appwrite 11.0.2 → 13.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -52,6 +52,7 @@ module Appwrite
52
52
  # @param [] logging Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.
53
53
  # @param [String] entrypoint Entrypoint File. This path is relative to the "providerRootDirectory".
54
54
  # @param [String] commands Build Commands.
55
+ # @param [Array] scopes List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
55
56
  # @param [String] installation_id Appwrite Installation ID for VCS (Version Control System) deployment.
56
57
  # @param [String] provider_repository_id Repository ID of the repo linked to the function.
57
58
  # @param [String] provider_branch Production branch for the repo linked to the function.
@@ -60,10 +61,11 @@ module Appwrite
60
61
  # @param [String] template_repository Repository name of the template.
61
62
  # @param [String] template_owner The name of the owner of the template.
62
63
  # @param [String] template_root_directory Path to function code in the template repo.
63
- # @param [String] template_branch Production branch for the repo linked to the function template.
64
+ # @param [String] template_version Version (tag) for the repo linked to the function template.
65
+ # @param [String] specification Runtime specification for the function and builds.
64
66
  #
65
67
  # @return [Function]
66
- def create(function_id:, name:, runtime:, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil, logging: nil, entrypoint: nil, commands: nil, installation_id: nil, provider_repository_id: nil, provider_branch: nil, provider_silent_mode: nil, provider_root_directory: nil, template_repository: nil, template_owner: nil, template_root_directory: nil, template_branch: nil)
68
+ def create(function_id:, name:, runtime:, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil, logging: nil, entrypoint: nil, commands: nil, scopes: nil, installation_id: nil, provider_repository_id: nil, provider_branch: nil, provider_silent_mode: nil, provider_root_directory: nil, template_repository: nil, template_owner: nil, template_root_directory: nil, template_version: nil, specification: nil)
67
69
  api_path = '/functions'
68
70
 
69
71
  if function_id.nil?
@@ -90,6 +92,7 @@ module Appwrite
90
92
  logging: logging,
91
93
  entrypoint: entrypoint,
92
94
  commands: commands,
95
+ scopes: scopes,
93
96
  installationId: installation_id,
94
97
  providerRepositoryId: provider_repository_id,
95
98
  providerBranch: provider_branch,
@@ -98,7 +101,8 @@ module Appwrite
98
101
  templateRepository: template_repository,
99
102
  templateOwner: template_owner,
100
103
  templateRootDirectory: template_root_directory,
101
- templateBranch: template_branch,
104
+ templateVersion: template_version,
105
+ specification: specification,
102
106
  }
103
107
 
104
108
  api_headers = {
@@ -139,6 +143,31 @@ module Appwrite
139
143
  end
140
144
 
141
145
 
146
+ # List allowed function specifications for this instance.
147
+ #
148
+ #
149
+ #
150
+ # @return [SpecificationList]
151
+ def list_specifications()
152
+ api_path = '/functions/specifications'
153
+
154
+ api_params = {
155
+ }
156
+
157
+ api_headers = {
158
+ "content-type": 'application/json',
159
+ }
160
+
161
+ @client.call(
162
+ method: 'GET',
163
+ path: api_path,
164
+ headers: api_headers,
165
+ params: api_params,
166
+ response_type: Models::SpecificationList
167
+ )
168
+ end
169
+
170
+
142
171
  # Get a function by its unique ID.
143
172
  #
144
173
  # @param [String] function_id Function ID.
@@ -182,14 +211,16 @@ module Appwrite
182
211
  # @param [] logging Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.
183
212
  # @param [String] entrypoint Entrypoint File. This path is relative to the "providerRootDirectory".
184
213
  # @param [String] commands Build Commands.
214
+ # @param [Array] scopes List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
185
215
  # @param [String] installation_id Appwrite Installation ID for VCS (Version Controle System) deployment.
186
216
  # @param [String] provider_repository_id Repository ID of the repo linked to the function
187
217
  # @param [String] provider_branch Production branch for the repo linked to the function
188
218
  # @param [] provider_silent_mode Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
189
219
  # @param [String] provider_root_directory Path to function code in the linked repo.
220
+ # @param [String] specification Runtime specification for the function and builds.
190
221
  #
191
222
  # @return [Function]
192
- def update(function_id:, name:, runtime: nil, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil, logging: nil, entrypoint: nil, commands: nil, installation_id: nil, provider_repository_id: nil, provider_branch: nil, provider_silent_mode: nil, provider_root_directory: nil)
223
+ def update(function_id:, name:, runtime: nil, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil, logging: nil, entrypoint: nil, commands: nil, scopes: nil, installation_id: nil, provider_repository_id: nil, provider_branch: nil, provider_silent_mode: nil, provider_root_directory: nil, specification: nil)
193
224
  api_path = '/functions/{functionId}'
194
225
  .gsub('{functionId}', function_id)
195
226
 
@@ -212,11 +243,13 @@ module Appwrite
212
243
  logging: logging,
213
244
  entrypoint: entrypoint,
214
245
  commands: commands,
246
+ scopes: scopes,
215
247
  installationId: installation_id,
216
248
  providerRepositoryId: provider_repository_id,
217
249
  providerBranch: provider_branch,
218
250
  providerSilentMode: provider_silent_mode,
219
251
  providerRootDirectory: provider_root_directory,
252
+ specification: specification,
220
253
  }
