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
@@ -76,8 +76,12 @@ module Zavudev
76
76
  )
77
77
  end
78
78
 
79
- # Purchase an available phone number. The first US phone number is free for each
80
- # team.
79
+ # Purchase an available phone number. Requires a paid plan: the Free plan cannot
80
+ # purchase phone numbers and receives `402` with code `paid_plan_required`. Paid
81
+ # plans include one US number at no charge. The included number is one per account
82
+ # and is granted once: claiming it spends the benefit for good, so releasing that
83
+ # number does not make another one free, and numbers the account already bought do
84
+ # not consume it.
81
85
  #
82
86
  # @overload purchase(phone_number:, name: nil, request_options: {})
83
87
  #
@@ -147,12 +151,17 @@ module Zavudev
147
151
  )
148
152
  end
149
153
 
154
+ # Some parameter documentations has been truncated, see
155
+ # {Zavudev::Models::PhoneNumberSearchAvailableParams} for more details.
156
+ #
150
157
  # Search for available phone numbers to purchase by country and type.
151
158
  #
152
- # @overload search_available(country_code:, contains: nil, limit: nil, type: nil, request_options: {})
159
+ # @overload search_available(country_code:, capabilities: nil, contains: nil, limit: nil, type: nil, request_options: {})
153
160
  #
154
161
  # @param country_code [String] Two-letter ISO country code.
155
162
  #
163
+ # @param capabilities [String] Comma-separated capabilities the number must have: `sms`, `voice`, `mms`. Number
164
+ #
156
165
  # @param contains [String] Search for numbers containing this string.
157
166
  #
158
167
  # @param limit [Integer] Maximum number of results to return.
@@ -33,6 +33,11 @@ module Zavudev
33
33
 
34
34
  # List recent agent executions with pagination.
35
35
  #
36
+ # An execution is one inbound message answered by the agent, so this covers the
37
+ # messaging channels only. Voice calls are never listed here regardless of how
38
+ # many the agent handled. Use `GET /v1/calls` (and `GET /v1/calls/{callId}` for
39
+ # the transcript) for voice.
40
+ #
36
41
  # @overload list(sender_id, cursor: nil, limit: nil, status: nil, request_options: {})
37
42
  #
38
43
  # @param sender_id [String]
@@ -5,6 +5,9 @@ module Zavudev
5
5
  class Senders
6
6
  class Agent
7
7
  class Tools
8
+ # Some parameter documentations has been truncated, see
9
+ # {Zavudev::Models::Senders::Agent::ToolCreateParams} for more details.
10
+ #
8
11
  # Create a new tool for an agent. Tools allow the agent to call external webhooks.
9
12
  #
10
13
  # @overload create(sender_id, description:, name:, parameters:, webhook_url:, enabled: nil, webhook_secret: nil, request_options: {})
@@ -21,7 +24,7 @@ module Zavudev
21
24
  #
22
25
  # @param enabled [Boolean]
23
26
  #
24
- # @param webhook_secret [String] Optional secret for webhook signature verification.
27
+ # @param webhook_secret [String] Signing secret for the webhook. Optional: Zavu generates one when omitted and re
25
28
  #
26
29
  # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
27
30
  #
@@ -155,7 +158,16 @@ module Zavudev
155
158
  )
156
159
  end
157
160
 
158
- # Test a tool by triggering its webhook with test parameters.
161
+ # Run a tool with the parameters you supply and return what it answered.
162
+ #
163
+ # The call is synchronous: the response carries the tool's status, body, and
164
+ # duration, so a green result is evidence the tool ran rather than evidence it was
165
+ # accepted. Each run is also recorded and readable afterwards via
166
+ # `GET /v1/senders/{senderId}/agent/tools/{toolId}/test-runs`.
167
+ #
168
+ # A tool that answers with an error is reported as a run with `success: false` —
169
+ # the endpoint itself still returns 200. This fires the tool's real webhook, so a
170
+ # test has whatever side effects the tool has.
159
171
  #
