@bernierllc/nevarmail 0.5.0 → 0.6.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
@@ -151,6 +151,7 @@ yourself can narrow a block; a default the server resolves cannot.
151
151
  | `listContacts` / `upsertContacts` / `updateContact` / `deleteContact` | `/api/v1/contacts` | `contacts:read` / `contacts:write` |
152
152
  | `listSenders` / `createSender(input)` — `input.projectId?` targets a project when the org has more than one | `/api/v1/senders` | `senders:read` / `senders:write` |
153
153
  | `getSender` / `updateSender` / `deleteSender` | `/api/v1/senders/{id}` | `senders:read` / `senders:write` |
154
+ | `importSenders({ projectId? })` — adopts the project's provider-account identities; re-run to pick up provider verification | `POST /api/v1/senders/import` | `senders:write` |
154
155
  | `listDomains` / `createDomain(domain, { projectId })` / `getDomain` / `deleteDomain` | `/api/v1/domains` | `domains:read` / `domains:write` |
155
156
  | `getDomainDnsRecords` / `verifyDomain` | `/api/v1/domains/{id}/…` | `domains:read` / `domains:write` |
156
157
  | `listSuppressions` / `addSuppressions` | `/api/v1/suppressions` | `org:read` / `org:write` |
package/dist/index.d.ts CHANGED
@@ -253,6 +253,17 @@ export interface CreateSenderInput {
253
253
  }
254
254
  /** A sender stays in the project it was created in, so `projectId` is create-only. */
255
255
  export type UpdateSenderInput = Partial<Omit<CreateSenderInput, "projectId">>;
256
+ /** Result of `importSenders`: counts per outcome, then the project's senders. */
257
+ export interface ImportSendersResult {
258
+ /** Provider identities with no NevarMail sender yet — created. */
259
+ imported: number;
260
+ /** Existing senders matched by address and stamped with the provider id. */
261
+ linked: number;
262
+ /** Already-imported senders whose address or verification changed at the provider. */
263
+ refreshed: number;
264
+ unchanged: number;
265
+ senders: Sender[];
266
+ }
256
267
  export interface DnsRecord {
257
268
  type: "TXT" | "CNAME" | "MX";
258
269
  host: string;
@@ -468,6 +479,18 @@ export declare class NevarMail {
468
479
  listSenders(options?: PageOptions): Promise<Paginated<Sender>>;
469
480
  /** POST /api/v1/senders */
470
481
  createSender(input: CreateSenderInput): Promise<Sender>;
482
+ /**
483
+ * POST /api/v1/senders/import — adopt the sender identities already at the
484
+ * project's connected provider account instead of creating parallel ones.
485
+ * Idempotent; re-run it to pick up verification completed at the provider.
486
+ * `projectId` follows `createSender`: omit it only when the org has one
487
+ * project (else 400 `PROJECT_REQUIRED`); 404 `NOT_FOUND` for a project the
488
+ * key's user can't open; 400 `VALIDATION_ERROR` when that project has no
489
+ * connected provider account.
490
+ */
491
+ importSenders(options?: {
492
+ projectId?: string;
493
+ }): Promise<ImportSendersResult>;
471
494
  /** GET /api/v1/senders/{id} — 404 NOT_FOUND. */
472
495
  getSender(id: string): Promise<Sender>;
473
496
  /** PATCH /api/v1/senders/{id} — a partial update; the route has no PUT. */
package/dist/index.js CHANGED
@@ -311,6 +311,20 @@ export class NevarMail {
311
311
  createSender(input) {
312
312
  return this.request("POST", "/api/v1/senders", { body: input });
313
313
  }
314
+ /**
315
+ * POST /api/v1/senders/import — adopt the sender identities already at the
316
+ * project's connected provider account instead of creating parallel ones.
317
+ * Idempotent; re-run it to pick up verification completed at the provider.
318
+ * `projectId` follows `createSender`: omit it only when the org has one
319
+ * project (else 400 `PROJECT_REQUIRED`); 404 `NOT_FOUND` for a project the
320
+ * key's user can't open; 400 `VALIDATION_ERROR` when that project has no
321
+ * connected provider account.
322
+ */
323
+ importSenders(options = {}) {
324
+ return this.request("POST", "/api/v1/senders/import", {
325
+ query: { projectId: options.projectId },
326
+ });
327
+ }
314
328
  /** GET /api/v1/senders/{id} — 404 NOT_FOUND. */
315
329
  getSender(id) {
316
330
  return this.request("GET", `/api/v1/senders/${encodeURIComponent(id)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bernierllc/nevarmail",
3
- "version": "0.5.0",
3
+ "version": "0.6.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",