@billionsend/node 0.2.2 → 0.3.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1 (2026-11-26)
4
+
5
+ The OpenAPI snapshot follows the document the API now publishes (186 operations, as before).
6
+
7
+ - Suppressions carry a `note`, why the entry is blocked: `suppressions.create({ note })` and `suppressions.batch.add({ note })` take one (1 to 500 characters, stored on the rows the request creates; an entry that already exists keeps its own), and every entry answers it (`string | null`, `null` on an entry SES wrote).
8
+ - `domains.get(id)` answers `sending_limits`, the broadcast limit the domain's registrable name is under (read-only, only on this call): `mode` (`warming`, `limited`, `unlimited`, `exempt` or `trusted`), `warmup_day`, `warmup_ends_on`, the running window (`window_started_at`, `cap`, `used`), the growth multiplier `g` with the warnings holding it (`g_reasons`), the deliveries it grows from (`t`, `b`), the recipients waiting for the next window (`parked`, `next_window_at`) and `hard_indicators` (`delivery`, `content_review`, `providers_in_backoff`). Only broadcasts are limited; API, SMTP and automation mail never are.
9
+ - Doc comments follow the published descriptions: a recipient's opt-out from a domain is permanent and covers transactional mail too unless the domain turned on `send_transactional_to_unsubscribed`; a broadcast body without the unsubscribe placeholder gets a default unsubscribe link when it is sent.
10
+
11
+ ## 0.3.0 (2026-11-20)
12
+
13
+ The OpenAPI snapshot follows the document the API now publishes (186 operations, up from 180).
14
+
15
+ - New `brand` resource for the team's default look of the recipient-facing pages: `brand.get()`, `brand.update({ accent_color, font, company_address, powered_by, show_topics })`, `brand.logo.upload({ file })` and `brand.logo.delete()`. `Brand` is typed with `logo_url`, `accent_color`, `font` and `company_address` nullable and the read-only `powered_by_locked` and `branding_locked`. A write needs the manage permission; a domain-scoped key is refused on `/brand` with 403 `restricted_api_key`.
16
+ - New `domains.unsubscribePage.logo.upload(id, { file })` and `.delete(id)` for one domain's own unsubscribe-page logo. An upload is `multipart/form-data` with one `file` part: a `Blob` or `File`, or its bytes (`Uint8Array`, `ArrayBuffer`), PNG, JPEG or WebP, at most 2 MiB (`UploadLogoParams`, exported). A `File` keeps its name and type; otherwise the name (`logo.png`, `logo.jpg`, `logo.webp`) and content type are judged from the bytes, and `filename` / `contentType` override them. It answers `{ object: "logo", logo_url }`; a delete answers `{ object: "logo", deleted: true }`. No logo storage is a 404, a wrong format, a too large file or a missing file a 422.
17
+ - An upload is not repeated after a 5xx, a timeout or a dropped connection (it is a `PUT`, but not safe to repeat blindly); a 429 is still retried.
18
+ - `domains.update({ unsubscribe_page })` takes `support_url` (http(s) only, `null` clears it) and `powered_by` (`true`, `false`, or `null` to follow the team's brand). The page in a domain's answer carries `support_url`, `powered_by` and the read-only `powered_by_effective` (whether recipients really see "Powered by"; always `true` on Free, the saved value is kept). `logo_url` is `null` when no logo is uploaded or the deployment has no logo storage.
19
+ - `broadcasts.create` and `broadcasts.update` take `dormant_check` and `include_dormant` (booleans, optional): by default a contact who got 8 or more broadcasts and automation emails with no tracked open or click for 120 days gets a "still want these?" email instead of the broadcast, and `include_dormant: true` also sends to contacts already marked dormant. `broadcasts.get` answers both (always present).
20
+
3
21
  ## 0.2.2 (2026-11-19)
4
22
 
5
23
  The OpenAPI snapshot follows the document the API now publishes (180 operations, as before).
package/README.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  The official Node.js and TypeScript client for the [BillionSend](https://billionsend.com) email API: send email, run inboxes for people and agents, stream inbox events, verify webhooks, and manage domains, contacts and broadcasts.
4
4
 
5
- - Every API operation, typed from the BillionSend OpenAPI document.
5
+ - A method for each of the 186 operations of the BillionSend API, typed from a snapshot of its OpenAPI document (see [API coverage](#api-coverage)).
6
6
  - Results as `{ data, error, headers }`: methods never throw. Errors are classes you can tell apart with `instanceof`.
7
7
  - Safe sends: every send carries an `Idempotency-Key`, so retries after a timeout never send twice.
8
8
  - Async iterators for every list and for live inbox events, with automatic resume.
9
- - ES modules and CommonJS, with types for both. No runtime dependencies. Node.js 18 or later (any runtime with `fetch` works).
9
+ - ES modules and CommonJS, with types for both. No runtime dependencies. Node.js 18 or later (any runtime with `fetch` works); the CI runs the tests on Node.js 22 and 24 and the built package on 18, 20, 22 and 24.
10
10
 
11
11
  Documentation: [billionsend.com/docs](https://billionsend.com/docs) · SDK guide: [billionsend.com/docs/sdks/node](https://billionsend.com/docs/sdks/node) · Source: [github.com/billionsend/billionsend-node](https://github.com/billionsend/billionsend-node)
12
12
 
@@ -34,7 +34,7 @@ CommonJS works the same way: `const { BillionSend } = require("@billionsend/node
34
34
  ```ts
35
35
  const { data, error } = await bs.emails.send({
36
36
  from: "Acme <hello@acme.dev>",
37
- to: ["ana@example.com"],
37
+ to: ["success@simulator.amazonses.com"],
38
38
  subject: "Welcome to Acme",
39
39
  html: "<p>Glad you are here.</p>",
40
40
  });
@@ -52,7 +52,7 @@ if (error) {
52
52
  await bs.emails.send(message, { idempotencyKey: `welcome/${user.id}` });
53
53
  ```
54
54
 
55
- **Retries.** Failures worth retrying are retried up to `maxRetries` times (default 2): `429`, `5xx`, timeouts and network errors, and the `409 concurrent_idempotent_requests` the API answers while the first attempt with the same key is still running. A `429` is retried for every request, because the API answers it before it writes anything; the other failures (`5xx`, timeouts, network errors, the `409`) only for requests safe to repeat: `GET`, `PUT`, `DELETE` and the sending operations above. The client waits as `retry-after` asks, or backs off exponentially (0.5 s, 1 s, 2 s … up to 8 s, with jitter); a `retry-after` over a minute is not waited for, and the error comes back instead.
55
+ **Retries.** Failures worth retrying are retried up to `maxRetries` times (default 2): `429`, `5xx`, timeouts and network errors, and the `409 concurrent_idempotent_requests` the API answers while the first attempt with the same key is still running. A `429` is retried for every request, because the API answers it before it writes anything; the other failures (`5xx`, timeouts, network errors, the `409`) only for requests safe to repeat: `GET`, `PUT`, `DELETE` and the sending operations above (a logo upload, although a `PUT`, is not repeated after them). The client waits as `retry-after` asks, or backs off exponentially (0.5 s, 1 s, 2 s … up to 8 s, with jitter); a `retry-after` over a minute is not waited for, and the error comes back instead.
56
56
 
57
57
  ```ts
58
58
  const bs = new BillionSend({ apiKey: "bs_...", maxRetries: 4 });
@@ -78,10 +78,12 @@ Every method resolves to one of:
78
78
  | `NotFoundError` | `404` |
79
79
  | `ConflictError` | `409`, such as an idempotency key reused with a different payload |
80
80
  | `RateLimitError` | `429`; `retryAfter` holds the server's hint in seconds |
81
- | `APIError` | `5xx` |
81
+ | `APIError` | `5xx`; `retryAfter` holds the server's hint in seconds, `null` without one |
82
82
  | `APIConnectionError` | no answer: DNS, connection or TLS failure (`statusCode` is `null`) |
83
83
  | `APITimeoutError` | the request timed out (a subclass of `APIConnectionError`) |
84
84
 
85
+ Any other status (such as `402` or `413`) comes back as a plain `BillionSendError` with its `statusCode`, and so does a call that could not be sent at all, with no request made and no retry: `name: "invalid_header"` for a header value HTTP cannot carry (only printable ASCII; the message names the header, never its value), and `application_error` for a path parameter that is empty, `.` or `..`, or for a call aborted through its `signal`. `WebhookVerificationError` (below) is a `BillionSendError` too.
86
+
85
87
  Each carries `statusCode`, `name` (the API's error name, such as `validation_error`; `application_error` when the API sent none), `message` and `requestId`, the answer's `x-request-id`: the same id the request has on the dashboard's Logs page, so quote it when you ask about a request.
86
88
 
87
89
  ```ts
@@ -105,7 +107,7 @@ for await (const contact of bs.contacts.listAll({ limit: 100 })) {
105
107
  }
106
108
  ```
107
109
 
108
- Thread search has `searchAll`. Starting with `before` walks backward. `paginate(fetchPage)` builds the same iterator over any page fetcher.
110
+ Thread search has `searchAll`, and the two broadcast lists `broadcasts.recipientsAll` and `broadcasts.clickedLinksAll`. Starting with `before` walks backward. `paginate(fetchPage)` builds the same iterator over any page fetcher.
109
111
 
110
112
  ## An agent's inbox: wait, read, reply
111
113
 
@@ -155,7 +157,7 @@ const { data: code } = await bs.inboxes.codes.latest("support@acme.dev", { from:
155
157
  - `InboxStreamEvent`: `{ id, event, data }`, where `event` is the webhook event name (`inbox.email.received`, `inbox.thread.created`, `inbox.draft.sent`, `email.received`, …) and `data` is `{ type, created_at, inbox_id, data }`, the webhook payload's metadata with the ids to read next (`thread_id`, `email_id`, `draft_id`).
156
158
  - `StreamGapEvent`: `{ id: null, event: "stream.gap", data: { reason } }` when the stream resumed from further back than the server keeps (24 hours): events may be missing, so read the lists again. One stream hands it out once per position.
157
159
 
158
- When the connection drops (the server also closes every stream about every ten minutes), the stream reconnects with `Last-Event-ID` and replays what it missed before the live events. A connection that delivers nothing, not even the server's keep-alive comment (sent every 15 seconds), for `idleTimeoutMs` (default 45 seconds, `0` turns it off) counts as dropped, so a connection that died silently cannot hang the loop. `maxReconnects` (default 5) bounds the reconnects that fail in a row; one that opens the stream resets the count. A reconnect the API refuses with a `Retry-After` waits that long (longer than 60 seconds: that error is thrown at once). When the reconnects run out, the last one's error is thrown: the API's answer as its own class (`RateLimitError`, `APIError`), or an `APIConnectionError` when the API could not be reached; a refusal a retry cannot fix (a revoked key) is thrown at once. One inbox's stream ends after that inbox's `inbox.deleted` or `inbox.expired`.
160
+ When the connection drops (the server also closes every stream about every ten minutes), the stream reconnects with `Last-Event-ID` and replays what it missed before the live events. A connection that delivers nothing, not even the server's keep-alive comment (sent every 15 seconds), for `idleTimeoutMs` (default 45 seconds, `0` turns it off) counts as dropped, so a connection that died silently cannot hang the loop. `maxReconnects` (default 5) bounds the reconnects that fail in a row; one that opens the stream resets the count. A reconnect the API refuses with a `Retry-After` waits that long (longer than 60 seconds: that error is thrown at once). When the reconnects run out, the last one's error is thrown: the API's answer as its own class (`RateLimitError`, `APIError`), or an `APIConnectionError` when the API could not be reached; a refusal a retry cannot fix (a revoked key) is thrown at once. One inbox's stream ends after that inbox's `inbox.deleted` or `inbox.expired`. Streams are capped per key and per team: one opened over the cap resolves to a `RateLimitError` (`too_many_streams`).
159
161
 
160
162
  ```ts
161
163
  const opened = await bs.inboxes.events.stream({ types: "inbox.email.received,inbox.thread.created" }, {
@@ -192,7 +194,7 @@ app.post("/webhooks/billionsend", express.raw({ type: "application/json" }), asy
192
194
  });
193
195
  ```
194
196
 
195
- With the Fetch API (Next.js route handlers, Hono, Bun, Deno, workers) it is `await verifyWebhook(await request.text(), request.headers, secret)`. During a secret rotation a delivery carries a signature for each live secret, and either secret verifies it.
197
+ With the Fetch API (Next.js route handlers, Hono, Bun, Deno, workers) it is `await verifyWebhook(await request.text(), request.headers, secret)`. During a secret rotation a delivery carries a signature for each live secret, and either secret verifies it. The fourth argument takes `{ tolerance }` (seconds, default 300) to change how far the timestamp may be from now.
196
198
 
197
199
  Deliveries come from `51.161.117.92` with the user agent `BillionSend-Webhooks/1.0 (+https://billionsend.com/docs/concepts/webhooks)`; when the receiving end sits behind a WAF or Cloudflare, allow them as the [webhooks guide](https://billionsend.com/docs/concepts/webhooks) describes.
198
200
 
@@ -211,6 +213,21 @@ if (started.error) throw started.error;
211
213
  const done = await bs.contacts.imports.get(started.data.id); // status: queued, in_progress, completed or failed
212
214
  ```
213
215
 
216
+ ## Brand and logos
217
+
218
+ `brand` is the team's default look for the pages recipients see (`get`, `update`, `logo`); a domain can set its own on `domains.update({ unsubscribe_page })` and `domains.unsubscribePage.logo`. A logo is a PNG, JPEG or WebP of at most 2 MiB: pass a `Blob` / `File` or its bytes (the file name and content type come from the `File` or the bytes, or from `filename` / `contentType`). `logo_url` is `null` while none is uploaded; `powered_by_effective` tells whether recipients really see "Powered by" (a Free plan always does).
219
+
220
+ ```ts
221
+ const logo = new Blob([await readFile("logo.png")], { type: "image/png" });
222
+ await bs.brand.logo.upload({ file: logo });
223
+ await bs.brand.update({ accent_color: "#2B44FF", font: "serif", show_topics: true });
224
+
225
+ await bs.domains.unsubscribePage.logo.upload(domainId, { file: logo });
226
+ await bs.domains.update(domainId, {
227
+ unsubscribe_page: { support_url: "https://acme.dev/help", powered_by: null }, // null follows the team's brand
228
+ });
229
+ ```
230
+
214
231
  ## Agent sign-up
215
232
 
216
233
  An agent can create its own account with no API key; the answer carries the new key and inbox.
@@ -250,10 +267,11 @@ Every method takes a last `options` argument with `signal`, `headers`, `timeoutM
250
267
  | --- | --- |
251
268
  | `emails` | send, batch, list, get, update, cancel, delete, insights, share, unshare, `metrics` (the time series; `metrics.links`, `metrics.countries`, `metrics.clients`), `attachments` (list, get) |
252
269
  | `emails.receiving` | received mail: list, get, delete, reply, forward, `attachments` (list, get, text) |
253
- | `domains` | create, list, get, update, delete, verify, `claims` (create, get, verify) |
270
+ | `domains` | create, list, get, update, delete, verify, `claims` (create, get, verify), `unsubscribePage.logo` (upload, delete) |
271
+ | `brand` | get, update, `logo` (upload, delete) |
254
272
  | `apiKeys` | create, list, update, delete |
255
- | `contacts` | create, list, get, update, delete, preferences link, `batch`, `imports` (create, list, get), `topics`, `segments` (list, add, remove) |
256
- | `audiences.contacts` | contacts addressed through an audience |
273
+ | `contacts` | create, list, get, update, delete, preferences link, `batch` (create, get, remove), `imports` (create, list, get), `topics` (list, update), `segments` (list, add, remove) |
274
+ | `audiences.contacts` | contacts addressed through an audience: create, get, update, delete |
257
275
  | `contactProperties`, `segments`, `topics` | create, list, get, update, delete (segment contacts under `segments.contacts`) |
258
276
  | `broadcasts` | create, list, get, update, delete, send, duplicate, cancel, recipients, clickedLinks |
259
277
  | `templates` | create, list, get, update, delete, publish, duplicate |
@@ -266,16 +284,25 @@ Every method takes a last `options` argument with `signal`, `headers`, `timeoutM
266
284
  | `automations` | create, list, get, update, remove, validate, duplicate, simulate, stop, metrics, `runs` (list, get, cancel) |
267
285
  | `logs` | list, get |
268
286
  | `oauthGrants` | list, revoke |
269
- | `inboxes` | create, list, get, update, delete, send, `agent` (get, update), `safety`, `labels`, `threads` (search, labels, emails, reply, forward), `quarantine`, `codes`, `drafts`, `events` |
287
+ | `inboxes` | create, list, get, update, delete, send, `agent` (get, update), `safety`, `labels`, `threads` (list, get, update, delete, search, `labels`, `emails`: list, get, reply, forward), `quarantine` (list, release), `codes` (latest), `drafts` (create, list, get, update, delete, send, reject), `events` (stream, streamInbox) |
270
288
  | `agent` | signup, status, claimEmail |
271
289
 
272
290
  Method names are camelCase; request and response fields keep the API's snake_case names. All request and response types are exported, named after the API's schemas (`SendEmailRequest`, `Inbox`, …).
273
291
 
292
+ ## API coverage
293
+
294
+ Every operation of the API's OpenAPI document has its method: the 186 `operationId`s are the methods' dotted paths (`emails.send`, `inboxes.threads.emails.reply`). The types are generated from `openapi/api.openapi.json`, the snapshot taken for version 0.3.0, so they follow that snapshot and not the API's later schema changes. Two additions are missing from the types, though the API takes and returns them:
295
+
296
+ - `suppressions.create` and `suppressions.batch.add` accept `note` (up to 500 characters, why the entry is blocked), and the entries `suppressions.list` and `suppressions.get` return carry `note`.
297
+ - `domains.get` returns `sending_limits` (the domain's broadcast warm-up and sending window: `mode`, `warmup_day`, `warmup_ends_on`, `window_started_at`, `cap`, `used`, `g`, `g_reasons`, `t`, `b`, `parked`, `next_window_at`, `hard_indicators`).
298
+
299
+ The SDK sends a request body as given and returns the answer as the API wrote it, so both work at runtime; only the compiler does not know them. An object literal with `note` fails the type check as an unknown property (build the object in a variable first), and reading `note` or `sending_limits` needs a cast.
300
+
274
301
  ## Development
275
302
 
276
303
  ```bash
277
304
  pnpm install
278
- pnpm typecheck && pnpm lint && pnpm test:coverage # fails below 95% lines and branches of the hand-written code
305
+ pnpm typecheck && pnpm lint && pnpm test:coverage # fails below 95% lines, branches, functions and statements of the hand-written code
279
306
  pnpm build && pnpm test:smoke
280
307
  ```
281
308
 
@@ -294,10 +321,8 @@ pnpm openapi:check # fails when the snapshot differs from the publi
294
321
 
295
322
  Publishing is manual; nothing is published on push.
296
323
 
297
- 1. Set `version` in `package.json`, turn the changelog's `Unreleased` heading into that version, commit, then tag and push: `git tag v0.1.0 && git push origin main v0.1.0`.
298
- 2. The first version only: a member of the `@billionsend` npm organization publishes from a clean checkout of the tag, with two-factor authentication: `pnpm install --frozen-lockfile && pnpm typecheck && pnpm lint && pnpm test && pnpm test:smoke && npm publish` (`prepublishOnly` builds; `publishConfig.access` is `public`).
299
- 3. Once the package exists: on npmjs.com, `@billionsend/node` → Settings → Trusted Publisher → GitHub Actions, repository `billionsend/billionsend-node`, workflow `release.yml`.
300
- 4. Every later version: Actions → `release` → Run workflow, on the version tag. The workflow refuses a branch or a tag that differs from `package.json`, runs every check, and publishes with npm Trusted Publishing (no token stored).
324
+ 1. Set `version` in `package.json` and `src/version.ts`, add the version's section to the changelog, commit, then tag and push: `git tag v<version> && git push origin main v<version>`.
325
+ 2. Actions → `release` → Run workflow, on the version tag. The workflow refuses a branch or a tag that differs from `package.json`, runs every check, and publishes with npm Trusted Publishing (no token stored). That needs `@billionsend/node` on npmjs.com → Settings → Trusted Publisher → GitHub Actions to name repository `billionsend/billionsend-node` and workflow `release.yml`.
301
326
 
302
327
  ## License
303
328
 
package/dist/index.cjs CHANGED
@@ -166,7 +166,7 @@ function sleep(ms, signal) {
166
166
  }
167
167
 
168
168
  // src/version.ts
169
- var VERSION = "0.2.2";
169
+ var VERSION = "0.3.1";
170
170
 
171
171
  // src/core.ts
172
172
  var DEFAULT_BASE_URL = "https://api.billionsend.com";
@@ -328,7 +328,7 @@ var Core = class {
328
328
  );
329
329
  }
330
330
  const keyed = headers["idempotency-key"] !== void 0;
331
- const safeToRepeat = IDEMPOTENT_METHODS.has(method) || keyed;
331
+ const safeToRepeat = IDEMPOTENT_METHODS.has(method) && init.noRepeat !== true || keyed;
332
332
  const maxRetries = options.maxRetries ?? this.maxRetries;
333
333
  const timeoutMs = options.timeoutMs ?? this.timeoutMs;
334
334
  for (let attempt = 0; ; attempt++) {
@@ -460,6 +460,95 @@ function idempotent(options) {
460
460
  return { idempotent: true, idempotencyKey: options?.idempotencyKey, options };
461
461
  }
462
462
 
463
+ // src/resources/brand.ts
464
+ var KINDS = [
465
+ { type: "image/png", extension: "png" },
466
+ { type: "image/jpeg", extension: "jpg" },
467
+ { type: "image/webp", extension: "webp" }
468
+ ];
469
+ function sniff(head) {
470
+ const at = (offset, ...bytes) => bytes.every((byte, i) => head[offset + i] === byte);
471
+ if (at(0, 137, 80, 78, 71, 13, 10, 26, 10)) return KINDS[0];
472
+ if (at(0, 255, 216, 255)) return KINDS[1];
473
+ if (at(0, 82, 73, 70, 70) && at(8, 87, 69, 66, 80)) return KINDS[2];
474
+ return void 0;
475
+ }
476
+ async function logoForm(params) {
477
+ const { file, filename, contentType } = params;
478
+ let blob;
479
+ let named;
480
+ if (file instanceof Blob) {
481
+ blob = file;
482
+ if ("name" in file && typeof file.name === "string" && file.name !== "") named = file.name;
483
+ } else {
484
+ blob = new Blob([file]);
485
+ }
486
+ let type = contentType ?? blob.type;
487
+ let kind;
488
+ if (type === "" || named === void 0) {
489
+ kind = sniff(new Uint8Array(await blob.slice(0, 12).arrayBuffer()));
490
+ if (type === "") type = kind?.type ?? "";
491
+ }
492
+ const form = new FormData();
493
+ form.append(
494
+ "file",
495
+ type === blob.type ? blob : new Blob([blob], { type }),
496
+ filename ?? named ?? `logo.${kind?.extension ?? "png"}`
497
+ );
498
+ return form;
499
+ }
500
+ var BrandLogo = class extends Resource {
501
+ /**
502
+ * `PUT /brand/logo`: uploads the team's logo (PNG, JPEG or WebP, at most 2 MiB)
503
+ * as `multipart/form-data`. An upload is not repeated after a 5xx or a dropped
504
+ * connection (a 429 is).
505
+ */
506
+ async upload(params, options) {
507
+ return this.core.request("put", "/brand/logo", {
508
+ form: await logoForm(params),
509
+ noRepeat: true,
510
+ options
511
+ });
512
+ }
513
+ /** `DELETE /brand/logo` */
514
+ delete(options) {
515
+ return this.core.request("delete", "/brand/logo", { options });
516
+ }
517
+ };
518
+ var Brand = class extends Resource {
519
+ logo = new BrandLogo(this.core);
520
+ /** `GET /brand` */
521
+ get(options) {
522
+ return this.core.request("get", "/brand", { options });
523
+ }
524
+ /** `PATCH /brand`: fields not sent keep their value. */
525
+ update(payload, options) {
526
+ return this.core.request("patch", "/brand", { body: payload, options });
527
+ }
528
+ };
529
+ var DomainUnsubscribePageLogo = class extends Resource {
530
+ /**
531
+ * `PUT /domains/{id}/unsubscribe-page/logo`: uploads the domain's logo (PNG,
532
+ * JPEG or WebP, at most 2 MiB) as `multipart/form-data`. An upload is not
533
+ * repeated after a 5xx or a dropped connection (a 429 is).
534
+ */
535
+ async upload(id, params, options) {
536
+ return this.core.request("put", "/domains/{id}/unsubscribe-page/logo", {
537
+ path: { id },
538
+ form: await logoForm(params),
539
+ noRepeat: true,
540
+ options
541
+ });
542
+ }
543
+ /** `DELETE /domains/{id}/unsubscribe-page/logo` */
544
+ delete(id, options) {
545
+ return this.core.request("delete", "/domains/{id}/unsubscribe-page/logo", { path: { id }, options });
546
+ }
547
+ };
548
+ var DomainUnsubscribePage = class extends Resource {
549
+ logo = new DomainUnsubscribePageLogo(this.core);
550
+ };
551
+
463
552
  // src/resources/account.ts
464
553
  var DomainClaims = class extends Resource {
465
554
  /** `POST /domains/claim`: starts a claim on a domain another team already holds. */
@@ -477,6 +566,7 @@ var DomainClaims = class extends Resource {
477
566
  };
478
567
  var Domains = class extends Resource {
479
568
  claims = new DomainClaims(this.core);
569
+ unsubscribePage = new DomainUnsubscribePage(this.core);
480
570
  /** `POST /domains` */
481
571
  create(payload, options) {
482
572
  return this.core.request("post", "/domains", { body: payload, options });
@@ -1951,6 +2041,7 @@ var BillionSend = class {
1951
2041
  events;
1952
2042
  logs;
1953
2043
  oauthGrants;
2044
+ brand;
1954
2045
  #core;
1955
2046
  /**
1956
2047
  * @param apiKeyOrOptions An API key (`bs_...`), or options. Without a key the
@@ -1982,6 +2073,7 @@ var BillionSend = class {
1982
2073
  this.events = new Events(core);
1983
2074
  this.logs = new Logs(core);
1984
2075
  this.oauthGrants = new OauthGrants(core);
2076
+ this.brand = new Brand(core);
1985
2077
  }
1986
2078
  /** The API base URL this client calls. */
1987
2079
  get baseUrl() {