@clipboard-health/notifications 1.0.4 → 1.2.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/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clipboard-health/notifications",
|
|
3
3
|
"description": "Send notifications through third-party providers.",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"bugs": "https://github.com/ClipboardHealth/core-utils/issues",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@clipboard-health/background-jobs-adapter": "0.
|
|
8
|
-
"@clipboard-health/phone-number": "0.
|
|
9
|
-
"@clipboard-health/util-ts": "3.
|
|
7
|
+
"@clipboard-health/background-jobs-adapter": "0.5.0",
|
|
8
|
+
"@clipboard-health/phone-number": "0.9.0",
|
|
9
|
+
"@clipboard-health/util-ts": "3.18.0",
|
|
10
10
|
"@knocklabs/node": "1.20.0",
|
|
11
11
|
"tslib": "2.8.1"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@clipboard-health/testing-core": "0.
|
|
14
|
+
"@clipboard-health/testing-core": "0.27.0",
|
|
15
15
|
"type-fest": "5.0.1"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [],
|
|
@@ -53,6 +53,29 @@ export interface NotificationEnqueueData {
|
|
|
53
53
|
export interface NotificationJobData extends Omit<NotificationEnqueueData, "idempotencyKey"> {
|
|
54
54
|
idempotencyKey: TriggerIdempotencyKey;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Type utility to create Job and Enqueue data type variants.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* type MyNotificationData = NotificationData<{
|
|
62
|
+
* name: string;
|
|
63
|
+
* age: number;
|
|
64
|
+
* }>;
|
|
65
|
+
*
|
|
66
|
+
* export class MyNotificationJob implements HandlerInterface<MyNotificationData["Job"]> {
|
|
67
|
+
* ...
|
|
68
|
+
* }
|
|
69
|
+
*
|
|
70
|
+
* await notificationJobEnqueuer.enqueueOneOrMore<MyNotificationData["Enqueue"]>(
|
|
71
|
+
* ...
|
|
72
|
+
* );
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export interface NotificationData<T> {
|
|
76
|
+
Job: NotificationJobData & T;
|
|
77
|
+
Enqueue: NotificationEnqueueData & T;
|
|
78
|
+
}
|
|
56
79
|
interface NotificationJobEnqueuerParams {
|
|
57
80
|
adapter: BackgroundJobsAdapter;
|
|
58
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notificationJobEnqueuer.js","sourceRoot":"","sources":["../../../../../packages/notifications/src/lib/notificationJobEnqueuer.ts"],"names":[],"mappings":";;;AAAA,uFAGmD;AAEnD,gEAA6D;AAC7D,oGAAiG;AACjG,mEAIiC;
|
|
1
|
+
{"version":3,"file":"notificationJobEnqueuer.js","sourceRoot":"","sources":["../../../../../packages/notifications/src/lib/notificationJobEnqueuer.ts"],"names":[],"mappings":";;;AAAA,uFAGmD;AAEnD,gEAA6D;AAC7D,oGAAiG;AACjG,mEAIiC;AAiGjC,MAAa,uBAAuB;IACjB,OAAO,CAA2C;IAEnE,YAAY,MAAqC;QAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAE3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmEG;IACH,KAAK,CAAC,gBAAgB,CACpB,sBAA4C,EAC5C,IAAkB;IAClB,yDAAyD;IACzD,OAAiE;QAEjE,MAAM,OAAO,CAAC,GAAG,CACf,IAAA,iCAAe,EAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,UAAU,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