appwrite 26.0.0 → 27.0.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/authentication_factor.rb +1 -0
- data/lib/appwrite/enums/build_runtime.rb +1 -0
- data/lib/appwrite/enums/database_status.rb +11 -0
- data/lib/appwrite/enums/database_type.rb +3 -0
- data/lib/appwrite/enums/embedding_model.rb +10 -0
- data/lib/appwrite/enums/invalidation_type.rb +9 -0
- data/lib/appwrite/enums/organization_key_scopes.rb +2 -0
- data/lib/appwrite/enums/project_key_scopes.rb +5 -0
- data/lib/appwrite/enums/project_policy_id.rb +1 -0
- data/lib/appwrite/enums/runtime.rb +1 -0
- data/lib/appwrite/models/activity_event.rb +58 -3
- data/lib/appwrite/models/app.rb +152 -0
- data/lib/appwrite/models/app_installation.rb +72 -0
- data/lib/appwrite/models/app_installation_list.rb +32 -0
- data/lib/appwrite/models/app_key.rb +67 -0
- data/lib/appwrite/models/app_key_list.rb +32 -0
- data/lib/appwrite/models/app_scope.rb +47 -0
- data/lib/appwrite/models/app_scope_list.rb +32 -0
- data/lib/appwrite/models/app_secret.rb +67 -0
- data/lib/appwrite/models/app_secret_list.rb +32 -0
- data/lib/appwrite/models/app_secret_plaintext.rb +67 -0
- data/lib/appwrite/models/apps_list.rb +32 -0
- data/lib/appwrite/models/billing_plan.rb +9 -4
- data/lib/appwrite/models/billing_plan_addon.rb +6 -6
- data/lib/appwrite/models/billing_plan_addon_details.rb +1 -1
- data/lib/appwrite/models/database.rb +35 -6
- data/lib/appwrite/models/database_migration.rb +102 -0
- data/lib/appwrite/models/database_migration_list.rb +32 -0
- data/lib/appwrite/models/database_status.rb +92 -0
- data/lib/appwrite/models/database_status_connections.rb +32 -0
- data/lib/appwrite/models/database_status_replica.rb +42 -0
- data/lib/appwrite/models/database_status_volume.rb +42 -0
- data/lib/appwrite/models/dedicated_database.rb +262 -0
- data/lib/appwrite/models/dedicated_database_member.rb +42 -0
- data/lib/appwrite/models/dedicated_database_operation.rb +77 -0
- data/lib/appwrite/models/dedicated_database_operation_list.rb +32 -0
- data/lib/appwrite/models/dedicated_database_replicas.rb +62 -0
- data/lib/appwrite/models/dedicated_database_specification.rb +67 -0
- data/lib/appwrite/models/dedicated_database_specification_list.rb +37 -0
- data/lib/appwrite/models/dedicated_database_specification_pricing.rb +42 -0
- data/lib/appwrite/models/embedding.rb +42 -0
- data/lib/appwrite/models/embedding_list.rb +32 -0
- data/lib/appwrite/models/file.rb +10 -0
- data/lib/appwrite/models/mfa_challenge_secret.rb +47 -0
- data/lib/appwrite/models/mfa_factors.rb +8 -3
- data/lib/appwrite/models/oauth2_approve.rb +27 -0
- data/lib/appwrite/models/oauth2_authorize.rb +32 -0
- data/lib/appwrite/models/oauth2_consent.rb +72 -0
- data/lib/appwrite/models/oauth2_consent_list.rb +32 -0
- data/lib/appwrite/models/oauth2_consent_token.rb +77 -0
- data/lib/appwrite/models/oauth2_consent_token_list.rb +32 -0
- data/lib/appwrite/models/oauth2_device_authorization.rb +52 -0
- data/lib/appwrite/models/oauth2_grant.rb +82 -0
- data/lib/appwrite/models/oauth2_organization.rb +27 -0
- data/lib/appwrite/models/oauth2_organization_list.rb +32 -0
- data/lib/appwrite/models/oauth2_par.rb +32 -0
- data/lib/appwrite/models/oauth2_project.rb +37 -0
- data/lib/appwrite/models/oauth2_project_list.rb +32 -0
- data/lib/appwrite/models/oauth2_reject.rb +27 -0
- data/lib/appwrite/models/oauth2_token.rb +57 -0
- data/lib/appwrite/models/organization.rb +12 -12
- data/lib/appwrite/models/policy_mfa_factors.rb +47 -0
- data/lib/appwrite/models/project.rb +15 -0
- data/lib/appwrite/models/project_auth_method.rb +3 -3
- data/lib/appwrite/models/proxy_invalidation.rb +42 -0
- data/lib/appwrite/models/usage_billing_plan.rb +9 -9
- data/lib/appwrite/services/account.rb +210 -33
- data/lib/appwrite/services/activities.rb +1 -1
- data/lib/appwrite/services/apps.rb +855 -0
- data/lib/appwrite/services/backups.rb +31 -12
- data/lib/appwrite/services/databases.rb +4 -4
- data/lib/appwrite/services/embeddings.rb +48 -0
- data/lib/appwrite/services/functions.rb +1 -1
- data/lib/appwrite/services/oauth2.rb +525 -0
- data/lib/appwrite/services/organization.rb +168 -0
- data/lib/appwrite/services/project.rb +54 -57
- data/lib/appwrite/services/proxy.rb +44 -0
- data/lib/appwrite/services/sites.rb +4 -2
- data/lib/appwrite/services/storage.rb +4 -2
- data/lib/appwrite/services/tables_db.rb +378 -6
- data/lib/appwrite/services/teams.rb +198 -0
- data/lib/appwrite/services/users.rb +38 -0
- data/lib/appwrite.rb +50 -0
- metadata +52 -2
|
@@ -89,6 +89,174 @@ module Appwrite
|
|
|
89
89
|
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
+
# List app installations on the organization. Any organization member can
|
|
93
|
+
# read installations.
|
|
94
|
+
#
|
|
95
|
+
# @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.
|
|
96
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
97
|
+
#
|
|
98
|
+
# @return [AppInstallationList]
|
|
99
|
+
def list_installations(queries: nil, total: nil)
|
|
100
|
+
api_path = '/organization/installations'
|
|
101
|
+
|
|
102
|
+
api_params = {
|
|
103
|
+
queries: queries,
|
|
104
|
+
total: total,
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
api_headers = {
|
|
108
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
109
|
+
"accept": 'application/json',
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@client.call(
|
|
113
|
+
method: 'GET',
|
|
114
|
+
path: api_path,
|
|
115
|
+
headers: api_headers,
|
|
116
|
+
params: api_params,
|
|
117
|
+
response_type: Models::AppInstallationList
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Install an app on the organization. Only organization members with the
|
|
123
|
+
# owner role can install apps. The installation is granted the scopes the app
|
|
124
|
+
# currently requests.
|
|
125
|
+
#
|
|
126
|
+
# @param [String] app_id Application unique ID.
|
|
127
|
+
# @param [String] authorization_details Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. The Appwrite Console stores authorized project IDs here.
|
|
128
|
+
#
|
|
129
|
+
# @return [AppInstallation]
|
|
130
|
+
def create_installation(app_id:, authorization_details: nil)
|
|
131
|
+
api_path = '/organization/installations'
|
|
132
|
+
|
|
133
|
+
if app_id.nil?
|
|
134
|
+
raise Appwrite::Exception.new('Missing required parameter: "appId"')
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
api_params = {
|
|
138
|
+
appId: app_id,
|
|
139
|
+
authorizationDetails: authorization_details,
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
api_headers = {
|
|
143
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
144
|
+
"content-type": 'application/json',
|
|
145
|
+
"accept": 'application/json',
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@client.call(
|
|
149
|
+
method: 'POST',
|
|
150
|
+
path: api_path,
|
|
151
|
+
headers: api_headers,
|
|
152
|
+
params: api_params,
|
|
153
|
+
response_type: Models::AppInstallation
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Get an app installation on the organization by its unique ID. Any
|
|
159
|
+
# organization member can read installations.
|
|
160
|
+
#
|
|
161
|
+
# @param [String] installation_id Installation unique ID.
|
|
162
|
+
#
|
|
163
|
+
# @return [AppInstallation]
|
|
164
|
+
def get_installation(installation_id:)
|
|
165
|
+
api_path = '/organization/installations/{installationId}'
|
|
166
|
+
.gsub('{installationId}', installation_id)
|
|
167
|
+
|
|
168
|
+
if installation_id.nil?
|
|
169
|
+
raise Appwrite::Exception.new('Missing required parameter: "installationId"')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
api_params = {
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
api_headers = {
|
|
176
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
177
|
+
"accept": 'application/json',
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@client.call(
|
|
181
|
+
method: 'GET',
|
|
182
|
+
path: api_path,
|
|
183
|
+
headers: api_headers,
|
|
184
|
+
params: api_params,
|
|
185
|
+
response_type: Models::AppInstallation
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Update an app installation on the organization. Only organization members
|
|
191
|
+
# with the owner role can update installations. The installation's granted
|
|
192
|
+
# scopes are refreshed to the scopes the app currently requests; previously
|
|
193
|
+
# issued installation access tokens are revoked.
|
|
194
|
+
#
|
|
195
|
+
# @param [String] installation_id Installation unique ID.
|
|
196
|
+
# @param [String] authorization_details Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value.
|
|
197
|
+
#
|
|
198
|
+
# @return [AppInstallation]
|
|
199
|
+
def update_installation(installation_id:, authorization_details: nil)
|
|
200
|
+
api_path = '/organization/installations/{installationId}'
|
|
201
|
+
.gsub('{installationId}', installation_id)
|
|
202
|
+
|
|
203
|
+
if installation_id.nil?
|
|
204
|
+
raise Appwrite::Exception.new('Missing required parameter: "installationId"')
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
api_params = {
|
|
208
|
+
authorizationDetails: authorization_details,
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
api_headers = {
|
|
212
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
213
|
+
"content-type": 'application/json',
|
|
214
|
+
"accept": 'application/json',
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@client.call(
|
|
218
|
+
method: 'PUT',
|
|
219
|
+
path: api_path,
|
|
220
|
+
headers: api_headers,
|
|
221
|
+
params: api_params,
|
|
222
|
+
response_type: Models::AppInstallation
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Uninstall an app from the organization by its installation ID. Only
|
|
228
|
+
# organization members with the owner role can remove installations.
|
|
229
|
+
# Previously issued installation access tokens are revoked.
|
|
230
|
+
#
|
|
231
|
+
# @param [String] installation_id Installation unique ID.
|
|
232
|
+
#
|
|
233
|
+
# @return []
|
|
234
|
+
def delete_installation(installation_id:)
|
|
235
|
+
api_path = '/organization/installations/{installationId}'
|
|
236
|
+
.gsub('{installationId}', installation_id)
|
|
237
|
+
|
|
238
|
+
if installation_id.nil?
|
|
239
|
+
raise Appwrite::Exception.new('Missing required parameter: "installationId"')
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
api_params = {
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
api_headers = {
|
|
246
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
247
|
+
"content-type": 'application/json',
|
|
248
|
+
"accept": 'application/json',
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@client.call(
|
|
252
|
+
method: 'DELETE',
|
|
253
|
+
path: api_path,
|
|
254
|
+
headers: api_headers,
|
|
255
|
+
params: api_params,
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
end
|
|
259
|
+
|
|
92
260
|
# Get a list of all API keys from the current organization.
|
|
93
261
|
#
|
|
94
262
|
# @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: expire, accessedAt, name, scopes
|
|
@@ -123,56 +123,6 @@ module Appwrite
|
|
|
123
123
|
|
|
124
124
|
end
|
|
125
125
|
|
|
126
|
-
# Create a new API key. It's recommended to have multiple API keys with
|
|
127
|
-
# strict scopes for separate functions within your project.
|
|
128
|
-
#
|
|
129
|
-
# You can also create an ephemeral API key if you need a short-lived key
|
|
130
|
-
# instead.
|
|
131
|
-
#
|
|
132
|
-
# @param [String] key_id Key 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.
|
|
133
|
-
# @param [String] name Key name. Max length: 128 chars.
|
|
134
|
-
# @param [Array] scopes Key scopes list. Maximum of 200 scopes are allowed.
|
|
135
|
-
# @param [String] expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
|
|
136
|
-
#
|
|
137
|
-
# @return [Key]
|
|
138
|
-
def create_key(key_id:, name:, scopes:, expire: nil)
|
|
139
|
-
api_path = '/project/keys'
|
|
140
|
-
|
|
141
|
-
if key_id.nil?
|
|
142
|
-
raise Appwrite::Exception.new('Missing required parameter: "keyId"')
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
if name.nil?
|
|
146
|
-
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
if scopes.nil?
|
|
150
|
-
raise Appwrite::Exception.new('Missing required parameter: "scopes"')
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
api_params = {
|
|
154
|
-
keyId: key_id,
|
|
155
|
-
name: name,
|
|
156
|
-
scopes: scopes,
|
|
157
|
-
expire: expire,
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
api_headers = {
|
|
161
|
-
"X-Appwrite-Project": @client.get_config('project'),
|
|
162
|
-
"content-type": 'application/json',
|
|
163
|
-
"accept": 'application/json',
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
@client.call(
|
|
167
|
-
method: 'POST',
|
|
168
|
-
path: api_path,
|
|
169
|
-
headers: api_headers,
|
|
170
|
-
params: api_params,
|
|
171
|
-
response_type: Models::Key
|
|
172
|
-
)
|
|
173
|
-
|
|
174
|
-
end
|
|
175
|
-
|
|
176
126
|
# Create a new ephemeral API key. It's recommended to have multiple API keys
|
|
177
127
|
# with strict scopes for separate functions within your project.
|
|
178
128
|
#
|
|
@@ -569,15 +519,17 @@ module Appwrite
|
|
|
569
519
|
# @param [Integer] refresh_token_duration Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year.
|
|
570
520
|
# @param [Integer] public_access_token_duration Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour.
|
|
571
521
|
# @param [Integer] public_refresh_token_duration Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days.
|
|
522
|
+
# @param [Integer] installation_access_token_duration Access token duration in seconds for app installation access tokens. Leave empty to use default 1 hour.
|
|
572
523
|
# @param [] confidential_pkce When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting.
|
|
573
524
|
# @param [String] verification_url URL to your application page where users enter the device flow user code. Required to enable the Device Authorization Grant.
|
|
574
525
|
# @param [Integer] user_code_length Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8.
|
|
575
526
|
# @param [String] user_code_format Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`.
|
|
576
527
|
# @param [Integer] device_code_duration Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600.
|
|
577
528
|
# @param [Array] default_scopes List of OAuth2 scopes used when an authorization request omits the scope parameter. Every default scope must also be allowed by the OAuth2 server. Maximum of 100 scopes are allowed, each up to 128 characters long.
|
|
529
|
+
# @param [Array] installation_scopes List of scopes an application may request when installed on a team. Omitting the parameter clears the list, so no installation scopes can be granted. Maximum of 100 scopes are allowed, each up to 128 characters long.
|
|
578
530
|
#
|
|
579
531
|
# @return [Project]
|
|
580
|
-
def update_o_auth2_server(enabled:, authorization_url:, scopes: nil, authorization_details_types: nil, access_token_duration: nil, refresh_token_duration: nil, public_access_token_duration: nil, public_refresh_token_duration: nil, confidential_pkce: nil, verification_url: nil, user_code_length: nil, user_code_format: nil, device_code_duration: nil, default_scopes: nil)
|
|
532
|
+
def update_o_auth2_server(enabled:, authorization_url:, scopes: nil, authorization_details_types: nil, access_token_duration: nil, refresh_token_duration: nil, public_access_token_duration: nil, public_refresh_token_duration: nil, installation_access_token_duration: nil, confidential_pkce: nil, verification_url: nil, user_code_length: nil, user_code_format: nil, device_code_duration: nil, default_scopes: nil, installation_scopes: nil)
|
|
581
533
|
api_path = '/project/oauth2-server'
|
|
582
534
|
|
|
583
535
|
if enabled.nil?
|
|
@@ -597,12 +549,14 @@ module Appwrite
|
|
|
597
549
|
refreshTokenDuration: refresh_token_duration,
|
|
598
550
|
publicAccessTokenDuration: public_access_token_duration,
|
|
599
551
|
publicRefreshTokenDuration: public_refresh_token_duration,
|
|
552
|
+
installationAccessTokenDuration: installation_access_token_duration,
|
|
600
553
|
confidentialPkce: confidential_pkce,
|
|
601
554
|
verificationUrl: verification_url,
|
|
602
555
|
userCodeLength: user_code_length,
|
|
603
556
|
userCodeFormat: user_code_format,
|
|
604
557
|
deviceCodeDuration: device_code_duration,
|
|
605
558
|
defaultScopes: default_scopes,
|
|
559
|
+
installationScopes: installation_scopes,
|
|
606
560
|
}
|
|
607
561
|
|
|
608
562
|
api_headers = {
|
|
@@ -3049,6 +3003,44 @@ module Appwrite
|
|
|
3049
3003
|
|
|
3050
3004
|
end
|
|
3051
3005
|
|
|
3006
|
+
# Updating this policy allows you to control which factors users can use to
|
|
3007
|
+
# complete an MFA challenge. Disabled factors cannot be used to create a
|
|
3008
|
+
# challenge and are reported as unavailable when listing factors. The custom
|
|
3009
|
+
# factor is disabled by default; enable it to deliver challenge codes through
|
|
3010
|
+
# your own channel. Recovery codes always remain available as a fallback.
|
|
3011
|
+
#
|
|
3012
|
+
# @param [] totp Set to true to allow TOTP to complete an MFA challenge, or false to disable it.
|
|
3013
|
+
# @param [] email Set to true to allow email to complete an MFA challenge, or false to disable it.
|
|
3014
|
+
# @param [] phone Set to true to allow phone (SMS) to complete an MFA challenge, or false to disable it.
|
|
3015
|
+
# @param [] custom Set to true to allow the custom factor to complete an MFA challenge, or false to disable it.
|
|
3016
|
+
#
|
|
3017
|
+
# @return [Project]
|
|
3018
|
+
def update_mfa_factors_policy(totp: nil, email: nil, phone: nil, custom: nil)
|
|
3019
|
+
api_path = '/project/policies/mfa-factors'
|
|
3020
|
+
|
|
3021
|
+
api_params = {
|
|
3022
|
+
totp: totp,
|
|
3023
|
+
email: email,
|
|
3024
|
+
phone: phone,
|
|
3025
|
+
custom: custom,
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3028
|
+
api_headers = {
|
|
3029
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
3030
|
+
"content-type": 'application/json',
|
|
3031
|
+
"accept": 'application/json',
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
@client.call(
|
|
3035
|
+
method: 'PATCH',
|
|
3036
|
+
path: api_path,
|
|
3037
|
+
headers: api_headers,
|
|
3038
|
+
params: api_params,
|
|
3039
|
+
response_type: Models::Project
|
|
3040
|
+
)
|
|
3041
|
+
|
|
3042
|
+
end
|
|
3043
|
+
|
|
3052
3044
|
# Updating this policy allows you to control if new passwords are checked
|
|
3053
3045
|
# against most common passwords dictionary. When enabled, and user changes
|
|
3054
3046
|
# their password, password must not be contained in the dictionary.
|
|
@@ -3093,7 +3085,7 @@ module Appwrite
|
|
|
3093
3085
|
# users, and it will only start to collect and enforce the policy on password
|
|
3094
3086
|
# changes since the policy is enabled.
|
|
3095
3087
|
#
|
|
3096
|
-
# @param [Integer] total Set the password history length per user. Value can be between 1 and
|
|
3088
|
+
# @param [Integer] total Set the password history length per user. Value can be between 1 and 20, or null to disable the limit.
|
|
3097
3089
|
#
|
|
3098
3090
|
# @return [Project]
|
|
3099
3091
|
def update_password_history_policy(total:)
|
|
@@ -3233,7 +3225,7 @@ module Appwrite
|
|
|
3233
3225
|
# Update maximum duration how long sessions created within a project should
|
|
3234
3226
|
# stay active for.
|
|
3235
3227
|
#
|
|
3236
|
-
# @param [Integer] duration Maximum session length in seconds. Minium allowed value is
|
|
3228
|
+
# @param [Integer] duration Maximum session length in seconds. Minium allowed value is 60 seconds, and maximum is 1 year, which is 31536000 seconds.
|
|
3237
3229
|
#
|
|
3238
3230
|
# @return [Project]
|
|
3239
3231
|
def update_session_duration_policy(duration:)
|
|
@@ -3300,7 +3292,7 @@ module Appwrite
|
|
|
3300
3292
|
# Update the maximum number of sessions allowed per user. When the limit is
|
|
3301
3293
|
# hit, the oldest session will be deleted to make room for new one.
|
|
3302
3294
|
#
|
|
3303
|
-
# @param [Integer] total Set the maximum number of sessions allowed per user. Value can be between 1 and
|
|
3295
|
+
# @param [Integer] total Set the maximum number of sessions allowed per user. Value can be between 1 and 100.
|
|
3304
3296
|
#
|
|
3305
3297
|
# @return [Project]
|
|
3306
3298
|
def update_session_limit_policy(total:)
|
|
@@ -3334,7 +3326,7 @@ module Appwrite
|
|
|
3334
3326
|
# amount of existing users already exceeded the limit, all users remain
|
|
3335
3327
|
# active, but new user sign up will be prohibited.
|
|
3336
3328
|
#
|
|
3337
|
-
# @param [Integer] total Set the maximum number of users allowed in the project. Value can be between
|
|
3329
|
+
# @param [Integer] total Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit.
|
|
3338
3330
|
#
|
|
3339
3331
|
# @return [Project]
|
|
3340
3332
|
def update_user_limit_policy(total:)
|
|
@@ -3367,9 +3359,9 @@ module Appwrite
|
|
|
3367
3359
|
# Get a policy by its unique ID. This endpoint returns the current
|
|
3368
3360
|
# configuration for the requested project policy.
|
|
3369
3361
|
#
|
|
3370
|
-
# @param [ProjectPolicyId] policy_id Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email.
|
|
3362
|
+
# @param [ProjectPolicyId] policy_id Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, 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.
|
|
3371
3363
|
#
|
|
3372
|
-
# @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail]
|
|
3364
|
+
# @return [PolicyPasswordDictionary, PolicyPasswordHistory, PolicyPasswordStrength, PolicyPasswordPersonalData, PolicySessionAlert, PolicySessionDuration, PolicySessionInvalidation, PolicySessionLimit, PolicyUserLimit, PolicyMembershipPrivacy, PolicyMfaFactors, PolicyDenyAliasedEmail, PolicyDenyDisposableEmail, PolicyDenyFreeEmail, PolicyDenyCorporateEmail]
|
|
3373
3365
|
def get_policy(policy_id:)
|
|
3374
3366
|
api_path = '/project/policies/{policyId}'
|
|
3375
3367
|
.gsub('{policyId}', policy_id)
|
|
@@ -3447,6 +3439,11 @@ module Appwrite
|
|
|
3447
3439
|
return Models::PolicyMembershipPrivacy.from(map: response)
|
|
3448
3440
|
end
|
|
3449
3441
|
|
|
3442
|
+
if response['$id'] == 'mfa-factors'
|
|
3443
|
+
|
|
3444
|
+
return Models::PolicyMfaFactors.from(map: response)
|
|
3445
|
+
end
|
|
3446
|
+
|
|
3450
3447
|
if response['$id'] == 'deny-aliased-email'
|
|
3451
3448
|
|
|
3452
3449
|
return Models::PolicyDenyAliasedEmail.from(map: response)
|
|
@@ -7,6 +7,50 @@ module Appwrite
|
|
|
7
7
|
@client = client
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
+
# Create a new CDN cache invalidation for a domain. Executes a hard purge of
|
|
11
|
+
# cached content.
|
|
12
|
+
#
|
|
13
|
+
# Depending on type, the invalidation purges a single cache tag, a single URL
|
|
14
|
+
# path, or all cached content for the domain.
|
|
15
|
+
#
|
|
16
|
+
# @param [String] domain Domain name.
|
|
17
|
+
# @param [InvalidationType] type Type of reference passed. Allowed values are: tag, path, all
|
|
18
|
+
# @param [String] reference Reference to invalidate. Depending on type this can be: cache tag name (up to 128 characters), URL path (up to 2048 characters). Not required when type is all.
|
|
19
|
+
#
|
|
20
|
+
# @return [ProxyInvalidation]
|
|
21
|
+
def create_invalidation(domain:, type:, reference: nil)
|
|
22
|
+
api_path = '/proxy/invalidations'
|
|
23
|
+
|
|
24
|
+
if domain.nil?
|
|
25
|
+
raise Appwrite::Exception.new('Missing required parameter: "domain"')
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
if type.nil?
|
|
29
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
api_params = {
|
|
33
|
+
domain: domain,
|
|
34
|
+
type: type,
|
|
35
|
+
reference: reference,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
api_headers = {
|
|
39
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
40
|
+
"content-type": 'application/json',
|
|
41
|
+
"accept": 'application/json',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@client.call(
|
|
45
|
+
method: 'POST',
|
|
46
|
+
path: api_path,
|
|
47
|
+
headers: api_headers,
|
|
48
|
+
params: api_params,
|
|
49
|
+
response_type: Models::ProxyInvalidation
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
|
|
10
54
|
# Get a list of all the proxy rules. You can use the query params to filter
|
|
11
55
|
# your results.
|
|
12
56
|
#
|
|
@@ -155,7 +155,7 @@ module Appwrite
|
|
|
155
155
|
|
|
156
156
|
# List allowed site specifications for this instance.
|
|
157
157
|
#
|
|
158
|
-
# @param [String] type Specification type to list. Can be one of: runtimes, builds.
|
|
158
|
+
# @param [String] type Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes.
|
|
159
159
|
#
|
|
160
160
|
# @return [SpecificationList]
|
|
161
161
|
def list_specifications(type: nil)
|
|
@@ -693,9 +693,10 @@ module Appwrite
|
|
|
693
693
|
# @param [String] site_id Site ID.
|
|
694
694
|
# @param [String] deployment_id Deployment ID.
|
|
695
695
|
# @param [DeploymentDownloadType] type Deployment file to download. Can be: "source", "output".
|
|
696
|
+
# @param [String] token Presigned source-download token for accessing this deployment without a session (jobs-service).
|
|
696
697
|
#
|
|
697
698
|
# @return []
|
|
698
|
-
def get_deployment_download(site_id:, deployment_id:, type: nil)
|
|
699
|
+
def get_deployment_download(site_id:, deployment_id:, type: nil, token: nil)
|
|
699
700
|
api_path = '/sites/{siteId}/deployments/{deploymentId}/download'
|
|
700
701
|
.gsub('{siteId}', site_id)
|
|
701
702
|
.gsub('{deploymentId}', deployment_id)
|
|
@@ -710,6 +711,7 @@ module Appwrite
|
|
|
710
711
|
|
|
711
712
|
api_params = {
|
|
712
713
|
type: type,
|
|
714
|
+
token: token,
|
|
713
715
|
}
|
|
714
716
|
|
|
715
717
|
api_headers = {
|
|
@@ -217,7 +217,7 @@ module Appwrite
|
|
|
217
217
|
# your results.
|
|
218
218
|
#
|
|
219
219
|
# @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).
|
|
220
|
-
# @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: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
|
220
|
+
# @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: name, folder, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
|
221
221
|
# @param [String] search Search term to filter your list results. Max length: 256 chars.
|
|
222
222
|
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
223
223
|
#
|
|
@@ -274,9 +274,10 @@ module Appwrite
|
|
|
274
274
|
# @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.
|
|
275
275
|
# @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).
|
|
276
276
|
# @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).
|
|
277
|
+
# @param [String] folder Virtual folder to place the file in, for example "photos/2026". Nest folders with `/`. Defaults to the bucket root.
|
|
277
278
|
#
|
|
278
279
|
# @return [File]
|
|
279
|
-
def create_file(bucket_id:, file_id:, file:, permissions: nil, on_progress: nil)
|
|
280
|
+
def create_file(bucket_id:, file_id:, file:, permissions: nil, folder: nil, on_progress: nil)
|
|
280
281
|
api_path = '/storage/buckets/{bucketId}/files'
|
|
281
282
|
.gsub('{bucketId}', bucket_id)
|
|
282
283
|
|
|
@@ -296,6 +297,7 @@ module Appwrite
|
|
|
296
297
|
fileId: file_id,
|
|
297
298
|
file: file,
|
|
298
299
|
permissions: permissions,
|
|
300
|
+
folder: folder,
|
|
299
301
|
}
|
|
300
302
|
|
|
301
303
|
api_headers = {
|