zavudev 0.9.1 → 0.11.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 (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/zavudev/client.rb +8 -0
  5. data/lib/zavudev/models/contact_delete_params.rb +20 -0
  6. data/lib/zavudev/models/function_create_params.rb +104 -0
  7. data/lib/zavudev/models/function_create_response.rb +168 -0
  8. data/lib/zavudev/models/function_delete_params.rb +20 -0
  9. data/lib/zavudev/models/function_delete_response.rb +28 -0
  10. data/lib/zavudev/models/function_deploy_params.rb +37 -0
  11. data/lib/zavudev/models/function_deploy_response.rb +104 -0
  12. data/lib/zavudev/models/function_get_deployment_params.rb +20 -0
  13. data/lib/zavudev/models/function_get_deployment_response.rb +104 -0
  14. data/lib/zavudev/models/function_retrieve_params.rb +20 -0
  15. data/lib/zavudev/models/function_retrieve_response.rb +168 -0
  16. data/lib/zavudev/models/function_tail_logs_params.rb +58 -0
  17. data/lib/zavudev/models/function_tail_logs_response.rb +41 -0
  18. data/lib/zavudev/models/function_update_params.rb +37 -0
  19. data/lib/zavudev/models/function_update_response.rb +168 -0
  20. data/lib/zavudev/models/functions/secret_list_params.rb +22 -0
  21. data/lib/zavudev/models/functions/secret_list_response.rb +59 -0
  22. data/lib/zavudev/models/functions/secret_set_params.rb +34 -0
  23. data/lib/zavudev/models/functions/secret_set_response.rb +10 -0
  24. data/lib/zavudev/models/functions/secret_unset_params.rb +28 -0
  25. data/lib/zavudev/models/me_retrieve_params.rb +14 -0
  26. data/lib/zavudev/models/me_retrieve_response.rb +85 -0
  27. data/lib/zavudev/models/message_show_typing_params.rb +26 -0
  28. data/lib/zavudev/models/message_show_typing_response.rb +16 -0
  29. data/lib/zavudev/models/senders/agent/execution_retrieve_params.rb +30 -0
  30. data/lib/zavudev/models/senders/agent/execution_retrieve_response.rb +20 -0
  31. data/lib/zavudev/models/webhook_event.rb +9 -0
  32. data/lib/zavudev/models.rb +22 -0
  33. data/lib/zavudev/resources/contacts.rb +24 -0
  34. data/lib/zavudev/resources/functions/secrets.rb +98 -0
  35. data/lib/zavudev/resources/functions.rb +220 -0
  36. data/lib/zavudev/resources/me.rb +33 -0
  37. data/lib/zavudev/resources/messages.rb +31 -0
  38. data/lib/zavudev/resources/senders/agent/executions.rb +26 -0
  39. data/lib/zavudev/version.rb +1 -1
  40. data/lib/zavudev.rb +29 -0
  41. data/rbi/zavudev/client.rbi +6 -0
  42. data/rbi/zavudev/models/contact_delete_params.rbi +35 -0
  43. data/rbi/zavudev/models/function_create_params.rbi +177 -0
  44. data/rbi/zavudev/models/function_create_response.rbi +277 -0
  45. data/rbi/zavudev/models/function_delete_params.rbi +35 -0
  46. data/rbi/zavudev/models/function_delete_response.rbi +44 -0
  47. data/rbi/zavudev/models/function_deploy_params.rbi +63 -0
  48. data/rbi/zavudev/models/function_deploy_response.rbi +196 -0
  49. data/rbi/zavudev/models/function_get_deployment_params.rbi +38 -0
  50. data/rbi/zavudev/models/function_get_deployment_response.rbi +201 -0
  51. data/rbi/zavudev/models/function_retrieve_params.rbi +35 -0
  52. data/rbi/zavudev/models/function_retrieve_response.rbi +277 -0
  53. data/rbi/zavudev/models/function_tail_logs_params.rbi +90 -0
  54. data/rbi/zavudev/models/function_tail_logs_response.rbi +75 -0
  55. data/rbi/zavudev/models/function_update_params.rbi +63 -0
  56. data/rbi/zavudev/models/function_update_response.rbi +277 -0
  57. data/rbi/zavudev/models/functions/secret_list_params.rbi +40 -0
  58. data/rbi/zavudev/models/functions/secret_list_response.rbi +118 -0
  59. data/rbi/zavudev/models/functions/secret_set_params.rbi +53 -0
  60. data/rbi/zavudev/models/functions/secret_set_response.rbi +9 -0
  61. data/rbi/zavudev/models/functions/secret_unset_params.rbi +48 -0
  62. data/rbi/zavudev/models/me_retrieve_params.rbi +27 -0
  63. data/rbi/zavudev/models/me_retrieve_response.rbi +151 -0
  64. data/rbi/zavudev/models/message_show_typing_params.rbi +46 -0
  65. data/rbi/zavudev/models/message_show_typing_response.rbi +26 -0
  66. data/rbi/zavudev/models/senders/agent/execution_retrieve_params.rbi +50 -0
  67. data/rbi/zavudev/models/senders/agent/execution_retrieve_response.rbi +41 -0
  68. data/rbi/zavudev/models/webhook_event.rbi +11 -0
  69. data/rbi/zavudev/models.rbi +22 -0
  70. data/rbi/zavudev/resources/contacts.rbi +15 -0
  71. data/rbi/zavudev/resources/functions/secrets.rbi +69 -0
  72. data/rbi/zavudev/resources/functions.rbi +171 -0
  73. data/rbi/zavudev/resources/me.rbi +22 -0
  74. data/rbi/zavudev/resources/messages.rbi +21 -0
  75. data/rbi/zavudev/resources/senders/agent/executions.rbi +14 -0
  76. data/sig/zavudev/client.rbs +4 -0
  77. data/sig/zavudev/models/contact_delete_params.rbs +23 -0
  78. data/sig/zavudev/models/function_create_params.rbs +107 -0
  79. data/sig/zavudev/models/function_create_response.rbs +126 -0
  80. data/sig/zavudev/models/function_delete_params.rbs +23 -0
  81. data/sig/zavudev/models/function_delete_response.rbs +22 -0
  82. data/sig/zavudev/models/function_deploy_params.rbs +40 -0
  83. data/sig/zavudev/models/function_deploy_response.rbs +98 -0
  84. data/sig/zavudev/models/function_get_deployment_params.rbs +23 -0
  85. data/sig/zavudev/models/function_get_deployment_response.rbs +98 -0
  86. data/sig/zavudev/models/function_retrieve_params.rbs +23 -0
  87. data/sig/zavudev/models/function_retrieve_response.rbs +126 -0
  88. data/sig/zavudev/models/function_tail_logs_params.rbs +61 -0
  89. data/sig/zavudev/models/function_tail_logs_response.rbs +37 -0
  90. data/sig/zavudev/models/function_update_params.rbs +40 -0
  91. data/sig/zavudev/models/function_update_response.rbs +126 -0
  92. data/sig/zavudev/models/functions/secret_list_params.rbs +25 -0
  93. data/sig/zavudev/models/functions/secret_list_response.rbs +70 -0
  94. data/sig/zavudev/models/functions/secret_set_params.rbs +34 -0
  95. data/sig/zavudev/models/functions/secret_set_response.rbs +7 -0
  96. data/sig/zavudev/models/functions/secret_unset_params.rbs +30 -0
  97. data/sig/zavudev/models/me_retrieve_params.rbs +14 -0
  98. data/sig/zavudev/models/me_retrieve_response.rbs +75 -0
  99. data/sig/zavudev/models/message_show_typing_params.rbs +30 -0
  100. data/sig/zavudev/models/message_show_typing_response.rbs +13 -0
  101. data/sig/zavudev/models/senders/agent/execution_retrieve_params.rbs +32 -0
  102. data/sig/zavudev/models/senders/agent/execution_retrieve_response.rbs +18 -0
  103. data/sig/zavudev/models/webhook_event.rbs +4 -0
  104. data/sig/zavudev/models.rbs +22 -0
  105. data/sig/zavudev/resources/contacts.rbs +5 -0
  106. data/sig/zavudev/resources/functions/secrets.rbs +27 -0
  107. data/sig/zavudev/resources/functions.rbs +61 -0
  108. data/sig/zavudev/resources/me.rbs +11 -0
  109. data/sig/zavudev/resources/messages.rbs +6 -0
  110. data/sig/zavudev/resources/senders/agent/executions.rbs +6 -0
  111. metadata +89 -2
@@ -0,0 +1,85 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zavudev
4
+ module Models
5
+ # @see Zavudev::Resources::Me#retrieve
6
+ class MeRetrieveResponse < Zavudev::Internal::Type::BaseModel
7
+ # @!attribute api_key
8
+ #
9
+ # @return [Zavudev::Models::MeRetrieveResponse::APIKey]
10
+ required :api_key, -> { Zavudev::Models::MeRetrieveResponse::APIKey }, api_name: :apiKey
11
+
12
+ # @!attribute is_test_mode
13
+ #
14
+ # @return [Boolean]
15
+ required :is_test_mode, Zavudev::Internal::Type::Boolean, api_name: :isTestMode
16
+
17
+ # @!attribute project
18
+ #
19
+ # @return [Zavudev::Models::MeRetrieveResponse::Project]
20
+ required :project, -> { Zavudev::Models::MeRetrieveResponse::Project }
21
+
22
+ # @!attribute team
23
+ #
24
+ # @return [Zavudev::Models::MeRetrieveResponse::Team]
25
+ required :team, -> { Zavudev::Models::MeRetrieveResponse::Team }
26
+
27
+ # @!method initialize(api_key:, is_test_mode:, project:, team:)
28
+ # @param api_key [Zavudev::Models::MeRetrieveResponse::APIKey]
29
+ # @param is_test_mode [Boolean]
30
+ # @param project [Zavudev::Models::MeRetrieveResponse::Project]
31
+ # @param team [Zavudev::Models::MeRetrieveResponse::Team]
32
+
33
+ # @see Zavudev::Models::MeRetrieveResponse#api_key
34
+ class APIKey < Zavudev::Internal::Type::BaseModel
35
+ # @!attribute id
36
+ #
37
+ # @return [String]
38
+ required :id, String
39
+
40
+ # @!method initialize(id:)
41
+ # @param id [String]
42
+ end
43
+
44
+ # @see Zavudev::Models::MeRetrieveResponse#project
45
+ class Project < Zavudev::Internal::Type::BaseModel
46
+ # @!attribute id
47
+ #
48
+ # @return [String]
49
+ required :id, String
50
+
51
+ # @!attribute is_sub_account
52
+ #
53
+ # @return [Boolean]
54
+ required :is_sub_account, Zavudev::Internal::Type::Boolean, api_name: :isSubAccount
55
+
56
+ # @!attribute name
57
+ #
58
+ # @return [String, nil]
59
+ required :name, String, nil?: true
60
+
61
+ # @!method initialize(id:, is_sub_account:, name:)
62
+ # @param id [String]
63
+ # @param is_sub_account [Boolean]
64
+ # @param name [String, nil]
65
+ end
66
+
67
+ # @see Zavudev::Models::MeRetrieveResponse#team
68
+ class Team < Zavudev::Internal::Type::BaseModel
69
+ # @!attribute id
70
+ #
71
+ # @return [String]
72
+ required :id, String
73
+
74
+ # @!attribute name
75
+ #
76
+ # @return [String, nil]
77
+ required :name, String, nil?: true
78
+
79
+ # @!method initialize(id:, name:)
80
+ # @param id [String]
81
+ # @param name [String, nil]
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zavudev
4
+ module Models
5
+ # @see Zavudev::Resources::Messages#show_typing
6
+ class MessageShowTypingParams < Zavudev::Internal::Type::BaseModel
7
+ extend Zavudev::Internal::Type::RequestParameters::Converter
8
+ include Zavudev::Internal::Type::RequestParameters
9
+
10
+ # @!attribute message_id
11
+ #
12
+ # @return [String]
13
+ required :message_id, String
14
+
15
+ # @!attribute zavu_sender
16
+ #
17
+ # @return [String, nil]
18
+ optional :zavu_sender, String
19
+
20
+ # @!method initialize(message_id:, zavu_sender: nil, request_options: {})
21
+ # @param message_id [String]
22
+ # @param zavu_sender [String]
23
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zavudev
4
+ module Models
5
+ # @see Zavudev::Resources::Messages#show_typing
6
+ class MessageShowTypingResponse < Zavudev::Internal::Type::BaseModel
7
+ # @!attribute success
8
+ #
9
+ # @return [Boolean]
10
+ required :success, Zavudev::Internal::Type::Boolean
11
+
12
+ # @!method initialize(success:)
13
+ # @param success [Boolean]
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zavudev
4
+ module Models
5
+ module Senders
6
+ module Agent
7
+ # @see Zavudev::Resources::Senders::Agent::Executions#retrieve
8
+ class ExecutionRetrieveParams < Zavudev::Internal::Type::BaseModel
9
+ extend Zavudev::Internal::Type::RequestParameters::Converter
10
+ include Zavudev::Internal::Type::RequestParameters
11
+
12
+ # @!attribute sender_id
13
+ #
14
+ # @return [String]
15
+ required :sender_id, String
16
+
17
+ # @!attribute execution_id
18
+ #
19
+ # @return [String]
20
+ required :execution_id, String
21
+
22
+ # @!method initialize(sender_id:, execution_id:, request_options: {})
23
+ # @param sender_id [String]
24
+ # @param execution_id [String]
25
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}]
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zavudev
4
+ module Models
5
+ module Senders
6
+ module Agent
7
+ # @see Zavudev::Resources::Senders::Agent::Executions#retrieve
8
+ class ExecutionRetrieveResponse < Zavudev::Internal::Type::BaseModel
9
+ # @!attribute execution
10
+ #
11
+ # @return [Zavudev::Models::Senders::AgentExecution]
12
+ required :execution, -> { Zavudev::Senders::AgentExecution }
13
+
14
+ # @!method initialize(execution:)
15
+ # @param execution [Zavudev::Models::Senders::AgentExecution]
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -35,6 +35,13 @@ module Zavudev
35
35
  #
