move: BroadcastService to [+] BroadcastModule

This commit is contained in:
KernelDeimos 2024-08-05 16:59:21 -04:00 committed by Eric Dubé
parent cea29645fe
commit c213b21bee
5 changed files with 19 additions and 6 deletions

View File

@ -27,6 +27,7 @@ const BaseService = require("./src/services/BaseService.js");
const { Context } = require("./src/util/context.js");
const { TestDriversModule } = require("./src/modules/test-drivers/TestDriversModule.js");
const { PuterAIModule } = require("./src/modules/puterai/PuterAIModule.js");
const { BroadcastModule } = require("./src/modules/broadcast/BroadcastModule.js");
module.exports = {
@ -50,4 +51,5 @@ module.exports = {
SelfHostedModule,
TestDriversModule,
PuterAIModule,
BroadcastModule,
};

View File

@ -279,9 +279,6 @@ const install = async ({ services, app, useapi }) => {
const { ScriptService } = require('./services/ScriptService');
services.registerService('script', ScriptService);
const { BroadcastService } = require('./services/BroadcastService');
services.registerService('broadcast', BroadcastService);
const { NotificationService } = require('./services/NotificationService');
services.registerService('notification', NotificationService);

View File

@ -0,0 +1,14 @@
const { AdvancedBase } = require("@heyputer/puter-js-common");
class BroadcastModule extends AdvancedBase {
async install (context) {
const services = context.get('services');
const { BroadcastService } = require('./BroadcastService');
services.registerService('broadcast', BroadcastService);
}
}
module.exports = {
BroadcastModule,
};

View File

@ -17,9 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { AdvancedBase } = require("@heyputer/puter-js-common");
const { Endpoint } = require("../util/expressutil");
const { UserActorType } = require("./auth/Actor");
const BaseService = require("./BaseService");
const BaseService = require("../../services/BaseService");
class KeyPairHelper extends AdvancedBase {
static MODULES = {

View File

@ -84,6 +84,7 @@ const main = async () => {
DatabaseModule,
LocalDiskStorageModule,
SelfHostedModule,
BroadcastModule,
TestDriversModule,
PuterAIModule,
} = (await import('@heyputer/backend')).default;
@ -95,6 +96,7 @@ const main = async () => {
k.add_module(new DatabaseModule());
k.add_module(new LocalDiskStorageModule());
k.add_module(new SelfHostedModule());
k.add_module(new BroadcastModule());
k.add_module(new TestDriversModule());
// k.add_module(new PuterAIModule());
k.boot();