@bernierllc/nevarmail 0.8.0 → 0.9.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
@@ -123,14 +123,21 @@ request into three. Sends are not idempotent; a retry after a `5xx` may deliver
123
123
 
124
124
  ## Use cases and suppression scope
125
125
 
126
+ Suppressions are per project. `checkSuppression(email, useCaseId?, projectId?)` answers for
127
+ one project: `projectId`, else the project of `useCaseId`, else the organization's only
128
+ project. An organization with several projects gets `400 PROJECT_REQUIRED` when neither is
129
+ passed. A bounce or spam complaint on a provider account blocks every project; any other
130
+ suppression blocks only its own.
131
+
126
132
  `use_case_id` names the message category a send belongs to. It is the difference between
127
133
  "this person unsubscribed from your newsletter" and "this person can no longer be emailed":
128
134
 
129
- - **Name it**, and an opt-out scoped to a *different* category does not block the send.
130
- - **Omit it**, and every active suppression on that address applies — the strict reading.
135
+ - **Name it**, and an opt-out from a *different* category's list does not block the send,
136
+ and a category marked non-suppressable is exempt from opt-outs.
137
+ - **Omit it**, and every active suppression of the project applies — the strict reading.
131
138
 
132
- Bounces and spam complaints block everything regardless. Only a `use_case_id` you passed
133
- yourself can narrow a block; a default the server resolves cannot.
139
+ Bounces, spam complaints and manual suppressions block every category regardless. Only a
140
+ `use_case_id` you passed yourself can narrow a block; a default the server resolves cannot.
134
141
 
135
142
  ## Methods
136
143
 
package/dist/index.d.ts CHANGED
@@ -431,10 +431,13 @@ export declare class NevarMail {
431
431
  cancelled: boolean;
432
432
  }>;
433
433
  /**
434
- * GET /api/v1/suppressions/check — would a send to this address be blocked?
435
- * Omitting `useCaseId` is the strict answer: every active suppression counts.
434
+ * GET /api/v1/suppressions/check — would a send from this project to this
435
+ * address be blocked? Suppressions are per project. `projectId` defaults to
436
+ * the use case's project, else the org's only one (400 PROJECT_REQUIRED in a
437
+ * multi-project org). Omitting `useCaseId` is the strict answer: every list
438
+ * opt-out of the project counts.
436
439
  */
437
- checkSuppression(email: string, useCaseId?: string): Promise<SuppressionCheck>;
440
+ checkSuppression(email: string, useCaseId?: string, projectId?: string): Promise<SuppressionCheck>;
438
441
  /** GET /api/v1/preferences — one recipient's per-category subscriptions. */
439
442
  getPreferences(email: string): Promise<RecipientPreferences>;
440
443
  /**
package/dist/index.js CHANGED
@@ -216,12 +216,15 @@ export class NevarMail {
216
216
  return this.request("DELETE", `/api/v1/email/schedule/${encodeURIComponent(id)}`);
217
217
  }
218
218
  /**
219
- * GET /api/v1/suppressions/check — would a send to this address be blocked?
220
- * Omitting `useCaseId` is the strict answer: every active suppression counts.
219
+ * GET /api/v1/suppressions/check — would a send from this project to this
220
+ * address be blocked? Suppressions are per project. `projectId` defaults to
221
+ * the use case's project, else the org's only one (400 PROJECT_REQUIRED in a
222
+ * multi-project org). Omitting `useCaseId` is the strict answer: every list
223
+ * opt-out of the project counts.
221
224
  */
222
- checkSuppression(email, useCaseId) {
225
+ checkSuppression(email, useCaseId, projectId) {
223
226
  return this.request("GET", "/api/v1/suppressions/check", {
224
- query: { email, use_case_id: useCaseId },
227
+ query: { email, use_case_id: useCaseId, project_id: projectId },
225
228
  });
226
229
  }
227
230
  /** GET /api/v1/preferences — one recipient's per-category subscriptions. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bernierllc/nevarmail",
3
- "version": "0.8.0",
3
+ "version": "0.9.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",