zavudev 0.13.0 → 0.15.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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/README.md +1 -1
  4. data/lib/zavudev/internal/transport/base_client.rb +4 -1
  5. data/lib/zavudev/models/broadcast_channel.rb +1 -0
  6. data/lib/zavudev/models/channel.rb +1 -0
  7. data/lib/zavudev/models/contact.rb +1 -0
  8. data/lib/zavudev/models/contact_channel.rb +1 -0
  9. data/lib/zavudev/models/contact_create_params.rb +1 -0
  10. data/lib/zavudev/models/contact_update_params.rb +1 -0
  11. data/lib/zavudev/models/contacts/channel_add_params.rb +1 -0
  12. data/lib/zavudev/models/invitation.rb +27 -1
  13. data/lib/zavudev/models/invitation_create_params.rb +28 -1
  14. data/lib/zavudev/models/message_send_params.rb +6 -3
  15. data/lib/zavudev/models/webhook_event.rb +6 -1
  16. data/lib/zavudev/resources/invitations.rb +15 -4
  17. data/lib/zavudev/resources/messages.rb +1 -1
  18. data/lib/zavudev/version.rb +1 -1
  19. data/rbi/zavudev/models/broadcast_channel.rbi +1 -0
  20. data/rbi/zavudev/models/channel.rbi +1 -0
  21. data/rbi/zavudev/models/contact.rbi +2 -0
  22. data/rbi/zavudev/models/contact_channel.rbi +2 -0
  23. data/rbi/zavudev/models/contact_create_params.rbi +5 -0
  24. data/rbi/zavudev/models/contact_update_params.rbi +5 -0
  25. data/rbi/zavudev/models/contacts/channel_add_params.rbi +5 -0
  26. data/rbi/zavudev/models/invitation.rbi +48 -0
  27. data/rbi/zavudev/models/invitation_create_params.rbi +63 -0
  28. data/rbi/zavudev/models/message_send_params.rbi +10 -4
  29. data/rbi/zavudev/models/webhook_event.rbi +6 -1
  30. data/rbi/zavudev/resources/invitations.rbi +19 -3
  31. data/rbi/zavudev/resources/messages.rbi +5 -2
  32. data/sig/zavudev/models/broadcast_channel.rbs +2 -0
  33. data/sig/zavudev/models/channel.rbs +2 -0
  34. data/sig/zavudev/models/contact.rbs +2 -1
  35. data/sig/zavudev/models/contact_channel.rbs +2 -1
  36. data/sig/zavudev/models/contact_create_params.rbs +3 -1
  37. data/sig/zavudev/models/contact_update_params.rbs +2 -1
  38. data/sig/zavudev/models/contacts/channel_add_params.rbs +3 -1
  39. data/sig/zavudev/models/invitation.rbs +20 -0
  40. data/sig/zavudev/models/invitation_create_params.rbs +20 -0
  41. data/sig/zavudev/resources/invitations.rbs +1 -0
  42. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7acd7e0349acb65eada647202880714e47e5b9cfcfa12583f77e27db11993f82
4
- data.tar.gz: bf70c460648a96d443e2bd79b8be6a678306be02d38fdde537c186aec4ba77d3
3
+ metadata.gz: c47655af05e478984221142dbae0a305261b0e154bda36ba6d11370540f4b159
4
+ data.tar.gz: 61f9fb898a158c74137d0222bea09e68257115df2d451cf2b9d152bc76348000
5
5
  SHA512:
