@naturali/sdk 0.182.0 → 0.184.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 CHANGED
@@ -941,6 +941,38 @@ var Channels = class {
941
941
  });
942
942
  }
943
943
  /**
944
+ * Create a WhatsApp signup link
945
+ *
946
+ * 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.
947
+ *
948
+ * 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.
949
+ *
950
+ * 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.
951
+ *
952
+ */
953
+ static createWhatsappSignupLink(options) {
954
+ return (options.client ?? client).post({
955
+ url: "/v1/projects/{project_id}/channels/whatsapp/signup-links",
956
+ ...options
957
+ });
958
+ }
959
+ /**
960
+ * Complete a WhatsApp signup
961
+ *
962
+ * 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`).
963
+ *
964
+ */
965
+ static completeWhatsappSignup(options) {
966
+ return (options.client ?? client).post({
967
+ url: "/v1/channels/whatsapp/signup/complete",
968
+ ...options,
969
+ headers: {
970
+ "Content-Type": "application/json",
971
+ ...options.headers
972
+ }
973
+ });
974
+ }
975
+ /**
944
976
  * Delete a channel
945
977
  *
946
978
  * 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).