36
36
  # - `invitation.status_changed`: A partner invitation status changed (pending,
37
37
  # in_progress, completed, cancelled)
38
+ #
39
+ # **Custom domain events:**
40
+ #
41
+ # - `domain.verified`: A custom email domain passed verification (DKIM, and
42
+ # SPF/DMARC/MAIL FROM if enhanced records are enabled)
43
+ # - `domain.failed`: A custom email domain failed verification or is partially
44
+ # verified
38
45
  module WebhookEvent
39
46
  extend Zavudev::Internal::Type::Enum
40
47
 
@@ -49,6 +56,8 @@ module Zavudev
49
56
  CONVERSATION_NEW = :"conversation.new"
50
57
  TEMPLATE_STATUS_CHANGED = :"template.status_changed"
51
58
  INVITATION_STATUS_CHANGED = :"invitation.status_changed"
59
+ DOMAIN_VERIFIED = :"domain.verified"
60
+ DOMAIN_FAILED = :"domain.failed"
52
61
 
53
62
  # @!method self.values
54
63
  # @return [Array<Symbol>]
@@ -103,6 +103,8 @@ module Zavudev
103
103
 
104
104
  ContactCreateParams = Zavudev::Models::ContactCreateParams
105
105
 
106
+ ContactDeleteParams = Zavudev::Models::ContactDeleteParams
107
+
106
108
  ContactDismissMergeSuggestionParams = Zavudev::Models::ContactDismissMergeSuggestionParams
