90dc-core 1.15.9 → 1.16.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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/clients/FirebasePushNotificationClient.d.ts +126 -0
- package/dist/lib/clients/FirebasePushNotificationClient.d.ts.map +1 -0
- package/dist/lib/clients/FirebasePushNotificationClient.js +646 -0
- package/dist/lib/clients/FirebasePushNotificationClient.js.map +1 -0
- package/dist/lib/clients/PushNotificationClient.d.ts.map +1 -1
- package/dist/lib/clients/PushNotificationClient.js +12 -1
- package/dist/lib/clients/PushNotificationClient.js.map +1 -1
- package/dist/lib/config/ConfigValidator.d.ts +9 -9
- package/dist/lib/config/ConfigValidator.d.ts.map +1 -1
- package/dist/lib/config/ConfigValidator.js +11 -10
- package/dist/lib/config/ConfigValidator.js.map +1 -1
- package/dist/lib/dbmodels/program/CoachExerciseNote.d.ts +1 -1
- package/dist/lib/dbmodels/program/CoachExerciseNote.d.ts.map +1 -1
- package/dist/lib/dbmodels/program/CoachExerciseNote.js +1 -1
- package/dist/lib/dbmodels/program/CoachExerciseNote.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./lib/models/NotificationInterfaces.js";
|
|
|
6
6
|
export * from "./lib/dbmodels/index.js";
|
|
7
7
|
export { EmailClient } from "./lib/clients/EmailClient.js";
|
|
8
8
|
export { PushNotificationClient } from "./lib/clients/PushNotificationClient.js";
|
|
9
|
+
export { FirebasePushNotificationClient } from "./lib/clients/FirebasePushNotificationClient.js";
|
|
9
10
|
export type { SendTemplateEmailRequest, BatchTemplateEmailRequest, EmailResponse, } from "./lib/clients/EmailClient.js";
|
|
10
11
|
export type { NotificationPayload } from "./lib/clients/PushNotificationClient.js";
|
|
11
12
|
export { AuthenticationUtil } from "./lib/utils/AuthenticationUtil.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AAGvD,cAAc,yBAAyB,CAAA;AAGvC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAChF,YAAY,EACV,wBAAwB,EACxB,yBAAyB,EACzB,aAAa,GACd,MAAM,8BAA8B,CAAA;AACrC,YAAY,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAGlF,OAAO,EAAC,kBAAkB,EAAC,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAA;AAClE,OAAO,EAAC,kBAAkB,EAAC,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAC,GAAG,EAAC,MAAM,uBAAuB,CAAA;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,aAAa,GACnB,MAAM,2BAA2B,CAAA;AAGlC,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,0BAA0B,EAC1B,YAAY,EACZ,aAAa,EACb,UAAU,EACV,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,qBAAqB,GAC3B,MAAM,8BAA8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WAAW,EAAC,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAC,cAAc,EAAE,KAAK,cAAc,EAAC,MAAM,2BAA2B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./lib/dbmodels/index.js";
|
|
|
9
9
|
//Clients
|
|
10
10
|
export { EmailClient } from "./lib/clients/EmailClient.js";
|
|
11
11
|
export { PushNotificationClient } from "./lib/clients/PushNotificationClient.js";
|
|
12
|
+
export { FirebasePushNotificationClient } from "./lib/clients/FirebasePushNotificationClient.js";
|
|
12
13
|
//Utils
|
|
13
14
|
export { AuthenticationUtil } from "./lib/utils/AuthenticationUtil.js";
|
|
14
15
|
export { NotificationsUtil } from "./lib/utils/NotificationsUtil.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["//Interfaces\nexport * from \"./lib/models/ProgramInterfaces.js\";\nexport * from \"./lib/models/ExerciseInterfaces.js\";\nexport * from \"./lib/models/WorkoutInterfaces.js\";\nexport * from \"./lib/models/UserInterfaces.js\";\nexport * from \"./lib/models/NotificationInterfaces.js\";\n\n//DB Models - Export all models and model arrays\nexport * from \"./lib/dbmodels/index.js\"\n\n//Clients\nexport { EmailClient } from \"./lib/clients/EmailClient.js\"\nexport { PushNotificationClient } from \"./lib/clients/PushNotificationClient.js\"\nexport type {\n SendTemplateEmailRequest,\n BatchTemplateEmailRequest,\n EmailResponse,\n} from \"./lib/clients/EmailClient.js\"\nexport type { NotificationPayload } from \"./lib/clients/PushNotificationClient.js\"\n\n//Utils\nexport {AuthenticationUtil} from \"./lib/utils/AuthenticationUtil.js\"\nexport {NotificationsUtil} from \"./lib/utils/NotificationsUtil.js\"\nexport {NotificationClient} from \"./lib/utils/NotificationClient.js\"\nexport {Log} from \"./lib/utils/Logger.js\"\nexport {SecretManager} from \"./lib/utils/SecretManager.js\"\nexport {\n initializeSentry,\n isSentryEnabled,\n scrubObject,\n captureRequestBody,\n extractUserContext,\n buildRequestContext,\n buildResponseContext,\n reportErrorToSentry,\n reportMessageToSentry,\n type ErrorReportOptions,\n type SeverityLevel,\n} from \"./lib/utils/SentryUtil.js\"\n\n//Testing Utilities\nexport {\n createMockContext,\n createMockUser,\n createAuthenticatedContext,\n mockDatabase,\n flushPromises,\n assertions,\n executeRoute,\n type BaseContext,\n type AuthenticatedContext,\n type RouterContext,\n type RouterMiddleware,\n type RouterLayer,\n type RouterLike,\n type SequelizeModelMethods,\n} from \"./lib/testing/testHelpers.js\"\n\n//Config\nexport {\n ConfigValidator,\n BaseConfigSchema,\n CommonSchemas,\n createConfig,\n ConfigurationError,\n type BaseConfig\n} from \"./lib/config/ConfigValidator.js\"\n\n//Errors\nexport {\n AppError,\n ValidationError,\n AuthenticationError,\n ForbiddenError,\n NotFoundError,\n ConflictError,\n UnprocessableEntityError,\n RateLimitError,\n InternalServerError,\n ServiceUnavailableError,\n DatabaseError,\n ExternalAPIError,\n isAppError,\n isOperationalError,\n toAppError\n} from \"./lib/Errors/AppError.js\"\n\n//Middlewares\nexport {\n ErrorMiddleware,\n} from \"./lib/middlewares/ErrorMiddleware.js\"\nexport { validate, type ValidationConfig } from \"./lib/middlewares/ValidationMiddleware.js\";\n\n//Controllers\nexport { BaseController, type RouteConfig } from \"./lib/controllers/BaseController.js\";\n\n\nexport {RedisClient} from \"./lib/classes/Redis.js\"\nexport {DatabaseClient, type DatabaseConfig} from \"./lib/classes/Database.js\""],"names":["EmailClient","PushNotificationClient","AuthenticationUtil","NotificationsUtil","NotificationClient","Log","SecretManager","initializeSentry","isSentryEnabled","scrubObject","captureRequestBody","extractUserContext","buildRequestContext","buildResponseContext","reportErrorToSentry","reportMessageToSentry","createMockContext","createMockUser","createAuthenticatedContext","mockDatabase","flushPromises","assertions","executeRoute","ConfigValidator","BaseConfigSchema","CommonSchemas","createConfig","ConfigurationError","AppError","ValidationError","AuthenticationError","ForbiddenError","NotFoundError","ConflictError","UnprocessableEntityError","RateLimitError","InternalServerError","ServiceUnavailableError","DatabaseError","ExternalAPIError","isAppError","isOperationalError","toAppError","ErrorMiddleware","validate","BaseController","RedisClient","DatabaseClient"],"mappings":"AAAA,YAAY;AACZ,cAAc,oCAAoC;AAClD,cAAc,qCAAqC;AACnD,cAAc,oCAAoC;AAClD,cAAc,iCAAiC;AAC/C,cAAc,yCAAyC;AAEvD,gDAAgD;AAChD,cAAc,iBAAyB;AAEvC,SAAS;AACT,SAASA,WAAW,QAAQ,+BAA8B;AAC1D,SAASC,sBAAsB,QAAQ,0CAAyC;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["//Interfaces\nexport * from \"./lib/models/ProgramInterfaces.js\";\nexport * from \"./lib/models/ExerciseInterfaces.js\";\nexport * from \"./lib/models/WorkoutInterfaces.js\";\nexport * from \"./lib/models/UserInterfaces.js\";\nexport * from \"./lib/models/NotificationInterfaces.js\";\n\n//DB Models - Export all models and model arrays\nexport * from \"./lib/dbmodels/index.js\"\n\n//Clients\nexport { EmailClient } from \"./lib/clients/EmailClient.js\"\nexport { PushNotificationClient } from \"./lib/clients/PushNotificationClient.js\"\nexport { FirebasePushNotificationClient } from \"./lib/clients/FirebasePushNotificationClient.js\"\nexport type {\n SendTemplateEmailRequest,\n BatchTemplateEmailRequest,\n EmailResponse,\n} from \"./lib/clients/EmailClient.js\"\nexport type { NotificationPayload } from \"./lib/clients/PushNotificationClient.js\"\n\n//Utils\nexport {AuthenticationUtil} from \"./lib/utils/AuthenticationUtil.js\"\nexport {NotificationsUtil} from \"./lib/utils/NotificationsUtil.js\"\nexport {NotificationClient} from \"./lib/utils/NotificationClient.js\"\nexport {Log} from \"./lib/utils/Logger.js\"\nexport {SecretManager} from \"./lib/utils/SecretManager.js\"\nexport {\n initializeSentry,\n isSentryEnabled,\n scrubObject,\n captureRequestBody,\n extractUserContext,\n buildRequestContext,\n buildResponseContext,\n reportErrorToSentry,\n reportMessageToSentry,\n type ErrorReportOptions,\n type SeverityLevel,\n} from \"./lib/utils/SentryUtil.js\"\n\n//Testing Utilities\nexport {\n createMockContext,\n createMockUser,\n createAuthenticatedContext,\n mockDatabase,\n flushPromises,\n assertions,\n executeRoute,\n type BaseContext,\n type AuthenticatedContext,\n type RouterContext,\n type RouterMiddleware,\n type RouterLayer,\n type RouterLike,\n type SequelizeModelMethods,\n} from \"./lib/testing/testHelpers.js\"\n\n//Config\nexport {\n ConfigValidator,\n BaseConfigSchema,\n CommonSchemas,\n createConfig,\n ConfigurationError,\n type BaseConfig\n} from \"./lib/config/ConfigValidator.js\"\n\n//Errors\nexport {\n AppError,\n ValidationError,\n AuthenticationError,\n ForbiddenError,\n NotFoundError,\n ConflictError,\n UnprocessableEntityError,\n RateLimitError,\n InternalServerError,\n ServiceUnavailableError,\n DatabaseError,\n ExternalAPIError,\n isAppError,\n isOperationalError,\n toAppError\n} from \"./lib/Errors/AppError.js\"\n\n//Middlewares\nexport {\n ErrorMiddleware,\n} from \"./lib/middlewares/ErrorMiddleware.js\"\nexport { validate, type ValidationConfig } from \"./lib/middlewares/ValidationMiddleware.js\";\n\n//Controllers\nexport { BaseController, type RouteConfig } from \"./lib/controllers/BaseController.js\";\n\n\nexport {RedisClient} from \"./lib/classes/Redis.js\"\nexport {DatabaseClient, type DatabaseConfig} from \"./lib/classes/Database.js\""],"names":["EmailClient","PushNotificationClient","FirebasePushNotificationClient","AuthenticationUtil","NotificationsUtil","NotificationClient","Log","SecretManager","initializeSentry","isSentryEnabled","scrubObject","captureRequestBody","extractUserContext","buildRequestContext","buildResponseContext","reportErrorToSentry","reportMessageToSentry","createMockContext","createMockUser","createAuthenticatedContext","mockDatabase","flushPromises","assertions","executeRoute","ConfigValidator","BaseConfigSchema","CommonSchemas","createConfig","ConfigurationError","AppError","ValidationError","AuthenticationError","ForbiddenError","NotFoundError","ConflictError","UnprocessableEntityError","RateLimitError","InternalServerError","ServiceUnavailableError","DatabaseError","ExternalAPIError","isAppError","isOperationalError","toAppError","ErrorMiddleware","valid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;AAGvF,SAAQC,WAAW,QAAO,yBAAwB;AAClD,SAAQC,cAAc,QAA4B,4BAA2B"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Firebase Push Notification Client
|
|
3
|
+
*
|
|
4
|
+
* Industry-standard implementation using Firebase Admin SDK for:
|
|
5
|
+
* - iOS (APNs via FCM)
|
|
6
|
+
* - Android (FCM)
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Multicast messaging (up to 500 tokens per request)
|
|
10
|
+
* - Topic-based messaging for efficient broadcasting
|
|
11
|
+
* - Automatic token validation and cleanup
|
|
12
|
+
* - Built-in retry logic and error handling
|
|
13
|
+
* - Message delivery tracking
|
|
14
|
+
* - Type-safe API
|
|
15
|
+
*/
|
|
16
|
+
export interface NotificationPayload {
|
|
17
|
+
title: string;
|
|
18
|
+
body: string;
|
|
19
|
+
imageUrl?: string;
|
|
20
|
+
sound?: string;
|
|
21
|
+
badge?: number;
|
|
22
|
+
data?: Record<string, string>;
|
|
23
|
+
redirectPath?: string;
|
|
24
|
+
}
|
|
25
|
+
interface SendResult {
|
|
26
|
+
successCount: number;
|
|
27
|
+
failureCount: number;
|
|
28
|
+
invalidTokens: string[];
|
|
29
|
+
}
|
|
30
|
+
export declare class FirebasePushNotificationClient {
|
|
31
|
+
private static instance;
|
|
32
|
+
private static initPromise;
|
|
33
|
+
private logger;
|
|
34
|
+
private app;
|
|
35
|
+
private serviceAccount;
|
|
36
|
+
private constructor();
|
|
37
|
+
static getInstance(): Promise<FirebasePushNotificationClient>;
|
|
38
|
+
private static loadServiceAccount;
|
|
39
|
+
static resetInstance(): void;
|
|
40
|
+
private initializeApp;
|
|
41
|
+
shutdown(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Send notifications using multicast (up to 500 tokens at once)
|
|
44
|
+
* Automatically handles token validation and cleanup
|
|
45
|
+
*/
|
|
46
|
+
private sendMulticast;
|
|
47
|
+
/**
|
|
48
|
+
* Remove invalid device tokens from database
|
|
49
|
+
*/
|
|
50
|
+
private removeInvalidTokens;
|
|
51
|
+
/**
|
|
52
|
+
* Send notification to specific device tokens
|
|
53
|
+
*/
|
|
54
|
+
sendToTokens(tokens: string[], platform: "ios" | "android", notification: NotificationPayload): Promise<SendResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Send notification to a single user (all their devices)
|
|
57
|
+
*/
|
|
58
|
+
sendToUser(params: {
|
|
59
|
+
userUuid: string;
|
|
60
|
+
notification: NotificationPayload;
|
|
61
|
+
}): Promise<SendResult>;
|
|
62
|
+
/**
|
|
63
|
+
* Send notification to multiple users
|
|
64
|
+
*/
|
|
65
|
+
sendToUsers(params: {
|
|
66
|
+
userUuids: string[];
|
|
67
|
+
notification: NotificationPayload;
|
|
68
|
+
}): Promise<SendResult>;
|
|
69
|
+
/**
|
|
70
|
+
* Subscribe users to a topic for efficient group messaging
|
|
71
|
+
*/
|
|
72
|
+
subscribeToTopic(tokens: string[], topic: string): Promise<{
|
|
73
|
+
successCount: number;
|
|
74
|
+
failureCount: number;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Send notification to a topic (efficient for large groups)
|
|
78
|
+
*/
|
|
79
|
+
sendToTopic(params: {
|
|
80
|
+
topic: string;
|
|
81
|
+
notification: NotificationPayload;
|
|
82
|
+
}): Promise<{
|
|
83
|
+
messageId: string;
|
|
84
|
+
}>;
|
|
85
|
+
/**
|
|
86
|
+
* Send notification using a template
|
|
87
|
+
*/
|
|
88
|
+
sendTemplateToUser(params: {
|
|
89
|
+
userUuid: string;
|
|
90
|
+
notificationType: string;
|
|
91
|
+
language?: string;
|
|
92
|
+
data?: Record<string, string>;
|
|
93
|
+
}): Promise<SendResult>;
|
|
94
|
+
/**
|
|
95
|
+
* Send templated notification to multiple users
|
|
96
|
+
*/
|
|
97
|
+
sendTemplateToUsers(params: {
|
|
98
|
+
userUuids: string[];
|
|
99
|
+
notificationType: string;
|
|
100
|
+
language?: string;
|
|
101
|
+
data?: Record<string, string>;
|
|
102
|
+
}): Promise<SendResult>;
|
|
103
|
+
/**
|
|
104
|
+
* Send notification to all users (uses topic for efficiency)
|
|
105
|
+
* Consider subscribing users to an "all_users" topic for better performance
|
|
106
|
+
*/
|
|
107
|
+
sendToAllUsers(params: {
|
|
108
|
+
notification: NotificationPayload;
|
|
109
|
+
batchSize?: number;
|
|
110
|
+
}): Promise<{
|
|
111
|
+
totalSent: number;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Send notification to a user group
|
|
115
|
+
* Recommended: Use topics instead for better performance
|
|
116
|
+
*/
|
|
117
|
+
sendToGroup(params: {
|
|
118
|
+
notification: NotificationPayload;
|
|
119
|
+
group: "premium" | "free" | "trial";
|
|
120
|
+
batchSize?: number;
|
|
121
|
+
}): Promise<{
|
|
122
|
+
totalSent: number;
|
|
123
|
+
}>;
|
|
124
|
+
}
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=FirebasePushNotificationClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FirebasePushNotificationClient.d.ts","sourceRoot":"","sources":["../../../src/lib/clients/FirebasePushNotificationClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4BH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,UAAU;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,qBAAa,8BAA8B;IACzC,OAAO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