@managemint-solutions/entities 1.1.27 → 1.1.30

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.
@@ -0,0 +1,9 @@
1
+ export type GetNotificationsDto = {
2
+ search?: string | null;
3
+ page: number;
4
+ page_size: number;
5
+ created_after?: string | null;
6
+ created_before?: string | null;
7
+ status_in?: string | null;
8
+ type_in?: string | null;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ export declare enum NotificationStatus {
2
+ PENDING = "pending",
3
+ PROCESSING = "processing",
4
+ SENT = "sent",
5
+ FAILED = "failed"
6
+ }
7
+ export declare enum NotificationChannel {
8
+ EMAIL = "email"
9
+ }
10
+ export declare enum NotificationType {
11
+ INVOICE_PAYMENT_FAILED = "invoice_payment_failed",
12
+ CARD_EXPIRING_SOON = "card_expiring_soon",
13
+ PAYMENT_RECOVERED = "payment_recovered",
14
+ ORGANIZATION_PROVISIONED = "organization_provisioned"
15
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationType = exports.NotificationChannel = exports.NotificationStatus = void 0;
4
+ var NotificationStatus;
5
+ (function (NotificationStatus) {
6
+ NotificationStatus["PENDING"] = "pending";
7
+ NotificationStatus["PROCESSING"] = "processing";
8
+ NotificationStatus["SENT"] = "sent";
9
+ NotificationStatus["FAILED"] = "failed";
10
+ })(NotificationStatus || (exports.NotificationStatus = NotificationStatus = {}));
11
+ ;
12
+ var NotificationChannel;
13
+ (function (NotificationChannel) {
14
+ NotificationChannel["EMAIL"] = "email";
15
+ })(NotificationChannel || (exports.NotificationChannel = NotificationChannel = {}));
16
+ ;
17
+ var NotificationType;
18
+ (function (NotificationType) {
19
+ NotificationType["INVOICE_PAYMENT_FAILED"] = "invoice_payment_failed";
20
+ NotificationType["CARD_EXPIRING_SOON"] = "card_expiring_soon";
21
+ NotificationType["PAYMENT_RECOVERED"] = "payment_recovered";
22
+ NotificationType["ORGANIZATION_PROVISIONED"] = "organization_provisioned";
23
+ })(NotificationType || (exports.NotificationType = NotificationType = {}));
24
+ ;
@@ -0,0 +1,25 @@
1
+ import type { UUID } from 'crypto';
2
+ import { UserIdentity } from '../users';
3
+ import { NotificationChannel, NotificationStatus, NotificationType } from './enum';
4
+ export * from './enum';
5
+ export interface NotificationSummary {
6
+ mms_id: UUID;
7
+ created_at: Date;
8
+ recipient: UserIdentity | null;
9
+ recipient_email: string;
10
+ notification_type: NotificationType;
11
+ channel: NotificationChannel;
12
+ template_id: string;
13
+ status: NotificationStatus;
14
+ attempts: number;
15
+ sent_at: Date | null;
16
+ failed_at: Date | null;
17
+ failure_reason: string | null;
18
+ delivered_at: Date | null;
19
+ delivery_delayed_at: Date | null;
20
+ opened_at: Date | null;
21
+ clicked_at: Date | null;
22
+ bounced_at: Date | null;
23
+ complained_at: Date | null;
24
+ delivery_failure_reason: string | null;
25
+ }
@@ -0,0 +1,17 @@
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("./enum"), exports);
@@ -0,0 +1,17 @@
1
+ export declare enum ResendWebhookEventType {
2
+ EMAIL_SENT = "email.sent",
3
+ EMAIL_DELIVERED = "email.delivered",
4
+ EMAIL_DELIVERY_DELAYED = "email.delivery_delayed",
5
+ EMAIL_OPENED = "email.opened",
6
+ EMAIL_CLICKED = "email.clicked",
7
+ EMAIL_BOUNCED = "email.bounced",
8
+ EMAIL_COMPLAINED = "email.complained",
9
+ EMAIL_FAILED = "email.failed"
10
+ }
11
+ export declare enum ResendWebhookProcessingStatus {
12
+ RECEIVED = "received",
13
+ PROCESSING = "processing",
14
+ PROCESSED = "processed",
15
+ IGNORED_DUPLICATE = "ignored_duplicate",
16
+ FAILED = "failed"
17
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResendWebhookProcessingStatus = exports.ResendWebhookEventType = void 0;
4
+ var ResendWebhookEventType;
5
+ (function (ResendWebhookEventType) {
6
+ ResendWebhookEventType["EMAIL_SENT"] = "email.sent";
7
+ ResendWebhookEventType["EMAIL_DELIVERED"] = "email.delivered";
8
+ ResendWebhookEventType["EMAIL_DELIVERY_DELAYED"] = "email.delivery_delayed";
9
+ ResendWebhookEventType["EMAIL_OPENED"] = "email.opened";
10
+ ResendWebhookEventType["EMAIL_CLICKED"] = "email.clicked";
11
+ ResendWebhookEventType["EMAIL_BOUNCED"] = "email.bounced";
12
+ ResendWebhookEventType["EMAIL_COMPLAINED"] = "email.complained";
13
+ ResendWebhookEventType["EMAIL_FAILED"] = "email.failed";
14
+ })(ResendWebhookEventType || (exports.ResendWebhookEventType = ResendWebhookEventType = {}));
15
+ ;
16
+ var ResendWebhookProcessingStatus;
17
+ (function (ResendWebhookProcessingStatus) {
18
+ ResendWebhookProcessingStatus["RECEIVED"] = "received";
19
+ ResendWebhookProcessingStatus["PROCESSING"] = "processing";
20
+ ResendWebhookProcessingStatus["PROCESSED"] = "processed";
21
+ ResendWebhookProcessingStatus["IGNORED_DUPLICATE"] = "ignored_duplicate";
22
+ ResendWebhookProcessingStatus["FAILED"] = "failed";
23
+ })(ResendWebhookProcessingStatus || (exports.ResendWebhookProcessingStatus = ResendWebhookProcessingStatus = {}));
24
+ ;
@@ -0,0 +1,2 @@
1
+ export * from './enum';
2
+ export * from './webhook';
@@ -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("./enum"), exports);
18
+ __exportStar(require("./webhook"), exports);
@@ -0,0 +1,39 @@
1
+ import { ResendWebhookEventType } from '../enum';
2
+ /**
3
+ * One email event's data as Resend delivers it. `email_id` is the id the send
4
+ * API returned, and therefore the notification outbox's provider_message_id.
5
+ * The optional blocks are populated per event type.
6
+ */
7
+ export type ResendEmailEventData = {
8
+ email_id: string;
9
+ from: string;
10
+ to: string[];
11
+ subject: string;
12
+ created_at: string;
13
+ tags?: Record<string, string>;
14
+ bounce?: {
15
+ message: string;
16
+ type: string;
17
+ subType: string;
18
+ };
19
+ click?: {
20
+ link: string;
21
+ timestamp: string;
22
+ ipAddress?: string;
23
+ userAgent?: string;
24
+ };
25
+ failed?: {
26
+ reason: string;
27
+ };
28
+ };
29
+ /**
30
+ * The webhook envelope. `type` is wider than the enum on purpose: Resend also
31
+ * emits event families we do not subscribe to (email.received, domain.*,
32
+ * contact.*, suppression.*) and an unknown type must still parse so the
33
+ * receiver can acknowledge it.
34
+ */
35
+ export type ResendWebhookEventPayload = {
36
+ type: ResendWebhookEventType | string;
37
+ created_at: string;
38
+ data: ResendEmailEventData;
39
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managemint-solutions/entities",
3
- "version": "1.1.27",
3
+ "version": "1.1.30",
4
4
  "description": "Entity types used by both the api and portal",
5
5
  "homepage": "https://github.com/ManageMint-Solutions/managemint-solutions-entities#readme",
6
6
  "bugs": {