6
- metadata.gz: 751db02e34b4d9766f38893a15353ebdca10307eec404418c8ea0a690c0c566f65d1e6fe5d25297872b17a877d0d13c5c230cfc0cd094445c4d97a6e54a12cce
7
- data.tar.gz: 636bc3237e0a5048dc8f955d3335d23bd2c7bb45e894597bdc6c936386cb1b44599b0f5433b57b31f921d99cbacc0b748668667b63ce043f15cb0d198614cc32
6
+ metadata.gz: 037ef7d5bd90239e10bf70596a6bf95041d0b80ca05f3086281e97e117464559ca1607cab6a6a315b541dcfeae46371c3adec06aff60dd4fc835e8d0715ee17d
7
+ data.tar.gz: 9a81cc375e69f7280ce8e49677582bf3d1cb1d227bf05f37c87ef697d8446af7b1b3ed61571cbc8a8973c128263a95850519ad2bbb3d33d2195515cbba8ba70e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.0 (2026-07-05)
4
+
5
+ Full Changelog: [v0.14.0...v0.15.0](https://github.com/zavudev/sdk-ruby/compare/v0.14.0...v0.15.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([0afbaaf](https://github.com/zavudev/sdk-ruby/commit/0afbaaf775796e6901f790329e5ead6b623fbae6))
10
+ * **api:** api update ([ae16782](https://github.com/zavudev/sdk-ruby/commit/ae16782c53d59b8eb136ed27e9df09b1d889fd2c))
11
+
12
+
13
+ ### Chores
14
+
15
+ * **internal:** bound formatter parallelism to CPU count ([40b3e99](https://github.com/zavudev/sdk-ruby/commit/40b3e99d17ef2297beb30ff8af97fd0b43fb0d75))
16
+
17
+ ## 0.14.0 (2026-06-24)
18
+
19
+ Full Changelog: [v0.13.0...v0.14.0](https://github.com/zavudev/sdk-ruby/compare/v0.13.0...v0.14.0)
20
+
21
+ ### Features
22
+
23
+ * **api:** api update ([6a691cd](https://github.com/zavudev/sdk-ruby/commit/6a691cd596deb8fa5cb32118684e8f811798cc50))
24
+ * **api:** api update ([91a78af](https://github.com/zavudev/sdk-ruby/commit/91a78af6beed7c6a17abb0928965532976d5eac5))
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * **client:** send content-type header for requests with an omitted optional body ([73b6654](https://github.com/zavudev/sdk-ruby/commit/73b66544a2756aaf64f189c9eb47ba66cd09f305))
30
+
3
31
  ## 0.13.0 (2026-06-07)
4
32
 
5
33
  Full Changelog: [v0.12.0...v0.13.0](https://github.com/zavudev/sdk-ruby/compare/v0.12.0...v0.13.0)
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "zavudev", "~> 0.13.0"
29
+ gem "zavudev", "~> 0.15.0"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -306,7 +306,10 @@ module Zavudev
306
306
  Zavudev::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
307
307
  end
308
308
 
309
- headers.delete("content-type") if body.nil?
309
+ # Generated methods always pass `req[:body]` for operations that define a
310
+ # request body, so only elide the content-type header when the operation
311
+ # has no body at all, not when an optional body param was omitted.
312
+ headers.delete("content-type") if body.nil? && !req.key?(:body)
310
313
 
311
314
  url = Zavudev::Internal::Util.join_parsed_uri(
312
315
  @base_url_components,
@@ -13,6 +13,7 @@ module Zavudev
13
13
  TELEGRAM = :telegram
14
14
  EMAIL = :email
15
15
  INSTAGRAM = :instagram
16
+ MESSENGER = :messenger
16
17
  VOICE = :voice
17
18
 
18
19
  # @!method self.values
@@ -13,6 +13,7 @@ module Zavudev
13
13
  TELEGRAM = :telegram
14
14
  EMAIL = :email
15
15
  INSTAGRAM = :instagram
16
+ MESSENGER = :messenger
16
17
  VOICE = :voice
17
18
 
18
19
  # @!method self.values
@@ -131,6 +131,7 @@ module Zavudev
131
131
  TELEGRAM = :telegram
132
132
  EMAIL = :email
133
133
  INSTAGRAM = :instagram
134
+ MESSENGER = :messenger
134
135
  VOICE = :voice
135
136
 
136
137
  # @!method self.values
@@ -108,6 +108,7 @@ module Zavudev
108
108
  WHATSAPP = :whatsapp
109
109
  EMAIL = :email
110
110
  TELEGRAM = :telegram
111
+ MESSENGER = :messenger
111
112
  VOICE = :voice
112
113
 
113
114
  # @!method self.values
@@ -88,6 +88,7 @@ module Zavudev
88
88
  WHATSAPP = :whatsapp
89
89
  EMAIL = :email
90
90
  TELEGRAM = :telegram
91
+ MESSENGER = :messenger
91
92
  VOICE = :voice
92
93
 
93
94
  # @!method self.values
@@ -44,6 +44,7 @@ module Zavudev
44
44
  TELEGRAM = :telegram
45
45
  EMAIL = :email
46
46
  INSTAGRAM = :instagram
47
+ MESSENGER = :messenger
47
48
  VOICE = :voice
48
49
 
49
50
  # @!method self.values
@@ -66,6 +66,7 @@ module Zavudev
66
66
  WHATSAPP = :whatsapp
67
67
  EMAIL = :email
68
68
  TELEGRAM = :telegram
69
+ MESSENGER = :messenger
69
70
  VOICE = :voice
70
71
 
71
72
  # @!method self.values
@@ -62,6 +62,13 @@ module Zavudev
62
62
  # @return [Time, nil]
63
63
  optional :completed_at, Time, api_name: :completedAt, nil?: true
64
64
 
65
+ # @!attribute connection_type
66
+ # How the client connects WhatsApp: `whatsapp_waba` (official Cloud API via
67
+ # embedded signup) or `whatsapp_alt` (QR-linked).
68
+ #
69
+ # @return [Symbol, Zavudev::Models::Invitation::ConnectionType, nil]
70
+ optional :connection_type, enum: -> { Zavudev::Invitation::ConnectionType }, api_name: :connectionType
71
+
65
72
  # @!attribute phone_number_id
66
73
  # ID of a pre-assigned Zavu phone number for WhatsApp registration.
67
74
  #
@@ -84,7 +91,10 @@ module Zavudev
84
91
  # @return [Time, nil]
85
92
  optional :viewed_at, Time, api_name: :viewedAt, nil?: true
86
93
 
87
- # @!method initialize(id:, token:, created_at:, expires_at:, status:, updated_at:, url:, client_email: nil, client_name: nil, client_phone: nil, completed_at: nil, phone_number_id: nil, sender_id: nil, started_at: nil, viewed_at: nil)
94
+ # @!method initialize(id:, token:, created_at:, expires_at:, status:, updated_at:, url:, client_email: nil, client_name: nil, client_phone: nil, completed_at: nil, connection_type: nil, phone_number_id: nil, sender_id: nil, started_at: nil, viewed_at: nil)
95
+ # Some parameter documentations has been truncated, see
96
+ # {Zavudev::Models::Invitation} for more details.
97
+ #
88
98
  # @param id [String]
89
99
  #
90
100
  # @param token [String] Unique invitation token.
@@ -107,6 +117,8 @@ module Zavudev
107
117
  #
108
118
  # @param completed_at [Time, nil]
109
119
  #
120
+ # @param connection_type [Symbol, Zavudev::Models::Invitation::ConnectionType] How the client connects WhatsApp: `whatsapp_waba` (official Cloud API via embedd
121
+ #
110
122
  # @param phone_number_id [String, nil] ID of a pre-assigned Zavu phone number for WhatsApp registration.
111
123
  #
112
124
  # @param sender_id [String, nil] ID of the sender created when invitation is completed.
@@ -130,6 +142,20 @@ module Zavudev
130
142
  # @!method self.values
131
143
  # @return [Array<Symbol>]
132
144
  end
145
+
146
+ # How the client connects WhatsApp: `whatsapp_waba` (official Cloud API via
147
+ # embedded signup) or `whatsapp_alt` (QR-linked).
148
+ #
149
+ # @see Zavudev::Models::Invitation#connection_type
150
+ module ConnectionType
151
+ extend Zavudev::Internal::Type::Enum
152
+
153
+ WHATSAPP_WABA = :whatsapp_waba
154
+ WHATSAPP_ALT = :whatsapp_alt
155
+
156
+ # @!method self.values
157
+ # @return [Array<Symbol>]
158
+ end
133
159
  end
134
160
  end
135
161
  end
@@ -33,6 +33,17 @@ module Zavudev
33
33
  # @return [String, nil]
34
34
  optional :client_phone, String, api_name: :clientPhone
35
35
 
36
+ # @!attribute connection_type
37
+ # How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
38
+ # signup to link an official WhatsApp Business Account. `whatsapp_alt` links the
39
+ # number by scanning a QR code — available only to teams with the WhatsApp
40
+ # Alternative feature enabled.
41
+ #
42
+ # @return [Symbol, Zavudev::Models::InvitationCreateParams::ConnectionType, nil]
43
+ optional :connection_type,
44
+ enum: -> { Zavudev::InvitationCreateParams::ConnectionType },
45
+ api_name: :connectionType
46
+
36
47
  # @!attribute expires_in_days
37
48
  # Number of days until the invitation expires.
38
49
  #
@@ -46,7 +57,7 @@ module Zavudev
46
57
  # @return [String, nil]
47
58
  optional :phone_number_id, String, api_name: :phoneNumberId
48
59
 
49
- # @!method initialize(allowed_phone_countries: nil, client_email: nil, client_name: nil, client_phone: nil, expires_in_days: nil, phone_number_id: nil, request_options: {})
60
+ # @!method initialize(allowed_phone_countries: nil, client_email: nil, client_name: nil, client_phone: nil, connection_type: nil, expires_in_days: nil, phone_number_id: nil, request_options: {})
50
61
  # Some parameter documentations has been truncated, see
51
62
  # {Zavudev::Models::InvitationCreateParams} for more details.
52
63
  #
@@ -58,11 +69,27 @@ module Zavudev
58
69
  #
59
70
  # @param client_phone [String] Phone number of the client in E.164 format.
60
71
  #
72
+ # @param connection_type [Symbol, Zavudev::Models::InvitationCreateParams::ConnectionType] How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
73
+ #
61
74
  # @param expires_in_days [Integer] Number of days until the invitation expires.
62
75
  #
63
76
  # @param phone_number_id [String] ID of a Zavu phone number to pre-assign for WhatsApp registration. If provided,
64
77
  #
65
78
  # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}]
79
+
80
+ # How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
81
+ # signup to link an official WhatsApp Business Account. `whatsapp_alt` links the
82
+ # number by scanning a QR code — available only to teams with the WhatsApp
83
+ # Alternative feature enabled.
84
+ module ConnectionType
85
+ extend Zavudev::Internal::Type::Enum
86
+
87
+ WHATSAPP_WABA = :whatsapp_waba
88
+ WHATSAPP_ALT = :whatsapp_alt
89
+
90
+ # @!method self.values
91
+ # @return [Array<Symbol>]
92
+ end
66
93
  end
67
94
  end
68
95
  end
@@ -8,8 +8,11 @@ module Zavudev
8
8
  include Zavudev::Internal::Type::RequestParameters
9
9
 
10
10
  # @!attribute to
11
- # Recipient phone number in E.164 format, email address, or numeric chat ID (for
12
- # Telegram/Instagram).
11
+ # Recipient phone number in E.164 format, email address, WhatsApp business-scoped
12
+ # user ID (BSUID, e.g. `US.13491208655302741918`), or numeric chat ID (for
13
+ # Telegram/Instagram/Messenger). A BSUID is routed to WhatsApp and sent via the
14
+ # `recipient` field; use it to message a contact who adopted a username and whose
15
+ # phone number is hidden.
13
16
  #
14
17
  # @return [String]
15
18
  required :to, String
@@ -101,7 +104,7 @@ module Zavudev
101
104
  # Some parameter documentations has been truncated, see
102
105
  # {Zavudev::Models::MessageSendParams} for more details.
103
106
  #
104
- # @param to [String] Recipient phone number in E.164 format, email address, or numeric chat ID (for T
107
+ # @param to [String] Recipient phone number in E.164 format, email address, WhatsApp business-scoped
105
108
  #
106
109
  # @param attachments [Array<Zavudev::Models::MessageSendParams::Attachment>] Email attachments. Only supported when channel is 'email'. Maximum 40MB total si
107
110
  #
@@ -21,7 +21,12 @@ module Zavudev
21
21
  # delivered as `message.inbound` with `messageType='reaction'`. When the contact
22
22
  # replied to (quoted) an earlier message, `data.content` carries the reply
23
23
  # context: `replyToMessageId`, `replyToProviderMessageId`, `replyToFrom`,
24
- # `replyToText`, and `replyToMessageType`.
24
+ # `replyToText`, and `replyToMessageType`. `data.providerTimestamp` is the
25
+ # provider's original receive time in Unix milliseconds (the moment the channel
26
+ # received the message from the contact — WhatsApp, Telegram, Instagram,
27
+ # Messenger; `null` for SMS and email). Compare it against the top-level
28
+ # `timestamp` (when Zavu dispatched the webhook) to detect and ignore delayed
29
+ # deliveries.
25
30
  # - `message.unsupported`: Received a message type that is not supported
26
31
  #
27
32
  # **Broadcast events:**
@@ -6,11 +6,20 @@ module Zavudev
6
6
  # Some parameter documentations has been truncated, see
7
7
  # {Zavudev::Models::InvitationCreateParams} for more details.
8
8
  #
9
- # Create a partner invitation link for a client to connect their WhatsApp Business
10
- # account. The client will complete Meta's embedded signup flow and the resulting
11
- # sender will be created in your project.
9
+ # Create a partner invitation link for a client to connect WhatsApp. The client
10
+ # opens the returned `url` and connects. Set `connectionType` to choose how they
11
+ # connect:
12
12
  #
13
- # @overload create(allowed_phone_countries: nil, client_email: nil, client_name: nil, client_phone: nil, expires_in_days: nil, phone_number_id: nil, request_options: {})
13
+ # - `whatsapp_waba` (default): the client completes Meta's embedded signup,
14
+ # linking an official WhatsApp Business Account.
15
+ # - `whatsapp_alt`: the client links their number by scanning a QR code. Requires
16
+ # the WhatsApp Alternative feature to be enabled for your team (otherwise
17
+ # returns 400).
18
+ #
19
+ # Either way, the resulting sender is created in your project when the client
20
+ # completes the flow, and the invitation transitions to `completed`.
21
+ #
22
+ # @overload create(allowed_phone_countries: nil, client_email: nil, client_name: nil, client_phone: nil, connection_type: nil, expires_in_days: nil, phone_number_id: nil, request_options: {})
14
23
  #
15
24
  # @param allowed_phone_countries [Array<String>] ISO country codes for allowed phone numbers.
16
25
  #
@@ -20,6 +29,8 @@ module Zavudev
20
29
  #
21
30
  # @param client_phone [String] Phone number of the client in E.164 format.
22
31
  #
32
+ # @param connection_type [Symbol, Zavudev::Models::InvitationCreateParams::ConnectionType] How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
33
+ #
23
34
  # @param expires_in_days [Integer] Number of days until the invitation expires.
24
35
  #
25
36
  # @param phone_number_id [String] ID of a Zavu phone number to pre-assign for WhatsApp registration. If provided,
@@ -109,7 +109,7 @@ module Zavudev
109
109
  #
110
110
  # @overload send_(to:, attachments: nil, channel: nil, content: nil, fallback_enabled: nil, html_body: nil, idempotency_key: nil, message_type: nil, metadata: nil, reply_to: nil, subject: nil, text: nil, voice_language: nil, zavu_sender: nil, request_options: {})
111
111
  #
112
- # @param to [String] Body param: Recipient phone number in E.164 format, email address, or numeric ch
112
+ # @param to [String] Body param: Recipient phone number in E.164 format, email address, WhatsApp busi
113
113
  #
114
114
  # @param attachments [Array<Zavudev::Models::MessageSendParams::Attachment>] Body param: Email attachments. Only supported when channel is 'email'. Maximum 4
115
115
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zavudev
4
- VERSION = "0.13.0"
4
+ VERSION = "0.15.0"
5
5
  end
@@ -16,6 +16,7 @@ module Zavudev
16
16
  TELEGRAM = T.let(:telegram, Zavudev::BroadcastChannel::TaggedSymbol)
17
17
  EMAIL = T.let(:email, Zavudev::BroadcastChannel::TaggedSymbol)
18
18
  INSTAGRAM = T.let(:instagram, Zavudev::BroadcastChannel::TaggedSymbol)
19
+ MESSENGER = T.let(:messenger, Zavudev::BroadcastChannel::TaggedSymbol)
19
20
  VOICE = T.let(:voice, Zavudev::BroadcastChannel::TaggedSymbol)
20
21
 
21
22
  sig do
@@ -16,6 +16,7 @@ module Zavudev
16
16
  TELEGRAM = T.let(:telegram, Zavudev::Channel::TaggedSymbol)
17
17
  EMAIL = T.let(:email, Zavudev::Channel::TaggedSymbol)
18
18
  INSTAGRAM = T.let(:instagram, Zavudev::Channel::TaggedSymbol)
19
+ MESSENGER = T.let(:messenger, Zavudev::Channel::TaggedSymbol)
19
20
  VOICE = T.let(:voice, Zavudev::Channel::TaggedSymbol)
20
21
 
21
22
  sig { override.returns(T::Array[Zavudev::Channel::TaggedSymbol]) }
@@ -178,6 +178,8 @@ module Zavudev
178
178
  EMAIL = T.let(:email, Zavudev::Contact::DefaultChannel::TaggedSymbol)
179
179
  INSTAGRAM =
180
180
  T.let(:instagram, Zavudev::Contact::DefaultChannel::TaggedSymbol)
181
+ MESSENGER =
182
+ T.let(:messenger, Zavudev::Contact::DefaultChannel::TaggedSymbol)
181
183
  VOICE = T.let(:voice, Zavudev::Contact::DefaultChannel::TaggedSymbol)
182
184
 
183
185
  sig do
@@ -146,6 +146,8 @@ module Zavudev
146
146
  EMAIL = T.let(:email, Zavudev::ContactChannel::Channel::TaggedSymbol)
147
147
  TELEGRAM =
148
148
  T.let(:telegram, Zavudev::ContactChannel::Channel::TaggedSymbol)
149
+ MESSENGER =
150
+ T.let(:messenger, Zavudev::ContactChannel::Channel::TaggedSymbol)
149
151
  VOICE = T.let(:voice, Zavudev::ContactChannel::Channel::TaggedSymbol)
150
152
 
151
153
  sig do
@@ -169,6 +169,11 @@ module Zavudev
169
169
  :telegram,
170
170
  Zavudev::ContactCreateParams::Channel::Channel::TaggedSymbol
171
171
  )
172
+ MESSENGER =
173
+ T.let(
174
+ :messenger,
175
+ Zavudev::ContactCreateParams::Channel::Channel::TaggedSymbol
176
+ )
172
177
  VOICE =
173
178
  T.let(
174
179
  :voice,
@@ -95,6 +95,11 @@ module Zavudev
95
95
  :instagram,
96
96
  Zavudev::ContactUpdateParams::DefaultChannel::TaggedSymbol
97
97
  )
98
+ MESSENGER =
99
+ T.let(
100
+ :messenger,
101
+ Zavudev::ContactUpdateParams::DefaultChannel::TaggedSymbol
102
+ )
98
103
  VOICE =
99
104
  T.let(
100
105
  :voice,
@@ -120,6 +120,11 @@ module Zavudev
120
120
  :telegram,
121
121
  Zavudev::Contacts::ChannelAddParams::Channel::TaggedSymbol
122
122
  )
123
+ MESSENGER =
124
+ T.let(
125
+ :messenger,
126
+ Zavudev::Contacts::ChannelAddParams::Channel::TaggedSymbol
127
+ )
123
128
  VOICE =
124
129
  T.let(
125
130
  :voice,
@@ -42,6 +42,20 @@ module Zavudev
42
42
  sig { returns(T.nilable(Time)) }
43
43
  attr_accessor :completed_at
44
44
 
45
+ # How the client connects WhatsApp: `whatsapp_waba` (official Cloud API via
46
+ # embedded signup) or `whatsapp_alt` (QR-linked).
47
+ sig do
48
+ returns(T.nilable(Zavudev::Invitation::ConnectionType::TaggedSymbol))
49
+ end
50
+ attr_reader :connection_type
51
+
52
+ sig do
53
+ params(
54
+ connection_type: Zavudev::Invitation::ConnectionType::OrSymbol
55
+ ).void
56
+ end
57
+ attr_writer :connection_type
58
+
45
59
  # ID of a pre-assigned Zavu phone number for WhatsApp registration.
46
60
  sig { returns(T.nilable(String)) }
47
61
  attr_accessor :phone_number_id
@@ -69,6 +83,7 @@ module Zavudev
69
83
  client_name: T.nilable(String),
70
84
  client_phone: T.nilable(String),
71
85
  completed_at: T.nilable(Time),
86
+ connection_type: Zavudev::Invitation::ConnectionType::OrSymbol,
72
87
  phone_number_id: T.nilable(String),
73
88
  sender_id: T.nilable(String),
74
89
  started_at: T.nilable(Time),
@@ -90,6 +105,9 @@ module Zavudev
90
105
  client_name: nil,
91
106
  client_phone: nil,
92
107
  completed_at: nil,
108
+ # How the client connects WhatsApp: `whatsapp_waba` (official Cloud API via
109
+ # embedded signup) or `whatsapp_alt` (QR-linked).
110
+ connection_type: nil,
93
111
  # ID of a pre-assigned Zavu phone number for WhatsApp registration.
94
112
  phone_number_id: nil,
95
113
  # ID of the sender created when invitation is completed.
@@ -113,6 +131,7 @@ module Zavudev
113
131
  client_name: T.nilable(String),
114
132
  client_phone: T.nilable(String),
115
133
  completed_at: T.nilable(Time),
134
+ connection_type: Zavudev::Invitation::ConnectionType::TaggedSymbol,
116
135
  phone_number_id: T.nilable(String),
117
136
  sender_id: T.nilable(String),
118
137
  started_at: T.nilable(Time),
@@ -144,6 +163,35 @@ module Zavudev
144
163
  def self.values
145
164
  end
146
165
  end
166
+
167
+ # How the client connects WhatsApp: `whatsapp_waba` (official Cloud API via
168
+ # embedded signup) or `whatsapp_alt` (QR-linked).
169
+ module ConnectionType
170
+ extend Zavudev::Internal::Type::Enum
171
+
172
+ TaggedSymbol =
173
+ T.type_alias { T.all(Symbol, Zavudev::Invitation::ConnectionType) }
174
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
175
+
176
+ WHATSAPP_WABA =
177
+ T.let(
178
+ :whatsapp_waba,
179
+ Zavudev::Invitation::ConnectionType::TaggedSymbol
180
+ )
181
+ WHATSAPP_ALT =
182
+ T.let(
183
+ :whatsapp_alt,
184
+ Zavudev::Invitation::ConnectionType::TaggedSymbol
185
+ )
186
+
187
+ sig do
188
+ override.returns(
189
+ T::Array[Zavudev::Invitation::ConnectionType::TaggedSymbol]
190
+ )
191
+ end
192
+ def self.values
193
+ end
194
+ end
147
195
  end
148
196
  end
149
197
  end
@@ -39,6 +39,25 @@ module Zavudev
39
39
  sig { params(client_phone: String).void }
40
40
  attr_writer :client_phone
41
41
 
42
+ # How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
43
+ # signup to link an official WhatsApp Business Account. `whatsapp_alt` links the
44
+ # number by scanning a QR code — available only to teams with the WhatsApp
45
+ # Alternative feature enabled.
46
+ sig do
47
+ returns(
48
+ T.nilable(Zavudev::InvitationCreateParams::ConnectionType::OrSymbol)
49
+ )
50
+ end
51
+ attr_reader :connection_type
52
+
53
+ sig do
54
+ params(
55
+ connection_type:
56
+ Zavudev::InvitationCreateParams::ConnectionType::OrSymbol
57
+ ).void
58
+ end
59
+ attr_writer :connection_type
60
+
42
61
  # Number of days until the invitation expires.
43
62
  sig { returns(T.nilable(Integer)) }
44
63
  attr_reader :expires_in_days
@@ -60,6 +79,8 @@ module Zavudev
60
79
  client_email: String,
61
80
  client_name: String,
62
81
  client_phone: String,
82
+ connection_type:
83
+ Zavudev::InvitationCreateParams::ConnectionType::OrSymbol,
63
84
  expires_in_days: Integer,
64
85
  phone_number_id: String,
65
86
  request_options: Zavudev::RequestOptions::OrHash
@@ -74,6 +95,11 @@ module Zavudev
74
95
  client_name: nil,
75
96
  # Phone number of the client in E.164 format.
76
97
  client_phone: nil,
98
+ # How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
99
+ # signup to link an official WhatsApp Business Account. `whatsapp_alt` links the
100
+ # number by scanning a QR code — available only to teams with the WhatsApp
101
+ # Alternative feature enabled.
102
+ connection_type: nil,
77
103
  # Number of days until the invitation expires.
78
104
  expires_in_days: nil,
79
105
  # ID of a Zavu phone number to pre-assign for WhatsApp registration. If provided,
@@ -90,6 +116,8 @@ module Zavudev
90
116
  client_email: String,
91
117
  client_name: String,
92
118
  client_phone: String,
119
+ connection_type:
120
+ Zavudev::InvitationCreateParams::ConnectionType::OrSymbol,
93
121
  expires_in_days: Integer,
94
122
  phone_number_id: String,
95
123
  request_options: Zavudev::RequestOptions
@@ -98,6 +126,41 @@ module Zavudev
98
126
  end
99
127
  def to_hash
100
128
  end
129
+
130
+ # How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
131
+ # signup to link an official WhatsApp Business Account. `whatsapp_alt` links the
132
+ # number by scanning a QR code — available only to teams with the WhatsApp
133
+ # Alternative feature enabled.
134
+ module ConnectionType
135
+ extend Zavudev::Internal::Type::Enum
136
+
137
+ TaggedSymbol =
138
+ T.type_alias do
139
+ T.all(Symbol, Zavudev::InvitationCreateParams::ConnectionType)
140
+ end
141
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
142
+
143
+ WHATSAPP_WABA =
144
+ T.let(
145
+ :whatsapp_waba,
146
+ Zavudev::InvitationCreateParams::ConnectionType::TaggedSymbol
147
+ )
148
+ WHATSAPP_ALT =
149
+ T.let(
150
+ :whatsapp_alt,
151
+ Zavudev::InvitationCreateParams::ConnectionType::TaggedSymbol
152
+ )
153
+
154
+ sig do
155
+ override.returns(
156
+ T::Array[
157
+ Zavudev::InvitationCreateParams::ConnectionType::TaggedSymbol
158
+ ]
159
+ )
160
+ end
161
+ def self.values
162
+ end
163
+ end
101
164
  end
102
165
  end
103
166
  end
@@ -11,8 +11,11 @@ module Zavudev
11
11
  T.any(Zavudev::MessageSendParams, Zavudev::Internal::AnyHash)
12
12
  end
13
13
 
14
- # Recipient phone number in E.164 format, email address, or numeric chat ID (for
15
- # Telegram/Instagram).
14
+ # Recipient phone number in E.164 format, email address, WhatsApp business-scoped
15
+ # user ID (BSUID, e.g. `US.13491208655302741918`), or numeric chat ID (for
16
+ # Telegram/Instagram/Messenger). A BSUID is routed to WhatsApp and sent via the
17
+ # `recipient` field; use it to message a contact who adopted a username and whose
18
+ # phone number is hidden.
16
19
  sig { returns(String) }
17
20
  attr_accessor :to
18
21
 
@@ -138,8 +141,11 @@ module Zavudev
138
141
  ).returns(T.attached_class)
139
142
  end
140
143
  def self.new(
141
- # Recipient phone number in E.164 format, email address, or numeric chat ID (for
142
- # Telegram/Instagram).
144
+ # Recipient phone number in E.164 format, email address, WhatsApp business-scoped
145
+ # user ID (BSUID, e.g. `US.13491208655302741918`), or numeric chat ID (for
146
+ # Telegram/Instagram/Messenger). A BSUID is routed to WhatsApp and sent via the
147
+ # `recipient` field; use it to message a contact who adopted a username and whose
148
+ # phone number is hidden.
143
149
  to:,
144
150
  # Email attachments. Only supported when channel is 'email'. Maximum 40MB total
145
151
  # size.
@@ -21,7 +21,12 @@ module Zavudev
21
21
  # delivered as `message.inbound` with `messageType='reaction'`. When the contact
22
22
  # replied to (quoted) an earlier message, `data.content` carries the reply
23
23
  # context: `replyToMessageId`, `replyToProviderMessageId`, `replyToFrom`,
24
- # `replyToText`, and `replyToMessageType`.
24
+ # `replyToText`, and `replyToMessageType`. `data.providerTimestamp` is the
25
+ # provider's original receive time in Unix milliseconds (the moment the channel
26
+ # received the message from the contact — WhatsApp, Telegram, Instagram,
27
+ # Messenger; `null` for SMS and email). Compare it against the top-level
28
+ # `timestamp` (when Zavu dispatched the webhook) to detect and ignore delayed
29
+ # deliveries.
25
30
  # - `message.unsupported`: Received a message type that is not supported
26
31
  #
27
32
  # **Broadcast events:**
@@ -3,15 +3,26 @@
3
3
  module Zavudev
4
4
  module Resources
5
5
  class Invitations
6
- # Create a partner invitation link for a client to connect their WhatsApp Business
7
- # account. The client will complete Meta's embedded signup flow and the resulting
8
- # sender will be created in your project.
6
+ # Create a partner invitation link for a client to connect WhatsApp. The client
7
+ # opens the returned `url` and connects. Set `connectionType` to choose how they
8
+ # connect:
9
+ #
10
+ # - `whatsapp_waba` (default): the client completes Meta's embedded signup,
11
+ # linking an official WhatsApp Business Account.
12
+ # - `whatsapp_alt`: the client links their number by scanning a QR code. Requires
13
+ # the WhatsApp Alternative feature to be enabled for your team (otherwise
14
+ # returns 400).
15
+ #
16
+ # Either way, the resulting sender is created in your project when the client
17
+ # completes the flow, and the invitation transitions to `completed`.
9
18
  sig do
10
19
  params(
11
20
  allowed_phone_countries: T::Array[String],
12
21
  client_email: String,
13
22
  client_name: String,
14
23
  client_phone: String,
24
+ connection_type:
25
+ Zavudev::InvitationCreateParams::ConnectionType::OrSymbol,
15
26
  expires_in_days: Integer,
16
27
  phone_number_id: String,
17
28
  request_options: Zavudev::RequestOptions::OrHash
@@ -26,6 +37,11 @@ module Zavudev
26
37
  client_name: nil,
27
38
  # Phone number of the client in E.164 format.
28
39
  client_phone: nil,
40
+ # How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
41
+ # signup to link an official WhatsApp Business Account. `whatsapp_alt` links the
42
+ # number by scanning a QR code — available only to teams with the WhatsApp
43
+ # Alternative feature enabled.
44
+ connection_type: nil,
29
45
  # Number of days until the invitation expires.
30
46
  expires_in_days: nil,
31
47
  # ID of a Zavu phone number to pre-assign for WhatsApp registration. If provided,
@@ -94,8 +94,11 @@ module Zavudev
94
94
  ).returns(Zavudev::MessageResponse)
95
95
  end
96
96
  def send_(
97
- # Body param: Recipient phone number in E.164 format, email address, or numeric
98
- # chat ID (for Telegram/Instagram).
97
+ # Body param: Recipient phone number in E.164 format, email address, WhatsApp
98
+ # business-scoped user ID (BSUID, e.g. `US.13491208655302741918`), or numeric chat
99
+ # ID (for Telegram/Instagram/Messenger). A BSUID is routed to WhatsApp and sent
100
+ # via the `recipient` field; use it to message a contact who adopted a username
101
+ # and whose phone number is hidden.
99
102
  to:,
100
103
  # Body param: Email attachments. Only supported when channel is 'email'. Maximum
101
104
  # 40MB total size.
@@ -8,6 +8,7 @@ module Zavudev
8
8
  | :telegram
9
9
  | :email
10
10
  | :instagram
11
+ | :messenger
11
12
  | :voice
12
13
 
13
14
  module BroadcastChannel
@@ -20,6 +21,7 @@ module Zavudev
20
21
  TELEGRAM: :telegram
21
22
  EMAIL: :email
22
23
  INSTAGRAM: :instagram
24
+ MESSENGER: :messenger
23
25
  VOICE: :voice
24
26
 
25
27
  def self?.values: -> ::Array[Zavudev::Models::broadcast_channel]
@@ -8,6 +8,7 @@ module Zavudev
8
8
  | :telegram
9
9
  | :email
10
10
  | :instagram
11
+ | :messenger
11
12
  | :voice
12
13
 
13
14
  module Channel
@@ -20,6 +21,7 @@ module Zavudev
20
21
  TELEGRAM: :telegram
21
22
  EMAIL: :email
22
23
  INSTAGRAM: :instagram
24
+ MESSENGER: :messenger
23
25
  VOICE: :voice
24
26
 
25
27
  def self?.values: -> ::Array[Zavudev::Models::channel]
@@ -109,7 +109,7 @@ module Zavudev
109
109
  }
110
110
 
111
111
  type default_channel =
112
- :sms | :whatsapp | :telegram | :email | :instagram | :voice
112
+ :sms | :whatsapp | :telegram | :email | :instagram | :messenger | :voice
113
113
 
114
114
  module DefaultChannel
115
115
  extend Zavudev::Internal::Type::Enum
@@ -119,6 +119,7 @@ module Zavudev
119
119
  TELEGRAM: :telegram
120
120
  EMAIL: :email
121
121
  INSTAGRAM: :instagram
122
+ MESSENGER: :messenger
122
123
  VOICE: :voice
123
124
 
124
125
  def self?.values: -> ::Array[Zavudev::Models::Contact::default_channel]
@@ -85,7 +85,7 @@ module Zavudev
85
85
  updated_at: Time
86
86
  }
87
87
 
88
- type channel = :sms | :whatsapp | :email | :telegram | :voice
88
+ type channel = :sms | :whatsapp | :email | :telegram | :messenger | :voice
89
89
 
90
90
  module Channel
91
91
  extend Zavudev::Internal::Type::Enum
@@ -94,6 +94,7 @@ module Zavudev
94
94
  WHATSAPP: :whatsapp
95
95
  EMAIL: :email
96
96
  TELEGRAM: :telegram
97
+ MESSENGER: :messenger
97
98
  VOICE: :voice
98
99
 
99
100
  def self?.values: -> ::Array[Zavudev::Models::ContactChannel::channel]
@@ -78,7 +78,8 @@ module Zavudev
78
78
  label: String
79
79
  }
80
80
 
81
- type channel = :sms | :whatsapp | :email | :telegram | :voice
81
+ type channel =
82
+ :sms | :whatsapp | :email | :telegram | :messenger | :voice
82
83
 
83
84
  module Channel
84
85
  extend Zavudev::Internal::Type::Enum
@@ -87,6 +88,7 @@ module Zavudev
87
88
  WHATSAPP: :whatsapp
88
89
  EMAIL: :email
89
90
  TELEGRAM: :telegram
91
+ MESSENGER: :messenger
90
92
  VOICE: :voice
91
93
 
92
94
  def self?.values: -> ::Array[Zavudev::Models::ContactCreateParams::Channel::channel]
@@ -35,7 +35,7 @@ module Zavudev
35
35
  }
36
36
 
37
37
  type default_channel =
38
- :sms | :whatsapp | :telegram | :email | :instagram | :voice
38
+ :sms | :whatsapp | :telegram | :email | :instagram | :messenger | :voice
39
39
 
40
40
  module DefaultChannel
41
41
  extend Zavudev::Internal::Type::Enum
@@ -45,6 +45,7 @@ module Zavudev
45
45
  TELEGRAM: :telegram
46
46
  EMAIL: :email
47
47
  INSTAGRAM: :instagram
48
+ MESSENGER: :messenger
48
49
  VOICE: :voice
49
50
 
50
51
  def self?.values: -> ::Array[Zavudev::Models::ContactUpdateParams::default_channel]
@@ -54,7 +54,8 @@ module Zavudev
54
54
  request_options: Zavudev::RequestOptions
55
55
  }
56
56
 
57
- type channel = :sms | :whatsapp | :email | :telegram | :voice
57
+ type channel =
58
+ :sms | :whatsapp | :email | :telegram | :messenger | :voice
58
59
 
59
60
  module Channel
60
61
  extend Zavudev::Internal::Type::Enum
@@ -63,6 +64,7 @@ module Zavudev
63
64
  WHATSAPP: :whatsapp
64
65
  EMAIL: :email
65
66
  TELEGRAM: :telegram
67
+ MESSENGER: :messenger
66
68
  VOICE: :voice
67
69
 
68
70
  def self?.values: -> ::Array[Zavudev::Models::Contacts::ChannelAddParams::channel]
@@ -13,6 +13,7 @@ module Zavudev
13
13
  client_name: String?,
14
14
  client_phone: String?,
15
15
  completed_at: Time?,
16
+ connection_type: Zavudev::Models::Invitation::connection_type,
16
17
  phone_number_id: String?,
17
18
  sender_id: String?,
18
19
  started_at: Time?,
@@ -42,6 +43,12 @@ module Zavudev
42
43
 
43
44
  attr_accessor completed_at: Time?
44
45
 
46
+ attr_reader connection_type: Zavudev::Models::Invitation::connection_type?
47
+
48
+ def connection_type=: (
49
+ Zavudev::Models::Invitation::connection_type
50
+ ) -> Zavudev::Models::Invitation::connection_type
51
+
45
52
  attr_accessor phone_number_id: String?
46
53
 
47
54
  attr_accessor sender_id: String?
@@ -62,6 +69,7 @@ module Zavudev
62
69
  ?client_name: String?,
63
70
  ?client_phone: String?,
64
71
  ?completed_at: Time?,
72
+ ?connection_type: Zavudev::Models::Invitation::connection_type,
65
73
  ?phone_number_id: String?,
66
74
  ?sender_id: String?,
67
75
  ?started_at: Time?,
@@ -80,6 +88,7 @@ module Zavudev
80
88
  client_name: String?,
81
89
  client_phone: String?,
82
90
  completed_at: Time?,
91
+ connection_type: Zavudev::Models::Invitation::connection_type,
83
92
  phone_number_id: String?,
84
93
  sender_id: String?,
85
94
  started_at: Time?,
@@ -99,6 +108,17 @@ module Zavudev
99
108
 
100
109
  def self?.values: -> ::Array[Zavudev::Models::Invitation::status]
101
110
  end
111
+
112
+ type connection_type = :whatsapp_waba | :whatsapp_alt
113
+
114
+ module ConnectionType
115
+ extend Zavudev::Internal::Type::Enum
116
+
117
+ WHATSAPP_WABA: :whatsapp_waba
118
+ WHATSAPP_ALT: :whatsapp_alt
119
+
120
+ def self?.values: -> ::Array[Zavudev::Models::Invitation::connection_type]
121
+ end
102
122
  end
103
123
  end
104
124
  end
@@ -6,6 +6,7 @@ module Zavudev
6
6
  client_email: String,
7
7
  client_name: String,
8
8
  client_phone: String,
9
+ connection_type: Zavudev::Models::InvitationCreateParams::connection_type,
9
10
  expires_in_days: Integer,
10
11
  phone_number_id: String
11
12
  }
@@ -31,6 +32,12 @@ module Zavudev
31
32
 
32
33
  def client_phone=: (String) -> String
33
34
 
35
+ attr_reader connection_type: Zavudev::Models::InvitationCreateParams::connection_type?
36
+
37
+ def connection_type=: (
38
+ Zavudev::Models::InvitationCreateParams::connection_type
39
+ ) -> Zavudev::Models::InvitationCreateParams::connection_type
40
+
34
41
  attr_reader expires_in_days: Integer?
35
42
 
36
43
  def expires_in_days=: (Integer) -> Integer
@@ -44,6 +51,7 @@ module Zavudev
44
51
  ?client_email: String,
45
52
  ?client_name: String,
46
53
  ?client_phone: String,
54
+ ?connection_type: Zavudev::Models::InvitationCreateParams::connection_type,
47
55
  ?expires_in_days: Integer,
48
56
  ?phone_number_id: String,
49
57
  ?request_options: Zavudev::request_opts
@@ -54,10 +62,22 @@ module Zavudev
54
62
  client_email: String,
55
63
  client_name: String,
56
64
  client_phone: String,
65
+ connection_type: Zavudev::Models::InvitationCreateParams::connection_type,
57
66
  expires_in_days: Integer,
58
67
  phone_number_id: String,
59
68
  request_options: Zavudev::RequestOptions
60
69
  }
70
+
71
+ type connection_type = :whatsapp_waba | :whatsapp_alt
72
+
73
+ module ConnectionType
74
+ extend Zavudev::Internal::Type::Enum
75
+
76
+ WHATSAPP_WABA: :whatsapp_waba
77
+ WHATSAPP_ALT: :whatsapp_alt
78
+
79
+ def self?.values: -> ::Array[Zavudev::Models::InvitationCreateParams::connection_type]
80
+ end
61
81
  end
62
82
  end
63
83
  end
@@ -6,6 +6,7 @@ module Zavudev
6
6
  ?client_email: String,
7
7
  ?client_name: String,
8
8
  ?client_phone: String,
9
+ ?connection_type: Zavudev::Models::InvitationCreateParams::connection_type,
9
10
  ?expires_in_days: Integer,
10
11
  ?phone_number_id: String,
11
12
  ?request_options: Zavudev::request_opts
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zavudev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zavudev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-08 00:00:00.000000000 Z
11
+ date: 2026-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi