@bernierllc/nevarmail 0.13.1 → 0.14.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 +3 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -162,6 +162,8 @@ Bounces, spam complaints and manual suppressions block every category regardless
|
|
|
162
162
|
| `listDomains` / `createDomain(domain, { projectId })` / `getDomain` / `deleteDomain` | `/api/v1/domains` | `domains:read` / `domains:write` |
|
|
163
163
|
| `getDomainDnsRecords` / `verifyDomain` | `/api/v1/domains/{id}/…` | `domains:read` / `domains:write` |
|
|
164
164
|
| `listSuppressions` / `addSuppressions` | `/api/v1/suppressions` | `org:read` / `org:write` |
|
|
165
|
+
| `getInboxDbStatus` | `GET /api/v1/inbox-db/status` | `org:read` |
|
|
166
|
+
| `connectInboxDb({ connectionString, provider? })` / `testInboxDbConnection` | `POST /api/v1/inbox-db/connection` / `…/connection/test` | `org:write` |
|
|
165
167
|
|
|
166
168
|
Application-level details worth knowing before you hit them:
|
|
167
169
|
|
|
@@ -179,6 +181,7 @@ Application-level details worth knowing before you hit them:
|
|
|
179
181
|
`use_case_id` with `scope: "account"` is a `400`. `projectId` names the project the rows land
|
|
180
182
|
in; omitted, they land in the use case's project, else in every project the key's owner can open.
|
|
181
183
|
- **Managed accounts cannot delete domains** — `deleteDomain` throws `403 MANAGED_ACCOUNT`.
|
|
184
|
+
- **The inbox-db connection string is sent once and never echoed.** `connectInboxDb` stores it encrypted; `InboxDbStatus` omits it. `schemaName` is the Postgres schema NevarMail owns in your database.
|
|
182
185
|
|
|
183
186
|
Anything still not covered — analytics, campaigns, webhook endpoints — goes through
|
|
184
187
|
`request()` (or `requestPaginated()` for list routes), which applies the same auth, envelope
|
package/dist/index.d.ts
CHANGED
|
@@ -439,6 +439,25 @@ export interface AddSuppressionsResult {
|
|
|
439
439
|
invalid: number;
|
|
440
440
|
provider_sync: "queued" | "skipped";
|
|
441
441
|
}
|
|
442
|
+
export type InboxDbProvider = "byo" | "supabase" | "neon";
|
|
443
|
+
/** The org's inbox database as NevarMail last recorded it. Never includes the connection string. */
|
|
444
|
+
export interface InboxDbStatus {
|
|
445
|
+
provider: InboxDbProvider;
|
|
446
|
+
/** `connected` | `error` | `schema_drift` | `schema_conflict` | `pending_verification`. */
|
|
447
|
+
status: string;
|
|
448
|
+
/** The Postgres schema NevarMail owns in the customer database (`nevarmail_<org-slug>_<hash8>`; bare `nevarmail` on connections made before per-org schemas). */
|
|
449
|
+
schemaName: string;
|
|
450
|
+
schemaVersion: string | null;
|
|
451
|
+
pgvectorAvailable: boolean;
|
|
452
|
+
lastHealthCheck: string | null;
|
|
453
|
+
createdAt: string;
|
|
454
|
+
}
|
|
455
|
+
export interface ConnectInboxDbInput {
|
|
456
|
+
/** Postgres connection string; sent once over TLS, stored encrypted, never returned. */
|
|
457
|
+
connectionString: string;
|
|
458
|
+
/** Defaults to `byo`. */
|
|
459
|
+
provider?: InboxDbProvider;
|
|
460
|
+
}
|
|
442
461
|
export interface NevarMailOptions {
|
|
443
462
|
/**
|
|
444
463
|
* A REST API key (`nvm_api_live_…` / `nvm_api_test_…`). An MCP key is
|
|
@@ -626,5 +645,14 @@ export declare class NevarMail {
|
|
|
626
645
|
listSuppressions(options?: ListSuppressionsOptions): Promise<Paginated<Suppression>>;
|
|
627
646
|
/** POST /api/v1/suppressions — bulk add; see AddSuppressionsInput for the scope rules. */
|
|
628
647
|
addSuppressions(input: AddSuppressionsInput): Promise<AddSuppressionsResult>;
|
|
648
|
+
/** GET /api/v1/inbox-db/status — scope `org:read`; 404 when no connection is stored. */
|
|
649
|
+
getInboxDbStatus(): Promise<InboxDbStatus>;
|
|
650
|
+
/**
|
|
651
|
+
* POST /api/v1/inbox-db/connection — scope `org:write`; 201. Throws 422 when the database is
|
|
652
|
+
* unreachable, lacks pgvector/permissions, or already holds another org's schema.
|
|
653
|
+
*/
|
|
654
|
+
connectInboxDb(input: ConnectInboxDbInput): Promise<InboxDbStatus>;
|
|
655
|
+
/** POST /api/v1/inbox-db/connection/test — scope `org:write`; 404 when nothing is stored. */
|
|
656
|
+
testInboxDbConnection(): Promise<InboxDbStatus>;
|
|
629
657
|
}
|
|
630
658
|
export default NevarMail;
|
package/dist/index.js
CHANGED
|
@@ -441,5 +441,21 @@ export class NevarMail {
|
|
|
441
441
|
addSuppressions(input) {
|
|
442
442
|
return this.request("POST", "/api/v1/suppressions", { body: input });
|
|
443
443
|
}
|
|
444
|
+
// ── Inbox database ─────────────────────────────────────────────────────
|
|
445
|
+
/** GET /api/v1/inbox-db/status — scope `org:read`; 404 when no connection is stored. */
|
|
446
|
+
getInboxDbStatus() {
|
|
447
|
+
return this.request("GET", "/api/v1/inbox-db/status");
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* POST /api/v1/inbox-db/connection — scope `org:write`; 201. Throws 422 when the database is
|
|
451
|
+
* unreachable, lacks pgvector/permissions, or already holds another org's schema.
|
|
452
|
+
*/
|
|
453
|
+
connectInboxDb(input) {
|
|
454
|
+
return this.request("POST", "/api/v1/inbox-db/connection", { body: input });
|
|
455
|
+
}
|
|
456
|
+
/** POST /api/v1/inbox-db/connection/test — scope `org:write`; 404 when nothing is stored. */
|
|
457
|
+
testInboxDbConnection() {
|
|
458
|
+
return this.request("POST", "/api/v1/inbox-db/connection/test");
|
|
459
|
+
}
|
|
444
460
|
}
|
|
445
461
|
export default NevarMail;
|
package/package.json
CHANGED