@ferreirasw/yoke-common 0.2.0 → 0.3.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/dist/messaging/constants/routing-keys.d.ts +3 -0
- package/dist/messaging/constants/routing-keys.js +3 -0
- package/dist/messaging/constants/routing-keys.js.map +1 -1
- package/dist/messaging/types/index.d.ts +1 -0
- package/dist/messaging/types/index.js +1 -0
- package/dist/messaging/types/index.js.map +1 -1
- package/dist/messaging/types/notification-messages.d.ts +50 -0
- package/dist/messaging/types/notification-messages.js +13 -0
- package/dist/messaging/types/notification-messages.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -24,5 +24,8 @@ export declare const ROUTING_KEYS: {
|
|
|
24
24
|
readonly QUOTATION_COMPLETED: "quotation.completed";
|
|
25
25
|
readonly QUOTATION_EXPIRED: "quotation.expired";
|
|
26
26
|
readonly PRODUCT_SELECTED: "product.selected";
|
|
27
|
+
readonly NOTIFICATION_SEND_EMAIL: "notification.send.email";
|
|
28
|
+
readonly NOTIFICATION_EMAIL_SENT: "notification.email.sent";
|
|
29
|
+
readonly NOTIFICATION_EMAIL_FAILED: "notification.email.failed";
|
|
27
30
|
};
|
|
28
31
|
export type RoutingKey = (typeof ROUTING_KEYS)[keyof typeof ROUTING_KEYS];
|
|
@@ -27,5 +27,8 @@ exports.ROUTING_KEYS = {
|
|
|
27
27
|
QUOTATION_COMPLETED: 'quotation.completed',
|
|
28
28
|
QUOTATION_EXPIRED: 'quotation.expired',
|
|
29
29
|
PRODUCT_SELECTED: 'product.selected',
|
|
30
|
+
NOTIFICATION_SEND_EMAIL: 'notification.send.email',
|
|
31
|
+
NOTIFICATION_EMAIL_SENT: 'notification.email.sent',
|
|
32
|
+
NOTIFICATION_EMAIL_FAILED: 'notification.email.failed',
|
|
30
33
|
};
|
|
31
34
|
//# sourceMappingURL=routing-keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing-keys.js","sourceRoot":"","sources":["../../../src/messaging/constants/routing-keys.ts"],"names":[],"mappings":";;;AAMa,QAAA,YAAY,GAAG;IAE1B,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAGlC,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAG5B,cAAc,EAAE,YAAY;IAC5B,eAAe,EAAE,aAAa;IAC9B,cAAc,EAAE,qBAAqB;IAGrC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAGlC,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAG5B,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,kBAAkB;IAGpC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAGlC,iBAAiB,EAAE,mBAAmB;IACtC,mBAAmB,EAAE,qBAAqB;IAC1C,iBAAiB,EAAE,mBAAmB;IACtC,gBAAgB,EAAE,kBAAkB;
|
|
1
|
+
{"version":3,"file":"routing-keys.js","sourceRoot":"","sources":["../../../src/messaging/constants/routing-keys.ts"],"names":[],"mappings":";;;AAMa,QAAA,YAAY,GAAG;IAE1B,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAGlC,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAG5B,cAAc,EAAE,YAAY;IAC5B,eAAe,EAAE,aAAa;IAC9B,cAAc,EAAE,qBAAqB;IAGrC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAGlC,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAG5B,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,kBAAkB;IAGpC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAGlC,iBAAiB,EAAE,mBAAmB;IACtC,mBAAmB,EAAE,qBAAqB;IAC1C,iBAAiB,EAAE,mBAAmB;IACtC,gBAAgB,EAAE,kBAAkB;IAGpC,uBAAuB,EAAE,yBAAyB;IAClD,uBAAuB,EAAE,yBAAyB;IAClD,yBAAyB,EAAE,2BAA2B;CAC9C,CAAC"}
|
|
@@ -19,4 +19,5 @@ __exportStar(require("./account-messages"), exports);
|
|
|
19
19
|
__exportStar(require("./user-messages"), exports);
|
|
20
20
|
__exportStar(require("./product-messages"), exports);
|
|
21
21
|
__exportStar(require("./quotation-messages"), exports);
|
|
22
|
+
__exportStar(require("./notification-messages"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/messaging/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,iDAA+B;AAC/B,qDAAmC;AACnC,kDAAgC;AAChC,qDAAmC;AACnC,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/messaging/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,iDAA+B;AAC/B,qDAAmC;AACnC,kDAAgC;AAChC,qDAAmC;AACnC,uDAAqC;AACrC,0DAAwC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BaseMessage } from './base-message';
|
|
2
|
+
export declare enum EmailTemplateType {
|
|
3
|
+
PASSWORD_RESET = "password_reset",
|
|
4
|
+
USER_ACTIVATION = "user_activation",
|
|
5
|
+
WELCOME = "welcome",
|
|
6
|
+
QUOTATION_COMPLETED = "quotation_completed",
|
|
7
|
+
PRODUCT_SELECTED = "product_selected",
|
|
8
|
+
GENERIC = "generic"
|
|
9
|
+
}
|
|
10
|
+
export interface SendEmailNotificationMessage extends BaseMessage {
|
|
11
|
+
to: string;
|
|
12
|
+
subject: string;
|
|
13
|
+
templateType: EmailTemplateType;
|
|
14
|
+
templateParams: Record<string, any>;
|
|
15
|
+
textBody?: string;
|
|
16
|
+
htmlBody?: string;
|
|
17
|
+
source?: string;
|
|
18
|
+
userId?: string;
|
|
19
|
+
correlationId?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface EmailSentMessage extends BaseMessage {
|
|
22
|
+
notificationId: string;
|
|
23
|
+
to: string;
|
|
24
|
+
subject: string;
|
|
25
|
+
sentAt: Date;
|
|
26
|
+
providerMessageId?: string;
|
|
27
|
+
correlationId?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface EmailFailedMessage extends BaseMessage {
|
|
30
|
+
to: string;
|
|
31
|
+
subject: string;
|
|
32
|
+
error: string;
|
|
33
|
+
failedAt: Date;
|
|
34
|
+
correlationId?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface NotificationRequest extends BaseMessage {
|
|
37
|
+
type: 'email' | 'sms' | 'push';
|
|
38
|
+
recipient: string;
|
|
39
|
+
content: {
|
|
40
|
+
subject?: string;
|
|
41
|
+
body: string;
|
|
42
|
+
templateType?: EmailTemplateType;
|
|
43
|
+
templateParams?: Record<string, any>;
|
|
44
|
+
};
|
|
45
|
+
metadata?: {
|
|
46
|
+
source?: string;
|
|
47
|
+
userId?: string;
|
|
48
|
+
correlationId?: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailTemplateType = void 0;
|
|
4
|
+
var EmailTemplateType;
|
|
5
|
+
(function (EmailTemplateType) {
|
|
6
|
+
EmailTemplateType["PASSWORD_RESET"] = "password_reset";
|
|
7
|
+
EmailTemplateType["USER_ACTIVATION"] = "user_activation";
|
|
8
|
+
EmailTemplateType["WELCOME"] = "welcome";
|
|
9
|
+
EmailTemplateType["QUOTATION_COMPLETED"] = "quotation_completed";
|
|
10
|
+
EmailTemplateType["PRODUCT_SELECTED"] = "product_selected";
|
|
11
|
+
EmailTemplateType["GENERIC"] = "generic";
|
|
12
|
+
})(EmailTemplateType || (exports.EmailTemplateType = EmailTemplateType = {}));
|
|
13
|
+
//# sourceMappingURL=notification-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-messages.js","sourceRoot":"","sources":["../../../src/messaging/types/notification-messages.ts"],"names":[],"mappings":";;;AAKA,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,sDAAiC,CAAA;IACjC,wDAAmC,CAAA;IACnC,wCAAmB,CAAA;IACnB,gEAA2C,CAAA;IAC3C,0DAAqC,CAAA;IACrC,wCAAmB,CAAA;AACrB,CAAC,EAPW,iBAAiB,iCAAjB,iBAAiB,QAO5B"}
|