@pilot-status/sdk 0.12.0 → 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/CHANGELOG.md CHANGED
@@ -2,6 +2,97 @@
2
2
 
3
3
  All notable changes to `@pilot-status/sdk`.
4
4
 
5
+ ## 0.14.0 - 2026-10-11
6
+
7
+ ### Added
8
+
9
+ - **`numbers.pay(id)`** — `POST /v1/numbers/{id}/pay`, no body. "Pay now" for the
10
+ extra-number charge of one number. A number past the workspace's paid capacity is charged
11
+ when it first connects; if that charge is refused, sending from the number is blocked
12
+ (`409 NUMBER_BLOCKED`, `reason: "extra_charge_unpaid"`) until it is paid. With a card on
13
+ file this charges it. Requires a tenant-scoped API key with the `billing:manage`
14
+ permission. Resolves to `{ ok: true, status: "paid" | "not_required" }`
15
+ (`NumberPayResult`); `not_required` means nothing is owed, so the call is safe to repeat.
16
+ - A refusal throws. 402 `PAYMENT_FAILED` (may carry `declineCode`, `proratedTotal`,
17
+ `currency`) and 402 `INSUFFICIENT_FUNDS` arrive as a plain `PilotStatusHttpError` —
18
+ there is no error class for 402 — so read `err.status` and `err.body.code`. 502
19
+ `PAYMENT_PROVIDER_ERROR` is a `ServerError` (the server retries the charge; the SDK
20
+ does not repeat the POST), 409 `PAYMENT_IN_PROGRESS` a `ConflictError`, 404
21
+ `NUMBER_NOT_FOUND` a `NotFoundError`, 403 `NUMBER_SCOPE_NOT_ALLOWED` /
22
+ `PERMISSION_DENIED` a `ForbiddenError`.
23
+ - Types `NumberPayResult` and `NumberPayErrorBody` (the shape of `err.body` on a refused
24
+ `pay()`).
25
+ - **`extraChargeUnpaidSince` and `extraChargeDisconnectAt`** (`string | null`, ISO 8601) on
26
+ `WhatsAppNumberListItem` (`numbers.list()`, every item) and `NumberDetail`
27
+ (`numbers.get()`, and therefore `UpdateNumberResult`). `extraChargeUnpaidSince` is
28
+ non-null while sending is blocked for the unpaid charge. `extraChargeDisconnectAt` is
29
+ when the number is disconnected if it stays unpaid — 7 days after the block — and is
30
+ always `null` on a Meta Cloud API number, which is never disconnected for this. Both are
31
+ top-level, not inside `health`.
32
+
33
+ ### Changed
34
+
35
+ - Type-level only: the two new fields are **required** on `WhatsAppNumberListItem` and
36
+ `NumberDetail`, because the API always sends them. Code that only reads these types is
37
+ unaffected; a hand-written fixture or mock typed as one of them needs the two keys
38
+ (`null` for a number that is not blocked).
39
+
40
+ ## 0.13.0 - 2026-10-08
41
+
42
+ ### Added
43
+
44
+ - **Leads: `client.leads`** (Meta Lead Ads — Facebook / Instagram Instant Forms of the
45
+ Pages linked to the key's number). Number-scoped API key only.
46
+ - `leads.list(params?)` — `GET /v1/leads`, newest first by the time the person submitted
47
+ the form. Filters `formId`, `adId`, `pageId` (exact match), `startDate` / `endDate`
48
+ (ISO-8601, on the lead's own `createdAt`, i.e. Meta's `created_time`), `page`,
49
+ `pageSize` (default 30, max 100). Resolves to
50
+ `{ leads, total, page, pageSize, totalPages, notice? }`.
51
+ - `leads.get(id)` — `GET /v1/leads/{id}`, by OUR id (the `id` from `list`, the `leadId`
52
+ of the webhook), not Meta's `leadgenId`. A lead of another number answers 404
53
+ `LEAD_NOT_FOUND`. Resolves to `{ lead, notice? }`.
54
+ - On a `RELAY_ONLY` number a lead is still returned with `redacted: true`: ids,
55
+ attribution and status stay, `fullName` / `email` / `phone` are `null` and `fields` is
56
+ empty; the response then carries `notice`.
57
+ - `consentGiven: null` means **unknown** (no consent checkbox configured, or not
58
+ answered) — never a refusal.
59
+ - Types `Lead`, `LeadField`, `LeadListParams`, `LeadListResult`, `LeadGetResult`.
60
+ - **`lead.received` webhook event** (`LeadReceivedEvent`, `LeadReceivedEventData`,
61
+ `LeadReceivedField`): the whole lead, delivered on the number its Page is linked to — on
62
+ **any** provider, since the lead arrives on the Page, not through the number. Wrapped in
63
+ `data`; the number field is **`whatsappNumberId`** (not `numberId`) and there is no
64
+ `event` repeated inside `data`. `leadgenId` is Meta's id and the natural idempotency key;
65
+ `leadId` is ours and reads back with `client.leads.get(leadId)`. In `fields`, `label` is
66
+ absent when it could not be resolved (on `client.leads.*` it is always present, falling
67
+ back to the key). `parseCustomerWebhook`, `isCustomerWebhookEvent` and
68
+ `CUSTOMER_WEBHOOK_EVENTS` now include it.
69
+ - `KNOWN_MESSAGE_ORIGINS` (runtime tuple) and `KnownMessageOrigin`: every value `origin`
70
+ can take today on `GET /v1/messages`, `GET /v1/messages/history` and
71
+ `GET /v1/messages/{id}` — `API`, `MCP`, `CHATWOOT`, `CHAT`, `DASHBOARD`, `SYSTEM`,
72
+ `APP` and the new `LAYER`.
73
+
74
+ ### Changed
75
+
76
+ - **`lead.received` is now a known event.** On 0.12.0 it reached your handler as
77
+ `{ type: "unknown", ... }` (`UnknownCustomerWebhookEvent`); from this version it is parsed
78
+ and validated as `LeadReceivedEvent`. Type-level only for code with an exhaustive
79
+ `switch (event.event)` that assigns the default branch to `never`: add a
80
+ `case "lead.received":` (or let it fall to your default). Like any known event, a
81
+ `lead.received` body missing a required field now throws instead of coming back as
82
+ unknown. Runtime output for every other event is unchanged.
83
+ - Docs only, no type change: `MessageLogEntry.origin` and `ChatHistoryMessage.origin` can
84
+ now be `"CHATWOOT"` or `"LAYER"` on outbound messages sent through the Pilot Status Meta
85
+ layer — `CHATWOOT` for an agent reply from a native Chatwoot WhatsApp Cloud inbox,
86
+ `LAYER` for any other client. These rows have `correlationId: null`, no detail
87
+ (`messages.get()` answers 404), are not counted in plan usage, and their `status`
88
+ follows Meta's (`SENT`, `DELIVERED`, `READ`, `FAILED`). The `origin` fields stay
89
+ `string | null`, so nothing breaks for code that only reads them.
90
+ - Docs only: `MessageLogEntry.content` on those rows (a template reads
91
+ `"Template: <name>"`, location/contacts get a short generated text), and
92
+ `MessageListParams` now warns that `status`, `direction: "out"`, `templateId` and
93
+ `window` leave out outbound rows without a send request (`APP`, `LAYER`, native-inbox
94
+ `CHATWOOT`).
95
+
5
96
  ## 0.12.0 - 2026-10-05
6
97
 
7
98
  ### Added
package/README.md CHANGED
@@ -172,6 +172,67 @@ await client.numbers.logout(id);
172
172
  > available to reconnect another number. To lower the bill, use
173
173
  > `subscription.scheduleRemoval()` (applies next cycle).
174
174
 
175
+ #### Paying the extra-number charge of a number
176
+
177
+ A number past the workspace's paid capacity (an *extra number*) is charged when it
178
+ **first connects**. If that charge is refused, the number stays connected but
179
+ **sending from it is blocked** — `messages.send()` answers `409 NUMBER_BLOCKED` with
180
+ `reason: "extra_charge_unpaid"` — until the charge is paid. Both `numbers.list()` and
181
+ `numbers.get(id)` say so at the top level of each number:
182
+
183
+ - `extraChargeUnpaidSince` — ISO timestamp of the block; `null` when the number is not
184
+ blocked.
185
+ - `extraChargeDisconnectAt` — ISO timestamp at which the number is **disconnected** if it
186
+ stays unpaid (7 days after the block). Always `null` on a Meta Cloud API number, which
187
+ is never disconnected for this.
188
+
189
+ `numbers.pay(id)` is "pay now" (`POST /v1/numbers/{id}/pay`, no body). With a card on file
190
+ it **charges** it. It needs a **tenant-scoped** API key with the `billing:manage`
191
+ permission, the same rule as `subscription.addExtraNumbers()`. A wallet top-up or a newly
192
+ saved card also retries the charge on its own, without this call.
193
+
194
+ ```ts
195
+ import { PilotStatusHttpError, type NumberPayErrorBody } from "@pilot-status/sdk";
196
+
197
+ const blocked = (await client.numbers.list()).filter((n) => n.extraChargeUnpaidSince !== null);
198
+
199
+ for (const n of blocked) {
200
+ try {
201
+ const { status } = await client.numbers.pay(n.id);
202
+ // "paid": charged, the number can send again.
203
+ // "not_required": nothing was owed for it — safe to call again.
204
+ console.log(n.id, status);
205
+ } catch (err) {
206
+ if (!(err instanceof PilotStatusHttpError)) throw err;
207
+ // 402 has no error class of its own: branch on the status and on body.code.
208
+ const body = err.body as NumberPayErrorBody | undefined;
209
+ if (err.status === 402 && body?.code === "PAYMENT_FAILED") {
210
+ // The card was refused. declineCode is the issuer's reason, when it gave one.
211
+ console.log(body.declineCode, body.proratedTotal, body.currency);
212
+ } else if (err.status === 402 && body?.code === "INSUFFICIENT_FUNDS") {
213
+ // No credits and no usable card: add credits or a card, then pay again.
214
+ } else if (err.status === 409 && body?.code === "PAYMENT_IN_PROGRESS") {
215
+ // Another payment of this workspace is running: call again in a few seconds.
216
+ } else if (err.status === 502 && body?.code === "PAYMENT_PROVIDER_ERROR") {
217
+ // Not a refusal: the charge could not be concluded and the server retries it.
218
+ } else {
219
+ throw err; // 404 NUMBER_NOT_FOUND, 403 NUMBER_SCOPE_NOT_ALLOWED / PERMISSION_DENIED
220
+ }
221
+ }
222
+ }
223
+ ```
224
+
225
+ | Status | `body.code` | Thrown as | Meaning |
226
+ | --- | --- | --- | --- |
227
+ | 402 | `PAYMENT_FAILED` | `PilotStatusHttpError` | Charge refused. May carry `declineCode`, `proratedTotal`, `currency`. |
228
+ | 402 | `INSUFFICIENT_FUNDS` | `PilotStatusHttpError` | No credits and no usable card. |
229
+ | 502 | `PAYMENT_PROVIDER_ERROR` | `ServerError` | The charge could not be concluded; the server retries it. |
230
+ | 409 | `PAYMENT_IN_PROGRESS` | `ConflictError` | Another payment of the workspace is running. |
231
+ | 404 | `NUMBER_NOT_FOUND` | `NotFoundError` | No such number in this workspace. |
232
+ | 403 | `NUMBER_SCOPE_NOT_ALLOWED` / `PERMISSION_DENIED` | `ForbiddenError` | Key is not tenant-scoped, or lacks `billing:manage`. |
233
+
234
+ The SDK never retries a POST on its own, so `pay()` sends exactly one request.
235
+
175
236
  ## Messages, conversations and the 24h window
176
237
 
177
238
  ```ts
@@ -188,6 +249,13 @@ await client.messages.typing({ to: "+5511999999999", state: "typing" });
188
249
  // Conversations, newest activity first
189
250
  const { conversations } = await client.conversations.list({ pageSize: 50 });
190
251
 
252
+ // Meta Lead Ads leads of the Pages linked to the number, newest first (number-scoped key).
253
+ // Filters: formId, adId, pageId, startDate, endDate (on the lead's own createdAt), page, pageSize.
254
+ const { leads, total, notice } = await client.leads.list({ formId: "123", pageSize: 100 });
255
+ const { lead } = await client.leads.get(leads[0].id); // 404 LEAD_NOT_FOUND for another number's lead
256
+ // On a RELAY_ONLY number a lead keeps ids, attribution and status, with `redacted: true`
257
+ // and fullName/email/phone/fields blanked; the response then carries `notice`.
258
+
191
259
  // Can I send free-form right now?
192
260
  const w = await client.serviceWindow.get("+5511999999999");
193
261
  // Branch on windowType, not on `open`: web numbers always report open: true
@@ -497,7 +565,7 @@ Notes:
497
565
  - `message.received` includes `fromMe` (boolean).
498
566
  - `message.group` is delivered for inbound group messages (includes `groupName`).
499
567
  - `message.newsletter` is delivered for inbound WhatsApp channel / newsletter messages (`@newsletter`, includes `newsletterId`).
500
- - Supported events in the parser: `message.sent`, `message.delivered`, `message.read`, `message.failed`, `message.reply`, `message.received`, `message.group`, `message.newsletter`, `number.created`, `number.connected`, `number.disconnected`, `number.removed`, `number.restored`, `call.ringing`, `call.connected`, `call.ended`, `call.missed`, `call.permission_updated`, `flow.response_received`. The same list is exported as `CUSTOMER_WEBHOOK_EVENTS` — it is derived from the parser's own union, and a test compares this line against it, so the two cannot drift.
568
+ - Supported events in the parser: `message.sent`, `message.delivered`, `message.read`, `message.failed`, `message.reply`, `message.received`, `message.group`, `message.newsletter`, `number.created`, `number.connected`, `number.disconnected`, `number.removed`, `number.restored`, `call.ringing`, `call.connected`, `call.ended`, `call.missed`, `call.permission_updated`, `flow.response_received`, `lead.received`. The same list is exported as `CUSTOMER_WEBHOOK_EVENTS` — it is derived from the parser's own union, and a test compares this line against it, so the two cannot drift.
501
569
  - `flow.response_received` carries the answers of a submitted WhatsApp Flow (`interactive.nfm_reply`), **META numbers only**. Wrapped in `data` like the `message.*` events: `{ event, data: { event, flowId, metaFlowId, flowToken, messageId, whatsappNumberId, from, receivedAt, response, responseRaw, flowMedia, submitted } }`. Two fields need care. **The number field is `whatsappNumberId`, not `numberId`** — same value as everywhere else, different name on the wire, so a handler reading `numberId` gets `undefined`. And **`response` and `responseRaw` are mutually exclusive**: `response` is the parsed answer object and `responseRaw` is `null`; when the submission could not be parsed it is the other way round, and the raw string is the only copy of the answer that exists. `flowId` is `null` for a Flow built in Meta's Flow Manager and not yet synced here — normal, not an error.
502
570
  - **Files attached inside a Flow form** (`PhotoPicker` / `DocumentPicker`) are **not in `response`**. A media picker requires a `data_exchange` endpoint, so what `response` holds for such a field is a reference to Meta's CDN — which Meta deletes after 20 days. The re-hosted copy is the only way to reach the bytes, and it is published in the two places the answers are readable, in shapes that are similar and **not** the same:
503
571
  - On the event, `data.flowMedia` — `null` when nothing was attached, and **never `[]`**. The asymmetry is deliberate: the payload stored in the webhook log of a `RELAY_ONLY` number is redacted field by field, and the redactor blanks any field that holds something. An empty array holds something, so it would be replaced by the "content unavailable" placeholder and read back as *"there were attachments and we hid them"*; `null` passes through untouched. `flowMedia` is also **optional**, and absent is not `null` — absent is a backend older than the field, which the parser accepts rather than rejecting every event from an older deployment over one field it cannot read.
@@ -515,6 +583,7 @@ Notes:
515
583
  - ⛔ **Nothing of what YOUR endpoint answered is captured** — `extension_message_response` never appears anywhere in Pilot Status. What you returned is already `response` on the same event.
516
584
  - The two shapes differ in exactly one way, the same way the attachment shapes do: on the event `submitted` is **`null`, never `[]`**, when nothing was captured (the redactor that blanks a `RELAY_ONLY` log replaces anything non-empty, so `[]` would read as *"there were answers and we hid them"*), and it is also **optional** — absent means a backend older than the field. On `listResponses()` it is **always an array**.
517
585
  - ⚠️ **Empty is not "they typed nothing".** A NAVIGATE-only Flow never calls an endpoint at all — its answers are wholly in `response` — and a number configured to relay and keep nothing captures none. The element type is exported: `import type { FlowSubmittedExchange } from "@pilot-status/sdk"`, and it is the SAME type on both surfaces.
586
+ - `lead.received` carries a whole lead from a Facebook / Instagram Instant Form (Meta Lead Ads), delivered on the number its Page is linked to — on **any** provider, since the lead arrives on the Page, not through the number. Wrapped in `data`: `{ event, data: { leadId, leadgenId, whatsappNumberId, pageId, pageName?, formId, formName?, adId?, adsetId?, campaignId?, adName?, adsetName?, campaignName?, platform?, isOrganic?, createdAt, fullName?, email?, phone?, fields, consentGiven?, conversationId? } }` (types `LeadReceivedEvent` / `LeadReceivedEventData` / `LeadReceivedField`). Like the Flow event, **the number field is `whatsappNumberId`**; unlike it, there is **no `event` repeated inside `data`**. `leadgenId` is Meta's id and the natural idempotency key; `leadId` is ours and reads back with `client.leads.get(leadId)`. `createdAt` is when the person submitted the form. `fields[]` is `{ key, label?, values }` — `values` is always a list, and `label` is absent when it could not be resolved (on `client.leads.*` it is always present, falling back to the key). `consentGiven: null` means **unknown** (no consent checkbox configured, or not answered), never a refusal.
518
587
  - `call.*` payloads are **flat** (fields sit next to `event`, no `data` wrapper): `{ event, callId, externalCallId?, direction, status, from, to, timestamp, duration? }`. `duration` (seconds) appears on `call.ended` only when the call was answered; `call.permission_updated` has `callId`/`direction` `null` and `status` `NO_PERMISSION` | `TEMPORARY` | `PERMANENT`.
519
588
 
520
589
  ## Errors
package/dist/client.d.ts CHANGED
@@ -4,6 +4,7 @@ import { BrandingResource } from "./resources/branding.js";
4
4
  import { CallsResource } from "./resources/calls.js";
5
5
  import { ChatwootResource } from "./resources/chatwoot.js";
6
6
  import { ConversationsResource } from "./resources/conversations.js";
7
+ import { LeadsResource } from "./resources/leads.js";
7
8
  import { EmbedResource } from "./resources/embed.js";
8
9
  import { FlowsResource } from "./resources/flows.js";
9
10
  import { MessagesResource } from "./resources/messages.js";
@@ -59,6 +60,8 @@ export declare class PilotStatusClient {
59
60
  readonly media: MediaResource;
60
61
  readonly calls: CallsResource;
61
62
  readonly conversations: ConversationsResource;
63
+ /** Meta Lead Ads leads (`/v1/leads`) — number-scoped key only. */
64
+ readonly leads: LeadsResource;
62
65
  readonly serviceWindow: ServiceWindowResource;
63
66
  readonly meta: MetaResource;
64
67
  readonly webhooks: WebhooksResource;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAA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QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,qBAAqB,CAAC;IAC9C,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,kEAAkE;IAClE,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;gBAI5B,OAAO,EAAE,wBAAwB;IA+C7C;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,gBAAgB,EAAE,MAAM,GAAG,iBAAiB;CAGxD"}
package/dist/client.js CHANGED
@@ -4,6 +4,7 @@ import { BrandingResource } from "./resources/branding.js";
4
4
  import { CallsResource } from "./resources/calls.js";
5
5
  import { ChatwootResource } from "./resources/chatwoot.js";
6
6
  import { ConversationsResource } from "./resources/conversations.js";
7
+ import { LeadsResource } from "./resources/leads.js";
7
8
  import { EmbedResource } from "./resources/embed.js";
8
9
  import { FlowsResource } from "./resources/flows.js";
9
10
  import { MessagesResource } from "./resources/messages.js";
@@ -36,6 +37,8 @@ export class PilotStatusClient {
36
37
  media;
37
38
  calls;
38
39
  conversations;
40
+ /** Meta Lead Ads leads (`/v1/leads`) — number-scoped key only. */
41
+ leads;
39
42
  serviceWindow;
40
43
  meta;
41
44
  webhooks;
@@ -75,6 +78,7 @@ export class PilotStatusClient {
75
78
  this.media = new MediaResource(http);
76
79
  this.calls = new CallsResource(http);
77
80
  this.conversations = new ConversationsResource(http);
81
+ this.leads = new LeadsResource(http);
78
82
  this.serviceWindow = new ServiceWindowResource(http);
79
83
  this.meta = new MetaResource(http);
80
84
  this.webhooks = new WebhooksResource(http);
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC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AI,CAAC,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,IAAI,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,UAAU,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,gBAAwB;QACjC,OAAO,IAAI,iBAAiB,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { PilotStatusClient, DEFAULT_BASE_URL } from "./client.js";
2
2
  export type { PilotStatusClientOptions } from "./client.js";
3
3
  export { PilotStatusError, PilotStatusHttpError, AuthenticationError, ValidationError, ForbiddenError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, ServerError, } from "./errors.js";
4
4
  export type { PilotStatusErrorBody } from "./errors.js";
5
- export { NUMBER_STATUS_FAILURE_CODES } from "./types.js";
5
+ export { NUMBER_STATUS_FAILURE_CODES, KNOWN_MESSAGE_ORIGINS } from "./types.js";
6
6
  /**
7
7
  * Reads Meta's refusal list out of the error `flows.uploadJson()` throws. It is the
8
8
  * ONLY place that list is reachable — see its own docblock.
@@ -10,8 +10,8 @@ export { NUMBER_STATUS_FAILURE_CODES } from "./types.js";
10
10
  export { flowJsonValidationErrors } from "./resources/flows.js";
11
11
  /** Phone lines: the resource classes, the `data:` URI helper and the `Content-Disposition` parser. */
12
12
  export { PhoneLinesResource, PhoneLineVerificationResource, toDataUri, parseContentDispositionFileName, } from "./resources/phone-lines.js";
13
- export type { MessageStatus, Button, ButtonType, MarketingOptions, SendMessageInput, SendMessageHeader, SendMessageAccepted, MessageDetails, MessageMetaPricing, MessageLogDirection, MessageLogEntry, MessageListParams, MessageListResult, GroupMessagesParams, GroupMessagesResult, UnreadMessagesParams, UnreadMessagesResult, MarkReadResult, TypingState, TypingInput, TypingResult, DashboardStats, ApiKeyCreated, ApiKeyListItem, ApiKeyListResult, NumberApiKeyReveal, RegeneratedNumberKey, WhatsAppNumberInstance, WhatsAppNumberListItem, NumberListItemApiKeyRef, NumberCoexistence, CreateNumberInput, CreateNumberResult, CreateMetaNumberInput, CheckNumbersInput, CheckNumbersResult, NumberConnectResult, NumberStatusResult, NumberStatusFailureCode, NumberDetail, NumberSettings, NumberSettingsInput, NumberSettingsSync, NumberPiiInput, NumberLogoutResult, NumberRestoreResult, NumberPurgeResult, UpdateNumberInput, UpdateNumberResult, ChatHistoryMedia, ChatHistoryMessage, MessageHistoryParams, MessageHistoryResult, NumberLinkBundle, RemotePairingInput, RemotePairingResult, RemotePairingInfo, RemotePairingStatus, RemotePairingConnectResult, CancelMessagesResult, DeleteNumberResult, TemplateCategory, TemplateExamples, TemplateListItem, TemplateDetail, CreateTemplateInput, UpdateTemplateInput, TemplateDeleteResult, FlowCategory, Flow, FlowListParams, FlowListResult, CreateFlowInput, FlowCreated, UpdateFlowInput, FlowUpdateResult, FlowDeleteResult, FlowJsonUploadResult, FlowJsonValidationFailure, FlowPublishInput, FlowPublishResult, FlowDeprecateInput, FlowDeprecateResult, FlowResponse, FlowResponseMedia, FlowSubmittedExchange, FlowResponseListParams, FlowResponseListResult, FlowEndpointKeyMetaStatus, FlowEndpointKeyStatus, FlowEndpointKeyRotateInput, FlowEndpointKeyRotateResult, GroupListItem, GroupDetail, GroupParticipant, CreateGroupInput, GroupActionResult, GroupInviteResult, GroupPinAction, NewsletterListItem, MediaDownloadResult, ConversationListParams, ConversationListResult, ConversationSummary, ServiceWindowType, ServiceWindowResult, MetaPricingParams, MetaPricingResult, Webhook, CreateWebhookInput, UpdateWebhookInput, WebhookDeleteResult, WebhookLogsParams, WebhookLogEntry, BrandingInput, BrandingResult, EmbedSurface, EmbedSessionInput, EmbedSessionResult, CheckoutPurpose, CheckoutInput, CheckoutResult, ExtraNumbersPreview, ExtraNumbersPurchaseResult, ExtraNumbersScheduleResult, ChatwootChannelMode, ChatwootStatus, ChatwootConnectInput, ChatwootUpdateInput, ChatwootTestInput, ChatwootTestResult, ChatwootHistoryReplayInput, ChatwootHistoryReplayState, WorkspaceRole, WorkspaceMemberStatus, WorkspaceDetail, WorkspaceMember, WorkspaceMemberList, CallDirection, CallStatus, CallDetails, CallInitiateInput, CallInitiateAccepted, CallActionResult, CallListResult, CallingSettingsResult, CallSettingsUpdateInput, CallSettingsUpdateResult, CallPermissionResult, CallPermissionRequestInput, CallPermissionRequestResult, CallRealtimeSessionMode, CallRealtimeSessionResult, VerificationStatus, VerificationDocumentType, VerificationContactChannel, VerificationContactChannelPath, VerificationDocumentStatus, VerificationReviewReason, VerificationDetails, VerificationState, StartVerificationParams, StartVerificationOptions, StartVerificationResult, ActivationAudio, } from "./types.js";
14
- export type { CustomerWebhookEvent, UnknownCustomerWebhookEvent, WhatsAppMessageType, MessageSentEvent, MessageDeliveredEvent, MessageReadEvent, MessageFailedEvent, MessageReplyEvent, MessageReceivedEvent, MessageGroupEvent, MessageNewsletterEvent, NumberCreatedEvent, NumberConnectedEvent, NumberDisconnectedEvent, NumberRemovedEvent, NumberRestoredEvent, CallRingingEvent, CallConnectedEvent, CallEndedEvent, CallMissedEvent, CallPermissionUpdatedEvent, EvolutionGoCallEventData, EvolutionGoCallOfferEvent, EvolutionGoCallAcceptEvent, EvolutionGoCallTerminateEvent, EvolutionGoCallEvent, FlowResponseReceivedEvent, FlowResponseReceivedEventData, FlowResponseMediaAttachment, PhoneLineWebhookEvent, PhoneLineWebhookEventName, PhoneLineReturnedReason, PhoneLinePurchasedEvent, PhoneLineAudioReceivedEvent, PhoneLineCodeReceivedEvent, PhoneLineCodeFailedEvent, PhoneLineRenewedEvent, PhoneLinePaymentFailedEvent, PhoneLineSuspendedEvent, PhoneLineReturnedEvent, PhoneLineCanceledEvent, PhoneLineVerificationUpdatedEvent, } from "./webhooks/types.js";
13
+ export type { MessageStatus, Button, ButtonType, MarketingOptions, SendMessageInput, SendMessageHeader, SendMessageAccepted, MessageDetails, MessageMetaPricing, MessageLogDirection, MessageLogEntry, KnownMessageOrigin, MessageListParams, MessageListResult, GroupMessagesParams, GroupMessagesResult, UnreadMessagesParams, UnreadMessagesResult, MarkReadResult, TypingState, TypingInput, TypingResult, DashboardStats, ApiKeyCreated, ApiKeyListItem, ApiKeyListResult, NumberApiKeyReveal, RegeneratedNumberKey, WhatsAppNumberInstance, WhatsAppNumberListItem, NumberListItemApiKeyRef, NumberCoexistence, CreateNumberInput, CreateNumberResult, CreateMetaNumberInput, CheckNumbersInput, CheckNumbersResult, NumberConnectResult, NumberStatusResult, NumberStatusFailureCode, NumberDetail, NumberSettings, NumberSettingsInput, NumberSettingsSync, NumberPiiInput, NumberLogoutResult, NumberRestoreResult, NumberPurgeResult, NumberPayResult, NumberPayErrorBody, UpdateNumberInput, UpdateNumberResult, ChatHistoryMedia, ChatHistoryMessage, MessageHistoryParams, MessageHistoryResult, NumberLinkBundle, RemotePairingInput, RemotePairingResult, RemotePairingInfo, RemotePairingStatus, RemotePairingConnectResult, CancelMessagesResult, DeleteNumberResult, TemplateCategory, TemplateExamples, TemplateListItem, TemplateDetail, CreateTemplateInput, UpdateTemplateInput, TemplateDeleteResult, FlowCategory, Flow, FlowListParams, FlowListResult, CreateFlowInput, FlowCreated, UpdateFlowInput, FlowUpdateResult, FlowDeleteResult, FlowJsonUploadResult, FlowJsonValidationFailure, FlowPublishInput, FlowPublishResult, FlowDeprecateInput, FlowDeprecateResult, FlowResponse, FlowResponseMedia, FlowSubmittedExchange, FlowResponseListParams, FlowResponseListResult, FlowEndpointKeyMetaStatus, FlowEndpointKeyStatus, FlowEndpointKeyRotateInput, FlowEndpointKeyRotateResult, GroupListItem, GroupDetail, GroupParticipant, CreateGroupInput, GroupActionResult, GroupInviteResult, GroupPinAction, NewsletterListItem, MediaDownloadResult, ConversationListParams, ConversationListResult, ConversationSummary, LeadListParams, LeadListResult, LeadGetResult, Lead, LeadField, ServiceWindowType, ServiceWindowResult, MetaPricingParams, MetaPricingResult, Webhook, CreateWebhookInput, UpdateWebhookInput, WebhookDeleteResult, WebhookLogsParams, WebhookLogEntry, BrandingInput, BrandingResult, EmbedSurface, EmbedSessionInput, EmbedSessionResult, CheckoutPurpose, CheckoutInput, CheckoutResult, ExtraNumbersPreview, ExtraNumbersPurchaseResult, ExtraNumbersScheduleResult, ChatwootChannelMode, ChatwootStatus, ChatwootConnectInput, ChatwootUpdateInput, ChatwootTestInput, ChatwootTestResult, ChatwootHistoryReplayInput, ChatwootHistoryReplayState, WorkspaceRole, WorkspaceMemberStatus, WorkspaceDetail, WorkspaceMember, WorkspaceMemberList, CallDirection, CallStatus, CallDetails, CallInitiateInput, CallInitiateAccepted, CallActionResult, CallListResult, CallingSettingsResult, CallSettingsUpdateInput, CallSettingsUpdateResult, CallPermissionResult, CallPermissionRequestInput, CallPermissionRequestResult, CallRealtimeSessionMode, CallRealtimeSessionResult, VerificationStatus, VerificationDocumentType, VerificationContactChannel, VerificationContactChannelPath, VerificationDocumentStatus, VerificationReviewReason, VerificationDetails, VerificationState, StartVerificationParams, StartVerificationOptions, StartVerificationResult, ActivationAudio, } from "./types.js";
14
+ export type { CustomerWebhookEvent, UnknownCustomerWebhookEvent, WhatsAppMessageType, MessageSentEvent, MessageDeliveredEvent, MessageReadEvent, MessageFailedEvent, MessageReplyEvent, MessageReceivedEvent, MessageGroupEvent, MessageNewsletterEvent, NumberCreatedEvent, NumberConnectedEvent, NumberDisconnectedEvent, NumberRemovedEvent, NumberRestoredEvent, CallRingingEvent, CallConnectedEvent, CallEndedEvent, CallMissedEvent, CallPermissionUpdatedEvent, EvolutionGoCallEventData, EvolutionGoCallOfferEvent, EvolutionGoCallAcceptEvent, EvolutionGoCallTerminateEvent, EvolutionGoCallEvent, FlowResponseReceivedEvent, FlowResponseReceivedEventData, FlowResponseMediaAttachment, LeadReceivedEvent, LeadReceivedEventData, LeadReceivedField, PhoneLineWebhookEvent, PhoneLineWebhookEventName, PhoneLineReturnedReason, PhoneLinePurchasedEvent, PhoneLineAudioReceivedEvent, PhoneLineCodeReceivedEvent, PhoneLineCodeFailedEvent, PhoneLineRenewedEvent, PhoneLinePaymentFailedEvent, PhoneLineSuspendedEvent, PhoneLineReturnedEvent, PhoneLineCanceledEvent, PhoneLineVerificationUpdatedEvent, } from "./webhooks/types.js";
15
15
  export { parseCustomerWebhook, isCustomerWebhookEvent, isUnknownCustomerWebhookEvent, CUSTOMER_WEBHOOK_EVENTS, } from "./webhooks/parse.js";
16
16
  export type { ParseCustomerWebhookOptions } from "./webhooks/parse.js";
17
17
  export { verifyWebhookSignature, WEBHOOK_SIGNATURE_HEADER, } from "./webhooks/signature.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA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"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAClE,YAAY,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,cAAc,EACd,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEhF;;;GAGG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,sGAAsG;AACtG,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,SAAS,EACT,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,aAAa,EACb,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,WAAW,EACX,YAAY,EACZ,cAAc,EACd,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,c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AC7B,OAAO,EACH,oBAAoB,EACpB,sBAAsB,EACtB,6BAA6B,EAC7B,uBAAuB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- // mutation-exempt-file: PURE RE-EXPORT BARREL — every non-blank line is `export … from`, ⚠️ (this used to say "209 lines" and the file had 219: a count in a justification rots the moment an export is added, and a reader who counts and finds a mismatch distrusts the whole exemption — or "verifies" it away. The claim is now the one that stays checkable no matter how the file grows.) with no statement, no expression and no branch to mutate. EVERY value it re-exports is ASSERTED in the test of the module it comes from — the list below is the claim, and it is checkable name by name (⚠️ this used to say "7"; measured 2026-09-06 there are SIX blocks carrying nineteen names, because `CUSTOMER_WEBHOOK_EVENTS` ships in the same block as `parseCustomerWebhook` even though a different test asserts it. A count that disagrees with the enumeration beside it makes a reader doubt both), so nothing here is unmeasured: `PilotStatusClient`/`DEFAULT_BASE_URL` in `client.test.ts`; the 10 error classes (`UnprocessableEntityError` included, 16 references, structural assertions on the prototype chain) in `errors.test.ts`; `NUMBER_STATUS_FAILURE_CODES` in `resources/resources.test.ts`, list asserted whole; `flowJsonValidationErrors` in `resources/flows.test.ts`; `parseCustomerWebhook`/`isCustomerWebhookEvent` in `webhooks/parse.test.ts`; `CUSTOMER_WEBHOOK_EVENTS` in `webhooks/readme-events.test.ts`, compared name-by-name against `README.md`; `verifyWebhookSignature`/`WEBHOOK_SIGNATURE_HEADER` in `webhooks/signature.test.ts`; `PhoneLinesResource`/`PhoneLineVerificationResource`/`toDataUri`/`parseContentDispositionFileName` in `resources/phone-lines.test.ts`. Everything else it forwards is `export type`, erased before a mutant could exist. This is the declared escape hatch for the gate's OWN documented limit — `mutate-diff.mjs` does not follow barrels, so a barrel resolves to `index` and lands in `semTeste`; the same reason already excludes this exact file from `vitest.coverage.config.ts` ("pure re-export barrel"). A dropped export is caught by `tsc`, in this package and in every consumer, not by mutation.
1
+ // mutation-exempt-file: PURE RE-EXPORT BARREL — every non-blank line is `export … from`, ⚠️ (this used to say "209 lines" and the file had 219: a count in a justification rots the moment an export is added, and a reader who counts and finds a mismatch distrusts the whole exemption — or "verifies" it away. The claim is now the one that stays checkable no matter how the file grows.) with no statement, no expression and no branch to mutate. EVERY value it re-exports is ASSERTED in the test of the module it comes from — the list below is the claim, and it is checkable name by name (⚠️ this used to say "7"; measured 2026-09-06 there are SIX blocks carrying nineteen names, because `CUSTOMER_WEBHOOK_EVENTS` ships in the same block as `parseCustomerWebhook` even though a different test asserts it. A count that disagrees with the enumeration beside it makes a reader doubt both), so nothing here is unmeasured: `PilotStatusClient`/`DEFAULT_BASE_URL` in `client.test.ts`; the 10 error classes (`UnprocessableEntityError` included, 16 references, structural assertions on the prototype chain) in `errors.test.ts`; `NUMBER_STATUS_FAILURE_CODES` and `KNOWN_MESSAGE_ORIGINS` in `resources/resources.test.ts`, each list asserted whole; `flowJsonValidationErrors` in `resources/flows.test.ts`; `parseCustomerWebhook`/`isCustomerWebhookEvent` in `webhooks/parse.test.ts`; `CUSTOMER_WEBHOOK_EVENTS` in `webhooks/readme-events.test.ts`, compared name-by-name against `README.md`; `verifyWebhookSignature`/`WEBHOOK_SIGNATURE_HEADER` in `webhooks/signature.test.ts`; `PhoneLinesResource`/`PhoneLineVerificationResource`/`toDataUri`/`parseContentDispositionFileName` in `resources/phone-lines.test.ts`. Everything else it forwards is `export type`, erased before a mutant could exist. This is the declared escape hatch for the gate's OWN documented limit — `mutate-diff.mjs` does not follow barrels, so a barrel resolves to `index` and lands in `semTeste`; the same reason already excludes this exact file from `vitest.coverage.config.ts` ("pure re-export barrel"). A dropped export is caught by `tsc`, in this package and in every consumer, not by mutation.
2
2
  export { PilotStatusClient, DEFAULT_BASE_URL } from "./client.js";
3
3
  export { PilotStatusError, PilotStatusHttpError, AuthenticationError, ValidationError, ForbiddenError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, ServerError, } from "./errors.js";
4
- export { NUMBER_STATUS_FAILURE_CODES } from "./types.js";
4
+ export { NUMBER_STATUS_FAILURE_CODES, KNOWN_MESSAGE_ORIGINS } from "./types.js";
5
5
  /**
6
6
  * Reads Meta's refusal list out of the error `flows.uploadJson()` throws. It is the
7
7
  * ONLY place that list is reachable — see its own docblock.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,okEAAokE;AAEpkE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGlE,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,cAAc,EACd,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAEzD;;;GAGG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,sGAAsG;AACtG,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,SAAS,EACT,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;AAsNpC,OAAO,EACH,oBAAoB,EACpB,sBAAsB,EACtB,6BAA6B,EAC7B,uBAAuB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qmEAAqmE;AAErmE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGlE,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,cAAc,EACd,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEhF;;;GAGG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,sGAAsG;AACtG,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,SAAS,EACT,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;AAiOpC,OAAO,EACH,oBAAoB,EACpB,sBAAsB,EACtB,6BAA6B,EAC7B,uBAAuB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { HttpClient } from "../http.js";
2
+ import type { LeadGetResult, LeadListParams, LeadListResult } from "../types.js";
3
+ /**
4
+ * Meta Lead Ads leads (`GET /v1/leads`) captured from the Facebook / Instagram Instant
5
+ * Forms of the Pages linked to the key's number. Newest first by Meta's own
6
+ * `created_time`.
7
+ */
8
+ export declare class LeadsResource {
9
+ #private;
10
+ constructor(http: HttpClient);
11
+ /**
12
+ * Requires a NUMBER-scoped key.
13
+ *
14
+ * On a `piiMode: "RELAY_ONLY"` number (or outside the retention window) a lead is
15
+ * still listed, with `redacted: true`: ids, attribution and status fields stay, and
16
+ * `fullName`, `email`, `phone` and `fields` are blanked. The response then carries a
17
+ * `notice`.
18
+ */
19
+ list(params?: LeadListParams): Promise<LeadListResult>;
20
+ /**
21
+ * One lead by OUR id (the `id` of {@link list}, the `leadId` of the `lead.received`
22
+ * webhook). A lead of another number answers 404 `LEAD_NOT_FOUND`.
23
+ */
24
+ get(id: string): Promise<LeadGetResult>;
25
+ }
26
+ //# sourceMappingURL=leads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leads.d.ts","sourceRoot":"","sources":["../../src/resources/leads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjF;;;;GAIG;AACH,qBAAa,aAAa;;gBAGV,IAAI,EAAE,UAAU;IAI5B;;;;;;;OAOG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAgB5D;;;OAGG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAMhD"}
@@ -0,0 +1,46 @@
1
+ import { compact } from "../internal.js";
2
+ /**
3
+ * Meta Lead Ads leads (`GET /v1/leads`) captured from the Facebook / Instagram Instant
4
+ * Forms of the Pages linked to the key's number. Newest first by Meta's own
5
+ * `created_time`.
6
+ */
7
+ export class LeadsResource {
8
+ #http;
9
+ constructor(http) {
10
+ this.#http = http;
11
+ }
12
+ /**
13
+ * Requires a NUMBER-scoped key.
14
+ *
15
+ * On a `piiMode: "RELAY_ONLY"` number (or outside the retention window) a lead is
16
+ * still listed, with `redacted: true`: ids, attribution and status fields stay, and
17
+ * `fullName`, `email`, `phone` and `fields` are blanked. The response then carries a
18
+ * `notice`.
19
+ */
20
+ async list(params) {
21
+ return this.#http.requestJson({
22
+ method: "GET",
23
+ path: "/v1/leads",
24
+ query: compact({
25
+ formId: params?.formId,
26
+ adId: params?.adId,
27
+ pageId: params?.pageId,
28
+ startDate: params?.startDate,
29
+ endDate: params?.endDate,
30
+ page: params?.page,
31
+ pageSize: params?.pageSize,
32
+ }),
33
+ });
34
+ }
35
+ /**
36
+ * One lead by OUR id (the `id` of {@link list}, the `leadId` of the `lead.received`
37
+ * webhook). A lead of another number answers 404 `LEAD_NOT_FOUND`.
38
+ */
39
+ async get(id) {
40
+ return this.#http.requestJson({
41
+ method: "GET",
42
+ path: `/v1/leads/${encodeURIComponent(id)}`,
43
+ });
44
+ }
45
+ }
46
+ //# sourceMappingURL=leads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leads.js","sourceRoot":"","sources":["../../src/resources/leads.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC;;;;GAIG;AACH,MAAM,OAAO,aAAa;IACb,KAAK,CAAa;IAE3B,YAAY,IAAgB;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI,CAAC,MAAuB;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAiB;YAC1C,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,OAAO,CAAC;gBACX,MAAM,EAAE,MAAM,EAAE,MAAM;gBACtB,IAAI,EAAE,MAAM,EAAE,IAAI;gBAClB,MAAM,EAAE,MAAM,EAAE,MAAM;gBACtB,SAAS,EAAE,MAAM,EAAE,SAAS;gBAC5B,OAAO,EAAE,MAAM,EAAE,OAAO;gBACxB,IAAI,EAAE,MAAM,EAAE,IAAI;gBAClB,QAAQ,EAAE,MAAM,EAAE,QAAQ;aAC7B,CAAC;SACL,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,GAAG,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAgB;YACzC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,aAAa,kBAAkB,CAAC,EAAE,CAAC,EAAE;SAC9C,CAAC,CAAC;IACP,CAAC;CACJ"}
@@ -1,5 +1,5 @@
1
1
  import type { HttpClient } from "../http.js";
2
- import type { CheckNumbersInput, CheckNumbersResult, CreateMetaNumberInput, CreateNumberInput, CreateNumberResult, DeleteNumberResult, NumberConnectResult, NumberDetail, NumberLogoutResult, NumberPurgeResult, NumberRestoreResult, NumberSettingsInput, NumberStatusResult, RemotePairingInput, RemotePairingResult, UpdateNumberInput, UpdateNumberResult, WhatsAppNumberListItem } from "../types.js";
2
+ import type { CheckNumbersInput, CheckNumbersResult, CreateMetaNumberInput, CreateNumberInput, CreateNumberResult, DeleteNumberResult, NumberConnectResult, NumberDetail, NumberLogoutResult, NumberPayResult, NumberPurgeResult, NumberRestoreResult, NumberSettingsInput, NumberStatusResult, RemotePairingInput, RemotePairingResult, UpdateNumberInput, UpdateNumberResult, WhatsAppNumberListItem } from "../types.js";
3
3
  export declare class NumbersResource {
4
4
  #private;
5
5
  constructor(http: HttpClient);
@@ -81,6 +81,30 @@ export declare class NumbersResource {
81
81
  * restoring, call {@link connect} and read the QR / pairing code again.
82
82
  */
83
83
  restore(id: string): Promise<NumberRestoreResult>;
84
+ /**
85
+ * "Pay now" for the extra-number charge of one number
86
+ * (`POST /v1/numbers/{id}/pay`, no body).
87
+ *
88
+ * A number past the workspace's paid capacity is charged when it first connects.
89
+ * If that charge is refused the number stays connected but SENDING from it is
90
+ * blocked — `extraChargeUnpaidSince` is set on the number, and a send answers
91
+ * `409 NUMBER_BLOCKED` with `reason: "extra_charge_unpaid"` — until it is paid.
92
+ * A QR-paired number is disconnected at `extraChargeDisconnectAt` if it stays
93
+ * unpaid.
94
+ *
95
+ * ⚠️ With a card on file this CHARGES it. Requires a tenant-scoped API key with the
96
+ * `billing:manage` permission, like `subscription.addExtraNumbers()`.
97
+ *
98
+ * Resolves to `{ ok: true, status: "paid" }`, or `status: "not_required"` when
99
+ * nothing is owed for the number — so it is safe to call again.
100
+ *
101
+ * A refusal THROWS, and 402 has no error class of its own: catch
102
+ * `PilotStatusHttpError` and read `err.status` and `err.body.code`
103
+ * (typed as `NumberPayErrorBody`) — 402 `PAYMENT_FAILED` / `INSUFFICIENT_FUNDS`,
104
+ * 502 `PAYMENT_PROVIDER_ERROR`, 409 `PAYMENT_IN_PROGRESS`. The SDK never retries a
105
+ * POST on its own.
106
+ */
107
+ pay(id: string): Promise<NumberPayResult>;
84
108
  /**
85
109
  * IMMEDIATE hard delete (`DELETE /v1/numbers/{id}/purge`) — the behavior
86
110
  * `delete()` had before the soft delete.
@@ -1 +1 @@
1
- {"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src/resources/numbers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EACR,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACzB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;;gBAGZ,IAAI,EAAE,UAAU;IAItB,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAajE,IAAI,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAOrC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAOvD;;;;;;;;;;OAUG;IACG,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAOxD;;;;OAIG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,YAAY,CAAC;IAQjF;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAQ/E;;;;;;;;;;;;;;;;OAgBG;IACG,cAAc,CAChB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,mB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rE,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAY/E"}
@@ -130,6 +130,35 @@ export class NumbersResource {
130
130
  path: `/v1/numbers/${encodeURIComponent(id)}/restore`,
131
131
  });
132
132
  }
133
+ /**
134
+ * "Pay now" for the extra-number charge of one number
135
+ * (`POST /v1/numbers/{id}/pay`, no body).
136
+ *
137
+ * A number past the workspace's paid capacity is charged when it first connects.
138
+ * If that charge is refused the number stays connected but SENDING from it is
139
+ * blocked — `extraChargeUnpaidSince` is set on the number, and a send answers
140
+ * `409 NUMBER_BLOCKED` with `reason: "extra_charge_unpaid"` — until it is paid.
141
+ * A QR-paired number is disconnected at `extraChargeDisconnectAt` if it stays
142
+ * unpaid.
143
+ *
144
+ * ⚠️ With a card on file this CHARGES it. Requires a tenant-scoped API key with the
145
+ * `billing:manage` permission, like `subscription.addExtraNumbers()`.
146
+ *
147
+ * Resolves to `{ ok: true, status: "paid" }`, or `status: "not_required"` when
148
+ * nothing is owed for the number — so it is safe to call again.
149
+ *
150
+ * A refusal THROWS, and 402 has no error class of its own: catch
151
+ * `PilotStatusHttpError` and read `err.status` and `err.body.code`
152
+ * (typed as `NumberPayErrorBody`) — 402 `PAYMENT_FAILED` / `INSUFFICIENT_FUNDS`,
153
+ * 502 `PAYMENT_PROVIDER_ERROR`, 409 `PAYMENT_IN_PROGRESS`. The SDK never retries a
154
+ * POST on its own.
155
+ */
156
+ async pay(id) {
157
+ return this.#http.requestJson({
158
+ method: "POST",
159
+ path: `/v1/numbers/${encodeURIComponent(id)}/pay`,
160
+ });
161
+ }
133
162
  /**
134
163
  * IMMEDIATE hard delete (`DELETE /v1/numbers/{id}/purge`) — the behavior
135
164
  * `delete()` had before the soft delete.
@@ -1 +1 @@
1
- {"version":3,"file":"numbers.js","sourceRoot":"","sources":["../../src/resources/numbers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAsBzC,MAA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