@sente-labs/sdk 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/index.cjs +2 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -73,6 +73,8 @@ var Sente = class {
|
|
|
73
73
|
messages = {
|
|
74
74
|
list: (identityId, opts = {}) => this.#req("GET", `/v1/messages${qs({ identityId, ...opts })}`),
|
|
75
75
|
get: (id) => this.#req("GET", `/v1/messages/${id}`),
|
|
76
|
+
/** Send an email from an identity (outbound). `text` and/or `html` required. */
|
|
77
|
+
send: (identityId, input) => this.#req("POST", "/v1/messages", { identityId, ...input }),
|
|
76
78
|
/** Long-poll for the next matching message; resolves to null on timeout. */
|
|
77
79
|
waitFor: async (identityId, opts = {}) => await this.#req("GET", `/v1/messages/wait${qs({ identityId, ...opts })}`) ?? null,
|
|
78
80
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export type Message = {
|
|
|
14
14
|
subject: string | null;
|
|
15
15
|
parsed?: unknown;
|
|
16
16
|
annotation?: unknown;
|
|
17
|
+
/** Outbound only: sent → delivered | bounced | complained | rejected (from SES delivery events). */
|
|
18
|
+
deliveryStatus?: string | null;
|
|
17
19
|
createdAt: string;
|
|
18
20
|
};
|
|
19
21
|
export type Webhook = {
|
|
@@ -58,6 +60,13 @@ export declare class Sente {
|
|
|
58
60
|
limit?: number;
|
|
59
61
|
}) => Promise<Message[]>;
|
|
60
62
|
get: (id: string) => Promise<Message>;
|
|
63
|
+
/** Send an email from an identity (outbound). `text` and/or `html` required. */
|
|
64
|
+
send: (identityId: string, input: {
|
|
65
|
+
to: string;
|
|
66
|
+
subject: string;
|
|
67
|
+
text?: string;
|
|
68
|
+
html?: string;
|
|
69
|
+
}) => Promise<Message>;
|
|
61
70
|
/** Long-poll for the next matching message; resolves to null on timeout. */
|
|
62
71
|
waitFor: (identityId: string, opts?: {
|
|
63
72
|
since?: string;
|
package/dist/index.js
CHANGED
|
@@ -48,6 +48,8 @@ var Sente = class {
|
|
|
48
48
|
messages = {
|
|
49
49
|
list: (identityId, opts = {}) => this.#req("GET", `/v1/messages${qs({ identityId, ...opts })}`),
|
|
50
50
|
get: (id) => this.#req("GET", `/v1/messages/${id}`),
|
|
51
|
+
/** Send an email from an identity (outbound). `text` and/or `html` required. */
|
|
52
|
+
send: (identityId, input) => this.#req("POST", "/v1/messages", { identityId, ...input }),
|
|
51
53
|
/** Long-poll for the next matching message; resolves to null on timeout. */
|
|
52
54
|
waitFor: async (identityId, opts = {}) => await this.#req("GET", `/v1/messages/wait${qs({ identityId, ...opts })}`) ?? null,
|
|
53
55
|
/**
|