@sapiom/tools 0.10.2 → 0.11.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +2 -1
  3. package/dist/cjs/client.d.ts +60 -0
  4. package/dist/cjs/client.d.ts.map +1 -1
  5. package/dist/cjs/client.js +32 -0
  6. package/dist/cjs/client.js.map +1 -1
  7. package/dist/cjs/email/errors.d.ts +16 -0
  8. package/dist/cjs/email/errors.d.ts.map +1 -0
  9. package/dist/cjs/email/errors.js +36 -0
  10. package/dist/cjs/email/errors.js.map +1 -0
  11. package/dist/cjs/email/index.d.ts +391 -0
  12. package/dist/cjs/email/index.d.ts.map +1 -0
  13. package/dist/cjs/email/index.js +465 -0
  14. package/dist/cjs/email/index.js.map +1 -0
  15. package/dist/cjs/index.d.ts +3 -1
  16. package/dist/cjs/index.d.ts.map +1 -1
  17. package/dist/cjs/index.js +4 -1
  18. package/dist/cjs/index.js.map +1 -1
  19. package/dist/cjs/stub/index.d.ts.map +1 -1
  20. package/dist/cjs/stub/index.js +116 -0
  21. package/dist/cjs/stub/index.js.map +1 -1
  22. package/dist/esm/client.d.ts +60 -0
  23. package/dist/esm/client.d.ts.map +1 -1
  24. package/dist/esm/client.js +32 -0
  25. package/dist/esm/client.js.map +1 -1
  26. package/dist/esm/email/errors.d.ts +16 -0
  27. package/dist/esm/email/errors.d.ts.map +1 -0
  28. package/dist/esm/email/errors.js +31 -0
  29. package/dist/esm/email/errors.js.map +1 -0
  30. package/dist/esm/email/index.d.ts +391 -0
  31. package/dist/esm/email/index.d.ts.map +1 -0
  32. package/dist/esm/email/index.js +446 -0
  33. package/dist/esm/email/index.js.map +1 -0
  34. package/dist/esm/index.d.ts +3 -1
  35. package/dist/esm/index.d.ts.map +1 -1
  36. package/dist/esm/index.js +3 -1
  37. package/dist/esm/index.js.map +1 -1
  38. package/dist/esm/stub/index.d.ts.map +1 -1
  39. package/dist/esm/stub/index.js +116 -0
  40. package/dist/esm/stub/index.js.map +1 -1
  41. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  42. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  43. package/package.json +6 -1
  44. package/src/email/README.md +96 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @sapiom/tools
2
2
 
3
+ ## 0.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 84e44e2: Add the `email` capability — programmatic transactional email. Create and manage inboxes, send/list/get messages, reply/reply-all/forward, register and verify custom sending domains, list and read conversation threads, and register webhooks for inbound events. Available as `sapiom.email.*` on the client, as the ambient `email` namespace, and from the `@sapiom/tools/email` subpath. Failed requests throw `EmailHttpError`.
8
+
3
9
  ## 0.10.2
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @sapiom/tools
2
2
 
3
- A typed TypeScript client for Sapiom capabilities — sandboxes, git repositories, coding agents, file storage, content generation, search, orchestrations, and schedules — authenticated to your tenant.
3
+ A typed TypeScript client for Sapiom capabilities — sandboxes, git repositories, coding agents, file storage, content generation, search, email, orchestrations, and schedules — authenticated to your tenant.
4
4
 
5
5
  These are the same capabilities your Sapiom agents call as tools; this package makes them callable directly from your own code.
6
6
 
