@pilot-status/sdk 0.14.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/CHANGELOG.md +62 -0
- package/README.md +59 -4
- package/dist/client.d.ts +9 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +12 -0
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/ads.d.ts +40 -0
- package/dist/resources/ads.d.ts.map +1 -0
- package/dist/resources/ads.js +67 -0
- package/dist/resources/ads.js.map +1 -0
- package/dist/resources/lead-pages.d.ts +44 -0
- package/dist/resources/lead-pages.d.ts.map +1 -0
- package/dist/resources/lead-pages.js +87 -0
- package/dist/resources/lead-pages.js.map +1 -0
- package/dist/resources/messages.d.ts.map +1 -1
- package/dist/resources/messages.js +7 -0
- package/dist/resources/messages.js.map +1 -1
- package/dist/resources/numbers.d.ts +4 -0
- package/dist/resources/numbers.d.ts.map +1 -1
- package/dist/resources/numbers.js +4 -0
- package/dist/resources/numbers.js.map +1 -1
- package/dist/resources/referrals.d.ts +32 -0
- package/dist/resources/referrals.d.ts.map +1 -0
- package/dist/resources/referrals.js +55 -0
- package/dist/resources/referrals.js.map +1 -0
- package/dist/resources/workspace.d.ts +8 -10
- package/dist/resources/workspace.d.ts.map +1 -1
- package/dist/resources/workspace.js +8 -10
- package/dist/resources/workspace.js.map +1 -1
- package/dist/types.d.ts +412 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,68 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@pilot-status/sdk`.
|
|
4
4
|
|
|
5
|
+
## 0.16.0 - 2026-10-20
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **`referrals.list()` / `referrals.summary()`** — `GET /v1/referrals` and
|
|
10
|
+
`GET /v1/referrals/summary`, Click-to-WhatsApp ad attribution. `list` filters by
|
|
11
|
+
`sourceId`, `sourceType` (`"ad"` | `"post"`), `startDate`, `endDate`, `page`, `pageSize`
|
|
12
|
+
(max 100) and returns the inbound messages that started a conversation from an ad, each
|
|
13
|
+
with a `referral` block (`ChatReferral`: `sourceId`, ad copy, `ctwaClid`, resolved
|
|
14
|
+
`campaignName` / `adsetName` / `adName` and `namesResolvedAt`). `summary` groups by ad
|
|
15
|
+
(`conversations` = DISTINCT conversations, `messages`), capped at 200 ads with
|
|
16
|
+
`truncated`, `notice?` and `piiNotice?`. `sourceId` is the stable identity; names are
|
|
17
|
+
filled only when the advertiser shared the ad account with Pilot Status. Acts on one
|
|
18
|
+
number and needs `chat:read`: a number-scoped key, or an account-wide key with
|
|
19
|
+
`whatsappNumberId` (else 403 `TENANT_SCOPE_NOT_ALLOWED`).
|
|
20
|
+
- **`ads`** — `listAccounts()` (`GET /v1/ads/accounts`), `linkAccount(adAccountId)`
|
|
21
|
+
(`POST`, 201), `unlinkAccount(adAccountId)` (`DELETE`, soft) — account-wide key,
|
|
22
|
+
`integrations:manage`; and `summary({ whatsappNumberId?, startDate?, endDate? })`
|
|
23
|
+
(`GET /v1/ads/summary`, `analytics:read`): ads volume with names and `leadCount`,
|
|
24
|
+
workspace-wide on an account-wide key without a number.
|
|
25
|
+
- **`leadPages`** — `list()`, `link({ pageId, whatsappNumberId? })` (201), `update(id,
|
|
26
|
+
{ whatsappNumberId })` (→ `autoSendDisabled`), `unlink(id)`, `listForms(id)`,
|
|
27
|
+
`updateForm(id, formId, config)` (PUT, replaces the whole config), `resync(id)` (202;
|
|
28
|
+
429 `RESYNC_COOLDOWN` with `retryAfterSeconds`). `integrations:manage`; a credential
|
|
29
|
+
bound to one number sees only its links. ⚠️ `unlink` ERASES every lead captured through
|
|
30
|
+
the Page (`deletedLeads`) and its form configs.
|
|
31
|
+
- Types for all of the above, and an optional `referral` on `ChatHistoryMessage` (the
|
|
32
|
+
history endpoint already returned it).
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- **`seatLimit` is now `number | null`** on `WorkspaceDetail` (`workspace.get()`) and
|
|
37
|
+
`WorkspaceMemberList` (`workspace.members.listWithSeats()`). Members are unlimited on
|
|
38
|
+
every plan: the API sends `seatLimit: null` and no longer answers 409
|
|
39
|
+
`SEAT_LIMIT_REACHED`. `seatsUsed` stays, as information only (ACTIVE members plus PENDING
|
|
40
|
+
invites in their window). TypeScript callers that did arithmetic on `seatLimit` now have
|
|
41
|
+
to handle `null`.
|
|
42
|
+
|
|
43
|
+
## 0.15.0 - 2026-10-19
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- **`markRead`** (`boolean`, optional) on `messages.send()` (`SendMessageInput`). Omitted,
|
|
48
|
+
the number's `markReadOnSend` setting decides (default `true`). `false` on a Meta Cloud
|
|
49
|
+
API number: the message goes out WITHOUT the "typing" indicator and the contact's last
|
|
50
|
+
inbound message is NOT marked read (no blue ticks) — the Cloud API only allows typing as
|
|
51
|
+
part of a read receipt, so the two are inseparable. Use case: an AI agent replies and a
|
|
52
|
+
human still finds the conversation unread later. No effect on Evolution (unofficial)
|
|
53
|
+
numbers: sending never marks read there, and read-on-arrival is the number's
|
|
54
|
+
`readMessages` setting (turn it off for this use case). ⚠️ `messages.typing()` on a Meta
|
|
55
|
+
number also marks read. A non-boolean value makes `send()` throw a `TypeError` before
|
|
56
|
+
any request (the API would refuse it with `400`); `false` reaches the server and an
|
|
57
|
+
omitted value keeps the number's default.
|
|
58
|
+
- **`markReadOnSend`** (`boolean`, default `true`) in `NumberSettingsInput` — `settings` of
|
|
59
|
+
`numbers.create()`, `numbers.update()` and `numbers.updateSettings()` — and therefore in
|
|
60
|
+
the `settings` block of `NumberSettings` (`numbers.get()`). The per-number default for
|
|
61
|
+
`markRead`, with the same semantics and the same Meta-only effect. Platform-level, beside
|
|
62
|
+
`historyImportEnabled` / `webhookHistoricalMessages` / `ignoreNewsletters`, not an
|
|
63
|
+
Evolution GO advanced setting.
|
|
64
|
+
- **`appliesTo.sending`** (`"meta" | "none"`) in `NumberSettings` — where
|
|
65
|
+
`markReadOnSend` takes effect: `"meta"` on an official number, `"none"` on an unofficial one.
|
|
66
|
+
|
|
5
67
|
## 0.14.0 - 2026-10-11
|
|
6
68
|
|
|
7
69
|
### Added
|
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ for (const k of keys) {
|
|
|
83
83
|
|
|
84
84
|
```ts
|
|
85
85
|
const ws = await client.workspace.get();
|
|
86
|
-
console.log(ws.seatsUsed
|
|
86
|
+
console.log(ws.seatsUsed); // informational: members are unlimited, `ws.seatLimit` is null
|
|
87
87
|
|
|
88
88
|
const members = await client.workspace.members.list(); // ACTIVE + PENDING
|
|
89
89
|
```
|
|
@@ -126,6 +126,9 @@ await client.numbers.updateSettings(id, { webhookHistoricalMessages: false });
|
|
|
126
126
|
// stored messages and webhook deliveries
|
|
127
127
|
await client.numbers.updateSettings(id, { ignoreNewsletters: true });
|
|
128
128
|
|
|
129
|
+
// Meta number: sends no longer show "typing" nor mark the chat read
|
|
130
|
+
await client.numbers.updateSettings(id, { markReadOnSend: false });
|
|
131
|
+
|
|
129
132
|
await client.numbers.update(id, {
|
|
130
133
|
piiMode: "STORE_X_DAYS",
|
|
131
134
|
piiRetentionDays: 30,
|
|
@@ -133,12 +136,19 @@ await client.numbers.update(id, {
|
|
|
133
136
|
});
|
|
134
137
|
```
|
|
135
138
|
|
|
136
|
-
`historyImportEnabled`, `webhookHistoricalMessages
|
|
137
|
-
|
|
139
|
+
`historyImportEnabled`, `webhookHistoricalMessages`, `ignoreNewsletters` and
|
|
140
|
+
`markReadOnSend` are platform-level and accepted on every provider. `ignoreNewsletters` is where a WhatsApp Channel post is
|
|
138
141
|
refused: the provider exposes no `@newsletter` gate (unlike `ignoreGroups`, which
|
|
139
142
|
it applies itself), so the post always arrives and is dropped on our side —
|
|
140
143
|
before the conversation, the stored message and the webhook. On a Meta number
|
|
141
|
-
channels never arrive at all.
|
|
144
|
+
channels never arrive at all. `markReadOnSend` (default `true`) is the default for
|
|
145
|
+
`markRead` on `messages.send()`: with `false`, a send from a Meta Cloud API number
|
|
146
|
+
goes out WITHOUT the "typing" indicator and does NOT mark the contact's last inbound
|
|
147
|
+
message read (no blue ticks) — the Cloud API only allows typing as part of a read
|
|
148
|
+
receipt, so the two are inseparable. It has no effect on an Evolution number:
|
|
149
|
+
sending never marks read there, and read-on-arrival is `readMessages` (turn it off
|
|
150
|
+
for the "AI replies, a human still sees it unread" case). ⚠️ `messages.typing()` on
|
|
151
|
+
a Meta number also marks read. The other six are the Evolution GO
|
|
142
152
|
`advancedSettings`, in the GO dialect
|
|
143
153
|
(`ignoreGroups`, not the v2 `groupsIgnore`); passing `null` resets one to the
|
|
144
154
|
provider default. On a Meta number they are stored but never applied — which is
|
|
@@ -246,6 +256,15 @@ const { total, messages } = await client.messages.unread();
|
|
|
246
256
|
await client.messages.markRead("+5511999999999");
|
|
247
257
|
await client.messages.typing({ to: "+5511999999999", state: "typing" });
|
|
248
258
|
|
|
259
|
+
// Reply WITHOUT marking the conversation read (e.g. an AI agent answering while a
|
|
260
|
+
// human still needs to see it unread). Omit `markRead` to use the number's
|
|
261
|
+
// `markReadOnSend` setting (default true).
|
|
262
|
+
await client.messages.send({
|
|
263
|
+
destinationNumber: "+5511999999999",
|
|
264
|
+
text: "Thanks, we got your message!",
|
|
265
|
+
markRead: false,
|
|
266
|
+
});
|
|
267
|
+
|
|
249
268
|
// Conversations, newest activity first
|
|
250
269
|
const { conversations } = await client.conversations.list({ pageSize: 50 });
|
|
251
270
|
|
|
@@ -256,6 +275,42 @@ const { lead } = await client.leads.get(leads[0].id); // 404 LEAD_NOT_FOUND for
|
|
|
256
275
|
// On a RELAY_ONLY number a lead keeps ids, attribution and status, with `redacted: true`
|
|
257
276
|
// and fullName/email/phone/fields blanked; the response then carries `notice`.
|
|
258
277
|
|
|
278
|
+
// Click-to-WhatsApp ad attribution (`chat:read`). Acts on ONE number: a number-scoped key,
|
|
279
|
+
// or an account-wide key with `whatsappNumberId` set (else 403 TENANT_SCOPE_NOT_ALLOWED).
|
|
280
|
+
// Filters: sourceId, sourceType ("ad" | "post"), startDate, endDate, page, pageSize.
|
|
281
|
+
const { referrals } = await client.referrals.list({ sourceType: "ad", pageSize: 100 });
|
|
282
|
+
// Each row is the FIRST inbound of a conversation started by the ad; `referral.sourceId`
|
|
283
|
+
// is the stable ad id, `referral.campaignName`/`adsetName`/`adName` are filled only when
|
|
284
|
+
// the advertiser shared the ad account with Pilot Status (see `namesResolvedAt`).
|
|
285
|
+
const { ads, truncated } = await client.referrals.summary({ startDate: "2026-10-01T00:00:00Z" });
|
|
286
|
+
// `conversations` = distinct conversations (the lead count), `messages` = messages.
|
|
287
|
+
// Capped at 200 ads: `truncated: true` means a PARTIAL answer — narrow the dates.
|
|
288
|
+
|
|
289
|
+
// Ads configuration. Ad accounts (account-wide key, `integrations:manage`): access comes
|
|
290
|
+
// from the advertiser adding `partnerBusinessId` as a PARTNER (ads_read) of the ad account.
|
|
291
|
+
const { linked, candidates, partnerBusinessId } = await client.ads.listAccounts();
|
|
292
|
+
await client.ads.linkAccount("act_1234567890"); // 409 AD_ACCOUNT_NOT_PROVEN / AD_ACCOUNT_NOT_SHARED
|
|
293
|
+
await client.ads.unlinkAccount("act_1234567890");
|
|
294
|
+
// Ads volume with names and `leadCount` (`analytics:read`). An account-wide key without
|
|
295
|
+
// `whatsappNumberId` reports the whole workspace; the param narrows it to one number.
|
|
296
|
+
const report = await client.ads.summary({ startDate: "2026-10-01T00:00:00Z" });
|
|
297
|
+
|
|
298
|
+
// Lead Ads Pages and Instant Forms (`integrations:manage`).
|
|
299
|
+
const pages = await client.leadPages.list();
|
|
300
|
+
const { link } = await client.leadPages.link({ pageId: "1234567890", whatsappNumberId: "wn_1" });
|
|
301
|
+
const { autoSendDisabled } = await client.leadPages.update(link.pageLinkId, { whatsappNumberId: "wn_2" });
|
|
302
|
+
await client.leadPages.resync(link.pageLinkId); // 202; 429 RESYNC_COOLDOWN carries retryAfterSeconds
|
|
303
|
+
const { forms, templates } = await client.leadPages.listForms(link.pageLinkId);
|
|
304
|
+
await client.leadPages.updateForm(link.pageLinkId, forms[0].formId, {
|
|
305
|
+
consentDisclaimerKey: null,
|
|
306
|
+
autoSendEnabled: true, // new leads get a WhatsApp message without a human
|
|
307
|
+
templateId: templates[0].id, // official numbers; others use `freeText`
|
|
308
|
+
freeText: null,
|
|
309
|
+
variableMap: { "1": { source: "field", key: "full_name" } },
|
|
310
|
+
});
|
|
311
|
+
// ⚠️ unlink ERASES every lead captured through the Page and its form configs.
|
|
312
|
+
const { deletedLeads } = await client.leadPages.unlink(link.pageLinkId);
|
|
313
|
+
|
|
259
314
|
// Can I send free-form right now?
|
|
260
315
|
const w = await client.serviceWindow.get("+5511999999999");
|
|
261
316
|
// Branch on windowType, not on `open`: web numbers always report open: true
|
package/dist/client.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ import { CallsResource } from "./resources/calls.js";
|
|
|
5
5
|
import { ChatwootResource } from "./resources/chatwoot.js";
|
|
6
6
|
import { ConversationsResource } from "./resources/conversations.js";
|
|
7
7
|
import { LeadsResource } from "./resources/leads.js";
|
|
8
|
+
import { ReferralsResource } from "./resources/referrals.js";
|
|
9
|
+
import { AdsResource } from "./resources/ads.js";
|
|
10
|
+
import { LeadPagesResource } from "./resources/lead-pages.js";
|
|
8
11
|
import { EmbedResource } from "./resources/embed.js";
|
|
9
12
|
import { FlowsResource } from "./resources/flows.js";
|
|
10
13
|
import { MessagesResource } from "./resources/messages.js";
|
|
@@ -62,6 +65,12 @@ export declare class PilotStatusClient {
|
|
|
62
65
|
readonly conversations: ConversationsResource;
|
|
63
66
|
/** Meta Lead Ads leads (`/v1/leads`) — number-scoped key only. */
|
|
64
67
|
readonly leads: LeadsResource;
|
|
68
|
+
/** Click-to-WhatsApp ad attribution (`/v1/referrals`) — acts on one number. */
|
|
69
|
+
readonly referrals: ReferralsResource;
|
|
70
|
+
/** Meta ad accounts and the ads volume report (`/v1/ads/*`). */
|
|
71
|
+
readonly ads: AdsResource;
|
|
72
|
+
/** Meta Lead Ads Pages and Instant Form configuration (`/v1/lead-pages/*`). */
|
|
73
|
+
readonly leadPages: LeadPagesResource;
|
|
65
74
|
readonly serviceWindow: ServiceWindowResource;
|
|
66
75
|
readonly meta: MetaResource;
|
|
67
76
|
readonly webhooks: WebhooksResource;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -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,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,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,oBAA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AAQ,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;IAkD7C;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,gBAAgB,EAAE,MAAM,GAAG,iBAAiB;CAGxD"}
|
package/dist/client.js
CHANGED
|
@@ -5,6 +5,9 @@ import { CallsResource } from "./resources/calls.js";
|
|
|
5
5
|
import { ChatwootResource } from "./resources/chatwoot.js";
|
|
6
6
|
import { ConversationsResource } from "./resources/conversations.js";
|
|
7
7
|
import { LeadsResource } from "./resources/leads.js";
|
|
8
|
+
import { ReferralsResource } from "./resources/referrals.js";
|
|
9
|
+
import { AdsResource } from "./resources/ads.js";
|
|
10
|
+
import { LeadPagesResource } from "./resources/lead-pages.js";
|
|
8
11
|
import { EmbedResource } from "./resources/embed.js";
|
|
9
12
|
import { FlowsResource } from "./resources/flows.js";
|
|
10
13
|
import { MessagesResource } from "./resources/messages.js";
|
|
@@ -39,6 +42,12 @@ export class PilotStatusClient {
|
|
|
39
42
|
conversations;
|
|
40
43
|
/** Meta Lead Ads leads (`/v1/leads`) — number-scoped key only. */
|
|
41
44
|
leads;
|
|
45
|
+
/** Click-to-WhatsApp ad attribution (`/v1/referrals`) — acts on one number. */
|
|
46
|
+
referrals;
|
|
47
|
+
/** Meta ad accounts and the ads volume report (`/v1/ads/*`). */
|
|
48
|
+
ads;
|
|
49
|
+
/** Meta Lead Ads Pages and Instant Form configuration (`/v1/lead-pages/*`). */
|
|
50
|
+
leadPages;
|
|
42
51
|
serviceWindow;
|
|
43
52
|
meta;
|
|
44
53
|
webhooks;
|
|
@@ -79,6 +88,9 @@ export class PilotStatusClient {
|
|
|
79
88
|
this.calls = new CallsResource(http);
|
|
80
89
|
this.conversations = new ConversationsResource(http);
|
|
81
90
|
this.leads = new LeadsResource(http);
|
|
91
|
+
this.referrals = new ReferralsResource(http);
|
|
92
|
+
this.ads = new AdsResource(http);
|
|
93
|
+
this.leadPages = new LeadPagesResource(http);
|
|
82
94
|
this.serviceWindow = new ServiceWindowResource(http);
|
|
83
95
|
this.meta = new MetaResource(http);
|
|
84
96
|
this.webhooks = new WebhooksResource(http);
|
package/dist/client.js.map
CHANGED
|
@@ -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,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,0BAA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AI,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
|
@@ -10,7 +10,7 @@ export { NUMBER_STATUS_FAILURE_CODES, KNOWN_MESSAGE_ORIGINS } 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, 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";
|
|
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, ChatReferral, ReferralListParams, ReferralMessage, ReferralListResult, ReferralSummaryParams, ReferralSummaryAd, ReferralSummaryResult, LinkedAdAccount, AdAccountCandidate, AdAccountListResult, AdAccountLinkResult, AdAccountUnlinkResult, AdsSummaryParams, AdsSummaryAd, AdsSummaryResult, LeadPageLink, LeadPageCandidate, LeadPageListResult, LeadPageLinkInput, LeadPageLinkResult, LeadPageUpdateInput, LeadPageUpdateResult, LeadPageUnlinkResult, LeadPageResyncResult, LeadVariableSource, LeadFormConfig, LeadFormQuestion, LeadForm, LeadFormListResult, LeadFormConfigInput, LeadFormConfigResult, 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
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";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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;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,k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ACvB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,6BAA6B,EAC7B,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAC7B,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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAgQpC,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,40 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { AdAccountLinkResult, AdAccountListResult, AdAccountUnlinkResult, AdsSummaryParams, AdsSummaryResult } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Meta ads configuration (`/v1/ads/*`): the ad accounts connected to the workspace (so
|
|
5
|
+
* ad / ad set / campaign NAMES can be resolved) and the ads volume report.
|
|
6
|
+
*
|
|
7
|
+
* Access to an ad account comes from the advertiser adding the Pilot Status business
|
|
8
|
+
* portfolio (`partnerBusinessId`) as a PARTNER with `ads_read` in Meta Business Manager —
|
|
9
|
+
* there is no token to send here.
|
|
10
|
+
*/
|
|
11
|
+
export declare class AdsResource {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(http: HttpClient);
|
|
14
|
+
/**
|
|
15
|
+
* Connected ad accounts and the ones that may be connected. Account-wide (tenant)
|
|
16
|
+
* key only, with `integrations:manage`; a number-scoped key is refused.
|
|
17
|
+
*/
|
|
18
|
+
listAccounts(): Promise<AdAccountListResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Connect one ad account (`act_<digits>`). Answers 201 `{ link }`. Refusals:
|
|
21
|
+
* 409 `AD_ACCOUNT_NOT_PROVEN` (no ad of that account in this workspace's
|
|
22
|
+
* conversations), 409 `AD_ACCOUNT_NOT_SHARED` (partner grant not there yet),
|
|
23
|
+
* 502 `ADS_LOOKUP_UNAVAILABLE`, 503 `ADS_NOT_CONFIGURED`. Account-wide key only.
|
|
24
|
+
*/
|
|
25
|
+
linkAccount(adAccountId: string): Promise<AdAccountLinkResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Disconnect one ad account. Soft: names already resolved stay. 404 `NOT_FOUND` when
|
|
28
|
+
* it is not linked to this workspace. Account-wide key only.
|
|
29
|
+
*/
|
|
30
|
+
unlinkAccount(adAccountId: string): Promise<AdAccountUnlinkResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Click-to-WhatsApp volume per ad, with resolved names and `leadCount`. Needs
|
|
33
|
+
* `analytics:read` (unlike `referrals.summary()`, which needs `chat:read`). A credential
|
|
34
|
+
* bound to one number (number-scoped key, or `whatsappNumberId` on the client) reports
|
|
35
|
+
* that number; an account-wide key without it reports the whole workspace. Capped at
|
|
36
|
+
* 200 ads (`truncated`).
|
|
37
|
+
*/
|
|
38
|
+
summary(params?: AdsSummaryParams): Promise<AdsSummaryResult>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=ads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ads.d.ts","sourceRoot":"","sources":["../../src/resources/ads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAErB;;;;;;;GAOG;AACH,qBAAa,WAAW;;gBAGV,IAAI,EAAE,UAAU;IAI5B;;;OAGG;IACG,YAAY,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAOlD;;;;;OAKG;IACG,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAQpE;;;OAGG;IACG,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAOxE;;;;;;OAMG;IACG,OAAO,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAWpE"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { compact } from "../internal.js";
|
|
2
|
+
/**
|
|
3
|
+
* Meta ads configuration (`/v1/ads/*`): the ad accounts connected to the workspace (so
|
|
4
|
+
* ad / ad set / campaign NAMES can be resolved) and the ads volume report.
|
|
5
|
+
*
|
|
6
|
+
* Access to an ad account comes from the advertiser adding the Pilot Status business
|
|
7
|
+
* portfolio (`partnerBusinessId`) as a PARTNER with `ads_read` in Meta Business Manager —
|
|
8
|
+
* there is no token to send here.
|
|
9
|
+
*/
|
|
10
|
+
export class AdsResource {
|
|
11
|
+
#http;
|
|
12
|
+
constructor(http) {
|
|
13
|
+
this.#http = http;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Connected ad accounts and the ones that may be connected. Account-wide (tenant)
|
|
17
|
+
* key only, with `integrations:manage`; a number-scoped key is refused.
|
|
18
|
+
*/
|
|
19
|
+
async listAccounts() {
|
|
20
|
+
return this.#http.requestJson({
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: "/v1/ads/accounts",
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Connect one ad account (`act_<digits>`). Answers 201 `{ link }`. Refusals:
|
|
27
|
+
* 409 `AD_ACCOUNT_NOT_PROVEN` (no ad of that account in this workspace's
|
|
28
|
+
* conversations), 409 `AD_ACCOUNT_NOT_SHARED` (partner grant not there yet),
|
|
29
|
+
* 502 `ADS_LOOKUP_UNAVAILABLE`, 503 `ADS_NOT_CONFIGURED`. Account-wide key only.
|
|
30
|
+
*/
|
|
31
|
+
async linkAccount(adAccountId) {
|
|
32
|
+
return this.#http.requestJson({
|
|
33
|
+
method: "POST",
|
|
34
|
+
path: "/v1/ads/accounts",
|
|
35
|
+
body: { adAccountId },
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Disconnect one ad account. Soft: names already resolved stay. 404 `NOT_FOUND` when
|
|
40
|
+
* it is not linked to this workspace. Account-wide key only.
|
|
41
|
+
*/
|
|
42
|
+
async unlinkAccount(adAccountId) {
|
|
43
|
+
return this.#http.requestJson({
|
|
44
|
+
method: "DELETE",
|
|
45
|
+
path: `/v1/ads/accounts/${encodeURIComponent(adAccountId)}`,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Click-to-WhatsApp volume per ad, with resolved names and `leadCount`. Needs
|
|
50
|
+
* `analytics:read` (unlike `referrals.summary()`, which needs `chat:read`). A credential
|
|
51
|
+
* bound to one number (number-scoped key, or `whatsappNumberId` on the client) reports
|
|
52
|
+
* that number; an account-wide key without it reports the whole workspace. Capped at
|
|
53
|
+
* 200 ads (`truncated`).
|
|
54
|
+
*/
|
|
55
|
+
async summary(params) {
|
|
56
|
+
return this.#http.requestJson({
|
|
57
|
+
method: "GET",
|
|
58
|
+
path: "/v1/ads/summary",
|
|
59
|
+
query: compact({
|
|
60
|
+
whatsappNumberId: params?.whatsappNumberId,
|
|
61
|
+
startDate: params?.startDate,
|
|
62
|
+
endDate: params?.endDate,
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=ads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ads.js","sourceRoot":"","sources":["../../src/resources/ads.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AASzC;;;;;;;GAOG;AACH,MAAM,OAAO,WAAW;IACb,KAAK,CAAa;IAE3B,YAAY,IAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAsB;YACjD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,kBAAkB;SACzB,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CAAC,WAAmB;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAsB;YACjD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,EAAE,WAAW,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,aAAa,CAAC,WAAmB;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAwB;YACnD,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,oBAAoB,kBAAkB,CAAC,WAAW,CAAC,EAAE;SAC5D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,OAAO,CAAC,MAAyB;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAmB;YAC9C,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,OAAO,CAAC;gBACb,gBAAgB,EAAE,MAAM,EAAE,gBAAgB;gBAC1C,SAAS,EAAE,MAAM,EAAE,SAAS;gBAC5B,OAAO,EAAE,MAAM,EAAE,OAAO;aACzB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { LeadFormConfigInput, LeadFormConfigResult, LeadFormListResult, LeadPageLinkInput, LeadPageLinkResult, LeadPageListResult, LeadPageResyncResult, LeadPageUnlinkResult, LeadPageUpdateInput, LeadPageUpdateResult } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Meta Lead Ads configuration (`/v1/lead-pages/*`): which Facebook Pages feed leads to
|
|
5
|
+
* which WhatsApp number, and each Instant Form's consent / auto-send setup.
|
|
6
|
+
*
|
|
7
|
+
* Every call needs `integrations:manage`. A credential bound to one number
|
|
8
|
+
* (number-scoped key, or `whatsappNumberId` on the client) acts on that number's links
|
|
9
|
+
* only (403 `NUMBER_NOT_IN_GRANT` otherwise); an account-wide key without it sees the
|
|
10
|
+
* whole workspace. Write calls refuse unknown body fields with 400 `UNKNOWN_FIELDS`.
|
|
11
|
+
*/
|
|
12
|
+
export declare class LeadPagesResource {
|
|
13
|
+
#private;
|
|
14
|
+
constructor(http: HttpClient);
|
|
15
|
+
/** Linked Pages and the Pages this workspace may link. */
|
|
16
|
+
list(): Promise<LeadPageListResult>;
|
|
17
|
+
/** Link one Page to one number. Answers 201 `{ link }`; the 90-day backfill starts on its own. */
|
|
18
|
+
link(input: LeadPageLinkInput): Promise<LeadPageLinkResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Move a Page link to another number. When `autoSendDisabled` comes back `true`, every
|
|
21
|
+
* auto-send of the Page's forms was switched OFF and has to be reviewed.
|
|
22
|
+
*/
|
|
23
|
+
update(pageLinkId: string, input: LeadPageUpdateInput): Promise<LeadPageUpdateResult>;
|
|
24
|
+
/**
|
|
25
|
+
* ⚠️ DESTRUCTIVE: unlinking ERASES every lead captured through this Page
|
|
26
|
+
* (`deletedLeads`) and deletes its form configurations. There is no undo.
|
|
27
|
+
*/
|
|
28
|
+
unlink(pageLinkId: string): Promise<LeadPageUnlinkResult>;
|
|
29
|
+
/** The Page's Instant Forms (live from Meta) with their stored configs and usable templates. */
|
|
30
|
+
listForms(pageLinkId: string): Promise<LeadFormListResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Create or REPLACE one form's config. ⚠️ With `autoSendEnabled: true` new leads get a
|
|
33
|
+
* WhatsApp message without a human: an official number sends `templateId` (an APPROVED
|
|
34
|
+
* template), the others send `freeText`.
|
|
35
|
+
*/
|
|
36
|
+
updateForm(pageLinkId: string, formId: string, input: LeadFormConfigInput): Promise<LeadFormConfigResult>;
|
|
37
|
+
/**
|
|
38
|
+
* Re-pull the Page's last 90 days of leads (idempotent) and retry the subscription when
|
|
39
|
+
* it is down. Answers 202; the backfill runs in the background. Inside the per-Page
|
|
40
|
+
* cooldown it throws 429 `RESYNC_COOLDOWN`, whose body carries `retryAfterSeconds`.
|
|
41
|
+
*/
|
|
42
|
+
resync(pageLinkId: string): Promise<LeadPageResyncResult>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=lead-pages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lead-pages.d.ts","sourceRoot":"","sources":["../../src/resources/lead-pages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB;;;;;;;;GAQG;AACH,qBAAa,iBAAiB;;gBAGhB,IAAI,EAAE,UAAU;IAQ5B,0DAA0D;IACpD,IAAI,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAOzC,kGAAkG;IAC5F,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWjE;;;OAGG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQ3F;;;OAGG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAO/D,gGAAgG;IAC1F,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAOhE;;;;OAIG;IACG,UAAU,CACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,oBAAoB,CAAC;IAQhC;;;;OAIG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAMhE"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Meta Lead Ads configuration (`/v1/lead-pages/*`): which Facebook Pages feed leads to
|
|
3
|
+
* which WhatsApp number, and each Instant Form's consent / auto-send setup.
|
|
4
|
+
*
|
|
5
|
+
* Every call needs `integrations:manage`. A credential bound to one number
|
|
6
|
+
* (number-scoped key, or `whatsappNumberId` on the client) acts on that number's links
|
|
7
|
+
* only (403 `NUMBER_NOT_IN_GRANT` otherwise); an account-wide key without it sees the
|
|
8
|
+
* whole workspace. Write calls refuse unknown body fields with 400 `UNKNOWN_FIELDS`.
|
|
9
|
+
*/
|
|
10
|
+
export class LeadPagesResource {
|
|
11
|
+
#http;
|
|
12
|
+
constructor(http) {
|
|
13
|
+
this.#http = http;
|
|
14
|
+
}
|
|
15
|
+
#path(pageLinkId) {
|
|
16
|
+
return `/v1/lead-pages/${encodeURIComponent(pageLinkId)}`;
|
|
17
|
+
}
|
|
18
|
+
/** Linked Pages and the Pages this workspace may link. */
|
|
19
|
+
async list() {
|
|
20
|
+
return this.#http.requestJson({
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: "/v1/lead-pages",
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** Link one Page to one number. Answers 201 `{ link }`; the 90-day backfill starts on its own. */
|
|
26
|
+
async link(input) {
|
|
27
|
+
return this.#http.requestJson({
|
|
28
|
+
method: "POST",
|
|
29
|
+
path: "/v1/lead-pages",
|
|
30
|
+
body: input.whatsappNumberId === undefined
|
|
31
|
+
? { pageId: input.pageId }
|
|
32
|
+
: { pageId: input.pageId, whatsappNumberId: input.whatsappNumberId },
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Move a Page link to another number. When `autoSendDisabled` comes back `true`, every
|
|
37
|
+
* auto-send of the Page's forms was switched OFF and has to be reviewed.
|
|
38
|
+
*/
|
|
39
|
+
async update(pageLinkId, input) {
|
|
40
|
+
return this.#http.requestJson({
|
|
41
|
+
method: "PATCH",
|
|
42
|
+
path: this.#path(pageLinkId),
|
|
43
|
+
body: { whatsappNumberId: input.whatsappNumberId },
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* ⚠️ DESTRUCTIVE: unlinking ERASES every lead captured through this Page
|
|
48
|
+
* (`deletedLeads`) and deletes its form configurations. There is no undo.
|
|
49
|
+
*/
|
|
50
|
+
async unlink(pageLinkId) {
|
|
51
|
+
return this.#http.requestJson({
|
|
52
|
+
method: "DELETE",
|
|
53
|
+
path: this.#path(pageLinkId),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** The Page's Instant Forms (live from Meta) with their stored configs and usable templates. */
|
|
57
|
+
async listForms(pageLinkId) {
|
|
58
|
+
return this.#http.requestJson({
|
|
59
|
+
method: "GET",
|
|
60
|
+
path: `${this.#path(pageLinkId)}/forms`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Create or REPLACE one form's config. ⚠️ With `autoSendEnabled: true` new leads get a
|
|
65
|
+
* WhatsApp message without a human: an official number sends `templateId` (an APPROVED
|
|
66
|
+
* template), the others send `freeText`.
|
|
67
|
+
*/
|
|
68
|
+
async updateForm(pageLinkId, formId, input) {
|
|
69
|
+
return this.#http.requestJson({
|
|
70
|
+
method: "PUT",
|
|
71
|
+
path: `${this.#path(pageLinkId)}/forms/${encodeURIComponent(formId)}`,
|
|
72
|
+
body: input,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Re-pull the Page's last 90 days of leads (idempotent) and retry the subscription when
|
|
77
|
+
* it is down. Answers 202; the backfill runs in the background. Inside the per-Page
|
|
78
|
+
* cooldown it throws 429 `RESYNC_COOLDOWN`, whose body carries `retryAfterSeconds`.
|
|
79
|
+
*/
|
|
80
|
+
async resync(pageLinkId) {
|
|
81
|
+
return this.#http.requestJson({
|
|
82
|
+
method: "POST",
|
|
83
|
+
path: `${this.#path(pageLinkId)}/resync`,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=lead-pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lead-pages.js","sourceRoot":"","sources":["../../src/resources/lead-pages.ts"],"names":[],"mappings":"AAcA;;;;;;;;GAQG;AACH,MAAM,OAAO,iBAAiB;IACnB,KAAK,CAAa;IAE3B,YAAY,IAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,KAAK,CAAC,UAAkB;QACtB,OAAO,kBAAkB,kBAAkB,CAAC,UAAU,CAAC,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C,KAAK,CAAC,UAAU,CAAC,QAAQ;SACxC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,UAAU,CACd,UAAkB,EAClB,MAAc,EACd,KAA0B;QAE1B,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAuB;YAClD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE;YACrE,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,UAAkB;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAuB;YAClD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS;SACzC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/resources/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAEV,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB,qBAAa,gBAAgB;;gBAGf,IAAI,EAAE,UAAU;IAItB,IAAI,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/resources/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAEV,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB,qBAAa,gBAAgB;;gBAGf,IAAI,EAAE,UAAU;IAItB,IAAI,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAkD3D,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAO9C;;;;;;;;;;;;;;;;OAgBG;IACG,OAAO,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAarE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQjE;;;;;;;;OAQG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAkBlE,+EAA+E;IACzE,KAAK,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAavE;;;;;;;OAOG;IACG,MAAM,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQ1E;;;;;;;;OAQG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAQnD;;;;;;;;;OASG;IACG,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;CAOxD"}
|
|
@@ -5,6 +5,11 @@ export class MessagesResource {
|
|
|
5
5
|
this.#http = http;
|
|
6
6
|
}
|
|
7
7
|
async send(input) {
|
|
8
|
+
// Plain JS can pass anything; a stringly "false" would otherwise be dropped and
|
|
9
|
+
// the message would silently mark the contact's chat as read.
|
|
10
|
+
if (input.markRead !== undefined && typeof input.markRead !== "boolean") {
|
|
11
|
+
throw new TypeError(`markRead must be a boolean (true or false), got ${typeof input.markRead}`);
|
|
12
|
+
}
|
|
8
13
|
return this.#http.requestJson({
|
|
9
14
|
method: "POST",
|
|
10
15
|
path: "/v1/messages/send",
|
|
@@ -41,6 +46,8 @@ export class MessagesResource {
|
|
|
41
46
|
...(input.text ? { text: input.text } : {}),
|
|
42
47
|
...(input.header ? { header: input.header } : {}),
|
|
43
48
|
...(input.footer ? { footer: input.footer } : {}),
|
|
49
|
+
// `false` is the value that matters here, so test for presence, not truthiness.
|
|
50
|
+
...(input.markRead !== undefined ? { markRead: input.markRead } : {}),
|
|
44
51
|
},
|
|
45
52
|
});
|
|
46
53
|
}
|