160
172
  # @overload test_(tool_id, sender_id:, test_params:, request_options: {})
161
173
  #
@@ -16,9 +16,12 @@ module Zavudev
16
16
  # @return [Zavudev::Resources::Senders::Agent::KnowledgeBases]
17
17
  attr_reader :knowledge_bases
18
18
 
19
+ # Some parameter documentations has been truncated, see
20
+ # {Zavudev::Models::Senders::AgentCreateParams} for more details.
21
+ #
19
22
  # Create an AI agent for a sender. Each sender can have at most one agent.
20
23
  #
21
- # @overload create(sender_id, model:, name:, provider:, system_prompt:, api_key: nil, context_window_messages: nil, include_contact_metadata: nil, max_tokens: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, request_options: {})
24
+ # @overload create(sender_id, model:, name:, provider:, system_prompt:, api_key: nil, context_window_messages: nil, include_contact_metadata: nil, max_tokens: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, voice: nil, request_options: {})
22
25
  #
23
26
  # @param sender_id [String]
24
27
  #
@@ -44,6 +47,8 @@ module Zavudev
44
47
  #
45
48
  # @param trigger_on_message_types [Array<String>]
46
49
  #
50
+ # @param voice [Zavudev::Models::Senders::AgentCreateParams::Voice] Voice Agent configuration. Enable this to let the agent answer and place phone c
51
+ #
47
52
  # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
48
53
  #
49
54
  # @return [Zavudev::Models::Senders::AgentResponse]
@@ -79,9 +84,12 @@ module Zavudev
79
84
  )
80
85
  end
81
86
 
87
+ # Some parameter documentations has been truncated, see
88
+ # {Zavudev::Models::Senders::AgentUpdateParams} for more details.
89
+ #
82
90
  # Update an AI agent's configuration.
83
91
  #
84
- # @overload update(sender_id, api_key: nil, context_window_messages: nil, enabled: nil, include_contact_metadata: nil, max_tokens: nil, model: nil, name: nil, provider: nil, system_prompt: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, request_options: {})
92
+ # @overload update(sender_id, api_key: nil, context_window_messages: nil, enabled: nil, include_contact_metadata: nil, max_tokens: nil, model: nil, name: nil, provider: nil, system_prompt: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, voice: nil, request_options: {})
85
93
  #
86
94
  # @param sender_id [String]
87
95
  #
@@ -109,6 +117,8 @@ module Zavudev
109
117
  #
110
118
  # @param trigger_on_message_types [Array<String>]
111
119
  #
120
+ # @param voice [Zavudev::Models::Senders::AgentUpdateParams::Voice] Voice Agent configuration. Patch this object to enable voice, change the greetin
121
+ #
112
122
  # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
113
123
  #
114
124
  # @return [Zavudev::Models::Senders::AgentResponse]
@@ -146,6 +156,12 @@ module Zavudev
146
156
 
147
157
  # Get statistics for an AI agent including invocations, tokens, and costs.
148
158
  #
159
+ # Covers the messaging channels only. Voice calls are not counted here: a call is
160
+ # a multi-turn conversation rather than one inbound message and one reply, so it
161
+ # is recorded as a call, not an execution. An agent that only answers phone calls
162
+ # reports zeros on every field. Use `GET /v1/calls` for voice activity, duration,
163
+ # and cost.
164
+ #
149
165
  # @overload stats(sender_id, request_options: {})
150
166
  #
151
167
  # @param sender_id [String]
@@ -14,7 +14,7 @@ module Zavudev
14
14
  #
15
15
  # Create sender
16
16
  #
17
- # @overload create(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: {})
17
+ # @overload create(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: {})
18
18
  #
19
19
  # @param name [String]
20
20
  #
@@ -26,12 +26,18 @@ module Zavudev
26
26
  #
27
27
  # @param email_receiving_enabled [Boolean] Enable inbound email receiving on this sender. Requires a verified MX record on
28
28
  #
29
- # @param phone_number [String] Phone number in E.164 format. Required for phone-based channels (SMS, WhatsApp).
29
+ # @param enable_sms_oneway [Boolean] Enable the one-way SMS channel (`sms_oneway`). Needs nothing else — no phone num
30
+ #
31
+ # @param enable_voice [Boolean] Let this sender place and answer phone calls. Requires `phoneNumber`; enabling i
32
+ #
33
+ # @param phone_number [String] Phone number in E.164 format, and it must be a number your project already owns
30
34
  #
31
35
  # @param set_as_default [Boolean]
32
36
  #
33
37
  # @param webhook_events [Array<Symbol, Zavudev::Models::WebhookEvent>] Events to subscribe to.
34
38
  #
39
+ # @param webhook_signature_version [Symbol, Zavudev::Models::SenderCreateParams::WebhookSignatureVersion] Which `X-Zavu-Signature` scheme this receiver is sent.
40
+ #
35
41
  # @param webhook_url [String] HTTPS URL for webhook events.
36
42
  #
37
43
  # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -74,7 +80,7 @@ module Zavudev
74
80
  #
75
81
  # Update sender
76
82
  #
77
- # @overload update(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: {})
83
+ # @overload update(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: {})
78
84
  #
79
85
  # @param sender_id [String]
80
86
  #
@@ -88,6 +94,10 @@ module Zavudev
88
94
  #
89
95
  # @param email_receiving_enabled [Boolean] Enable or disable inbound email receiving for this sender.
90
96
  #
97
+ # @param enable_sms_oneway [Boolean] Turn the one-way SMS channel on or off. Enabling needs nothing else and takes ef
98
+ #
99
+ # @param enable_voice [Boolean] Turn the voice channel on or off. The sender must already have a phone number pr
100
+ #
91
101
  # @param name [String]
92
102
  #
93
103
  # @param set_as_default [Boolean]
@@ -96,6 +106,8 @@ module Zavudev
96
106
  #
97
107
  # @param webhook_events [Array<Symbol, Zavudev::Models::WebhookEvent>] Events to subscribe to.
98
108
  #
109
+ # @param webhook_signature_version [Symbol, Zavudev::Models::SenderUpdateParams::WebhookSignatureVersion] Which `X-Zavu-Signature` scheme this receiver is sent.
110
+ #
99
111
  # @param webhook_url [String, nil] HTTPS URL for webhook events. Set to null to remove webhook.
100
112
  #
101
113
  # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zavudev
4
- VERSION = "0.18.0"
4
+ VERSION = "0.20.0"
5
5
  end
@@ -2,10 +2,7 @@
2
2
 
3
3
  module Zavudev
4
4
  module Models
5
- # Delivery channel. Use 'auto' for intelligent routing. `whatsapp_alt` is the
6
- # QR-linked WhatsApp channel and is only accepted for teams with the WhatsApp
7
- # Alternative feature enabled; the sender must have a connected whatsapp_alt
8
- # session.
5
+ # Delivery channel. Use 'auto' for intelligent routing.
9
6
  module Channel
10
7
  extend Zavudev::Internal::Type::Enum
11
8
 
@@ -16,7 +13,6 @@ module Zavudev
16
13
  SMS = T.let(:sms, Zavudev::Channel::TaggedSymbol)
17
14
  SMS_ONEWAY = T.let(:sms_oneway, Zavudev::Channel::TaggedSymbol)
18
15
  WHATSAPP = T.let(:whatsapp, Zavudev::Channel::TaggedSymbol)
19
- WHATSAPP_ALT = T.let(:whatsapp_alt, Zavudev::Channel::TaggedSymbol)
20
16
  TELEGRAM = T.let(:telegram, Zavudev::Channel::TaggedSymbol)
21
17
  EMAIL = T.let(:email, Zavudev::Channel::TaggedSymbol)
22
18
  INSTAGRAM = T.let(:instagram, Zavudev::Channel::TaggedSymbol)
@@ -31,6 +31,27 @@ module Zavudev
31
31
  sig { params(description: String).void }
32
32
  attr_writer :description
33
33
 
34
+ # Which file in `files` is the entry point. Defaults to `index.ts`.
35
+ sig { returns(T.nilable(String)) }
36
+ attr_reader :entrypoint
37
+
38
+ sig { params(entrypoint: String).void }
39
+ attr_writer :entrypoint
40
+
41
+ # The project's source files, keyed by path relative to the project root (e.g.
42
+ # `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
43
+ # function is built, so a function can be split across as many files as it needs.
44
+ #
45
+ # Paths must be relative and use forward slashes; `..`, `node_modules/` and
46
+ # `package.json` are rejected. npm packages are not uploaded here — declare them
47
+ # under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
48
+ # for the whole tree.
49
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
50
+ attr_reader :files
51
+
52
+ sig { params(files: T::Hash[Symbol, String]).void }
53
+ attr_writer :files
54
+
34
55
  # Whether to expose a public HTTPS URL for this function.
35
56
  sig { returns(T.nilable(T::Boolean)) }
36
57
  attr_reader :http_enabled
@@ -61,13 +82,19 @@ module Zavudev
61
82
  end
62
83
  attr_writer :runtime
63
84
 
64
- # TypeScript source code for the function entry point (max ~900KB).
85
+ # Shortcut for a single-file function: exactly equivalent to sending `files` with
86
+ # one entry named after `entrypoint` (`index.ts` by default). Fully supported —
87
+ # use whichever fits. If both are sent, `files` wins.
65
88
  sig { returns(T.nilable(String)) }
66
89
  attr_reader :source_code
67
90
 
68
91
  sig { params(source_code: String).void }
69
92
  attr_writer :source_code
70
93
 
94
+ # Per-invocation timeout in seconds. Event and cron invocations are asynchronous,
95
+ # so a long timeout only bounds cost; a tool called during a live conversation
96
+ # holds up the reply, and a function exposed over HTTP is additionally bounded by
97
+ # the platform's HTTP response limit.
71
98
  sig { returns(T.nilable(Integer)) }
72
99
  attr_reader :timeout_sec
73
100
 
@@ -80,6 +107,8 @@ module Zavudev
80
107
  slug: String,
81
108
  dependencies: T::Hash[Symbol, String],
82
109
  description: String,
110
+ entrypoint: String,
111
+ files: T::Hash[Symbol, String],
83
112
  http_enabled: T::Boolean,
84
113
  memory_mb: Zavudev::FunctionCreateParams::MemoryMB::OrInteger,
85
114
  runtime: Zavudev::FunctionCreateParams::Runtime::OrSymbol,
@@ -95,13 +124,30 @@ module Zavudev
95
124
  # npm dependencies. Keys are package names, values are semver ranges.
96
125
  dependencies: nil,
97
126
  description: nil,
127
+ # Which file in `files` is the entry point. Defaults to `index.ts`.
128
+ entrypoint: nil,
129
+ # The project's source files, keyed by path relative to the project root (e.g.
130
+ # `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
131
+ # function is built, so a function can be split across as many files as it needs.
132
+ #
133
+ # Paths must be relative and use forward slashes; `..`, `node_modules/` and
134
+ # `package.json` are rejected. npm packages are not uploaded here — declare them
135
+ # under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
136
+ # for the whole tree.
137
+ files: nil,
98
138
  # Whether to expose a public HTTPS URL for this function.
99
139
  http_enabled: nil,
100
140
  memory_mb: nil,
101
141
  # Runtime the function is deployed on.
102
142
  runtime: nil,
103
- # TypeScript source code for the function entry point (max ~900KB).
143
+ # Shortcut for a single-file function: exactly equivalent to sending `files` with
144
+ # one entry named after `entrypoint` (`index.ts` by default). Fully supported —
145
+ # use whichever fits. If both are sent, `files` wins.
104
146
  source_code: nil,
147
+ # Per-invocation timeout in seconds. Event and cron invocations are asynchronous,
148
+ # so a long timeout only bounds cost; a tool called during a live conversation
149
+ # holds up the reply, and a function exposed over HTTP is additionally bounded by
150
+ # the platform's HTTP response limit.
105
151
  timeout_sec: nil,
106
152
  request_options: {}
107
153
  )
@@ -114,6 +160,8 @@ module Zavudev
114
160
  slug: String,
115
161
  dependencies: T::Hash[Symbol, String],
116
162
  description: String,
163
+ entrypoint: String,
164
+ files: T::Hash[Symbol, String],
117
165
  http_enabled: T::Boolean,
118
166
  memory_mb: Zavudev::FunctionCreateParams::MemoryMB::OrInteger,
119
167
  runtime: Zavudev::FunctionCreateParams::Runtime::OrSymbol,
@@ -108,7 +108,9 @@ module Zavudev
108
108
  sig { returns(T.nilable(String)) }
109
109
  attr_accessor :description
110
110
 
111
- # HTTPS endpoint when httpEnabled is true.
111
+ # HTTPS endpoint, present only while httpEnabled is true. Null otherwise,
112
+ # including for a function that was previously exposed — the stored URL stops
113
+ # serving the moment HTTP is turned off, so it is never returned.
112
114
  sig { returns(T.nilable(String)) }
113
115
  attr_accessor :public_url
114
116
 
@@ -157,7 +159,9 @@ module Zavudev
157
159
  # ID of the deployment currently serving traffic.
158
160
  active_deployment_id: nil,
159
161
  description: nil,
160
- # HTTPS endpoint when httpEnabled is true.
162
+ # HTTPS endpoint, present only while httpEnabled is true. Null otherwise,
163
+ # including for a function that was previously exposed — the stored URL stops
164
+ # serving the moment HTTP is turned off, so it is never returned.
161
165
  public_url: nil
162
166
  )
163
167
  end
@@ -21,7 +21,30 @@ module Zavudev
21
21
  sig { params(dependencies: T::Hash[Symbol, String]).void }
22
22
  attr_writer :dependencies
23
23
 
24
- # New source code to publish (replaces the draft).
24
+ # Which file in `files` is the entry point. Defaults to `index.ts`.
25
+ sig { returns(T.nilable(String)) }
26
+ attr_reader :entrypoint
27
+
28
+ sig { params(entrypoint: String).void }
29
+ attr_writer :entrypoint
30
+
31
+ # The project's source files, keyed by path relative to the project root (e.g.
32
+ # `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
33
+ # function is built, so a function can be split across as many files as it needs.
34
+ #
35
+ # Paths must be relative and use forward slashes; `..`, `node_modules/` and
36
+ # `package.json` are rejected. npm packages are not uploaded here — declare them
37
+ # under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
38
+ # for the whole tree.
39
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
40
+ attr_reader :files
41
+
42
+ sig { params(files: T::Hash[Symbol, String]).void }
43
+ attr_writer :files
44
+
45
+ # Shortcut for a single-file function: exactly equivalent to sending `files` with
46
+ # one entry named after `entrypoint` (`index.ts` by default). Fully supported —
47
+ # use whichever fits. If both are sent, `files` wins.
25
48
  sig { returns(T.nilable(String)) }
26
49
  attr_reader :source_code
27
50
 
@@ -32,6 +55,8 @@ module Zavudev
32
55
  params(
33
56
  function_id: String,
34
57
  dependencies: T::Hash[Symbol, String],
58
+ entrypoint: String,
59
+ files: T::Hash[Symbol, String],
35
60
  source_code: String,
36
61
  request_options: Zavudev::RequestOptions::OrHash
37
62
  ).returns(T.attached_class)
@@ -40,7 +65,20 @@ module Zavudev
40
65
  function_id:,
41
66
  # New dependency map (replaces existing dependencies).
42
67
  dependencies: nil,
43
- # New source code to publish (replaces the draft).
68
+ # Which file in `files` is the entry point. Defaults to `index.ts`.
69
+ entrypoint: nil,
70
+ # The project's source files, keyed by path relative to the project root (e.g.
71
+ # `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
72
+ # function is built, so a function can be split across as many files as it needs.
73
+ #
74
+ # Paths must be relative and use forward slashes; `..`, `node_modules/` and
75
+ # `package.json` are rejected. npm packages are not uploaded here — declare them
76
+ # under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
77
+ # for the whole tree.
78
+ files: nil,
79
+ # Shortcut for a single-file function: exactly equivalent to sending `files` with
80
+ # one entry named after `entrypoint` (`index.ts` by default). Fully supported —
81
+ # use whichever fits. If both are sent, `files` wins.
44
82
  source_code: nil,
45
83
  request_options: {}
46
84
  )
@@ -51,6 +89,8 @@ module Zavudev
51
89
  {
52
90
  function_id: String,
53
91
  dependencies: T::Hash[Symbol, String],
92
+ entrypoint: String,
93
+ files: T::Hash[Symbol, String],
54
94
  source_code: String,
55
95
  request_options: Zavudev::RequestOptions
56
96
  }
@@ -69,6 +69,15 @@ module Zavudev
69
69
  sig { returns(Integer) }
70
70
  attr_accessor :version
71
71
 
72
+ # What the build printed: dependency installation, the bundler's output, and the
73
+ # compiler's message when it failed. Returned when fetching a single deployment,
74
+ # omitted from the list. Read this first when a deploy fails — `errorMessage` is
75
+ # often the outer wrapper's summary, and the line that names the broken import or
76
+ # the syntax error is here.
77
+ sig { returns(T.nilable(String)) }
78
+ attr_accessor :build_logs
79
+
80
+ # Size of the built bundle in bytes. Null until the build finishes.
72
81
  sig { returns(T.nilable(Integer)) }
73
82
  attr_accessor :bundle_bytes
74
83
 
@@ -79,6 +88,7 @@ module Zavudev
79
88
  sig { returns(T.nilable(String)) }
80
89
  attr_accessor :error_message
81
90
 
91
+ # Total size of the deployed source tree in bytes.
82
92
  sig { returns(T.nilable(Integer)) }
83
93
  attr_accessor :source_code_bytes
84
94
 
@@ -90,6 +100,7 @@ module Zavudev
90
100
  status:
91
101
  Zavudev::Models::FunctionDeployResponse::Deployment::Status::OrSymbol,
92
102
  version: Integer,
103
+ build_logs: T.nilable(String),
93
104
  bundle_bytes: T.nilable(Integer),
94
105
  deployed_at: T.nilable(Time),
95
106
  error_message: T.nilable(String),
@@ -104,10 +115,18 @@ module Zavudev
104
115
  status:,
105
116
  # Monotonically increasing deployment version, starting at 1.
106
117
  version:,
118
+ # What the build printed: dependency installation, the bundler's output, and the
119
+ # compiler's message when it failed. Returned when fetching a single deployment,
120
+ # omitted from the list. Read this first when a deploy fails — `errorMessage` is
121
+ # often the outer wrapper's summary, and the line that names the broken import or
122
+ # the syntax error is here.
123
+ build_logs: nil,
124
+ # Size of the built bundle in bytes. Null until the build finishes.
107
125
  bundle_bytes: nil,
108
126
  deployed_at: nil,
109
127
  # Failure reason when status is 'failed'.
110
128
  error_message: nil,
129
+ # Total size of the deployed source tree in bytes.
111
130
  source_code_bytes: nil
112
131
  )
113
132
  end
@@ -121,6 +140,7 @@ module Zavudev
121
140
  status:
122
141
  Zavudev::Models::FunctionDeployResponse::Deployment::Status::TaggedSymbol,
123
142
  version: Integer,
143
+ build_logs: T.nilable(String),
124
144
  bundle_bytes: T.nilable(Integer),
125
145
  deployed_at: T.nilable(Time),
126
146
  error_message: T.nilable(String),
@@ -74,6 +74,15 @@ module Zavudev
74
74
  sig { returns(Integer) }
75
75
  attr_accessor :version
76
76
 
77
+ # What the build printed: dependency installation, the bundler's output, and the
78
+ # compiler's message when it failed. Returned when fetching a single deployment,
79
+ # omitted from the list. Read this first when a deploy fails — `errorMessage` is
80
+ # often the outer wrapper's summary, and the line that names the broken import or
81
+ # the syntax error is here.
82
+ sig { returns(T.nilable(String)) }
83
+ attr_accessor :build_logs
84
+
85
+ # Size of the built bundle in bytes. Null until the build finishes.
77
86
  sig { returns(T.nilable(Integer)) }
78
87
  attr_accessor :bundle_bytes
79
88
 
@@ -84,6 +93,7 @@ module Zavudev
84
93
  sig { returns(T.nilable(String)) }
85
94
  attr_accessor :error_message
86
95
 
96
+ # Total size of the deployed source tree in bytes.
87
97
  sig { returns(T.nilable(Integer)) }
88
98
  attr_accessor :source_code_bytes
89
99
 
@@ -95,6 +105,7 @@ module Zavudev
95
105
  status:
96
106
  Zavudev::Models::FunctionGetDeploymentResponse::Deployment::Status::OrSymbol,
97
107
  version: Integer,
108
+ build_logs: T.nilable(String),
98
109
  bundle_bytes: T.nilable(Integer),
99
110
  deployed_at: T.nilable(Time),
100
111
  error_message: T.nilable(String),
@@ -109,10 +120,18 @@ module Zavudev
109
120
  status:,
110
121
  # Monotonically increasing deployment version, starting at 1.
111
122
  version:,
123
+ # What the build printed: dependency installation, the bundler's output, and the
124
+ # compiler's message when it failed. Returned when fetching a single deployment,
125
+ # omitted from the list. Read this first when a deploy fails — `errorMessage` is
126
+ # often the outer wrapper's summary, and the line that names the broken import or
127
+ # the syntax error is here.
128
+ build_logs: nil,
129
+ # Size of the built bundle in bytes. Null until the build finishes.
112
130
  bundle_bytes: nil,
113
131
  deployed_at: nil,
114
132
  # Failure reason when status is 'failed'.
115
133
  error_message: nil,
134
+ # Total size of the deployed source tree in bytes.
116
135
  source_code_bytes: nil
117
136
  )
118
137
  end
@@ -126,6 +145,7 @@ module Zavudev
126
145
  status:
127
146
  Zavudev::Models::FunctionGetDeploymentResponse::Deployment::Status::TaggedSymbol,
128
147
  version: Integer,
148
+ build_logs: T.nilable(String),
129
149
  bundle_bytes: T.nilable(Integer),
130
150
  deployed_at: T.nilable(Time),
131
151
  error_message: T.nilable(String),
@@ -108,7 +108,9 @@ module Zavudev
108
108
  sig { returns(T.nilable(String)) }
109
109
  attr_accessor :description
110
110
 
111
- # HTTPS endpoint when httpEnabled is true.
111
+ # HTTPS endpoint, present only while httpEnabled is true. Null otherwise,
112
+ # including for a function that was previously exposed — the stored URL stops
113
+ # serving the moment HTTP is turned off, so it is never returned.
112
114
  sig { returns(T.nilable(String)) }
113
115
  attr_accessor :public_url
114
116
 
@@ -157,7 +159,9 @@ module Zavudev
157
159
  # ID of the deployment currently serving traffic.
158
160
  active_deployment_id: nil,
159
161
  description: nil,
160
- # HTTPS endpoint when httpEnabled is true.
162
+ # HTTPS endpoint, present only while httpEnabled is true. Null otherwise,
163
+ # including for a function that was previously exposed — the stored URL stops
164
+ # serving the moment HTTP is turned off, so it is never returned.
161
165
  public_url: nil
162
166
  )
163
167
  end
@@ -21,7 +21,39 @@ module Zavudev
21
21
  sig { params(dependencies: T::Hash[Symbol, String]).void }
