@managemint-solutions/entities 1.1.29 → 1.1.31
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/notifications/index.d.ts +22 -0
- package/dist/resend/enum/index.d.ts +17 -0
- package/dist/resend/enum/index.js +24 -0
- package/dist/resend/index.d.ts +2 -0
- package/dist/resend/index.js +18 -0
- package/dist/resend/webhook/index.d.ts +39 -0
- package/dist/resend/webhook/index.js +2 -0
- package/package.json +1 -1
|
@@ -15,4 +15,26 @@ export interface NotificationSummary {
|
|
|
15
15
|
sent_at: Date | null;
|
|
16
16
|
failed_at: Date | null;
|
|
17
17
|
failure_reason: string | null;
|
|
18
|
+
delivered_at: Date | null;
|
|
19
|
+
delivery_delayed_at: Date | null;
|
|
20
|
+
/** First-party: stamped when someone views the notification in the portal. */
|
|
21
|
+
opened_at: Date | null;
|
|
22
|
+
bounced_at: Date | null;
|
|
23
|
+
complained_at: Date | null;
|
|
24
|
+
delivery_failure_reason: string | null;
|
|
25
|
+
}
|
|
26
|
+
/** The rendered email as the provider sent it - variables already substituted. */
|
|
27
|
+
export interface NotificationEmailContent {
|
|
28
|
+
subject: string;
|
|
29
|
+
html: string | null;
|
|
30
|
+
text: string | null;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The detail view behind one notification. Content blocks are per channel:
|
|
34
|
+
* `email` is null when the channel is not email or the body could not be
|
|
35
|
+
* fetched from the provider; future channels add their own nullable blocks.
|
|
36
|
+
*/
|
|
37
|
+
export interface NotificationEntity extends NotificationSummary {
|
|
38
|
+
template_variables: Record<string, string | number>;
|
|
39
|
+
email: NotificationEmailContent | null;
|
|
18
40
|
}
|
|
@@ -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,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
|
+
};
|
package/package.json
CHANGED