107
109
 
108
110
  ContactListParams = Zavudev::Models::ContactListParams
@@ -125,6 +127,22 @@ module Zavudev
125
127
 
126
128
  ExportRetrieveParams = Zavudev::Models::ExportRetrieveParams
127
129
 
130
+ FunctionCreateParams = Zavudev::Models::FunctionCreateParams
131
+
132
+ FunctionDeleteParams = Zavudev::Models::FunctionDeleteParams
133
+
134
+ FunctionDeployParams = Zavudev::Models::FunctionDeployParams
135
+
136
+ FunctionGetDeploymentParams = Zavudev::Models::FunctionGetDeploymentParams
137
+
138
+ FunctionRetrieveParams = Zavudev::Models::FunctionRetrieveParams
139
+
140
+ Functions = Zavudev::Models::Functions
141
+
142
+ FunctionTailLogsParams = Zavudev::Models::FunctionTailLogsParams
143
+
144
+ FunctionUpdateParams = Zavudev::Models::FunctionUpdateParams
145
+
128
146
  IntrospectValidatePhoneParams = Zavudev::Models::IntrospectValidatePhoneParams
129
147
 
130
148
  Invitation = Zavudev::Models::Invitation
@@ -139,6 +157,8 @@ module Zavudev
139
157
 
