zavudev 0.18.0 → 0.20.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 (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +37 -0
  3. data/README.md +1 -1
  4. data/lib/zavudev/models/channel.rb +1 -5
  5. data/lib/zavudev/models/function_create_params.rb +36 -4
  6. data/lib/zavudev/models/function_create_response.rb +4 -2
  7. data/lib/zavudev/models/function_deploy_params.rb +31 -3
  8. data/lib/zavudev/models/function_deploy_response.rb +20 -3
  9. data/lib/zavudev/models/function_get_deployment_response.rb +20 -3
  10. data/lib/zavudev/models/function_retrieve_response.rb +4 -2
  11. data/lib/zavudev/models/function_update_params.rb +41 -3
  12. data/lib/zavudev/models/function_update_response.rb +4 -2
  13. data/lib/zavudev/models/invitation.rb +101 -9
  14. data/lib/zavudev/models/invitation_create_params.rb +34 -13
  15. data/lib/zavudev/models/invitation_list_params.rb +14 -0
  16. data/lib/zavudev/models/message.rb +28 -6
  17. data/lib/zavudev/models/message_send_params.rb +2 -5
  18. data/lib/zavudev/models/message_type.rb +16 -0
  19. data/lib/zavudev/models/phone_number_pricing.rb +7 -2
  20. data/lib/zavudev/models/phone_number_search_available_params.rb +13 -1
  21. data/lib/zavudev/models/sender.rb +12 -1
  22. data/lib/zavudev/models/sender_create_params.rb +72 -4
  23. data/lib/zavudev/models/sender_update_params.rb +65 -1
  24. data/lib/zavudev/models/sender_webhook.rb +47 -1
  25. data/lib/zavudev/models/senders/agent/agent_tool.rb +19 -1
  26. data/lib/zavudev/models/senders/agent/tool_create_params.rb +7 -2
  27. data/lib/zavudev/models/senders/agent/tool_test_response.rb +90 -5
  28. data/lib/zavudev/models/senders/agent.rb +198 -1
  29. data/lib/zavudev/models/senders/agent_create_params.rb +188 -1
  30. data/lib/zavudev/models/senders/agent_execution.rb +26 -1
  31. data/lib/zavudev/models/senders/agent_update_params.rb +188 -1
  32. data/lib/zavudev/models/template.rb +1 -0
  33. data/lib/zavudev/models/template_create_params.rb +19 -9
  34. data/lib/zavudev/models/webhook_event.rb +51 -19
  35. data/lib/zavudev/resources/broadcasts.rb +20 -4
  36. data/lib/zavudev/resources/functions.rb +35 -10
  37. data/lib/zavudev/resources/invitations.rb +18 -12
  38. data/lib/zavudev/resources/messages.rb +24 -4
  39. data/lib/zavudev/resources/number_10dlc/brands.rb +5 -1
  40. data/lib/zavudev/resources/number_10dlc/campaigns.rb +6 -1
  41. data/lib/zavudev/resources/phone_numbers.rb +12 -3
  42. data/lib/zavudev/resources/senders/agent/executions.rb +5 -0
  43. data/lib/zavudev/resources/senders/agent/tools.rb +14 -2
  44. data/lib/zavudev/resources/senders/agent.rb +18 -2
  45. data/lib/zavudev/resources/senders.rb +15 -3
  46. data/lib/zavudev/version.rb +1 -1
  47. data/rbi/zavudev/models/channel.rbi +1 -5
  48. data/rbi/zavudev/models/function_create_params.rbi +50 -2
  49. data/rbi/zavudev/models/function_create_response.rbi +6 -2
  50. data/rbi/zavudev/models/function_deploy_params.rbi +42 -2
  51. data/rbi/zavudev/models/function_deploy_response.rbi +20 -0
  52. data/rbi/zavudev/models/function_get_deployment_response.rbi +20 -0
  53. data/rbi/zavudev/models/function_retrieve_response.rbi +6 -2
  54. data/rbi/zavudev/models/function_update_params.rbi +57 -2
  55. data/rbi/zavudev/models/function_update_response.rbi +6 -2
  56. data/rbi/zavudev/models/invitation.rbi +162 -13
  57. data/rbi/zavudev/models/invitation_create_params.rbi +51 -18
  58. data/rbi/zavudev/models/invitation_list_params.rbi +17 -0
  59. data/rbi/zavudev/models/message.rbi +47 -8
  60. data/rbi/zavudev/models/message_send_params.rbi +4 -10
  61. data/rbi/zavudev/models/message_type.rbi +18 -0
  62. data/rbi/zavudev/models/phone_number_pricing.rbi +6 -2
  63. data/rbi/zavudev/models/phone_number_search_available_params.rbi +13 -0
  64. data/rbi/zavudev/models/sender.rbi +17 -0
  65. data/rbi/zavudev/models/sender_create_params.rbi +136 -4
  66. data/rbi/zavudev/models/sender_update_params.rbi +124 -0
  67. data/rbi/zavudev/models/sender_webhook.rbi +69 -0
  68. data/rbi/zavudev/models/senders/agent/agent_tool.rbi +26 -3
  69. data/rbi/zavudev/models/senders/agent/tool_create_params.rbi +6 -2
  70. data/rbi/zavudev/models/senders/agent/tool_test_response.rbi +130 -5
  71. data/rbi/zavudev/models/senders/agent.rbi +320 -3
  72. data/rbi/zavudev/models/senders/agent_create_params.rbi +304 -0
  73. data/rbi/zavudev/models/senders/agent_execution.rbi +31 -3
  74. data/rbi/zavudev/models/senders/agent_update_params.rbi +304 -0
  75. data/rbi/zavudev/models/template.rbi +5 -0
  76. data/rbi/zavudev/models/template_create_params.rbi +27 -6
  77. data/rbi/zavudev/models/webhook_event.rbi +55 -20
  78. data/rbi/zavudev/resources/broadcasts.rbi +20 -4
  79. data/rbi/zavudev/resources/functions.rbi +62 -6
  80. data/rbi/zavudev/resources/invitations.rbi +36 -16
  81. data/rbi/zavudev/resources/messages.rbi +27 -10
  82. data/rbi/zavudev/resources/number_10dlc/brands.rbi +5 -1
  83. data/rbi/zavudev/resources/number_10dlc/campaigns.rbi +6 -1
  84. data/rbi/zavudev/resources/phone_numbers.rbi +10 -2
  85. data/rbi/zavudev/resources/senders/agent/executions.rbi +5 -0
  86. data/rbi/zavudev/resources/senders/agent/tools.rbi +13 -2
  87. data/rbi/zavudev/resources/senders/agent.rbi +16 -0
  88. data/rbi/zavudev/resources/senders.rbi +56 -2
  89. data/sig/zavudev/models/channel.rbs +0 -2
  90. data/sig/zavudev/models/function_create_params.rbs +14 -0
  91. data/sig/zavudev/models/function_deploy_params.rbs +14 -0
  92. data/sig/zavudev/models/function_deploy_response.rbs +5 -0
  93. data/sig/zavudev/models/function_get_deployment_response.rbs +5 -0
  94. data/sig/zavudev/models/function_update_params.rbs +21 -0
  95. data/sig/zavudev/models/invitation.rbs +58 -3
  96. data/sig/zavudev/models/invitation_create_params.rbs +2 -2
  97. data/sig/zavudev/models/invitation_list_params.rbs +3 -1
  98. data/sig/zavudev/models/message.rbs +7 -0
  99. data/sig/zavudev/models/message_type.rbs +4 -0
  100. data/sig/zavudev/models/phone_number_search_available_params.rbs +7 -0
  101. data/sig/zavudev/models/sender.rbs +7 -0
  102. data/sig/zavudev/models/sender_create_params.rbs +35 -0
  103. data/sig/zavudev/models/sender_update_params.rbs +35 -0
  104. data/sig/zavudev/models/sender_webhook.rbs +17 -0
  105. data/sig/zavudev/models/senders/agent/agent_tool.rbs +10 -3
  106. data/sig/zavudev/models/senders/agent/tool_test_response.rbs +68 -4
  107. data/sig/zavudev/models/senders/agent.rbs +161 -3
  108. data/sig/zavudev/models/senders/agent_create_params.rbs +152 -1
  109. data/sig/zavudev/models/senders/agent_execution.rbs +13 -3
  110. data/sig/zavudev/models/senders/agent_update_params.rbs +152 -1
  111. data/sig/zavudev/models/template.rbs +2 -1
  112. data/sig/zavudev/models/template_create_params.rbs +9 -6
  113. data/sig/zavudev/models/webhook_event.rbs +10 -2
  114. data/sig/zavudev/resources/functions.rbs +7 -0
  115. data/sig/zavudev/resources/phone_numbers.rbs +1 -0
  116. data/sig/zavudev/resources/senders/agent.rbs +2 -0
  117. data/sig/zavudev/resources/senders.rbs +6 -0
  118. metadata +2 -2
@@ -8,7 +8,8 @@ module Zavudev
8
8
  include Zavudev::Internal::Type::RequestParameters
9
9
 
10
10
  # @!attribute allowed_phone_countries
11
- # ISO country codes for allowed phone numbers.
11
+ # ISO country codes for allowed phone numbers. Only valid when `connectionType` is
12
+ # `whatsapp_waba` — sending it with `messenger` returns 400.
12
13
  #
13
14
  # @return [Array<String>, nil]
14
15
  optional :allowed_phone_countries,
@@ -34,10 +35,19 @@ module Zavudev
34
35
  optional :client_phone, String, api_name: :clientPhone
35
36
 
36
37
  # @!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.
38
+ # Which Meta channel the client connects, and how.
39
+ #
40
+ # - `whatsapp_waba` (default): Meta's embedded signup links an official WhatsApp
41
+ # Business Account. Accepts `phoneNumberId` and `allowedPhoneCountries`.
42
+ # - `messenger`: the client authorizes with Facebook and picks a Facebook Page
43
+ # they administer. The Page's Messenger inbox — including Marketplace chats — is
44
+ # routed to Zavu. They must be an admin of at least one Page. A Page can only be
45
+ # connected to one Zavu project at a time: if the client picks a Page that
46
+ # another project already connected, the newer connection wins and the older one
47
+ # is disconnected.
48
+ #
49
+ # One invitation connects one channel. To onboard a client on several channels,
50
+ # create one invitation per channel; each completes into its own sender.
41
51
  #
42
52
  # @return [Symbol, Zavudev::Models::InvitationCreateParams::ConnectionType, nil]
43
53
  optional :connection_type,
@@ -52,7 +62,9 @@ module Zavudev
52
62
 
53
63
  # @!attribute phone_number_id
54
64
  # ID of a Zavu phone number to pre-assign for WhatsApp registration. If provided,
55
- # the client will use this number instead of their own.
65
+ # the client will use this number instead of their own. Only valid when
66
+ # `connectionType` is `whatsapp_waba` — sending it with `messenger` returns 400,
67
+ # since a Facebook Page has no phone number.
56
68
  #
57
69
  # @return [String, nil]
58
70
  optional :phone_number_id, String, api_name: :phoneNumberId
@@ -61,7 +73,7 @@ module Zavudev
61
73
  # Some parameter documentations has been truncated, see
62
74
  # {Zavudev::Models::InvitationCreateParams} for more details.
63
75
  #
64
- # @param allowed_phone_countries [Array<String>] ISO country codes for allowed phone numbers.
76
+ # @param allowed_phone_countries [Array<String>] ISO country codes for allowed phone numbers. Only valid when `connectionType` is
65
77
  #
66
78
  # @param client_email [String] Email of the client being invited.
67
79
  #
@@ -69,7 +81,7 @@ module Zavudev
69
81
  #
70
82
  # @param client_phone [String] Phone number of the client in E.164 format.
71
83
  #
72
- # @param connection_type [Symbol, Zavudev::Models::InvitationCreateParams::ConnectionType] How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
84
+ # @param connection_type [Symbol, Zavudev::Models::InvitationCreateParams::ConnectionType] Which Meta channel the client connects, and how.
73
85
  #
74
86
  # @param expires_in_days [Integer] Number of days until the invitation expires.
75
87
  #
@@ -77,15 +89,24 @@ module Zavudev
77
89
  #
78
90
  # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}]
79
91
 
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.
92
+ # Which Meta channel the client connects, and how.
93
+ #
94
+ # - `whatsapp_waba` (default): Meta's embedded signup links an official WhatsApp
95
+ # Business Account. Accepts `phoneNumberId` and `allowedPhoneCountries`.
96
+ # - `messenger`: the client authorizes with Facebook and picks a Facebook Page
97
+ # they administer. The Page's Messenger inbox — including Marketplace chats — is
98
+ # routed to Zavu. They must be an admin of at least one Page. A Page can only be
99
+ # connected to one Zavu project at a time: if the client picks a Page that
100
+ # another project already connected, the newer connection wins and the older one
101
+ # is disconnected.
102
+ #
103
+ # One invitation connects one channel. To onboard a client on several channels,
104
+ # create one invitation per channel; each completes into its own sender.
84
105
  module ConnectionType
85
106
  extend Zavudev::Internal::Type::Enum
86
107
 
87
108
  WHATSAPP_WABA = :whatsapp_waba
88
- WHATSAPP_ALT = :whatsapp_alt
109
+ MESSENGER = :messenger
89
110
 
90
111
  # @!method self.values
91
112
  # @return [Array<Symbol>]
@@ -20,10 +20,18 @@ module Zavudev
20
20
  # @!attribute status
21
21
  # Current status of the partner invitation.
22
22
  #
23
+ # `failed` means the client started the connection and it did not finish (they
24
+ # cancelled Meta's dialog, denied a permission, or abandoned the tab). A failed
25
+ # invitation is still usable: the same link can be retried, and it moves back to
26
+ # `in_progress` when the client tries again.
27
+ #
23
28
  # @return [Symbol, Zavudev::Models::InvitationListParams::Status, nil]
24
29
  optional :status, enum: -> { Zavudev::InvitationListParams::Status }
25
30
 
26
31
  # @!method initialize(cursor: nil, limit: nil, status: nil, request_options: {})
32
+ # Some parameter documentations has been truncated, see
33
+ # {Zavudev::Models::InvitationListParams} for more details.
34
+ #
27
35
  # @param cursor [String]
28
36
  #
29
37
  # @param limit [Integer]
@@ -33,6 +41,11 @@ module Zavudev
33
41
  # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}]
34
42
 
35
43
  # Current status of the partner invitation.
44
+ #
45
+ # `failed` means the client started the connection and it did not finish (they
46
+ # cancelled Meta's dialog, denied a permission, or abandoned the tab). A failed
47
+ # invitation is still usable: the same link can be retried, and it moves back to
48
+ # `in_progress` when the client tries again.
36
49
  module Status
37
50
  extend Zavudev::Internal::Type::Enum
38
51
 
@@ -41,6 +54,7 @@ module Zavudev
41
54
  COMPLETED = :completed
42
55
  EXPIRED = :expired
43
56
  CANCELLED = :cancelled
57
+ FAILED = :failed
44
58
 
45
59
  # @!method self.values
46
60
  # @return [Array<Symbol>]
@@ -10,10 +10,7 @@ module Zavudev
10
10
  required :id, String
11
11
 
12
12
  # @!attribute channel
13
- # Delivery channel. Use 'auto' for intelligent routing. `whatsapp_alt` is the
14
- # QR-linked WhatsApp channel and is only accepted for teams with the WhatsApp
15
- # Alternative feature enabled; the sender must have a connected whatsapp_alt
16
- # session.
13
+ # Delivery channel. Use 'auto' for intelligent routing.
17
14
  #
18
15
  # @return [Symbol, Zavudev::Models::Channel]
19
16
  required :channel, enum: -> { Zavudev::Channel }
@@ -27,6 +24,20 @@ module Zavudev
27
24
  # Type of message. Non-text types are supported by WhatsApp and Telegram (varies
28
25
  # by type).
29
26
  #
27
+ # `location_request` asks the recipient to share their location and is
28
+ # WhatsApp-only. It takes no `content` object — the prompt goes in `text` (max
29
+ # 1024 characters) and the button label is fixed by WhatsApp. The recipient's
30
+ # answer arrives as an inbound `location` message whose `content.replyToMessageId`
31
+ # is the ID of the request.
32
+ #
33
+ # `request_contact_info` asks the recipient to share their phone number and is
34
+ # WhatsApp-only. Like `location_request` it takes no `content` object — the prompt
35
+ # goes in `text` (max 1024 characters) and WhatsApp renders a fixed **Share
36
+ # Contact Info** button. The answer arrives as an inbound `contact` message. Use
37
+ # it to recover the phone number of a contact who adopted a WhatsApp username and
38
+ # is only known by their business-scoped user ID (BSUID); when they share it, Zavu
39
+ # automatically links the phone number to that contact.
40
+ #
30
41
  # @return [Symbol, Zavudev::Models::MessageType]
31
42
  required :message_type, enum: -> { Zavudev::MessageType }, api_name: :messageType
32
43
 
@@ -46,6 +57,15 @@ module Zavudev
46
57
  # @return [Zavudev::Models::MessageContent, nil]
47
58
  optional :content, -> { Zavudev::MessageContent }
48
59
 
60
+ # @!attribute conversation_id
61
+ # ID of the conversation (inbox thread) this message belongs to. Use it to build a
62
+ # direct dashboard link:
63
+ # `https://dashboard.zavu.dev/{locale}/inbox?conv={conversationId}`. Omitted only
64
+ # on legacy messages created before conversation threading.
65
+ #
66
+ # @return [String, nil]
67
+ optional :conversation_id, String, api_name: :conversationId
68
+
49
69
  # @!attribute cost
50
70
  # Zavu platform charge in USD for this message. Messaging is billed against your
51
71
  # plan's monthly limits plus usage-based overage.
@@ -107,13 +127,13 @@ module Zavudev
107
127
  # @return [Time, nil]
108
128
  optional :updated_at, Time, api_name: :updatedAt
109
129
 
110
- # @!method initialize(id:, channel:, created_at:, message_type:, status:, to:, content: nil, cost: nil, cost_provider: nil, cost_total: nil, error_code: nil, error_message: nil, from: nil, metadata: nil, provider_message_id: nil, sender_id: nil, text: nil, updated_at: nil)
130
+ # @!method initialize(id:, channel:, created_at:, message_type:, status:, to:, content: nil, conversation_id: nil, cost: nil, cost_provider: nil, cost_total: nil, error_code: nil, error_message: nil, from: nil, metadata: nil, provider_message_id: nil, sender_id: nil, text: nil, updated_at: nil)
111
131
  # Some parameter documentations has been truncated, see {Zavudev::Models::Message}
112
132
  # for more details.
113
133
  #
114
134
  # @param id [String]
115
135
  #
116
- # @param channel [Symbol, Zavudev::Models::Channel] Delivery channel. Use 'auto' for intelligent routing. `whatsapp_alt` is the QR-l
136
+ # @param channel [Symbol, Zavudev::Models::Channel] Delivery channel. Use 'auto' for intelligent routing.
117
137
  #
118
138
  # @param created_at [Time]
119
139
  #
@@ -125,6 +145,8 @@ module Zavudev
125
145
  #
126
146
  # @param content [Zavudev::Models::MessageContent] Content for non-text message types (WhatsApp and Telegram).
127
147
  #
148
+ # @param conversation_id [String] ID of the conversation (inbox thread) this message belongs to. Use it to build a
149
+ #
128
150
  # @param cost [Float, nil] Zavu platform charge in USD for this message. Messaging is billed against your p
129
151
  #
130
152
  # @param cost_provider [Float, nil] Carrier and delivery cost in USD.
@@ -9,13 +9,10 @@ module Zavudev
9
9
 
10
10
  # @!attribute to
11
11
  # Recipient phone number in E.164 format, email address, WhatsApp business-scoped
12
- # user ID (BSUID, e.g. `US.13491208655302741918`), WhatsApp group JID
13
- # (`<id>@g.us`, e.g. `120363000000000000@g.us`), or numeric chat ID (for
12
+ # user ID (BSUID, e.g. `US.13491208655302741918`), or numeric chat ID (for
14
13
  # Telegram/Instagram/Messenger). A BSUID is routed to WhatsApp and sent via the
15
14
  # `recipient` field; use it to message a contact who adopted a username and whose
16
- # phone number is hidden. A group JID is only valid on the `whatsapp_alt` channel
17
- # and supports text and media (image, video, audio, document, sticker, location,
18
- # contact).
15
+ # phone number is hidden.
19
16
  #
20
17
  # @return [String]
21
18
  required :to, String
@@ -4,6 +4,20 @@ module Zavudev
4
4
  module Models
5
5
  # Type of message. Non-text types are supported by WhatsApp and Telegram (varies
6
6
  # by type).
7
+ #
8
+ # `location_request` asks the recipient to share their location and is
9
+ # WhatsApp-only. It takes no `content` object — the prompt goes in `text` (max
10
+ # 1024 characters) and the button label is fixed by WhatsApp. The recipient's
11
+ # answer arrives as an inbound `location` message whose `content.replyToMessageId`
12
+ # is the ID of the request.
13
+ #
14
+ # `request_contact_info` asks the recipient to share their phone number and is
15
+ # WhatsApp-only. Like `location_request` it takes no `content` object — the prompt
16
+ # goes in `text` (max 1024 characters) and WhatsApp renders a fixed **Share
17
+ # Contact Info** button. The answer arrives as an inbound `contact` message. Use
18
+ # it to recover the phone number of a contact who adopted a WhatsApp username and
19
+ # is only known by their business-scoped user ID (BSUID); when they share it, Zavu
20
+ # automatically links the phone number to that contact.
7
21
  module MessageType
8
22
  extend Zavudev::Internal::Type::Enum
9
23
 
@@ -18,6 +32,8 @@ module Zavudev
18
32
  BUTTONS = :buttons
19
33
  LIST = :list
20
34
  CTA_URL = :cta_url
35
+ REQUEST_CONTACT_INFO = :request_contact_info
36
+ LOCATION_REQUEST = :location_request
21
37
  REACTION = :reaction
22
38
  TEMPLATE = :template
23
39
 
@@ -4,7 +4,9 @@ module Zavudev
4
4
  module Models
5
5
  class PhoneNumberPricing < Zavudev::Internal::Type::BaseModel
6
6
  # @!attribute is_free_eligible
7
- # Whether this number qualifies for the free first US number offer.
7
+ # Whether this number qualifies as the plan-included US number on paid plans. The
8
+ # benefit is one per account: it is never offered again once claimed, not even
9
+ # after the number is released.
8
10
  #
9
11
  # @return [Boolean, nil]
10
12
  optional :is_free_eligible, Zavudev::Internal::Type::Boolean, api_name: :isFreeEligible
@@ -22,7 +24,10 @@ module Zavudev
22
24
  optional :upfront_price, Float, api_name: :upfrontPrice
23
25
 
24
26
  # @!method initialize(is_free_eligible: nil, monthly_price: nil, upfront_price: nil)
25
- # @param is_free_eligible [Boolean] Whether this number qualifies for the free first US number offer.
27
+ # Some parameter documentations has been truncated, see
28
+ # {Zavudev::Models::PhoneNumberPricing} for more details.
29
+ #
30
+ # @param is_free_eligible [Boolean] Whether this number qualifies as the plan-included US number on paid plans. The
26
31
  #
27
32
  # @param monthly_price [Float] Monthly price in USD.
28
33
  #
@@ -13,6 +13,13 @@ module Zavudev
13
13
  # @return [String]
14
14
  required :country_code, String
15
15
 
16
+ # @!attribute capabilities
17
+ # Comma-separated capabilities the number must have: `sms`, `voice`, `mms`.
18
+ # Numbers missing any of them are dropped.
19
+ #
20
+ # @return [String, nil]
21
+ optional :capabilities, String
22
+
16
23
  # @!attribute contains
17
24
  # Search for numbers containing this string.
18
25
  #
@@ -31,9 +38,14 @@ module Zavudev
31
38
  # @return [Symbol, Zavudev::Models::PhoneNumberType, nil]
32
39
  optional :type, enum: -> { Zavudev::PhoneNumberType }
33
40
 
34
- # @!method initialize(country_code:, contains: nil, limit: nil, type: nil, request_options: {})
41
+ # @!method initialize(country_code:, capabilities: nil, contains: nil, limit: nil, type: nil, request_options: {})
42
+ # Some parameter documentations has been truncated, see
43
+ # {Zavudev::Models::PhoneNumberSearchAvailableParams} for more details.
44
+ #
35
45
  # @param country_code [String] Two-letter ISO country code.
36
46
  #
47
+ # @param capabilities [String] Comma-separated capabilities the number must have: `sms`, `voice`, `mms`. Number
48
+ #
37
49
  # @param contains [String] Search for numbers containing this string.
38
50
  #
39
51
  # @param limit [Integer] Maximum number of results to return.
@@ -20,6 +20,15 @@ module Zavudev
20
20
  # @return [String]
21
21
  required :phone_number, String, api_name: :phoneNumber
22
22
 
23
+ # @!attribute channels
24
+ # Channels this sender can actually send on right now, computed from its
25
+ # configuration. Empty means the sender cannot send or receive anything yet: a
26
+ # phoneNumber alone does not enable SMS or voice. Check this rather than inferring
27
+ # capability from phoneNumber or emailAddress.
28
+ #
29
+ # @return [Array<String>, nil]
30
+ optional :channels, Zavudev::Internal::Type::ArrayOf[String]
31
+
23
32
  # @!attribute created_at
24
33
  #
25
34
  # @return [Time, nil]
@@ -69,7 +78,7 @@ module Zavudev
69
78
  # @return [Zavudev::Models::Sender::Whatsapp, nil]
70
79
  optional :whatsapp, -> { Zavudev::Sender::Whatsapp }
71
80
 
72
- # @!method initialize(id:, name:, phone_number:, created_at: nil, email_address: nil, email_catch_all_enabled: nil, email_receiving_enabled: nil, is_default: nil, updated_at: nil, webhook: nil, whatsapp: nil)
81
+ # @!method initialize(id:, name:, phone_number:, channels: nil, created_at: nil, email_address: nil, email_catch_all_enabled: nil, email_receiving_enabled: nil, is_default: nil, updated_at: nil, webhook: nil, whatsapp: nil)
73
82
  # Some parameter documentations has been truncated, see {Zavudev::Models::Sender}
74
83
  # for more details.
75
84
  #
@@ -79,6 +88,8 @@ module Zavudev
79
88
  #
80
89
  # @param phone_number [String] Phone number in E.164 format.
81
90
  #
91
+ # @param channels [Array<String>] Channels this sender can actually send on right now, computed from its configura
92
+ #
82
93
  # @param created_at [Time]
83
94
  #
84
95
  # @param email_address [String] From-address for the email channel, if configured.
@@ -40,9 +40,29 @@ module Zavudev
40
40
  # @return [Boolean, nil]
41
41
  optional :email_receiving_enabled, Zavudev::Internal::Type::Boolean, api_name: :emailReceivingEnabled
42
42
 
43
+ # @!attribute enable_sms_oneway
44
+ # Enable the one-way SMS channel (`sms_oneway`). Needs nothing else — no phone
45
+ # number, no credential — so it is the fastest way to get a sender that can send.
46
+ # Recipients cannot reply. Confirm with `sms_oneway` in the `channels` array on
47
+ # the response.
48
+ #
49
+ # @return [Boolean, nil]
50
+ optional :enable_sms_oneway, Zavudev::Internal::Type::Boolean, api_name: :enableSmsOneway
51
+
52
+ # @!attribute enable_voice
53
+ # Let this sender place and answer phone calls. Requires `phoneNumber`; enabling
54
+ # it without one returns 400. Check the `channels` array on the response to
55
+ # confirm `voice` is on.
56
+ #
57
+ # @return [Boolean, nil]
58
+ optional :enable_voice, Zavudev::Internal::Type::Boolean, api_name: :enableVoice
59
+
43
60
  # @!attribute phone_number
44
- # Phone number in E.164 format. Required for phone-based channels (SMS, WhatsApp).
45
- # Omit for an email-only sender.
61
+ # Phone number in E.164 format, and it must be a number your project already owns
62
+ # (see `GET /v1/phone-numbers`). The number is routed to the sender as part of
63
+ # this call, which is what turns the SMS channel on. Passing a number the project
64
+ # does not own, or one already attached to another sender, returns 400 rather than
65
+ # creating a sender that cannot send. Omit for an email-only sender.
46
66
  #
47
67
  # @return [String, nil]
48
68
  optional :phone_number, String, api_name: :phoneNumber
@@ -60,13 +80,32 @@ module Zavudev
60
80
  -> { Zavudev::Internal::Type::ArrayOf[enum: Zavudev::WebhookEvent] },
61
81
  api_name: :webhookEvents
62
82
 
83
+ # @!attribute webhook_signature_version
84
+ # Which `X-Zavu-Signature` scheme this receiver is sent.
85
+ #
86
+ # - `v1`: `v1=HMAC_SHA256(secret, body)`. The scheme used before this was
87
+ # configurable. Existing webhooks stay on it until you move them.
88
+ # - `v2`: `v2=HMAC_SHA256(secret, "{t}.{body}")`. The current scheme, and the
89
+ # default for new senders. It signs the timestamp together with the body.
90
+ # - `v1+v2`: both signatures, sharing one `t`. The migration setting: a receiver
91
+ # reading either one works, so you can deploy and confirm your new verifier
92
+ # before switching over.
93
+ #
94
+ # Moving from `v1` straight to `v2` returns `400`. Set `v1+v2` first. See
95
+ # https://docs.zavu.dev/guides/receiving-messages/signature-migration
96
+ #
97
+ # @return [Symbol, Zavudev::Models::SenderCreateParams::WebhookSignatureVersion, nil]
98
+ optional :webhook_signature_version,
99
+ enum: -> { Zavudev::SenderCreateParams::WebhookSignatureVersion },
100
+ api_name: :webhookSignatureVersion
101
+
63
102
  # @!attribute webhook_url
64
103
  # HTTPS URL for webhook events.
65
104
  #
66
105
  # @return [String, nil]
67
106
  optional :webhook_url, String, api_name: :webhookUrl
68
107
 
69
- # @!method initialize(name:, email_address: nil, email_domain_id: nil, email_from_name: nil, email_receiving_enabled: nil, phone_number: nil, set_as_default: nil, webhook_events: nil, webhook_url: nil, request_options: {})
108
+ # @!method initialize(name:, email_address: nil, email_domain_id: nil, email_from_name: nil, email_receiving_enabled: nil, enable_sms_oneway: nil, enable_voice: nil, phone_number: nil, set_as_default: nil, webhook_events: nil, webhook_signature_version: nil, webhook_url: nil, request_options: {})
70
109
  # Some parameter documentations has been truncated, see
71
110
  # {Zavudev::Models::SenderCreateParams} for more details.
72
111
  #
@@ -80,15 +119,44 @@ module Zavudev
80
119
  #
81
120
  # @param email_receiving_enabled [Boolean] Enable inbound email receiving on this sender. Requires a verified MX record on
82
121
  #
83
- # @param phone_number [String] Phone number in E.164 format. Required for phone-based channels (SMS, WhatsApp).
122
+ # @param enable_sms_oneway [Boolean] Enable the one-way SMS channel (`sms_oneway`). Needs nothing else — no phone num
123
+ #
124
+ # @param enable_voice [Boolean] Let this sender place and answer phone calls. Requires `phoneNumber`; enabling i
125
+ #
126
+ # @param phone_number [String] Phone number in E.164 format, and it must be a number your project already owns
84
127
  #
85
128
  # @param set_as_default [Boolean]
86
129
  #
87
130
  # @param webhook_events [Array<Symbol, Zavudev::Models::WebhookEvent>] Events to subscribe to.
88
131
  #
132
+ # @param webhook_signature_version [Symbol, Zavudev::Models::SenderCreateParams::WebhookSignatureVersion] Which `X-Zavu-Signature` scheme this receiver is sent.
133
+ #
89
134
  # @param webhook_url [String] HTTPS URL for webhook events.
90
135
  #
91
136
  # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}]
137
+
138
+ # Which `X-Zavu-Signature` scheme this receiver is sent.
139
+ #
140
+ # - `v1`: `v1=HMAC_SHA256(secret, body)`. The scheme used before this was
141
+ # configurable. Existing webhooks stay on it until you move them.
142
+ # - `v2`: `v2=HMAC_SHA256(secret, "{t}.{body}")`. The current scheme, and the
143
+ # default for new senders. It signs the timestamp together with the body.
144
+ # - `v1+v2`: both signatures, sharing one `t`. The migration setting: a receiver
145
+ # reading either one works, so you can deploy and confirm your new verifier
146
+ # before switching over.
147
+ #
148
+ # Moving from `v1` straight to `v2` returns `400`. Set `v1+v2` first. See
149
+ # https://docs.zavu.dev/guides/receiving-messages/signature-migration
150
+ module WebhookSignatureVersion
151
+ extend Zavudev::Internal::Type::Enum
152
+
153
+ V1 = :v1
154
+ V1_V2 = :"v1+v2"
155
+ V2 = :v2
156
+
157
+ # @!method self.values
158
+ # @return [Array<Symbol>]
159
+ end
92
160
  end
93
161
  end
94
162
  end
@@ -46,6 +46,22 @@ module Zavudev
46
46
  # @return [Boolean, nil]
47
47
  optional :email_receiving_enabled, Zavudev::Internal::Type::Boolean, api_name: :emailReceivingEnabled
48
48
 
49
+ # @!attribute enable_sms_oneway
50
+ # Turn the one-way SMS channel on or off. Enabling needs nothing else and takes
51
+ # effect immediately; disabling removes the channel from the sender. Confirm with
52
+ # the `channels` array on the response.
53
+ #
54
+ # @return [Boolean, nil]
55
+ optional :enable_sms_oneway, Zavudev::Internal::Type::Boolean, api_name: :enableSmsOneway
56
+
57
+ # @!attribute enable_voice
58
+ # Turn the voice channel on or off. The sender must already have a phone number
59
+ # provisioned for calls; enabling it otherwise returns 400 instead of storing a
60
+ # flag that changes nothing. Confirm with the `channels` array on the response.
61
+ #
62
+ # @return [Boolean, nil]
63
+ optional :enable_voice, Zavudev::Internal::Type::Boolean, api_name: :enableVoice
64
+
49
65
  # @!attribute name
50
66
  #
51
67
  # @return [String, nil]
@@ -70,13 +86,32 @@ module Zavudev
70
86
  -> { Zavudev::Internal::Type::ArrayOf[enum: Zavudev::WebhookEvent] },
71
87
  api_name: :webhookEvents
72
88
 
89
+ # @!attribute webhook_signature_version
90
+ # Which `X-Zavu-Signature` scheme this receiver is sent.
91
+ #
92
+ # - `v1`: `v1=HMAC_SHA256(secret, body)`. The scheme used before this was
93
+ # configurable. Existing webhooks stay on it until you move them.
94
+ # - `v2`: `v2=HMAC_SHA256(secret, "{t}.{body}")`. The current scheme, and the
95
+ # default for new senders. It signs the timestamp together with the body.
96
+ # - `v1+v2`: both signatures, sharing one `t`. The migration setting: a receiver
97
+ # reading either one works, so you can deploy and confirm your new verifier
98
+ # before switching over.
99
+ #
100
+ # Moving from `v1` straight to `v2` returns `400`. Set `v1+v2` first. See
101
+ # https://docs.zavu.dev/guides/receiving-messages/signature-migration
102
+ #
103
+ # @return [Symbol, Zavudev::Models::SenderUpdateParams::WebhookSignatureVersion, nil]
104
+ optional :webhook_signature_version,
105
+ enum: -> { Zavudev::SenderUpdateParams::WebhookSignatureVersion },
106
+ api_name: :webhookSignatureVersion
107
+
73
108
  # @!attribute webhook_url
74
109
  # HTTPS URL for webhook events. Set to null to remove webhook.
75
110
  #
76
111
  # @return [String, nil]
77
112
  optional :webhook_url, String, api_name: :webhookUrl, nil?: true
78
113
 
79
- # @!method initialize(sender_id:, email_address: nil, email_catch_all_enabled: nil, email_domain_id: nil, email_from_name: nil, email_receiving_enabled: nil, name: nil, set_as_default: nil, webhook_active: nil, webhook_events: nil, webhook_url: nil, request_options: {})
114
+ # @!method initialize(sender_id:, email_address: nil, email_catch_all_enabled: nil, email_domain_id: nil, email_from_name: nil, email_receiving_enabled: nil, enable_sms_oneway: nil, enable_voice: nil, name: nil, set_as_default: nil, webhook_active: nil, webhook_events: nil, webhook_signature_version: nil, webhook_url: nil, request_options: {})
80
115
  # Some parameter documentations has been truncated, see
81
116
  # {Zavudev::Models::SenderUpdateParams} for more details.
82
117
  #
@@ -92,6 +127,10 @@ module Zavudev
92
127
  #
93
128
  # @param email_receiving_enabled [Boolean] Enable or disable inbound email receiving for this sender.
94
129
  #
130
+ # @param enable_sms_oneway [Boolean] Turn the one-way SMS channel on or off. Enabling needs nothing else and takes ef
131
+ #
132
+ # @param enable_voice [Boolean] Turn the voice channel on or off. The sender must already have a phone number pr
133
+ #
95
134
  # @param name [String]
96
135
  #
97
136
  # @param set_as_default [Boolean]
@@ -100,9 +139,34 @@ module Zavudev
100
139
  #
101
140
  # @param webhook_events [Array<Symbol, Zavudev::Models::WebhookEvent>] Events to subscribe to.
102
141
  #
142
+ # @param webhook_signature_version [Symbol, Zavudev::Models::SenderUpdateParams::WebhookSignatureVersion] Which `X-Zavu-Signature` scheme this receiver is sent.
143
+ #
103
144
  # @param webhook_url [String, nil] HTTPS URL for webhook events. Set to null to remove webhook.
104
145
  #
105
146
  # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}]
147
+
148
+ # Which `X-Zavu-Signature` scheme this receiver is sent.
149
+ #
150
+ # - `v1`: `v1=HMAC_SHA256(secret, body)`. The scheme used before this was
151
+ # configurable. Existing webhooks stay on it until you move them.
152
+ # - `v2`: `v2=HMAC_SHA256(secret, "{t}.{body}")`. The current scheme, and the
153
+ # default for new senders. It signs the timestamp together with the body.
154
+ # - `v1+v2`: both signatures, sharing one `t`. The migration setting: a receiver
155
+ # reading either one works, so you can deploy and confirm your new verifier
156
+ # before switching over.
157
+ #
158
+ # Moving from `v1` straight to `v2` returns `400`. Set `v1+v2` first. See
159
+ # https://docs.zavu.dev/guides/receiving-messages/signature-migration
160
+ module WebhookSignatureVersion
161
+ extend Zavudev::Internal::Type::Enum
162
+
163
+ V1 = :v1
164
+ V1_V2 = :"v1+v2"
165
+ V2 = :v2
166
+
167
+ # @!method self.values
168
+ # @return [Array<Symbol>]
169
+ end
106
170
  end
107
171
  end
108
172
  end
@@ -15,6 +15,25 @@ module Zavudev
15
15
  # @return [Array<Symbol, Zavudev::Models::WebhookEvent>]
16
16
  required :events, -> { Zavudev::Internal::Type::ArrayOf[enum: Zavudev::WebhookEvent] }
17
17
 
18
+ # @!attribute signature_version
19
+ # Which `X-Zavu-Signature` scheme this receiver is sent.
20
+ #
21
+ # - `v1`: `v1=HMAC_SHA256(secret, body)`. The scheme used before this was
22
+ # configurable. Existing webhooks stay on it until you move them.
23
+ # - `v2`: `v2=HMAC_SHA256(secret, "{t}.{body}")`. The current scheme, and the
24
+ # default for new senders. It signs the timestamp together with the body.
25
+ # - `v1+v2`: both signatures, sharing one `t`. The migration setting: a receiver
26
+ # reading either one works, so you can deploy and confirm your new verifier
27
+ # before switching over.
28
+ #
29
+ # Moving from `v1` straight to `v2` returns `400`. Set `v1+v2` first. See
30
+ # https://docs.zavu.dev/guides/receiving-messages/signature-migration
31
+ #
32
+ # @return [Symbol, Zavudev::Models::SenderWebhook::SignatureVersion]
33
+ required :signature_version,
34
+ enum: -> { Zavudev::SenderWebhook::SignatureVersion },
35
+ api_name: :signatureVersion
36
+
18
37
  # @!attribute url
19
38
  # HTTPS URL that will receive webhook events.
20
39
  #
@@ -28,7 +47,7 @@ module Zavudev
28
47
  # @return [String, nil]
29
48
  optional :secret, String
30
49
 
31
- # @!method initialize(active:, events:, url:, secret: nil)
50
+ # @!method initialize(active:, events:, signature_version:, url:, secret: nil)
32
51
  # Some parameter documentations has been truncated, see
33
52
  # {Zavudev::Models::SenderWebhook} for more details.
34
53
  #
@@ -38,9 +57,36 @@ module Zavudev
38
57
  #
39
58
  # @param events [Array<Symbol, Zavudev::Models::WebhookEvent>] List of events the webhook is subscribed to.
40
59
  #
60
+ # @param signature_version [Symbol, Zavudev::Models::SenderWebhook::SignatureVersion] Which `X-Zavu-Signature` scheme this receiver is sent.
61
+ #
41
62
  # @param url [String] HTTPS URL that will receive webhook events.
42
63
  #
43
64
  # @param secret [String] Webhook secret for signature verification. Only returned on create or regenerate
65
+
66
+ # Which `X-Zavu-Signature` scheme this receiver is sent.
67
+ #
68
+ # - `v1`: `v1=HMAC_SHA256(secret, body)`. The scheme used before this was
69
+ # configurable. Existing webhooks stay on it until you move them.
70
+ # - `v2`: `v2=HMAC_SHA256(secret, "{t}.{body}")`. The current scheme, and the
71
+ # default for new senders. It signs the timestamp together with the body.
72
+ # - `v1+v2`: both signatures, sharing one `t`. The migration setting: a receiver
73
+ # reading either one works, so you can deploy and confirm your new verifier
74
+ # before switching over.
75
+ #
76
+ # Moving from `v1` straight to `v2` returns `400`. Set `v1+v2` first. See
77
+ # https://docs.zavu.dev/guides/receiving-messages/signature-migration
78
+ #
79
+ # @see Zavudev::Models::SenderWebhook#signature_version
80
+ module SignatureVersion
81
+ extend Zavudev::Internal::Type::Enum
82
+
83
+ V1 = :v1
84
+ V1_V2 = :"v1+v2"
85
+ V2 = :v2
86
+
87
+ # @!method self.values
88
+ # @return [Array<Symbol>]
89
+ end
44
90
  end
45
91
  end
46
92
  end
@@ -53,7 +53,22 @@ module Zavudev
53
53
  # @return [String]
54
54
  required :webhook_url, String, api_name: :webhookUrl
55
55
 
56
- # @!method initialize(id:, agent_id:, created_at:, description:, enabled:, name:, parameters:, updated_at:, webhook_url:)
56
+ # @!attribute webhook_secret
57
+ # Signing secret for this tool's webhook. **Returned only when the tool is
58
+ # created**, never on a later read.
59
+ #
60
+ # Zavu generates one if you do not supply it, and signs every call to this tool
61
+ # with it: `X-Zavu-Signature: <hex>`, the HMAC-SHA256 of the request body. Verify
62
+ # it before trusting the call. Lost it? Rotate with
63
+ # `POST /v1/senders/{senderId}/agent/tools/{toolId}/webhook/secret`.
64
+ #
65
+ # @return [String, nil]
66
+ optional :webhook_secret, String, api_name: :webhookSecret
67
+
68
+ # @!method initialize(id:, agent_id:, created_at:, description:, enabled:, name:, parameters:, updated_at:, webhook_url:, webhook_secret: nil)
69
+ # Some parameter documentations has been truncated, see
70
+ # {Zavudev::Models::Senders::Agent::AgentTool} for more details.
71
+ #
57
72
  # @param id [String]
58
73
  #
59
74
  # @param agent_id [String]
@@ -71,6 +86,9 @@ module Zavudev
71
86
  # @param updated_at [Time]
72
87
  #
73
88
  # @param webhook_url [String] HTTPS URL to call when the tool is executed.
89
+ #
90
+ # @param webhook_secret [String] Signing secret for this tool's webhook. \*\*Returned only when the tool is
91
+ # created
74
92
  end
75
93
  end
76
94