appwrite-cli 0.17.0 → 0.18.2
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.
- package/README.md +4 -4
- package/docs/examples/account/{create-session.md → create-email-session.md} +1 -1
- package/docs/examples/account/create-phone-session.md +3 -0
- package/docs/examples/account/create-phone-verification.md +1 -0
- package/docs/examples/account/update-phone-session.md +3 -0
- package/docs/examples/account/update-phone-verification.md +3 -0
- package/docs/examples/account/update-phone.md +3 -0
- package/docs/examples/{database → databases}/create-boolean-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-collection.md +2 -1
- package/docs/examples/{database → databases}/create-document.md +2 -1
- package/docs/examples/{database → databases}/create-email-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-enum-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-float-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-index.md +2 -1
- package/docs/examples/{database → databases}/create-integer-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-ip-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-string-attribute.md +2 -1
- package/docs/examples/{database → databases}/create-url-attribute.md +2 -1
- package/docs/examples/databases/create.md +3 -0
- package/docs/examples/databases/delete-attribute.md +4 -0
- package/docs/examples/databases/delete-collection.md +3 -0
- package/docs/examples/{database → databases}/delete-document.md +2 -1
- package/docs/examples/databases/delete-index.md +4 -0
- package/docs/examples/databases/delete.md +2 -0
- package/docs/examples/databases/get-attribute.md +4 -0
- package/docs/examples/databases/get-collection-usage.md +4 -0
- package/docs/examples/databases/get-collection.md +3 -0
- package/docs/examples/databases/get-database-usage.md +3 -0
- package/docs/examples/{database → databases}/get-document.md +2 -1
- package/docs/examples/databases/get-index.md +4 -0
- package/docs/examples/databases/get-usage.md +2 -0
- package/docs/examples/databases/get.md +2 -0
- package/docs/examples/databases/list-attributes.md +3 -0
- package/docs/examples/databases/list-collection-logs.md +5 -0
- package/docs/examples/databases/list-collections.md +8 -0
- package/docs/examples/{database → databases}/list-document-logs.md +2 -1
- package/docs/examples/databases/list-documents.md +10 -0
- package/docs/examples/databases/list-indexes.md +3 -0
- package/docs/examples/databases/list-logs.md +4 -0
- package/docs/examples/databases/list.md +7 -0
- package/docs/examples/{database → databases}/update-collection.md +2 -1
- package/docs/examples/{database → databases}/update-document.md +3 -2
- package/docs/examples/databases/update.md +3 -0
- package/docs/examples/projects/create-key.md +2 -1
- package/docs/examples/projects/update-key.md +2 -1
- package/docs/examples/projects/update-webhook-signature.md +3 -0
- package/docs/examples/users/{update-verification.md → update-email-verification.md} +1 -1
- package/docs/examples/users/update-phone-verification.md +3 -0
- package/docs/examples/users/update-phone.md +3 -0
- package/index.js +2 -2
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +3 -3
- package/lib/commands/account.js +202 -31
- package/lib/commands/{database.js → databases.js} +477 -177
- package/lib/commands/deploy.js +1 -1
- package/lib/commands/functions.js +4 -4
- package/lib/commands/projects.js +43 -4
- package/lib/commands/storage.js +3 -3
- package/lib/commands/teams.js +2 -2
- package/lib/commands/users.js +71 -5
- package/lib/questions.js +9 -1
- package/package.json +1 -1
- package/docs/examples/database/delete-attribute.md +0 -3
- package/docs/examples/database/delete-collection.md +0 -2
- package/docs/examples/database/delete-index.md +0 -3
- package/docs/examples/database/get-attribute.md +0 -3
- package/docs/examples/database/get-collection-usage.md +0 -3
- package/docs/examples/database/get-collection.md +0 -2
- package/docs/examples/database/get-index.md +0 -3
- package/docs/examples/database/get-usage.md +0 -2
- package/docs/examples/database/list-attributes.md +0 -2
- package/docs/examples/database/list-collection-logs.md +0 -4
- package/docs/examples/database/list-collections.md +0 -7
- package/docs/examples/database/list-documents.md +0 -9
- package/docs/examples/database/list-indexes.md +0 -2
package/lib/commands/account.js
CHANGED
|
@@ -194,6 +194,35 @@ const accountUpdatePassword = async ({ password, oldPassword, parseOutput = true
|
|
|
194
194
|
return response;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
+
const accountUpdatePhone = async ({ number, password, parseOutput = true, sdk = undefined}) => {
|
|
198
|
+
/* @param {string} number */
|
|
199
|
+
/* @param {string} password */
|
|
200
|
+
|
|
201
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
202
|
+
let path = '/account/phone';
|
|
203
|
+
let payload = {};
|
|
204
|
+
|
|
205
|
+
/** Body Params */
|
|
206
|
+
if (typeof number !== 'undefined') {
|
|
207
|
+
payload['number'] = number;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (typeof password !== 'undefined') {
|
|
211
|
+
payload['password'] = password;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
let response = undefined;
|
|
215
|
+
response = await client.call('patch', path, {
|
|
216
|
+
'content-type': 'application/json',
|
|
217
|
+
}, payload);
|
|
218
|
+
|
|
219
|
+
if (parseOutput) {
|
|
220
|
+
parse(response)
|
|
221
|
+
success()
|
|
222
|
+
}
|
|
223
|
+
return response;
|
|
224
|
+
}
|
|
225
|
+
|
|
197
226
|
const accountGetPrefs = async ({ parseOutput = true, sdk = undefined}) => {
|
|
198
227
|
|
|
199
228
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
@@ -320,25 +349,13 @@ const accountGetSessions = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
320
349
|
return response;
|
|
321
350
|
}
|
|
322
351
|
|
|
323
|
-
const
|
|
324
|
-
/* @param {string} email */
|
|
325
|
-
/* @param {string} password */
|
|
352
|
+
const accountDeleteSessions = async ({ parseOutput = true, sdk = undefined}) => {
|
|
326
353
|
|
|
327
354
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
328
355
|
let path = '/account/sessions';
|
|
329
356
|
let payload = {};
|
|
330
|
-
|
|
331
|
-
/** Body Params */
|
|
332
|
-
if (typeof email !== 'undefined') {
|
|
333
|
-
payload['email'] = email;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
if (typeof password !== 'undefined') {
|
|
337
|
-
payload['password'] = password;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
357
|
let response = undefined;
|
|
341
|
-
response = await client.call('
|
|
358
|
+
response = await client.call('delete', path, {
|
|
342
359
|
'content-type': 'application/json',
|
|
343
360
|
}, payload);
|
|
344
361
|
|
|
@@ -349,13 +366,13 @@ const accountCreateSession = async ({ email, password, parseOutput = true, sdk =
|
|
|
349
366
|
return response;
|
|
350
367
|
}
|
|
351
368
|
|
|
352
|
-
const
|
|
369
|
+
const accountCreateAnonymousSession = async ({ parseOutput = true, sdk = undefined}) => {
|
|
353
370
|
|
|
354
371
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
355
|
-
let path = '/account/sessions';
|
|
372
|
+
let path = '/account/sessions/anonymous';
|
|
356
373
|
let payload = {};
|
|
357
374
|
let response = undefined;
|
|
358
|
-
response = await client.call('
|
|
375
|
+
response = await client.call('post', path, {
|
|
359
376
|
'content-type': 'application/json',
|
|
360
377
|
}, payload);
|
|
361
378
|
|
|
@@ -366,11 +383,23 @@ const accountDeleteSessions = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
366
383
|
return response;
|
|
367
384
|
}
|
|
368
385
|
|
|
369
|
-
const
|
|
386
|
+
const accountCreateEmailSession = async ({ email, password, parseOutput = true, sdk = undefined}) => {
|
|
387
|
+
/* @param {string} email */
|
|
388
|
+
/* @param {string} password */
|
|
370
389
|
|
|
371
390
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
372
|
-
let path = '/account/sessions/
|
|
391
|
+
let path = '/account/sessions/email';
|
|
373
392
|
let payload = {};
|
|
393
|
+
|
|
394
|
+
/** Body Params */
|
|
395
|
+
if (typeof email !== 'undefined') {
|
|
396
|
+
payload['email'] = email;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
if (typeof password !== 'undefined') {
|
|
400
|
+
payload['password'] = password;
|
|
401
|
+
}
|
|
402
|
+
|
|
374
403
|
let response = undefined;
|
|
375
404
|
response = await client.call('post', path, {
|
|
376
405
|
'content-type': 'application/json',
|
|
@@ -478,6 +507,64 @@ const accountCreateOAuth2Session = async ({ provider, success, failure, scopes,
|
|
|
478
507
|
return response;
|
|
479
508
|
}
|
|
480
509
|
|
|
510
|
+
const accountCreatePhoneSession = async ({ userId, number, parseOutput = true, sdk = undefined}) => {
|
|
511
|
+
/* @param {string} userId */
|
|
512
|
+
/* @param {string} number */
|
|
513
|
+
|
|
514
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
515
|
+
let path = '/account/sessions/phone';
|
|
516
|
+
let payload = {};
|
|
517
|
+
|
|
518
|
+
/** Body Params */
|
|
519
|
+
if (typeof userId !== 'undefined') {
|
|
520
|
+
payload['userId'] = userId;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
if (typeof number !== 'undefined') {
|
|
524
|
+
payload['number'] = number;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
let response = undefined;
|
|
528
|
+
response = await client.call('post', path, {
|
|
529
|
+
'content-type': 'application/json',
|
|
530
|
+
}, payload);
|
|
531
|
+
|
|
532
|
+
if (parseOutput) {
|
|
533
|
+
parse(response)
|
|
534
|
+
success()
|
|
535
|
+
}
|
|
536
|
+
return response;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
const accountUpdatePhoneSession = async ({ userId, secret, parseOutput = true, sdk = undefined}) => {
|
|
540
|
+
/* @param {string} userId */
|
|
541
|
+
/* @param {string} secret */
|
|
542
|
+
|
|
543
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
544
|
+
let path = '/account/sessions/phone';
|
|
545
|
+
let payload = {};
|
|
546
|
+
|
|
547
|
+
/** Body Params */
|
|
548
|
+
if (typeof userId !== 'undefined') {
|
|
549
|
+
payload['userId'] = userId;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
if (typeof secret !== 'undefined') {
|
|
553
|
+
payload['secret'] = secret;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
let response = undefined;
|
|
557
|
+
response = await client.call('put', path, {
|
|
558
|
+
'content-type': 'application/json',
|
|
559
|
+
}, payload);
|
|
560
|
+
|
|
561
|
+
if (parseOutput) {
|
|
562
|
+
parse(response)
|
|
563
|
+
success()
|
|
564
|
+
}
|
|
565
|
+
return response;
|
|
566
|
+
}
|
|
567
|
+
|
|
481
568
|
const accountGetSession = async ({ sessionId, parseOutput = true, sdk = undefined}) => {
|
|
482
569
|
/* @param {string} sessionId */
|
|
483
570
|
|
|
@@ -602,6 +689,52 @@ const accountUpdateVerification = async ({ userId, secret, parseOutput = true, s
|
|
|
602
689
|
return response;
|
|
603
690
|
}
|
|
604
691
|
|
|
692
|
+
const accountCreatePhoneVerification = async ({ parseOutput = true, sdk = undefined}) => {
|
|
693
|
+
|
|
694
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
695
|
+
let path = '/account/verification/phone';
|
|
696
|
+
let payload = {};
|
|
697
|
+
let response = undefined;
|
|
698
|
+
response = await client.call('post', path, {
|
|
699
|
+
'content-type': 'application/json',
|
|
700
|
+
}, payload);
|
|
701
|
+
|
|
702
|
+
if (parseOutput) {
|
|
703
|
+
parse(response)
|
|
704
|
+
success()
|
|
705
|
+
}
|
|
706
|
+
return response;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
const accountUpdatePhoneVerification = async ({ userId, secret, parseOutput = true, sdk = undefined}) => {
|
|
710
|
+
/* @param {string} userId */
|
|
711
|
+
/* @param {string} secret */
|
|
712
|
+
|
|
713
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
714
|
+
let path = '/account/verification/phone';
|
|
715
|
+
let payload = {};
|
|
716
|
+
|
|
717
|
+
/** Body Params */
|
|
718
|
+
if (typeof userId !== 'undefined') {
|
|
719
|
+
payload['userId'] = userId;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
if (typeof secret !== 'undefined') {
|
|
723
|
+
payload['secret'] = secret;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
let response = undefined;
|
|
727
|
+
response = await client.call('put', path, {
|
|
728
|
+
'content-type': 'application/json',
|
|
729
|
+
}, payload);
|
|
730
|
+
|
|
731
|
+
if (parseOutput) {
|
|
732
|
+
parse(response)
|
|
733
|
+
success()
|
|
734
|
+
}
|
|
735
|
+
return response;
|
|
736
|
+
}
|
|
737
|
+
|
|
605
738
|
|
|
606
739
|
account
|
|
607
740
|
.command(`get`)
|
|
@@ -649,6 +782,13 @@ account
|
|
|
649
782
|
.option(`--oldPassword <oldPassword>`, `Current user password. Must be at least 8 chars.`)
|
|
650
783
|
.action(actionRunner(accountUpdatePassword))
|
|
651
784
|
|
|
785
|
+
account
|
|
786
|
+
.command(`updatePhone`)
|
|
787
|
+
.description(`Update currently logged in user account phone number. After changing phone number, the user confirmation status will get reset. A new confirmation SMS is not sent automatically however you can use the phone confirmation endpoint again to send the confirmation SMS.`)
|
|
788
|
+
.requiredOption(`--number <number>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
|
|
789
|
+
.requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
|
|
790
|
+
.action(actionRunner(accountUpdatePhone))
|
|
791
|
+
|
|
652
792
|
account
|
|
653
793
|
.command(`getPrefs`)
|
|
654
794
|
.description(`Get currently logged in user preferences as a key-value object.`)
|
|
@@ -681,13 +821,6 @@ account
|
|
|
681
821
|
.description(`Get currently logged in user list of active sessions across different devices.`)
|
|
682
822
|
.action(actionRunner(accountGetSessions))
|
|
683
823
|
|
|
684
|
-
account
|
|
685
|
-
.command(`createSession`)
|
|
686
|
-
.description(`Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.`)
|
|
687
|
-
.requiredOption(`--email <email>`, `User email.`)
|
|
688
|
-
.requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
|
|
689
|
-
.action(actionRunner(accountCreateSession))
|
|
690
|
-
|
|
691
824
|
account
|
|
692
825
|
.command(`deleteSessions`)
|
|
693
826
|
.description(`Delete all sessions from the user account and remove any sessions cookies from the end client.`)
|
|
@@ -698,6 +831,13 @@ account
|
|
|
698
831
|
.description(`Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](/docs/client/account#accountUpdateEmail) or create an [OAuth2 session](/docs/client/account#accountCreateOAuth2Session).`)
|
|
699
832
|
.action(actionRunner(accountCreateAnonymousSession))
|
|
700
833
|
|
|
834
|
+
account
|
|
835
|
+
.command(`createEmailSession`)
|
|
836
|
+
.description(`Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.`)
|
|
837
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
838
|
+
.requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
|
|
839
|
+
.action(actionRunner(accountCreateEmailSession))
|
|
840
|
+
|
|
701
841
|
account
|
|
702
842
|
.command(`createMagicURLSession`)
|
|
703
843
|
.description(`Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT /account/sessions/magic-url](/docs/client/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.`)
|
|
@@ -716,12 +856,26 @@ account
|
|
|
716
856
|
account
|
|
717
857
|
.command(`createOAuth2Session`)
|
|
718
858
|
.description(`Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.. `)
|
|
719
|
-
.requiredOption(`--provider <provider>`, `OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch,
|
|
859
|
+
.requiredOption(`--provider <provider>`, `OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, bitbucket, bitly, box, dailymotion, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoom.`)
|
|
720
860
|
.option(`--success <success>`, `URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project 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.`)
|
|
721
861
|
.option(`--failure <failure>`, `URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project 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.`)
|
|
722
|
-
.option(`--scopes <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
|
|
862
|
+
.option(`--scopes <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.`)
|
|
723
863
|
.action(actionRunner(accountCreateOAuth2Session))
|
|
724
864
|
|
|
865
|
+
account
|
|
866
|
+
.command(`createPhoneSession`)
|
|
867
|
+
.description(`Sends the user a SMS with a secret key for creating a session. Use the returned user ID and the secret to submit a request to the [PUT /account/sessions/phone](/docs/client/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.`)
|
|
868
|
+
.requiredOption(`--userId <userId>`, `Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. 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.`)
|
|
869
|
+
.requiredOption(`--number <number>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
|
|
870
|
+
.action(actionRunner(accountCreatePhoneSession))
|
|
871
|
+
|
|
872
|
+
account
|
|
873
|
+
.command(`updatePhoneSession`)
|
|
874
|
+
.description(`Use this endpoint to complete creating the session with the Magic URL. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/sessions/magic-url](/docs/client/account#accountCreateMagicURLSession) endpoint. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.`)
|
|
875
|
+
.requiredOption(`--userId <userId>`, `User ID.`)
|
|
876
|
+
.requiredOption(`--secret <secret>`, `Valid verification token.`)
|
|
877
|
+
.action(actionRunner(accountUpdatePhoneSession))
|
|
878
|
+
|
|
725
879
|
account
|
|
726
880
|
.command(`getSession`)
|
|
727
881
|
.description(`Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.`)
|
|
@@ -747,7 +901,7 @@ account
|
|
|
747
901
|
|
|
748
902
|
account
|
|
749
903
|
.command(`createVerification`)
|
|
750
|
-
.description(`Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#
|
|
904
|
+
.description(`Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#accountUpdateEmailVerification). The verification link sent to the user's email address is valid for 7 days. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. `)
|
|
751
905
|
.requiredOption(`--url <url>`, `URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project 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.`)
|
|
752
906
|
.action(actionRunner(accountCreateVerification))
|
|
753
907
|
|
|
@@ -758,6 +912,18 @@ account
|
|
|
758
912
|
.requiredOption(`--secret <secret>`, `Valid verification token.`)
|
|
759
913
|
.action(actionRunner(accountUpdateVerification))
|
|
760
914
|
|
|
915
|
+
account
|
|
916
|
+
.command(`createPhoneVerification`)
|
|
917
|
+
.description(`Use this endpoint to send a verification message to your user's phone number to confirm they are the valid owners of that address. The provided secret should allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#accountUpdatePhoneVerification). The verification link sent to the user's phone number is valid for 15 minutes.`)
|
|
918
|
+
.action(actionRunner(accountCreatePhoneVerification))
|
|
919
|
+
|
|
920
|
+
account
|
|
921
|
+
.command(`updatePhoneVerification`)
|
|
922
|
+
.description(`Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.`)
|
|
923
|
+
.requiredOption(`--userId <userId>`, `User ID.`)
|
|
924
|
+
.requiredOption(`--secret <secret>`, `Valid verification token.`)
|
|
925
|
+
.action(actionRunner(accountUpdatePhoneVerification))
|
|
926
|
+
|
|
761
927
|
|
|
762
928
|
module.exports = {
|
|
763
929
|
account,
|
|
@@ -768,21 +934,26 @@ module.exports = {
|
|
|
768
934
|
accountGetLogs,
|
|
769
935
|
accountUpdateName,
|
|
770
936
|
accountUpdatePassword,
|
|
937
|
+
accountUpdatePhone,
|
|
771
938
|
accountGetPrefs,
|
|
772
939
|
accountUpdatePrefs,
|
|
773
940
|
accountCreateRecovery,
|
|
774
941
|
accountUpdateRecovery,
|
|
775
942
|
accountGetSessions,
|
|
776
|
-
accountCreateSession,
|
|
777
943
|
accountDeleteSessions,
|
|
778
944
|
accountCreateAnonymousSession,
|
|
945
|
+
accountCreateEmailSession,
|
|
779
946
|
accountCreateMagicURLSession,
|
|
780
947
|
accountUpdateMagicURLSession,
|
|
781
948
|
accountCreateOAuth2Session,
|
|
949
|
+
accountCreatePhoneSession,
|
|
950
|
+
accountUpdatePhoneSession,
|
|
782
951
|
accountGetSession,
|
|
783
952
|
accountUpdateSession,
|
|
784
953
|
accountDeleteSession,
|
|
785
954
|
accountUpdateStatus,
|
|
786
955
|
accountCreateVerification,
|
|
787
|
-
accountUpdateVerification
|
|
956
|
+
accountUpdateVerification,
|
|
957
|
+
accountCreatePhoneVerification,
|
|
958
|
+
accountUpdatePhoneVerification
|
|
788
959
|
};
|