@zavudev/sdk 0.45.0 → 0.47.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts.map +1 -1
  4. package/client.js +9 -1
  5. package/client.js.map +1 -1
  6. package/client.mjs +9 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/broadcasts/broadcasts.d.mts +1 -1
  10. package/resources/broadcasts/broadcasts.d.mts.map +1 -1
  11. package/resources/broadcasts/broadcasts.d.ts +1 -1
  12. package/resources/broadcasts/broadcasts.d.ts.map +1 -1
  13. package/resources/broadcasts/broadcasts.js.map +1 -1
  14. package/resources/broadcasts/broadcasts.mjs.map +1 -1
  15. package/resources/contacts/channels.d.mts +1 -1
  16. package/resources/contacts/channels.d.mts.map +1 -1
  17. package/resources/contacts/channels.d.ts +1 -1
  18. package/resources/contacts/channels.d.ts.map +1 -1
  19. package/resources/contacts/contacts.d.mts +4 -4
  20. package/resources/contacts/contacts.d.mts.map +1 -1
  21. package/resources/contacts/contacts.d.ts +4 -4
  22. package/resources/contacts/contacts.d.ts.map +1 -1
  23. package/resources/invitations.d.mts +24 -3
  24. package/resources/invitations.d.mts.map +1 -1
  25. package/resources/invitations.d.ts +24 -3
  26. package/resources/invitations.d.ts.map +1 -1
  27. package/resources/invitations.js +12 -3
  28. package/resources/invitations.js.map +1 -1
  29. package/resources/invitations.mjs +12 -3
  30. package/resources/invitations.mjs.map +1 -1
  31. package/resources/messages.d.mts +6 -3
  32. package/resources/messages.d.mts.map +1 -1
  33. package/resources/messages.d.ts +6 -3
  34. package/resources/messages.d.ts.map +1 -1
  35. package/resources/senders/senders.d.mts +6 -1
  36. package/resources/senders/senders.d.mts.map +1 -1
  37. package/resources/senders/senders.d.ts +6 -1
  38. package/resources/senders/senders.d.ts.map +1 -1
  39. package/resources/senders/senders.js.map +1 -1
  40. package/resources/senders/senders.mjs.map +1 -1
  41. package/src/client.ts +9 -1
  42. package/src/resources/broadcasts/broadcasts.ts +1 -0
  43. package/src/resources/contacts/channels.ts +1 -1
  44. package/src/resources/contacts/contacts.ts +4 -4
  45. package/src/resources/invitations.ts +26 -3
  46. package/src/resources/messages.ts +6 -2
  47. package/src/resources/senders/senders.ts +6 -1
  48. package/src/version.ts +1 -1
  49. package/version.d.mts +1 -1
  50. package/version.d.ts +1 -1
  51. package/version.js +1 -1
  52. package/version.mjs +1 -1
@@ -8,9 +8,18 @@ import { path } from '../internal/utils/path';
8
8
 
9
9
  export class Invitations extends APIResource {
10
10
  /**
11
- * Create a partner invitation link for a client to connect their WhatsApp Business
12
- * account. The client will complete Meta's embedded signup flow and the resulting
13
- * sender will be created in your project.
11
+ * Create a partner invitation link for a client to connect WhatsApp. The client
12
+ * opens the returned `url` and connects. Set `connectionType` to choose how they
13
+ * connect:
14
+ *
15
+ * - `whatsapp_waba` (default): the client completes Meta's embedded signup,
16
+ * linking an official WhatsApp Business Account.
17
+ * - `whatsapp_alt`: the client links their number by scanning a QR code. Requires
18
+ * the WhatsApp Alternative feature to be enabled for your team (otherwise
19
+ * returns 400).
20
+ *
21
+ * Either way, the resulting sender is created in your project when the client
22
+ * completes the flow, and the invitation transitions to `completed`.
14
23
  *
15
24
  * @example
16
25
  * ```ts
@@ -108,6 +117,12 @@ export interface Invitation {
108
117
 
109
118
  completedAt?: string | null;
110
119
 
120
+ /**
121
+ * How the client connects WhatsApp: `whatsapp_waba` (official Cloud API via
122
+ * embedded signup) or `whatsapp_alt` (QR-linked).
123
+ */
124
+ connectionType?: 'whatsapp_waba' | 'whatsapp_alt';
125
+
111
126
  /**
112
127
  * ID of a pre-assigned Zavu phone number for WhatsApp registration.
113
128
  */
@@ -156,6 +171,14 @@ export interface InvitationCreateParams {
156
171
  */
157
172
  clientPhone?: string;
158
173
 
174
+ /**
175
+ * How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
176
+ * signup to link an official WhatsApp Business Account. `whatsapp_alt` links the
177
+ * number by scanning a QR code — available only to teams with the WhatsApp
178
+ * Alternative feature enabled.
179
+ */
180
+ connectionType?: 'whatsapp_waba' | 'whatsapp_alt';
181
+
159
182
  /**
160
183
  * Number of days until the invitation expires.
161
184
  */
@@ -150,6 +150,7 @@ export type Channel =
150
150
  | 'telegram'
151
151
  | 'email'
152
152
  | 'instagram'
153
+ | 'messenger'
153
154
  | 'voice';
154
155
 
155
156
  export interface Message {
@@ -486,8 +487,11 @@ export interface MessageReactParams {
486
487
 
487
488
  export interface MessageSendParams {
488
489
  /**
489
- * Body param: Recipient phone number in E.164 format, email address, or numeric
490
- * chat ID (for Telegram/Instagram).
490
+ * Body param: Recipient phone number in E.164 format, email address, WhatsApp
491
+ * business-scoped user ID (BSUID, e.g. `US.13491208655302741918`), or numeric chat
492
+ * ID (for Telegram/Instagram/Messenger). A BSUID is routed to WhatsApp and sent
493
+ * via the `recipient` field; use it to message a contact who adopted a username
494
+ * and whose phone number is hidden.
491
495
  */
492
496
  to: string;
493
497
 
@@ -312,7 +312,12 @@ export interface SenderWebhook {
312
312
  * delivered as `message.inbound` with `messageType='reaction'`. When the contact
313
313
  * replied to (quoted) an earlier message, `data.content` carries the reply
314
314
  * context: `replyToMessageId`, `replyToProviderMessageId`, `replyToFrom`,
315
- * `replyToText`, and `replyToMessageType`.
315
+ * `replyToText`, and `replyToMessageType`. `data.providerTimestamp` is the
316
+ * provider's original receive time in Unix milliseconds (the moment the channel
317
+ * received the message from the contact — WhatsApp, Telegram, Instagram,
318
+ * Messenger; `null` for SMS and email). Compare it against the top-level
319
+ * `timestamp` (when Zavu dispatched the webhook) to detect and ignore delayed
320
+ * deliveries.
316
321
  * - `message.unsupported`: Received a message type that is not supported
317
322
  *
318
323
  * **Broadcast events:**
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.45.0'; // x-release-please-version
1
+ export const VERSION = '0.47.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.45.0";
1
+ export declare const VERSION = "0.47.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.45.0";
1
+ export declare const VERSION = "0.47.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.45.0'; // x-release-please-version
4
+ exports.VERSION = '0.47.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.45.0'; // x-release-please-version
1
+ export const VERSION = '0.47.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map