mirror of
https://github.com/HeyPuter/puter.git
synced 2026-02-19 21:21:23 -06:00
dev: expose Context and ready event to extensions
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 ?? {};
|
||||
|
||||
Reference in New Issue
Block a user