@bernierllc/nevarmail 0.12.0 → 0.13.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/dist/index.d.ts CHANGED
@@ -210,7 +210,12 @@ export interface CreateListInput {
210
210
  * ignores it: a list opt-out always applies to that list.
211
211
  */
212
212
  unsubScope?: "list" | "global";
213
- unsubHandler?: "provider" | "hosted" | "custom_html";
213
+ /**
214
+ * Which page the list's unsubscribe link opens. Default `"hosted"`: the
215
+ * project's branded preferences page. `"provider"` is gone:
216
+ * every link already went to the hosted page, so it was a second name for it.
217
+ */
218
+ unsubHandler?: "hosted" | "custom_html";
214
219
  storageTier?: "provider" | "byo_database" | "local";
215
220
  }
216
221
  export interface NewContact {
@@ -474,11 +479,22 @@ export declare class NevarMail {
474
479
  * routes, where dropping it would make `total` unknowable to the caller.
475
480
  */
476
481
  requestPaginated<T>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", path: string, options?: RequestOptions): Promise<Paginated<T>>;
477
- /** POST /api/v1/email/send — one transactional message. */
482
+ /**
483
+ * POST /api/v1/email/send — one transactional message. A marketing send
484
+ * whose use case's list has a Custom HTML unsubscribe page and none saved is
485
+ * a 409 LIST_UNSUB_PAGE_MISSING; the message names where to save one.
486
+ */
478
487
  sendEmail(input: SendEmailInput): Promise<EmailResult>;
479
- /** POST /api/v1/email/send-to-list — one message to every contact on a list. */
488
+ /**
489
+ * POST /api/v1/email/send-to-list — one message to every contact on a list.
490
+ * 409 LIST_UNSUB_PAGE_MISSING while the list's Custom HTML unsubscribe page
491
+ * is unsaved; nobody is mailed.
492
+ */
480
493
  sendEmailToList(input: SendToListInput): Promise<SendToListResult>;
481
- /** POST /api/v1/email/schedule — queue a send for a future instant. */
494
+ /**
495
+ * POST /api/v1/email/schedule — queue a send for a future instant. Same
496
+ * guards as sendEmail at schedule time, including 409 LIST_UNSUB_PAGE_MISSING.
497
+ */
482
498
  scheduleEmail(input: ScheduleEmailInput): Promise<ScheduledEmail>;
483
499
  /** GET /api/v1/email/schedule — the org's scheduled sends, newest first. */
484
500
  listScheduledEmails(): Promise<ScheduledEmail[]>;
package/dist/index.js CHANGED
@@ -197,15 +197,26 @@ export class NevarMail {
197
197
  return true;
198
198
  return options.signal !== undefined && cause?.name === "AbortError";
199
199
  }
200
- /** POST /api/v1/email/send — one transactional message. */
200
+ /**
201
+ * POST /api/v1/email/send — one transactional message. A marketing send
202
+ * whose use case's list has a Custom HTML unsubscribe page and none saved is
203
+ * a 409 LIST_UNSUB_PAGE_MISSING; the message names where to save one.
204
+ */
201
205
  sendEmail(input) {
202
206
  return this.request("POST", "/api/v1/email/send", { body: input });
203
207
  }
204
- /** POST /api/v1/email/send-to-list — one message to every contact on a list. */
208
+ /**
209
+ * POST /api/v1/email/send-to-list — one message to every contact on a list.
210
+ * 409 LIST_UNSUB_PAGE_MISSING while the list's Custom HTML unsubscribe page
211
+ * is unsaved; nobody is mailed.
212
+ */
205
213
  sendEmailToList(input) {
206
214
  return this.request("POST", "/api/v1/email/send-to-list", { body: input });
207
215
  }
208
- /** POST /api/v1/email/schedule — queue a send for a future instant. */
216
+ /**
217
+ * POST /api/v1/email/schedule — queue a send for a future instant. Same
218
+ * guards as sendEmail at schedule time, including 409 LIST_UNSUB_PAGE_MISSING.
219
+ */
209
220
  scheduleEmail(input) {
210
221
  return this.request("POST", "/api/v1/email/schedule", { body: input });
211
222
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bernierllc/nevarmail",
3
- "version": "0.12.0",
3
+ "version": "0.13.1",
4
4
  "description": "Official client for the NevarMail v1 API. Typed, retries 429/5xx, throws NevarMailError on every non-2xx.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",