140
158
  LineType = Zavudev::Models::LineType
141
159
 
160
+ MeRetrieveParams = Zavudev::Models::MeRetrieveParams
161
+
142
162
  Message = Zavudev::Models::Message
143
163
 
144
164
  MessageContent = Zavudev::Models::MessageContent
@@ -153,6 +173,8 @@ module Zavudev
153
173
 
154
174
  MessageSendParams = Zavudev::Models::MessageSendParams
155
175
 
176
+ MessageShowTypingParams = Zavudev::Models::MessageShowTypingParams
177
+
156
178
  MessageStatus = Zavudev::Models::MessageStatus
157
179
 
158
180
  MessageType = Zavudev::Models::MessageType
@@ -102,6 +102,30 @@ module Zavudev
102
102
  )
103
103
  end
104
104
 
105
+ # Permanently delete a contact and its communication channels. Implements
106
+ # right-to-erasure obligations under GDPR Art. 17, Ley 19.628 (Chile) Art. 12,
107
+ # CCPA § 1798.105, and LGPD Art. 18.VI. The contact, its channels, and any
108
+ # associated agent flow sessions and conversation threads are removed. Past
109
+ # message records and broadcast delivery logs are retained for billing/audit but
110
+ # no longer reference the deleted contact.
111
+ #
112
+ # @overload delete(contact_id, request_options: {})
113
+ #
114
+ # @param contact_id [String]
115
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
116
+ #
117
+ # @return [nil]
118
+ #
119
+ # @see Zavudev::Models::ContactDeleteParams
120
+ def delete(contact_id, params = {})
121
+ @client.request(
122
+ method: :delete,
123
+ path: ["v1/contacts/%1$s", contact_id],
124
+ model: NilClass,
125
+ options: params[:request_options]
126
+ )
127
+ end
128
+
105
129
  # Dismiss the merge suggestion for a contact.
