@dereekb/firebase-server 11.0.21 → 11.1.1
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 +13 -0
- package/mailgun/package.json +1 -1
- package/model/package.json +6 -0
- package/model/src/index.d.ts +1 -0
- package/model/src/index.js +5 -0
- package/model/src/index.js.map +1 -0
- package/model/src/lib/index.d.ts +2 -0
- package/model/src/lib/index.js +6 -0
- package/model/src/lib/index.js.map +1 -0
- package/model/src/lib/mailgun/index.d.ts +1 -0
- package/model/src/lib/mailgun/index.js +5 -0
- package/model/src/lib/mailgun/index.js.map +1 -0
- package/model/src/lib/mailgun/notification.send.service.mailgun.d.ts +51 -0
- package/model/src/lib/mailgun/notification.send.service.mailgun.js +67 -0
- package/model/src/lib/mailgun/notification.send.service.mailgun.js.map +1 -0
- package/model/src/lib/notification/index.d.ts +11 -0
- package/model/src/lib/notification/index.js +15 -0
- package/model/src/lib/notification/index.js.map +1 -0
- package/model/src/lib/notification/notification.action.init.server.d.ts +72 -0
- package/model/src/lib/notification/notification.action.init.server.js +228 -0
- package/model/src/lib/notification/notification.action.init.server.js.map +1 -0
- package/model/src/lib/notification/notification.action.server.d.ts +70 -0
- package/model/src/lib/notification/notification.action.server.js +1049 -0
- package/model/src/lib/notification/notification.action.server.js.map +1 -0
- package/model/src/lib/notification/notification.config.d.ts +31 -0
- package/model/src/lib/notification/notification.config.js +13 -0
- package/model/src/lib/notification/notification.config.js.map +1 -0
- package/model/src/lib/notification/notification.config.service.d.ts +49 -0
- package/model/src/lib/notification/notification.config.service.js +59 -0
- package/model/src/lib/notification/notification.config.service.js.map +1 -0
- package/model/src/lib/notification/notification.error.d.ts +9 -0
- package/model/src/lib/notification/notification.error.js +74 -0
- package/model/src/lib/notification/notification.error.js.map +1 -0
- package/model/src/lib/notification/notification.module.d.ts +49 -0
- package/model/src/lib/notification/notification.module.js +69 -0
- package/model/src/lib/notification/notification.module.js.map +1 -0
- package/model/src/lib/notification/notification.send.d.ts +4 -0
- package/model/src/lib/notification/notification.send.js +3 -0
- package/model/src/lib/notification/notification.send.js.map +1 -0
- package/model/src/lib/notification/notification.send.service.d.ts +65 -0
- package/model/src/lib/notification/notification.send.service.js +10 -0
- package/model/src/lib/notification/notification.send.service.js.map +1 -0
- package/model/src/lib/notification/notification.send.service.notificationsummary.d.ts +18 -0
- package/model/src/lib/notification/notification.send.service.notificationsummary.js +105 -0
- package/model/src/lib/notification/notification.send.service.notificationsummary.js.map +1 -0
- package/model/src/lib/notification/notification.send.service.text.d.ts +9 -0
- package/model/src/lib/notification/notification.send.service.text.js +30 -0
- package/model/src/lib/notification/notification.send.service.text.js.map +1 -0
- package/model/src/lib/notification/notification.util.d.ts +128 -0
- package/model/src/lib/notification/notification.util.js +465 -0
- package/model/src/lib/notification/notification.util.js.map +1 -0
- package/package.json +7 -1
- package/test/package.json +1 -1
- package/zoho/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type AsyncNotificationSummaryCreateAction, type AsyncNotificationUserCreateAction, type AsyncNotificationUserUpdateAction, CleanupSentNotificationsParams, CreateNotificationBoxParams, CreateNotificationSummaryParams, CreateNotificationUserParams, type NotificationSummaryDocument, type NotificationUserDocument, SendNotificationParams, SendQueuedNotificationsParams, UpdateNotificationBoxParams, UpdateNotificationBoxRecipientParams, UpdateNotificationUserParams, type AsyncNotificationBoxCreateAction, type AsyncNotificationBoxUpdateAction, type CleanupSentNotificationsResult, type FirestoreContextReference, type FirestoreModelKey, type NotificationBox, type NotificationBoxDocument, type NotificationDocument, type NotificationFirestoreCollections, type SendNotificationResult, type SendQueuedNotificationsResult, type Transaction, type ResyncAllNotificationUserParams, type ResyncAllNotificationUsersResult, type ResyncNotificationUserResult, ResyncNotificationUserParams, type AppNotificationTemplateTypeInfoRecordServiceRef, type AsyncNotificationSummaryUpdateAction, UpdateNotificationSummaryParams } from '@dereekb/firebase';
|
|
2
|
+
import { type FirebaseServerActionsContext, type FirebaseServerAuthServiceRef } from '@dereekb/firebase-server';
|
|
3
|
+
import { type TransformAndValidateFunctionResult } from '@dereekb/model';
|
|
4
|
+
import { type InjectionToken } from '@nestjs/common';
|
|
5
|
+
import { type NotificationTemplateServiceRef } from './notification.config.service';
|
|
6
|
+
import { type NotificationSendServiceRef } from './notification.send.service';
|
|
7
|
+
/**
|
|
8
|
+
* Injection token for the BaseNotificationServerActionsContext
|
|
9
|
+
*/
|
|
10
|
+
export declare const BASE_NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN: InjectionToken;
|
|
11
|
+
/**
|
|
12
|
+
* Injection token for the NotificationServerActionsContext
|
|
13
|
+
*/
|
|
14
|
+
export declare const NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN: InjectionToken;
|
|
15
|
+
export interface BaseNotificationServerActionsContext extends FirebaseServerActionsContext, NotificationFirestoreCollections, FirebaseServerAuthServiceRef, FirestoreContextReference {
|
|
16
|
+
}
|
|
17
|
+
export interface NotificationServerActionsContext extends FirebaseServerActionsContext, NotificationFirestoreCollections, AppNotificationTemplateTypeInfoRecordServiceRef, FirebaseServerAuthServiceRef, NotificationTemplateServiceRef, NotificationSendServiceRef, FirestoreContextReference {
|
|
18
|
+
}
|
|
19
|
+
export declare abstract class NotificationServerActions {
|
|
20
|
+
abstract createNotificationUser(params: CreateNotificationUserParams): AsyncNotificationUserCreateAction<CreateNotificationUserParams>;
|
|
21
|
+
abstract updateNotificationUser(params: UpdateNotificationUserParams): AsyncNotificationUserUpdateAction<UpdateNotificationUserParams>;
|
|
22
|
+
abstract resyncNotificationUser(params: ResyncNotificationUserParams): Promise<TransformAndValidateFunctionResult<ResyncNotificationUserParams, (notificationUserDocument: NotificationUserDocument) => Promise<ResyncNotificationUserResult>>>;
|
|
23
|
+
abstract resyncAllNotificationUsers(params?: ResyncAllNotificationUserParams): Promise<ResyncAllNotificationUsersResult>;
|
|
24
|
+
abstract createNotificationSummary(params: CreateNotificationSummaryParams): AsyncNotificationSummaryCreateAction<CreateNotificationSummaryParams>;
|
|
25
|
+
abstract updateNotificationSummary(params: UpdateNotificationSummaryParams): AsyncNotificationSummaryUpdateAction<UpdateNotificationSummaryParams>;
|
|
26
|
+
abstract createNotificationBox(params: CreateNotificationBoxParams): AsyncNotificationBoxCreateAction<CreateNotificationBoxParams>;
|
|
27
|
+
abstract updateNotificationBox(params: UpdateNotificationBoxParams): AsyncNotificationBoxUpdateAction<UpdateNotificationBoxParams>;
|
|
28
|
+
abstract updateNotificationBoxRecipient(params: UpdateNotificationBoxRecipientParams): AsyncNotificationBoxUpdateAction<UpdateNotificationBoxRecipientParams>;
|
|
29
|
+
abstract sendNotification(params: SendNotificationParams): Promise<TransformAndValidateFunctionResult<SendNotificationParams, (notificationDocument: NotificationDocument) => Promise<SendNotificationResult>>>;
|
|
30
|
+
abstract sendQueuedNotifications(params: SendQueuedNotificationsParams): Promise<TransformAndValidateFunctionResult<SendQueuedNotificationsParams, () => Promise<SendQueuedNotificationsResult>>>;
|
|
31
|
+
abstract cleanupSentNotifications(params: CleanupSentNotificationsParams): Promise<TransformAndValidateFunctionResult<CleanupSentNotificationsParams, () => Promise<CleanupSentNotificationsResult>>>;
|
|
32
|
+
}
|
|
33
|
+
export declare function notificationServerActions(context: NotificationServerActionsContext): NotificationServerActions;
|
|
34
|
+
export declare function createNotificationUserFactory(context: NotificationServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<CreateNotificationUserParams, () => Promise<NotificationUserDocument>, object, unknown>;
|
|
35
|
+
export declare function updateNotificationUserFactory(context: NotificationServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<UpdateNotificationUserParams, (notificationUserDocument: NotificationUserDocument) => Promise<NotificationUserDocument>, object, unknown>;
|
|
36
|
+
export declare function resyncNotificationUserFactory(context: NotificationServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<ResyncNotificationUserParams, (notificationUserDocument: NotificationUserDocument) => Promise<ResyncNotificationUserResult>, object, unknown>;
|
|
37
|
+
export declare function resyncAllNotificationUsersFactory(context: NotificationServerActionsContext): (params?: ResyncAllNotificationUserParams) => Promise<ResyncAllNotificationUsersResult>;
|
|
38
|
+
export declare function createNotificationSummaryFactory(context: NotificationServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<CreateNotificationSummaryParams, () => Promise<NotificationSummaryDocument>, object, unknown>;
|
|
39
|
+
export declare function updateNotificationSummaryFactory(context: NotificationServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<UpdateNotificationSummaryParams, (notificationSummaryDocument: NotificationSummaryDocument) => Promise<NotificationSummaryDocument>, object, unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* Used for creating a new NotificationBox within a transaction.
|
|
42
|
+
*
|
|
43
|
+
* Used for new models.
|
|
44
|
+
*/
|
|
45
|
+
export interface CreateNotificationBoxInTransactionParams {
|
|
46
|
+
/**
|
|
47
|
+
* Now date to use.
|
|
48
|
+
*/
|
|
49
|
+
now?: Date;
|
|
50
|
+
/**
|
|
51
|
+
* Model to create the box for.
|
|
52
|
+
*/
|
|
53
|
+
model: FirestoreModelKey;
|
|
54
|
+
}
|
|
55
|
+
export declare function createNotificationBoxInTransactionFactory(context: NotificationServerActionsContext): (params: CreateNotificationBoxInTransactionParams, transaction: Transaction) => Promise<{
|
|
56
|
+
notificationBoxTemplate: NotificationBox;
|
|
57
|
+
notificationBoxDocument: NotificationBoxDocument;
|
|
58
|
+
}>;
|
|
59
|
+
export declare function createNotificationBoxFactory(context: NotificationServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<CreateNotificationBoxParams, () => Promise<NotificationBoxDocument>, object, unknown>;
|
|
60
|
+
export declare function updateNotificationBoxFactory({ firebaseServerActionTransformFunctionFactory }: NotificationServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<UpdateNotificationBoxParams, (notificationBoxDocument: NotificationBoxDocument) => Promise<NotificationBoxDocument>, object, unknown>;
|
|
61
|
+
export declare function updateNotificationBoxRecipientFactory({ firestoreContext, authService, notificationBoxCollection, notificationUserCollection, firebaseServerActionTransformFunctionFactory }: NotificationServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<UpdateNotificationBoxRecipientParams, (notificationBoxDocument: NotificationBoxDocument) => Promise<NotificationBoxDocument>, object, unknown>;
|
|
62
|
+
export declare const UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY = 8;
|
|
63
|
+
export declare const UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS = 1;
|
|
64
|
+
export declare const KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY = 8;
|
|
65
|
+
export declare const KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS = 5;
|
|
66
|
+
export declare const NOTIFICATION_MAX_SEND_ATTEMPTS = 5;
|
|
67
|
+
export declare const NOTIFICATION_BOX_NOT_INITIALIZED_DELAY_MINUTES = 8;
|
|
68
|
+
export declare function sendNotificationFactory(context: NotificationServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<SendNotificationParams, (notificationDocument: NotificationDocument) => Promise<SendNotificationResult>, object, unknown>;
|
|
69
|
+
export declare function sendQueuedNotificationsFactory(context: NotificationServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<SendQueuedNotificationsParams, () => Promise<SendQueuedNotificationsResult>, object, unknown>;
|
|
70
|
+
export declare function cleanupSentNotificationsFactory(context: NotificationServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<CleanupSentNotificationsParams, () => Promise<CleanupSentNotificationsResult>, object, unknown>;
|