@naturali/sdk 0.183.0 → 0.185.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/dist/index.cjs +32 -0
- package/dist/index.d.cts +268 -157
- package/dist/index.d.mts +268 -157
- package/dist/index.mjs +32 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -940,6 +940,38 @@ var Channels = class {
|
|
|
940
940
|
});
|
|
941
941
|
}
|
|
942
942
|
/**
|
|
943
|
+
* Create a WhatsApp signup link
|
|
944
|
+
*
|
|
945
|
+
* A Meta Embedded Signup URL for this project, to hand to the person who owns the WhatsApp number. They sign in with Meta, pick or create the business account and number, and the number is linked to the project as a channel with `credential_source: embedded_signup` when they finish. No popup or naturali session is needed to follow it.
|
|
946
|
+
*
|
|
947
|
+
* The link only links the number: the channel starts with `default: { action: silence }`, so it answers nothing until an agent is bound to it with `PATCH /v1/projects/{project_id}/channels/{channel_id}` or a route.
|
|
948
|
+
*
|
|
949
|
+
* The link is good for 30 minutes and acts for whoever created it: it stops working if they leave the project. A number not yet registered for sending is registered with a two-step verification PIN naturali generates and does not keep; the owner can reset it in WhatsApp Manager. Returns `501` on deployments where Meta signup is not configured.
|
|
950
|
+
*
|
|
951
|
+
*/
|
|
952
|
+
static createWhatsappSignupLink(options) {
|
|
953
|
+
return (options.client ?? client).post({
|
|
954
|
+
url: "/v1/projects/{project_id}/channels/whatsapp/signup-links",
|
|
955
|
+
...options
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Complete a WhatsApp signup
|
|
960
|
+
*
|
|
961
|
+
* Finish a signup link whose Meta dialog granted more than one number: the app's result page receives `pending` and the numbers to choose from, and sends back the one chosen. `pending` is the authorization, so no bearer token is needed; it expires 10 minutes after the dialog returns (`400 link_expired`).
|
|
962
|
+
*
|
|
963
|
+
*/
|
|
964
|
+
static completeWhatsappSignup(options) {
|
|
965
|
+
return (options.client ?? client).post({
|
|
966
|
+
url: "/v1/channels/whatsapp/signup/complete",
|
|
967
|
+
...options,
|
|
968
|
+
headers: {
|
|
969
|
+
"Content-Type": "application/json",
|
|
970
|
+
...options.headers
|
|
971
|
+
}
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
943
975
|
* Delete a channel
|
|
944
976
|
*
|
|
945
977
|
* Deletes the channel and whatever it provisioned — the WhatsApp send tool and write-only credential secret, or the Discord channel's sealed bot token (dropped with the row, closing its gateway connection).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.185.0",
|
|
4
4
|
"description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"naturali",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@hey-api/openapi-ts": "^0.99.0",
|
|
41
|
-
"@naturali/api": "0.
|
|
41
|
+
"@naturali/api": "0.185.0",
|
|
42
42
|
"@ttoss/openapi-codegen": "^0.5.0",
|
|
43
43
|
"@types/node": "^26.5.1",
|
|
44
44
|
"tsdown": "^0.23.0",
|