106
130
  #
107
131
  # @overload dismiss_merge_suggestion(contact_id, request_options: {})
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zavudev
4
+ module Resources
5
+ class Functions
6
+ class Secrets
7
+ # Lists every secret key set on the function. Plaintext is NEVER returned — only
8
+ # the last 4 characters of each value, for visual confirmation.
9
+ #
10
+ # @overload list(function_id, request_options: {})
11
+ #
12
+ # @param function_id [String] Zavu Function ID.
13
+ #
14
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
15
+ #
16
+ # @return [Zavudev::Models::Functions::SecretListResponse]
17
+ #
18
+ # @see Zavudev::Models::Functions::SecretListParams
19
+ def list(function_id, params = {})
20
+ @client.request(
21
+ method: :get,
22
+ path: ["v1/functions/%1$s/secrets", function_id],
23
+ model: Zavudev::Models::Functions::SecretListResponse,
24
+ options: params[:request_options]
25
+ )
26
+ end
27
+
28
+ # Create or update a secret on a function. Marks the function out-of-sync; the
29
+ # next `POST /deploy` re-publishes the Lambda with the new env. Keys must match
30
+ # `[A-Z_][A-Z0-9_]*` (uppercase env-var style) and cannot start with reserved
31
+ # prefixes (AWS*, LAMBDA*, etc).
32
+ #
33
+ # @overload set(key, function_id:, value:, request_options: {})
34
+ #
35
+ # @param key [String] Path param
36
+ #
37
+ # @param function_id [String] Path param: Zavu Function ID.
38
+ #
39
+ # @param value [String] Body param
40
+ #
41
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
42
+ #
43
+ # @return [Object]
44
+ #
45
+ # @see Zavudev::Models::Functions::SecretSetParams
46
+ def set(key, params)
47
+ parsed, options = Zavudev::Functions::SecretSetParams.dump_request(params)
48
+ function_id =
49
+ parsed.delete(:function_id) do
50
+ raise ArgumentError.new("missing required path argument #{_1}")
51
+ end
52
+ @client.request(
53
+ method: :put,
54
+ path: ["v1/functions/%1$s/secrets/%2$s", function_id, key],
55
+ body: parsed,
56
+ model: Zavudev::Internal::Type::Unknown,
57
+ options: options
58
+ )
59
+ end
60
+
61
+ # Remove a secret from a function. Doesn't take effect on the running Lambda until
62
+ # the next deploy.
63
+ #
64
+ # @overload unset(key, function_id:, request_options: {})
65
+ #
66
+ # @param key [String]
67
+ #
68
+ # @param function_id [String] Zavu Function ID.
69
+ #
70
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
71
+ #
72
+ # @return [nil]
73
+ #
74
+ # @see Zavudev::Models::Functions::SecretUnsetParams
75
+ def unset(key, params)
76
+ parsed, options = Zavudev::Functions::SecretUnsetParams.dump_request(params)
77
+ function_id =
78
+ parsed.delete(:function_id) do
79
+ raise ArgumentError.new("missing required path argument #{_1}")
80
+ end
81
+ @client.request(
82
+ method: :delete,
83
+ path: ["v1/functions/%1$s/secrets/%2$s", function_id, key],
84
+ model: NilClass,
85
+ options: options
86
+ )
87
+ end
88
+
89
+ # @api private
90
+ #
91
+ # @param client [Zavudev::Client]
92
+ def initialize(client:)
93
+ @client = client
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,220 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zavudev
4
+ module Resources
5
+ class Functions
6
+ # @return [Zavudev::Resources::Functions::Secrets]
7
+ attr_reader :secrets
8
+
9
+ # Create a new Zavu Function. The function starts in `draft` status. A dedicated
10
+ # API key is auto-provisioned and injected as the `ZAVU_API_KEY` secret so the
11
+ # function can call back into the Zavu API without manual setup.
12
+ #
13
+ # Provide `sourceCode` to seed the draft. Call
14
+ # `POST /v1/functions/{functionId}/deploy` afterwards to publish.
15
+ #
16
+ # @overload create(name:, slug:, dependencies: nil, description: nil, http_enabled: nil, memory_mb: nil, runtime: nil, source_code: nil, timeout_sec: nil, request_options: {})
17
+ #
18
+ # @param name [String]
19
+ #
20
+ # @param slug [String] URL-safe identifier (lowercase, digits, hyphens). Must be unique per project.
21
+ #
22
+ # @param dependencies [Hash{Symbol=>String}] npm dependencies. Keys are package names, values are semver ranges.
23
+ #
24
+ # @param description [String]
25
+ #
26
+ # @param http_enabled [Boolean] Whether to expose a public HTTPS URL for this function.
27
+ #
28
+ # @param memory_mb [Integer, Zavudev::Models::FunctionCreateParams::MemoryMB]
29
+ #
30
+ # @param runtime [Symbol, Zavudev::Models::FunctionCreateParams::Runtime] Runtime the function is deployed on.
31
+ #
32
+ # @param source_code [String] TypeScript source code for the function entry point (max ~900KB).
33
+ #
34
+ # @param timeout_sec [Integer]
35
+ #
36
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
37
+ #
38
+ # @return [Zavudev::Models::FunctionCreateResponse]
39
+ #
40
+ # @see Zavudev::Models::FunctionCreateParams
41
+ def create(params)
42
+ parsed, options = Zavudev::FunctionCreateParams.dump_request(params)
43
+ @client.request(
44
+ method: :post,
45
+ path: "v1/functions",
46
+ body: parsed,
47
+ model: Zavudev::Models::FunctionCreateResponse,
48
+ options: options
49
+ )
50
+ end
51
+
52
+ # Get function
53
+ #
54
+ # @overload retrieve(function_id, request_options: {})
55
+ #
56
+ # @param function_id [String] Zavu Function ID.
57
+ #
58
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
59
+ #
60
+ # @return [Zavudev::Models::FunctionRetrieveResponse]
61
+ #
62
+ # @see Zavudev::Models::FunctionRetrieveParams
63
+ def retrieve(function_id, params = {})
64
+ @client.request(
65
+ method: :get,
66
+ path: ["v1/functions/%1$s", function_id],
67
+ model: Zavudev::Models::FunctionRetrieveResponse,
68
+ options: params[:request_options]
69
+ )
70
+ end
71
+
72
+ # Update the draft source code and/or dependency map without triggering a build.
73
+ # Visible in the dashboard immediately, but the live (deployed) function does not
74
+ # change until `POST /v1/functions/{functionId}/deploy` runs.
75
+ #
76
+ # @overload update(function_id, dependencies: nil, source_code: nil, request_options: {})
77
+ #
78
+ # @param function_id [String] Zavu Function ID.
79
+ #
80
+ # @param dependencies [Hash{Symbol=>String}] New dependency map (replaces existing dependencies).
81
+ #
82
+ # @param source_code [String] New source code to publish (replaces the draft).
83
+ #
84
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
85
+ #
86
+ # @return [Zavudev::Models::FunctionUpdateResponse]
87
+ #
88
+ # @see Zavudev::Models::FunctionUpdateParams
89
+ def update(function_id, params = {})
90
+ parsed, options = Zavudev::FunctionUpdateParams.dump_request(params)
91
+ @client.request(
92
+ method: :patch,
93
+ path: ["v1/functions/%1$s", function_id],
94
+ body: parsed,
95
+ model: Zavudev::Models::FunctionUpdateResponse,
96
+ options: options
97
+ )
98
+ end
99
+
100
+ # Permanently delete a function and cascade: triggers, secrets, deployment
101
+ # history, managed agents+tools, and revoke the auto-provisioned API key. The AWS
102
+ # Lambda + log group are torn down asynchronously.
103
+ #
104
+ # @overload delete(function_id, request_options: {})
105
+ #
106
+ # @param function_id [String] Zavu Function ID.
107
+ #
108
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
109
+ #
110
+ # @return [Zavudev::Models::FunctionDeleteResponse]
111
+ #
112
+ # @see Zavudev::Models::FunctionDeleteParams
113
+ def delete(function_id, params = {})
114
+ @client.request(
115
+ method: :delete,
116
+ path: ["v1/functions/%1$s", function_id],
117
+ model: Zavudev::Models::FunctionDeleteResponse,
118
+ options: params[:request_options]
119
+ )
120
+ end
121
+
122
+ # Publish the function. If `sourceCode` or `dependencies` are provided in the
123
+ # body, they replace the current draft before deployment. Returns immediately with
124
+ # a deployment ID — poll `GET /v1/functions/deployments/{deploymentId}` until
125
+ # status is `active` or `failed`.
126
+ #
127
+ # @overload deploy(function_id, dependencies: nil, source_code: nil, request_options: {})
128
+ #
129
+ # @param function_id [String] Zavu Function ID.
130
+ #
131
+ # @param dependencies [Hash{Symbol=>String}] New dependency map (replaces existing dependencies).
132
+ #
133
+ # @param source_code [String] New source code to publish (replaces the draft).
134
+ #
135
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
136
+ #
137
+ # @return [Zavudev::Models::FunctionDeployResponse]
138
+ #
139
+ # @see Zavudev::Models::FunctionDeployParams
140
+ def deploy(function_id, params = {})
141
+ parsed, options = Zavudev::FunctionDeployParams.dump_request(params)
142
+ @client.request(
143
+ method: :post,
144
+ path: ["v1/functions/%1$s/deploy", function_id],
145
+ body: parsed,
146
+ model: Zavudev::Models::FunctionDeployResponse,
147
+ options: options
148
+ )
149
+ end
150
+
151
+ # Fetch a deployment to poll its status during a deploy.
152
+ #
153
+ # @overload get_deployment(deployment_id, request_options: {})
154
+ #
155
+ # @param deployment_id [String] Function deployment ID.
156
+ #
157
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
158
+ #
159
+ # @return [Zavudev::Models::FunctionGetDeploymentResponse]
160
+ #
161
+ # @see Zavudev::Models::FunctionGetDeploymentParams
162
+ def get_deployment(deployment_id, params = {})
163
+ @client.request(
164
+ method: :get,
165
+ path: ["v1/functions/deployments/%1$s", deployment_id],
166
+ model: Zavudev::Models::FunctionGetDeploymentResponse,
167
+ options: params[:request_options]
168
+ )
169
+ end
170
+
171
+ # Fetch invocation logs for a function. Logs are paginated via `nextToken`. Pass
172
+ # `startTime` / `endTime` (Unix epoch milliseconds) to bound the window, or
173
+ # `filterPattern` to filter messages.
174
+ #
175
+ # @overload tail_logs(function_id, end_time: nil, filter_pattern: nil, limit: nil, next_token: nil, start_time: nil, request_options: {})
176
+ #
177
+ # @param function_id [String] Zavu Function ID.
178
+ #
179
+ # @param end_time [Integer] End of the log window in Unix epoch milliseconds.
180
+ #
181
+ # @param filter_pattern [String]
182
+ #
183
+ # @param limit [Integer]
184
+ #
185
+ # @param next_token [String]
186
+ #
187
+ # @param start_time [Integer] Start of the log window in Unix epoch milliseconds.
188
+ #
189
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
190
+ #
191
+ # @return [Zavudev::Models::FunctionTailLogsResponse]
192
+ #
193
+ # @see Zavudev::Models::FunctionTailLogsParams
194
+ def tail_logs(function_id, params = {})
195
+ parsed, options = Zavudev::FunctionTailLogsParams.dump_request(params)
196
+ query = Zavudev::Internal::Util.encode_query_params(parsed)
197
+ @client.request(
198
+ method: :get,
199
+ path: ["v1/functions/%1$s/logs", function_id],
200
+ query: query.transform_keys(
201
+ end_time: "endTime",
202
+ filter_pattern: "filterPattern",
203
+ next_token: "nextToken",
204
+ start_time: "startTime"
205
+ ),
206
+ model: Zavudev::Models::FunctionTailLogsResponse,
207
+ options: options
208
+ )
209
+ end
210
+
211
+ # @api private
212
+ #
213
+ # @param client [Zavudev::Client]
214
+ def initialize(client:)
215
+ @client = client
216
+ @secrets = Zavudev::Resources::Functions::Secrets.new(client: client)
217
+ end
218
+ end
219
+ end
220
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zavudev
4
+ module Resources
5
+ class Me
6
+ # Returns the project, team, and API key metadata bound to the current Bearer
7
+ # token. Used by CLIs and SDKs to confirm which project they will operate on.
8
+ #
9
+ # @overload retrieve(request_options: {})
10
+ #
11
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
12
+ #
13
+ # @return [Zavudev::Models::MeRetrieveResponse]
14
+ #
15
+ # @see Zavudev::Models::MeRetrieveParams
16
+ def retrieve(params = {})
17
+ @client.request(
18
+ method: :get,
19
+ path: "v1/me",
20
+ model: Zavudev::Models::MeRetrieveResponse,
21
+ options: params[:request_options]
22
+ )
23
+ end
24
+
25
+ # @api private
26
+ #
27
+ # @param client [Zavudev::Client]
28
+ def initialize(client:)
29
+ @client = client
30
+ end
31
+ end
32
+ end
33
+ end
@@ -155,6 +155,37 @@ module Zavudev
155
155
  )