221
254
 
222
255
  api_headers = {
@@ -266,7 +299,7 @@ module Appwrite
266
299
  # params to filter your results.
267
300
  #
268
301
  # @param [String] function_id Function ID.
269
- # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: size, buildId, activate, entrypoint, commands
302
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: size, buildId, activate, entrypoint, commands, type, size
270
303
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
271
304
  #
272
305
  # @return [DeploymentList]
@@ -466,19 +499,17 @@ module Appwrite
466
499
  end
467
500
 
468
501
 
469
- # Create a new build for an Appwrite Function deployment. This endpoint can
470
- # be used to retry a failed build.
502
+ #
471
503
  #
472
504
  # @param [String] function_id Function ID.
473
505
  # @param [String] deployment_id Deployment ID.
474
506
  # @param [String] build_id Build unique ID.
475
507
  #
476
508
  # @return []
477
- def create_build(function_id:, deployment_id:, build_id:)
478
- api_path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'
509
+ def create_build(function_id:, deployment_id:, build_id: nil)
510
+ api_path = '/functions/{functionId}/deployments/{deploymentId}/build'
479
511
  .gsub('{functionId}', function_id)
480
512
  .gsub('{deploymentId}', deployment_id)
481
- .gsub('{buildId}', build_id)
482
513
 
483
514
  if function_id.nil?
484
515
  raise Appwrite::Exception.new('Missing required parameter: "functionId"')
@@ -488,8 +519,40 @@ module Appwrite
488
519
  raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
489
520
  end
490
521
 
491
- if build_id.nil?
492
- raise Appwrite::Exception.new('Missing required parameter: "buildId"')
522
+ api_params = {
523
+ buildId: build_id,
524
+ }
525
+
526
+ api_headers = {
527
+ "content-type": 'application/json',
528
+ }
529
+
530
+ @client.call(
531
+ method: 'POST',
532
+ path: api_path,
533
+ headers: api_headers,
534
+ params: api_params,
535
+ )
536
+ end
537
+
538
+
539
+ #
540
+ #
541
+ # @param [String] function_id Function ID.
542
+ # @param [String] deployment_id Deployment ID.
543
+ #
544
+ # @return [Build]
545
+ def update_deployment_build(function_id:, deployment_id:)
546
+ api_path = '/functions/{functionId}/deployments/{deploymentId}/build'
547
+ .gsub('{functionId}', function_id)
548
+ .gsub('{deploymentId}', deployment_id)
549
+
550
+ if function_id.nil?
551
+ raise Appwrite::Exception.new('Missing required parameter: "functionId"')
552
+ end
553
+
554
+ if deployment_id.nil?
555
+ raise Appwrite::Exception.new('Missing required parameter: "deploymentId"')
493
556
  end
494
557
 
495
558
  api_params = {
@@ -500,10 +563,11 @@ module Appwrite
500
563
  }
501
564
 
502
565
  @client.call(
503
- method: 'POST',
566
+ method: 'PATCH',
504
567
  path: api_path,
505
568
  headers: api_headers,
506
569
  params: api_params,
570
+ response_type: Models::Build
507
571
  )
508
572
  end
509
573
 
@@ -515,7 +579,7 @@ module Appwrite
515
579
  # @param [String] deployment_id Deployment ID.
516
580
  #
517
581
  # @return []
518
- def download_deployment(function_id:, deployment_id:)
582
+ def get_deployment_download(function_id:, deployment_id:)
519
583
  api_path = '/functions/{functionId}/deployments/{deploymentId}/download'
520
584
  .gsub('{functionId}', function_id)
521
585
  .gsub('{deploymentId}', deployment_id)
@@ -548,7 +612,7 @@ module Appwrite
548
612
  # query params to filter your results.
549
613
  #
550
614
  # @param [String] function_id Function ID.
551
- # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration
615
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
552
616
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
553
617
  #
554
618
  # @return [ExecutionList]
@@ -590,9 +654,10 @@ module Appwrite
590
654
  # @param [String] xpath HTTP path of execution. Path can include query params. Default value is /
591
655
  # @param [ExecutionMethod] method HTTP method of execution. Default value is GET.
592
656
  # @param [Hash] headers HTTP headers of execution. Defaults to empty.
657
+ # @param [String] scheduled_at Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
593
658
  #
594
659
  # @return [Execution]
595
- def create_execution(function_id:, body: nil, async: nil, xpath: nil, method: nil, headers: nil)
660
+ def create_execution(function_id:, body: nil, async: nil, xpath: nil, method: nil, headers: nil, scheduled_at: nil)
596
661
  api_path = '/functions/{functionId}/executions'
597
662
  .gsub('{functionId}', function_id)
598
663
 
@@ -606,6 +671,7 @@ module Appwrite
606
671
  path: xpath,
607
672
  method: method,
608
673
  headers: headers,
674
+ scheduledAt: scheduled_at,
609
675
  }
