@pilot-status/sdk 0.26.0 → 0.28.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 +50 -0
- package/README.md +141 -5
- package/dist/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -0
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +10 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +10 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/resources/ads.d.ts +23 -12
- package/dist/resources/ads.d.ts.map +1 -1
- package/dist/resources/ads.js +28 -12
- package/dist/resources/ads.js.map +1 -1
- package/dist/resources/api-keys.d.ts +52 -4
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +68 -3
- package/dist/resources/api-keys.js.map +1 -1
- package/dist/resources/flows.d.ts +56 -1
- package/dist/resources/flows.d.ts.map +1 -1
- package/dist/resources/flows.js +93 -0
- package/dist/resources/flows.js.map +1 -1
- package/dist/resources/knowledge.d.ts +14 -0
- package/dist/resources/knowledge.d.ts.map +1 -0
- package/dist/resources/knowledge.js +27 -0
- package/dist/resources/knowledge.js.map +1 -0
- package/dist/resources/lead-pages.d.ts +7 -3
- package/dist/resources/lead-pages.d.ts.map +1 -1
- package/dist/resources/lead-pages.js +9 -2
- package/dist/resources/lead-pages.js.map +1 -1
- package/dist/resources/messages.d.ts +23 -1
- package/dist/resources/messages.d.ts.map +1 -1
- package/dist/resources/messages.js +34 -0
- package/dist/resources/messages.js.map +1 -1
- package/dist/resources/numbers.d.ts +36 -1
- package/dist/resources/numbers.d.ts.map +1 -1
- package/dist/resources/numbers.js +67 -0
- package/dist/resources/numbers.js.map +1 -1
- package/dist/resources/phone-lines.d.ts +67 -1
- package/dist/resources/phone-lines.d.ts.map +1 -1
- package/dist/resources/phone-lines.js +116 -0
- package/dist/resources/phone-lines.js.map +1 -1
- package/dist/resources/workspace-webhooks.d.ts +17 -1
- package/dist/resources/workspace-webhooks.d.ts.map +1 -1
- package/dist/resources/workspace-webhooks.js +21 -0
- package/dist/resources/workspace-webhooks.js.map +1 -1
- package/dist/resources/workspace.d.ts +47 -9
- package/dist/resources/workspace.d.ts.map +1 -1
- package/dist/resources/workspace.js +81 -8
- package/dist/resources/workspace.js.map +1 -1
- package/dist/types.d.ts +352 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/user-agent.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/resources/ads.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { compact } from "../internal.js";
|
|
2
2
|
/**
|
|
3
|
-
* Meta ads configuration (`/v1/ads/*`): the ad accounts connected to the workspace
|
|
4
|
-
* ad / ad set / campaign NAMES can be resolved) and the ads volume report.
|
|
3
|
+
* Meta ads configuration (`/v1/ads/*`): the ad accounts connected to the workspace's
|
|
4
|
+
* numbers (so ad / ad set / campaign NAMES can be resolved) and the ads volume report.
|
|
5
|
+
*
|
|
6
|
+
* Ads are per OFFICIAL number: each ad account is linked to ONE official (Cloud API / WABA)
|
|
7
|
+
* WhatsApp number, and a number that is not official is refused with 422
|
|
8
|
+
* `ADS_REQUIRE_OFFICIAL_NUMBER`. A number-scoped key works on its own number; an
|
|
9
|
+
* account-wide key works on any number of the workspace.
|
|
5
10
|
*
|
|
6
11
|
* Access to an ad account comes from the advertiser adding the Pilot Status business
|
|
7
12
|
* portfolio (`partnerBusinessId`) as a PARTNER with `ads_read` in Meta Business Manager —
|
|
@@ -13,31 +18,42 @@ export class AdsResource {
|
|
|
13
18
|
this.#http = http;
|
|
14
19
|
}
|
|
15
20
|
/**
|
|
16
|
-
* Connected ad accounts and the ones that may be connected
|
|
17
|
-
*
|
|
21
|
+
* Connected ad accounts and the ones that may be connected, with `integrations:manage`.
|
|
22
|
+
* `params.whatsappNumberId` narrows to one number (inside the key's scope, else 403
|
|
23
|
+
* `NUMBER_NOT_IN_GRANT`); a number-scoped key lists its own number's accounts.
|
|
24
|
+
* 422 `ADS_REQUIRE_OFFICIAL_NUMBER` when that number is not official.
|
|
18
25
|
*/
|
|
19
|
-
async listAccounts() {
|
|
26
|
+
async listAccounts(params) {
|
|
20
27
|
return this.#http.requestJson({
|
|
21
28
|
method: "GET",
|
|
22
29
|
path: "/v1/ads/accounts",
|
|
30
|
+
...(params?.whatsappNumberId !== undefined
|
|
31
|
+
? { query: { whatsappNumberId: params.whatsappNumberId } }
|
|
32
|
+
: {}),
|
|
23
33
|
});
|
|
24
34
|
}
|
|
25
35
|
/**
|
|
26
|
-
* Connect one ad account (`act_<digits>`)
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
36
|
+
* Connect one ad account (`act_<digits>`) to one official number. `options.whatsappNumberId`
|
|
37
|
+
* is REQUIRED with an account-wide (workspace) key; a number-scoped key defaults to its
|
|
38
|
+
* own number. Answers 201 `{ link }`. Refusals: 422 `ADS_REQUIRE_OFFICIAL_NUMBER`,
|
|
39
|
+
* 409 `AD_ACCOUNT_LINKED_TO_ANOTHER_NUMBER` (body carries the current `whatsappNumberId`),
|
|
40
|
+
* 409 `AD_ACCOUNT_NOT_PROVEN` (no ad of that account brought a conversation to this
|
|
41
|
+
* number), 409 `AD_ACCOUNT_NOT_SHARED` (partner grant not there yet), 403
|
|
42
|
+
* `NUMBER_NOT_IN_GRANT`, 502 `ADS_LOOKUP_UNAVAILABLE`, 503 `ADS_NOT_CONFIGURED`.
|
|
30
43
|
*/
|
|
31
|
-
async linkAccount(adAccountId) {
|
|
44
|
+
async linkAccount(adAccountId, options) {
|
|
32
45
|
return this.#http.requestJson({
|
|
33
46
|
method: "POST",
|
|
34
47
|
path: "/v1/ads/accounts",
|
|
35
|
-
body:
|
|
48
|
+
body: options?.whatsappNumberId === undefined
|
|
49
|
+
? { adAccountId }
|
|
50
|
+
: { adAccountId, whatsappNumberId: options.whatsappNumberId },
|
|
36
51
|
});
|
|
37
52
|
}
|
|
38
53
|
/**
|
|
39
54
|
* Disconnect one ad account. Soft: names already resolved stay. 404 `NOT_FOUND` when
|
|
40
|
-
* it is not linked to this workspace
|
|
55
|
+
* it is not linked to this workspace — or, with a number-scoped key, when it is linked
|
|
56
|
+
* to another number. 422 `ADS_REQUIRE_OFFICIAL_NUMBER` when the key's number is not official.
|
|
41
57
|
*/
|
|
42
58
|
async unlinkAccount(adAccountId) {
|
|
43
59
|
return this.#http.requestJson({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ads.js","sourceRoot":"","sources":["../../src/resources/ads.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ads.js","sourceRoot":"","sources":["../../src/resources/ads.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAWzC;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,WAAW;IACb,KAAK,CAAa;IAE3B,YAAY,IAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAAC,MAA4B;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAsB;YACjD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,kBAAkB;YACxB,GAAG,CAAC,MAAM,EAAE,gBAAgB,KAAK,SAAS;gBACxC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EAAE,EAAE;gBAC1D,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,WAAW,CACf,WAAmB,EACnB,OAA8B;QAE9B,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAsB;YACjD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB;YACxB,IAAI,EACF,OAAO,EAAE,gBAAgB,KAAK,SAAS;gBACrC,CAAC,CAAC,EAAE,WAAW,EAAE;gBACjB,CAAC,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,EAAE;SAClE,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpClient } from "../http.js";
|
|
2
|
-
import type { ApiKeyListResult, RegeneratedNumberKey } from "../types.js";
|
|
2
|
+
import type { ApiKeyListResult, CreatedNumberApiKey, NumberApiKeyList, RegeneratedApiKey, RegeneratedNumberKey, RevokedNumberApiKey } from "../types.js";
|
|
3
3
|
export declare class ApiKeysResource {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(http: HttpClient);
|
|
@@ -30,10 +30,58 @@ export declare class ApiKeysResource {
|
|
|
30
30
|
/**
|
|
31
31
|
* Regenerate the default key of one WhatsApp number (`POST /v1/api-keys`).
|
|
32
32
|
*
|
|
33
|
-
* Tenant-scoped action
|
|
34
|
-
*
|
|
35
|
-
*
|
|
33
|
+
* Tenant-scoped action. It rotates ONLY the DEFAULT (primary) key of the number
|
|
34
|
+
* identified by `whatsappNumberId` and returns the new usable key (shown once).
|
|
35
|
+
* Named number keys ({@link createNumberKey}) survive; a panic/reissue revokes all.
|
|
36
|
+
*
|
|
37
|
+
* **The previous default key stops working immediately** (no grace period).
|
|
38
|
+
* Zero-downtime rotation: create a named number key with {@link createNumberKey},
|
|
39
|
+
* switch your integration to it, then regenerate (or revoke) the old one.
|
|
36
40
|
*/
|
|
37
41
|
regenerateNumber(whatsappNumberId: string): Promise<RegeneratedNumberKey>;
|
|
42
|
+
/**
|
|
43
|
+
* List the keys of one number (`GET /v1/numbers/{numberId}/api-keys`): the
|
|
44
|
+
* default key (`isPrimary: true`) plus named keys, masked (`prefix`/`last4`).
|
|
45
|
+
*
|
|
46
|
+
* Credential: a workspace key (`ps_workspace_…`) or an account key
|
|
47
|
+
* (`ps_account_…` + `workspaceId`, sent as `x-workspace-id`); number keys get 403.
|
|
48
|
+
*/
|
|
49
|
+
listNumberKeys(numberId: string): Promise<NumberApiKeyList>;
|
|
50
|
+
/**
|
|
51
|
+
* Create a NAMED key for one number (`POST /v1/numbers/{numberId}/api-keys`) → 201.
|
|
52
|
+
* The raw `apiKey.key` is returned ONCE — store it. `name` is 1–60 chars
|
|
53
|
+
* (400 `name_required` / `name_too_long`); at most 20 keys per number including
|
|
54
|
+
* the default (409 `limit_reached`). Same credentials as {@link listNumberKeys}.
|
|
55
|
+
* Not retried automatically.
|
|
56
|
+
*/
|
|
57
|
+
createNumberKey(numberId: string, input: {
|
|
58
|
+
name: string;
|
|
59
|
+
}): Promise<CreatedNumberApiKey>;
|
|
60
|
+
/**
|
|
61
|
+
* Revoke one named key of a number (`DELETE /v1/numbers/{numberId}/api-keys/{keyId}`).
|
|
62
|
+
* It stops working immediately. The default key cannot be revoked here
|
|
63
|
+
* (409 `primary_key_use_regenerate`: use {@link regenerateNumber}).
|
|
64
|
+
*/
|
|
65
|
+
revokeNumberKey(numberId: string, keyId: string): Promise<RevokedNumberApiKey>;
|
|
66
|
+
/**
|
|
67
|
+
* Regenerate THE key of the calling scope (`POST /v1/api-keys/regenerate`) → 201.
|
|
68
|
+
*
|
|
69
|
+
* ⛔ **This revokes the key you are calling with.** A number-scoped key rotates
|
|
70
|
+
* itself; the workspace's primary key rotates itself. The OLD KEY STOPS WORKING
|
|
71
|
+
* IMMEDIATELY — every later call on this client answers 401 until you build a new
|
|
72
|
+
* client with the returned `key`, which is shown ONCE (store it before anything
|
|
73
|
+
* else). A named `ps_workspace_` key rotates the workspace's PRIMARY key and
|
|
74
|
+
* survives itself.
|
|
75
|
+
*
|
|
76
|
+
* Needs `apikeys:reveal` (OWNER) for an account key; a per-number OAuth grant is
|
|
77
|
+
* 403 `NUMBERS_GRANT_NOT_ALLOWED`. Never retried automatically by the SDK.
|
|
78
|
+
*
|
|
79
|
+
* **The previous key stops working immediately** (no grace period). To rotate
|
|
80
|
+
* without downtime, do not call this first: create a named workspace key
|
|
81
|
+
* (`ps_workspace_…`) with `workspaces.apiKeys.create(workspaceId, { name })`
|
|
82
|
+
* using an account key, or use an account key (`ps_account_…` + `workspaceId`)
|
|
83
|
+
* directly; switch your integration to it; then revoke the old key.
|
|
84
|
+
*/
|
|
85
|
+
regenerate(): Promise<RegeneratedApiKey>;
|
|
38
86
|
}
|
|
39
87
|
//# sourceMappingURL=api-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAKrB,qBAAa,eAAe;;gBAGd,IAAI,EAAE,UAAU;IAI5B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAOvC;;;;;;;;;;OAUG;IACG,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQ/E;;;;;;OAMG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIjE;;;;;;OAMG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAQ9F;;;;OAIG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAOpF;;;;;;;;;;;;;;;;;;OAkBG;IACG,UAAU,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAM/C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const numberKeysPath = (numberId) => `/v1/numbers/${encodeURIComponent(numberId)}/api-keys`;
|
|
1
2
|
export class ApiKeysResource {
|
|
2
3
|
#http;
|
|
3
4
|
constructor(http) {
|
|
@@ -35,9 +36,13 @@ export class ApiKeysResource {
|
|
|
35
36
|
/**
|
|
36
37
|
* Regenerate the default key of one WhatsApp number (`POST /v1/api-keys`).
|
|
37
38
|
*
|
|
38
|
-
* Tenant-scoped action
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* Tenant-scoped action. It rotates ONLY the DEFAULT (primary) key of the number
|
|
40
|
+
* identified by `whatsappNumberId` and returns the new usable key (shown once).
|
|
41
|
+
* Named number keys ({@link createNumberKey}) survive; a panic/reissue revokes all.
|
|
42
|
+
*
|
|
43
|
+
* **The previous default key stops working immediately** (no grace period).
|
|
44
|
+
* Zero-downtime rotation: create a named number key with {@link createNumberKey},
|
|
45
|
+
* switch your integration to it, then regenerate (or revoke) the old one.
|
|
41
46
|
*/
|
|
42
47
|
async regenerateNumber(whatsappNumberId) {
|
|
43
48
|
return this.#http.requestJson({
|
|
@@ -46,5 +51,65 @@ export class ApiKeysResource {
|
|
|
46
51
|
body: { whatsappNumberId },
|
|
47
52
|
});
|
|
48
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* List the keys of one number (`GET /v1/numbers/{numberId}/api-keys`): the
|
|
56
|
+
* default key (`isPrimary: true`) plus named keys, masked (`prefix`/`last4`).
|
|
57
|
+
*
|
|
58
|
+
* Credential: a workspace key (`ps_workspace_…`) or an account key
|
|
59
|
+
* (`ps_account_…` + `workspaceId`, sent as `x-workspace-id`); number keys get 403.
|
|
60
|
+
*/
|
|
61
|
+
async listNumberKeys(numberId) {
|
|
62
|
+
return this.#http.requestJson({ method: "GET", path: numberKeysPath(numberId) });
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Create a NAMED key for one number (`POST /v1/numbers/{numberId}/api-keys`) → 201.
|
|
66
|
+
* The raw `apiKey.key` is returned ONCE — store it. `name` is 1–60 chars
|
|
67
|
+
* (400 `name_required` / `name_too_long`); at most 20 keys per number including
|
|
68
|
+
* the default (409 `limit_reached`). Same credentials as {@link listNumberKeys}.
|
|
69
|
+
* Not retried automatically.
|
|
70
|
+
*/
|
|
71
|
+
async createNumberKey(numberId, input) {
|
|
72
|
+
return this.#http.requestJson({
|
|
73
|
+
method: "POST",
|
|
74
|
+
path: numberKeysPath(numberId),
|
|
75
|
+
body: { name: input.name },
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Revoke one named key of a number (`DELETE /v1/numbers/{numberId}/api-keys/{keyId}`).
|
|
80
|
+
* It stops working immediately. The default key cannot be revoked here
|
|
81
|
+
* (409 `primary_key_use_regenerate`: use {@link regenerateNumber}).
|
|
82
|
+
*/
|
|
83
|
+
async revokeNumberKey(numberId, keyId) {
|
|
84
|
+
return this.#http.requestJson({
|
|
85
|
+
method: "DELETE",
|
|
86
|
+
path: `${numberKeysPath(numberId)}/${encodeURIComponent(keyId)}`,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Regenerate THE key of the calling scope (`POST /v1/api-keys/regenerate`) → 201.
|
|
91
|
+
*
|
|
92
|
+
* ⛔ **This revokes the key you are calling with.** A number-scoped key rotates
|
|
93
|
+
* itself; the workspace's primary key rotates itself. The OLD KEY STOPS WORKING
|
|
94
|
+
* IMMEDIATELY — every later call on this client answers 401 until you build a new
|
|
95
|
+
* client with the returned `key`, which is shown ONCE (store it before anything
|
|
96
|
+
* else). A named `ps_workspace_` key rotates the workspace's PRIMARY key and
|
|
97
|
+
* survives itself.
|
|
98
|
+
*
|
|
99
|
+
* Needs `apikeys:reveal` (OWNER) for an account key; a per-number OAuth grant is
|
|
100
|
+
* 403 `NUMBERS_GRANT_NOT_ALLOWED`. Never retried automatically by the SDK.
|
|
101
|
+
*
|
|
102
|
+
* **The previous key stops working immediately** (no grace period). To rotate
|
|
103
|
+
* without downtime, do not call this first: create a named workspace key
|
|
104
|
+
* (`ps_workspace_…`) with `workspaces.apiKeys.create(workspaceId, { name })`
|
|
105
|
+
* using an account key, or use an account key (`ps_account_…` + `workspaceId`)
|
|
106
|
+
* directly; switch your integration to it; then revoke the old key.
|
|
107
|
+
*/
|
|
108
|
+
async regenerate() {
|
|
109
|
+
return this.#http.requestJson({
|
|
110
|
+
method: "POST",
|
|
111
|
+
path: "/v1/api-keys/regenerate",
|
|
112
|
+
});
|
|
113
|
+
}
|
|
49
114
|
}
|
|
50
115
|
//# sourceMappingURL=api-keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../../src/resources/api-keys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../../src/resources/api-keys.ts"],"names":[],"mappings":"AAUA,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,EAAE,CAC1C,eAAe,kBAAkB,CAAC,QAAQ,CAAC,WAAW,CAAC;AAEzD,MAAM,OAAO,eAAe;IACjB,KAAK,CAAa;IAE3B,YAAY,IAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAmB;YAC9C,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,cAAc;SACrB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,gBAAgB,CAAC,gBAAwB;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAuB;YAClD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,EAAE,gBAAgB,EAAE;SAC3B,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,cAAc,CAAC,QAAgB;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAmB,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,eAAe,CAAC,QAAgB,EAAE,KAAuB;QAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAsB;YACjD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;YAC9B,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE;SAC3B,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CAAC,QAAgB,EAAE,KAAa;QACnD,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAsB;YACjD,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE;SACjE,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAoB;YAC/C,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,yBAAyB;SAChC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpClient } from "../http.js";
|
|
2
|
-
import type { CreateFlowInput, FlowCreated, FlowDeleteResult, FlowDeprecateInput, FlowDeprecateResult, FlowEndpointKeyRotateInput, FlowEndpointKeyRotateResult, FlowEndpointKeyStatus, FlowJsonUploadResult, FlowListParams, FlowListResult, FlowPublishInput, FlowPublishResult, FlowResponseListParams, FlowResponseListResult, FlowUpdateResult, UpdateFlowInput } from "../types.js";
|
|
2
|
+
import type { CreateFlowInput, FlowCreated, FlowDeleteResult, FlowDeprecateInput, FlowDeprecateResult, FlowEndpointKeyRotateInput, FlowEndpointKeyRotateResult, FlowEndpointKeyStatus, FlowEndpointState, FlowJsonDocument, FlowJsonUploadResult, FlowListParams, FlowListResult, FlowMetaSyncResult, FlowPreviewInput, FlowPreviewResult, FlowPublishInput, FlowPublishResult, FlowResponseListParams, FlowResponseListResult, FlowTraceList, FlowUpdateResult, RegisterFlowEndpointInput, RegisterFlowEndpointResult, SetFlowEndpointInput, SetFlowEndpointResult, UpdateFlowInput } from "../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Meta's `validation_errors` list, pulled out of a thrown `uploadJson` failure.
|
|
5
5
|
*
|
|
@@ -199,5 +199,60 @@ export declare class FlowsResource {
|
|
|
199
199
|
* say it.
|
|
200
200
|
*/
|
|
201
201
|
rotateEndpointKey(whatsappNumberId: string, options?: FlowEndpointKeyRotateInput): Promise<FlowEndpointKeyRotateResult>;
|
|
202
|
+
/**
|
|
203
|
+
* `GET /v1/flows/{id}/json` — reads back the Flow JSON document from Meta
|
|
204
|
+
* (`flows:read`). 404 `FLOW_NOT_FOUND` when the Flow does not resolve under this key;
|
|
205
|
+
* 502 when it does but Meta would not hand over its document (e.g. none uploaded yet).
|
|
206
|
+
*/
|
|
207
|
+
getJson(id: string): Promise<FlowJsonDocument>;
|
|
208
|
+
/**
|
|
209
|
+
* `POST /v1/flows/{id}/preview` — a link that renders the Flow the way WhatsApp will.
|
|
210
|
+
* Works on a DRAFT. Needs `flows:manage` (ADMIN and up).
|
|
211
|
+
*
|
|
212
|
+
* ⛔ The `previewUrl` needs NO LOGIN: anyone holding it sees the Flow — treat it as a
|
|
213
|
+
* secret, never paste it into a ticket or chat. ⛔ It is not a sandbox either: for a
|
|
214
|
+
* `data_exchange` Flow the preview drives your real endpoint. `invalidate: true`
|
|
215
|
+
* mints a NEW link and kills the previous one. `expiresAt` may be `null`.
|
|
216
|
+
*/
|
|
217
|
+
preview(id: string, input?: FlowPreviewInput): Promise<FlowPreviewResult>;
|
|
218
|
+
/**
|
|
219
|
+
* `GET /v1/flows/{id}/traces` — what our proxy saw on this Flow's `data_exchange`
|
|
220
|
+
* calls (action, screen, outcome, your webhook's status and latency), newest first.
|
|
221
|
+
* One capped tail, NOT paginated (`page`/`pageSize` are refused with 400).
|
|
222
|
+
*
|
|
223
|
+
* Traces live for a short window (24 h by default): an empty list carries `notice`,
|
|
224
|
+
* because "never called" and "aged out" look the same. Bodies are withheld on a
|
|
225
|
+
* `RELAY_ONLY` number.
|
|
226
|
+
*/
|
|
227
|
+
listTraces(id: string): Promise<FlowTraceList>;
|
|
228
|
+
/**
|
|
229
|
+
* `GET /v1/flows/{id}/endpoint` — the Flow's `data_exchange` wiring: your destination
|
|
230
|
+
* `url`, whether a signing secret exists, our proxy URL, where Meta points (`drift`)
|
|
231
|
+
* and `warnings`. Needs `flows:manage`: `endpointUri` embeds a credential token.
|
|
232
|
+
*/
|
|
233
|
+
getEndpoint(id: string): Promise<FlowEndpointState>;
|
|
234
|
+
/**
|
|
235
|
+
* `PUT /v1/flows/{id}/endpoint` — sets (or, with `url: null`, removes) YOUR webhook
|
|
236
|
+
* that receives the decrypted exchanges. `url` is required and must be `https://`.
|
|
237
|
+
* `rotateSecret: true` issues a new HMAC secret (returned in `secret`; store it).
|
|
238
|
+
*
|
|
239
|
+
* ⚠️ This does NOT touch Meta: to point the Flow at our proxy, call
|
|
240
|
+
* {@link registerEndpoint}. Read `drift`/`warnings` in the answer. (`PATCH` on the
|
|
241
|
+
* same path is identical.)
|
|
242
|
+
*/
|
|
243
|
+
setEndpoint(id: string, input: SetFlowEndpointInput): Promise<SetFlowEndpointResult>;
|
|
244
|
+
/**
|
|
245
|
+
* `POST /v1/flows/{id}/endpoint` — registers our proxy URL as the Flow's
|
|
246
|
+
* `endpoint_uri` ON META (may republish the Flow: see `republished`/`finalStatus`).
|
|
247
|
+
* Overwriting an endpoint Meta already has that is not ours needs
|
|
248
|
+
* `confirmOverwrite: true`.
|
|
249
|
+
*/
|
|
250
|
+
registerEndpoint(id: string, input?: RegisterFlowEndpointInput): Promise<RegisterFlowEndpointResult>;
|
|
251
|
+
/**
|
|
252
|
+
* `POST /v1/flows/meta/sync` — re-reads the key's number's Flows from Meta and
|
|
253
|
+
* creates/updates the local catalogue (`flows:manage`). Number-scoped key; sends no
|
|
254
|
+
* body. A sync of the same number already running is 429 (`Retry-After`).
|
|
255
|
+
*/
|
|
256
|
+
syncFromMeta(): Promise<FlowMetaSyncResult>;
|
|
202
257
|
}
|
|
203
258
|
//# sourceMappingURL=flows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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;;;;;;;;;;;;OAaG;IACG,SAAS,CACX,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,kBAAuB,GACjC,OAAO,CAAC,mBAAmB,CAAC;IAU/B;;;;;;;;;;OAUG;IACG,aAAa,CACf,EAAE,EAAE,MAAM,EACV,MAAM,CAAC,EAAE,sBAAsB,GAChC,OAAO,CAAC,sBAAsB,CAAC;IAWlC;;;;;;;;;;;;;;;;OAgBG;IACG,cAAc,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAO9E;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,iBAAiB,CACnB,gBAAgB,EAAE,MAAM,EACxB,OAAO,GAAE,0BAA+B,GACzC,OAAO,CAAC,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/resources/flows.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EACR,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EAClB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,IAAI,CASzE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,aAAa;;gBAGV,IAAI,EAAE,UAA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AO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,GAAE,gBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAQnF;;;;;;;;OAQG;IACG,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAOpD;;;;OAIG;IACG,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAOzD;;;;;;;;OAQG;IACG,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAQ1F;;;;;OAKG;IACG,gBAAgB,CAClB,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,yBAA8B,GACtC,OAAO,CAAC,0BAA0B,CAAC;IAQtC;;;;OAIG;IACG,YAAY,IAAI,OAAO,CAAC,kBAAkB,CAAC;CAMpD"}
|
package/dist/resources/flows.js
CHANGED
|
@@ -285,5 +285,98 @@ export class FlowsResource {
|
|
|
285
285
|
}),
|
|
286
286
|
});
|
|
287
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* `GET /v1/flows/{id}/json` — reads back the Flow JSON document from Meta
|
|
290
|
+
* (`flows:read`). 404 `FLOW_NOT_FOUND` when the Flow does not resolve under this key;
|
|
291
|
+
* 502 when it does but Meta would not hand over its document (e.g. none uploaded yet).
|
|
292
|
+
*/
|
|
293
|
+
async getJson(id) {
|
|
294
|
+
return this.#http.requestJson({
|
|
295
|
+
method: "GET",
|
|
296
|
+
path: `/v1/flows/${encodeURIComponent(id)}/json`,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* `POST /v1/flows/{id}/preview` — a link that renders the Flow the way WhatsApp will.
|
|
301
|
+
* Works on a DRAFT. Needs `flows:manage` (ADMIN and up).
|
|
302
|
+
*
|
|
303
|
+
* ⛔ The `previewUrl` needs NO LOGIN: anyone holding it sees the Flow — treat it as a
|
|
304
|
+
* secret, never paste it into a ticket or chat. ⛔ It is not a sandbox either: for a
|
|
305
|
+
* `data_exchange` Flow the preview drives your real endpoint. `invalidate: true`
|
|
306
|
+
* mints a NEW link and kills the previous one. `expiresAt` may be `null`.
|
|
307
|
+
*/
|
|
308
|
+
async preview(id, input = {}) {
|
|
309
|
+
return this.#http.requestJson({
|
|
310
|
+
method: "POST",
|
|
311
|
+
path: `/v1/flows/${encodeURIComponent(id)}/preview`,
|
|
312
|
+
body: compact({ invalidate: input.invalidate }),
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* `GET /v1/flows/{id}/traces` — what our proxy saw on this Flow's `data_exchange`
|
|
317
|
+
* calls (action, screen, outcome, your webhook's status and latency), newest first.
|
|
318
|
+
* One capped tail, NOT paginated (`page`/`pageSize` are refused with 400).
|
|
319
|
+
*
|
|
320
|
+
* Traces live for a short window (24 h by default): an empty list carries `notice`,
|
|
321
|
+
* because "never called" and "aged out" look the same. Bodies are withheld on a
|
|
322
|
+
* `RELAY_ONLY` number.
|
|
323
|
+
*/
|
|
324
|
+
async listTraces(id) {
|
|
325
|
+
return this.#http.requestJson({
|
|
326
|
+
method: "GET",
|
|
327
|
+
path: `/v1/flows/${encodeURIComponent(id)}/traces`,
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* `GET /v1/flows/{id}/endpoint` — the Flow's `data_exchange` wiring: your destination
|
|
332
|
+
* `url`, whether a signing secret exists, our proxy URL, where Meta points (`drift`)
|
|
333
|
+
* and `warnings`. Needs `flows:manage`: `endpointUri` embeds a credential token.
|
|
334
|
+
*/
|
|
335
|
+
async getEndpoint(id) {
|
|
336
|
+
return this.#http.requestJson({
|
|
337
|
+
method: "GET",
|
|
338
|
+
path: `/v1/flows/${encodeURIComponent(id)}/endpoint`,
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* `PUT /v1/flows/{id}/endpoint` — sets (or, with `url: null`, removes) YOUR webhook
|
|
343
|
+
* that receives the decrypted exchanges. `url` is required and must be `https://`.
|
|
344
|
+
* `rotateSecret: true` issues a new HMAC secret (returned in `secret`; store it).
|
|
345
|
+
*
|
|
346
|
+
* ⚠️ This does NOT touch Meta: to point the Flow at our proxy, call
|
|
347
|
+
* {@link registerEndpoint}. Read `drift`/`warnings` in the answer. (`PATCH` on the
|
|
348
|
+
* same path is identical.)
|
|
349
|
+
*/
|
|
350
|
+
async setEndpoint(id, input) {
|
|
351
|
+
return this.#http.requestJson({
|
|
352
|
+
method: "PUT",
|
|
353
|
+
path: `/v1/flows/${encodeURIComponent(id)}/endpoint`,
|
|
354
|
+
body: compact({ url: input.url, rotateSecret: input.rotateSecret }),
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* `POST /v1/flows/{id}/endpoint` — registers our proxy URL as the Flow's
|
|
359
|
+
* `endpoint_uri` ON META (may republish the Flow: see `republished`/`finalStatus`).
|
|
360
|
+
* Overwriting an endpoint Meta already has that is not ours needs
|
|
361
|
+
* `confirmOverwrite: true`.
|
|
362
|
+
*/
|
|
363
|
+
async registerEndpoint(id, input = {}) {
|
|
364
|
+
return this.#http.requestJson({
|
|
365
|
+
method: "POST",
|
|
366
|
+
path: `/v1/flows/${encodeURIComponent(id)}/endpoint`,
|
|
367
|
+
body: compact({ confirmOverwrite: input.confirmOverwrite }),
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* `POST /v1/flows/meta/sync` — re-reads the key's number's Flows from Meta and
|
|
372
|
+
* creates/updates the local catalogue (`flows:manage`). Number-scoped key; sends no
|
|
373
|
+
* body. A sync of the same number already running is 429 (`Retry-After`).
|
|
374
|
+
*/
|
|
375
|
+
async syncFromMeta() {
|
|
376
|
+
return this.#http.requestJson({
|
|
377
|
+
method: "POST",
|
|
378
|
+
path: "/v1/flows/meta/sync",
|
|
379
|
+
});
|
|
380
|
+
}
|
|
288
381
|
}
|
|
289
382
|
//# sourceMappingURL=flows.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows.js","sourceRoot":"","sources":["../../src/resources/flows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"flows.js","sourceRoot":"","sources":["../../src/resources/flows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AA+BzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACnD,IAAI,CAAC,CAAC,KAAK,YAAY,oBAAoB,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1D,MAAM,IAAI,GAAG,KAAK,CAAC,IAGJ,CAAC;IAChB,IAAI,IAAI,EAAE,IAAI,KAAK,mBAAmB;QAAE,OAAO,IAAI,CAAC;IACpD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IACvD,OAAO,IAAI,CAAC,gBAAgB,CAAC;AACjC,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,aAAa;IACb,KAAK,CAAa;IAE3B,YAAY,IAAgB;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAED;;;;;;OAMG;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,IAAI,EAAE,MAAM,EAAE,IAAI;gBAClB,QAAQ,EAAE,MAAM,EAAE,QAAQ;aAC7B,CA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AK,CAAC,WAAW,CAAC,EAAU,EAAE,KAA2B;QACrD,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAwB;YACjD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,aAAa,kBAAkB,CAAC,EAAE,CAAC,WAAW;YACpD,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC;SACtE,CAAC,CAAC;IACP,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,gBAAgB,CAClB,EAAU,EACV,QAAmC,EAAE;QAErC,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAA6B;YACtD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,aAAa,kBAAkB,CAAC,EAAE,CAAC,WAAW;YACpD,IAAI,EAAE,OAAO,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC;SAC9D,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,YAAY;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAqB;YAC9C,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,qBAAqB;SAC9B,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HttpClient } from "../http.js";
|
|
2
|
+
import type { KnowledgeSearchParams, KnowledgeSearchResult } from "../types.js";
|
|
3
|
+
/** Search what Pilot Status publishes (`POST /v1/knowledge/search`). */
|
|
4
|
+
export declare class KnowledgeResource {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
/**
|
|
8
|
+
* Searches the API documentation, the blog and the public site pages (landing,
|
|
9
|
+
* plans, use cases, legal, status) in pt-BR, en and es. Any key can call it.
|
|
10
|
+
* Each result has the public URL, so you can link to the source.
|
|
11
|
+
*/
|
|
12
|
+
search(params: KnowledgeSearchParams): Promise<KnowledgeSearchResult>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=knowledge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../src/resources/knowledge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEhF,wEAAwE;AACxE,qBAAa,iBAAiB;;gBAGd,IAAI,EAAE,UAAU;IAI5B;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAW9E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Search what Pilot Status publishes (`POST /v1/knowledge/search`). */
|
|
2
|
+
export class KnowledgeResource {
|
|
3
|
+
#http;
|
|
4
|
+
constructor(http) {
|
|
5
|
+
this.#http = http;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Searches the API documentation, the blog and the public site pages (landing,
|
|
9
|
+
* plans, use cases, legal, status) in pt-BR, en and es. Any key can call it.
|
|
10
|
+
* Each result has the public URL, so you can link to the source.
|
|
11
|
+
*/
|
|
12
|
+
async search(params) {
|
|
13
|
+
const body = { query: params.query };
|
|
14
|
+
if (params.type !== undefined)
|
|
15
|
+
body.type = params.type;
|
|
16
|
+
if (params.language !== undefined)
|
|
17
|
+
body.language = params.language;
|
|
18
|
+
if (params.limit !== undefined)
|
|
19
|
+
body.limit = params.limit;
|
|
20
|
+
return this.#http.requestJson({
|
|
21
|
+
method: "POST",
|
|
22
|
+
path: "/v1/knowledge/search",
|
|
23
|
+
body,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=knowledge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.js","sourceRoot":"","sources":["../../src/resources/knowledge.ts"],"names":[],"mappings":"AAGA,wEAAwE;AACxE,MAAM,OAAO,iBAAiB;IACjB,KAAK,CAAa;IAE3B,YAAY,IAAgB;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,MAA6B;QACtC,MAAM,IAAI,GAA4B,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;QAC9D,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS;YAAE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACvD,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS;YAAE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QACnE,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1D,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAwB;YACjD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,sBAAsB;YAC5B,IAAI;SACP,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpClient } from "../http.js";
|
|
2
|
-
import type { LeadFormConfigInput, LeadFormConfigResult, LeadFormListResult, LeadPageLinkInput, LeadPageLinkResult, LeadPageListResult, LeadPageResyncResult, LeadPageUnlinkResult, LeadPageUpdateInput, LeadPageUpdateResult } from "../types.js";
|
|
2
|
+
import type { LeadFormConfigInput, LeadFormConfigResult, LeadFormListResult, LeadPageLinkInput, LeadPageLinkResult, LeadPageListParams, LeadPageListResult, LeadPageResyncResult, LeadPageUnlinkResult, LeadPageUpdateInput, LeadPageUpdateResult } from "../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Meta Lead Ads configuration (`/v1/lead-pages/*`): which Facebook Pages feed leads to
|
|
5
5
|
* which WhatsApp number, and each Instant Form's consent / auto-send setup.
|
|
@@ -12,8 +12,12 @@ import type { LeadFormConfigInput, LeadFormConfigResult, LeadFormListResult, Lea
|
|
|
12
12
|
export declare class LeadPagesResource {
|
|
13
13
|
#private;
|
|
14
14
|
constructor(http: HttpClient);
|
|
15
|
-
/**
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Linked Pages and the Pages this workspace may link. `params.whatsappNumberId` narrows
|
|
17
|
+
* to one number inside the key's scope; that number must be official, else 422
|
|
18
|
+
* `ADS_REQUIRE_OFFICIAL_NUMBER`.
|
|
19
|
+
*/
|
|
20
|
+
list(params?: LeadPageListParams): Promise<LeadPageListResult>;
|
|
17
21
|
/** Link one Page to one number. Answers 201 `{ link }`; the 90-day backfill starts on its own. */
|
|
18
22
|
link(input: LeadPageLinkInput): Promise<LeadPageLinkResult>;
|
|
19
23
|
/**
|
|
@@ -1 +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
|
|
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,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB;;;;;;;;GAQG;AACH,qBAAa,iBAAiB;;gBAGhB,IAAI,EAAE,UAAU;IAQ5B;;;;OAIG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAUpE,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"}
|
|
@@ -15,11 +15,18 @@ export class LeadPagesResource {
|
|
|
15
15
|
#path(pageLinkId) {
|
|
16
16
|
return `/v1/lead-pages/${encodeURIComponent(pageLinkId)}`;
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Linked Pages and the Pages this workspace may link. `params.whatsappNumberId` narrows
|
|
20
|
+
* to one number inside the key's scope; that number must be official, else 422
|
|
21
|
+
* `ADS_REQUIRE_OFFICIAL_NUMBER`.
|
|
22
|
+
*/
|
|
23
|
+
async list(params) {
|
|
20
24
|
return this.#http.requestJson({
|
|
21
25
|
method: "GET",
|
|
22
26
|
path: "/v1/lead-pages",
|
|
27
|
+
...(params?.whatsappNumberId !== undefined
|
|
28
|
+
? { query: { whatsappNumberId: params.whatsappNumberId } }
|
|
29
|
+
: {}),
|
|
23
30
|
});
|
|
24
31
|
}
|
|
25
32
|
/** Link one Page to one number. Answers 201 `{ link }`; the 90-day backfill starts on its own. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lead-pages.js","sourceRoot":"","sources":["../../src/resources/lead-pages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lead-pages.js","sourceRoot":"","sources":["../../src/resources/lead-pages.ts"],"names":[],"mappings":"AAeA;;;;;;;;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,EAAE,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,IAAI,CAAC,MAA2B;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAqB;YAChD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,gBAAgB;YACtB,GAAG,CAAC,MAAM,EAAE,gBAAgB,KAAK,SAAS;gBACxC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EAAE,EAAE;gBAC1D,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAC;IACL,CAAC;IAED,kGAAkG;IAClG,KAAK,CAAC,IAAI,CAAC,KAAwB;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAqB;YAChD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,gBAAgB;YACtB,IAAI,EACF,KAAK,CAAC,gBAAgB,KAAK,SAAS;gBAClC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAA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,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,5 +1,5 @@
|
|
|
1
1
|
import type { HttpClient } from "../http.js";
|
|
2
|
-
import type { CancelMessagesResult, GroupMessagesParams, GroupMessagesResult, MarkReadResult, MessageDetails, MessageHistoryParams, MessageHistoryResult, MessageListParams, MessageListResult, SendMessageAccepted, SendMessageInput, SendMessageOptions, TypingInput, TypingResult, UnreadMessagesParams, UnreadMessagesResult } from "../types.js";
|
|
2
|
+
import type { CancelMessagesResult, GroupMessagesParams, GroupMessagesResult, MarkReadResult, MessageDetails, MessageHistoryParams, MessageHistoryResult, MessageListParams, MessageListResult, ResendMessageResult, SendMessageAccepted, SendMessageInput, SendMessageOptions, TypingInput, TypingResult, UnreadCountsParams, UnreadCountsResult, UnreadMessagesParams, UnreadMessagesResult } from "../types.js";
|
|
3
3
|
export declare class MessagesResource {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(http: HttpClient);
|
|
@@ -56,6 +56,28 @@ export declare class MessagesResource {
|
|
|
56
56
|
* `RELAY_ONLY`.
|
|
57
57
|
*/
|
|
58
58
|
unread(params?: UnreadMessagesParams): Promise<UnreadMessagesResult>;
|
|
59
|
+
/**
|
|
60
|
+
* Unread inbound count PER NUMBER, in one call (`GET /v1/messages/unread/counts`).
|
|
61
|
+
*
|
|
62
|
+
* Each `total` is exactly the `total` of {@link unread} for that number. Without
|
|
63
|
+
* `whatsappNumberIds`, every number inside the credential's reach is counted (a
|
|
64
|
+
* number-scoped key sees its own number only). At most 100 ids (400
|
|
65
|
+
* `TOO_MANY_NUMBERS`); an id outside the credential's reach is 403
|
|
66
|
+
* `NUMBER_NOT_IN_GRANT`, one that is not a number of the workspace 404
|
|
67
|
+
* `NUMBER_NOT_FOUND`. Needs `chat:read`.
|
|
68
|
+
*/
|
|
69
|
+
unreadCounts(params?: UnreadCountsParams): Promise<UnreadCountsResult>;
|
|
70
|
+
/**
|
|
71
|
+
* Resends a `FAILED` or `CANCELED` message (`POST /v1/messages/{id}/resend`) → 202,
|
|
72
|
+
* replaying the stored request as a NEW message (new `id`, `originalMessageId`
|
|
73
|
+
* pointing back). Number-scoped key only; needs `messages:resend`.
|
|
74
|
+
*
|
|
75
|
+
* Any other status is 409 (a `SENT`/`QUEUED` message may still be delivered — a
|
|
76
|
+
* resend would be a second sender). A second resend of the same message within 120 s
|
|
77
|
+
* is refused, and a message with no stored request snapshot is 422. Sends no body
|
|
78
|
+
* (the route refuses any field). Never retried automatically by the SDK.
|
|
79
|
+
*/
|
|
80
|
+
resend(id: string): Promise<ResendMessageResult>;
|
|
59
81
|
/**
|
|
60
82
|
* Acknowledges the read receipt (blue tick) of the LAST message received from
|
|
61
83
|
* `to`, and of every earlier one, without sending any message at all
|
|
@@ -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,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB,qBAAa,gBAAgB;;gBAGf,IAAI,EAAE,UAAU;IAI5B;;;;;;;;;;OAUG;IACG,IAAI,CACR,KAAK,EAAE,gBAAgB,EACvB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,mBAAmB,CAAC;IAsEzB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IA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