156
156
  end
157
157
 
158
+ # Some parameter documentations has been truncated, see
159
+ # {Zavudev::Models::MessageShowTypingParams} for more details.
160
+ #
161
+ # Mark an inbound WhatsApp message as read and display a typing indicator to the
162
+ # user while you prepare a response. The indicator is automatically dismissed when
163
+ # you send a reply, or after 25 seconds — whichever comes first. Only valid for
164
+ # inbound WhatsApp messages. Use this when a reply will take more than a couple of
165
+ # seconds (LLM agent, tool call, lookup) to improve the recipient's experience.
166
+ #
167
+ # @overload show_typing(message_id, zavu_sender: nil, request_options: {})
168
+ #
169
+ # @param message_id [String]
170
+ #
171
+ # @param zavu_sender [String] Optional sender profile ID. If omitted, the project's default sender will be use
172
+ #
173
+ # @param request_options [Zavudev::RequestOptions, Hash{Symbol=>Object}, nil]
174
+ #
175
+ # @return [Zavudev::Models::MessageShowTypingResponse]
176
+ #
177
+ # @see Zavudev::Models::MessageShowTypingParams
178
+ def show_typing(message_id, params = {})
179
+ parsed, options = Zavudev::MessageShowTypingParams.dump_request(params)
180
+ @client.request(
181
+ method: :post,
182
+ path: ["v1/messages/%1$s/typing", message_id],
183
+ headers: parsed.transform_keys(zavu_sender: "zavu-sender"),
184
+ model: Zavudev::Models::MessageShowTypingResponse,
185
+ options: options
186
+ )
187
+ end
188
+
158
189
  # @api private
159
190
  #
160
191
  # @param client [Zavudev::Client]