appwrite 28.3.2 → 28.4.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 +20 -4
- data/lib/appwrite/enums/billing_plan_group.rb +2 -0
- data/lib/appwrite/enums/build_runtime.rb +2 -0
- data/lib/appwrite/enums/databases_index_type.rb +1 -0
- data/lib/appwrite/enums/domain_registration_type.rb +10 -0
- data/lib/appwrite/enums/domain_transfer_status_enum.rb +14 -0
- data/lib/appwrite/enums/framework.rb +1 -0
- data/lib/appwrite/enums/id_token_provider.rb +8 -0
- data/lib/appwrite/enums/image_gravity.rb +1 -0
- data/lib/appwrite/enums/o_auth2_auth0_prompt.rb +9 -0
- data/lib/appwrite/enums/o_auth2_discord_prompt.rb +8 -0
- data/lib/appwrite/enums/o_auth2_github_prompt.rb +7 -0
- data/lib/appwrite/enums/o_auth2_kakao_prompt.rb +10 -0
- data/lib/appwrite/enums/o_auth2_microsoft_prompt.rb +10 -0
- data/lib/appwrite/enums/o_auth2_okta_prompt.rb +9 -0
- data/lib/appwrite/enums/o_auth2_salesforce_prompt.rb +8 -0
- data/lib/appwrite/enums/o_auth2_zoho_prompt.rb +7 -0
- data/lib/appwrite/enums/o_auth_provider.rb +3 -0
- data/lib/appwrite/enums/project_email_template_id.rb +2 -0
- data/lib/appwrite/enums/project_key_scopes.rb +4 -0
- data/lib/appwrite/enums/project_o_auth2_auth0_prompt.rb +9 -0
- data/lib/appwrite/enums/project_o_auth2_discord_prompt.rb +8 -0
- data/lib/appwrite/enums/project_o_auth2_git_hub_prompt.rb +7 -0
- data/lib/appwrite/enums/project_o_auth2_kakao_prompt.rb +10 -0
- data/lib/appwrite/enums/project_o_auth2_microsoft_prompt.rb +10 -0
- data/lib/appwrite/enums/project_o_auth2_okta_prompt.rb +9 -0
- data/lib/appwrite/enums/project_o_auth2_salesforce_prompt.rb +8 -0
- data/lib/appwrite/enums/project_o_auth2_zoho_prompt.rb +7 -0
- data/lib/appwrite/enums/project_o_auth_provider_id.rb +3 -0
- data/lib/appwrite/enums/project_policy_id.rb +2 -0
- data/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb +1 -0
- data/lib/appwrite/enums/runtime.rb +2 -0
- data/lib/appwrite/enums/tables_db_index_type.rb +1 -0
- data/lib/appwrite/enums/waf_rule_action.rb +11 -0
- data/lib/appwrite/models/account.rb +143 -0
- data/lib/appwrite/models/billing_plan.rb +12 -0
- data/lib/appwrite/models/dedicated_database.rb +15 -0
- data/lib/appwrite/models/dedicated_database_specification.rb +20 -0
- data/lib/appwrite/models/dns_record.rb +83 -0
- data/lib/appwrite/models/dns_records_list.rb +33 -0
- data/lib/appwrite/models/domain.rb +109 -0
- data/lib/appwrite/models/domain_price.rb +63 -0
- data/lib/appwrite/models/domain_prices_list.rb +33 -0
- data/lib/appwrite/models/domain_transfer_status.rb +59 -0
- data/lib/appwrite/models/domains_list.rb +33 -0
- data/lib/appwrite/models/identity.rb +8 -3
- data/lib/appwrite/models/o_auth2_apple.rb +13 -3
- data/lib/appwrite/models/o_auth2_auth0.rb +23 -0
- data/lib/appwrite/models/o_auth2_discord.rb +25 -3
- data/lib/appwrite/models/o_auth2_github.rb +24 -3
- data/lib/appwrite/models/o_auth2_google.rb +17 -5
- data/lib/appwrite/models/o_auth2_kakao.rb +67 -0
- data/lib/appwrite/models/o_auth2_microsoft.rb +24 -0
- data/lib/appwrite/models/o_auth2_oidc.rb +4 -2
- data/lib/appwrite/models/o_auth2_okta.rb +23 -0
- data/lib/appwrite/models/o_auth2_salesforce.rb +25 -3
- data/lib/appwrite/models/o_auth2_tik_tok.rb +43 -0
- data/lib/appwrite/models/o_auth2_webflow.rb +43 -0
- data/lib/appwrite/models/o_auth2_zoho.rb +24 -3
- data/lib/appwrite/models/oauth2_introspection.rb +83 -0
- data/lib/appwrite/models/platform_android.rb +8 -3
- data/lib/appwrite/models/policy_password_pwned.rb +43 -0
- data/lib/appwrite/models/policy_password_rotation.rb +38 -0
- data/lib/appwrite/models/project.rb +15 -0
- data/lib/appwrite/models/proxy_rule.rb +1 -0
- data/lib/appwrite/models/topic.rb +13 -3
- data/lib/appwrite/models/user.rb +5 -0
- data/lib/appwrite/models/waf_rule_bypass.rb +111 -0
- data/lib/appwrite/models/waf_rule_challenge.rb +126 -0
- data/lib/appwrite/models/waf_rule_deny.rb +111 -0
- data/lib/appwrite/models/waf_rule_list.rb +33 -0
- data/lib/appwrite/models/waf_rule_rate_limit.rb +136 -0
- data/lib/appwrite/models/waf_rule_redirect.rb +121 -0
- data/lib/appwrite/services/account.rb +301 -5
- data/lib/appwrite/services/avatars.rb +71 -0
- data/lib/appwrite/services/databases.rb +4 -1
- data/lib/appwrite/services/documents_db.rb +4 -1
- data/lib/appwrite/services/domains.rb +2318 -0
- data/lib/appwrite/services/functions.rb +11 -3
- data/lib/appwrite/services/locale.rb +49 -14
- data/lib/appwrite/services/messaging.rb +130 -6
- data/lib/appwrite/services/oauth2.rb +45 -0
- data/lib/appwrite/services/organization.rb +225 -0
- data/lib/appwrite/services/project.rb +439 -15
- data/lib/appwrite/services/sites.rb +11 -3
- data/lib/appwrite/services/tables_db.rb +4 -1
- data/lib/appwrite/services/teams.rb +4 -1
- data/lib/appwrite/services/vectors_db.rb +4 -1
- data/lib/appwrite/services/waf.rb +859 -0
- data/lib/appwrite.rb +42 -0
- metadata +44 -2
|
@@ -1260,15 +1260,122 @@ module Appwrite
|
|
|
1260
1260
|
)
|
|
1261
1261
|
end
|
|
1262
1262
|
|
|
1263
|
+
# Use this endpoint to send a 6-digit password recovery code to the user's
|
|
1264
|
+
# email address. Unlike
|
|
1265
|
+
# [createRecovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery),
|
|
1266
|
+
# this method requires no redirect URL, which makes it suitable for mobile
|
|
1267
|
+
# and desktop apps that cannot host a recovery page. Learn more about how to
|
|
1268
|
+
# [complete the recovery
|
|
1269
|
+
# process](https://appwrite.io/docs/references/cloud/client-web/account#updateRecoveryOTP).
|
|
1270
|
+
# The code sent to the user's email address is valid for 15 minutes.
|
|
1271
|
+
#
|
|
1272
|
+
# Enable the **phrase** parameter to include a randomly generated security
|
|
1273
|
+
# phrase in both the email and the response. Showing that phrase in your app
|
|
1274
|
+
# lets the user confirm the email genuinely came from your request, which
|
|
1275
|
+
# helps protect against phishing.
|
|
1276
|
+
#
|
|
1277
|
+
#
|
|
1278
|
+
# @param [String] email User email.
|
|
1279
|
+
# @param [] phrase Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
|
|
1280
|
+
#
|
|
1281
|
+
# @return [Token]
|
|
1282
|
+
def create_recovery_otp(
|
|
1283
|
+
email:,
|
|
1284
|
+
phrase: nil
|
|
1285
|
+
)
|
|
1286
|
+
if email.nil?
|
|
1287
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
|
1288
|
+
end
|
|
1289
|
+
|
|
1290
|
+
api_path = '/account/recovery/otp'
|
|
1291
|
+
|
|
1292
|
+
api_params = {
|
|
1293
|
+
email: email,
|
|
1294
|
+
phrase: phrase,
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
api_headers = {
|
|
1298
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
1299
|
+
"content-type": 'application/json',
|
|
1300
|
+
"accept": 'application/json',
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
@client.call(
|
|
1304
|
+
method: 'POST',
|
|
1305
|
+
path: api_path,
|
|
1306
|
+
headers: api_headers,
|
|
1307
|
+
params: api_params,
|
|
1308
|
+
response_type: Models::Token
|
|
1309
|
+
)
|
|
1310
|
+
end
|
|
1311
|
+
|
|
1312
|
+
# Use this endpoint to complete the user password recovery process using the
|
|
1313
|
+
# 6-digit code that was emailed by
|
|
1314
|
+
# [createRecoveryOTP](https://appwrite.io/docs/references/cloud/client-web/account#createRecoveryOTP).
|
|
1315
|
+
# Pass the **userId** of the user along with the **secret** code from the
|
|
1316
|
+
# email and the new **password** to set. If confirmed, this route will return
|
|
1317
|
+
# a 200 status code, the code is consumed and the user's password is updated.
|
|
1318
|
+
#
|
|
1319
|
+
#
|
|
1320
|
+
# @param [String] user_id User ID.
|
|
1321
|
+
# @param [String] secret Valid recovery OTP code.
|
|
1322
|
+
# @param [String] password New user password. Must be between 8 and 256 chars.
|
|
1323
|
+
#
|
|
1324
|
+
# @return [Token]
|
|
1325
|
+
def update_recovery_otp(
|
|
1326
|
+
user_id:,
|
|
1327
|
+
secret:,
|
|
1328
|
+
password:
|
|
1329
|
+
)
|
|
1330
|
+
if user_id.nil?
|
|
1331
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
1332
|
+
end
|
|
1333
|
+
|
|
1334
|
+
if secret.nil?
|
|
1335
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
1336
|
+
end
|
|
1337
|
+
|
|
1338
|
+
if password.nil?
|
|
1339
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
|
1340
|
+
end
|
|
1341
|
+
|
|
1342
|
+
api_path = '/account/recovery/otp'
|
|
1343
|
+
|
|
1344
|
+
api_params = {
|
|
1345
|
+
userId: user_id,
|
|
1346
|
+
secret: secret,
|
|
1347
|
+
password: password,
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
api_headers = {
|
|
1351
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
1352
|
+
"content-type": 'application/json',
|
|
1353
|
+
"accept": 'application/json',
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
@client.call(
|
|
1357
|
+
method: 'PUT',
|
|
1358
|
+
path: api_path,
|
|
1359
|
+
headers: api_headers,
|
|
1360
|
+
params: api_params,
|
|
1361
|
+
response_type: Models::Token
|
|
1362
|
+
)
|
|
1363
|
+
end
|
|
1364
|
+
|
|
1263
1365
|
# Get the list of active sessions across different devices for the currently
|
|
1264
1366
|
# logged in user.
|
|
1265
1367
|
#
|
|
1368
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
1266
1369
|
#
|
|
1267
1370
|
# @return [SessionList]
|
|
1268
|
-
def list_sessions(
|
|
1371
|
+
def list_sessions(
|
|
1372
|
+
total: nil
|
|
1373
|
+
)
|
|
1269
1374
|
api_path = '/account/sessions'
|
|
1270
1375
|
|
|
1271
|
-
api_params = {
|
|
1376
|
+
api_params = {
|
|
1377
|
+
total: total,
|
|
1378
|
+
}
|
|
1272
1379
|
|
|
1273
1380
|
api_headers = {
|
|
1274
1381
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
@@ -1287,12 +1394,17 @@ module Appwrite
|
|
|
1287
1394
|
# Delete all sessions from the user account and remove any sessions cookies
|
|
1288
1395
|
# from the end client.
|
|
1289
1396
|
#
|
|
1397
|
+
# @param [] current Delete the current session too. Use false to sign out of every other session while staying signed in on this one.
|
|
1290
1398
|
#
|
|
1291
1399
|
# @return []
|
|
1292
|
-
def delete_sessions(
|
|
1400
|
+
def delete_sessions(
|
|
1401
|
+
current: nil
|
|
1402
|
+
)
|
|
1293
1403
|
api_path = '/account/sessions'
|
|
1294
1404
|
|
|
1295
|
-
api_params = {
|
|
1405
|
+
api_params = {
|
|
1406
|
+
current: current,
|
|
1407
|
+
}
|
|
1296
1408
|
|
|
1297
1409
|
api_headers = {
|
|
1298
1410
|
"X-Appwrite-Project": @client.get_config('project'),
|
|
@@ -1346,11 +1458,13 @@ module Appwrite
|
|
|
1346
1458
|
#
|
|
1347
1459
|
# @param [String] email User email.
|
|
1348
1460
|
# @param [String] password User password. Must be at least 8 chars.
|
|
1461
|
+
# @param [Integer] duration Session length in seconds. Minimum is 60 seconds, and it cannot exceed the project maximum session length. Defaults to the project maximum session length.
|
|
1349
1462
|
#
|
|
1350
1463
|
# @return [Session]
|
|
1351
1464
|
def create_email_password_session(
|
|
1352
1465
|
email:,
|
|
1353
|
-
password
|
|
1466
|
+
password:,
|
|
1467
|
+
duration: nil
|
|
1354
1468
|
)
|
|
1355
1469
|
api_path = '/account/sessions/email'
|
|
1356
1470
|
|
|
@@ -1365,6 +1479,100 @@ module Appwrite
|
|
|
1365
1479
|
api_params = {
|
|
1366
1480
|
email: email,
|
|
1367
1481
|
password: password,
|
|
1482
|
+
duration: duration,
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
api_headers = {
|
|
1486
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
1487
|
+
"content-type": 'application/json',
|
|
1488
|
+
"accept": 'application/json',
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
@client.call(
|
|
1492
|
+
method: 'POST',
|
|
1493
|
+
path: api_path,
|
|
1494
|
+
headers: api_headers,
|
|
1495
|
+
params: api_params,
|
|
1496
|
+
response_type: Models::Session
|
|
1497
|
+
)
|
|
1498
|
+
end
|
|
1499
|
+
|
|
1500
|
+
# Allow the user to login to their account using an OpenID Connect ID token
|
|
1501
|
+
# obtained natively from the OAuth2 provider, for example via Google
|
|
1502
|
+
# Credential Manager on Android or Sign in with Apple on iOS. No browser or
|
|
1503
|
+
# redirect is involved: the ID token is verified against the provider's
|
|
1504
|
+
# published signing keys and a session is created in a single request.
|
|
1505
|
+
#
|
|
1506
|
+
# Native sign-in is switched on per provider with its nativeEnabled setting.
|
|
1507
|
+
# It is independent of the browser-based flow's enabled setting, which has no
|
|
1508
|
+
# effect on this endpoint. The token's audience must match the provider's
|
|
1509
|
+
# configured client ID or one of its native client IDs; tokens issued for any
|
|
1510
|
+
# other client ID are rejected. For Sign in with Apple, register your app's
|
|
1511
|
+
# bundle ID as a native client ID. For Google, the web client ID used by
|
|
1512
|
+
# Credential Manager is usually the configured client ID; add your Android
|
|
1513
|
+
# and iOS client IDs as native client IDs if your app requests tokens for
|
|
1514
|
+
# them.
|
|
1515
|
+
#
|
|
1516
|
+
# Pass the raw nonce used when requesting the ID token so it can be validated
|
|
1517
|
+
# against the token's nonce claim. When signing in with Apple, the nonce is
|
|
1518
|
+
# required: hash it with SHA-256 before passing it to the Apple SDK, and send
|
|
1519
|
+
# the raw value here - Apple tokens requested without a nonce are rejected.
|
|
1520
|
+
# For Google the nonce is optional: it is validated whenever the token
|
|
1521
|
+
# carries one, and ignored when the provider issued the token without one.
|
|
1522
|
+
# Apple only returns the user's name on the first authorization, and never
|
|
1523
|
+
# inside the ID token - capture it on the client and pass it via the name
|
|
1524
|
+
# parameter.
|
|
1525
|
+
#
|
|
1526
|
+
# If there is already an active session, the new session will be attached to
|
|
1527
|
+
# the logged-in account. If there are no active sessions, the server will
|
|
1528
|
+
# attempt to look for a user with the same email address as the verified
|
|
1529
|
+
# email received from the provider and attach the new session to the existing
|
|
1530
|
+
# user. If no matching user is found - the server will create a new user.
|
|
1531
|
+
#
|
|
1532
|
+
# This flow does not return provider refresh tokens. You may pass an access
|
|
1533
|
+
# token the provider handed your client, along with its lifetime, to store it
|
|
1534
|
+
# on the session - but Appwrite cannot renew it once it expires. If your app
|
|
1535
|
+
# needs long-lived access to provider APIs, use the browser-based OAuth2 flow
|
|
1536
|
+
# instead.
|
|
1537
|
+
#
|
|
1538
|
+
# A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1539
|
+
# about session
|
|
1540
|
+
# limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1541
|
+
#
|
|
1542
|
+
#
|
|
1543
|
+
# @param [IdTokenProvider] provider OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google.
|
|
1544
|
+
# @param [String] id_token OpenID Connect ID token (JWT) obtained natively from the provider, for example via Google Credential Manager or Sign in with Apple.
|
|
1545
|
+
# @param [String] nonce Raw nonce used when requesting the ID token. Required for Apple, and whenever the token carries a nonce claim, which must match it. Ignored when the provider issued the token without a nonce.
|
|
1546
|
+
# @param [String] access_token Provider access token to store alongside the session for calling provider APIs. Never used for authentication.
|
|
1547
|
+
# @param [Integer] access_token_expiry Seconds until the provider access token expires, as reported by the provider. Stored so clients can tell when the stored token goes stale.
|
|
1548
|
+
# @param [String] name User name. Only used when creating a new user and the ID token has no name claim, such as on the first Sign in with Apple authorization.
|
|
1549
|
+
#
|
|
1550
|
+
# @return [Session]
|
|
1551
|
+
def create_id_token_session(
|
|
1552
|
+
provider:,
|
|
1553
|
+
id_token:,
|
|
1554
|
+
nonce: nil,
|
|
1555
|
+
access_token: nil,
|
|
1556
|
+
access_token_expiry: nil,
|
|
1557
|
+
name: nil
|
|
1558
|
+
)
|
|
1559
|
+
if provider.nil?
|
|
1560
|
+
raise Appwrite::Exception.new('Missing required parameter: "provider"')
|
|
1561
|
+
end
|
|
1562
|
+
|
|
1563
|
+
if id_token.nil?
|
|
1564
|
+
raise Appwrite::Exception.new('Missing required parameter: "idToken"')
|
|
1565
|
+
end
|
|
1566
|
+
|
|
1567
|
+
api_path = '/account/sessions/id-token'
|
|
1568
|
+
|
|
1569
|
+
api_params = {
|
|
1570
|
+
provider: provider,
|
|
1571
|
+
idToken: id_token,
|
|
1572
|
+
nonce: nonce,
|
|
1573
|
+
accessToken: access_token,
|
|
1574
|
+
accessTokenExpiry: access_token_expiry,
|
|
1575
|
+
name: name,
|
|
1368
1576
|
}
|
|
1369
1577
|
|
|
1370
1578
|
api_headers = {
|
|
@@ -2125,6 +2333,94 @@ module Appwrite
|
|
|
2125
2333
|
)
|
|
2126
2334
|
end
|
|
2127
2335
|
|
|
2336
|
+
# Use this endpoint to send a 6-digit verification code to the currently
|
|
2337
|
+
# logged in user's email address. Unlike
|
|
2338
|
+
# [createEmailVerification](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerification),
|
|
2339
|
+
# this method requires no redirect URL, which makes it suitable for mobile
|
|
2340
|
+
# and desktop apps that cannot host a verification page. Learn more about how
|
|
2341
|
+
# to [complete the verification
|
|
2342
|
+
# process](https://appwrite.io/docs/references/cloud/client-web/account#updateEmailVerificationOTP).
|
|
2343
|
+
# The code sent to the user's email address is valid for 15 minutes.
|
|
2344
|
+
#
|
|
2345
|
+
# Enable the **phrase** parameter to include a randomly generated security
|
|
2346
|
+
# phrase in both the email and the response. Showing that phrase in your app
|
|
2347
|
+
# lets the user confirm the email genuinely came from your request, which
|
|
2348
|
+
# helps protect against phishing.
|
|
2349
|
+
#
|
|
2350
|
+
#
|
|
2351
|
+
# @param [] phrase Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
|
|
2352
|
+
#
|
|
2353
|
+
# @return [Token]
|
|
2354
|
+
def create_email_verification_otp(
|
|
2355
|
+
phrase: nil
|
|
2356
|
+
)
|
|
2357
|
+
api_path = '/account/verifications/email/otp'
|
|
2358
|
+
|
|
2359
|
+
api_params = {
|
|
2360
|
+
phrase: phrase,
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
api_headers = {
|
|
2364
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
2365
|
+
"content-type": 'application/json',
|
|
2366
|
+
"accept": 'application/json',
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
@client.call(
|
|
2370
|
+
method: 'POST',
|
|
2371
|
+
path: api_path,
|
|
2372
|
+
headers: api_headers,
|
|
2373
|
+
params: api_params,
|
|
2374
|
+
response_type: Models::Token
|
|
2375
|
+
)
|
|
2376
|
+
end
|
|
2377
|
+
|
|
2378
|
+
# Use this endpoint to complete the user email verification process using the
|
|
2379
|
+
# 6-digit code that was emailed by
|
|
2380
|
+
# [createEmailVerificationOTP](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerificationOTP).
|
|
2381
|
+
# Pass the **userId** of the user being verified along with the **secret**
|
|
2382
|
+
# code from the email. If confirmed, this route will return a 200 status code
|
|
2383
|
+
# and the code is consumed.
|
|
2384
|
+
#
|
|
2385
|
+
#
|
|
2386
|
+
# @param [String] user_id User ID.
|
|
2387
|
+
# @param [String] secret Valid verification OTP code.
|
|
2388
|
+
#
|
|
2389
|
+
# @return [Token]
|
|
2390
|
+
def update_email_verification_otp(
|
|
2391
|
+
user_id:,
|
|
2392
|
+
secret:
|
|
2393
|
+
)
|
|
2394
|
+
if user_id.nil?
|
|
2395
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
|
2396
|
+
end
|
|
2397
|
+
|
|
2398
|
+
if secret.nil?
|
|
2399
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
|
2400
|
+
end
|
|
2401
|
+
|
|
2402
|
+
api_path = '/account/verifications/email/otp'
|
|
2403
|
+
|
|
2404
|
+
api_params = {
|
|
2405
|
+
userId: user_id,
|
|
2406
|
+
secret: secret,
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
api_headers = {
|
|
2410
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
2411
|
+
"content-type": 'application/json',
|
|
2412
|
+
"accept": 'application/json',
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
@client.call(
|
|
2416
|
+
method: 'PUT',
|
|
2417
|
+
path: api_path,
|
|
2418
|
+
headers: api_headers,
|
|
2419
|
+
params: api_params,
|
|
2420
|
+
response_type: Models::Token
|
|
2421
|
+
)
|
|
2422
|
+
end
|
|
2423
|
+
|
|
2128
2424
|
# Use this endpoint to send a verification SMS to the currently logged in
|
|
2129
2425
|
# user. This endpoint is meant for use after updating a user's phone number
|
|
2130
2426
|
# using the
|
|
@@ -346,6 +346,77 @@ module Appwrite
|
|
|
346
346
|
)
|
|
347
347
|
end
|
|
348
348
|
|
|
349
|
+
# Update the profile photo of the currently authenticated user. The uploaded
|
|
350
|
+
# image takes priority over every other photo source, including OAuth2
|
|
351
|
+
# identity photos, Gravatar, and Libravatar. Updating an already customized
|
|
352
|
+
# photo replaces it. The image must be at most 5MB and is sent in a single
|
|
353
|
+
# request.
|
|
354
|
+
#
|
|
355
|
+
# @param [file] file Binary image file of at most 5MB. Allowed file types are png, jpg, jpeg, and webp.
|
|
356
|
+
#
|
|
357
|
+
# @return [Account]
|
|
358
|
+
def update_photo(
|
|
359
|
+
file:,
|
|
360
|
+
on_progress: nil
|
|
361
|
+
)
|
|
362
|
+
if file.nil?
|
|
363
|
+
raise Appwrite::Exception.new('Missing required parameter: "file"')
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
api_path = '/avatars/photo'
|
|
367
|
+
|
|
368
|
+
api_params = {
|
|
369
|
+
file: file,
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
api_headers = {
|
|
373
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
374
|
+
"content-type": 'multipart/form-data',
|
|
375
|
+
"accept": 'application/json',
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
id_param_name = nil
|
|
379
|
+
param_name = 'file'
|
|
380
|
+
|
|
381
|
+
@client.chunked_upload(
|
|
382
|
+
path: api_path,
|
|
383
|
+
headers: api_headers,
|
|
384
|
+
params: api_params,
|
|
385
|
+
param_name: param_name,
|
|
386
|
+
id_param_name: id_param_name,
|
|
387
|
+
on_progress: on_progress,
|
|
388
|
+
method: 'PUT',
|
|
389
|
+
response_type: Models::Account
|
|
390
|
+
)
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
# Delete the profile photo of the currently authenticated user and store the
|
|
394
|
+
# built-in static placeholder in its place. The placeholder is the user's
|
|
395
|
+
# photo from then on, so it takes priority over every other photo source —
|
|
396
|
+
# OAuth2 identity photos, Gravatar, Libravatar, and initials — until a new
|
|
397
|
+
# photo is uploaded with avatars.updatePhoto.
|
|
398
|
+
#
|
|
399
|
+
#
|
|
400
|
+
# @return []
|
|
401
|
+
def delete_photo()
|
|
402
|
+
api_path = '/avatars/photo'
|
|
403
|
+
|
|
404
|
+
api_params = {}
|
|
405
|
+
|
|
406
|
+
api_headers = {
|
|
407
|
+
"X-Appwrite-Project": @client.get_config('project'),
|
|
408
|
+
"content-type": 'application/json',
|
|
409
|
+
"accept": 'application/json',
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
@client.call(
|
|
413
|
+
method: 'DELETE',
|
|
414
|
+
path: api_path,
|
|
415
|
+
headers: api_headers,
|
|
416
|
+
params: api_params,
|
|
417
|
+
)
|
|
418
|
+
end
|
|
419
|
+
|
|
349
420
|
# Converts a given plain text to a QR code image. You can use the query
|
|
350
421
|
# parameters to change the size and style of the resulting image.
|
|
351
422
|
#
|
|
@@ -97,15 +97,18 @@ module Appwrite
|
|
|
97
97
|
# List transactions across all databases.
|
|
98
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).
|
|
100
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
100
101
|
#
|
|
101
102
|
# @return [TransactionList]
|
|
102
103
|
def list_transactions(
|
|
103
|
-
queries: nil
|
|
104
|
+
queries: nil,
|
|
105
|
+
total: nil
|
|
104
106
|
)
|
|
105
107
|
api_path = '/databases/transactions'
|
|
106
108
|
|
|
107
109
|
api_params = {
|
|
108
110
|
queries: queries,
|
|
111
|
+
total: total,
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
api_headers = {
|
|
@@ -119,15 +119,18 @@ module Appwrite
|
|
|
119
119
|
# List transactions across all databases.
|
|
120
120
|
#
|
|
121
121
|
# @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).
|
|
122
|
+
# @param [] total When set to false, the total count returned will be 0 and will not be calculated.
|
|
122
123
|
#
|
|
123
124
|
# @return [TransactionList]
|
|
124
125
|
def list_transactions(
|
|
125
|
-
queries: nil
|
|
126
|
+
queries: nil,
|
|
127
|
+
total: nil
|
|
126
128
|
)
|
|
127
129
|
api_path = '/documentsdb/transactions'
|
|
128
130
|
|
|
129
131
|
api_params = {
|
|
130
132
|
queries: queries,
|
|
133
|
+
total: total,
|
|
131
134
|
}
|
|
132
135
|
|
|
133
136
|
api_headers = {
|