@funnelchat-hq/sdk 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/index.cjs +7 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -18
- package/dist/index.d.ts +27 -18
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -4900,7 +4900,7 @@ interface paths {
|
|
|
4900
4900
|
};
|
|
4901
4901
|
/**
|
|
4902
4902
|
* The QR code to connect a number
|
|
4903
|
-
* @description Creates the WhatsApp instance when needed. Only for QR numbers: an official one answers `422 provider_unsupported`. Scanning the QR gives control of a WhatsApp, so it needs `accounts:operate
|
|
4903
|
+
* @description Creates the WhatsApp instance when needed. Only for QR numbers: an official one answers `422 provider_unsupported`. Scanning the QR gives control of a WhatsApp, so it needs **WhatsApp numbers → Create, connect and delete** (`accounts:operate`). Every call brings the code of that moment: ask again every `expires_in` seconds (5 with a QR) and replace the image with the latest one; the answer carries `Cache-Control: no-store`.
|
|
4904
4904
|
*/
|
|
4905
4905
|
get: operations["pendingDevice.qr"];
|
|
4906
4906
|
put?: never;
|
|
@@ -9594,7 +9594,7 @@ interface components {
|
|
|
9594
9594
|
/** @description `https`, public and without user or password. */
|
|
9595
9595
|
url: string;
|
|
9596
9596
|
description?: string | null;
|
|
9597
|
-
/** @description Types of the catalog (`GET /api/v1/webhooks/events`). The key needs the `{area}:read`
|
|
9597
|
+
/** @description Types of the catalog (`GET /api/v1/webhooks/events`). The key needs the **View** permission of the area of each type in the panel (`{area}:read`), such as **WhatsApp numbers → View** (`accounts:read`). */
|
|
9598
9598
|
events: string[];
|
|
9599
9599
|
filters?: components["schemas"]["PendingWebhookSubscriptionFilters"] | null;
|
|
9600
9600
|
};
|
|
@@ -21057,8 +21057,9 @@ interface RequestOptions {
|
|
|
21057
21057
|
/** Overrides the client's `maxRetries` for this request. */
|
|
21058
21058
|
maxRetries?: number;
|
|
21059
21059
|
/**
|
|
21060
|
-
* Allows automatic retries of a non-idempotent send
|
|
21061
|
-
*
|
|
21060
|
+
* Allows automatic retries of a non-idempotent send for this request: a `POST` that needs
|
|
21061
|
+
* **Contacts and conversations → Send** (`conversations:send`). Off by default: a retried send
|
|
21062
|
+
* can deliver the same message twice.
|
|
21062
21063
|
*/
|
|
21063
21064
|
retrySend?: boolean;
|
|
21064
21065
|
/** Cancels the request. */
|
|
@@ -21133,7 +21134,8 @@ type LinkId = PathParams<'/api/v1/connect-links/{link}', 'GET'>['link'];
|
|
|
21133
21134
|
* `device_id` the link reconnects that number instead, without taking a new slot. The Meta sign-up
|
|
21134
21135
|
* is not available in production yet: `type: 'meta'` answers `503 meta_connect_disabled` until it is.
|
|
21135
21136
|
*
|
|
21136
|
-
* Reading needs `accounts:read
|
|
21137
|
+
* Reading needs **WhatsApp numbers → View** (`accounts:read`); creating and revoking,
|
|
21138
|
+
* **WhatsApp numbers → Create, connect and delete** (`accounts:operate`). The result arrives three
|
|
21137
21139
|
* ways: the `device.connected` webhook (with `connect_link_id` and `external_reference`), the
|
|
21138
21140
|
* `return_url`, or `get`. The other `device.*` events carry the link that last connected the number.
|
|
21139
21141
|
*
|
|
@@ -21586,7 +21588,8 @@ declare class Devices extends Resource {
|
|
|
21586
21588
|
/**
|
|
21587
21589
|
* `POST /api/v1/devices`: creates a number that connects by QR code (`connection: 'qr'`), with
|
|
21588
21590
|
* `connected: false`. Then show its QR with `qr`, or send your customer a connect link
|
|
21589
|
-
* (`connectLinks.create`). Needs
|
|
21591
|
+
* (`connectLinks.create`). Needs **WhatsApp numbers → Create, connect and delete**
|
|
21592
|
+
* (`accounts:operate`). It takes a slot of the plan, with the panel's
|
|
21590
21593
|
* rejections: `403 numbers_not_included`, `403 number_limit_reached`, `422 qr_requires_coexistence`
|
|
21591
21594
|
* and `422 method_already_present` (`same_number_as` adds QR to a number in coexistence instead).
|
|
21592
21595
|
* An account has at most one QR number waiting to be scanned: another one is `409
|
|
@@ -21648,7 +21651,8 @@ declare class Devices extends Resource {
|
|
|
21648
21651
|
/**
|
|
21649
21652
|
* `DELETE /api/v1/devices/{device}`: deletes the number and frees its slot of the plan. An
|
|
21650
21653
|
* official number stops receiving through Funnelchat but stays registered with Meta; a QR one
|
|
21651
|
-
* logs out. Irreversible; needs
|
|
21654
|
+
* logs out. Irreversible; needs **WhatsApp numbers → Create, connect and delete**
|
|
21655
|
+
* (`accounts:operate`). Sends `device.deleted`.
|
|
21652
21656
|
*/
|
|
21653
21657
|
delete(device: DeviceId$3, options?: RequestOptions): APIPromise<Record<string, unknown>>;
|
|
21654
21658
|
/** `PUT /api/v1/devices/{device}`: also changes `external_reference`. */
|
|
@@ -21702,7 +21706,8 @@ declare class Devices extends Resource {
|
|
|
21702
21706
|
* 0 once connected) and have it scanned right away: WhatsApp changes the code every few seconds and
|
|
21703
21707
|
* an old one no longer links, so show the latest and never store or forward a QR. Only for QR
|
|
21704
21708
|
* numbers (an official one is `422 provider_unsupported`); needs
|
|
21705
|
-
* `accounts:operate
|
|
21709
|
+
* **WhatsApp numbers → Create, connect and delete** (`accounts:operate`), since scanning it gives
|
|
21710
|
+
* control of a WhatsApp. A number that cannot connect now
|
|
21706
21711
|
* answers `409` (`trial_number_blocked`, `number_suspended_by_plan`, `device_inactive`…).
|
|
21707
21712
|
*/
|
|
21708
21713
|
qr(device: DeviceId$3, options?: RequestOptions): APIPromise<{
|
|
@@ -21744,7 +21749,8 @@ type RunId = PathParams<'/api/v1/forms/families/{familyId}/responses/{runId}', '
|
|
|
21744
21749
|
type DeviceId$2 = PathParams<'/api/v1/forms/{id}/numbers/{deviceId}', 'DELETE'>['deviceId'];
|
|
21745
21750
|
/**
|
|
21746
21751
|
* WhatsApp forms (conversations area): build them, publish them on your numbers and read the
|
|
21747
|
-
* answers. Reading needs `conversations:read
|
|
21752
|
+
* answers. Reading needs **Contacts and conversations → View** (`conversations:read`); the rest,
|
|
21753
|
+
* **Contacts and conversations → Edit** (`conversations:write`).
|
|
21748
21754
|
*
|
|
21749
21755
|
* Two ids: `id` is one version of a form; `family_id` is the form itself (every version). You send
|
|
21750
21756
|
* a form by its `family_id` with `messages.sendForm`, and `whatsapp_form.completed` brings it as
|
|
@@ -21901,7 +21907,7 @@ declare class Forms extends Resource {
|
|
|
21901
21907
|
type GroupId = PathParams<'/api/v1/groups/{group}', 'GET'>['group'];
|
|
21902
21908
|
type GroupUid = PathParams<'/api/v1/groups/{groupUid}/metadata', 'GET'>['groupUid'];
|
|
21903
21909
|
type DeviceId$1 = PathParams<'/api/v1/devices/{device}/groups', 'GET'>['device'];
|
|
21904
|
-
/** WhatsApp groups (communities area): read them, their participants, events and messages. Permission `communities:read
|
|
21910
|
+
/** WhatsApp groups (communities area): read them, their participants, events and messages. Permission: **Groups and campaigns → View** (`communities:read`). */
|
|
21905
21911
|
declare class Groups extends Resource {
|
|
21906
21912
|
/** `GET /api/v1/groups`, paginated. */
|
|
21907
21913
|
list(query?: Query<'/api/v1/groups'>, options?: RequestOptions): PagePromise<{
|
|
@@ -22108,8 +22114,8 @@ type SendMessageParams = Omit<SendMessageBody, 'contact_id'> & {
|
|
|
22108
22114
|
* delivered. The rest arrives by `message.status_changed` (with the same `id` as `message_id`) or
|
|
22109
22115
|
* with {@link Messages.get}.
|
|
22110
22116
|
*
|
|
22111
|
-
* Sending with an API key needs
|
|
22112
|
-
* WhatsApp rules: `422 window_closed`, `422 antiblock_*`, `422 recipient_*`,
|
|
22117
|
+
* Sending with an API key needs **Contacts and conversations → Send** (`conversations:send`) and
|
|
22118
|
+
* is subject to the WhatsApp rules: `422 window_closed`, `422 antiblock_*`, `422 recipient_*`,
|
|
22113
22119
|
* `422 provider_unsupported`, `429 rate_limited` (with `retryAfter`) and `429 mac_lockout_24h`. A
|
|
22114
22120
|
* rejected send stores nothing (see `SEND_ERROR_CODES`). Sends are never retried automatically
|
|
22115
22121
|
* unless you pass `retrySend: true`.
|
|
@@ -23707,10 +23713,13 @@ type SubscriptionId = PathParams<'/api/v1/webhooks/{id}', 'GET'>['id'];
|
|
|
23707
23713
|
/**
|
|
23708
23714
|
* Webhook subscriptions (accounts area) and the verification of deliveries.
|
|
23709
23715
|
*
|
|
23710
|
-
* Reading needs `webhooks:read` and the rest
|
|
23711
|
-
*
|
|
23712
|
-
*
|
|
23713
|
-
*
|
|
23716
|
+
* Reading needs **Notifications (webhooks) → View** (`webhooks:read`) and the rest
|
|
23717
|
+
* **Notifications (webhooks) → Manage** (`webhooks:write`); the catalog (`events()`) needs
|
|
23718
|
+
* **WhatsApp numbers → View** (`accounts:read`). A key only sees and manages subscriptions to
|
|
23719
|
+
* events of the areas it can read: **Contacts and conversations → View** (`conversations:read`),
|
|
23720
|
+
* **Groups and campaigns → View** (`communities:read`) and **WhatsApp numbers → View**
|
|
23721
|
+
* (`accounts:read`). Asking for others is a `422` on `events`, and touching a subscription that
|
|
23722
|
+
* has them is `403 permission_denied`.
|
|
23714
23723
|
*/
|
|
23715
23724
|
declare class Webhooks extends Resource {
|
|
23716
23725
|
/** Same as `Funnelchat.webhooks.verify`. */
|
|
@@ -23908,7 +23917,7 @@ declare class Funnelchat {
|
|
|
23908
23917
|
readonly verify: typeof verify;
|
|
23909
23918
|
readonly constructEvent: typeof constructEvent;
|
|
23910
23919
|
};
|
|
23911
|
-
static readonly VERSION = "0.2.
|
|
23920
|
+
static readonly VERSION = "0.2.1";
|
|
23912
23921
|
readonly baseUrl: string;
|
|
23913
23922
|
readonly timeoutMs: number;
|
|
23914
23923
|
readonly maxRetries: number;
|
|
@@ -23973,6 +23982,6 @@ interface RouteInfo {
|
|
|
23973
23982
|
declare const routes: readonly RouteInfo[];
|
|
23974
23983
|
|
|
23975
23984
|
/** The SDK version, sent in the `User-Agent`. A test keeps it equal to package.json. */
|
|
23976
|
-
declare const VERSION = "0.2.
|
|
23985
|
+
declare const VERSION = "0.2.1";
|
|
23977
23986
|
|
|
23978
23987
|
export { ACCESS_ERROR_CODES, APIConnectionError, APIConnectionTimeoutError, APIError, APIPromise, type APIResponse, APIUserAbortError, type AccessErrorCode, type ApiPath, AuthenticationError, BASE_URLS, BadRequestError, type Body, type ClientOptions, ConflictError, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT_MS, DEFAULT_TOLERANCE_SECONDS, type Environment, type FieldErrors, Funnelchat, FunnelchatError, type HttpMethod, IDEMPOTENCY_ERROR_CODES, type IdempotencyErrorCode, type IdempotentRequestOptions, InternalServerError, type KnownErrorCode, type ListItem, NUMBER_ERROR_CODES, NotFoundError, type NumberErrorCode, Page, PagePromise, type PathParams, PermissionDeniedError, type Query, type QueryParams, REQUEST_ID_HEADER, RateLimitError, type RawBody, type RequestBody, type RequestOptions, type ResponseBody, type RouteInfo, SEND_ERROR_CODES, SIGNATURE_HEADER, type SendErrorCode, type SendMessageParams, type TypedRequestOptions, UnprocessableEntityError, UnsupportedMediaTypeError, type UntypedRequestOptions, VERSION, type VerifyOptions, type WebhookEvent, type WebhookEventData, type WebhookEventEnvelope, type WebhookEventInfo, type WebhookEventOf, type WebhookEventType, type webhooks as WebhookSchemas, WebhookVerificationError, type WebhookVerificationFailure, type components, constructEvent, Funnelchat as default, isNumberQuotaError, isSendRuleError, type operations, type paths, routes, verify, webhookEvents };
|
package/dist/index.d.ts
CHANGED
|
@@ -4900,7 +4900,7 @@ interface paths {
|
|
|
4900
4900
|
};
|
|
4901
4901
|
/**
|
|
4902
4902
|
* The QR code to connect a number
|
|
4903
|
-
* @description Creates the WhatsApp instance when needed. Only for QR numbers: an official one answers `422 provider_unsupported`. Scanning the QR gives control of a WhatsApp, so it needs `accounts:operate
|
|
4903
|
+
* @description Creates the WhatsApp instance when needed. Only for QR numbers: an official one answers `422 provider_unsupported`. Scanning the QR gives control of a WhatsApp, so it needs **WhatsApp numbers → Create, connect and delete** (`accounts:operate`). Every call brings the code of that moment: ask again every `expires_in` seconds (5 with a QR) and replace the image with the latest one; the answer carries `Cache-Control: no-store`.
|
|
4904
4904
|
*/
|
|
4905
4905
|
get: operations["pendingDevice.qr"];
|
|
4906
4906
|
put?: never;
|
|
@@ -9594,7 +9594,7 @@ interface components {
|
|
|
9594
9594
|
/** @description `https`, public and without user or password. */
|
|
9595
9595
|
url: string;
|
|
9596
9596
|
description?: string | null;
|
|
9597
|
-
/** @description Types of the catalog (`GET /api/v1/webhooks/events`). The key needs the `{area}:read`
|
|
9597
|
+
/** @description Types of the catalog (`GET /api/v1/webhooks/events`). The key needs the **View** permission of the area of each type in the panel (`{area}:read`), such as **WhatsApp numbers → View** (`accounts:read`). */
|
|
9598
9598
|
events: string[];
|
|
9599
9599
|
filters?: components["schemas"]["PendingWebhookSubscriptionFilters"] | null;
|
|
9600
9600
|
};
|
|
@@ -21057,8 +21057,9 @@ interface RequestOptions {
|
|
|
21057
21057
|
/** Overrides the client's `maxRetries` for this request. */
|
|
21058
21058
|
maxRetries?: number;
|
|
21059
21059
|
/**
|
|
21060
|
-
* Allows automatic retries of a non-idempotent send
|
|
21061
|
-
*
|
|
21060
|
+
* Allows automatic retries of a non-idempotent send for this request: a `POST` that needs
|
|
21061
|
+
* **Contacts and conversations → Send** (`conversations:send`). Off by default: a retried send
|
|
21062
|
+
* can deliver the same message twice.
|
|
21062
21063
|
*/
|
|
21063
21064
|
retrySend?: boolean;
|
|
21064
21065
|
/** Cancels the request. */
|
|
@@ -21133,7 +21134,8 @@ type LinkId = PathParams<'/api/v1/connect-links/{link}', 'GET'>['link'];
|
|
|
21133
21134
|
* `device_id` the link reconnects that number instead, without taking a new slot. The Meta sign-up
|
|
21134
21135
|
* is not available in production yet: `type: 'meta'` answers `503 meta_connect_disabled` until it is.
|
|
21135
21136
|
*
|
|
21136
|
-
* Reading needs `accounts:read
|
|
21137
|
+
* Reading needs **WhatsApp numbers → View** (`accounts:read`); creating and revoking,
|
|
21138
|
+
* **WhatsApp numbers → Create, connect and delete** (`accounts:operate`). The result arrives three
|
|
21137
21139
|
* ways: the `device.connected` webhook (with `connect_link_id` and `external_reference`), the
|
|
21138
21140
|
* `return_url`, or `get`. The other `device.*` events carry the link that last connected the number.
|
|
21139
21141
|
*
|
|
@@ -21586,7 +21588,8 @@ declare class Devices extends Resource {
|
|
|
21586
21588
|
/**
|
|
21587
21589
|
* `POST /api/v1/devices`: creates a number that connects by QR code (`connection: 'qr'`), with
|
|
21588
21590
|
* `connected: false`. Then show its QR with `qr`, or send your customer a connect link
|
|
21589
|
-
* (`connectLinks.create`). Needs
|
|
21591
|
+
* (`connectLinks.create`). Needs **WhatsApp numbers → Create, connect and delete**
|
|
21592
|
+
* (`accounts:operate`). It takes a slot of the plan, with the panel's
|
|
21590
21593
|
* rejections: `403 numbers_not_included`, `403 number_limit_reached`, `422 qr_requires_coexistence`
|
|
21591
21594
|
* and `422 method_already_present` (`same_number_as` adds QR to a number in coexistence instead).
|
|
21592
21595
|
* An account has at most one QR number waiting to be scanned: another one is `409
|
|
@@ -21648,7 +21651,8 @@ declare class Devices extends Resource {
|
|
|
21648
21651
|
/**
|
|
21649
21652
|
* `DELETE /api/v1/devices/{device}`: deletes the number and frees its slot of the plan. An
|
|
21650
21653
|
* official number stops receiving through Funnelchat but stays registered with Meta; a QR one
|
|
21651
|
-
* logs out. Irreversible; needs
|
|
21654
|
+
* logs out. Irreversible; needs **WhatsApp numbers → Create, connect and delete**
|
|
21655
|
+
* (`accounts:operate`). Sends `device.deleted`.
|
|
21652
21656
|
*/
|
|
21653
21657
|
delete(device: DeviceId$3, options?: RequestOptions): APIPromise<Record<string, unknown>>;
|
|
21654
21658
|
/** `PUT /api/v1/devices/{device}`: also changes `external_reference`. */
|
|
@@ -21702,7 +21706,8 @@ declare class Devices extends Resource {
|
|
|
21702
21706
|
* 0 once connected) and have it scanned right away: WhatsApp changes the code every few seconds and
|
|
21703
21707
|
* an old one no longer links, so show the latest and never store or forward a QR. Only for QR
|
|
21704
21708
|
* numbers (an official one is `422 provider_unsupported`); needs
|
|
21705
|
-
* `accounts:operate
|
|
21709
|
+
* **WhatsApp numbers → Create, connect and delete** (`accounts:operate`), since scanning it gives
|
|
21710
|
+
* control of a WhatsApp. A number that cannot connect now
|
|
21706
21711
|
* answers `409` (`trial_number_blocked`, `number_suspended_by_plan`, `device_inactive`…).
|
|
21707
21712
|
*/
|
|
21708
21713
|
qr(device: DeviceId$3, options?: RequestOptions): APIPromise<{
|
|
@@ -21744,7 +21749,8 @@ type RunId = PathParams<'/api/v1/forms/families/{familyId}/responses/{runId}', '
|
|
|
21744
21749
|
type DeviceId$2 = PathParams<'/api/v1/forms/{id}/numbers/{deviceId}', 'DELETE'>['deviceId'];
|
|
21745
21750
|
/**
|
|
21746
21751
|
* WhatsApp forms (conversations area): build them, publish them on your numbers and read the
|
|
21747
|
-
* answers. Reading needs `conversations:read
|
|
21752
|
+
* answers. Reading needs **Contacts and conversations → View** (`conversations:read`); the rest,
|
|
21753
|
+
* **Contacts and conversations → Edit** (`conversations:write`).
|
|
21748
21754
|
*
|
|
21749
21755
|
* Two ids: `id` is one version of a form; `family_id` is the form itself (every version). You send
|
|
21750
21756
|
* a form by its `family_id` with `messages.sendForm`, and `whatsapp_form.completed` brings it as
|
|
@@ -21901,7 +21907,7 @@ declare class Forms extends Resource {
|
|
|
21901
21907
|
type GroupId = PathParams<'/api/v1/groups/{group}', 'GET'>['group'];
|
|
21902
21908
|
type GroupUid = PathParams<'/api/v1/groups/{groupUid}/metadata', 'GET'>['groupUid'];
|
|
21903
21909
|
type DeviceId$1 = PathParams<'/api/v1/devices/{device}/groups', 'GET'>['device'];
|
|
21904
|
-
/** WhatsApp groups (communities area): read them, their participants, events and messages. Permission `communities:read
|
|
21910
|
+
/** WhatsApp groups (communities area): read them, their participants, events and messages. Permission: **Groups and campaigns → View** (`communities:read`). */
|
|
21905
21911
|
declare class Groups extends Resource {
|
|
21906
21912
|
/** `GET /api/v1/groups`, paginated. */
|
|
21907
21913
|
list(query?: Query<'/api/v1/groups'>, options?: RequestOptions): PagePromise<{
|
|
@@ -22108,8 +22114,8 @@ type SendMessageParams = Omit<SendMessageBody, 'contact_id'> & {
|
|
|
22108
22114
|
* delivered. The rest arrives by `message.status_changed` (with the same `id` as `message_id`) or
|
|
22109
22115
|
* with {@link Messages.get}.
|
|
22110
22116
|
*
|
|
22111
|
-
* Sending with an API key needs
|
|
22112
|
-
* WhatsApp rules: `422 window_closed`, `422 antiblock_*`, `422 recipient_*`,
|
|
22117
|
+
* Sending with an API key needs **Contacts and conversations → Send** (`conversations:send`) and
|
|
22118
|
+
* is subject to the WhatsApp rules: `422 window_closed`, `422 antiblock_*`, `422 recipient_*`,
|
|
22113
22119
|
* `422 provider_unsupported`, `429 rate_limited` (with `retryAfter`) and `429 mac_lockout_24h`. A
|
|
22114
22120
|
* rejected send stores nothing (see `SEND_ERROR_CODES`). Sends are never retried automatically
|
|
22115
22121
|
* unless you pass `retrySend: true`.
|
|
@@ -23707,10 +23713,13 @@ type SubscriptionId = PathParams<'/api/v1/webhooks/{id}', 'GET'>['id'];
|
|
|
23707
23713
|
/**
|
|
23708
23714
|
* Webhook subscriptions (accounts area) and the verification of deliveries.
|
|
23709
23715
|
*
|
|
23710
|
-
* Reading needs `webhooks:read` and the rest
|
|
23711
|
-
*
|
|
23712
|
-
*
|
|
23713
|
-
*
|
|
23716
|
+
* Reading needs **Notifications (webhooks) → View** (`webhooks:read`) and the rest
|
|
23717
|
+
* **Notifications (webhooks) → Manage** (`webhooks:write`); the catalog (`events()`) needs
|
|
23718
|
+
* **WhatsApp numbers → View** (`accounts:read`). A key only sees and manages subscriptions to
|
|
23719
|
+
* events of the areas it can read: **Contacts and conversations → View** (`conversations:read`),
|
|
23720
|
+
* **Groups and campaigns → View** (`communities:read`) and **WhatsApp numbers → View**
|
|
23721
|
+
* (`accounts:read`). Asking for others is a `422` on `events`, and touching a subscription that
|
|
23722
|
+
* has them is `403 permission_denied`.
|
|
23714
23723
|
*/
|
|
23715
23724
|
declare class Webhooks extends Resource {
|
|
23716
23725
|
/** Same as `Funnelchat.webhooks.verify`. */
|
|
@@ -23908,7 +23917,7 @@ declare class Funnelchat {
|
|
|
23908
23917
|
readonly verify: typeof verify;
|
|
23909
23918
|
readonly constructEvent: typeof constructEvent;
|
|
23910
23919
|
};
|
|
23911
|
-
static readonly VERSION = "0.2.
|
|
23920
|
+
static readonly VERSION = "0.2.1";
|
|
23912
23921
|
readonly baseUrl: string;
|
|
23913
23922
|
readonly timeoutMs: number;
|
|
23914
23923
|
readonly maxRetries: number;
|
|
@@ -23973,6 +23982,6 @@ interface RouteInfo {
|
|
|
23973
23982
|
declare const routes: readonly RouteInfo[];
|
|
23974
23983
|
|
|
23975
23984
|
/** The SDK version, sent in the `User-Agent`. A test keeps it equal to package.json. */
|
|
23976
|
-
declare const VERSION = "0.2.
|
|
23985
|
+
declare const VERSION = "0.2.1";
|
|
23977
23986
|
|
|
23978
23987
|
export { ACCESS_ERROR_CODES, APIConnectionError, APIConnectionTimeoutError, APIError, APIPromise, type APIResponse, APIUserAbortError, type AccessErrorCode, type ApiPath, AuthenticationError, BASE_URLS, BadRequestError, type Body, type ClientOptions, ConflictError, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT_MS, DEFAULT_TOLERANCE_SECONDS, type Environment, type FieldErrors, Funnelchat, FunnelchatError, type HttpMethod, IDEMPOTENCY_ERROR_CODES, type IdempotencyErrorCode, type IdempotentRequestOptions, InternalServerError, type KnownErrorCode, type ListItem, NUMBER_ERROR_CODES, NotFoundError, type NumberErrorCode, Page, PagePromise, type PathParams, PermissionDeniedError, type Query, type QueryParams, REQUEST_ID_HEADER, RateLimitError, type RawBody, type RequestBody, type RequestOptions, type ResponseBody, type RouteInfo, SEND_ERROR_CODES, SIGNATURE_HEADER, type SendErrorCode, type SendMessageParams, type TypedRequestOptions, UnprocessableEntityError, UnsupportedMediaTypeError, type UntypedRequestOptions, VERSION, type VerifyOptions, type WebhookEvent, type WebhookEventData, type WebhookEventEnvelope, type WebhookEventInfo, type WebhookEventOf, type WebhookEventType, type webhooks as WebhookSchemas, WebhookVerificationError, type WebhookVerificationFailure, type components, constructEvent, Funnelchat as default, isNumberQuotaError, isSendRuleError, type operations, type paths, routes, verify, webhookEvents };
|
package/dist/index.js
CHANGED
|
@@ -919,7 +919,8 @@ var Devices = class extends Resource {
|
|
|
919
919
|
/**
|
|
920
920
|
* `POST /api/v1/devices`: creates a number that connects by QR code (`connection: 'qr'`), with
|
|
921
921
|
* `connected: false`. Then show its QR with `qr`, or send your customer a connect link
|
|
922
|
-
* (`connectLinks.create`). Needs
|
|
922
|
+
* (`connectLinks.create`). Needs **WhatsApp numbers → Create, connect and delete**
|
|
923
|
+
* (`accounts:operate`). It takes a slot of the plan, with the panel's
|
|
923
924
|
* rejections: `403 numbers_not_included`, `403 number_limit_reached`, `422 qr_requires_coexistence`
|
|
924
925
|
* and `422 method_already_present` (`same_number_as` adds QR to a number in coexistence instead).
|
|
925
926
|
* An account has at most one QR number waiting to be scanned: another one is `409
|
|
@@ -940,7 +941,8 @@ var Devices = class extends Resource {
|
|
|
940
941
|
/**
|
|
941
942
|
* `DELETE /api/v1/devices/{device}`: deletes the number and frees its slot of the plan. An
|
|
942
943
|
* official number stops receiving through Funnelchat but stays registered with Meta; a QR one
|
|
943
|
-
* logs out. Irreversible; needs
|
|
944
|
+
* logs out. Irreversible; needs **WhatsApp numbers → Create, connect and delete**
|
|
945
|
+
* (`accounts:operate`). Sends `device.deleted`.
|
|
944
946
|
*/
|
|
945
947
|
delete(device, options) {
|
|
946
948
|
return this.client.request("DELETE", "/api/v1/devices/{device}", { ...options, path: { device } });
|
|
@@ -955,7 +957,8 @@ var Devices = class extends Resource {
|
|
|
955
957
|
* 0 once connected) and have it scanned right away: WhatsApp changes the code every few seconds and
|
|
956
958
|
* an old one no longer links, so show the latest and never store or forward a QR. Only for QR
|
|
957
959
|
* numbers (an official one is `422 provider_unsupported`); needs
|
|
958
|
-
* `accounts:operate
|
|
960
|
+
* **WhatsApp numbers → Create, connect and delete** (`accounts:operate`), since scanning it gives
|
|
961
|
+
* control of a WhatsApp. A number that cannot connect now
|
|
959
962
|
* answers `409` (`trial_number_blocked`, `number_suspended_by_plan`, `device_inactive`…).
|
|
960
963
|
*/
|
|
961
964
|
qr(device, options) {
|
|
@@ -1380,7 +1383,7 @@ var Webhooks = class extends Resource {
|
|
|
1380
1383
|
};
|
|
1381
1384
|
|
|
1382
1385
|
// src/version.ts
|
|
1383
|
-
var VERSION = "0.2.
|
|
1386
|
+
var VERSION = "0.2.1";
|
|
1384
1387
|
|
|
1385
1388
|
// src/client.ts
|
|
1386
1389
|
var BASE_URLS = {
|