@@ -78,6 +78,7 @@ Each capability is a namespace, importable from the barrel or its own subpath (e
78
78
  | `orchestrations` | Run a deployed orchestration, or dispatch one from a step and await its result | [src/orchestrations](./src/orchestrations/README.md) |
79
79
  | `schedules` | Schedule a deployed orchestration to run on a cron, or once at a set time | [src/schedules](./src/schedules/README.md) |
80
80
  | `database` | On-demand Postgres databases, returned with direct connection credentials | [src/database](./src/database/README.md) |
81
+ | `email` | Transactional email — inboxes, messages, sending domains, threads, and inbound webhooks | [src/email](./src/email/README.md) |
81
82
 
82
83
  ## Composing capabilities
83
84
 
@@ -24,6 +24,7 @@ import type { UploadInput, UploadResponse, DownloadUrlResponse, ListOptions, Lis
24
24
  import type { ImageCreateInput, ImageGenerationResult, VideoCreateInput, VideoGenerationResult, VideoLaunchHandle } from "./content-generation/index.js";
25
25
  import type { ScrapeInput, ScrapeResult, WebSearchInput, WebSearchResponse, FindEmailInput, FindEmailResult, VerifyEmailInput, VerifyEmailResult, DomainSearchInput, DomainSearchResult } from "./search/index.js";
26
26
  import type { CreateDatabaseInput, Database } from "./database/index.js";
27
+ import type { CreateInboxInput, Inbox, ListInboxesOptions, InboxList, SendMessageInput, SendResult, ListMessagesOptions, MessageList, Message, ReplyInput, ReplyAllInput, ListThreadsOptions, ThreadList, Thread, CreateDomainInput, Domain, DomainList, CreateWebhookInput, Webhook } from "./email/index.js";
27
28
  export interface Sapiom {
28
29
  readonly sandboxes: {
29
30
  create(opts: SandboxCreateOptions): Promise<Sandbox>;
@@ -122,6 +123,65 @@ export interface Sapiom {
122
123
  /** Delete a database by its id or handle. */
123
124
  delete(idOrHandle: string): Promise<void>;
124
125
  };
126
+ /**
127
+ * Programmatic transactional email — inboxes, messages, sending domains,
128
+ * threads, and inbound-event webhooks. An `inboxId` is the inbox's email address.
129
+ */
130
+ readonly email: {
131
+ /** Create / list / get / delete mailboxes. */
132
+ inboxes: {
133
+ /** Create a new inbox (a real, addressable mailbox). */
134
+ create(input?: CreateInboxInput): Promise<Inbox>;
135
+ /** List the caller's inboxes. */
136
+ list(opts?: ListInboxesOptions): Promise<InboxList>;
137
+ /** Fetch a single inbox by id (its email address). */
138
+ get(inboxId: string): Promise<Inbox>;
139
+ /** Delete an inbox by id. */
140
+ delete(inboxId: string): Promise<void>;
141
+ };
142
+ /** Send / list / get / reply / forward messages. */
143
+ messages: {
144
+ /** Send a new message from an inbox. */
145
+ send(inboxId: string, input: SendMessageInput): Promise<SendResult>;
146
+ /** List messages in an inbox (metadata only — use `get` for the body). */
147
+ list(inboxId: string, opts?: ListMessagesOptions): Promise<MessageList>;
148
+ /** Fetch a single full message (including body). */
149
+ get(inboxId: string, messageId: string): Promise<Message>;
150
+ /** Reply to a message. */
151
+ reply(inboxId: string, messageId: string, input?: ReplyInput): Promise<SendResult>;
152
+ /** Reply to everyone on a message. */
153
+ replyAll(inboxId: string, messageId: string, input?: ReplyAllInput): Promise<SendResult>;
154
+ /** Forward a message to new recipient(s). */
155
+ forward(inboxId: string, messageId: string, input: SendMessageInput): Promise<SendResult>;
156
+ };
157
+ /** Register / verify / read custom sending domains. */
158
+ domains: {
159
+ /** Register a custom sending domain. Returns the DNS records to publish. */
160
+ create(input: CreateDomainInput): Promise<Domain>;
161
+ /** Trigger DNS re-verification; re-fetch with `get` to read the updated status. */
162
+ verify(domainId: string): Promise<void>;
163
+ /** Fetch a domain's full status and DNS records by id. */
164
+ get(domainId: string): Promise<Domain>;
165
+ /** List registered domains (without per-domain status/records). */
166
+ list(): Promise<DomainList>;
167
+ /** Delete a registered domain by id. */
168
+ delete(domainId: string): Promise<void>;
169
+ };
170
+ /** List / get conversation threads. */
171
+ threads: {
172
+ /** List conversation threads in an inbox (without their messages). */
173
+ list(inboxId: string, opts?: ListThreadsOptions): Promise<ThreadList>;
174
+ /** Fetch a single full thread (including its messages). */
175
+ get(inboxId: string, threadId: string): Promise<Thread>;
176
+ };
177
+ /** Register / delete inbound-event webhooks. */
178
+ webhooks: {
179
+ /** Register a webhook for inbound events. The returned `secret` is shown only once. */
180
+ create(input: CreateWebhookInput): Promise<Webhook>;
181
+ /** Delete a webhook by id. */
182
+ delete(id: number): Promise<void>;
183
+ };
184
+ };
125
185
  /**
126
186
  * Derive a client that attributes its calls to a different agent/trace. For the
127
187
  * router case (one process acting for many agents); step-authoring code doesn't
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,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G,OAAO,CAAC,IAAI,CAAC,CAAC;SACnC,CAAC;KACH,CAAC;IACF;;;;OAIG;IACH,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAAC;CAEnD;AAsGD,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,MAAM,CAE7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
@@ -60,6 +60,7 @@ const fileStorage = __importStar(require("./file-storage/index.js"));
60
60
  const contentGeneration = __importStar(require("./content-generation/index.js"));
61
61
  const index_js_6 = require("./search/index.js");
62
62
  const database = __importStar(require("./database/index.js"));
63
+ const email = __importStar(require("./email/index.js"));
63
64
  /** Bind every capability namespace to a transport. `withAttribution` rebinds to a derived one. */
64
65
  function bind(transport) {
65
66
  return {
@@ -118,6 +119,37 @@ function bind(transport) {
118
119
  get: (idOrHandle) => database.get(idOrHandle, transport),
119
120
  delete: (idOrHandle) => database.delete(idOrHandle, transport),
120
121
  },
122
+ email: {
123
+ inboxes: {
124
+ create: (input) => email.createInbox(input, transport),
125
+ list: (opts) => email.listInboxes(opts, transport),
126
+ get: (inboxId) => email.getInbox(inboxId, transport),
127
+ delete: (inboxId) => email.deleteInbox(inboxId, transport),
128
+ },
129
+ messages: {
130
+ send: (inboxId, input) => email.sendMessage(inboxId, input, transport),
131
+ list: (inboxId, opts) => email.listMessages(inboxId, opts, transport),
132
+ get: (inboxId, messageId) => email.getMessage(inboxId, messageId, transport),
133
+ reply: (inboxId, messageId, input) => email.replyMessage(inboxId, messageId, input, transport),
134
+ replyAll: (inboxId, messageId, input) => email.replyAllMessage(inboxId, messageId, input, transport),
135
+ forward: (inboxId, messageId, input) => email.forwardMessage(inboxId, messageId, input, transport),
136
+ },
137
+ domains: {
138
+ create: (input) => email.createDomain(input, transport),
139
+ verify: (domainId) => email.verifyDomain(domainId, transport),
140
+ get: (domainId) => email.getDomain(domainId, transport),
141
+ list: () => email.listDomains(transport),
142
+ delete: (domainId) => email.deleteDomain(domainId, transport),
143
+ },
144
+ threads: {
145
+ list: (inboxId, opts) => email.listThreads(inboxId, opts, transport),
146
+ get: (inboxId, threadId) => email.getThread(inboxId, threadId, transport),
147
+ },
148
+ webhooks: {
149
+ create: (input) => email.createWebhook(input, transport),
150
+ delete: (id) => email.deleteWebhook(id, transport),
151
+ },
152
+ },
121
153
  withAttribution: (attribution) => bind(transport.withAttribution(attribution)),
122
154
  };
123
155
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiQA,oCAEC;AAWD,kDAEC;AAhRD;;;;;;;;;;;;;;;GAeG;AACH,iDAK4B;AAC5B,mDAA+C;AAE/C,sDAAqD;AACrD,+CAK0B;AAS1B,wDAGmC;AAMnC,qEAAuD;AASvD,iFAAmE;AAQnE,gDAM2B;AAa3B,8DAAgD;AA6GhD,kGAAkG;AAClG,SAAS,IAAI,CAAC,SAAoB;IAChC,OAAO;QACL,SAAS,EAAE;YACT,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC;YACjD,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,kBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC;YAC7D,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,kBAAO,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC;YACvD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAO,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;SAC9C;QACD,YAAY,EAAE;YACZ,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAU,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CA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,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC;gBACpE,GAAG,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,CACzB,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC;aAChD;YACD,QAAQ,EAAE;gBACR,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC;gBACxD,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,EAAE,SAAS,CAAC;aACnD;SACF;QACD,eAAe,EAAE,CAAC,WAAW,EAAE,EAAE,CAC/B,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;KAC/C,CAAC;AACJ,CAAC;AAED,SAAgB,YAAY,CAAC,MAAwB;IACnD,OAAO,IAAI,CAAC,IAAI,oBAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,mBAAmB;IACjC,OAAO,IAAI,CAAC,IAAI,oBAAS,CAAC,EAAE,WAAW,EAAE,IAAA,6BAAkB,GAAE,EAAE,CAAC,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Error thrown by the `email` capability when a request fails (non-2xx response).
3
+ * Exposes `status` (HTTP status code) and `body` (parsed JSON body, or raw text
4
+ * when the body isn't JSON) for programmatic inspection.
5
+ */
6
+ export declare class EmailHttpError extends Error {
7
+ readonly status: number;
8
+ readonly body: unknown;
9
+ constructor(message: string, status: number, body: unknown);
10
+ }
11
+ /**
12
+ * Return the response when 2xx, otherwise throw an {@link EmailHttpError}.
13
+ * Parses the error body as JSON when possible; falls back to raw text.
14
+ */
15
+ export declare function ensureOk(response: Response, errorPrefix: string): Promise<Response>;
16
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/email/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;gBAEX,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;CAM3D;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,QAAQ,CAAC,CAcnB"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailHttpError = void 0;
4
+ exports.ensureOk = ensureOk;
5
+ /**
6
+ * Error thrown by the `email` capability when a request fails (non-2xx response).
7
+ * Exposes `status` (HTTP status code) and `body` (parsed JSON body, or raw text
8
+ * when the body isn't JSON) for programmatic inspection.
9
+ */
10
+ class EmailHttpError extends Error {
11
+ constructor(message, status, body) {
12
+ super(message);
13
+ this.name = "EmailHttpError";
14
+ this.status = status;
15
+ this.body = body;
16
+ }
17
+ }
18
+ exports.EmailHttpError = EmailHttpError;
19
+ /**
20
+ * Return the response when 2xx, otherwise throw an {@link EmailHttpError}.
21
+ * Parses the error body as JSON when possible; falls back to raw text.
22
+ */
23
+ async function ensureOk(response, errorPrefix) {
24
+ if (response.ok)
25
+ return response;
26
+ let body;
27
+ const text = await response.text().catch(() => "");
28
+ try {
29
+ body = JSON.parse(text);
30
+ }
31
+ catch {
32
+ body = text;
33
+ }
34
+ throw new EmailHttpError(`${errorPrefix}: ${response.status} ${text}`, response.status, body);
35
+ }
36
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/email/errors.ts"],"names":[],"mappings":";;;AAqBA,4BAiBC;AAtCD;;;;GAIG;AACH,MAAa,cAAe,SAAQ,KAAK;IAIvC,YAAY,OAAe,EAAE,MAAc,EAAE,IAAa;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAVD,wCAUC;AAED;;;GAGG;AACI,KAAK,UAAU,QAAQ,CAC5B,QAAkB,EAClB,WAAmB;IAEnB,IAAI,QAAQ,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAC;IACjC,IAAI,IAAa,CAAC;IAClB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC;QACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,GAAG,IAAI,CAAC;IACd,CAAC;IACD,MAAM,IAAI,cAAc,CACtB,GAAG,WAAW,KAAK,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE,EAC5C,QAAQ,CAAC,MAAM,EACf,IAAI,CACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,391 @@
1
+ /**
2
+ * `email` capability — programmatic transactional email: create inboxes, send and
3
+ * receive messages, manage sending domains and threads, and register webhooks for
4
+ * inbound events. Each inbox is a real, addressable mailbox your code owns.
5
+ *
6
+ * import { email } from "@sapiom/tools"; // ambient auth
7
+ *
8
+ * const inbox = await email.inboxes.create({ username: "support" });
9
+ * await email.messages.send(inbox.inboxId, {
10
+ * to: "customer@example.com",
11
+ * subject: "Welcome",
12
+ * text: "Thanks for signing up!",
13
+ * });
14
+ *
15
+ * Or via an explicit client: `createClient({ apiKey }).email.inboxes.create(...)`.
16
+ *
17
+ * Operations are grouped:
18
+ * - `inboxes` — create / list / get / delete mailboxes
19
+ * - `messages` — send / list / get / reply / replyAll / forward
20
+ * - `domains` — register a custom sending domain, verify it, read status
21
+ * - `threads` — list / get conversation threads
22
+ * - `webhooks` — register / delete inbound-event webhooks
23
+ *
24
+ * An `inboxId` is the inbox's email address; message, thread, and domain ids are
25
+ * opaque strings returned by their create/list calls. Failed requests throw
26
+ * {@link EmailHttpError} (carries `status` + parsed `body`).
27
+ */
28
+ import { Transport } from "../_client/index.js";
29
+ import { EmailHttpError } from "./errors.js";
30
+ export { EmailHttpError };
31
+ /**
32
+ * A recipient field — a single email address or a list of them. Used by `to`,
33
+ * `cc`, `bcc`, and `replyTo`.
34
+ */
35
+ export type Recipients = string | string[];
36
+ /** Verification state of a sending domain. */
37
+ export type DomainStatus = "NOT_STARTED" | "PENDING" | "VERIFYING" | "VERIFIED" | "INVALID" | "FAILED";
38
+ export interface CreateInboxInput {
39
+ /** Local part of the address (before the `@`). Generated for you if omitted. */
40
+ username?: string;
41
+ /** A verified custom sending domain to create the address on. Uses the default domain if omitted. */
42
+ domain?: string;
43
+ /** A display name shown to recipients (e.g. "Acme Support"). */
44
+ displayName?: string;
45
+ /** Your own idempotency / correlation key for the inbox. */
46
+ clientId?: string;
47
+ }
48
+ export interface Inbox {
49
+ /** Unique inbox identifier — this is the inbox's email address. */
50
+ inboxId: string;
51
+ /** The inbox's email address. */
52
+ email: string;
53
+ /** Display name shown to recipients, if set. */
54
+ displayName?: string;
55
+ /** Your idempotency / correlation key, if set at creation. */
56
+ clientId?: string;
57
+ /** ISO-8601 timestamp when the inbox was created. */
58
+ createdAt: string;
59
+ /** ISO-8601 timestamp when the inbox was last updated. */
60
+ updatedAt: string;
61
+ }
62
+ export interface ListInboxesOptions {
63
+ /** Maximum number of inboxes to return (1–100). */
64
+ limit?: number;
65
+ /** Opaque page cursor from a previous response's `nextPageToken`. */
66
+ pageToken?: string;
67
+ }
68
+ export interface InboxList {
69
+ /** Number of inboxes on this page. */
70
+ count: number;
71
+ /** Cursor for the next page, if more exist. Pass it back as `pageToken`. */
72
+ nextPageToken?: string;
73
+ /** Inboxes on the current page. */
74
+ inboxes: Inbox[];
75
+ }
76
+ export interface Attachment {
77
+ /** Unique attachment identifier. */
78
+ attachmentId: string;
79
+ /** Original file name, if available. */
80
+ filename?: string;
81
+ /** MIME content type, if available. */
82
+ contentType?: string;
83
+ /** Size in bytes. */
84
+ size: number;
85
+ }
86
+ export interface Message {
87
+ /** Unique message identifier. */
88
+ messageId: string;
89
+ /** Identifier of the thread this message belongs to. */
90
+ threadId: string;
91
+ /** Identifier of the inbox this message belongs to. */
92
+ inboxId: string;
93
+ /** Sender address. */
94
+ from: string;
95
+ /** Recipient addresses. */
96
+ to: string[];
97
+ /** Carbon-copy addresses, if any. */
98
+ cc?: string[];
99
+ /** Blind carbon-copy addresses, if any. */
100
+ bcc?: string[];
101
+ /** Reply-to addresses, if any. */
102
+ replyTo?: string[];
103
+ /** Subject line, if any. */
104
+ subject?: string;
105
+ /** Short preview of the body. */
106
+ preview?: string;
107
+ /** Plain-text body. */
108
+ text?: string;
109
+ /** HTML body. */
110
+ html?: string;
111
+ /** The plain-text body with quoted reply history removed — the "new" content only. */
112
+ extractedText?: string;
113
+ /** The HTML body with quoted reply history removed — the "new" content only. */
114
+ extractedHtml?: string;
115
+ /** Labels applied to the message. */
116
+ labels: string[];
117
+ /** ISO-8601 timestamp of the message. */
118
+ timestamp: string;
119
+ /** The `messageId` this message is a reply to, if any. */
120
+ inReplyTo?: string;
121
+ /** Message ids referenced by this message (threading chain), if any. */
122
+ references?: string[];
123
+ /** Custom headers on the message, if any. */
124
+ headers?: Record<string, string>;
125
+ /** Attachment metadata, if any. */
126
+ attachments?: Attachment[];
127
+ /** Total size in bytes. */
128
+ size: number;
129
+ /** ISO-8601 timestamp when the record was created. */
130
+ createdAt: string;
131
+ /** ISO-8601 timestamp when the record was last updated. */
132
+ updatedAt: string;
133
+ }
134
+ /**
135
+ * A message as it appears in a list — metadata only (no `text` / `html` /
136
+ * `extractedText` / `extractedHtml` / `replyTo`). Fetch the full message with
137
+ * `messages.get` to read the body.
138
+ */
139
+ export type MessageListItem = Omit<Message, "text" | "html" | "extractedText" | "extractedHtml" | "replyTo">;
140
+ export interface MessageList {
141
+ /** Number of messages on this page. */
142
+ count: number;
143
+ /** Cursor for the next page, if more exist. Pass it back as `pageToken`. */
144
+ nextPageToken?: string;
145
+ /** Messages on the current page (metadata only). */
146
+ messages: MessageListItem[];
147
+ }
148
+ export interface ListMessagesOptions {
149
+ /** Maximum number of messages to return (1–100). */
150
+ limit?: number;
151
+ /** Opaque page cursor from a previous response's `nextPageToken`. */
152
+ pageToken?: string;
153
+ }
154
+ /** The result of a send / reply / forward — identifies the created message and its thread. */
155
+ export interface SendResult {
156
+ /** Identifier of the created message. */
157
+ messageId: string;
158
+ /** Identifier of the thread the message belongs to. */
159
+ threadId: string;
160
+ }
161
+ export interface SendMessageInput {
162
+ /** Recipient(s). Required. */
163
+ to: Recipients;
164
+ /** Carbon-copy recipient(s). */
165
+ cc?: Recipients;
166
+ /** Blind carbon-copy recipient(s). */
167
+ bcc?: Recipients;
168
+ /** Reply-to address(es). */
169
+ replyTo?: Recipients;
170
+ /** Subject line. */
171
+ subject?: string;
172
+ /** Plain-text body. */
173
+ text?: string;
174
+ /** HTML body. */
175
+ html?: string;
176
+ /** Custom headers. Routing/identity/MIME headers are rejected — use the dedicated fields instead. */
177
+ headers?: Record<string, string>;
178
+ /** Labels to apply to the sent message. */
179
+ labels?: string[];
180
+ }
181
+ export interface ReplyInput {
182
+ /** Override the recipient(s). Defaults to the original sender if omitted. */
183
+ to?: Recipients;
184
+ /** Carbon-copy recipient(s). */
185
+ cc?: Recipients;
186
+ /** Blind carbon-copy recipient(s). */
187
+ bcc?: Recipients;
188
+ /** Reply-to address(es). */
189
+ replyTo?: Recipients;
190
+ /** Reply to everyone on the original message. */
191
+ replyAll?: boolean;
192
+ /** Plain-text body. */
193
+ text?: string;
194
+ /** HTML body. */
195
+ html?: string;
196
+ /** Custom headers. Routing/identity/MIME headers are rejected — use the dedicated fields instead. */
197
+ headers?: Record<string, string>;
198
+ /** Labels to apply to the reply. */
199
+ labels?: string[];
200
+ }
201
+ export interface ReplyAllInput {
202
+ /** Reply-to address(es). */
203
+ replyTo?: Recipients;
204
+ /** Plain-text body. */
205
+ text?: string;
206
+ /** HTML body. */
207
+ html?: string;
208
+ /** Custom headers. Routing/identity/MIME headers are rejected — use the dedicated fields instead. */
209
+ headers?: Record<string, string>;
210
+ /** Labels to apply to the reply. */
211
+ labels?: string[];
212
+ }
213
+ export interface Thread {
214
+ /** Unique thread identifier. */
215
+ threadId: string;
216
+ /** Identifier of the inbox this thread belongs to. */
217
+ inboxId: string;
218
+ /** Labels applied to the thread. */
219
+ labels: string[];
220
+ /** ISO-8601 timestamp of the thread's latest activity. */
221
+ timestamp: string;
222
+ /** ISO-8601 timestamp of the last received message, if any. */
223
+ receivedTimestamp?: string;
224
+ /** ISO-8601 timestamp of the last sent message, if any. */
225
+ sentTimestamp?: string;
226
+ /** Subject line, if any. */
227
+ subject?: string;
228
+ /** Short preview of the latest message. */
229
+ preview?: string;
230
+ /** Distinct sender addresses in the thread. */
231
+ senders: string[];
232
+ /** Distinct recipient addresses in the thread. */
233
+ recipients: string[];
234
+ /** Identifier of the most recent message in the thread. */
235
+ lastMessageId: string;
236
+ /** Number of messages in the thread. */
237
+ messageCount: number;
238
+ /** Total size in bytes. */
239
+ size: number;
240
+ /** Attachment metadata across the thread, if any. */
241
+ attachments?: Attachment[];
242
+ /** ISO-8601 timestamp when the record was created. */
243
+ createdAt: string;
244
+ /** ISO-8601 timestamp when the record was last updated. */
245
+ updatedAt: string;
246
+ /** The messages in the thread, oldest to newest. */
247
+ messages: Message[];
248
+ }
249
+ /** A thread as it appears in a list — without the `messages` array. */
250
+ export type ThreadListItem = Omit<Thread, "messages">;
251
+ export interface ThreadList {
252
+ /** Number of threads on this page. */
253
+ count: number;
254
+ /** Cursor for the next page, if more exist. Pass it back as `pageToken`. */
255
+ nextPageToken?: string;
256
+ /** Threads on the current page (without their messages). */
257
+ threads: ThreadListItem[];
258
+ }
259
+ export interface ListThreadsOptions {
260
+ /** Maximum number of threads to return (1–100). */
261
+ limit?: number;
262
+ /** Opaque page cursor from a previous response's `nextPageToken`. */
263
+ pageToken?: string;
264
+ }
265
+ export interface CreateDomainInput {
266
+ /** Fully-qualified domain to register, e.g. "mail.example.com". Required. */
267
+ domain: string;
268
+ /** Enable bounce/complaint feedback for this domain. Defaults to false. */
269
+ feedbackEnabled?: boolean;
270
+ }
271
+ /** A DNS record you must publish to verify a domain. */
272
+ export interface DomainRecord {
273
+ /** Record type. */
274
+ type: "TXT" | "CNAME" | "MX";
275
+ /** Record name (host). */
276
+ name: string;
277
+ /** Record value. */
278
+ value: string;
279
+ /** Whether the record has been observed as published and valid. */
280
+ status: "MISSING" | "INVALID" | "VALID";
281
+ /** Priority — present only for MX records. */
282
+ priority?: number;
283
+ }
284
+ export interface Domain {
285
+ /** Unique domain identifier. */
286
+ domainId: string;
287
+ /** The registered domain. */
288
+ domain: string;
289
+ /** Verification status. */
290
+ status: DomainStatus;
291
+ /** Whether bounce/complaint feedback is enabled. */
292
+ feedbackEnabled: boolean;
293
+ /** DNS records to publish to verify the domain. */
294
+ records: DomainRecord[];
295
+ /** ISO-8601 timestamp when the domain was created. */
296
+ createdAt: string;
297
+ /** ISO-8601 timestamp when the domain was last updated (bumps as verification re-checks DNS). */
298
+ updatedAt: string;
299
+ }
300
+ /**
301
+ * A domain as it appears in a list — without the `status` and `records` fields.
302
+ * Call `domains.get` for the full status and DNS records.
303
+ */
304
+ export interface DomainListItem {
305
+ /** Unique domain identifier. */
306
+ domainId: string;
307
+ /** The registered domain. */
308
+ domain: string;
309
+ /** Whether bounce/complaint feedback is enabled. */
310
+ feedbackEnabled: boolean;
311
+ /** ISO-8601 timestamp when the domain was created. */
312
+ createdAt: string;
313
+ /** ISO-8601 timestamp when the domain was last updated. */
314
+ updatedAt: string;
315
+ }
316
+ export interface DomainList {
317
+ /** Number of domains. */
318
+ count: number;
319
+ /** Domains (without status/records). */
320
+ domains: DomainListItem[];
321
+ }
322
+ export interface CreateWebhookInput {
323
+ /** HTTPS URL to deliver events to. Required. */
324
+ url: string;
325
+ /**
326
+ * The event to subscribe to (e.g. "message.received"), or "*" for all events.
327
+ * Required.
328
+ */
329
+ eventType: string;
330
+ }
331
+ export interface Webhook {
332
+ /** Unique webhook identifier. */
333
+ id: number;
334
+ /** The delivery URL. */
335
+ url: string;
336
+ /** The subscribed event type ("*" for all). */
337
+ eventType: string;
338
+ /**
339
+ * Signing secret for verifying delivered event signatures. Returned only at
340
+ * creation time — store it now; it cannot be retrieved later.
341
+ */
342
+ secret: string;
343
+ }
344
+ /** Create a new inbox (a real, addressable mailbox). */
345
+ export declare function createInbox(input?: CreateInboxInput, transport?: Transport, baseUrl?: string): Promise<Inbox>;
346
+ /** List the caller's inboxes. */
347
+ export declare function listInboxes(opts?: ListInboxesOptions, transport?: Transport, baseUrl?: string): Promise<InboxList>;
348
+ /** Fetch a single inbox by id (the inbox's email address). */
349
+ export declare function getInbox(inboxId: string, transport?: Transport, baseUrl?: string): Promise<Inbox>;
350
+ /** Delete an inbox by id. */
351
+ declare function deleteInbox(inboxId: string, transport?: Transport, baseUrl?: string): Promise<void>;
352
+ export { deleteInbox };
353
+ /** Send a new message from an inbox. */
354
+ export declare function sendMessage(inboxId: string, input: SendMessageInput, transport?: Transport, baseUrl?: string): Promise<SendResult>;
355
+ /** List messages in an inbox (metadata only — use `get` for the body). */
356
+ export declare function listMessages(inboxId: string, opts?: ListMessagesOptions, transport?: Transport, baseUrl?: string): Promise<MessageList>;
357
+ /** Fetch a single full message (including body) by id. */
358
+ export declare function getMessage(inboxId: string, messageId: string, transport?: Transport, baseUrl?: string): Promise<Message>;
359
+ /** Reply to a message. */
360
+ export declare function replyMessage(inboxId: string, messageId: string, input?: ReplyInput, transport?: Transport, baseUrl?: string): Promise<SendResult>;
361
+ /** Reply to everyone on a message. */
362
+ export declare function replyAllMessage(inboxId: string, messageId: string, input?: ReplyAllInput, transport?: Transport, baseUrl?: string): Promise<SendResult>;
363
+ /** Forward a message to new recipient(s). */
364
+ export declare function forwardMessage(inboxId: string, messageId: string, input: SendMessageInput, transport?: Transport, baseUrl?: string): Promise<SendResult>;
365
+ /** List conversation threads in an inbox (without their messages). */
366
+ export declare function listThreads(inboxId: string, opts?: ListThreadsOptions, transport?: Transport, baseUrl?: string): Promise<ThreadList>;
367
+ /** Fetch a single full thread (including its messages) by id. */
368
+ export declare function getThread(inboxId: string, threadId: string, transport?: Transport, baseUrl?: string): Promise<Thread>;
369
+ /** Register a custom sending domain. Returns the DNS records to publish. */
370
+ export declare function createDomain(input: CreateDomainInput, transport?: Transport, baseUrl?: string): Promise<Domain>;
371
+ /**
372
+ * Trigger DNS re-verification for a domain. Returns nothing — re-fetch the domain
373
+ * with `domains.get` to read the updated status and records.
374
+ */
375
+ export declare function verifyDomain(domainId: string, transport?: Transport, baseUrl?: string): Promise<void>;
376
+ /** Fetch a domain's full status and DNS records by id. */
377
+ export declare function getDomain(domainId: string, transport?: Transport, baseUrl?: string): Promise<Domain>;
378
+ /** List registered domains (without per-domain status/records). */
379
+ export declare function listDomains(transport?: Transport, baseUrl?: string): Promise<DomainList>;
380
+ /** Delete a registered domain by id. */
381
+ declare function deleteDomain(domainId: string, transport?: Transport, baseUrl?: string): Promise<void>;
382
+ export { deleteDomain };
383
+ /**
384
+ * Register a webhook for inbound events. The returned `secret` is shown only once —
385
+ * store it to verify delivered event signatures.
386
+ */
387
+ export declare function createWebhook(input: CreateWebhookInput, transport?: Transport, baseUrl?: string): Promise<Webhook>;
388
+ /** Delete a webhook by id. */
389
+ declare function deleteWebhook(id: number, transport?: Transport, baseUrl?: string): Promise<void>;
390
+ export { deleteWebhook };
391
+ //# sourceMappingURL=index.d.ts.map