appwrite 26.0.0 → 26.1.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 +1 -1
- data/lib/appwrite/enums/database_status.rb +11 -0
- data/lib/appwrite/enums/database_type.rb +3 -0
- data/lib/appwrite/enums/organization_key_scopes.rb +2 -0
- data/lib/appwrite/enums/project_key_scopes.rb +3 -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 +5 -0
- data/lib/appwrite/models/database.rb +35 -6
- data/lib/appwrite/models/database_status.rb +62 -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 +267 -0
- data/lib/appwrite/models/dedicated_database_member.rb +42 -0
- data/lib/appwrite/models/dedicated_database_replicas.rb +37 -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 +47 -0
- 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/project.rb +10 -0
- data/lib/appwrite/models/project_auth_method.rb +3 -3
- data/lib/appwrite/services/account.rb +209 -0
- data/lib/appwrite/services/apps.rb +813 -0
- data/lib/appwrite/services/backups.rb +25 -12
- data/lib/appwrite/services/oauth2.rb +525 -0
- data/lib/appwrite/services/organization.rb +168 -0
- data/lib/appwrite/services/project.rb +3 -1
- data/lib/appwrite/services/sites.rb +3 -1
- data/lib/appwrite/services/tables_db.rb +134 -2
- data/lib/appwrite/services/teams.rb +198 -0
- data/lib/appwrite.rb +38 -0
- metadata +40 -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
|
|
@@ -569,6 +569,7 @@ module Appwrite
|
|
|
569
569
|
# @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
570
|
# @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
571
|
# @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.
|
|
572
|
+
# @param [Integer] installation_access_token_duration Access token duration in seconds for app installation access tokens. Leave empty to use default 1 hour.
|
|
572
573
|
# @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
574
|
# @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
575
|
# @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.
|
|
@@ -577,7 +578,7 @@ module Appwrite
|
|
|
577
578
|
# @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.
|
|
578
579
|
#
|
|
579
580
|
# @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)
|
|
581
|
+
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)
|
|
581
582
|
api_path = '/project/oauth2-server'
|
|
582
583
|
|
|
583
584
|
if enabled.nil?
|
|
@@ -597,6 +598,7 @@ module Appwrite
|
|
|
597
598
|
refreshTokenDuration: refresh_token_duration,
|
|
598
599
|
publicAccessTokenDuration: public_access_token_duration,
|
|
599
600
|
publicRefreshTokenDuration: public_refresh_token_duration,
|
|
601
|
+
installationAccessTokenDuration: installation_access_token_duration,
|
|
600
602
|
confidentialPkce: confidential_pkce,
|
|
601
603
|
verificationUrl: verification_url,
|
|
602
604
|
userCodeLength: user_code_length,
|
|
@@ -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 = {
|
|
@@ -46,9 +46,10 @@ module Appwrite
|
|
|
46
46
|
# @param [String] name Database name. Max length: 128 chars.
|
|
47
47
|
# @param [] enabled Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
|
|
48
48
|
# @param [String] specification Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification.
|
|
49
|
+
# @param [Integer] replicas Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0.
|
|
49
50
|
#
|
|
50
51
|
# @return [Database]
|
|
51
|
-
def create(database_id:, name:, enabled: nil, specification: nil)
|
|
52
|
+
def create(database_id:, name:, enabled: nil, specification: nil, replicas: nil)
|
|
52
53
|
api_path = '/tablesdb'
|
|
53
54
|
|
|
54
55
|
if database_id.nil?
|
|
@@ -64,6 +65,7 @@ module Appwrite
|
|
|
64
65
|
name: name,
|
|
65
66
|
enabled: enabled,
|
|
66
67
|
specification: specification,
|
|
68
|
+
replicas: replicas,
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
api_headers = {
|
|
@@ -82,6 +84,33 @@ module Appwrite
|
|
|
82
84
|
|
|
83
85
|
end
|
|
84
86
|
|
|
87
|
+
# List the dedicated database specifications available on the current plan.
|
|
88
|
+
# Each specification reports its resource limits, pricing, and whether it is
|
|
89
|
+
# enabled for the organization.
|
|
90
|
+
#
|
|
91
|
+
#
|
|
92
|
+
# @return [DedicatedDatabaseSpecificationList]
|
|
93
|
+
def list_specifications()
|
|
94
|
+
api_path = '/tablesdb/specifications'
|
|
95
|
+
|
|
96
|
+
api_params = {
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
api_headers = {
|
|
100
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
101
|
+
"accept": 'application/json',
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@client.call(
|
|
105
|
+
method: 'GET',
|
|
106
|
+
path: api_path,
|
|
107
|
+
headers: api_headers,
|
|
108
|
+
params: api_params,
|
|
109
|
+
response_type: Models::DedicatedDatabaseSpecificationList
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
end
|
|
113
|
+
|
|
85
114
|
# List transactions across all databases.
|
|
86
115
|
#
|
|
87
116
|
# @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).
|
|
@@ -305,9 +334,10 @@ module Appwrite
|
|
|
305
334
|
# @param [String] database_id Database ID.
|
|
306
335
|
# @param [String] name Database name. Max length: 128 chars.
|
|
307
336
|
# @param [] enabled Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
|
|
337
|
+
# @param [Integer] replicas Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0.
|
|
308
338
|
#
|
|
309
339
|
# @return [Database]
|
|
310
|
-
def update(database_id:, name: nil, enabled: nil)
|
|
340
|
+
def update(database_id:, name: nil, enabled: nil, replicas: nil)
|
|
311
341
|
api_path = '/tablesdb/{databaseId}'
|
|
312
342
|
.gsub('{databaseId}', database_id)
|
|
313
343
|
|
|
@@ -318,6 +348,7 @@ module Appwrite
|
|
|
318
348
|
api_params = {
|
|
319
349
|
name: name,
|
|
320
350
|
enabled: enabled,
|
|
351
|
+
replicas: replicas,
|
|
321
352
|
}
|
|
322
353
|
|
|
323
354
|
api_headers = {
|
|
@@ -367,6 +398,107 @@ module Appwrite
|
|
|
367
398
|
|
|
368
399
|
end
|
|
369
400
|
|
|
401
|
+
# Trigger a manual failover for a dedicated database with high availability
|
|
402
|
+
# enabled. Promotes a replica to primary. The failover runs asynchronously;
|
|
403
|
+
# poll the database document for status updates.
|
|
404
|
+
#
|
|
405
|
+
# @param [String] database_id Database ID.
|
|
406
|
+
# @param [String] target_replica_id Target replica ID to promote. If not specified, the healthiest replica is selected.
|
|
407
|
+
#
|
|
408
|
+
# @return [DedicatedDatabase]
|
|
409
|
+
def create_failover(database_id:, target_replica_id: nil)
|
|
410
|
+
api_path = '/tablesdb/{databaseId}/failovers'
|
|
411
|
+
.gsub('{databaseId}', database_id)
|
|
412
|
+
|
|
413
|
+
if database_id.nil?
|
|
414
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
api_params = {
|
|
418
|
+
targetReplicaId: target_replica_id,
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
api_headers = {
|
|
422
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
423
|
+
"content-type": 'application/json',
|
|
424
|
+
"accept": 'application/json',
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
@client.call(
|
|
428
|
+
method: 'POST',
|
|
429
|
+
path: api_path,
|
|
430
|
+
headers: api_headers,
|
|
431
|
+
params: api_params,
|
|
432
|
+
response_type: Models::DedicatedDatabase
|
|
433
|
+
)
|
|
434
|
+
|
|
435
|
+
end
|
|
436
|
+
|
|
437
|
+
# Get high availability status for a dedicated database. Returns replica
|
|
438
|
+
# statuses, replication lag, and sync mode.
|
|
439
|
+
#
|
|
440
|
+
# @param [String] database_id Database ID.
|
|
441
|
+
#
|
|
442
|
+
# @return [DedicatedDatabaseReplicas]
|
|
443
|
+
def get_replicas(database_id:)
|
|
444
|
+
api_path = '/tablesdb/{databaseId}/replicas'
|
|
445
|
+
.gsub('{databaseId}', database_id)
|
|
446
|
+
|
|
447
|
+
if database_id.nil?
|
|
448
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
449
|
+
end
|
|
450
|
+
|
|
451
|
+
api_params = {
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
api_headers = {
|
|
455
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
456
|
+
"accept": 'application/json',
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
@client.call(
|
|
460
|
+
method: 'GET',
|
|
461
|
+
path: api_path,
|
|
462
|
+
headers: api_headers,
|
|
463
|
+
params: api_params,
|
|
464
|
+
response_type: Models::DedicatedDatabaseReplicas
|
|
465
|
+
)
|
|
466
|
+
|
|
467
|
+
end
|
|
468
|
+
|
|
469
|
+
# Get real-time health and status information for a dedicated database.
|
|
470
|
+
# Returns health status, readiness, uptime, connection info, replica status,
|
|
471
|
+
# and volume information.
|
|
472
|
+
#
|
|
473
|
+
# @param [String] database_id Database ID.
|
|
474
|
+
#
|
|
475
|
+
# @return [DatabaseStatus]
|
|
476
|
+
def get_status(database_id:)
|
|
477
|
+
api_path = '/tablesdb/{databaseId}/status'
|
|
478
|
+
.gsub('{databaseId}', database_id)
|
|
479
|
+
|
|
480
|
+
if database_id.nil?
|
|
481
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
482
|
+
end
|
|
483
|
+
|
|
484
|
+
api_params = {
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
api_headers = {
|
|
488
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
489
|
+
"accept": 'application/json',
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
@client.call(
|
|
493
|
+
method: 'GET',
|
|
494
|
+
path: api_path,
|
|
495
|
+
headers: api_headers,
|
|
496
|
+
params: api_params,
|
|
497
|
+
response_type: Models::DatabaseStatus
|
|
498
|
+
)
|
|
499
|
+
|
|
500
|
+
end
|
|
501
|
+
|
|
370
502
|
# Get a list of all tables that belong to the provided databaseId. You can
|
|
371
503
|
# use the search parameter to filter your results.
|
|
372
504
|
#
|
|
@@ -181,6 +181,204 @@ module Appwrite
|
|
|
181
181
|
|
|
182
182
|
end
|
|
183
183
|
|
|
184
|
+
# List app installations on a team. Any team member can read installations.
|
|
185
|
+
#
|
|
186
|
+
# @param [String] team_id Team ID.
|
|
187
|
+
# @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.
|
|
188
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
189
|
+
#
|
|
190
|
+
# @return [AppInstallationList]
|
|
191
|
+
def list_installations(team_id:, queries: nil, total: nil)
|
|
192
|
+
api_path = '/teams/{teamId}/installations'
|
|
193
|
+
.gsub('{teamId}', team_id)
|
|
194
|
+
|
|
195
|
+
if team_id.nil?
|
|
196
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
api_params = {
|
|
200
|
+
queries: queries,
|
|
201
|
+
total: total,
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
api_headers = {
|
|
205
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
206
|
+
"accept": 'application/json',
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@client.call(
|
|
210
|
+
method: 'GET',
|
|
211
|
+
path: api_path,
|
|
212
|
+
headers: api_headers,
|
|
213
|
+
params: api_params,
|
|
214
|
+
response_type: Models::AppInstallationList
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Install an app on a team. When authenticated as a user, only team members
|
|
220
|
+
# with the owner role can install apps. Requests using an API key or in admin
|
|
221
|
+
# mode can install apps on any team. The installation is granted the scopes
|
|
222
|
+
# the app currently requests.
|
|
223
|
+
#
|
|
224
|
+
# @param [String] team_id Team ID.
|
|
225
|
+
# @param [String] app_id Application unique ID.
|
|
226
|
+
# @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.
|
|
227
|
+
#
|
|
228
|
+
# @return [AppInstallation]
|
|
229
|
+
def create_installation(team_id:, app_id:, authorization_details: nil)
|
|
230
|
+
api_path = '/teams/{teamId}/installations'
|
|
231
|
+
.gsub('{teamId}', team_id)
|
|
232
|
+
|
|
233
|
+
if team_id.nil?
|
|
234
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if app_id.nil?
|
|
238
|
+
raise Appwrite::Exception.new('Missing required parameter: "appId"')
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
api_params = {
|
|
242
|
+
appId: app_id,
|
|
243
|
+
authorizationDetails: authorization_details,
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
api_headers = {
|
|
247
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
248
|
+
"content-type": 'application/json',
|
|
249
|
+
"accept": 'application/json',
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@client.call(
|
|
253
|
+
method: 'POST',
|
|
254
|
+
path: api_path,
|
|
255
|
+
headers: api_headers,
|
|
256
|
+
params: api_params,
|
|
257
|
+
response_type: Models::AppInstallation
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Get an app installation on a team by its unique ID. Any team member can
|
|
263
|
+
# read installations.
|
|
264
|
+
#
|
|
265
|
+
# @param [String] team_id Team ID.
|
|
266
|
+
# @param [String] installation_id Installation unique ID.
|
|
267
|
+
#
|
|
268
|
+
# @return [AppInstallation]
|
|
269
|
+
def get_installation(team_id:, installation_id:)
|
|
270
|
+
api_path = '/teams/{teamId}/installations/{installationId}'
|
|
271
|
+
.gsub('{teamId}', team_id)
|
|
272
|
+
.gsub('{installationId}', installation_id)
|
|
273
|
+
|
|
274
|
+
if team_id.nil?
|
|
275
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
if installation_id.nil?
|
|
279
|
+
raise Appwrite::Exception.new('Missing required parameter: "installationId"')
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
api_params = {
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
api_headers = {
|
|
286
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
287
|
+
"accept": 'application/json',
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
@client.call(
|
|
291
|
+
method: 'GET',
|
|
292
|
+
path: api_path,
|
|
293
|
+
headers: api_headers,
|
|
294
|
+
params: api_params,
|
|
295
|
+
response_type: Models::AppInstallation
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# Update an app installation on a team. Only team members with the owner role
|
|
301
|
+
# can update installations. The installation's granted scopes are refreshed
|
|
302
|
+
# to the scopes the app currently requests; previously issued installation
|
|
303
|
+
# access tokens are revoked.
|
|
304
|
+
#
|
|
305
|
+
# @param [String] team_id Team ID.
|
|
306
|
+
# @param [String] installation_id Installation unique ID.
|
|
307
|
+
# @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.
|
|
308
|
+
#
|
|
309
|
+
# @return [AppInstallation]
|
|
310
|
+
def update_installation(team_id:, installation_id:, authorization_details: nil)
|
|
311
|
+
api_path = '/teams/{teamId}/installations/{installationId}'
|
|
312
|
+
.gsub('{teamId}', team_id)
|
|
313
|
+
.gsub('{installationId}', installation_id)
|
|
314
|
+
|
|
315
|
+
if team_id.nil?
|
|
316
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
if installation_id.nil?
|
|
320
|
+
raise Appwrite::Exception.new('Missing required parameter: "installationId"')
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
api_params = {
|
|
324
|
+
authorizationDetails: authorization_details,
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
api_headers = {
|
|
328
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
329
|
+
"content-type": 'application/json',
|
|
330
|
+
"accept": 'application/json',
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
@client.call(
|
|
334
|
+
method: 'PUT',
|
|
335
|
+
path: api_path,
|
|
336
|
+
headers: api_headers,
|
|
337
|
+
params: api_params,
|
|
338
|
+
response_type: Models::AppInstallation
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Uninstall an app from a team by its installation ID. Only team members with
|
|
344
|
+
# the owner role can remove installations. Previously issued installation
|
|
345
|
+
# access tokens are revoked.
|
|
346
|
+
#
|
|
347
|
+
# @param [String] team_id Team ID.
|
|
348
|
+
# @param [String] installation_id Installation unique ID.
|
|
349
|
+
#
|
|
350
|
+
# @return []
|
|
351
|
+
def delete_installation(team_id:, installation_id:)
|
|
352
|
+
api_path = '/teams/{teamId}/installations/{installationId}'
|
|
353
|
+
.gsub('{teamId}', team_id)
|
|
354
|
+
.gsub('{installationId}', installation_id)
|
|
355
|
+
|
|
356
|
+
if team_id.nil?
|
|
357
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
if installation_id.nil?
|
|
361
|
+
raise Appwrite::Exception.new('Missing required parameter: "installationId"')
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
api_params = {
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
api_headers = {
|
|
368
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
369
|
+
"content-type": 'application/json',
|
|
370
|
+
"accept": 'application/json',
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
@client.call(
|
|
374
|
+
method: 'DELETE',
|
|
375
|
+
path: api_path,
|
|
376
|
+
headers: api_headers,
|
|
377
|
+
params: api_params,
|
|
378
|
+
)
|
|
379
|
+
|
|
380
|
+
end
|
|
381
|
+
|
|
184
382
|
# Use this endpoint to list a team's members using the team's ID. All team
|
|
185
383
|
# members have read access to this endpoint. Hide sensitive attributes from
|
|
186
384
|
# the response by toggling membership privacy in the Console.
|
data/lib/appwrite.rb
CHANGED
|
@@ -234,6 +234,10 @@ require_relative 'appwrite/models/billing_plan_limits'
|
|
|
234
234
|
require_relative 'appwrite/models/billing_plan_dedicated_database_limits'
|
|
235
235
|
require_relative 'appwrite/models/billing_plan_supported_addons'
|
|
236
236
|
require_relative 'appwrite/models/block'
|
|
237
|
+
require_relative 'appwrite/models/dedicated_database'
|
|
238
|
+
require_relative 'appwrite/models/database_status'
|
|
239
|
+
require_relative 'appwrite/models/dedicated_database_member'
|
|
240
|
+
require_relative 'appwrite/models/dedicated_database_replicas'
|
|
237
241
|
require_relative 'appwrite/models/organization'
|
|
238
242
|
require_relative 'appwrite/models/backup_policy'
|
|
239
243
|
require_relative 'appwrite/models/policy_deny_aliased_email'
|
|
@@ -242,11 +246,43 @@ require_relative 'appwrite/models/policy_deny_free_email'
|
|
|
242
246
|
require_relative 'appwrite/models/policy_deny_corporate_email'
|
|
243
247
|
require_relative 'appwrite/models/program'
|
|
244
248
|
require_relative 'appwrite/models/backup_restoration'
|
|
249
|
+
require_relative 'appwrite/models/dedicated_database_specification'
|
|
250
|
+
require_relative 'appwrite/models/dedicated_database_specification_list'
|
|
251
|
+
require_relative 'appwrite/models/dedicated_database_specification_pricing'
|
|
252
|
+
require_relative 'appwrite/models/database_status_connections'
|
|
253
|
+
require_relative 'appwrite/models/database_status_replica'
|
|
254
|
+
require_relative 'appwrite/models/database_status_volume'
|
|
245
255
|
require_relative 'appwrite/models/usage_billing_plan'
|
|
256
|
+
require_relative 'appwrite/models/app'
|
|
257
|
+
require_relative 'appwrite/models/app_secret'
|
|
258
|
+
require_relative 'appwrite/models/app_secret_plaintext'
|
|
259
|
+
require_relative 'appwrite/models/app_scope'
|
|
260
|
+
require_relative 'appwrite/models/app_installation'
|
|
261
|
+
require_relative 'appwrite/models/app_key'
|
|
262
|
+
require_relative 'appwrite/models/oauth2_authorize'
|
|
263
|
+
require_relative 'appwrite/models/oauth2_approve'
|
|
264
|
+
require_relative 'appwrite/models/oauth2_reject'
|
|
265
|
+
require_relative 'appwrite/models/oauth2_grant'
|
|
266
|
+
require_relative 'appwrite/models/oauth2_device_authorization'
|
|
267
|
+
require_relative 'appwrite/models/oauth2_par'
|
|
268
|
+
require_relative 'appwrite/models/oauth2_token'
|
|
269
|
+
require_relative 'appwrite/models/oauth2_consent'
|
|
270
|
+
require_relative 'appwrite/models/oauth2_consent_token'
|
|
271
|
+
require_relative 'appwrite/models/oauth2_project'
|
|
272
|
+
require_relative 'appwrite/models/oauth2_organization'
|
|
273
|
+
require_relative 'appwrite/models/oauth2_project_list'
|
|
274
|
+
require_relative 'appwrite/models/oauth2_organization_list'
|
|
275
|
+
require_relative 'appwrite/models/oauth2_consent_list'
|
|
276
|
+
require_relative 'appwrite/models/oauth2_consent_token_list'
|
|
246
277
|
require_relative 'appwrite/models/activity_event_list'
|
|
247
278
|
require_relative 'appwrite/models/backup_archive_list'
|
|
248
279
|
require_relative 'appwrite/models/backup_policy_list'
|
|
249
280
|
require_relative 'appwrite/models/backup_restoration_list'
|
|
281
|
+
require_relative 'appwrite/models/apps_list'
|
|
282
|
+
require_relative 'appwrite/models/app_secret_list'
|
|
283
|
+
require_relative 'appwrite/models/app_scope_list'
|
|
284
|
+
require_relative 'appwrite/models/app_installation_list'
|
|
285
|
+
require_relative 'appwrite/models/app_key_list'
|
|
250
286
|
|
|
251
287
|
require_relative 'appwrite/enums/authenticator_type'
|
|
252
288
|
require_relative 'appwrite/enums/authentication_factor'
|
|
@@ -311,6 +347,7 @@ require_relative 'appwrite/enums/billing_plan_group'
|
|
|
311
347
|
|
|
312
348
|
require_relative 'appwrite/services/account'
|
|
313
349
|
require_relative 'appwrite/services/activities'
|
|
350
|
+
require_relative 'appwrite/services/apps'
|
|
314
351
|
require_relative 'appwrite/services/avatars'
|
|
315
352
|
require_relative 'appwrite/services/backups'
|
|
316
353
|
require_relative 'appwrite/services/databases'
|
|
@@ -318,6 +355,7 @@ require_relative 'appwrite/services/functions'
|
|
|
318
355
|
require_relative 'appwrite/services/graphql'
|
|
319
356
|
require_relative 'appwrite/services/locale'
|
|
320
357
|
require_relative 'appwrite/services/messaging'
|
|
358
|
+
require_relative 'appwrite/services/oauth2'
|
|
321
359
|
require_relative 'appwrite/services/organization'
|
|
322
360
|
require_relative 'appwrite/services/presences'
|
|
323
361
|
require_relative 'appwrite/services/project'
|