dev: expose Context and ready event to extensions

This commit is contained in:
KernelDeimos
2025-04-23 15:51:28 -04:00
parent abf5852b93
commit 2b0c8fcaf0
2 changed files with 5 additions and 0 deletions

View File

@@ -82,6 +82,7 @@ const install = async ({ services, app, useapi, modapi }) => {
def('puter.middlewares.anticsrf', require('./middleware/anticsrf'));
def('core.APIError', require('./api/APIError'));
def('core.Context', Context);
def('core', require('./services/auth/Actor'), { assign: true });
def('core.config', config);

View File

@@ -61,6 +61,10 @@ class EventService extends BaseService {
this.listeners_ = {};
this.global_listeners_ = [];
}
async ['__on_boot.ready'] () {
this.emit('ready', {}, {});
}
async emit (key, data, meta) {
meta = meta ?? {};