@dereekb/firebase-server 12.3.13 → 12.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/mailgun/package.json +1 -1
- package/model/package.json +1 -1
- package/model/src/lib/notification/index.d.ts +1 -0
- package/model/src/lib/notification/index.js +1 -0
- package/model/src/lib/notification/index.js.map +1 -1
- package/model/src/lib/notification/notification.expedite.service.d.ts +91 -0
- package/model/src/lib/notification/notification.expedite.service.js +112 -0
- package/model/src/lib/notification/notification.expedite.service.js.map +1 -0
- package/model/src/lib/notification/notification.module.d.ts +19 -2
- package/model/src/lib/notification/notification.module.js +43 -6
- package/model/src/lib/notification/notification.module.js.map +1 -1
- package/package.json +1 -1
- package/test/package.json +1 -1
- package/test/src/lib/firebase/firebase.jest.js.map +1 -1
- package/zoho/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
# [12.4.0](https://github.com/dereekb/dbx-components/compare/v12.3.12-dev-dev...v12.4.0) (2025-08-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* added NotificationExpediteService ([bdfc0b3](https://github.com/dereekb/dbx-components/commit/bdfc0b35f11d3f60f0daa5fd4522f31da593f7d7))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
## [12.3.13](https://github.com/dereekb/dbx-components/compare/v12.3.12-dev...v12.3.13) (2025-08-22)
|
|
6
15
|
|
|
7
16
|
|
package/mailgun/package.json
CHANGED
package/model/package.json
CHANGED
|
@@ -10,4 +10,5 @@ export * from './notification.send';
|
|
|
10
10
|
export * from './notification.task.service';
|
|
11
11
|
export * from './notification.task.service.handler';
|
|
12
12
|
export * from './notification.error';
|
|
13
|
+
export * from './notification.expedite.service';
|
|
13
14
|
export * from './notification.util';
|
|
@@ -13,5 +13,6 @@ tslib_1.__exportStar(require("./notification.send"), exports);
|
|
|
13
13
|
tslib_1.__exportStar(require("./notification.task.service"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./notification.task.service.handler"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./notification.error"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./notification.expedite.service"), exports);
|
|
16
17
|
tslib_1.__exportStar(require("./notification.util"), exports);
|
|
17
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/model/src/lib/notification/index.ts"],"names":[],"mappings":";;;AAAA,uEAA6C;AAC7C,4EAAkD;AAClD,wEAA8C;AAC9C,gEAAsC;AACtC,gEAAsC;AACtC,0FAAgE;AAChE,2EAAiD;AACjD,sEAA4C;AAC5C,8DAAoC;AACpC,sEAA4C;AAC5C,8EAAoD;AACpD,+DAAqC;AACrC,8DAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/model/src/lib/notification/index.ts"],"names":[],"mappings":";;;AAAA,uEAA6C;AAC7C,4EAAkD;AAClD,wEAA8C;AAC9C,gEAAsC;AACtC,gEAAsC;AACtC,0FAAgE;AAChE,2EAAiD;AACjD,sEAA4C;AAC5C,8DAAoC;AACpC,sEAA4C;AAC5C,8EAAoD;AACpD,+DAAqC;AACrC,0EAAgD;AAChD,8DAAoC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { CreateNotificationDocumentPairResult, NotificationDocument, SendNotificationResult } from '@dereekb/firebase';
|
|
2
|
+
import { NotificationServerActions } from './notification.action.server';
|
|
3
|
+
import { Abstract, Provider } from '@nestjs/common';
|
|
4
|
+
/**
|
|
5
|
+
* Interface for a service that allows access to a NotificationServerActions instance and "expediting" the sending of notification(s) that should be emitted immediately for timeliness.
|
|
6
|
+
*
|
|
7
|
+
* @see MutableNotificationExpediteService is the default implementation.
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class NotificationExpediteService {
|
|
10
|
+
/**
|
|
11
|
+
* Returns the configured NotificationServerActions instance.
|
|
12
|
+
*/
|
|
13
|
+
abstract getNotificationServerActions(): NotificationServerActions;
|
|
14
|
+
/**
|
|
15
|
+
* Attempts to immediately send/run the input notification document.
|
|
16
|
+
*/
|
|
17
|
+
abstract sendNotification(notificationDocument: NotificationDocument): Promise<SendNotificationResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new NotificationExpediteServiceInstance.
|
|
20
|
+
*/
|
|
21
|
+
abstract expediteInstance(): NotificationExpediteServiceInstance;
|
|
22
|
+
}
|
|
23
|
+
export interface NotificationExpediteServiceInstance {
|
|
24
|
+
/**
|
|
25
|
+
* Resets/initializes the instance.
|
|
26
|
+
*/
|
|
27
|
+
initialize(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Enqueues the input notification document to be sent.
|
|
30
|
+
*
|
|
31
|
+
* @param notificationDocument
|
|
32
|
+
*/
|
|
33
|
+
enqueue(notificationDocument: NotificationDocument): void;
|
|
34
|
+
/**
|
|
35
|
+
* Enqueues the input CreateNotificationDocumentPairResult to be sent.
|
|
36
|
+
*
|
|
37
|
+
* @param createResult
|
|
38
|
+
* @returns true if the result was enqueued, false otherwise.
|
|
39
|
+
*/
|
|
40
|
+
enqueueCreateResult(createResult: CreateNotificationDocumentPairResult): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Attempts to send all the queued notifications.
|
|
43
|
+
*/
|
|
44
|
+
send(): Promise<SendNotificationResult[]>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Creates a new NotificationExpediteServiceInstance with the input NotificationExpediteService.
|
|
48
|
+
|
|
49
|
+
* @param notificationExpediteService
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
export declare function notificationExpediteServiceInstance(notificationExpediteService: NotificationExpediteService): NotificationExpediteServiceInstance;
|
|
53
|
+
/**
|
|
54
|
+
* Reference to a NotificationExpediteService.
|
|
55
|
+
*/
|
|
56
|
+
export interface NotificationExpediteServiceRef {
|
|
57
|
+
readonly notificationExpediteService: NotificationExpediteService;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Service used to "expedite" the sending of a specific notification.
|
|
61
|
+
*
|
|
62
|
+
* Because the NotificationActionService is typically created after other action services are due to the dependency injection graph, this service is
|
|
63
|
+
* created before the NotificationActionService is created, and then later updated by the NotificationActionService.
|
|
64
|
+
*
|
|
65
|
+
* It is best provided by provideMutableNotificationExpediteService() as a global provider.
|
|
66
|
+
*/
|
|
67
|
+
export declare class MutableNotificationExpediteService implements NotificationExpediteService {
|
|
68
|
+
private _notificationServerActions;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the configured NotificationServerActions instance.
|
|
71
|
+
*/
|
|
72
|
+
getNotificationServerActions(): NotificationServerActions;
|
|
73
|
+
/**
|
|
74
|
+
* Sets the NotificationServerActions instance to use.
|
|
75
|
+
*/
|
|
76
|
+
setNotificationServerActions(notificationServerActions: NotificationServerActions): void;
|
|
77
|
+
sendNotification(notificationDocument: NotificationDocument): Promise<SendNotificationResult>;
|
|
78
|
+
expediteInstance(): NotificationExpediteServiceInstance;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Provides an instance of MutableNotificationExpediteService and NotificationExpediteService.
|
|
82
|
+
*
|
|
83
|
+
* This should generally be used in the global module of an app.
|
|
84
|
+
*/
|
|
85
|
+
export declare function provideMutableNotificationExpediteService(): Provider[];
|
|
86
|
+
/**
|
|
87
|
+
* Convenience function that exports NotificationExpediteService and MutableNotificationExpediteService.
|
|
88
|
+
*
|
|
89
|
+
* This should generally be used in the global module of an app.
|
|
90
|
+
*/
|
|
91
|
+
export declare function exportMutableNotificationExpediteService(): Abstract<any>[];
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MutableNotificationExpediteService = exports.NotificationExpediteService = void 0;
|
|
4
|
+
exports.notificationExpediteServiceInstance = notificationExpediteServiceInstance;
|
|
5
|
+
exports.provideMutableNotificationExpediteService = provideMutableNotificationExpediteService;
|
|
6
|
+
exports.exportMutableNotificationExpediteService = exportMutableNotificationExpediteService;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
const firebase_1 = require("@dereekb/firebase");
|
|
9
|
+
const common_1 = require("@nestjs/common");
|
|
10
|
+
const util_1 = require("@dereekb/util");
|
|
11
|
+
/**
|
|
12
|
+
* Interface for a service that allows access to a NotificationServerActions instance and "expediting" the sending of notification(s) that should be emitted immediately for timeliness.
|
|
13
|
+
*
|
|
14
|
+
* @see MutableNotificationExpediteService is the default implementation.
|
|
15
|
+
*/
|
|
16
|
+
class NotificationExpediteService {
|
|
17
|
+
}
|
|
18
|
+
exports.NotificationExpediteService = NotificationExpediteService;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new NotificationExpediteServiceInstance with the input NotificationExpediteService.
|
|
21
|
+
|
|
22
|
+
* @param notificationExpediteService
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
function notificationExpediteServiceInstance(notificationExpediteService) {
|
|
26
|
+
let _documentsToSend = [];
|
|
27
|
+
const initialize = () => {
|
|
28
|
+
_documentsToSend = []; // resets the documents to send
|
|
29
|
+
};
|
|
30
|
+
const enqueue = (notificationDocument) => {
|
|
31
|
+
_documentsToSend.push(notificationDocument);
|
|
32
|
+
};
|
|
33
|
+
const enqueueCreateResult = (createResult) => {
|
|
34
|
+
let enqueued = false;
|
|
35
|
+
if (createResult.notificationDocument) {
|
|
36
|
+
enqueue(createResult.notificationDocument);
|
|
37
|
+
enqueued = true;
|
|
38
|
+
}
|
|
39
|
+
return enqueued;
|
|
40
|
+
};
|
|
41
|
+
const send = async () => {
|
|
42
|
+
const results = await (0, util_1.runAsyncTasksForValues)(_documentsToSend, (x) => notificationExpediteService.sendNotification(x), {
|
|
43
|
+
nonConcurrentTaskKeyFactory: (x) => x.parent.id // only send one notification at a time for a notification box
|
|
44
|
+
});
|
|
45
|
+
return results;
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
initialize,
|
|
49
|
+
enqueue,
|
|
50
|
+
enqueueCreateResult,
|
|
51
|
+
send
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// MARK: Implementation
|
|
55
|
+
/**
|
|
56
|
+
* Service used to "expedite" the sending of a specific notification.
|
|
57
|
+
*
|
|
58
|
+
* Because the NotificationActionService is typically created after other action services are due to the dependency injection graph, this service is
|
|
59
|
+
* created before the NotificationActionService is created, and then later updated by the NotificationActionService.
|
|
60
|
+
*
|
|
61
|
+
* It is best provided by provideMutableNotificationExpediteService() as a global provider.
|
|
62
|
+
*/
|
|
63
|
+
let MutableNotificationExpediteService = class MutableNotificationExpediteService {
|
|
64
|
+
_notificationServerActions;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the configured NotificationServerActions instance.
|
|
67
|
+
*/
|
|
68
|
+
getNotificationServerActions() {
|
|
69
|
+
return this._notificationServerActions;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Sets the NotificationServerActions instance to use.
|
|
73
|
+
*/
|
|
74
|
+
setNotificationServerActions(notificationServerActions) {
|
|
75
|
+
this._notificationServerActions = notificationServerActions;
|
|
76
|
+
}
|
|
77
|
+
async sendNotification(notificationDocument) {
|
|
78
|
+
const sendNotification = await this._notificationServerActions.sendNotification({ key: (0, firebase_1.firestoreDummyKey)() });
|
|
79
|
+
return sendNotification(notificationDocument);
|
|
80
|
+
}
|
|
81
|
+
expediteInstance() {
|
|
82
|
+
return notificationExpediteServiceInstance(this);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
exports.MutableNotificationExpediteService = MutableNotificationExpediteService;
|
|
86
|
+
exports.MutableNotificationExpediteService = MutableNotificationExpediteService = tslib_1.__decorate([
|
|
87
|
+
(0, common_1.Injectable)()
|
|
88
|
+
], MutableNotificationExpediteService);
|
|
89
|
+
// MARK: Providers
|
|
90
|
+
/**
|
|
91
|
+
* Provides an instance of MutableNotificationExpediteService and NotificationExpediteService.
|
|
92
|
+
*
|
|
93
|
+
* This should generally be used in the global module of an app.
|
|
94
|
+
*/
|
|
95
|
+
function provideMutableNotificationExpediteService() {
|
|
96
|
+
return [
|
|
97
|
+
MutableNotificationExpediteService,
|
|
98
|
+
{
|
|
99
|
+
provide: NotificationExpediteService,
|
|
100
|
+
useExisting: MutableNotificationExpediteService
|
|
101
|
+
}
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Convenience function that exports NotificationExpediteService and MutableNotificationExpediteService.
|
|
106
|
+
*
|
|
107
|
+
* This should generally be used in the global module of an app.
|
|
108
|
+
*/
|
|
109
|
+
function exportMutableNotificationExpediteService() {
|
|
110
|
+
return [NotificationExpediteService, MutableNotificationExpediteService];
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=notification.expedite.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.expedite.service.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/model/src/lib/notification/notification.expedite.service.ts"],"names":[],"mappings":";;;AA4DA,kFAoCC;AAoDD,8FAQC;AAOD,4FAEC;;AArKD,gDAA0I;AAE1I,2CAAgE;AAChE,wCAAuD;AAEvD;;;;GAIG;AACH,MAAsB,2BAA2B;CAehD;AAfD,kEAeC;AA6BD;;;;;GAKG;AACH,SAAgB,mCAAmC,CAAC,2BAAwD;IAC1G,IAAI,gBAAgB,GAA2B,EAAE,CAAC;IAElD,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,gBAAgB,GAAG,EAAE,CAAC,CAAC,+BAA+B;IACxD,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,CAAC,oBAA0C,EAAE,EAAE;QAC7D,gBAAgB,CAAC,IAAI,CAAC,oBAAoB,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IAED,gBAAgB;QACd,OAAO,mCAAmC,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;CACF,CAAA;AAzBY,gFAAkC;6CAAlC,kCAAkC;IAD9C,IAAA,mBAAU,GAAE;GACA,kCAAkC,CAyB9C;AAED,kBAAkB;AAClB;;;;GAIG;AACH,SAAgB,yCAAyC;IACvD,OAAO;QACL,kCAAkC;QAClC;YACE,OAAO,EAAE,2BAA2B;YACpC,WAAW,EAAE,kCAAkC;SAChD;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,wCAAwC;IACtD,OAAO,CAAC,2BAA2B,EAAE,kCAAkC,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -5,10 +5,12 @@ import { NotificationTemplateService } from './notification.config.service';
|
|
|
5
5
|
import { type Maybe } from '@dereekb/util';
|
|
6
6
|
import { NotificationSendService } from './notification.send.service';
|
|
7
7
|
import { NotificationTaskService } from './notification.task.service';
|
|
8
|
-
|
|
8
|
+
import { MutableNotificationExpediteService, NotificationExpediteService } from './notification.expedite.service';
|
|
9
|
+
export declare function notificationServerActionsContextFactory(context: BaseNotificationServerActionsContext, notificationTemplateService: NotificationTemplateService, notificationSendService: NotificationSendService, notificationTaskService: NotificationTaskService, notificationsExpediteService: NotificationExpediteService): {
|
|
9
10
|
notificationTemplateService: NotificationTemplateService;
|
|
10
11
|
notificationSendService: NotificationSendService;
|
|
11
12
|
notificationTaskService: NotificationTaskService;
|
|
13
|
+
notificationsExpediteService: NotificationExpediteService;
|
|
12
14
|
firebaseServerActionTransformFactory: import("dist/packages/model/src").TransformAndValidateObjectFactory;
|
|
13
15
|
firebaseServerActionTransformFunctionFactory: import("dist/packages/model/src").TransformAndValidateFunctionResultFactory;
|
|
14
16
|
notificationUserCollection: import("dist/packages/firebase/src").NotificationUserFirestoreCollection;
|
|
@@ -21,11 +23,12 @@ export declare function notificationServerActionsContextFactory(context: BaseNot
|
|
|
21
23
|
authService: import("dist/packages/firebase-server/src").FirebaseServerAuthService<import("dist/packages/firebase-server/src").FirebaseServerAuthUserContext, import("dist/packages/firebase-server/src").FirebaseServerAuthContext<import("dist/packages/firebase-server/src").FirebaseServerAuthUserContext>>;
|
|
22
24
|
firestoreContext: import("dist/packages/firebase/src").FirestoreContext<import("dist/packages/firebase/src").Firestore>;
|
|
23
25
|
};
|
|
24
|
-
export declare function notificationServerActionsFactory(context: NotificationServerActionsContext): NotificationServerActions;
|
|
26
|
+
export declare function notificationServerActionsFactory(context: NotificationServerActionsContext, mutableNotificationExpediteService: MutableNotificationExpediteService): NotificationServerActions;
|
|
25
27
|
export declare function notificationInitServerActionsFactory(context: NotificationServerActionsContext, notificationInitServerActionsContextConfig: NotificationInitServerActionsContextConfig): NotificationInitServerActions;
|
|
26
28
|
export interface ProvideAppNotificationMetadataConfig extends Pick<ModuleMetadata, 'imports' | 'exports' | 'providers'> {
|
|
27
29
|
/**
|
|
28
30
|
* The AppNotificationModule requires the following dependencies in order to initialze properly:
|
|
31
|
+
* - MutableNotificationExpediteService
|
|
29
32
|
* - NotificationSendService
|
|
30
33
|
* - NotificationTaskService
|
|
31
34
|
* - BaseNotificationServerActionsContext (BASE_NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN)
|
|
@@ -44,9 +47,23 @@ export interface ProvideAppNotificationMetadataConfig extends Pick<ModuleMetadat
|
|
|
44
47
|
* - NotificationTemplateService
|
|
45
48
|
* - NotificationServerActions
|
|
46
49
|
* - NotificationInitServerActions
|
|
50
|
+
* - NotificationExpediteService (MutableNotificationExpediteService is used as the existing, but it is not re-exported)
|
|
51
|
+
*
|
|
52
|
+
* Be sure the class that delares the module using this function also extends AbstractAppNotificationModule.
|
|
47
53
|
*
|
|
48
54
|
* @param provide
|
|
49
55
|
* @param useFactory
|
|
50
56
|
* @returns
|
|
51
57
|
*/
|
|
52
58
|
export declare function appNotificationModuleMetadata(config: ProvideAppNotificationMetadataConfig): ModuleMetadata;
|
|
59
|
+
/**
|
|
60
|
+
* Abstract module that should be extended when using appNotificationModuleMetadata.
|
|
61
|
+
*/
|
|
62
|
+
export declare abstract class AbstractAppNotificationModule {
|
|
63
|
+
constructor(mutableNotificationExpediteService: MutableNotificationExpediteService, actions: NotificationServerActions);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Pre-configured global provider for MutableNotificationExpediteService/NotificationExpediteService.
|
|
67
|
+
*/
|
|
68
|
+
export declare class GlobalNotificationModule {
|
|
69
|
+
}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GlobalNotificationModule = exports.AbstractAppNotificationModule = void 0;
|
|
3
4
|
exports.notificationServerActionsContextFactory = notificationServerActionsContextFactory;
|
|
4
5
|
exports.notificationServerActionsFactory = notificationServerActionsFactory;
|
|
5
6
|
exports.notificationInitServerActionsFactory = notificationInitServerActionsFactory;
|
|
6
7
|
exports.appNotificationModuleMetadata = appNotificationModuleMetadata;
|
|
8
|
+
const tslib_1 = require("tslib");
|
|
9
|
+
const common_1 = require("@nestjs/common");
|
|
7
10
|
const notification_action_init_server_1 = require("./notification.action.init.server");
|
|
8
11
|
const notification_action_server_1 = require("./notification.action.server");
|
|
9
12
|
const notification_config_service_1 = require("./notification.config.service");
|
|
10
13
|
const config_1 = require("@nestjs/config");
|
|
11
14
|
const notification_send_service_1 = require("./notification.send.service");
|
|
12
15
|
const notification_task_service_1 = require("./notification.task.service");
|
|
16
|
+
const notification_expedite_service_1 = require("./notification.expedite.service");
|
|
13
17
|
// MARK: Provider Factories
|
|
14
|
-
function notificationServerActionsContextFactory(context, notificationTemplateService, notificationSendService, notificationTaskService) {
|
|
15
|
-
return { ...context, notificationTemplateService, notificationSendService, notificationTaskService };
|
|
18
|
+
function notificationServerActionsContextFactory(context, notificationTemplateService, notificationSendService, notificationTaskService, notificationsExpediteService) {
|
|
19
|
+
return { ...context, notificationTemplateService, notificationSendService, notificationTaskService, notificationsExpediteService };
|
|
16
20
|
}
|
|
17
|
-
function notificationServerActionsFactory(context) {
|
|
21
|
+
function notificationServerActionsFactory(context, mutableNotificationExpediteService) {
|
|
18
22
|
return (0, notification_action_server_1.notificationServerActions)(context);
|
|
19
23
|
}
|
|
20
24
|
function notificationInitServerActionsFactory(context, notificationInitServerActionsContextConfig) {
|
|
@@ -31,6 +35,9 @@ function notificationInitServerActionsFactory(context, notificationInitServerAct
|
|
|
31
35
|
* - NotificationTemplateService
|
|
32
36
|
* - NotificationServerActions
|
|
33
37
|
* - NotificationInitServerActions
|
|
38
|
+
* - NotificationExpediteService (MutableNotificationExpediteService is used as the existing, but it is not re-exported)
|
|
39
|
+
*
|
|
40
|
+
* Be sure the class that delares the module using this function also extends AbstractAppNotificationModule.
|
|
34
41
|
*
|
|
35
42
|
* @param provide
|
|
36
43
|
* @param useFactory
|
|
@@ -41,12 +48,16 @@ function appNotificationModuleMetadata(config) {
|
|
|
41
48
|
const dependencyModuleImport = dependencyModule ? [dependencyModule] : [];
|
|
42
49
|
return {
|
|
43
50
|
imports: [config_1.ConfigModule, ...dependencyModuleImport, ...(imports ?? [])],
|
|
44
|
-
exports: [notification_action_server_1.NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, notification_config_service_1.NotificationTemplateService, notification_action_server_1.NotificationServerActions, notification_action_init_server_1.NotificationInitServerActions, ...(exports ?? [])],
|
|
51
|
+
exports: [notification_action_server_1.NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, notification_expedite_service_1.NotificationExpediteService, notification_config_service_1.NotificationTemplateService, notification_action_server_1.NotificationServerActions, notification_action_init_server_1.NotificationInitServerActions, ...(exports ?? [])],
|
|
45
52
|
providers: [
|
|
53
|
+
{
|
|
54
|
+
provide: notification_expedite_service_1.NotificationExpediteService,
|
|
55
|
+
useExisting: notification_expedite_service_1.MutableNotificationExpediteService
|
|
56
|
+
},
|
|
46
57
|
{
|
|
47
58
|
provide: notification_action_server_1.NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN,
|
|
48
59
|
useFactory: notificationServerActionsContextFactory,
|
|
49
|
-
inject: [notification_action_server_1.BASE_NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, notification_config_service_1.NotificationTemplateService, notification_send_service_1.NotificationSendService, notification_task_service_1.NotificationTaskService]
|
|
60
|
+
inject: [notification_action_server_1.BASE_NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, notification_config_service_1.NotificationTemplateService, notification_send_service_1.NotificationSendService, notification_task_service_1.NotificationTaskService, notification_expedite_service_1.NotificationExpediteService]
|
|
50
61
|
},
|
|
51
62
|
{
|
|
52
63
|
provide: notification_config_service_1.NotificationTemplateService,
|
|
@@ -55,7 +66,7 @@ function appNotificationModuleMetadata(config) {
|
|
|
55
66
|
{
|
|
56
67
|
provide: notification_action_server_1.NotificationServerActions,
|
|
57
68
|
useFactory: notificationServerActionsFactory,
|
|
58
|
-
inject: [notification_action_server_1.NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN]
|
|
69
|
+
inject: [notification_action_server_1.NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, notification_expedite_service_1.NotificationExpediteService]
|
|
59
70
|
},
|
|
60
71
|
{
|
|
61
72
|
provide: notification_action_init_server_1.NotificationInitServerActions,
|
|
@@ -66,4 +77,30 @@ function appNotificationModuleMetadata(config) {
|
|
|
66
77
|
]
|
|
67
78
|
};
|
|
68
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Abstract module that should be extended when using appNotificationModuleMetadata.
|
|
82
|
+
*/
|
|
83
|
+
let AbstractAppNotificationModule = class AbstractAppNotificationModule {
|
|
84
|
+
constructor(mutableNotificationExpediteService, actions) {
|
|
85
|
+
mutableNotificationExpediteService.setNotificationServerActions(actions);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
exports.AbstractAppNotificationModule = AbstractAppNotificationModule;
|
|
89
|
+
exports.AbstractAppNotificationModule = AbstractAppNotificationModule = tslib_1.__decorate([
|
|
90
|
+
(0, common_1.Module)({}),
|
|
91
|
+
tslib_1.__metadata("design:paramtypes", [notification_expedite_service_1.MutableNotificationExpediteService, notification_action_server_1.NotificationServerActions])
|
|
92
|
+
], AbstractAppNotificationModule);
|
|
93
|
+
/**
|
|
94
|
+
* Pre-configured global provider for MutableNotificationExpediteService/NotificationExpediteService.
|
|
95
|
+
*/
|
|
96
|
+
let GlobalNotificationModule = class GlobalNotificationModule {
|
|
97
|
+
};
|
|
98
|
+
exports.GlobalNotificationModule = GlobalNotificationModule;
|
|
99
|
+
exports.GlobalNotificationModule = GlobalNotificationModule = tslib_1.__decorate([
|
|
100
|
+
(0, common_1.Global)(),
|
|
101
|
+
(0, common_1.Module)({
|
|
102
|
+
providers: (0, notification_expedite_service_1.provideMutableNotificationExpediteService)(),
|
|
103
|
+
exports: (0, notification_expedite_service_1.exportMutableNotificationExpediteService)()
|
|
104
|
+
})
|
|
105
|
+
], GlobalNotificationModule);
|
|
69
106
|
//# sourceMappingURL=notification.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.module.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/model/src/lib/notification/notification.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notification.module.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/model/src/lib/notification/notification.module.ts"],"names":[],"mappings":";;;AAWA,0FAEC;AAED,4EAEC;AAED,oFAKC;AAkCD,sEAkCC;;AA5FD,2CAAqE;AACrE,uFAAyN;AACzN,6EAA+Q;AAC/Q,+EAA4E;AAE5E,2CAA8C;AAC9C,2EAAsE;AACtE,2EAAsE;AACtE,mFAAuM;AAEvM,2BAA2B;AAC3B,SAAgB,uCAAuC,CAAC,OAA6C,EAAE,2BAAwD,EAAE,uBAAgD,EAAE,uBAAgD,EAAE,4BAAyD;IAC5T,OAAO,EAAE,GAAG,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,CAAC;AACr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A6B;gBACtC,UAAU,EAAE,oCAAoC;gBAChD,MAAM,EAAE,CAAC,qEAAwC,EAAE,uFAAqD,CAAC;aAC1G;YACD,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;SACrB;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AAEI,IAAe,6BAA6B,GAA5C,MAAe,6BAA6B;IACjD,YAAY,kCAAsE,EAAE,OAAkC;QACpH,kCAAkC,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAC3E,CAAC;CACF,CAAA;AAJqB,sEAA6B;wCAA7B,6BAA6B;IADlD,IAAA,eAAM,EAAC,EAAE,CAAC;6CAEuC,kEAAkC,EAAW,sDAAyB;GADlG,6BAA6B,CAIlD;AAED;;GAEG;AAMI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;CAAG,CAAA;AAA3B,4DAAwB;mCAAxB,wBAAwB;IALpC,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,IAAA,yEAAyC,GAAE;QACtD,OAAO,EAAE,IAAA,wEAAwC,GAAE;KACpD,CAAC;GACW,wBAAwB,CAAG"}
|
package/package.json
CHANGED
package/test/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firebase.jest.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/test/src/lib/firebase/firebase.jest.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"firebase.jest.js","sourceRoot":"","sources":["../../../../../../../packages/firebase-server/test/src/lib/firebase/firebase.jest.ts"],"names":[],"mappings":";;;AA2BA,oGAcC;AAxCD,6CAA2G;AAC3G,uDAAyD;AACzD,2CAAuC;AAEvC;;GAEG;AACH,MAAa,gDAAiD,SAAQ,sBAAS;IAElE;IACA;IAFX,YACW,SAAqB,EACrB,iBAAyB;QAElC,MAAM,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,OAAsB,CAAC;QAClD,KAAK,CAAC,6CAA6C,iBAAiB,oBAAoB,IAAI,YAAY,CAAC,CAAC;QAJjG,cAAS,GAAT,SAAS,CAAY;QACrB,sBAAiB,GAAjB,iBAAiB,CAAQ;IAIpC,CAAC;CACF;AARD,4GAQC;AAED;;;;;;;;GAQG;AACH,SAAgB,4CAA4C,CAAC,YAAoB;IAC/E,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,KAAK,YAAY,kBAAU,EAAE,CAAC;YAChC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,OAAsB,CAAC;YAE9C,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;gBAC1B,MAAM,IAAI,gDAAgD,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;YAClF,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,2CAAoC,CAAC,KAAK,EAAE,kBAA2B,CAAC,CAAC;QACrF,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
|