22
22
  attr_writer :dependencies
23
23
 
24
- # New source code to publish (replaces the draft).
24
+ # Which file in `files` is the entry point. Defaults to `index.ts`.
25
+ sig { returns(T.nilable(String)) }
26
+ attr_reader :entrypoint
27
+
28
+ sig { params(entrypoint: String).void }
29
+ attr_writer :entrypoint
30
+
31
+ # The project's source files, keyed by path relative to the project root (e.g.
32
+ # `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
33
+ # function is built, so a function can be split across as many files as it needs.
34
+ #
35
+ # Paths must be relative and use forward slashes; `..`, `node_modules/` and
36
+ # `package.json` are rejected. npm packages are not uploaded here — declare them
37
+ # under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
38
+ # for the whole tree.
39
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
40
+ attr_reader :files
41
+
42
+ sig { params(files: T::Hash[Symbol, String]).void }
43
+ attr_writer :files
44
+
45
+ # Expose the function on its public HTTPS URL, or take it down. Applies to the
46
+ # already-deployed function without redeploying; the URL is returned as
47
+ # `publicUrl`.
48
+ sig { returns(T.nilable(T::Boolean)) }
49
+ attr_reader :http_enabled
50
+
51
+ sig { params(http_enabled: T::Boolean).void }
52
+ attr_writer :http_enabled
53
+
54
+ # Shortcut for a single-file function: exactly equivalent to sending `files` with
55
+ # one entry named after `entrypoint` (`index.ts` by default). Fully supported —
56
+ # use whichever fits. If both are sent, `files` wins.
25
57
  sig { returns(T.nilable(String)) }
26
58
  attr_reader :source_code
27
59
 
@@ -32,6 +64,9 @@ module Zavudev
32
64
  params(
33
65
  function_id: String,
34
66
  dependencies: T::Hash[Symbol, String],
67
+ entrypoint: String,
68
+ files: T::Hash[Symbol, String],
69
+ http_enabled: T::Boolean,
35
70
  source_code: String,
36
71
  request_options: Zavudev::RequestOptions::OrHash
37
72
  ).returns(T.attached_class)
@@ -40,7 +75,24 @@ module Zavudev
40
75
  function_id:,
41
76
  # New dependency map (replaces existing dependencies).
42
77
  dependencies: nil,
43
- # New source code to publish (replaces the draft).
78
+ # Which file in `files` is the entry point. Defaults to `index.ts`.
79
+ entrypoint: nil,
80
+ # The project's source files, keyed by path relative to the project root (e.g.
81
+ # `index.ts`, `lib/orders.ts`). Imports between them are resolved when the
82
+ # function is built, so a function can be split across as many files as it needs.
83
+ #
84
+ # Paths must be relative and use forward slashes; `..`, `node_modules/` and
85
+ # `package.json` are rejected. npm packages are not uploaded here — declare them
86
+ # under `dependencies` and Zavu installs them. Limits: 200 files and 900,000 bytes
87
+ # for the whole tree.
88
+ files: nil,
89
+ # Expose the function on its public HTTPS URL, or take it down. Applies to the
90
+ # already-deployed function without redeploying; the URL is returned as
91
+ # `publicUrl`.
92
+ http_enabled: nil,
93
+ # Shortcut for a single-file function: exactly equivalent to sending `files` with
94
+ # one entry named after `entrypoint` (`index.ts` by default). Fully supported —
95
+ # use whichever fits. If both are sent, `files` wins.
44
96
  source_code: nil,
45
97
  request_options: {}
46
98
  )
@@ -51,6 +103,9 @@ module Zavudev
51
103
  {
52
104
  function_id: String,
53
105
  dependencies: T::Hash[Symbol, String],
106
+ entrypoint: String,
107
+ files: T::Hash[Symbol, String],
108
+ http_enabled: T::Boolean,
54
109
  source_code: String,
55
110
  request_options: Zavudev::RequestOptions
56
111
  }