610
676
 
611
677
  api_headers = {
@@ -658,6 +724,42 @@ module Appwrite
658
724
  end
659
725
 
660
726
 
727
+ # Delete a function execution by its unique ID.
728
+ #
729
+ #
730
+ # @param [String] function_id Function ID.
731
+ # @param [String] execution_id Execution ID.
732
+ #
733
+ # @return []
734
+ def delete_execution(function_id:, execution_id:)
735
+ api_path = '/functions/{functionId}/executions/{executionId}'
736
+ .gsub('{functionId}', function_id)
737
+ .gsub('{executionId}', execution_id)
738
+
739
+ if function_id.nil?
740
+ raise Appwrite::Exception.new('Missing required parameter: "functionId"')
741
+ end
742
+
743
+ if execution_id.nil?
744
+ raise Appwrite::Exception.new('Missing required parameter: "executionId"')
745
+ end
746
+
747
+ api_params = {
748
+ }
749
+
750
+ api_headers = {
751
+ "content-type": 'application/json',
752
+ }
753
+
754
+ @client.call(
755
+ method: 'DELETE',
756
+ path: api_path,
757
+ headers: api_headers,
758
+ params: api_params,
759
+ )
760
+ end
761
+
762
+
661
763
  # Get a list of all variables of a specific function.
662
764
  #
663
765
  # @param [String] function_id Function unique ID.
@@ -256,7 +256,7 @@ module Appwrite
256
256
  #
257
257
  # @param [String] bucket_id Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
258
258
  # @param [String] file_id File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
259
- # @param [file] file Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/storage#file-input).
259
+ # @param [file] file Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).
260
260
  # @param [Array] permissions An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
261
261
  #
262
262
  # @return [File]
@@ -173,7 +173,8 @@ module Appwrite
173
173
 
174
174
 
175
175
  # Use this endpoint to list a team's members using the team's ID. All team
176
- # members have read access to this endpoint.
176
+ # members have read access to this endpoint. Hide sensitive attributes from
177
+ # the response by toggling membership privacy in the Console.
177
178
  #
178
179
  # @param [String] team_id Team ID.
179
180
  # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm
@@ -234,7 +235,7 @@ module Appwrite
234
235
  # @param [String] email Email of the new team member.
235
236
  # @param [String] user_id ID of the user to be added to a team.
236
237
  # @param [String] phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
237
- # @param [String] url URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
238
+ # @param [String] url URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
238
239
  # @param [String] name Name of the new team member. Max length: 128 chars.
239
240
  #
240
241
  # @return [Membership]
@@ -274,7 +275,8 @@ module Appwrite
274
275
 
275
276
 
276
277
  # Get a team member by the membership unique id. All team members have read
277
- # access for this resource.
278
+ # access for this resource. Hide sensitive attributes from the response by
279
+ # toggling membership privacy in the Console.
278
280
  #
279
281
  # @param [String] team_id Team ID.
280
282
  # @param [String] membership_id Membership ID.
@@ -611,6 +611,42 @@ module Appwrite
611
611
  end
612
612
 
613
613
 
614
+ # Use this endpoint to create a JSON Web Token for user by its unique ID. You
615
+ # can use the resulting JWT to authenticate on behalf of the user. The JWT
616
+ # secret will become invalid if the session it uses gets deleted.
617
+ #
618
+ # @param [String] user_id User ID.
619
+ # @param [String] session_id Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.
620
+ # @param [Integer] duration Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
621
+ #
622
+ # @return [Jwt]
623
+ def create_jwt(user_id:, session_id: nil, duration: nil)
624
+ api_path = '/users/{userId}/jwts'
625
+ .gsub('{userId}', user_id)
626
+
627
+ if user_id.nil?
628
+ raise Appwrite::Exception.new('Missing required parameter: "userId"')
629
+ end
630
+
631
+ api_params = {
632
+ sessionId: session_id,
633
+ duration: duration,
634
+ }
635
+
636
+ api_headers = {
637
+ "content-type": 'application/json',
638
+ }
639
+
640
+ @client.call(
641
+ method: 'POST',
642
+ path: api_path,
643
+ headers: api_headers,
644
+ params: api_params,
645
+ response_type: Models::Jwt
646
+ )
647
+ end
648
+
649
+
614
650
  # Update the user labels by its unique ID.
615
651
  #
616
652
  # Labels can be used to grant access to resources. While teams are a way for
data/lib/appwrite.rb CHANGED
@@ -40,6 +40,7 @@ require_relative 'appwrite/models/message_list'
40
40
  require_relative 'appwrite/models/topic_list'
41
41
  require_relative 'appwrite/models/subscriber_list'
42
42
  require_relative 'appwrite/models/target_list'
43
+ require_relative 'appwrite/models/specification_list'
43
44
  require_relative 'appwrite/models/database'
44
45
  require_relative 'appwrite/models/collection'
45
46
  require_relative 'appwrite/models/attribute_list'
@@ -79,6 +80,7 @@ require_relative 'appwrite/models/function'
79
80
  require_relative 'appwrite/models/runtime'
80
81
  require_relative 'appwrite/models/deployment'
81
82
  require_relative 'appwrite/models/execution'
83
+ require_relative 'appwrite/models/build'
82
84
  require_relative 'appwrite/models/variable'
83
85
  require_relative 'appwrite/models/country'
84
86
  require_relative 'appwrite/models/continent'
@@ -91,6 +93,7 @@ require_relative 'appwrite/models/health_status'
91
93
  require_relative 'appwrite/models/health_certificate'
92
94
  require_relative 'appwrite/models/health_time'
93
95
  require_relative 'appwrite/models/headers'
96
+ require_relative 'appwrite/models/specification'
94
97
  require_relative 'appwrite/models/mfa_challenge'
95
98
  require_relative 'appwrite/models/mfa_recovery_codes'
96
99
  require_relative 'appwrite/models/mfa_type'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.2
4
+ version: 13.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Appwrite Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-17 00:00:00.000000000 Z
11
+ date: 2024-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -73,6 +73,7 @@ files:
73
73
  - lib/appwrite/models/attribute_url.rb
74
74
  - lib/appwrite/models/bucket.rb
75
75
  - lib/appwrite/models/bucket_list.rb
76
+ - lib/appwrite/models/build.rb
76
77
  - lib/appwrite/models/collection.rb
77
78
  - lib/appwrite/models/collection_list.rb
78
79
  - lib/appwrite/models/continent.rb
@@ -128,6 +129,8 @@ files:
128
129
  - lib/appwrite/models/runtime_list.rb
129
130
  - lib/appwrite/models/session.rb
130
131
  - lib/appwrite/models/session_list.rb
132
+ - lib/appwrite/models/specification.rb
133
+ - lib/appwrite/models/specification_list.rb
131
134
  - lib/appwrite/models/subscriber.rb
132
135
  - lib/appwrite/models/subscriber_list.rb
133
136
  - lib/appwrite/models/target.rb