@nathapp/nestjs-notify 0.0.0-stage → 1.0.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/AGENTS.md +73 -0
- package/CLAUDE.md +71 -0
- package/GEMINI.md +71 -0
- package/README.md +181 -2
- package/codex.md +71 -0
- package/dist/constant/index.d.ts +1 -0
- package/dist/constant/index.js +18 -0
- package/dist/constant/index.js.map +1 -0
- package/dist/constant/tokens.d.ts +15 -0
- package/dist/constant/tokens.js +28 -0
- package/dist/constant/tokens.js.map +1 -0
- package/dist/delivery/console-delivery.channel.d.ts +8 -0
- package/dist/delivery/console-delivery.channel.js +31 -0
- package/dist/delivery/console-delivery.channel.js.map +1 -0
- package/dist/delivery/delivery-channel.registry.d.ts +11 -0
- package/dist/delivery/delivery-channel.registry.js +35 -0
- package/dist/delivery/delivery-channel.registry.js.map +1 -0
- package/dist/delivery/index.d.ts +2 -0
- package/dist/delivery/index.js +19 -0
- package/dist/delivery/index.js.map +1 -0
- package/dist/error/index.d.ts +1 -0
- package/dist/error/index.js +18 -0
- package/dist/error/index.js.map +1 -0
- package/dist/error/permanent-notification.error.d.ts +5 -0
- package/dist/error/permanent-notification.error.js +52 -0
- package/dist/error/permanent-notification.error.js.map +1 -0
- package/dist/event/index.d.ts +7 -0
- package/dist/event/index.js +10 -0
- package/dist/event/index.js.map +1 -0
- package/dist/exception/index.d.ts +2 -0
- package/dist/exception/index.js +19 -0
- package/dist/exception/index.js.map +1 -0
- package/dist/exception/notify-exception-code.d.ts +11 -0
- package/dist/exception/notify-exception-code.js +28 -0
- package/dist/exception/notify-exception-code.js.map +1 -0
- package/dist/exception/notify.exception.d.ts +6 -0
- package/dist/exception/notify.exception.js +28 -0
- package/dist/exception/notify.exception.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/interface/index.d.ts +4 -0
- package/dist/interface/index.js +21 -0
- package/dist/interface/index.js.map +1 -0
- package/dist/interface/models/delivery-log.interface.d.ts +30 -0
- package/dist/interface/models/delivery-log.interface.js +12 -0
- package/dist/interface/models/delivery-log.interface.js.map +1 -0
- package/dist/interface/models/dlq-job.interface.d.ts +8 -0
- package/dist/interface/models/dlq-job.interface.js +3 -0
- package/dist/interface/models/dlq-job.interface.js.map +1 -0
- package/dist/interface/models/index.d.ts +4 -0
- package/dist/interface/models/index.js +21 -0
- package/dist/interface/models/index.js.map +1 -0
- package/dist/interface/models/preference.interface.d.ts +28 -0
- package/dist/interface/models/preference.interface.js +11 -0
- package/dist/interface/models/preference.interface.js.map +1 -0
- package/dist/interface/models/template.interface.d.ts +29 -0
- package/dist/interface/models/template.interface.js +3 -0
- package/dist/interface/models/template.interface.js.map +1 -0
- package/dist/interface/providers/delivery-channel-provider.interface.d.ts +7 -0
- package/dist/interface/providers/delivery-channel-provider.interface.js +3 -0
- package/dist/interface/providers/delivery-channel-provider.interface.js.map +1 -0
- package/dist/interface/providers/index.d.ts +2 -0
- package/dist/interface/providers/index.js +19 -0
- package/dist/interface/providers/index.js.map +1 -0
- package/dist/interface/providers/provider-event-normalizer.interface.d.ts +4 -0
- package/dist/interface/providers/provider-event-normalizer.interface.js +10 -0
- package/dist/interface/providers/provider-event-normalizer.interface.js.map +1 -0
- package/dist/interface/repositories/delivery-log-repository.interface.d.ts +9 -0
- package/dist/interface/repositories/delivery-log-repository.interface.js +3 -0
- package/dist/interface/repositories/delivery-log-repository.interface.js.map +1 -0
- package/dist/interface/repositories/index.d.ts +3 -0
- package/dist/interface/repositories/index.js +20 -0
- package/dist/interface/repositories/index.js.map +1 -0
- package/dist/interface/repositories/preference-repository.interface.d.ts +7 -0
- package/dist/interface/repositories/preference-repository.interface.js +3 -0
- package/dist/interface/repositories/preference-repository.interface.js.map +1 -0
- package/dist/interface/repositories/template-repository.interface.d.ts +7 -0
- package/dist/interface/repositories/template-repository.interface.js +3 -0
- package/dist/interface/repositories/template-repository.interface.js.map +1 -0
- package/dist/interface/services/delivery-tracker.interface.d.ts +20 -0
- package/dist/interface/services/delivery-tracker.interface.js +15 -0
- package/dist/interface/services/delivery-tracker.interface.js.map +1 -0
- package/dist/interface/services/dlq-service.interface.d.ts +8 -0
- package/dist/interface/services/dlq-service.interface.js +3 -0
- package/dist/interface/services/dlq-service.interface.js.map +1 -0
- package/dist/interface/services/index.d.ts +48 -0
- package/dist/interface/services/index.js +19 -0
- package/dist/interface/services/index.js.map +1 -0
- package/dist/module/index.d.ts +30 -0
- package/dist/module/index.js +191 -0
- package/dist/module/index.js.map +1 -0
- package/dist/processor/index.d.ts +1 -0
- package/dist/processor/index.js +18 -0
- package/dist/processor/index.js.map +1 -0
- package/dist/processor/notification.processor.d.ts +14 -0
- package/dist/processor/notification.processor.js +101 -0
- package/dist/processor/notification.processor.js.map +1 -0
- package/dist/service/default-delivery-tracker.service.d.ts +11 -0
- package/dist/service/default-delivery-tracker.service.js +124 -0
- package/dist/service/default-delivery-tracker.service.js.map +1 -0
- package/dist/service/default-dlq.service.d.ts +16 -0
- package/dist/service/default-dlq.service.js +86 -0
- package/dist/service/default-dlq.service.js.map +1 -0
- package/dist/service/default-notify.service.d.ts +23 -0
- package/dist/service/default-notify.service.js +168 -0
- package/dist/service/default-notify.service.js.map +1 -0
- package/dist/service/default-preference.service.d.ts +15 -0
- package/dist/service/default-preference.service.js +57 -0
- package/dist/service/default-preference.service.js.map +1 -0
- package/dist/service/default-template.service.d.ts +36 -0
- package/dist/service/default-template.service.js +142 -0
- package/dist/service/default-template.service.js.map +1 -0
- package/dist/service/index.d.ts +5 -0
- package/dist/service/index.js +22 -0
- package/dist/service/index.js.map +1 -0
- package/dist/template/handlebars-template.engine.d.ts +8 -0
- package/dist/template/handlebars-template.engine.js +37 -0
- package/dist/template/handlebars-template.engine.js.map +1 -0
- package/dist/template/index.d.ts +15 -0
- package/dist/template/index.js +50 -0
- package/dist/template/index.js.map +1 -0
- package/dist/template/template-cache.d.ts +27 -0
- package/dist/template/template-cache.js +65 -0
- package/dist/template/template-cache.js.map +1 -0
- package/i18n/en/notify.json +14 -0
- package/i18n/zh/notify.json +14 -0
- package/package.json +49 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./console-delivery.channel"), exports);
|
|
18
|
+
__exportStar(require("./delivery-channel.registry"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/delivery/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,8DAA4C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './permanent-notification.error';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./permanent-notification.error"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/error/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PermanentNotificationError = void 0;
|
|
4
|
+
exports.isRetryableError = isRetryableError;
|
|
5
|
+
class PermanentNotificationError extends Error {
|
|
6
|
+
constructor(message, originalError) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.originalError = originalError;
|
|
9
|
+
this.name = 'PermanentNotificationError';
|
|
10
|
+
Object.setPrototypeOf(this, PermanentNotificationError.prototype);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.PermanentNotificationError = PermanentNotificationError;
|
|
14
|
+
function isRetryableError(error) {
|
|
15
|
+
if (error instanceof PermanentNotificationError) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
const message = error.message.toLowerCase();
|
|
19
|
+
const permanentPatterns = [
|
|
20
|
+
'invalid email',
|
|
21
|
+
'invalid phone',
|
|
22
|
+
'validation failed',
|
|
23
|
+
'missing required field',
|
|
24
|
+
'invalid template',
|
|
25
|
+
'unauthorized',
|
|
26
|
+
'forbidden',
|
|
27
|
+
'invalid api key',
|
|
28
|
+
];
|
|
29
|
+
for (const pattern of permanentPatterns) {
|
|
30
|
+
if (message.includes(pattern)) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const retryablePatterns = [
|
|
35
|
+
'timeout',
|
|
36
|
+
'rate limit',
|
|
37
|
+
'too many requests',
|
|
38
|
+
'service unavailable',
|
|
39
|
+
'connection refused',
|
|
40
|
+
'econnrefused',
|
|
41
|
+
'etimedout',
|
|
42
|
+
'network error',
|
|
43
|
+
'temporary failure',
|
|
44
|
+
];
|
|
45
|
+
for (const pattern of retryablePatterns) {
|
|
46
|
+
if (message.includes(pattern)) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=permanent-notification.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permanent-notification.error.js","sourceRoot":"","sources":["../../lib/error/permanent-notification.error.ts"],"names":[],"mappings":";;;AAgCA,4CA+CC;AA3ED,MAAa,0BAA2B,SAAQ,KAAK;IACnD,YACE,OAAe,EACC,aAAqB;QAErC,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,kBAAa,GAAb,aAAa,CAAQ;QAGrC,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;QACzC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC;IACpE,CAAC;CACF;AATD,gEASC;AAmBD,SAAgB,gBAAgB,CAAC,KAAY;IAE3C,IAAI,KAAK,YAAY,0BAA0B,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAG5C,MAAM,iBAAiB,GAAG;QACxB,eAAe;QACf,eAAe;QACf,mBAAmB;QACnB,wBAAwB;QACxB,kBAAkB;QAClB,cAAc;QACd,WAAW;QACX,iBAAiB;KAClB,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE,CAAC;QACxC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAGD,MAAM,iBAAiB,GAAG;QACxB,SAAS;QACT,YAAY;QACZ,mBAAmB;QACnB,qBAAqB;QACrB,oBAAoB;QACpB,cAAc;QACd,WAAW;QACX,eAAe;QACf,mBAAmB;KACpB,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE,CAAC;QACxC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAGD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const NotifyEvents: {
|
|
2
|
+
readonly NOTIFICATION_SENT: "notify.notification.sent";
|
|
3
|
+
readonly NOTIFICATION_FAILED: "notify.notification.failed";
|
|
4
|
+
readonly NOTIFICATION_DELIVERED: "notify.notification.delivered";
|
|
5
|
+
readonly NOTIFICATION_BOUNCED: "notify.notification.bounced";
|
|
6
|
+
};
|
|
7
|
+
export type NotifyEventName = (typeof NotifyEvents)[keyof typeof NotifyEvents];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotifyEvents = void 0;
|
|
4
|
+
exports.NotifyEvents = {
|
|
5
|
+
NOTIFICATION_SENT: 'notify.notification.sent',
|
|
6
|
+
NOTIFICATION_FAILED: 'notify.notification.failed',
|
|
7
|
+
NOTIFICATION_DELIVERED: 'notify.notification.delivered',
|
|
8
|
+
NOTIFICATION_BOUNCED: 'notify.notification.bounced',
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/event/index.ts"],"names":[],"mappings":";;;AAIa,QAAA,YAAY,GAAG;IAC1B,iBAAiB,EAAE,0BAA0B;IAC7C,mBAAmB,EAAE,4BAA4B;IACjD,sBAAsB,EAAE,+BAA+B;IACvD,oBAAoB,EAAE,6BAA6B;CAC3C,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./notify-exception-code"), exports);
|
|
18
|
+
__exportStar(require("./notify.exception"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/exception/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,qDAAmC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum NotifyExceptionCode {
|
|
2
|
+
TEMPLATE_NOT_FOUND = 23001,
|
|
3
|
+
TEMPLATE_INVALID_SYNTAX = 23002,
|
|
4
|
+
TEMPLATE_RENDER_FAILED = 23003,
|
|
5
|
+
PREFERENCE_NOT_FOUND = 23011,
|
|
6
|
+
CHANNEL_DISABLED = 23012,
|
|
7
|
+
CHANNEL_NOT_REGISTERED = 23013,
|
|
8
|
+
DELIVERY_FAILED = 23021,
|
|
9
|
+
DELIVERY_PERMANENT_FAILURE = 23022,
|
|
10
|
+
TENANT_MISMATCH = 23031
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotifyExceptionCode = void 0;
|
|
4
|
+
var NotifyExceptionCode;
|
|
5
|
+
(function (NotifyExceptionCode) {
|
|
6
|
+
NotifyExceptionCode[NotifyExceptionCode["TEMPLATE_NOT_FOUND"] = 23001] = "TEMPLATE_NOT_FOUND";
|
|
7
|
+
NotifyExceptionCode[NotifyExceptionCode["TEMPLATE_INVALID_SYNTAX"] = 23002] = "TEMPLATE_INVALID_SYNTAX";
|
|
8
|
+
NotifyExceptionCode[NotifyExceptionCode["TEMPLATE_RENDER_FAILED"] = 23003] = "TEMPLATE_RENDER_FAILED";
|
|
9
|
+
NotifyExceptionCode[NotifyExceptionCode["PREFERENCE_NOT_FOUND"] = 23011] = "PREFERENCE_NOT_FOUND";
|
|
10
|
+
NotifyExceptionCode[NotifyExceptionCode["CHANNEL_DISABLED"] = 23012] = "CHANNEL_DISABLED";
|
|
11
|
+
NotifyExceptionCode[NotifyExceptionCode["CHANNEL_NOT_REGISTERED"] = 23013] = "CHANNEL_NOT_REGISTERED";
|
|
12
|
+
NotifyExceptionCode[NotifyExceptionCode["DELIVERY_FAILED"] = 23021] = "DELIVERY_FAILED";
|
|
13
|
+
NotifyExceptionCode[NotifyExceptionCode["DELIVERY_PERMANENT_FAILURE"] = 23022] = "DELIVERY_PERMANENT_FAILURE";
|
|
14
|
+
NotifyExceptionCode[NotifyExceptionCode["TENANT_MISMATCH"] = 23031] = "TENANT_MISMATCH";
|
|
15
|
+
})(NotifyExceptionCode || (exports.NotifyExceptionCode = NotifyExceptionCode = {}));
|
|
16
|
+
const _EXHAUSTIVE_CHECK = {
|
|
17
|
+
[NotifyExceptionCode.TEMPLATE_NOT_FOUND]: true,
|
|
18
|
+
[NotifyExceptionCode.TEMPLATE_INVALID_SYNTAX]: true,
|
|
19
|
+
[NotifyExceptionCode.TEMPLATE_RENDER_FAILED]: true,
|
|
20
|
+
[NotifyExceptionCode.PREFERENCE_NOT_FOUND]: true,
|
|
21
|
+
[NotifyExceptionCode.CHANNEL_DISABLED]: true,
|
|
22
|
+
[NotifyExceptionCode.CHANNEL_NOT_REGISTERED]: true,
|
|
23
|
+
[NotifyExceptionCode.DELIVERY_FAILED]: true,
|
|
24
|
+
[NotifyExceptionCode.DELIVERY_PERMANENT_FAILURE]: true,
|
|
25
|
+
[NotifyExceptionCode.TENANT_MISMATCH]: true,
|
|
26
|
+
};
|
|
27
|
+
void _EXHAUSTIVE_CHECK;
|
|
28
|
+
//# sourceMappingURL=notify-exception-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify-exception-code.js","sourceRoot":"","sources":["../../lib/exception/notify-exception-code.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAiBX;AAjBD,WAAY,mBAAmB;IAE7B,6FAA0B,CAAA;IAC1B,uGAA+B,CAAA;IAC/B,qGAA8B,CAAA;IAG9B,iGAA4B,CAAA;IAC5B,yFAAwB,CAAA;IACxB,qGAA8B,CAAA;IAG9B,uFAAuB,CAAA;IACvB,6GAAkC,CAAA;IAGlC,uFAAuB,CAAA;AACzB,CAAC,EAjBW,mBAAmB,mCAAnB,mBAAmB,QAiB9B;AAED,MAAM,iBAAiB,GAAsC;IAC3D,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,EAAE,IAAI;IAC9C,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,EAAE,IAAI;IACnD,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,EAAE,IAAI;IAClD,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,EAAE,IAAI;IAChD,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,IAAI;IAC5C,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,EAAE,IAAI;IAClD,CAAC,mBAAmB,CAAC,eAAe,CAAC,EAAE,IAAI;IAC3C,CAAC,mBAAmB,CAAC,0BAA0B,CAAC,EAAE,IAAI;IACtD,CAAC,mBAAmB,CAAC,eAAe,CAAC,EAAE,IAAI;CAC5C,CAAC;AACF,KAAK,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AppException, AppExceptionArgs } from '@nathapp/nestjs-common';
|
|
2
|
+
import { NotifyExceptionCode } from './notify-exception-code';
|
|
3
|
+
export declare const NOTIFY_I18N_PREFIX = "notify";
|
|
4
|
+
export declare class NotifyException extends AppException {
|
|
5
|
+
constructor(code: NotifyExceptionCode, args?: AppExceptionArgs);
|
|
6
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotifyException = exports.NOTIFY_I18N_PREFIX = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const nestjs_common_1 = require("@nathapp/nestjs-common");
|
|
6
|
+
const notify_exception_code_1 = require("./notify-exception-code");
|
|
7
|
+
exports.NOTIFY_I18N_PREFIX = 'notify';
|
|
8
|
+
const NOTIFY_HTTP_STATUS = {
|
|
9
|
+
[notify_exception_code_1.NotifyExceptionCode.TEMPLATE_NOT_FOUND]: common_1.HttpStatus.NOT_FOUND,
|
|
10
|
+
[notify_exception_code_1.NotifyExceptionCode.TEMPLATE_INVALID_SYNTAX]: common_1.HttpStatus.BAD_REQUEST,
|
|
11
|
+
[notify_exception_code_1.NotifyExceptionCode.TEMPLATE_RENDER_FAILED]: common_1.HttpStatus.INTERNAL_SERVER_ERROR,
|
|
12
|
+
[notify_exception_code_1.NotifyExceptionCode.PREFERENCE_NOT_FOUND]: common_1.HttpStatus.NOT_FOUND,
|
|
13
|
+
[notify_exception_code_1.NotifyExceptionCode.CHANNEL_DISABLED]: common_1.HttpStatus.BAD_REQUEST,
|
|
14
|
+
[notify_exception_code_1.NotifyExceptionCode.CHANNEL_NOT_REGISTERED]: common_1.HttpStatus.BAD_REQUEST,
|
|
15
|
+
[notify_exception_code_1.NotifyExceptionCode.DELIVERY_FAILED]: common_1.HttpStatus.INTERNAL_SERVER_ERROR,
|
|
16
|
+
[notify_exception_code_1.NotifyExceptionCode.DELIVERY_PERMANENT_FAILURE]: common_1.HttpStatus.INTERNAL_SERVER_ERROR,
|
|
17
|
+
[notify_exception_code_1.NotifyExceptionCode.TENANT_MISMATCH]: common_1.HttpStatus.FORBIDDEN,
|
|
18
|
+
};
|
|
19
|
+
const _HTTP_STATUS_EXHAUSTIVE = NOTIFY_HTTP_STATUS;
|
|
20
|
+
void _HTTP_STATUS_EXHAUSTIVE;
|
|
21
|
+
class NotifyException extends nestjs_common_1.AppException {
|
|
22
|
+
constructor(code, args) {
|
|
23
|
+
var _a;
|
|
24
|
+
super(code, args, exports.NOTIFY_I18N_PREFIX, (_a = NOTIFY_HTTP_STATUS[code]) !== null && _a !== void 0 ? _a : common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.NotifyException = NotifyException;
|
|
28
|
+
//# sourceMappingURL=notify.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.exception.js","sourceRoot":"","sources":["../../lib/exception/notify.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,0DAAwE;AACxE,mEAA8D;AAEjD,QAAA,kBAAkB,GAAG,QAAQ,CAAC;AAE3C,MAAM,kBAAkB,GAAwC;IAC9D,CAAC,2CAAmB,CAAC,kBAAkB,CAAC,EAAE,mBAAU,CAAC,SAAS;IAC9D,CAAC,2CAAmB,CAAC,uBAAuB,CAAC,EAAE,mBAAU,CAAC,WAAW;IACrE,CAAC,2CAAmB,CAAC,sBAAsB,CAAC,EAAE,mBAAU,CAAC,qBAAqB;IAE9E,CAAC,2CAAmB,CAAC,oBAAoB,CAAC,EAAE,mBAAU,CAAC,SAAS;IAChE,CAAC,2CAAmB,CAAC,gBAAgB,CAAC,EAAE,mBAAU,CAAC,WAAW;IAC9D,CAAC,2CAAmB,CAAC,sBAAsB,CAAC,EAAE,mBAAU,CAAC,WAAW;IAEpE,CAAC,2CAAmB,CAAC,eAAe,CAAC,EAAE,mBAAU,CAAC,qBAAqB;IACvE,CAAC,2CAAmB,CAAC,0BAA0B,CAAC,EAAE,mBAAU,CAAC,qBAAqB;IAElF,CAAC,2CAAmB,CAAC,eAAe,CAAC,EAAE,mBAAU,CAAC,SAAS;CAC5D,CAAC;AAEF,MAAM,uBAAuB,GAAwC,kBAAkB,CAAC;AACxF,KAAK,uBAAuB,CAAC;AAE7B,MAAa,eAAgB,SAAQ,4BAAY;IAC/C,YAAY,IAAyB,EAAE,IAAuB;;QAC5D,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,0BAAkB,EAAE,MAAA,kBAAkB,CAAC,IAAI,CAAC,mCAAI,mBAAU,CAAC,qBAAqB,CAAC,CAAC;IACtG,CAAC;CACF;AAJD,0CAIC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './interface';
|
|
2
|
+
export * from './constant';
|
|
3
|
+
export * from './exception';
|
|
4
|
+
export * from './event';
|
|
5
|
+
export * from './service';
|
|
6
|
+
export * from './delivery';
|
|
7
|
+
export * from './template';
|
|
8
|
+
export * from './processor';
|
|
9
|
+
export * from './module';
|
|
10
|
+
export * from './error';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./interface"), exports);
|
|
18
|
+
__exportStar(require("./constant"), exports);
|
|
19
|
+
__exportStar(require("./exception"), exports);
|
|
20
|
+
__exportStar(require("./event"), exports);
|
|
21
|
+
__exportStar(require("./service"), exports);
|
|
22
|
+
__exportStar(require("./delivery"), exports);
|
|
23
|
+
__exportStar(require("./template"), exports);
|
|
24
|
+
__exportStar(require("./processor"), exports);
|
|
25
|
+
__exportStar(require("./module"), exports);
|
|
26
|
+
__exportStar(require("./error"), exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,6CAA2B;AAC3B,8CAA4B;AAC5B,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,6CAA2B;AAC3B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./models"), exports);
|
|
18
|
+
__exportStar(require("./repositories"), exports);
|
|
19
|
+
__exportStar(require("./services"), exports);
|
|
20
|
+
__exportStar(require("./providers"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,iDAA+B;AAC/B,6CAA2B;AAC3B,8CAA4B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface IDeliveryLog {
|
|
2
|
+
id: string;
|
|
3
|
+
tenantId: string;
|
|
4
|
+
userId?: string;
|
|
5
|
+
channel: string;
|
|
6
|
+
templateCode: string;
|
|
7
|
+
recipient: string;
|
|
8
|
+
status: DeliveryStatus;
|
|
9
|
+
providerMessageId?: string;
|
|
10
|
+
errorMessage?: string;
|
|
11
|
+
metadata?: Record<string, unknown>;
|
|
12
|
+
sentAt?: Date;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
}
|
|
15
|
+
export declare enum DeliveryStatus {
|
|
16
|
+
QUEUED = "queued",
|
|
17
|
+
SENT = "sent",
|
|
18
|
+
DELIVERED = "delivered",
|
|
19
|
+
FAILED = "failed",
|
|
20
|
+
BOUNCED = "bounced"
|
|
21
|
+
}
|
|
22
|
+
export interface CreateDeliveryLogData {
|
|
23
|
+
tenantId: string;
|
|
24
|
+
userId?: string;
|
|
25
|
+
channel: string;
|
|
26
|
+
templateCode: string;
|
|
27
|
+
recipient: string;
|
|
28
|
+
status: DeliveryStatus;
|
|
29
|
+
metadata?: Record<string, unknown>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeliveryStatus = void 0;
|
|
4
|
+
var DeliveryStatus;
|
|
5
|
+
(function (DeliveryStatus) {
|
|
6
|
+
DeliveryStatus["QUEUED"] = "queued";
|
|
7
|
+
DeliveryStatus["SENT"] = "sent";
|
|
8
|
+
DeliveryStatus["DELIVERED"] = "delivered";
|
|
9
|
+
DeliveryStatus["FAILED"] = "failed";
|
|
10
|
+
DeliveryStatus["BOUNCED"] = "bounced";
|
|
11
|
+
})(DeliveryStatus || (exports.DeliveryStatus = DeliveryStatus = {}));
|
|
12
|
+
//# sourceMappingURL=delivery-log.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-log.interface.js","sourceRoot":"","sources":["../../../lib/interface/models/delivery-log.interface.ts"],"names":[],"mappings":";;;AAeA,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,yCAAuB,CAAA;IACvB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;AACrB,CAAC,EANW,cAAc,8BAAd,cAAc,QAMzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dlq-job.interface.js","sourceRoot":"","sources":["../../../lib/interface/models/dlq-job.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./template.interface"), exports);
|
|
18
|
+
__exportStar(require("./preference.interface"), exports);
|
|
19
|
+
__exportStar(require("./delivery-log.interface"), exports);
|
|
20
|
+
__exportStar(require("./dlq-job.interface"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/interface/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,yDAAuC;AACvC,2DAAyC;AACzC,sDAAoC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface INotificationPreference {
|
|
2
|
+
id: string;
|
|
3
|
+
userId: string;
|
|
4
|
+
tenantId: string;
|
|
5
|
+
channel: NotificationChannelLike;
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
updatedAt: Date;
|
|
10
|
+
}
|
|
11
|
+
export declare enum NotificationChannel {
|
|
12
|
+
EMAIL = "email",
|
|
13
|
+
PUSH = "push",
|
|
14
|
+
SMS = "sms",
|
|
15
|
+
IN_APP = "in_app"
|
|
16
|
+
}
|
|
17
|
+
export type NotificationChannelLike = NotificationChannel | (string & Record<never, never>);
|
|
18
|
+
export interface CreatePreferenceData {
|
|
19
|
+
userId: string;
|
|
20
|
+
tenantId: string;
|
|
21
|
+
channel: NotificationChannelLike;
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
metadata?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface UpdatePreferenceData {
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
metadata?: Record<string, unknown>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationChannel = void 0;
|
|
4
|
+
var NotificationChannel;
|
|
5
|
+
(function (NotificationChannel) {
|
|
6
|
+
NotificationChannel["EMAIL"] = "email";
|
|
7
|
+
NotificationChannel["PUSH"] = "push";
|
|
8
|
+
NotificationChannel["SMS"] = "sms";
|
|
9
|
+
NotificationChannel["IN_APP"] = "in_app";
|
|
10
|
+
})(NotificationChannel || (exports.NotificationChannel = NotificationChannel = {}));
|
|
11
|
+
//# sourceMappingURL=preference.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference.interface.js","sourceRoot":"","sources":["../../../lib/interface/models/preference.interface.ts"],"names":[],"mappings":";;;AAWA,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,sCAAe,CAAA;IACf,oCAAa,CAAA;IACb,kCAAW,CAAA;IACX,wCAAiB,CAAA;AACnB,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface INotificationTemplate {
|
|
2
|
+
id: string;
|
|
3
|
+
tenantId: string;
|
|
4
|
+
code: string;
|
|
5
|
+
channel?: string;
|
|
6
|
+
locale: string;
|
|
7
|
+
subject?: string;
|
|
8
|
+
content: string;
|
|
9
|
+
isActive: boolean;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateTemplateData {
|
|
15
|
+
tenantId: string;
|
|
16
|
+
code: string;
|
|
17
|
+
channel?: string;
|
|
18
|
+
locale: string;
|
|
19
|
+
subject?: string;
|
|
20
|
+
content: string;
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface UpdateTemplateData {
|
|
24
|
+
channel?: string;
|
|
25
|
+
subject?: string;
|
|
26
|
+
content?: string;
|
|
27
|
+
isActive?: boolean;
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.interface.js","sourceRoot":"","sources":["../../../lib/interface/models/template.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ProviderClassOrAsyncOptions } from '@nathapp/nestjs-common';
|
|
2
|
+
import type { IDeliveryChannel } from '../services';
|
|
3
|
+
import type { NotificationChannelLike } from '../models';
|
|
4
|
+
export interface IDeliveryChannelProvider {
|
|
5
|
+
channel: NotificationChannelLike;
|
|
6
|
+
provider: ProviderClassOrAsyncOptions<IDeliveryChannel>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-channel-provider.interface.js","sourceRoot":"","sources":["../../../lib/interface/providers/delivery-channel-provider.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./delivery-channel-provider.interface"), exports);
|
|
18
|
+
__exportStar(require("./provider-event-normalizer.interface"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/interface/providers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wEAAsD;AACtD,wEAAsD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IProviderEventNormalizer = void 0;
|
|
4
|
+
class IProviderEventNormalizer {
|
|
5
|
+
normalize(_rawPayload) {
|
|
6
|
+
throw new Error('IProviderEventNormalizer.normalize is abstract');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.IProviderEventNormalizer = IProviderEventNormalizer;
|
|
10
|
+
//# sourceMappingURL=provider-event-normalizer.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-event-normalizer.interface.js","sourceRoot":"","sources":["../../../lib/interface/providers/provider-event-normalizer.interface.ts"],"names":[],"mappings":";;;AAEA,MAAa,wBAAwB;IACnC,SAAS,CAAC,WAAoB;QAC5B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;CACF;AAJD,4DAIC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IRepository, IPageResult } from '@nathapp/nestjs-data';
|
|
2
|
+
import type { IPageOption } from '@nathapp/nestjs-common';
|
|
3
|
+
import { IDeliveryLog, DeliveryStatus } from '../models/delivery-log.interface';
|
|
4
|
+
export interface IDeliveryLogRepository extends IRepository<IDeliveryLog, string> {
|
|
5
|
+
findByRecipient(recipient: string, tenantId: string, page: IPageOption): Promise<IPageResult<IDeliveryLog>>;
|
|
6
|
+
findByProviderMessageId(providerMessageId: string, tenantId: string): Promise<IDeliveryLog | null>;
|
|
7
|
+
updateStatus(id: string, tenantId: string, status: DeliveryStatus, errorMessage?: string, providerMessageId?: string): Promise<IDeliveryLog>;
|
|
8
|
+
updateStatusIfCurrent(id: string, tenantId: string, expectedStatus: DeliveryStatus, newStatus: DeliveryStatus, reason?: string): Promise<boolean>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-log-repository.interface.js","sourceRoot":"","sources":["../../../lib/interface/repositories/delivery-log-repository.interface.ts"],"names":[],"mappings":""}
|