mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Move Notifier to /ext
Summary: This makes it possible to configure a SendGrid-based Notifier instance via a JSON configuration file. Test Plan: Tested manually. Reviewers: alexmojaki Reviewed By: alexmojaki Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3432
This commit is contained in:
@@ -46,10 +46,15 @@ export interface ICreateStorageOptions {
|
||||
create(purpose: 'doc'|'meta', extraPrefix: string): ExternalStorage|undefined;
|
||||
}
|
||||
|
||||
export interface ICreateNotifierOptions {
|
||||
create(dbManager: HomeDBManager, gristConfig: GristServer): INotifier|undefined;
|
||||
}
|
||||
|
||||
export function makeSimpleCreator(opts: {
|
||||
sessionSecret?: string,
|
||||
storage?: ICreateStorageOptions[],
|
||||
activationMiddleware?: (db: HomeDBManager, app: express.Express) => Promise<void>,
|
||||
notifier?: ICreateNotifierOptions,
|
||||
}): ICreate {
|
||||
return {
|
||||
Billing(db) {
|
||||
@@ -63,8 +68,9 @@ export function makeSimpleCreator(opts: {
|
||||
}
|
||||
};
|
||||
},
|
||||
Notifier() {
|
||||
return {
|
||||
Notifier(dbManager, gristConfig) {
|
||||
const {notifier} = opts;
|
||||
return notifier?.create(dbManager, gristConfig) ?? {
|
||||
get testPending() { return false; },
|
||||
deleteUser() { throw new Error('deleteUser unavailable'); },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user