@bernierllc/nevarmail 0.15.0 → 0.16.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 +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -164,6 +164,7 @@ Bounces, spam complaints and manual suppressions block every category regardless
|
|
|
164
164
|
| `listDomains` / `createDomain(domain, { projectId })` / `getDomain` / `deleteDomain` | `/api/v1/domains` | `domains:read` / `domains:write` |
|
|
165
165
|
| `getDomainDnsRecords` / `verifyDomain` | `/api/v1/domains/{id}/…` | `domains:read` / `domains:write` |
|
|
166
166
|
| `listSuppressions` / `addSuppressions` | `/api/v1/suppressions` | `org:read` / `org:write` |
|
|
167
|
+
| `getProjectAddress(projectId)` / `setProjectAddress(projectId, { physicalAddress, addressComponents? })` | `GET` / `PUT /api/v1/projects/{id}/address` | `org:read` / `org:write` |
|
|
167
168
|
| `getInboxDbStatus` | `GET /api/v1/inbox-db/status` | `org:read` |
|
|
168
169
|
| `connectInboxDb({ connectionString, provider? })` / `testInboxDbConnection` | `POST /api/v1/inbox-db/connection` / `…/connection/test` | `org:write` |
|
|
169
170
|
|
package/dist/index.d.ts
CHANGED
|
@@ -505,6 +505,30 @@ export interface ConnectInboxDbInput {
|
|
|
505
505
|
/** Defaults to `byo`. */
|
|
506
506
|
provider?: InboxDbProvider;
|
|
507
507
|
}
|
|
508
|
+
/** One structured part of a postal address (Places-style `addressComponents`). */
|
|
509
|
+
export interface AddressComponent {
|
|
510
|
+
longText: string;
|
|
511
|
+
shortText: string;
|
|
512
|
+
types: string[];
|
|
513
|
+
languageCode?: string;
|
|
514
|
+
}
|
|
515
|
+
/** A project's CAN-SPAM postal address, the one its marketing mail's footer prints. */
|
|
516
|
+
export interface ProjectAddress {
|
|
517
|
+
physicalAddress: string;
|
|
518
|
+
addressComponents: AddressComponent[] | null;
|
|
519
|
+
}
|
|
520
|
+
/** `getProjectAddress`: the project's address plus the org's as a suggestion. */
|
|
521
|
+
export interface ProjectAddressWithOrg extends ProjectAddress {
|
|
522
|
+
/** Empty when the org has no address set. */
|
|
523
|
+
orgPhysicalAddress: string;
|
|
524
|
+
orgAddressComponents: AddressComponent[] | null;
|
|
525
|
+
}
|
|
526
|
+
export interface SetProjectAddressInput {
|
|
527
|
+
/** Never blank: 422 `PHYSICAL_ADDRESS_REQUIRED`. Trimmed; max 500 chars. */
|
|
528
|
+
physicalAddress: string;
|
|
529
|
+
/** Omitted or null clears any stored parts. Max 30. */
|
|
530
|
+
addressComponents?: AddressComponent[] | null;
|
|
531
|
+
}
|
|
508
532
|
export interface NevarMailOptions {
|
|
509
533
|
/**
|
|
510
534
|
* A REST API key (`nvm_api_live_…` / `nvm_api_test_…`). An MCP key is
|
|
@@ -722,6 +746,14 @@ export declare class NevarMail {
|
|
|
722
746
|
listSuppressions(options?: ListSuppressionsOptions): Promise<Paginated<Suppression>>;
|
|
723
747
|
/** POST /api/v1/suppressions — bulk add; see AddSuppressionsInput for the scope rules. */
|
|
724
748
|
addSuppressions(input: AddSuppressionsInput): Promise<AddSuppressionsResult>;
|
|
749
|
+
/** GET /api/v1/projects/{id}/address — scope `org:read`; 404 NOT_FOUND for a project the key's user can't open. */
|
|
750
|
+
getProjectAddress(projectId: string): Promise<ProjectAddressWithOrg>;
|
|
751
|
+
/**
|
|
752
|
+
* PUT /api/v1/projects/{id}/address — scope `org:write`. Sets the postal
|
|
753
|
+
* address the CAN-SPAM footer of the project's marketing mail carries; a
|
|
754
|
+
* marketing send is refused without one. Blank: 422 `PHYSICAL_ADDRESS_REQUIRED`.
|
|
755
|
+
*/
|
|
756
|
+
setProjectAddress(projectId: string, input: SetProjectAddressInput): Promise<ProjectAddress>;
|
|
725
757
|
/** GET /api/v1/inbox-db/status — scope `org:read`; 404 when no connection is stored. */
|
|
726
758
|
getInboxDbStatus(): Promise<InboxDbStatus>;
|
|
727
759
|
/**
|
package/dist/index.js
CHANGED
|
@@ -476,6 +476,19 @@ export class NevarMail {
|
|
|
476
476
|
addSuppressions(input) {
|
|
477
477
|
return this.request("POST", "/api/v1/suppressions", { body: input });
|
|
478
478
|
}
|
|
479
|
+
// ── Projects ───────────────────────────────────────────────────────────
|
|
480
|
+
/** GET /api/v1/projects/{id}/address — scope `org:read`; 404 NOT_FOUND for a project the key's user can't open. */
|
|
481
|
+
getProjectAddress(projectId) {
|
|
482
|
+
return this.request("GET", `/api/v1/projects/${encodeURIComponent(projectId)}/address`);
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* PUT /api/v1/projects/{id}/address — scope `org:write`. Sets the postal
|
|
486
|
+
* address the CAN-SPAM footer of the project's marketing mail carries; a
|
|
487
|
+
* marketing send is refused without one. Blank: 422 `PHYSICAL_ADDRESS_REQUIRED`.
|
|
488
|
+
*/
|
|
489
|
+
setProjectAddress(projectId, input) {
|
|
490
|
+
return this.request("PUT", `/api/v1/projects/${encodeURIComponent(projectId)}/address`, { body: input });
|
|
491
|
+
}
|
|
479
492
|
// ── Inbox database ─────────────────────────────────────────────────────
|
|
480
493
|
/** GET /api/v1/inbox-db/status — scope `org:read`; 404 when no connection is stored. */
|
|
481
494
|
getInboxDbStatus() {
|
package/package.json
CHANGED