appwrite 30.1.0 → 30.2.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.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +16 -2
- data/lib/appwrite/enums/appwrite_migration_resource.rb +1 -0
- data/lib/appwrite/enums/o_auth_provider.rb +2 -0
- data/lib/appwrite/enums/project_key_scopes.rb +6 -0
- data/lib/appwrite/enums/project_o_auth_provider_id.rb +2 -0
- data/lib/appwrite/enums/project_policy_id.rb +1 -0
- data/lib/appwrite/models/activity_event.rb +9 -4
- data/lib/appwrite/models/device.rb +58 -0
- data/lib/appwrite/models/environment.rb +48 -0
- data/lib/appwrite/models/environment_list.rb +33 -0
- data/lib/appwrite/models/o_auth2_vipps.rb +43 -0
- data/lib/appwrite/models/organization.rb +16 -1
- data/lib/appwrite/models/policy_account_devices.rb +33 -0
- data/lib/appwrite/models/project.rb +10 -0
- data/lib/appwrite/models/proxy_rule.rb +11 -1
- data/lib/appwrite/models/session.rb +6 -1
- data/lib/appwrite/models/waf_rule_bypass.rb +8 -3
- data/lib/appwrite/models/waf_rule_challenge.rb +5 -0
- data/lib/appwrite/models/waf_rule_deny.rb +8 -3
- data/lib/appwrite/models/waf_rule_rate_limit.rb +5 -0
- data/lib/appwrite/models/waf_rule_redirect.rb +5 -0
- data/lib/appwrite/services/account.rb +156 -1
- data/lib/appwrite/services/domains.rb +2 -2
- data/lib/appwrite/services/project.rb +217 -20
- data/lib/appwrite/services/proxy.rb +154 -1
- data/lib/appwrite/services/storage.rb +2 -2
- data/lib/appwrite/services/waf.rb +40 -10
- data/lib/appwrite.rb +5 -0
- metadata +7 -2
|
@@ -94,12 +94,13 @@ module Appwrite
|
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
# Get a list of all environments of the project. You can use the query params
|
|
97
|
-
# to filter your results.
|
|
97
|
+
# to filter your results. An environment is listed by its ID, the one passed
|
|
98
|
+
# in the `X-Appwrite-Environment` header to act in it.
|
|
98
99
|
#
|
|
99
|
-
# @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:
|
|
100
|
+
# @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: $id, name, search
|
|
100
101
|
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
101
102
|
#
|
|
102
|
-
# @return [
|
|
103
|
+
# @return [EnvironmentList]
|
|
103
104
|
def list_environments(
|
|
104
105
|
queries: nil,
|
|
105
106
|
total: nil
|
|
@@ -121,13 +122,17 @@ module Appwrite
|
|
|
121
122
|
path: api_path,
|
|
122
123
|
headers: api_headers,
|
|
123
124
|
params: api_params,
|
|
124
|
-
response_type: Models::
|
|
125
|
+
response_type: Models::EnvironmentList
|
|
125
126
|
)
|
|
126
127
|
end
|
|
127
128
|
|
|
128
129
|
# Create a new environment of the project. An environment is a separate
|
|
129
130
|
# project in the same organization and region, with its own resources and
|
|
130
|
-
# users. Its usage is billed under the project it belongs to.
|
|
131
|
+
# users. Its usage is billed under the project it belongs to. Requests act in
|
|
132
|
+
# the environment when they carry the project's ID in the
|
|
133
|
+
# `X-Appwrite-Project` header and the environment's ID in the
|
|
134
|
+
# `X-Appwrite-Environment` header; the environment has no project ID of its
|
|
135
|
+
# own to pass.
|
|
131
136
|
#
|
|
132
137
|
# Pass `resources` to copy the project into the environment. The environment
|
|
133
138
|
# is returned at once and the copy runs as a migration of the environment,
|
|
@@ -137,11 +142,11 @@ module Appwrite
|
|
|
137
142
|
# under its limit of 100 users for test accounts, and the memberships of
|
|
138
143
|
# users left behind are not copied.
|
|
139
144
|
#
|
|
140
|
-
# @param [String] environment_id
|
|
145
|
+
# @param [String] environment_id Environment ID, unique within the project and passed in the `X-Appwrite-Environment` header to act in the environment. Choose a custom ID such as `staging`, or generate a random ID with `ID.unique()`. Valid chars are a-z, 0-9, and hyphen. Can't start with a special char. Max length is 36 chars.
|
|
141
146
|
# @param [String] name Environment name. Max length: 128 chars.
|
|
142
147
|
# @param [Array] resources Resources to copy from the project into the environment, by type. A structural type such as `database`, `table`, `column`, `index`, `bucket`, `team`, `function` or `site` copies the structure and its settings; `row`, `file`, `user`, `membership`, `deployment` and `site-deployment` copy what it holds. A function or site is copied with its active deployment; add `deployment` or `site-deployment` to copy every deployment. Users are copied newest first and at most 90 of them, leaving room under the limit of 100 users of an environment for test accounts; the memberships of users left behind are not copied. Leave empty for an empty environment. Maximum of 100 types.
|
|
143
148
|
#
|
|
144
|
-
# @return [
|
|
149
|
+
# @return [Environment]
|
|
145
150
|
def create_environment(
|
|
146
151
|
environment_id:,
|
|
147
152
|
name:,
|
|
@@ -174,15 +179,16 @@ module Appwrite
|
|
|
174
179
|
path: api_path,
|
|
175
180
|
headers: api_headers,
|
|
176
181
|
params: api_params,
|
|
177
|
-
response_type: Models::
|
|
182
|
+
response_type: Models::Environment
|
|
178
183
|
)
|
|
179
184
|
end
|
|
180
185
|
|
|
181
|
-
# Get an environment of the project by its
|
|
186
|
+
# Get an environment of the project by its ID, the one passed in the
|
|
187
|
+
# `X-Appwrite-Environment` header to act in it.
|
|
182
188
|
#
|
|
183
|
-
# @param [String] environment_id Environment
|
|
189
|
+
# @param [String] environment_id Environment ID.
|
|
184
190
|
#
|
|
185
|
-
# @return [
|
|
191
|
+
# @return [Environment]
|
|
186
192
|
def get_environment(
|
|
187
193
|
environment_id:
|
|
188
194
|
)
|
|
@@ -205,16 +211,17 @@ module Appwrite
|
|
|
205
211
|
path: api_path,
|
|
206
212
|
headers: api_headers,
|
|
207
213
|
params: api_params,
|
|
208
|
-
response_type: Models::
|
|
214
|
+
response_type: Models::Environment
|
|
209
215
|
)
|
|
210
216
|
end
|
|
211
217
|
|
|
212
|
-
# Update the name of an environment of the project.
|
|
218
|
+
# Update the name of an environment of the project. The environment ID cannot
|
|
219
|
+
# be changed.
|
|
213
220
|
#
|
|
214
|
-
# @param [String] environment_id Environment
|
|
221
|
+
# @param [String] environment_id Environment ID.
|
|
215
222
|
# @param [String] name Environment name. Max length: 128 chars.
|
|
216
223
|
#
|
|
217
|
-
# @return [
|
|
224
|
+
# @return [Environment]
|
|
218
225
|
def update_environment(
|
|
219
226
|
environment_id:,
|
|
220
227
|
name:
|
|
@@ -245,13 +252,13 @@ module Appwrite
|
|
|
245
252
|
path: api_path,
|
|
246
253
|
headers: api_headers,
|
|
247
254
|
params: api_params,
|
|
248
|
-
response_type: Models::
|
|
255
|
+
response_type: Models::Environment
|
|
249
256
|
)
|
|
250
257
|
end
|
|
251
258
|
|
|
252
259
|
# Delete an environment of the project, with all of its resources and users.
|
|
253
260
|
#
|
|
254
|
-
# @param [String] environment_id Environment
|
|
261
|
+
# @param [String] environment_id Environment ID.
|
|
255
262
|
#
|
|
256
263
|
# @return []
|
|
257
264
|
def delete_environment(
|
|
@@ -2356,6 +2363,76 @@ module Appwrite
|
|
|
2356
2363
|
)
|
|
2357
2364
|
end
|
|
2358
2365
|
|
|
2366
|
+
# Update the project OAuth2 Vipps MobilePay configuration.
|
|
2367
|
+
#
|
|
2368
|
+
# @param [String] client_id 'Client ID' of Vipps MobilePay OAuth2 app. For example: 9a3a4b3e-0000-0000-0000-0f1a6d1c3b2e
|
|
2369
|
+
# @param [String] client_secret 'Client Secret' of Vipps MobilePay OAuth2 app. For example: Ay1jb000000000000000000000000000000Vx3k
|
|
2370
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
2371
|
+
#
|
|
2372
|
+
# @return [OAuth2Vipps]
|
|
2373
|
+
def update_o_auth2_vipps(
|
|
2374
|
+
client_id: nil,
|
|
2375
|
+
client_secret: nil,
|
|
2376
|
+
enabled: nil
|
|
2377
|
+
)
|
|
2378
|
+
api_path = '/project/oauth2/vipps'
|
|
2379
|
+
|
|
2380
|
+
api_params = {
|
|
2381
|
+
clientId: client_id,
|
|
2382
|
+
clientSecret: client_secret,
|
|
2383
|
+
enabled: enabled,
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
api_headers = {
|
|
2387
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
2388
|
+
"content-type": 'application/json',
|
|
2389
|
+
"accept": 'application/json',
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
@client.call(
|
|
2393
|
+
method: 'PATCH',
|
|
2394
|
+
path: api_path,
|
|
2395
|
+
headers: api_headers,
|
|
2396
|
+
params: api_params,
|
|
2397
|
+
response_type: Models::OAuth2Vipps
|
|
2398
|
+
)
|
|
2399
|
+
end
|
|
2400
|
+
|
|
2401
|
+
# Update the project OAuth2 Vipps MobilePay Sandbox configuration.
|
|
2402
|
+
#
|
|
2403
|
+
# @param [String] client_id 'Client ID' of Vipps MobilePay Sandbox OAuth2 app. For example: 9a3a4b3e-0000-0000-0000-0f1a6d1c3b2e
|
|
2404
|
+
# @param [String] client_secret 'Client Secret' of Vipps MobilePay Sandbox OAuth2 app. For example: Ay1jb000000000000000000000000000000Vx3k
|
|
2405
|
+
# @param [] enabled OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid.
|
|
2406
|
+
#
|
|
2407
|
+
# @return [OAuth2Vipps]
|
|
2408
|
+
def update_o_auth2_vipps_sandbox(
|
|
2409
|
+
client_id: nil,
|
|
2410
|
+
client_secret: nil,
|
|
2411
|
+
enabled: nil
|
|
2412
|
+
)
|
|
2413
|
+
api_path = '/project/oauth2/vippsSandbox'
|
|
2414
|
+
|
|
2415
|
+
api_params = {
|
|
2416
|
+
clientId: client_id,
|
|
2417
|
+
clientSecret: client_secret,
|
|
2418
|
+
enabled: enabled,
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
api_headers = {
|
|
2422
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
2423
|
+
"content-type": 'application/json',
|
|
2424
|
+
"accept": 'application/json',
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
@client.call(
|
|
2428
|
+
method: 'PATCH',
|
|
2429
|
+
path: api_path,
|
|
2430
|
+
headers: api_headers,
|
|
2431
|
+
params: api_params,
|
|
2432
|
+
response_type: Models::OAuth2Vipps
|
|
2433
|
+
)
|
|
2434
|
+
end
|
|
2435
|
+
|
|
2359
2436
|
# Update the project OAuth2 Webflow configuration.
|
|
2360
2437
|
#
|
|
2361
2438
|
# @param [String] client_id 'Client ID' of Webflow OAuth2 app. For example: 8bb20000000000000000000000000000000000000000000000000000000040dd
|
|
@@ -2609,7 +2686,7 @@ module Appwrite
|
|
|
2609
2686
|
#
|
|
2610
2687
|
# @param [ProjectOAuthProviderId] provider_id OAuth2 provider key. For example: github, google, apple.
|
|
2611
2688
|
#
|
|
2612
|
-
# @return [OAuth2Github, OAuth2Discord, OAuth2Figma, OAuth2Dropbox, OAuth2Dailymotion, OAuth2Bitbucket, OAuth2Bitly, OAuth2Box, OAuth2Autodesk, OAuth2Google, OAuth2Zoom, OAuth2Zoho, OAuth2Yandex, OAuth2X, OAuth2WordPress, OAuth2Webflow, OAuth2Twitch, OAuth2Stripe, OAuth2Spotify, OAuth2Slack, OAuth2Podio, OAuth2Notion, OAuth2Salesforce, OAuth2Yahoo, OAuth2HuggingFace, OAuth2Resend, OAuth2Cloudflare, OAuth2Linkedin, OAuth2Disqus, OAuth2Amazon, OAuth2Etsy, OAuth2Facebook, OAuth2Tradeshift, OAuth2Paypal, OAuth2Gitlab, OAuth2Authentik, OAuth2Auth0, OAuth2FusionAuth, OAuth2Keycloak, OAuth2Oidc, OAuth2Apple, OAuth2Okta, OAuth2Kick, OAuth2Microsoft, OAuth2TikTok, OAuth2Kakao]
|
|
2689
|
+
# @return [OAuth2Github, OAuth2Discord, OAuth2Figma, OAuth2Dropbox, OAuth2Dailymotion, OAuth2Bitbucket, OAuth2Bitly, OAuth2Box, OAuth2Autodesk, OAuth2Google, OAuth2Zoom, OAuth2Zoho, OAuth2Yandex, OAuth2X, OAuth2WordPress, OAuth2Webflow, OAuth2Twitch, OAuth2Stripe, OAuth2Spotify, OAuth2Slack, OAuth2Podio, OAuth2Notion, OAuth2Salesforce, OAuth2Yahoo, OAuth2HuggingFace, OAuth2Resend, OAuth2Cloudflare, OAuth2Linkedin, OAuth2Disqus, OAuth2Amazon, OAuth2Etsy, OAuth2Facebook, OAuth2Tradeshift, OAuth2Paypal, OAuth2Gitlab, OAuth2Authentik, OAuth2Auth0, OAuth2FusionAuth, OAuth2Keycloak, OAuth2Oidc, OAuth2Apple, OAuth2Okta, OAuth2Kick, OAuth2Microsoft, OAuth2TikTok, OAuth2Kakao, OAuth2Vipps]
|
|
2613
2690
|
def get_o_auth2_provider(
|
|
2614
2691
|
provider_id:
|
|
2615
2692
|
)
|
|
@@ -2798,11 +2875,21 @@ module Appwrite
|
|
|
2798
2875
|
return Models::OAuth2Facebook.from(map: response)
|
|
2799
2876
|
end
|
|
2800
2877
|
|
|
2878
|
+
if response['$id'] == 'tradeshift'
|
|
2879
|
+
|
|
2880
|
+
return Models::OAuth2Tradeshift.from(map: response)
|
|
2881
|
+
end
|
|
2882
|
+
|
|
2801
2883
|
if response['$id'] == 'tradeshiftBox'
|
|
2802
2884
|
|
|
2803
2885
|
return Models::OAuth2Tradeshift.from(map: response)
|
|
2804
2886
|
end
|
|
2805
2887
|
|
|
2888
|
+
if response['$id'] == 'paypal'
|
|
2889
|
+
|
|
2890
|
+
return Models::OAuth2Paypal.from(map: response)
|
|
2891
|
+
end
|
|
2892
|
+
|
|
2806
2893
|
if response['$id'] == 'paypalSandbox'
|
|
2807
2894
|
|
|
2808
2895
|
return Models::OAuth2Paypal.from(map: response)
|
|
@@ -2868,6 +2955,16 @@ module Appwrite
|
|
|
2868
2955
|
return Models::OAuth2Kakao.from(map: response)
|
|
2869
2956
|
end
|
|
2870
2957
|
|
|
2958
|
+
if response['$id'] == 'vipps'
|
|
2959
|
+
|
|
2960
|
+
return Models::OAuth2Vipps.from(map: response)
|
|
2961
|
+
end
|
|
2962
|
+
|
|
2963
|
+
if response['$id'] == 'vippsSandbox'
|
|
2964
|
+
|
|
2965
|
+
return Models::OAuth2Vipps.from(map: response)
|
|
2966
|
+
end
|
|
2967
|
+
|
|
2871
2968
|
raise Exception, "Unable to match response to any expected response model"
|
|
2872
2969
|
end
|
|
2873
2970
|
|
|
@@ -3519,6 +3616,42 @@ module Appwrite
|
|
|
3519
3616
|
)
|
|
3520
3617
|
end
|
|
3521
3618
|
|
|
3619
|
+
# Update whether account devices are enabled for the project. When enabled, a
|
|
3620
|
+
# browser can create an account device that holds multiple sessions and
|
|
3621
|
+
# switch between them. When disabled, account devices can no longer be
|
|
3622
|
+
# created, so each browser is limited to a single active session.
|
|
3623
|
+
#
|
|
3624
|
+
# @param [] enabled Set to true to allow account devices, or false to disable them for this project.
|
|
3625
|
+
#
|
|
3626
|
+
# @return [Project]
|
|
3627
|
+
def update_account_devices_policy(
|
|
3628
|
+
enabled:
|
|
3629
|
+
)
|
|
3630
|
+
if enabled.nil?
|
|
3631
|
+
raise Appwrite::Exception.new('Missing required parameter: "enabled"')
|
|
3632
|
+
end
|
|
3633
|
+
|
|
3634
|
+
api_path = '/project/policies/account-devices'
|
|
3635
|
+
|
|
3636
|
+
api_params = {
|
|
3637
|
+
enabled: enabled,
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
api_headers = {
|
|
3641
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
3642
|
+
"content-type": 'application/json',
|
|
3643
|
+
"accept": 'application/json',
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
@client.call(
|
|
3647
|
+
method: 'PATCH',
|
|
3648
|
+
path: api_path,
|
|
3649
|
+
headers: api_headers,
|
|
3650
|
+
params: api_params,
|
|
3651
|
+
response_type: Models::Project
|
|
3652
|
+
)
|
|
3653
|
+
end
|
|
3654
|
+
|
|
3522
3655
|
# Configures if aliased emails such as subaddresses and emails with suffixes
|
|
3523
3656
|
# are denied during new users sign-ups and email updates.
|
|
3524
3657
|
#
|
|
@@ -4247,9 +4380,9 @@ module Appwrite
|
|
|
4247
4380
|
# Get a policy by its unique ID. This endpoint returns the current
|
|
4248
4381
|
# configuration for the requested project policy.
|
|
4249
4382
|
#
|
|
4250
|
-
# @param [ProjectPolicyId] policy_id Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, password-pwned, password-rotation, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email, deny-realtime-guests, passkey.
|
|
4383
|
+
# @param [ProjectPolicyId] policy_id Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, password-pwned, password-rotation, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email, deny-realtime-guests, passkey, account-devices.
|
|
4251
4384
|
#
|
|
4252
|
-
# @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicyPasswordPwned, PolicyPasswordRotation, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail, PolicyDenyRealtimeGuests, PolicyPasskey]
|
|
4385
|
+
# @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicyPasswordPwned, PolicyPasswordRotation, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail, PolicyDenyRealtimeGuests, PolicyPasskey, PolicyAccountDevices]
|
|
4253
4386
|
def get_policy(
|
|
4254
4387
|
policy_id:
|
|
4255
4388
|
)
|
|
@@ -4373,9 +4506,73 @@ module Appwrite
|
|
|
4373
4506
|
return Models::PolicyPasskey.from(map: response)
|
|
4374
4507
|
end
|
|
4375
4508
|
|
|
4509
|
+
if response['$id'] == 'account-devices'
|
|
4510
|
+
|
|
4511
|
+
return Models::PolicyAccountDevices.from(map: response)
|
|
4512
|
+
end
|
|
4513
|
+
|
|
4376
4514
|
raise Exception, "Unable to match response to any expected response model"
|
|
4377
4515
|
end
|
|
4378
4516
|
|
|
4517
|
+
# Get the project preferences. Preferences are a key-value object stored on
|
|
4518
|
+
# the project for anyone working on it.
|
|
4519
|
+
#
|
|
4520
|
+
#
|
|
4521
|
+
# @return [Preferences]
|
|
4522
|
+
def get_prefs()
|
|
4523
|
+
api_path = '/project/prefs'
|
|
4524
|
+
|
|
4525
|
+
api_params = {}
|
|
4526
|
+
|
|
4527
|
+
api_headers = {
|
|
4528
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
4529
|
+
"accept": 'application/json',
|
|
4530
|
+
}
|
|
4531
|
+
|
|
4532
|
+
@client.call(
|
|
4533
|
+
method: 'GET',
|
|
4534
|
+
path: api_path,
|
|
4535
|
+
headers: api_headers,
|
|
4536
|
+
params: api_params,
|
|
4537
|
+
response_type: Models::Preferences
|
|
4538
|
+
)
|
|
4539
|
+
end
|
|
4540
|
+
|
|
4541
|
+
# Update the project preferences. The object you pass is stored as is and
|
|
4542
|
+
# replaces any previous value. The maximum allowed prefs size is 64kB and
|
|
4543
|
+
# throws an error if exceeded.
|
|
4544
|
+
#
|
|
4545
|
+
# @param [Hash] prefs Prefs key-value JSON object.
|
|
4546
|
+
#
|
|
4547
|
+
# @return [Preferences]
|
|
4548
|
+
def update_prefs(
|
|
4549
|
+
prefs:
|
|
4550
|
+
)
|
|
4551
|
+
if prefs.nil?
|
|
4552
|
+
raise Appwrite::Exception.new('Missing required parameter: "prefs"')
|
|
4553
|
+
end
|
|
4554
|
+
|
|
4555
|
+
api_path = '/project/prefs'
|
|
4556
|
+
|
|
4557
|
+
api_params = {
|
|
4558
|
+
prefs: prefs,
|
|
4559
|
+
}
|
|
4560
|
+
|
|
4561
|
+
api_headers = {
|
|
4562
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
4563
|
+
"content-type": 'application/json',
|
|
4564
|
+
"accept": 'application/json',
|
|
4565
|
+
}
|
|
4566
|
+
|
|
4567
|
+
@client.call(
|
|
4568
|
+
method: 'PUT',
|
|
4569
|
+
path: api_path,
|
|
4570
|
+
headers: api_headers,
|
|
4571
|
+
params: api_params,
|
|
4572
|
+
response_type: Models::Preferences
|
|
4573
|
+
)
|
|
4574
|
+
end
|
|
4575
|
+
|
|
4379
4576
|
# Update properties of a specific protocol. Use this endpoint to enable or
|
|
4380
4577
|
# disable a protocol in your project.
|
|
4381
4578
|
#
|
|
@@ -386,10 +386,163 @@ module Appwrite
|
|
|
386
386
|
)
|
|
387
387
|
end
|
|
388
388
|
|
|
389
|
+
# Update the function and VCS branch a function proxy rule executes. The rule
|
|
390
|
+
# domain cannot be changed.
|
|
391
|
+
#
|
|
392
|
+
# @param [String] rule_id Rule ID.
|
|
393
|
+
# @param [String] function_id ID of function to be executed.
|
|
394
|
+
# @param [String] branch Name of VCS branch to deploy changes automatically
|
|
395
|
+
#
|
|
396
|
+
# @return [ProxyRule]
|
|
397
|
+
def update_function_rule(
|
|
398
|
+
rule_id:,
|
|
399
|
+
function_id:,
|
|
400
|
+
branch: nil
|
|
401
|
+
)
|
|
402
|
+
if rule_id.nil? || rule_id == ''
|
|
403
|
+
raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
if function_id.nil?
|
|
407
|
+
raise Appwrite::Exception.new('Missing required parameter: "functionId"')
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
api_path = '/proxy/rules/{ruleId}/function'
|
|
411
|
+
.gsub('{ruleId}', @client.encode_path(rule_id))
|
|
412
|
+
|
|
413
|
+
api_params = {
|
|
414
|
+
functionId: function_id,
|
|
415
|
+
branch: branch,
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
api_headers = {
|
|
419
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
420
|
+
"content-type": 'application/json',
|
|
421
|
+
"accept": 'application/json',
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
@client.call(
|
|
425
|
+
method: 'PATCH',
|
|
426
|
+
path: api_path,
|
|
427
|
+
headers: api_headers,
|
|
428
|
+
params: api_params,
|
|
429
|
+
response_type: Models::ProxyRule
|
|
430
|
+
)
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
# Update the target URL, status code and parent resource of a redirect proxy
|
|
434
|
+
# rule. The rule domain cannot be changed.
|
|
435
|
+
#
|
|
436
|
+
# @param [String] rule_id Rule ID.
|
|
437
|
+
# @param [String] url Target URL of redirection
|
|
438
|
+
# @param [StatusCode] status_code Status code of redirection
|
|
439
|
+
# @param [String] resource_id ID of parent resource.
|
|
440
|
+
# @param [ProxyResourceType] resource_type Type of parent resource.
|
|
441
|
+
#
|
|
442
|
+
# @return [ProxyRule]
|
|
443
|
+
def update_redirect_rule(
|
|
444
|
+
rule_id:,
|
|
445
|
+
url:,
|
|
446
|
+
status_code:,
|
|
447
|
+
resource_id:,
|
|
448
|
+
resource_type:
|
|
449
|
+
)
|
|
450
|
+
if rule_id.nil? || rule_id == ''
|
|
451
|
+
raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
if url.nil?
|
|
455
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
if status_code.nil?
|
|
459
|
+
raise Appwrite::Exception.new('Missing required parameter: "statusCode"')
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
if resource_id.nil?
|
|
463
|
+
raise Appwrite::Exception.new('Missing required parameter: "resourceId"')
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
if resource_type.nil?
|
|
467
|
+
raise Appwrite::Exception.new('Missing required parameter: "resourceType"')
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
api_path = '/proxy/rules/{ruleId}/redirect'
|
|
471
|
+
.gsub('{ruleId}', @client.encode_path(rule_id))
|
|
472
|
+
|
|
473
|
+
api_params = {
|
|
474
|
+
url: url,
|
|
475
|
+
statusCode: status_code,
|
|
476
|
+
resourceId: resource_id,
|
|
477
|
+
resourceType: resource_type,
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
api_headers = {
|
|
481
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
482
|
+
"content-type": 'application/json',
|
|
483
|
+
"accept": 'application/json',
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
@client.call(
|
|
487
|
+
method: 'PATCH',
|
|
488
|
+
path: api_path,
|
|
489
|
+
headers: api_headers,
|
|
490
|
+
params: api_params,
|
|
491
|
+
response_type: Models::ProxyRule
|
|
492
|
+
)
|
|
493
|
+
end
|
|
494
|
+
|
|
495
|
+
# Update the site and VCS branch a site proxy rule serves. The rule domain
|
|
496
|
+
# cannot be changed.
|
|
497
|
+
#
|
|
498
|
+
# @param [String] rule_id Rule ID.
|
|
499
|
+
# @param [String] site_id ID of site to be executed.
|
|
500
|
+
# @param [String] branch Name of VCS branch to deploy changes automatically
|
|
501
|
+
#
|
|
502
|
+
# @return [ProxyRule]
|
|
503
|
+
def update_site_rule(
|
|
504
|
+
rule_id:,
|
|
505
|
+
site_id:,
|
|
506
|
+
branch: nil
|
|
507
|
+
)
|
|
508
|
+
if rule_id.nil? || rule_id == ''
|
|
509
|
+
raise Appwrite::Exception.new('Missing required parameter: "ruleId"')
|
|
510
|
+
end
|
|
511
|
+
|
|
512
|
+
if site_id.nil?
|
|
513
|
+
raise Appwrite::Exception.new('Missing required parameter: "siteId"')
|
|
514
|
+
end
|
|
515
|
+
|
|
516
|
+
api_path = '/proxy/rules/{ruleId}/site'
|
|
517
|
+
.gsub('{ruleId}', @client.encode_path(rule_id))
|
|
518
|
+
|
|
519
|
+
api_params = {
|
|
520
|
+
siteId: site_id,
|
|
521
|
+
branch: branch,
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
api_headers = {
|
|
525
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
526
|
+
"content-type": 'application/json',
|
|
527
|
+
"accept": 'application/json',
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
@client.call(
|
|
531
|
+
method: 'PATCH',
|
|
532
|
+
path: api_path,
|
|
533
|
+
headers: api_headers,
|
|
534
|
+
params: api_params,
|
|
535
|
+
response_type: Models::ProxyRule
|
|
536
|
+
)
|
|
537
|
+
end
|
|
538
|
+
|
|
389
539
|
# If not succeeded yet, retry verification process of a proxy rule domain.
|
|
390
540
|
# This endpoint triggers domain verification by checking DNS records. If
|
|
391
541
|
# verification is successful, a TLS certificate will be automatically
|
|
392
|
-
# provisioned for the domain asynchronously in the background.
|
|
542
|
+
# provisioned for the domain asynchronously in the background. A verified
|
|
543
|
+
# rule whose certificate renewal failed or is blocked, or whose certificate
|
|
544
|
+
# expired, is checked the same way, and its certificate renewed in the
|
|
545
|
+
# background.
|
|
393
546
|
#
|
|
394
547
|
# @param [String] rule_id Rule ID.
|
|
395
548
|
#
|
|
@@ -51,7 +51,7 @@ module Appwrite
|
|
|
51
51
|
# @param [Integer] maximum_file_size Maximum file size allowed in bytes. Maximum allowed value is 5GB.
|
|
52
52
|
# @param [Array] allowed_file_extensions Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
|
53
53
|
# @param [Compression] compression Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
|
54
|
-
# @param [] encryption Is encryption enabled?
|
|
54
|
+
# @param [] encryption Is encryption enabled? Files of any size are encrypted.
|
|
55
55
|
# @param [] antivirus Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
|
56
56
|
# @param [] transformations Are image transformations enabled?
|
|
57
57
|
# @param [String] description Optional description for the bucket.
|
|
@@ -156,7 +156,7 @@ module Appwrite
|
|
|
156
156
|
# @param [Integer] maximum_file_size Maximum file size allowed in bytes. Maximum allowed value is 5GB.
|
|
157
157
|
# @param [Array] allowed_file_extensions Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
|
158
158
|
# @param [Compression] compression Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled
|
|
159
|
-
# @param [] encryption Is encryption enabled?
|
|
159
|
+
# @param [] encryption Is encryption enabled? Files of any size are encrypted.
|
|
160
160
|
# @param [] antivirus Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
|
161
161
|
# @param [] transformations Are image transformations enabled?
|
|
162
162
|
# @param [String] description Optional description for the bucket.
|