appwrite 11.0.0.pre.rc.4 → 11.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +7 -17
- data/lib/appwrite/enums/authentication_factor.rb +3 -2
- data/lib/appwrite/enums/flag.rb +2 -2
- data/lib/appwrite/enums/index_type.rb +0 -1
- data/lib/appwrite/enums/name.rb +1 -0
- data/lib/appwrite/enums/password_hash.rb +2 -2
- data/lib/appwrite/enums/runtime.rb +42 -34
- data/lib/appwrite/enums/{encryption.rb → smtp_encryption.rb} +1 -1
- data/lib/appwrite/id.rb +20 -4
- data/lib/appwrite/models/mfa_recovery_codes.rb +27 -0
- data/lib/appwrite/models/mfa_type.rb +0 -5
- data/lib/appwrite/models/session.rb +8 -3
- data/lib/appwrite/models/user.rb +0 -5
- data/lib/appwrite/services/account.rb +219 -90
- data/lib/appwrite/services/databases.rb +16 -10
- data/lib/appwrite/services/health.rb +80 -1
- data/lib/appwrite/services/messaging.rb +42 -35
- data/lib/appwrite/services/users.rb +115 -22
- data/lib/appwrite.rb +3 -3
- metadata +6 -6
- data/lib/appwrite/enums/message_status.rb +0 -9
@@ -234,7 +234,7 @@ module Appwrite
|
|
234
234
|
end
|
235
235
|
|
236
236
|
|
237
|
-
#
|
237
|
+
# Enable or disable MFA on an account.
|
238
238
|
#
|
239
239
|
# @param [] mfa Enable or disable MFA.
|
240
240
|
#
|
@@ -264,12 +264,121 @@ module Appwrite
|
|
264
264
|
end
|
265
265
|
|
266
266
|
|
267
|
-
#
|
267
|
+
# Add an authenticator app to be used as an MFA factor. Verify the
|
268
|
+
# authenticator using the [verify
|
269
|
+
# authenticator](/docs/references/cloud/client-web/account#verifyAuthenticator)
|
270
|
+
# method.
|
271
|
+
#
|
272
|
+
# @param [AuthenticatorType] type Type of authenticator. Must be `totp`
|
273
|
+
#
|
274
|
+
# @return [MfaType]
|
275
|
+
def create_mfa_authenticator(type:)
|
276
|
+
api_path = '/account/mfa/authenticators/{type}'
|
277
|
+
.gsub('{type}', type)
|
278
|
+
|
279
|
+
if type.nil?
|
280
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
281
|
+
end
|
282
|
+
|
283
|
+
api_params = {
|
284
|
+
}
|
285
|
+
|
286
|
+
api_headers = {
|
287
|
+
"content-type": 'application/json',
|
288
|
+
}
|
289
|
+
|
290
|
+
@client.call(
|
291
|
+
method: 'POST',
|
292
|
+
path: api_path,
|
293
|
+
headers: api_headers,
|
294
|
+
params: api_params,
|
295
|
+
response_type: Models::MfaType
|
296
|
+
)
|
297
|
+
end
|
298
|
+
|
299
|
+
|
300
|
+
# Verify an authenticator app after adding it using the [add
|
301
|
+
# authenticator](/docs/references/cloud/client-web/account#addAuthenticator)
|
302
|
+
# method.
|
303
|
+
#
|
304
|
+
# @param [AuthenticatorType] type Type of authenticator.
|
305
|
+
# @param [String] otp Valid verification token.
|
306
|
+
#
|
307
|
+
# @return [User]
|
308
|
+
def update_mfa_authenticator(type:, otp:)
|
309
|
+
api_path = '/account/mfa/authenticators/{type}'
|
310
|
+
.gsub('{type}', type)
|
311
|
+
|
312
|
+
if type.nil?
|
313
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
314
|
+
end
|
315
|
+
|
316
|
+
if otp.nil?
|
317
|
+
raise Appwrite::Exception.new('Missing required parameter: "otp"')
|
318
|
+
end
|
319
|
+
|
320
|
+
api_params = {
|
321
|
+
otp: otp,
|
322
|
+
}
|
323
|
+
|
324
|
+
api_headers = {
|
325
|
+
"content-type": 'application/json',
|
326
|
+
}
|
327
|
+
|
328
|
+
@client.call(
|
329
|
+
method: 'PUT',
|
330
|
+
path: api_path,
|
331
|
+
headers: api_headers,
|
332
|
+
params: api_params,
|
333
|
+
response_type: Models::User
|
334
|
+
)
|
335
|
+
end
|
336
|
+
|
337
|
+
|
338
|
+
# Delete an authenticator for a user by ID.
|
268
339
|
#
|
269
|
-
# @param [
|
340
|
+
# @param [AuthenticatorType] type Type of authenticator.
|
341
|
+
# @param [String] otp Valid verification token.
|
342
|
+
#
|
343
|
+
# @return [User]
|
344
|
+
def delete_mfa_authenticator(type:, otp:)
|
345
|
+
api_path = '/account/mfa/authenticators/{type}'
|
346
|
+
.gsub('{type}', type)
|
347
|
+
|
348
|
+
if type.nil?
|
349
|
+
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
350
|
+
end
|
351
|
+
|
352
|
+
if otp.nil?
|
353
|
+
raise Appwrite::Exception.new('Missing required parameter: "otp"')
|
354
|
+
end
|
355
|
+
|
356
|
+
api_params = {
|
357
|
+
otp: otp,
|
358
|
+
}
|
359
|
+
|
360
|
+
api_headers = {
|
361
|
+
"content-type": 'application/json',
|
362
|
+
}
|
363
|
+
|
364
|
+
@client.call(
|
365
|
+
method: 'DELETE',
|
366
|
+
path: api_path,
|
367
|
+
headers: api_headers,
|
368
|
+
params: api_params,
|
369
|
+
response_type: Models::User
|
370
|
+
)
|
371
|
+
end
|
372
|
+
|
373
|
+
|
374
|
+
# Begin the process of MFA verification after sign-in. Finish the flow with
|
375
|
+
# [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
|
376
|
+
# method.
|
377
|
+
#
|
378
|
+
# @param [AuthenticationFactor] factor Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
|
270
379
|
#
|
271
380
|
# @return [MfaChallenge]
|
272
|
-
def
|
381
|
+
def create_mfa_challenge(factor:)
|
273
382
|
api_path = '/account/mfa/challenge'
|
274
383
|
|
275
384
|
if factor.nil?
|
@@ -294,13 +403,17 @@ module Appwrite
|
|
294
403
|
end
|
295
404
|
|
296
405
|
|
297
|
-
#
|
406
|
+
# Complete the MFA challenge by providing the one-time password. Finish the
|
407
|
+
# process of MFA verification by providing the one-time password. To begin
|
408
|
+
# the flow, use
|
409
|
+
# [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge)
|
410
|
+
# method.
|
298
411
|
#
|
299
412
|
# @param [String] challenge_id ID of the challenge.
|
300
413
|
# @param [String] otp Valid verification token.
|
301
414
|
#
|
302
415
|
# @return []
|
303
|
-
def
|
416
|
+
def update_mfa_challenge(challenge_id:, otp:)
|
304
417
|
api_path = '/account/mfa/challenge'
|
305
418
|
|
306
419
|
if challenge_id.nil?
|
@@ -329,11 +442,11 @@ module Appwrite
|
|
329
442
|
end
|
330
443
|
|
331
444
|
|
332
|
-
#
|
445
|
+
# List the factors available on the account to be used as a MFA challange.
|
333
446
|
#
|
334
447
|
#
|
335
448
|
# @return [MfaFactors]
|
336
|
-
def
|
449
|
+
def list_mfa_factors()
|
337
450
|
api_path = '/account/mfa/factors'
|
338
451
|
|
339
452
|
api_params = {
|
@@ -353,18 +466,15 @@ module Appwrite
|
|
353
466
|
end
|
354
467
|
|
355
468
|
|
356
|
-
#
|
469
|
+
# Get recovery codes that can be used as backup for MFA flow. Before getting
|
470
|
+
# codes, they must be generated using
|
471
|
+
# [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
|
472
|
+
# method. An OTP challenge is required to read recovery codes.
|
357
473
|
#
|
358
|
-
# @param [AuthenticatorType] type Type of authenticator.
|
359
474
|
#
|
360
|
-
# @return [
|
361
|
-
def
|
362
|
-
api_path = '/account/mfa/
|
363
|
-
.gsub('{type}', type)
|
364
|
-
|
365
|
-
if type.nil?
|
366
|
-
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
367
|
-
end
|
475
|
+
# @return [MfaRecoveryCodes]
|
476
|
+
def get_mfa_recovery_codes()
|
477
|
+
api_path = '/account/mfa/recovery-codes'
|
368
478
|
|
369
479
|
api_params = {
|
370
480
|
}
|
@@ -374,35 +484,27 @@ module Appwrite
|
|
374
484
|
}
|
375
485
|
|
376
486
|
@client.call(
|
377
|
-
method: '
|
487
|
+
method: 'GET',
|
378
488
|
path: api_path,
|
379
489
|
headers: api_headers,
|
380
490
|
params: api_params,
|
381
|
-
response_type: Models::
|
491
|
+
response_type: Models::MfaRecoveryCodes
|
382
492
|
)
|
383
493
|
end
|
384
494
|
|
385
495
|
|
386
|
-
#
|
496
|
+
# Generate recovery codes as backup for MFA flow. It's recommended to
|
497
|
+
# generate and show then immediately after user successfully adds their
|
498
|
+
# authehticator. Recovery codes can be used as a MFA verification type in
|
499
|
+
# [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge)
|
500
|
+
# method.
|
387
501
|
#
|
388
|
-
# @param [AuthenticatorType] type Type of authenticator.
|
389
|
-
# @param [String] otp Valid verification token.
|
390
502
|
#
|
391
|
-
# @return [
|
392
|
-
def
|
393
|
-
api_path = '/account/mfa/
|
394
|
-
.gsub('{type}', type)
|
395
|
-
|
396
|
-
if type.nil?
|
397
|
-
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
398
|
-
end
|
399
|
-
|
400
|
-
if otp.nil?
|
401
|
-
raise Appwrite::Exception.new('Missing required parameter: "otp"')
|
402
|
-
end
|
503
|
+
# @return [MfaRecoveryCodes]
|
504
|
+
def create_mfa_recovery_codes()
|
505
|
+
api_path = '/account/mfa/recovery-codes'
|
403
506
|
|
404
507
|
api_params = {
|
405
|
-
otp: otp,
|
406
508
|
}
|
407
509
|
|
408
510
|
api_headers = {
|
@@ -410,35 +512,26 @@ module Appwrite
|
|
410
512
|
}
|
411
513
|
|
412
514
|
@client.call(
|
413
|
-
method: '
|
515
|
+
method: 'POST',
|
414
516
|
path: api_path,
|
415
517
|
headers: api_headers,
|
416
518
|
params: api_params,
|
417
|
-
response_type: Models::
|
519
|
+
response_type: Models::MfaRecoveryCodes
|
418
520
|
)
|
419
521
|
end
|
420
522
|
|
421
523
|
|
422
|
-
#
|
524
|
+
# Regenerate recovery codes that can be used as backup for MFA flow. Before
|
525
|
+
# regenerating codes, they must be first generated using
|
526
|
+
# [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
|
527
|
+
# method. An OTP challenge is required to regenreate recovery codes.
|
423
528
|
#
|
424
|
-
# @param [AuthenticatorType] type Type of authenticator.
|
425
|
-
# @param [String] otp Valid verification token.
|
426
529
|
#
|
427
|
-
# @return [
|
428
|
-
def
|
429
|
-
api_path = '/account/mfa/
|
430
|
-
.gsub('{type}', type)
|
431
|
-
|
432
|
-
if type.nil?
|
433
|
-
raise Appwrite::Exception.new('Missing required parameter: "type"')
|
434
|
-
end
|
435
|
-
|
436
|
-
if otp.nil?
|
437
|
-
raise Appwrite::Exception.new('Missing required parameter: "otp"')
|
438
|
-
end
|
530
|
+
# @return [MfaRecoveryCodes]
|
531
|
+
def update_mfa_recovery_codes()
|
532
|
+
api_path = '/account/mfa/recovery-codes'
|
439
533
|
|
440
534
|
api_params = {
|
441
|
-
otp: otp,
|
442
535
|
}
|
443
536
|
|
444
537
|
api_headers = {
|
@@ -446,11 +539,11 @@ module Appwrite
|
|
446
539
|
}
|
447
540
|
|
448
541
|
@client.call(
|
449
|
-
method: '
|
542
|
+
method: 'PATCH',
|
450
543
|
path: api_path,
|
451
544
|
headers: api_headers,
|
452
545
|
params: api_params,
|
453
|
-
response_type: Models::
|
546
|
+
response_type: Models::MfaRecoveryCodes
|
454
547
|
)
|
455
548
|
end
|
456
549
|
|
@@ -867,43 +960,28 @@ module Appwrite
|
|
867
960
|
end
|
868
961
|
|
869
962
|
|
870
|
-
#
|
871
|
-
#
|
872
|
-
#
|
873
|
-
# back to your app when login is completed.
|
874
|
-
#
|
875
|
-
# If there is already an active session, the new session will be attached to
|
876
|
-
# the logged-in account. If there are no active sessions, the server will
|
877
|
-
# attempt to look for a user with the same email address as the email
|
878
|
-
# received from the OAuth2 provider and attach the new session to the
|
879
|
-
# existing user. If no matching user is found - the server will create a new
|
880
|
-
# user.
|
881
|
-
#
|
882
|
-
# A user is limited to 10 active sessions at a time by default. [Learn more
|
883
|
-
# about session
|
884
|
-
# limits](https://appwrite.io/docs/authentication-security#limits).
|
885
|
-
#
|
963
|
+
# Use this endpoint to create a session from token. Provide the **userId**
|
964
|
+
# and **secret** parameters from the successful response of authentication
|
965
|
+
# flows initiated by token creation. For example, magic URL and phone login.
|
886
966
|
#
|
887
|
-
# @param [
|
888
|
-
# @param [String]
|
889
|
-
# @param [String] failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
890
|
-
# @param [] token Include token credentials in the final redirect, useful for server-side integrations, or when cookies are not available.
|
891
|
-
# @param [Array] scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
|
967
|
+
# @param [String] user_id User 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.
|
968
|
+
# @param [String] secret Valid verification token.
|
892
969
|
#
|
893
|
-
# @return []
|
894
|
-
def
|
895
|
-
api_path = '/account/sessions/
|
896
|
-
.gsub('{provider}', provider)
|
970
|
+
# @return [Session]
|
971
|
+
def update_phone_session(user_id:, secret:)
|
972
|
+
api_path = '/account/sessions/phone'
|
897
973
|
|
898
|
-
if
|
899
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
974
|
+
if user_id.nil?
|
975
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
976
|
+
end
|
977
|
+
|
978
|
+
if secret.nil?
|
979
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
900
980
|
end
|
901
981
|
|
902
982
|
api_params = {
|
903
|
-
|
904
|
-
|
905
|
-
token: token,
|
906
|
-
scopes: scopes,
|
983
|
+
userId: user_id,
|
984
|
+
secret: secret,
|
907
985
|
}
|
908
986
|
|
909
987
|
api_headers = {
|
@@ -911,10 +989,11 @@ module Appwrite
|
|
911
989
|
}
|
912
990
|
|
913
991
|
@client.call(
|
914
|
-
method: '
|
992
|
+
method: 'PUT',
|
915
993
|
path: api_path,
|
916
994
|
headers: api_headers,
|
917
995
|
params: api_params,
|
996
|
+
response_type: Models::Session
|
918
997
|
)
|
919
998
|
end
|
920
999
|
|
@@ -988,8 +1067,9 @@ module Appwrite
|
|
988
1067
|
end
|
989
1068
|
|
990
1069
|
|
991
|
-
#
|
992
|
-
# useful when session
|
1070
|
+
# Use this endpoint to extend a session's length. Extending a session is
|
1071
|
+
# useful when session expiry is short. If the session was created using an
|
1072
|
+
# OAuth provider, this endpoint refreshes the access token from the provider.
|
993
1073
|
#
|
994
1074
|
# @param [String] session_id Session ID. Use the string 'current' to update the current device session.
|
995
1075
|
#
|
@@ -1180,6 +1260,55 @@ module Appwrite
|
|
1180
1260
|
end
|
1181
1261
|
|
1182
1262
|
|
1263
|
+
# Allow the user to login to their account using the OAuth2 provider of their
|
1264
|
+
# choice. Each OAuth2 provider should be enabled from the Appwrite console
|
1265
|
+
# first. Use the success and failure arguments to provide a redirect URL's
|
1266
|
+
# back to your app when login is completed.
|
1267
|
+
#
|
1268
|
+
# If authentication succeeds, `userId` and `secret` of a token will be
|
1269
|
+
# appended to the success URL as query parameters. These can be used to
|
1270
|
+
# create a new session using the [Create
|
1271
|
+
# session](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
1272
|
+
# endpoint.
|
1273
|
+
#
|
1274
|
+
# A user is limited to 10 active sessions at a time by default. [Learn more
|
1275
|
+
# about session
|
1276
|
+
# limits](https://appwrite.io/docs/authentication-security#limits).
|
1277
|
+
#
|
1278
|
+
# @param [OAuthProvider] provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
|
1279
|
+
# @param [String] success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
1280
|
+
# @param [String] failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
1281
|
+
# @param [Array] scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
|
1282
|
+
#
|
1283
|
+
# @return []
|
1284
|
+
def create_o_auth2_token(provider:, success: nil, failure: nil, scopes: nil)
|
1285
|
+
api_path = '/account/tokens/oauth2/{provider}'
|
1286
|
+
.gsub('{provider}', provider)
|
1287
|
+
|
1288
|
+
if provider.nil?
|
1289
|
+
raise Appwrite::Exception.new('Missing required parameter: "provider"')
|
1290
|
+
end
|
1291
|
+
|
1292
|
+
api_params = {
|
1293
|
+
success: success,
|
1294
|
+
failure: failure,
|
1295
|
+
scopes: scopes,
|
1296
|
+
}
|
1297
|
+
|
1298
|
+
api_headers = {
|
1299
|
+
"content-type": 'application/json',
|
1300
|
+
}
|
1301
|
+
|
1302
|
+
@client.call(
|
1303
|
+
method: 'GET',
|
1304
|
+
path: api_path,
|
1305
|
+
headers: api_headers,
|
1306
|
+
params: api_params,
|
1307
|
+
response_type: "location"
|
1308
|
+
)
|
1309
|
+
end
|
1310
|
+
|
1311
|
+
|
1183
1312
|
# Sends the user an SMS with a secret key for creating a session. If the
|
1184
1313
|
# provided user ID has not be registered, a new user will be created. Use the
|
1185
1314
|
# returned user ID and secret and submit a request to the [POST
|
@@ -381,7 +381,7 @@ module Appwrite
|
|
381
381
|
end
|
382
382
|
|
383
383
|
|
384
|
-
#
|
384
|
+
# List attributes in the collection.
|
385
385
|
#
|
386
386
|
# @param [String] database_id Database ID.
|
387
387
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
@@ -472,7 +472,8 @@ module Appwrite
|
|
472
472
|
end
|
473
473
|
|
474
474
|
|
475
|
-
#
|
475
|
+
# Update a boolean attribute. Changing the `default` value will not update
|
476
|
+
# already existing documents.
|
476
477
|
#
|
477
478
|
# @param [String] database_id Database ID.
|
478
479
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
@@ -526,7 +527,7 @@ module Appwrite
|
|
526
527
|
end
|
527
528
|
|
528
529
|
|
529
|
-
#
|
530
|
+
# Create a date time attribute according to the ISO 8601 standard.
|
530
531
|
#
|
531
532
|
# @param [String] database_id Database ID.
|
532
533
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
@@ -578,7 +579,8 @@ module Appwrite
|
|
578
579
|
end
|
579
580
|
|
580
581
|
|
581
|
-
#
|
582
|
+
# Update a date time attribute. Changing the `default` value will not update
|
583
|
+
# already existing documents.
|
582
584
|
#
|
583
585
|
# @param [String] database_id Database ID.
|
584
586
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
@@ -741,6 +743,8 @@ module Appwrite
|
|
741
743
|
end
|
742
744
|
|
743
745
|
|
746
|
+
# Create an enumeration attribute. The `elements` param acts as a white-list
|
747
|
+
# of accepted values for this attribute.
|
744
748
|
#
|
745
749
|
#
|
746
750
|
# @param [String] database_id Database ID.
|
@@ -1506,7 +1510,7 @@ module Appwrite
|
|
1506
1510
|
end
|
1507
1511
|
|
1508
1512
|
|
1509
|
-
#
|
1513
|
+
# Get attribute by ID.
|
1510
1514
|
#
|
1511
1515
|
# @param [String] database_id Database ID.
|
1512
1516
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
@@ -1547,7 +1551,7 @@ module Appwrite
|
|
1547
1551
|
end
|
1548
1552
|
|
1549
1553
|
|
1550
|
-
#
|
1554
|
+
# Deletes an attribute.
|
1551
1555
|
#
|
1552
1556
|
# @param [String] database_id Database ID.
|
1553
1557
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
@@ -1859,7 +1863,7 @@ module Appwrite
|
|
1859
1863
|
end
|
1860
1864
|
|
1861
1865
|
|
1862
|
-
#
|
1866
|
+
# List indexes in the collection.
|
1863
1867
|
#
|
1864
1868
|
# @param [String] database_id Database ID.
|
1865
1869
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
@@ -1897,7 +1901,9 @@ module Appwrite
|
|
1897
1901
|
end
|
1898
1902
|
|
1899
1903
|
|
1900
|
-
#
|
1904
|
+
# Creates an index on the attributes listed. Your index should include all
|
1905
|
+
# the attributes you will query in a single request.
|
1906
|
+
# Attributes can be `key`, `fulltext`, and `unique`.
|
1901
1907
|
#
|
1902
1908
|
# @param [String] database_id Database ID.
|
1903
1909
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
@@ -1953,7 +1959,7 @@ module Appwrite
|
|
1953
1959
|
end
|
1954
1960
|
|
1955
1961
|
|
1956
|
-
#
|
1962
|
+
# Get index by ID.
|
1957
1963
|
#
|
1958
1964
|
# @param [String] database_id Database ID.
|
1959
1965
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
@@ -1995,7 +2001,7 @@ module Appwrite
|
|
1995
2001
|
end
|
1996
2002
|
|
1997
2003
|
|
1998
|
-
#
|
2004
|
+
# Delete an index.
|
1999
2005
|
#
|
2000
2006
|
# @param [String] database_id Database ID.
|
2001
2007
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
@@ -323,7 +323,8 @@ module Appwrite
|
|
323
323
|
end
|
324
324
|
|
325
325
|
|
326
|
-
#
|
326
|
+
# Get the number of function executions that are waiting to be processed in
|
327
|
+
# the Appwrite internal queue server.
|
327
328
|
#
|
328
329
|
# @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
329
330
|
#
|
@@ -457,6 +458,60 @@ module Appwrite
|
|
457
458
|
end
|
458
459
|
|
459
460
|
|
461
|
+
# Get the number of metrics that are waiting to be processed in the Appwrite
|
462
|
+
# internal queue server.
|
463
|
+
#
|
464
|
+
# @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
465
|
+
#
|
466
|
+
# @return [HealthQueue]
|
467
|
+
def get_queue_usage(threshold: nil)
|
468
|
+
api_path = '/health/queue/usage'
|
469
|
+
|
470
|
+
api_params = {
|
471
|
+
threshold: threshold,
|
472
|
+
}
|
473
|
+
|
474
|
+
api_headers = {
|
475
|
+
"content-type": 'application/json',
|
476
|
+
}
|
477
|
+
|
478
|
+
@client.call(
|
479
|
+
method: 'GET',
|
480
|
+
path: api_path,
|
481
|
+
headers: api_headers,
|
482
|
+
params: api_params,
|
483
|
+
response_type: Models::HealthQueue
|
484
|
+
)
|
485
|
+
end
|
486
|
+
|
487
|
+
|
488
|
+
# Get the number of projects containing metrics that are waiting to be
|
489
|
+
# processed in the Appwrite internal queue server.
|
490
|
+
#
|
491
|
+
# @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
492
|
+
#
|
493
|
+
# @return [HealthQueue]
|
494
|
+
def get_queue_usage_dump(threshold: nil)
|
495
|
+
api_path = '/health/queue/usage-dump'
|
496
|
+
|
497
|
+
api_params = {
|
498
|
+
threshold: threshold,
|
499
|
+
}
|
500
|
+
|
501
|
+
api_headers = {
|
502
|
+
"content-type": 'application/json',
|
503
|
+
}
|
504
|
+
|
505
|
+
@client.call(
|
506
|
+
method: 'GET',
|
507
|
+
path: api_path,
|
508
|
+
headers: api_headers,
|
509
|
+
params: api_params,
|
510
|
+
response_type: Models::HealthQueue
|
511
|
+
)
|
512
|
+
end
|
513
|
+
|
514
|
+
|
460
515
|
# Get the number of webhooks that are waiting to be processed in the Appwrite
|
461
516
|
# internal queue server.
|
462
517
|
#
|
@@ -484,6 +539,30 @@ module Appwrite
|
|
484
539
|
end
|
485
540
|
|
486
541
|
|
542
|
+
# Check the Appwrite storage device is up and connection is successful.
|
543
|
+
#
|
544
|
+
#
|
545
|
+
# @return [HealthStatus]
|
546
|
+
def get_storage()
|
547
|
+
api_path = '/health/storage'
|
548
|
+
|
549
|
+
api_params = {
|
550
|
+
}
|
551
|
+
|
552
|
+
api_headers = {
|
553
|
+
"content-type": 'application/json',
|
554
|
+
}
|
555
|
+
|
556
|
+
@client.call(
|
557
|
+
method: 'GET',
|
558
|
+
path: api_path,
|
559
|
+
headers: api_headers,
|
560
|
+
params: api_params,
|
561
|
+
response_type: Models::HealthStatus
|
562
|
+
)
|
563
|
+
end
|
564
|
+
|
565
|
+
|
487
566
|
# Check the Appwrite local storage device is up and connection is successful.
|
488
567
|
#
|
489
568
|
#
|