@bernierllc/nevarmail 0.22.0 → 0.24.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/README.md CHANGED
@@ -165,6 +165,7 @@ the two, not both). The slug must exist in exactly one project the key can open:
165
165
  | `getCampaignAnalytics(id, { projectId? })` — counts plus delivery/open/click/bounce/unsubscribe rates (0 to 1) | `GET /api/v1/campaigns/{id}/analytics` | `analytics:read` |
166
166
  | `listLists` / `createList` / `getList` | `/api/v1/lists` | `contacts:read` / `contacts:write` |
167
167
  | `addListContacts` | `POST /api/v1/lists/{id}/contacts` | `contacts:write` |
168
+ | `removeListContact` | `DELETE /api/v1/lists/{id}/contacts?email=` (one list only; the contact is kept) | `contacts:write` |
168
169
  | `listContacts` / `upsertContacts` / `updateContact` / `deleteContact` | `/api/v1/contacts` | `contacts:read` / `contacts:write` |
169
170
  | `listBusinesses({ projectId?, page?, perPage? })` / `getBusiness(id, { projectId? })` | `GET /api/v1/businesses`, `GET /api/v1/businesses/{id}` | `contacts:read` |
170
171
  | `createBusiness(input)` / `updateBusiness(id, input)` / `deleteBusiness(id, { projectId? })` — update replaces `domains`, merges `attributes`; delete keeps the contacts | `POST /api/v1/businesses`, `PATCH` / `DELETE /api/v1/businesses/{id}` | `contacts:write` |
package/dist/index.d.ts CHANGED
@@ -341,6 +341,15 @@ export interface AddListContactsResult {
341
341
  alreadySubscribed: number;
342
342
  status: "added" | "already_subscribed" | "processing";
343
343
  }
344
+ export interface RemoveListContactResult {
345
+ listId: string;
346
+ email: string;
347
+ tier: "local" | "provider";
348
+ /** Null on a local-tier list. */
349
+ provider: string | null;
350
+ /** "processing" on a provider-tier list: the provider removes asynchronously. */
351
+ status: "removed" | "processing";
352
+ }
344
353
  export interface AggregatedContact {
345
354
  email: string;
346
355
  firstName?: string;
@@ -579,6 +588,11 @@ export interface Suppression {
579
588
  deactivatedBy: string | null;
580
589
  deactivatedByName: string | null;
581
590
  deactivationReason: string | null;
591
+ /**
592
+ * Set when this row was written because the same contact unsubscribed at
593
+ * another address (per-contact unsubscribe scope): that unsubscribe's id.
594
+ */
595
+ fannedOutFromId?: string | null;
582
596
  }
583
597
  export interface ListSuppressionsOptions extends PageOptions {
584
598
  reason?: SuppressionReason;
@@ -824,6 +838,13 @@ export declare class NevarMail {
824
838
  * 404 LIST_NOT_FOUND; 422 LIST_NOT_SYNCED when the provider copy is behind.
825
839
  */
826
840
  addListContacts(listId: string, contacts: NewContact | NewContact[]): Promise<AddListContactsResult>;
841
+ /**
842
+ * DELETE /api/v1/lists/{id}/contacts?email= — take one address off one list.
843
+ * The contact stays on its other lists and on the provider account; erasing
844
+ * it everywhere is `deleteContact`. 404 NOT_SUBSCRIBED when the address is
845
+ * not on the list; 404 NOT_FOUND for an unknown list.
846
+ */
847
+ removeListContact(listId: string, email: string): Promise<RemoveListContactResult>;
827
848
  /** GET /api/v1/contacts — paged; `q` is a substring search. */
828
849
  listContacts(options?: PageOptions & {
829
850
  q?: string;
package/dist/index.js CHANGED
@@ -389,6 +389,15 @@ export class NevarMail {
389
389
  addListContacts(listId, contacts) {
390
390
  return this.request("POST", `/api/v1/lists/${encodeURIComponent(listId)}/contacts`, { body: contacts });
391
391
  }
392
+ /**
393
+ * DELETE /api/v1/lists/{id}/contacts?email= — take one address off one list.
394
+ * The contact stays on its other lists and on the provider account; erasing
395
+ * it everywhere is `deleteContact`. 404 NOT_SUBSCRIBED when the address is
396
+ * not on the list; 404 NOT_FOUND for an unknown list.
397
+ */
398
+ removeListContact(listId, email) {
399
+ return this.request("DELETE", `/api/v1/lists/${encodeURIComponent(listId)}/contacts`, { query: { email } });
400
+ }
392
401
  /** GET /api/v1/contacts — paged; `q` is a substring search. */
393
402
  listContacts(options = {}) {
394
403
  return this.requestPaginated("GET", "/api/v1/contacts", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bernierllc/nevarmail",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
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",