appwrite-cli 5.0.3 → 6.0.0-rc.1
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/functions/create-build.md +1 -1
- package/docs/examples/functions/create-execution.md +1 -0
- package/docs/examples/functions/create.md +1 -0
- package/docs/examples/functions/delete-execution.md +3 -0
- package/docs/examples/functions/update-deployment-build.md +3 -0
- package/docs/examples/functions/update.md +1 -0
- package/docs/examples/messaging/update-email.md +1 -0
- package/docs/examples/projects/create-j-w-t.md +4 -0
- package/docs/examples/projects/update-mock-numbers.md +3 -0
- package/docs/examples/projects/update-session-alerts.md +3 -0
- package/docs/examples/users/create-j-w-t.md +4 -0
- package/docs/examples/vcs/get-repository-contents.md +4 -0
- package/index.js +34 -7
- package/install.ps1 +3 -3
- package/install.sh +2 -2
- package/lib/client.js +19 -5
- package/lib/commands/account.js +307 -153
- package/lib/commands/assistant.js +8 -5
- package/lib/commands/avatars.js +116 -60
- package/lib/commands/console.js +8 -5
- package/lib/commands/databases.js +353 -164
- package/lib/commands/functions.js +310 -100
- package/lib/commands/generic.js +206 -54
- package/lib/commands/graphql.js +14 -8
- package/lib/commands/health.js +140 -71
- package/lib/commands/init.js +250 -155
- package/lib/commands/locale.js +50 -26
- package/lib/commands/messaging.js +363 -179
- package/lib/commands/migrations.js +98 -50
- package/lib/commands/project.js +38 -20
- package/lib/commands/projects.js +449 -144
- package/lib/commands/proxy.js +32 -17
- package/lib/commands/pull.js +231 -0
- package/lib/commands/push.js +1518 -0
- package/lib/commands/run.js +282 -0
- package/lib/commands/storage.js +160 -76
- package/lib/commands/teams.js +102 -50
- package/lib/commands/users.js +325 -135
- package/lib/commands/vcs.js +102 -29
- package/lib/config.js +190 -18
- package/lib/emulation/docker.js +187 -0
- package/lib/emulation/utils.js +177 -0
- package/lib/id.js +30 -0
- package/lib/paginate.js +1 -2
- package/lib/parser.js +69 -12
- package/lib/questions.js +462 -84
- package/lib/sdks.js +1 -1
- package/lib/spinner.js +103 -0
- package/lib/utils.js +248 -3
- package/lib/validations.js +17 -0
- package/package.json +6 -2
- package/scoop/appwrite.json +3 -3
- package/lib/commands/deploy.js +0 -941
package/lib/commands/account.js
CHANGED
|
@@ -4,7 +4,7 @@ const tar = require("tar");
|
|
|
4
4
|
const ignore = require("ignore");
|
|
5
5
|
const { promisify } = require('util');
|
|
6
6
|
const libClient = require('../client.js');
|
|
7
|
-
const { getAllFiles } = require('../utils.js');
|
|
7
|
+
const { getAllFiles, showConsoleLink } = require('../utils.js');
|
|
8
8
|
const { Command } = require('commander');
|
|
9
9
|
const { sdkForProject, sdkForConsole } = require('../sdks')
|
|
10
10
|
const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser')
|
|
@@ -41,6 +41,7 @@ const account = new Command("account").description(commandDescriptions['account'
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @typedef {Object} AccountGetRequestParams
|
|
44
|
+
* @property {boolean} overrideForCli
|
|
44
45
|
* @property {boolean} parseOutput
|
|
45
46
|
* @property {libClient | undefined} sdk
|
|
46
47
|
*/
|
|
@@ -48,8 +49,9 @@ const account = new Command("account").description(commandDescriptions['account'
|
|
|
48
49
|
/**
|
|
49
50
|
* @param {AccountGetRequestParams} params
|
|
50
51
|
*/
|
|
51
|
-
const accountGet = async ({
|
|
52
|
-
let client = !sdk ? await sdkForProject() :
|
|
52
|
+
const accountGet = async ({parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
53
|
+
let client = !sdk ? await sdkForProject() :
|
|
54
|
+
sdk;
|
|
53
55
|
let apiPath = '/account';
|
|
54
56
|
let payload = {};
|
|
55
57
|
|
|
@@ -60,11 +62,16 @@ const accountGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
60
62
|
}, payload);
|
|
61
63
|
|
|
62
64
|
if (parseOutput) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
if(console) {
|
|
66
|
+
showConsoleLink('account', 'get');
|
|
67
|
+
} else {
|
|
68
|
+
parse(response)
|
|
69
|
+
success()
|
|
70
|
+
}
|
|
65
71
|
}
|
|
66
|
-
|
|
72
|
+
|
|
67
73
|
return response;
|
|
74
|
+
|
|
68
75
|
}
|
|
69
76
|
|
|
70
77
|
/**
|
|
@@ -73,6 +80,7 @@ const accountGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
73
80
|
* @property {string} email User email.
|
|
74
81
|
* @property {string} password New user password. Must be between 8 and 256 chars.
|
|
75
82
|
* @property {string} name User name. Max length: 128 chars.
|
|
83
|
+
* @property {boolean} overrideForCli
|
|
76
84
|
* @property {boolean} parseOutput
|
|
77
85
|
* @property {libClient | undefined} sdk
|
|
78
86
|
*/
|
|
@@ -80,8 +88,9 @@ const accountGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
80
88
|
/**
|
|
81
89
|
* @param {AccountCreateRequestParams} params
|
|
82
90
|
*/
|
|
83
|
-
const accountCreate = async ({
|
|
84
|
-
let client = !sdk ? await sdkForProject() :
|
|
91
|
+
const accountCreate = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
92
|
+
let client = !sdk ? await sdkForProject() :
|
|
93
|
+
sdk;
|
|
85
94
|
let apiPath = '/account';
|
|
86
95
|
let payload = {};
|
|
87
96
|
if (typeof userId !== 'undefined') {
|
|
@@ -107,12 +116,14 @@ const accountCreate = async ({ userId, email, password, name, parseOutput = true
|
|
|
107
116
|
parse(response)
|
|
108
117
|
success()
|
|
109
118
|
}
|
|
110
|
-
|
|
119
|
+
|
|
111
120
|
return response;
|
|
121
|
+
|
|
112
122
|
}
|
|
113
123
|
|
|
114
124
|
/**
|
|
115
125
|
* @typedef {Object} AccountDeleteRequestParams
|
|
126
|
+
* @property {boolean} overrideForCli
|
|
116
127
|
* @property {boolean} parseOutput
|
|
117
128
|
* @property {libClient | undefined} sdk
|
|
118
129
|
*/
|
|
@@ -120,8 +131,9 @@ const accountCreate = async ({ userId, email, password, name, parseOutput = true
|
|
|
120
131
|
/**
|
|
121
132
|
* @param {AccountDeleteRequestParams} params
|
|
122
133
|
*/
|
|
123
|
-
const accountDelete = async ({
|
|
124
|
-
let client = !sdk ? await sdkForProject() :
|
|
134
|
+
const accountDelete = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
135
|
+
let client = !sdk ? await sdkForProject() :
|
|
136
|
+
sdk;
|
|
125
137
|
let apiPath = '/account';
|
|
126
138
|
let payload = {};
|
|
127
139
|
|
|
@@ -135,14 +147,16 @@ const accountDelete = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
135
147
|
parse(response)
|
|
136
148
|
success()
|
|
137
149
|
}
|
|
138
|
-
|
|
150
|
+
|
|
139
151
|
return response;
|
|
152
|
+
|
|
140
153
|
}
|
|
141
154
|
|
|
142
155
|
/**
|
|
143
156
|
* @typedef {Object} AccountUpdateEmailRequestParams
|
|
144
157
|
* @property {string} email User email.
|
|
145
158
|
* @property {string} password User password. Must be at least 8 chars.
|
|
159
|
+
* @property {boolean} overrideForCli
|
|
146
160
|
* @property {boolean} parseOutput
|
|
147
161
|
* @property {libClient | undefined} sdk
|
|
148
162
|
*/
|
|
@@ -150,8 +164,9 @@ const accountDelete = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
150
164
|
/**
|
|
151
165
|
* @param {AccountUpdateEmailRequestParams} params
|
|
152
166
|
*/
|
|
153
|
-
const accountUpdateEmail = async ({
|
|
154
|
-
let client = !sdk ? await sdkForProject() :
|
|
167
|
+
const accountUpdateEmail = async ({email,password,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
168
|
+
let client = !sdk ? await sdkForProject() :
|
|
169
|
+
sdk;
|
|
155
170
|
let apiPath = '/account/email';
|
|
156
171
|
let payload = {};
|
|
157
172
|
if (typeof email !== 'undefined') {
|
|
@@ -171,13 +186,15 @@ const accountUpdateEmail = async ({ email, password, parseOutput = true, sdk = u
|
|
|
171
186
|
parse(response)
|
|
172
187
|
success()
|
|
173
188
|
}
|
|
174
|
-
|
|
189
|
+
|
|
175
190
|
return response;
|
|
191
|
+
|
|
176
192
|
}
|
|
177
193
|
|
|
178
194
|
/**
|
|
179
195
|
* @typedef {Object} AccountListIdentitiesRequestParams
|
|
180
196
|
* @property {string[]} 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: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry
|
|
197
|
+
* @property {boolean} overrideForCli
|
|
181
198
|
* @property {boolean} parseOutput
|
|
182
199
|
* @property {libClient | undefined} sdk
|
|
183
200
|
*/
|
|
@@ -185,8 +202,9 @@ const accountUpdateEmail = async ({ email, password, parseOutput = true, sdk = u
|
|
|
185
202
|
/**
|
|
186
203
|
* @param {AccountListIdentitiesRequestParams} params
|
|
187
204
|
*/
|
|
188
|
-
const accountListIdentities = async ({
|
|
189
|
-
let client = !sdk ? await sdkForProject() :
|
|
205
|
+
const accountListIdentities = async ({queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
206
|
+
let client = !sdk ? await sdkForProject() :
|
|
207
|
+
sdk;
|
|
190
208
|
let apiPath = '/account/identities';
|
|
191
209
|
let payload = {};
|
|
192
210
|
if (typeof queries !== 'undefined') {
|
|
@@ -203,13 +221,15 @@ const accountListIdentities = async ({ queries, parseOutput = true, sdk = undefi
|
|
|
203
221
|
parse(response)
|
|
204
222
|
success()
|
|
205
223
|
}
|
|
206
|
-
|
|
224
|
+
|
|
207
225
|
return response;
|
|
226
|
+
|
|
208
227
|
}
|
|
209
228
|
|
|
210
229
|
/**
|
|
211
230
|
* @typedef {Object} AccountDeleteIdentityRequestParams
|
|
212
231
|
* @property {string} identityId Identity ID.
|
|
232
|
+
* @property {boolean} overrideForCli
|
|
213
233
|
* @property {boolean} parseOutput
|
|
214
234
|
* @property {libClient | undefined} sdk
|
|
215
235
|
*/
|
|
@@ -217,8 +237,9 @@ const accountListIdentities = async ({ queries, parseOutput = true, sdk = undefi
|
|
|
217
237
|
/**
|
|
218
238
|
* @param {AccountDeleteIdentityRequestParams} params
|
|
219
239
|
*/
|
|
220
|
-
const accountDeleteIdentity = async ({
|
|
221
|
-
let client = !sdk ? await sdkForProject() :
|
|
240
|
+
const accountDeleteIdentity = async ({identityId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
241
|
+
let client = !sdk ? await sdkForProject() :
|
|
242
|
+
sdk;
|
|
222
243
|
let apiPath = '/account/identities/{identityId}'.replace('{identityId}', identityId);
|
|
223
244
|
let payload = {};
|
|
224
245
|
|
|
@@ -232,12 +253,14 @@ const accountDeleteIdentity = async ({ identityId, parseOutput = true, sdk = und
|
|
|
232
253
|
parse(response)
|
|
233
254
|
success()
|
|
234
255
|
}
|
|
235
|
-
|
|
256
|
+
|
|
236
257
|
return response;
|
|
258
|
+
|
|
237
259
|
}
|
|
238
260
|
|
|
239
261
|
/**
|
|
240
262
|
* @typedef {Object} AccountCreateJWTRequestParams
|
|
263
|
+
* @property {boolean} overrideForCli
|
|
241
264
|
* @property {boolean} parseOutput
|
|
242
265
|
* @property {libClient | undefined} sdk
|
|
243
266
|
*/
|
|
@@ -245,9 +268,10 @@ const accountDeleteIdentity = async ({ identityId, parseOutput = true, sdk = und
|
|
|
245
268
|
/**
|
|
246
269
|
* @param {AccountCreateJWTRequestParams} params
|
|
247
270
|
*/
|
|
248
|
-
const accountCreateJWT = async ({
|
|
249
|
-
let client = !sdk ? await sdkForProject() :
|
|
250
|
-
|
|
271
|
+
const accountCreateJWT = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
272
|
+
let client = !sdk ? await sdkForProject() :
|
|
273
|
+
sdk;
|
|
274
|
+
let apiPath = '/account/jwts';
|
|
251
275
|
let payload = {};
|
|
252
276
|
|
|
253
277
|
let response = undefined;
|
|
@@ -260,13 +284,15 @@ const accountCreateJWT = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
260
284
|
parse(response)
|
|
261
285
|
success()
|
|
262
286
|
}
|
|
263
|
-
|
|
287
|
+
|
|
264
288
|
return response;
|
|
289
|
+
|
|
265
290
|
}
|
|
266
291
|
|
|
267
292
|
/**
|
|
268
293
|
* @typedef {Object} AccountListLogsRequestParams
|
|
269
294
|
* @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
295
|
+
* @property {boolean} overrideForCli
|
|
270
296
|
* @property {boolean} parseOutput
|
|
271
297
|
* @property {libClient | undefined} sdk
|
|
272
298
|
*/
|
|
@@ -274,8 +300,9 @@ const accountCreateJWT = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
274
300
|
/**
|
|
275
301
|
* @param {AccountListLogsRequestParams} params
|
|
276
302
|
*/
|
|
277
|
-
const accountListLogs = async ({
|
|
278
|
-
let client = !sdk ? await sdkForProject() :
|
|
303
|
+
const accountListLogs = async ({queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
304
|
+
let client = !sdk ? await sdkForProject() :
|
|
305
|
+
sdk;
|
|
279
306
|
let apiPath = '/account/logs';
|
|
280
307
|
let payload = {};
|
|
281
308
|
if (typeof queries !== 'undefined') {
|
|
@@ -292,13 +319,15 @@ const accountListLogs = async ({ queries, parseOutput = true, sdk = undefined})
|
|
|
292
319
|
parse(response)
|
|
293
320
|
success()
|
|
294
321
|
}
|
|
295
|
-
|
|
322
|
+
|
|
296
323
|
return response;
|
|
324
|
+
|
|
297
325
|
}
|
|
298
326
|
|
|
299
327
|
/**
|
|
300
328
|
* @typedef {Object} AccountUpdateMFARequestParams
|
|
301
329
|
* @property {boolean} mfa Enable or disable MFA.
|
|
330
|
+
* @property {boolean} overrideForCli
|
|
302
331
|
* @property {boolean} parseOutput
|
|
303
332
|
* @property {libClient | undefined} sdk
|
|
304
333
|
*/
|
|
@@ -306,8 +335,9 @@ const accountListLogs = async ({ queries, parseOutput = true, sdk = undefined})
|
|
|
306
335
|
/**
|
|
307
336
|
* @param {AccountUpdateMFARequestParams} params
|
|
308
337
|
*/
|
|
309
|
-
const accountUpdateMFA = async ({
|
|
310
|
-
let client = !sdk ? await sdkForProject() :
|
|
338
|
+
const accountUpdateMFA = async ({mfa,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
339
|
+
let client = !sdk ? await sdkForProject() :
|
|
340
|
+
sdk;
|
|
311
341
|
let apiPath = '/account/mfa';
|
|
312
342
|
let payload = {};
|
|
313
343
|
if (typeof mfa !== 'undefined') {
|
|
@@ -324,13 +354,15 @@ const accountUpdateMFA = async ({ mfa, parseOutput = true, sdk = undefined}) =>
|
|
|
324
354
|
parse(response)
|
|
325
355
|
success()
|
|
326
356
|
}
|
|
327
|
-
|
|
357
|
+
|
|
328
358
|
return response;
|
|
359
|
+
|
|
329
360
|
}
|
|
330
361
|
|
|
331
362
|
/**
|
|
332
363
|
* @typedef {Object} AccountCreateMfaAuthenticatorRequestParams
|
|
333
364
|
* @property {AuthenticatorType} type Type of authenticator. Must be 'totp'
|
|
365
|
+
* @property {boolean} overrideForCli
|
|
334
366
|
* @property {boolean} parseOutput
|
|
335
367
|
* @property {libClient | undefined} sdk
|
|
336
368
|
*/
|
|
@@ -338,8 +370,9 @@ const accountUpdateMFA = async ({ mfa, parseOutput = true, sdk = undefined}) =>
|
|
|
338
370
|
/**
|
|
339
371
|
* @param {AccountCreateMfaAuthenticatorRequestParams} params
|
|
340
372
|
*/
|
|
341
|
-
const accountCreateMfaAuthenticator = async ({
|
|
342
|
-
let client = !sdk ? await sdkForProject() :
|
|
373
|
+
const accountCreateMfaAuthenticator = async ({type,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
374
|
+
let client = !sdk ? await sdkForProject() :
|
|
375
|
+
sdk;
|
|
343
376
|
let apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
344
377
|
let payload = {};
|
|
345
378
|
|
|
@@ -353,14 +386,16 @@ const accountCreateMfaAuthenticator = async ({ type, parseOutput = true, sdk = u
|
|
|
353
386
|
parse(response)
|
|
354
387
|
success()
|
|
355
388
|
}
|
|
356
|
-
|
|
389
|
+
|
|
357
390
|
return response;
|
|
391
|
+
|
|
358
392
|
}
|
|
359
393
|
|
|
360
394
|
/**
|
|
361
395
|
* @typedef {Object} AccountUpdateMfaAuthenticatorRequestParams
|
|
362
396
|
* @property {AuthenticatorType} type Type of authenticator.
|
|
363
397
|
* @property {string} otp Valid verification token.
|
|
398
|
+
* @property {boolean} overrideForCli
|
|
364
399
|
* @property {boolean} parseOutput
|
|
365
400
|
* @property {libClient | undefined} sdk
|
|
366
401
|
*/
|
|
@@ -368,8 +403,9 @@ const accountCreateMfaAuthenticator = async ({ type, parseOutput = true, sdk = u
|
|
|
368
403
|
/**
|
|
369
404
|
* @param {AccountUpdateMfaAuthenticatorRequestParams} params
|
|
370
405
|
*/
|
|
371
|
-
const accountUpdateMfaAuthenticator = async ({
|
|
372
|
-
let client = !sdk ? await sdkForProject() :
|
|
406
|
+
const accountUpdateMfaAuthenticator = async ({type,otp,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
407
|
+
let client = !sdk ? await sdkForProject() :
|
|
408
|
+
sdk;
|
|
373
409
|
let apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
374
410
|
let payload = {};
|
|
375
411
|
if (typeof otp !== 'undefined') {
|
|
@@ -386,14 +422,16 @@ const accountUpdateMfaAuthenticator = async ({ type, otp, parseOutput = true, sd
|
|
|
386
422
|
parse(response)
|
|
387
423
|
success()
|
|
388
424
|
}
|
|
389
|
-
|
|
425
|
+
|
|
390
426
|
return response;
|
|
427
|
+
|
|
391
428
|
}
|
|
392
429
|
|
|
393
430
|
/**
|
|
394
431
|
* @typedef {Object} AccountDeleteMfaAuthenticatorRequestParams
|
|
395
432
|
* @property {AuthenticatorType} type Type of authenticator.
|
|
396
433
|
* @property {string} otp Valid verification token.
|
|
434
|
+
* @property {boolean} overrideForCli
|
|
397
435
|
* @property {boolean} parseOutput
|
|
398
436
|
* @property {libClient | undefined} sdk
|
|
399
437
|
*/
|
|
@@ -401,8 +439,9 @@ const accountUpdateMfaAuthenticator = async ({ type, otp, parseOutput = true, sd
|
|
|
401
439
|
/**
|
|
402
440
|
* @param {AccountDeleteMfaAuthenticatorRequestParams} params
|
|
403
441
|
*/
|
|
404
|
-
const accountDeleteMfaAuthenticator = async ({
|
|
405
|
-
let client = !sdk ? await sdkForProject() :
|
|
442
|
+
const accountDeleteMfaAuthenticator = async ({type,otp,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
443
|
+
let client = !sdk ? await sdkForProject() :
|
|
444
|
+
sdk;
|
|
406
445
|
let apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
407
446
|
let payload = {};
|
|
408
447
|
if (typeof otp !== 'undefined') {
|
|
@@ -419,13 +458,15 @@ const accountDeleteMfaAuthenticator = async ({ type, otp, parseOutput = true, sd
|
|
|
419
458
|
parse(response)
|
|
420
459
|
success()
|
|
421
460
|
}
|
|
422
|
-
|
|
461
|
+
|
|
423
462
|
return response;
|
|
463
|
+
|
|
424
464
|
}
|
|
425
465
|
|
|
426
466
|
/**
|
|
427
467
|
* @typedef {Object} AccountCreateMfaChallengeRequestParams
|
|
428
468
|
* @property {AuthenticationFactor} factor Factor used for verification. Must be one of following: 'email', 'phone', 'totp', 'recoveryCode'.
|
|
469
|
+
* @property {boolean} overrideForCli
|
|
429
470
|
* @property {boolean} parseOutput
|
|
430
471
|
* @property {libClient | undefined} sdk
|
|
431
472
|
*/
|
|
@@ -433,8 +474,9 @@ const accountDeleteMfaAuthenticator = async ({ type, otp, parseOutput = true, sd
|
|
|
433
474
|
/**
|
|
434
475
|
* @param {AccountCreateMfaChallengeRequestParams} params
|
|
435
476
|
*/
|
|
436
|
-
const accountCreateMfaChallenge = async ({
|
|
437
|
-
let client = !sdk ? await sdkForProject() :
|
|
477
|
+
const accountCreateMfaChallenge = async ({factor,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
478
|
+
let client = !sdk ? await sdkForProject() :
|
|
479
|
+
sdk;
|
|
438
480
|
let apiPath = '/account/mfa/challenge';
|
|
439
481
|
let payload = {};
|
|
440
482
|
if (typeof factor !== 'undefined') {
|
|
@@ -451,14 +493,16 @@ const accountCreateMfaChallenge = async ({ factor, parseOutput = true, sdk = und
|
|
|
451
493
|
parse(response)
|
|
452
494
|
success()
|
|
453
495
|
}
|
|
454
|
-
|
|
496
|
+
|
|
455
497
|
return response;
|
|
498
|
+
|
|
456
499
|
}
|
|
457
500
|
|
|
458
501
|
/**
|
|
459
502
|
* @typedef {Object} AccountUpdateMfaChallengeRequestParams
|
|
460
503
|
* @property {string} challengeId ID of the challenge.
|
|
461
504
|
* @property {string} otp Valid verification token.
|
|
505
|
+
* @property {boolean} overrideForCli
|
|
462
506
|
* @property {boolean} parseOutput
|
|
463
507
|
* @property {libClient | undefined} sdk
|
|
464
508
|
*/
|
|
@@ -466,8 +510,9 @@ const accountCreateMfaChallenge = async ({ factor, parseOutput = true, sdk = und
|
|
|
466
510
|
/**
|
|
467
511
|
* @param {AccountUpdateMfaChallengeRequestParams} params
|
|
468
512
|
*/
|
|
469
|
-
const accountUpdateMfaChallenge = async ({
|
|
470
|
-
let client = !sdk ? await sdkForProject() :
|
|
513
|
+
const accountUpdateMfaChallenge = async ({challengeId,otp,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
514
|
+
let client = !sdk ? await sdkForProject() :
|
|
515
|
+
sdk;
|
|
471
516
|
let apiPath = '/account/mfa/challenge';
|
|
472
517
|
let payload = {};
|
|
473
518
|
if (typeof challengeId !== 'undefined') {
|
|
@@ -487,12 +532,14 @@ const accountUpdateMfaChallenge = async ({ challengeId, otp, parseOutput = true,
|
|
|
487
532
|
parse(response)
|
|
488
533
|
success()
|
|
489
534
|
}
|
|
490
|
-
|
|
535
|
+
|
|
491
536
|
return response;
|
|
537
|
+
|
|
492
538
|
}
|
|
493
539
|
|
|
494
540
|
/**
|
|
495
541
|
* @typedef {Object} AccountListMfaFactorsRequestParams
|
|
542
|
+
* @property {boolean} overrideForCli
|
|
496
543
|
* @property {boolean} parseOutput
|
|
497
544
|
* @property {libClient | undefined} sdk
|
|
498
545
|
*/
|
|
@@ -500,8 +547,9 @@ const accountUpdateMfaChallenge = async ({ challengeId, otp, parseOutput = true,
|
|
|
500
547
|
/**
|
|
501
548
|
* @param {AccountListMfaFactorsRequestParams} params
|
|
502
549
|
*/
|
|
503
|
-
const accountListMfaFactors = async ({
|
|
504
|
-
let client = !sdk ? await sdkForProject() :
|
|
550
|
+
const accountListMfaFactors = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
551
|
+
let client = !sdk ? await sdkForProject() :
|
|
552
|
+
sdk;
|
|
505
553
|
let apiPath = '/account/mfa/factors';
|
|
506
554
|
let payload = {};
|
|
507
555
|
|
|
@@ -515,12 +563,14 @@ const accountListMfaFactors = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
515
563
|
parse(response)
|
|
516
564
|
success()
|
|
517
565
|
}
|
|
518
|
-
|
|
566
|
+
|
|
519
567
|
return response;
|
|
568
|
+
|
|
520
569
|
}
|
|
521
570
|
|
|
522
571
|
/**
|
|
523
572
|
* @typedef {Object} AccountGetMfaRecoveryCodesRequestParams
|
|
573
|
+
* @property {boolean} overrideForCli
|
|
524
574
|
* @property {boolean} parseOutput
|
|
525
575
|
* @property {libClient | undefined} sdk
|
|
526
576
|
*/
|
|
@@ -528,8 +578,9 @@ const accountListMfaFactors = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
528
578
|
/**
|
|
529
579
|
* @param {AccountGetMfaRecoveryCodesRequestParams} params
|
|
530
580
|
*/
|
|
531
|
-
const accountGetMfaRecoveryCodes = async ({
|
|
532
|
-
let client = !sdk ? await sdkForProject() :
|
|
581
|
+
const accountGetMfaRecoveryCodes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
582
|
+
let client = !sdk ? await sdkForProject() :
|
|
583
|
+
sdk;
|
|
533
584
|
let apiPath = '/account/mfa/recovery-codes';
|
|
534
585
|
let payload = {};
|
|
535
586
|
|
|
@@ -543,12 +594,14 @@ const accountGetMfaRecoveryCodes = async ({ parseOutput = true, sdk = undefined}
|
|
|
543
594
|
parse(response)
|
|
544
595
|
success()
|
|
545
596
|
}
|
|
546
|
-
|
|
597
|
+
|
|
547
598
|
return response;
|
|
599
|
+
|
|
548
600
|
}
|
|
549
601
|
|
|
550
602
|
/**
|
|
551
603
|
* @typedef {Object} AccountCreateMfaRecoveryCodesRequestParams
|
|
604
|
+
* @property {boolean} overrideForCli
|
|
552
605
|
* @property {boolean} parseOutput
|
|
553
606
|
* @property {libClient | undefined} sdk
|
|
554
607
|
*/
|
|
@@ -556,8 +609,9 @@ const accountGetMfaRecoveryCodes = async ({ parseOutput = true, sdk = undefined}
|
|
|
556
609
|
/**
|
|
557
610
|
* @param {AccountCreateMfaRecoveryCodesRequestParams} params
|
|
558
611
|
*/
|
|
559
|
-
const accountCreateMfaRecoveryCodes = async ({
|
|
560
|
-
let client = !sdk ? await sdkForProject() :
|
|
612
|
+
const accountCreateMfaRecoveryCodes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
613
|
+
let client = !sdk ? await sdkForProject() :
|
|
614
|
+
sdk;
|
|
561
615
|
let apiPath = '/account/mfa/recovery-codes';
|
|
562
616
|
let payload = {};
|
|
563
617
|
|
|
@@ -571,12 +625,14 @@ const accountCreateMfaRecoveryCodes = async ({ parseOutput = true, sdk = undefin
|
|
|
571
625
|
parse(response)
|
|
572
626
|
success()
|
|
573
627
|
}
|
|
574
|
-
|
|
628
|
+
|
|
575
629
|
return response;
|
|
630
|
+
|
|
576
631
|
}
|
|
577
632
|
|
|
578
633
|
/**
|
|
579
634
|
* @typedef {Object} AccountUpdateMfaRecoveryCodesRequestParams
|
|
635
|
+
* @property {boolean} overrideForCli
|
|
580
636
|
* @property {boolean} parseOutput
|
|
581
637
|
* @property {libClient | undefined} sdk
|
|
582
638
|
*/
|
|
@@ -584,8 +640,9 @@ const accountCreateMfaRecoveryCodes = async ({ parseOutput = true, sdk = undefin
|
|
|
584
640
|
/**
|
|
585
641
|
* @param {AccountUpdateMfaRecoveryCodesRequestParams} params
|
|
586
642
|
*/
|
|
587
|
-
const accountUpdateMfaRecoveryCodes = async ({
|
|
588
|
-
let client = !sdk ? await sdkForProject() :
|
|
643
|
+
const accountUpdateMfaRecoveryCodes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
644
|
+
let client = !sdk ? await sdkForProject() :
|
|
645
|
+
sdk;
|
|
589
646
|
let apiPath = '/account/mfa/recovery-codes';
|
|
590
647
|
let payload = {};
|
|
591
648
|
|
|
@@ -599,13 +656,15 @@ const accountUpdateMfaRecoveryCodes = async ({ parseOutput = true, sdk = undefin
|
|
|
599
656
|
parse(response)
|
|
600
657
|
success()
|
|
601
658
|
}
|
|
602
|
-
|
|
659
|
+
|
|
603
660
|
return response;
|
|
661
|
+
|
|
604
662
|
}
|
|
605
663
|
|
|
606
664
|
/**
|
|
607
665
|
* @typedef {Object} AccountUpdateNameRequestParams
|
|
608
666
|
* @property {string} name User name. Max length: 128 chars.
|
|
667
|
+
* @property {boolean} overrideForCli
|
|
609
668
|
* @property {boolean} parseOutput
|
|
610
669
|
* @property {libClient | undefined} sdk
|
|
611
670
|
*/
|
|
@@ -613,8 +672,9 @@ const accountUpdateMfaRecoveryCodes = async ({ parseOutput = true, sdk = undefin
|
|
|
613
672
|
/**
|
|
614
673
|
* @param {AccountUpdateNameRequestParams} params
|
|
615
674
|
*/
|
|
616
|
-
const accountUpdateName = async ({
|
|
617
|
-
let client = !sdk ? await sdkForProject() :
|
|
675
|
+
const accountUpdateName = async ({name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
676
|
+
let client = !sdk ? await sdkForProject() :
|
|
677
|
+
sdk;
|
|
618
678
|
let apiPath = '/account/name';
|
|
619
679
|
let payload = {};
|
|
620
680
|
if (typeof name !== 'undefined') {
|
|
@@ -631,14 +691,16 @@ const accountUpdateName = async ({ name, parseOutput = true, sdk = undefined}) =
|
|
|
631
691
|
parse(response)
|
|
632
692
|
success()
|
|
633
693
|
}
|
|
634
|
-
|
|
694
|
+
|
|
635
695
|
return response;
|
|
696
|
+
|
|
636
697
|
}
|
|
637
698
|
|
|
638
699
|
/**
|
|
639
700
|
* @typedef {Object} AccountUpdatePasswordRequestParams
|
|
640
701
|
* @property {string} password New user password. Must be at least 8 chars.
|
|
641
702
|
* @property {string} oldPassword Current user password. Must be at least 8 chars.
|
|
703
|
+
* @property {boolean} overrideForCli
|
|
642
704
|
* @property {boolean} parseOutput
|
|
643
705
|
* @property {libClient | undefined} sdk
|
|
644
706
|
*/
|
|
@@ -646,8 +708,9 @@ const accountUpdateName = async ({ name, parseOutput = true, sdk = undefined}) =
|
|
|
646
708
|
/**
|
|
647
709
|
* @param {AccountUpdatePasswordRequestParams} params
|
|
648
710
|
*/
|
|
649
|
-
const accountUpdatePassword = async ({
|
|
650
|
-
let client = !sdk ? await sdkForProject() :
|
|
711
|
+
const accountUpdatePassword = async ({password,oldPassword,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
712
|
+
let client = !sdk ? await sdkForProject() :
|
|
713
|
+
sdk;
|
|
651
714
|
let apiPath = '/account/password';
|
|
652
715
|
let payload = {};
|
|
653
716
|
if (typeof password !== 'undefined') {
|
|
@@ -667,14 +730,16 @@ const accountUpdatePassword = async ({ password, oldPassword, parseOutput = true
|
|
|
667
730
|
parse(response)
|
|
668
731
|
success()
|
|
669
732
|
}
|
|
670
|
-
|
|
733
|
+
|
|
671
734
|
return response;
|
|
735
|
+
|
|
672
736
|
}
|
|
673
737
|
|
|
674
738
|
/**
|
|
675
739
|
* @typedef {Object} AccountUpdatePhoneRequestParams
|
|
676
740
|
* @property {string} phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
677
741
|
* @property {string} password User password. Must be at least 8 chars.
|
|
742
|
+
* @property {boolean} overrideForCli
|
|
678
743
|
* @property {boolean} parseOutput
|
|
679
744
|
* @property {libClient | undefined} sdk
|
|
680
745
|
*/
|
|
@@ -682,8 +747,9 @@ const accountUpdatePassword = async ({ password, oldPassword, parseOutput = true
|
|
|
682
747
|
/**
|
|
683
748
|
* @param {AccountUpdatePhoneRequestParams} params
|
|
684
749
|
*/
|
|
685
|
-
const accountUpdatePhone = async ({
|
|
686
|
-
let client = !sdk ? await sdkForProject() :
|
|
750
|
+
const accountUpdatePhone = async ({phone,password,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
751
|
+
let client = !sdk ? await sdkForProject() :
|
|
752
|
+
sdk;
|
|
687
753
|
let apiPath = '/account/phone';
|
|
688
754
|
let payload = {};
|
|
689
755
|
if (typeof phone !== 'undefined') {
|
|
@@ -703,12 +769,14 @@ const accountUpdatePhone = async ({ phone, password, parseOutput = true, sdk = u
|
|
|
703
769
|
parse(response)
|
|
704
770
|
success()
|
|
705
771
|
}
|
|
706
|
-
|
|
772
|
+
|
|
707
773
|
return response;
|
|
774
|
+
|
|
708
775
|
}
|
|
709
776
|
|
|
710
777
|
/**
|
|
711
778
|
* @typedef {Object} AccountGetPrefsRequestParams
|
|
779
|
+
* @property {boolean} overrideForCli
|
|
712
780
|
* @property {boolean} parseOutput
|
|
713
781
|
* @property {libClient | undefined} sdk
|
|
714
782
|
*/
|
|
@@ -716,8 +784,9 @@ const accountUpdatePhone = async ({ phone, password, parseOutput = true, sdk = u
|
|
|
716
784
|
/**
|
|
717
785
|
* @param {AccountGetPrefsRequestParams} params
|
|
718
786
|
*/
|
|
719
|
-
const accountGetPrefs = async ({
|
|
720
|
-
let client = !sdk ? await sdkForProject() :
|
|
787
|
+
const accountGetPrefs = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
788
|
+
let client = !sdk ? await sdkForProject() :
|
|
789
|
+
sdk;
|
|
721
790
|
let apiPath = '/account/prefs';
|
|
722
791
|
let payload = {};
|
|
723
792
|
|
|
@@ -731,13 +800,15 @@ const accountGetPrefs = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
731
800
|
parse(response)
|
|
732
801
|
success()
|
|
733
802
|
}
|
|
734
|
-
|
|
803
|
+
|
|
735
804
|
return response;
|
|
805
|
+
|
|
736
806
|
}
|
|
737
807
|
|
|
738
808
|
/**
|
|
739
809
|
* @typedef {Object} AccountUpdatePrefsRequestParams
|
|
740
810
|
* @property {object} prefs Prefs key-value JSON object.
|
|
811
|
+
* @property {boolean} overrideForCli
|
|
741
812
|
* @property {boolean} parseOutput
|
|
742
813
|
* @property {libClient | undefined} sdk
|
|
743
814
|
*/
|
|
@@ -745,8 +816,9 @@ const accountGetPrefs = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
745
816
|
/**
|
|
746
817
|
* @param {AccountUpdatePrefsRequestParams} params
|
|
747
818
|
*/
|
|
748
|
-
const accountUpdatePrefs = async ({
|
|
749
|
-
let client = !sdk ? await sdkForProject() :
|
|
819
|
+
const accountUpdatePrefs = async ({prefs,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
820
|
+
let client = !sdk ? await sdkForProject() :
|
|
821
|
+
sdk;
|
|
750
822
|
let apiPath = '/account/prefs';
|
|
751
823
|
let payload = {};
|
|
752
824
|
if (typeof prefs !== 'undefined') {
|
|
@@ -763,14 +835,16 @@ const accountUpdatePrefs = async ({ prefs, parseOutput = true, sdk = undefined})
|
|
|
763
835
|
parse(response)
|
|
764
836
|
success()
|
|
765
837
|
}
|
|
766
|
-
|
|
838
|
+
|
|
767
839
|
return response;
|
|
840
|
+
|
|
768
841
|
}
|
|
769
842
|
|
|
770
843
|
/**
|
|
771
844
|
* @typedef {Object} AccountCreateRecoveryRequestParams
|
|
772
845
|
* @property {string} email User email.
|
|
773
846
|
* @property {string} url URL to redirect the user back to your app from the recovery 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.
|
|
847
|
+
* @property {boolean} overrideForCli
|
|
774
848
|
* @property {boolean} parseOutput
|
|
775
849
|
* @property {libClient | undefined} sdk
|
|
776
850
|
*/
|
|
@@ -778,8 +852,9 @@ const accountUpdatePrefs = async ({ prefs, parseOutput = true, sdk = undefined})
|
|
|
778
852
|
/**
|
|
779
853
|
* @param {AccountCreateRecoveryRequestParams} params
|
|
780
854
|
*/
|
|
781
|
-
const accountCreateRecovery = async ({
|
|
782
|
-
let client = !sdk ? await sdkForProject() :
|
|
855
|
+
const accountCreateRecovery = async ({email,url,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
856
|
+
let client = !sdk ? await sdkForProject() :
|
|
857
|
+
sdk;
|
|
783
858
|
let apiPath = '/account/recovery';
|
|
784
859
|
let payload = {};
|
|
785
860
|
if (typeof email !== 'undefined') {
|
|
@@ -799,8 +874,9 @@ const accountCreateRecovery = async ({ email, url, parseOutput = true, sdk = und
|
|
|
799
874
|
parse(response)
|
|
800
875
|
success()
|
|
801
876
|
}
|
|
802
|
-
|
|
877
|
+
|
|
803
878
|
return response;
|
|
879
|
+
|
|
804
880
|
}
|
|
805
881
|
|
|
806
882
|
/**
|
|
@@ -808,6 +884,7 @@ const accountCreateRecovery = async ({ email, url, parseOutput = true, sdk = und
|
|
|
808
884
|
* @property {string} userId User ID.
|
|
809
885
|
* @property {string} secret Valid reset token.
|
|
810
886
|
* @property {string} password New user password. Must be between 8 and 256 chars.
|
|
887
|
+
* @property {boolean} overrideForCli
|
|
811
888
|
* @property {boolean} parseOutput
|
|
812
889
|
* @property {libClient | undefined} sdk
|
|
813
890
|
*/
|
|
@@ -815,8 +892,9 @@ const accountCreateRecovery = async ({ email, url, parseOutput = true, sdk = und
|
|
|
815
892
|
/**
|
|
816
893
|
* @param {AccountUpdateRecoveryRequestParams} params
|
|
817
894
|
*/
|
|
818
|
-
const accountUpdateRecovery = async ({
|
|
819
|
-
let client = !sdk ? await sdkForProject() :
|
|
895
|
+
const accountUpdateRecovery = async ({userId,secret,password,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
896
|
+
let client = !sdk ? await sdkForProject() :
|
|
897
|
+
sdk;
|
|
820
898
|
let apiPath = '/account/recovery';
|
|
821
899
|
let payload = {};
|
|
822
900
|
if (typeof userId !== 'undefined') {
|
|
@@ -839,12 +917,14 @@ const accountUpdateRecovery = async ({ userId, secret, password, parseOutput = t
|
|
|
839
917
|
parse(response)
|
|
840
918
|
success()
|
|
841
919
|
}
|
|
842
|
-
|
|
920
|
+
|
|
843
921
|
return response;
|
|
922
|
+
|
|
844
923
|
}
|
|
845
924
|
|
|
846
925
|
/**
|
|
847
926
|
* @typedef {Object} AccountListSessionsRequestParams
|
|
927
|
+
* @property {boolean} overrideForCli
|
|
848
928
|
* @property {boolean} parseOutput
|
|
849
929
|
* @property {libClient | undefined} sdk
|
|
850
930
|
*/
|
|
@@ -852,8 +932,9 @@ const accountUpdateRecovery = async ({ userId, secret, password, parseOutput = t
|
|
|
852
932
|
/**
|
|
853
933
|
* @param {AccountListSessionsRequestParams} params
|
|
854
934
|
*/
|
|
855
|
-
const accountListSessions = async ({
|
|
856
|
-
let client = !sdk ? await sdkForProject() :
|
|
935
|
+
const accountListSessions = async ({parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
936
|
+
let client = !sdk ? await sdkForProject() :
|
|
937
|
+
sdk;
|
|
857
938
|
let apiPath = '/account/sessions';
|
|
858
939
|
let payload = {};
|
|
859
940
|
|
|
@@ -864,15 +945,21 @@ const accountListSessions = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
864
945
|
}, payload);
|
|
865
946
|
|
|
866
947
|
if (parseOutput) {
|
|
867
|
-
|
|
868
|
-
|
|
948
|
+
if(console) {
|
|
949
|
+
showConsoleLink('account', 'listSessions');
|
|
950
|
+
} else {
|
|
951
|
+
parse(response)
|
|
952
|
+
success()
|
|
953
|
+
}
|
|
869
954
|
}
|
|
870
|
-
|
|
955
|
+
|
|
871
956
|
return response;
|
|
957
|
+
|
|
872
958
|
}
|
|
873
959
|
|
|
874
960
|
/**
|
|
875
961
|
* @typedef {Object} AccountDeleteSessionsRequestParams
|
|
962
|
+
* @property {boolean} overrideForCli
|
|
876
963
|
* @property {boolean} parseOutput
|
|
877
964
|
* @property {libClient | undefined} sdk
|
|
878
965
|
*/
|
|
@@ -880,8 +967,9 @@ const accountListSessions = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
880
967
|
/**
|
|
881
968
|
* @param {AccountDeleteSessionsRequestParams} params
|
|
882
969
|
*/
|
|
883
|
-
const accountDeleteSessions = async ({
|
|
884
|
-
let client = !sdk ? await sdkForProject() :
|
|
970
|
+
const accountDeleteSessions = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
971
|
+
let client = !sdk ? await sdkForProject() :
|
|
972
|
+
sdk;
|
|
885
973
|
let apiPath = '/account/sessions';
|
|
886
974
|
let payload = {};
|
|
887
975
|
|
|
@@ -895,12 +983,14 @@ const accountDeleteSessions = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
895
983
|
parse(response)
|
|
896
984
|
success()
|
|
897
985
|
}
|
|
898
|
-
|
|
986
|
+
|
|
899
987
|
return response;
|
|
988
|
+
|
|
900
989
|
}
|
|
901
990
|
|
|
902
991
|
/**
|
|
903
992
|
* @typedef {Object} AccountCreateAnonymousSessionRequestParams
|
|
993
|
+
* @property {boolean} overrideForCli
|
|
904
994
|
* @property {boolean} parseOutput
|
|
905
995
|
* @property {libClient | undefined} sdk
|
|
906
996
|
*/
|
|
@@ -908,8 +998,9 @@ const accountDeleteSessions = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
908
998
|
/**
|
|
909
999
|
* @param {AccountCreateAnonymousSessionRequestParams} params
|
|
910
1000
|
*/
|
|
911
|
-
const accountCreateAnonymousSession = async ({
|
|
912
|
-
let client = !sdk ? await sdkForProject() :
|
|
1001
|
+
const accountCreateAnonymousSession = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1002
|
+
let client = !sdk ? await sdkForProject() :
|
|
1003
|
+
sdk;
|
|
913
1004
|
let apiPath = '/account/sessions/anonymous';
|
|
914
1005
|
let payload = {};
|
|
915
1006
|
|
|
@@ -923,14 +1014,16 @@ const accountCreateAnonymousSession = async ({ parseOutput = true, sdk = undefin
|
|
|
923
1014
|
parse(response)
|
|
924
1015
|
success()
|
|
925
1016
|
}
|
|
926
|
-
|
|
1017
|
+
|
|
927
1018
|
return response;
|
|
1019
|
+
|
|
928
1020
|
}
|
|
929
1021
|
|
|
930
1022
|
/**
|
|
931
1023
|
* @typedef {Object} AccountCreateEmailPasswordSessionRequestParams
|
|
932
1024
|
* @property {string} email User email.
|
|
933
1025
|
* @property {string} password User password. Must be at least 8 chars.
|
|
1026
|
+
* @property {boolean} overrideForCli
|
|
934
1027
|
* @property {boolean} parseOutput
|
|
935
1028
|
* @property {libClient | undefined} sdk
|
|
936
1029
|
*/
|
|
@@ -938,8 +1031,9 @@ const accountCreateAnonymousSession = async ({ parseOutput = true, sdk = undefin
|
|
|
938
1031
|
/**
|
|
939
1032
|
* @param {AccountCreateEmailPasswordSessionRequestParams} params
|
|
940
1033
|
*/
|
|
941
|
-
const accountCreateEmailPasswordSession = async ({
|
|
942
|
-
let client = !sdk ? await sdkForProject() :
|
|
1034
|
+
const accountCreateEmailPasswordSession = async ({email,password,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1035
|
+
let client = !sdk ? await sdkForProject() :
|
|
1036
|
+
sdk;
|
|
943
1037
|
let apiPath = '/account/sessions/email';
|
|
944
1038
|
let payload = {};
|
|
945
1039
|
if (typeof email !== 'undefined') {
|
|
@@ -959,14 +1053,16 @@ const accountCreateEmailPasswordSession = async ({ email, password, parseOutput
|
|
|
959
1053
|
parse(response)
|
|
960
1054
|
success()
|
|
961
1055
|
}
|
|
962
|
-
|
|
1056
|
+
|
|
963
1057
|
return response;
|
|
1058
|
+
|
|
964
1059
|
}
|
|
965
1060
|
|
|
966
1061
|
/**
|
|
967
1062
|
* @typedef {Object} AccountUpdateMagicURLSessionRequestParams
|
|
968
1063
|
* @property {string} userId 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.
|
|
969
1064
|
* @property {string} secret Valid verification token.
|
|
1065
|
+
* @property {boolean} overrideForCli
|
|
970
1066
|
* @property {boolean} parseOutput
|
|
971
1067
|
* @property {libClient | undefined} sdk
|
|
972
1068
|
*/
|
|
@@ -974,8 +1070,9 @@ const accountCreateEmailPasswordSession = async ({ email, password, parseOutput
|
|
|
974
1070
|
/**
|
|
975
1071
|
* @param {AccountUpdateMagicURLSessionRequestParams} params
|
|
976
1072
|
*/
|
|
977
|
-
const accountUpdateMagicURLSession = async ({
|
|
978
|
-
let client = !sdk ? await sdkForProject() :
|
|
1073
|
+
const accountUpdateMagicURLSession = async ({userId,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1074
|
+
let client = !sdk ? await sdkForProject() :
|
|
1075
|
+
sdk;
|
|
979
1076
|
let apiPath = '/account/sessions/magic-url';
|
|
980
1077
|
let payload = {};
|
|
981
1078
|
if (typeof userId !== 'undefined') {
|
|
@@ -995,8 +1092,9 @@ const accountUpdateMagicURLSession = async ({ userId, secret, parseOutput = true
|
|
|
995
1092
|
parse(response)
|
|
996
1093
|
success()
|
|
997
1094
|
}
|
|
998
|
-
|
|
1095
|
+
|
|
999
1096
|
return response;
|
|
1097
|
+
|
|
1000
1098
|
}
|
|
1001
1099
|
|
|
1002
1100
|
/**
|
|
@@ -1005,6 +1103,7 @@ const accountUpdateMagicURLSession = async ({ userId, secret, parseOutput = true
|
|
|
1005
1103
|
* @property {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.
|
|
1006
1104
|
* @property {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.
|
|
1007
1105
|
* @property {string[]} 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.
|
|
1106
|
+
* @property {boolean} overrideForCli
|
|
1008
1107
|
* @property {boolean} parseOutput
|
|
1009
1108
|
* @property {libClient | undefined} sdk
|
|
1010
1109
|
*/
|
|
@@ -1012,8 +1111,9 @@ const accountUpdateMagicURLSession = async ({ userId, secret, parseOutput = true
|
|
|
1012
1111
|
/**
|
|
1013
1112
|
* @param {AccountCreateOAuth2SessionRequestParams} params
|
|
1014
1113
|
*/
|
|
1015
|
-
const accountCreateOAuth2Session = async ({
|
|
1016
|
-
let client = !sdk ? await sdkForProject() :
|
|
1114
|
+
const accountCreateOAuth2Session = async ({provider,success,failure,scopes,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1115
|
+
let client = !sdk ? await sdkForProject() :
|
|
1116
|
+
sdk;
|
|
1017
1117
|
let apiPath = '/account/sessions/oauth2/{provider}'.replace('{provider}', provider);
|
|
1018
1118
|
let payload = {};
|
|
1019
1119
|
if (typeof success !== 'undefined') {
|
|
@@ -1036,14 +1136,16 @@ const accountCreateOAuth2Session = async ({ provider, success, failure, scopes,
|
|
|
1036
1136
|
parse(response)
|
|
1037
1137
|
success()
|
|
1038
1138
|
}
|
|
1039
|
-
|
|
1139
|
+
|
|
1040
1140
|
return response;
|
|
1141
|
+
|
|
1041
1142
|
}
|
|
1042
1143
|
|
|
1043
1144
|
/**
|
|
1044
1145
|
* @typedef {Object} AccountUpdatePhoneSessionRequestParams
|
|
1045
1146
|
* @property {string} userId 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.
|
|
1046
1147
|
* @property {string} secret Valid verification token.
|
|
1148
|
+
* @property {boolean} overrideForCli
|
|
1047
1149
|
* @property {boolean} parseOutput
|
|
1048
1150
|
* @property {libClient | undefined} sdk
|
|
1049
1151
|
*/
|
|
@@ -1051,8 +1153,9 @@ const accountCreateOAuth2Session = async ({ provider, success, failure, scopes,
|
|
|
1051
1153
|
/**
|
|
1052
1154
|
* @param {AccountUpdatePhoneSessionRequestParams} params
|
|
1053
1155
|
*/
|
|
1054
|
-
const accountUpdatePhoneSession = async ({
|
|
1055
|
-
let client = !sdk ? await sdkForProject() :
|
|
1156
|
+
const accountUpdatePhoneSession = async ({userId,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1157
|
+
let client = !sdk ? await sdkForProject() :
|
|
1158
|
+
sdk;
|
|
1056
1159
|
let apiPath = '/account/sessions/phone';
|
|
1057
1160
|
let payload = {};
|
|
1058
1161
|
if (typeof userId !== 'undefined') {
|
|
@@ -1072,14 +1175,16 @@ const accountUpdatePhoneSession = async ({ userId, secret, parseOutput = true, s
|
|
|
1072
1175
|
parse(response)
|
|
1073
1176
|
success()
|
|
1074
1177
|
}
|
|
1075
|
-
|
|
1178
|
+
|
|
1076
1179
|
return response;
|
|
1180
|
+
|
|
1077
1181
|
}
|
|
1078
1182
|
|
|
1079
1183
|
/**
|
|
1080
1184
|
* @typedef {Object} AccountCreateSessionRequestParams
|
|
1081
1185
|
* @property {string} userId 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.
|
|
1082
1186
|
* @property {string} secret Secret of a token generated by login methods. For example, the 'createMagicURLToken' or 'createPhoneToken' methods.
|
|
1187
|
+
* @property {boolean} overrideForCli
|
|
1083
1188
|
* @property {boolean} parseOutput
|
|
1084
1189
|
* @property {libClient | undefined} sdk
|
|
1085
1190
|
*/
|
|
@@ -1087,8 +1192,9 @@ const accountUpdatePhoneSession = async ({ userId, secret, parseOutput = true, s
|
|
|
1087
1192
|
/**
|
|
1088
1193
|
* @param {AccountCreateSessionRequestParams} params
|
|
1089
1194
|
*/
|
|
1090
|
-
const accountCreateSession = async ({
|
|
1091
|
-
let client = !sdk ? await sdkForProject() :
|
|
1195
|
+
const accountCreateSession = async ({userId,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1196
|
+
let client = !sdk ? await sdkForProject() :
|
|
1197
|
+
sdk;
|
|
1092
1198
|
let apiPath = '/account/sessions/token';
|
|
1093
1199
|
let payload = {};
|
|
1094
1200
|
if (typeof userId !== 'undefined') {
|
|
@@ -1108,13 +1214,15 @@ const accountCreateSession = async ({ userId, secret, parseOutput = true, sdk =
|
|
|
1108
1214
|
parse(response)
|
|
1109
1215
|
success()
|
|
1110
1216
|
}
|
|
1111
|
-
|
|
1217
|
+
|
|
1112
1218
|
return response;
|
|
1219
|
+
|
|
1113
1220
|
}
|
|
1114
1221
|
|
|
1115
1222
|
/**
|
|
1116
1223
|
* @typedef {Object} AccountGetSessionRequestParams
|
|
1117
1224
|
* @property {string} sessionId Session ID. Use the string 'current' to get the current device session.
|
|
1225
|
+
* @property {boolean} overrideForCli
|
|
1118
1226
|
* @property {boolean} parseOutput
|
|
1119
1227
|
* @property {libClient | undefined} sdk
|
|
1120
1228
|
*/
|
|
@@ -1122,8 +1230,9 @@ const accountCreateSession = async ({ userId, secret, parseOutput = true, sdk =
|
|
|
1122
1230
|
/**
|
|
1123
1231
|
* @param {AccountGetSessionRequestParams} params
|
|
1124
1232
|
*/
|
|
1125
|
-
const accountGetSession = async ({
|
|
1126
|
-
let client = !sdk ? await sdkForProject() :
|
|
1233
|
+
const accountGetSession = async ({sessionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1234
|
+
let client = !sdk ? await sdkForProject() :
|
|
1235
|
+
sdk;
|
|
1127
1236
|
let apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
|
|
1128
1237
|
let payload = {};
|
|
1129
1238
|
|
|
@@ -1137,13 +1246,15 @@ const accountGetSession = async ({ sessionId, parseOutput = true, sdk = undefine
|
|
|
1137
1246
|
parse(response)
|
|
1138
1247
|
success()
|
|
1139
1248
|
}
|
|
1140
|
-
|
|
1249
|
+
|
|
1141
1250
|
return response;
|
|
1251
|
+
|
|
1142
1252
|
}
|
|
1143
1253
|
|
|
1144
1254
|
/**
|
|
1145
1255
|
* @typedef {Object} AccountUpdateSessionRequestParams
|
|
1146
1256
|
* @property {string} sessionId Session ID. Use the string 'current' to update the current device session.
|
|
1257
|
+
* @property {boolean} overrideForCli
|
|
1147
1258
|
* @property {boolean} parseOutput
|
|
1148
1259
|
* @property {libClient | undefined} sdk
|
|
1149
1260
|
*/
|
|
@@ -1151,8 +1262,9 @@ const accountGetSession = async ({ sessionId, parseOutput = true, sdk = undefine
|
|
|
1151
1262
|
/**
|
|
1152
1263
|
* @param {AccountUpdateSessionRequestParams} params
|
|
1153
1264
|
*/
|
|
1154
|
-
const accountUpdateSession = async ({
|
|
1155
|
-
let client = !sdk ? await sdkForProject() :
|
|
1265
|
+
const accountUpdateSession = async ({sessionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1266
|
+
let client = !sdk ? await sdkForProject() :
|
|
1267
|
+
sdk;
|
|
1156
1268
|
let apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
|
|
1157
1269
|
let payload = {};
|
|
1158
1270
|
|
|
@@ -1166,13 +1278,15 @@ const accountUpdateSession = async ({ sessionId, parseOutput = true, sdk = undef
|
|
|
1166
1278
|
parse(response)
|
|
1167
1279
|
success()
|
|
1168
1280
|
}
|
|
1169
|
-
|
|
1281
|
+
|
|
1170
1282
|
return response;
|
|
1283
|
+
|
|
1171
1284
|
}
|
|
1172
1285
|
|
|
1173
1286
|
/**
|
|
1174
1287
|
* @typedef {Object} AccountDeleteSessionRequestParams
|
|
1175
1288
|
* @property {string} sessionId Session ID. Use the string 'current' to delete the current device session.
|
|
1289
|
+
* @property {boolean} overrideForCli
|
|
1176
1290
|
* @property {boolean} parseOutput
|
|
1177
1291
|
* @property {libClient | undefined} sdk
|
|
1178
1292
|
*/
|
|
@@ -1180,8 +1294,9 @@ const accountUpdateSession = async ({ sessionId, parseOutput = true, sdk = undef
|
|
|
1180
1294
|
/**
|
|
1181
1295
|
* @param {AccountDeleteSessionRequestParams} params
|
|
1182
1296
|
*/
|
|
1183
|
-
const accountDeleteSession = async ({
|
|
1184
|
-
let client = !sdk ? await sdkForProject() :
|
|
1297
|
+
const accountDeleteSession = async ({sessionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1298
|
+
let client = !sdk ? await sdkForProject() :
|
|
1299
|
+
sdk;
|
|
1185
1300
|
let apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
|
|
1186
1301
|
let payload = {};
|
|
1187
1302
|
|
|
@@ -1195,12 +1310,14 @@ const accountDeleteSession = async ({ sessionId, parseOutput = true, sdk = undef
|
|
|
1195
1310
|
parse(response)
|
|
1196
1311
|
success()
|
|
1197
1312
|
}
|
|
1198
|
-
|
|
1313
|
+
|
|
1199
1314
|
return response;
|
|
1315
|
+
|
|
1200
1316
|
}
|
|
1201
1317
|
|
|
1202
1318
|
/**
|
|
1203
1319
|
* @typedef {Object} AccountUpdateStatusRequestParams
|
|
1320
|
+
* @property {boolean} overrideForCli
|
|
1204
1321
|
* @property {boolean} parseOutput
|
|
1205
1322
|
* @property {libClient | undefined} sdk
|
|
1206
1323
|
*/
|
|
@@ -1208,8 +1325,9 @@ const accountDeleteSession = async ({ sessionId, parseOutput = true, sdk = undef
|
|
|
1208
1325
|
/**
|
|
1209
1326
|
* @param {AccountUpdateStatusRequestParams} params
|
|
1210
1327
|
*/
|
|
1211
|
-
const accountUpdateStatus = async ({
|
|
1212
|
-
let client = !sdk ? await sdkForProject() :
|
|
1328
|
+
const accountUpdateStatus = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1329
|
+
let client = !sdk ? await sdkForProject() :
|
|
1330
|
+
sdk;
|
|
1213
1331
|
let apiPath = '/account/status';
|
|
1214
1332
|
let payload = {};
|
|
1215
1333
|
|
|
@@ -1223,8 +1341,9 @@ const accountUpdateStatus = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
1223
1341
|
parse(response)
|
|
1224
1342
|
success()
|
|
1225
1343
|
}
|
|
1226
|
-
|
|
1344
|
+
|
|
1227
1345
|
return response;
|
|
1346
|
+
|
|
1228
1347
|
}
|
|
1229
1348
|
|
|
1230
1349
|
/**
|
|
@@ -1232,6 +1351,7 @@ const accountUpdateStatus = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
1232
1351
|
* @property {string} targetId Target 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.
|
|
1233
1352
|
* @property {string} identifier The target identifier (token, email, phone etc.)
|
|
1234
1353
|
* @property {string} providerId Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
|
|
1354
|
+
* @property {boolean} overrideForCli
|
|
1235
1355
|
* @property {boolean} parseOutput
|
|
1236
1356
|
* @property {libClient | undefined} sdk
|
|
1237
1357
|
*/
|
|
@@ -1239,8 +1359,9 @@ const accountUpdateStatus = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
1239
1359
|
/**
|
|
1240
1360
|
* @param {AccountCreatePushTargetRequestParams} params
|
|
1241
1361
|
*/
|
|
1242
|
-
const accountCreatePushTarget = async ({
|
|
1243
|
-
let client = !sdk ? await sdkForProject() :
|
|
1362
|
+
const accountCreatePushTarget = async ({targetId,identifier,providerId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1363
|
+
let client = !sdk ? await sdkForProject() :
|
|
1364
|
+
sdk;
|
|
1244
1365
|
let apiPath = '/account/targets/push';
|
|
1245
1366
|
let payload = {};
|
|
1246
1367
|
if (typeof targetId !== 'undefined') {
|
|
@@ -1263,14 +1384,16 @@ const accountCreatePushTarget = async ({ targetId, identifier, providerId, parse
|
|
|
1263
1384
|
parse(response)
|
|
1264
1385
|
success()
|
|
1265
1386
|
}
|
|
1266
|
-
|
|
1387
|
+
|
|
1267
1388
|
return response;
|
|
1389
|
+
|
|
1268
1390
|
}
|
|
1269
1391
|
|
|
1270
1392
|
/**
|
|
1271
1393
|
* @typedef {Object} AccountUpdatePushTargetRequestParams
|
|
1272
1394
|
* @property {string} targetId Target ID.
|
|
1273
1395
|
* @property {string} identifier The target identifier (token, email, phone etc.)
|
|
1396
|
+
* @property {boolean} overrideForCli
|
|
1274
1397
|
* @property {boolean} parseOutput
|
|
1275
1398
|
* @property {libClient | undefined} sdk
|
|
1276
1399
|
*/
|
|
@@ -1278,8 +1401,9 @@ const accountCreatePushTarget = async ({ targetId, identifier, providerId, parse
|
|
|
1278
1401
|
/**
|
|
1279
1402
|
* @param {AccountUpdatePushTargetRequestParams} params
|
|
1280
1403
|
*/
|
|
1281
|
-
const accountUpdatePushTarget = async ({
|
|
1282
|
-
let client = !sdk ? await sdkForProject() :
|
|
1404
|
+
const accountUpdatePushTarget = async ({targetId,identifier,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1405
|
+
let client = !sdk ? await sdkForProject() :
|
|
1406
|
+
sdk;
|
|
1283
1407
|
let apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', targetId);
|
|
1284
1408
|
let payload = {};
|
|
1285
1409
|
if (typeof identifier !== 'undefined') {
|
|
@@ -1296,13 +1420,15 @@ const accountUpdatePushTarget = async ({ targetId, identifier, parseOutput = tru
|
|
|
1296
1420
|
parse(response)
|
|
1297
1421
|
success()
|
|
1298
1422
|
}
|
|
1299
|
-
|
|
1423
|
+
|
|
1300
1424
|
return response;
|
|
1425
|
+
|
|
1301
1426
|
}
|
|
1302
1427
|
|
|
1303
1428
|
/**
|
|
1304
1429
|
* @typedef {Object} AccountDeletePushTargetRequestParams
|
|
1305
1430
|
* @property {string} targetId Target ID.
|
|
1431
|
+
* @property {boolean} overrideForCli
|
|
1306
1432
|
* @property {boolean} parseOutput
|
|
1307
1433
|
* @property {libClient | undefined} sdk
|
|
1308
1434
|
*/
|
|
@@ -1310,8 +1436,9 @@ const accountUpdatePushTarget = async ({ targetId, identifier, parseOutput = tru
|
|
|
1310
1436
|
/**
|
|
1311
1437
|
* @param {AccountDeletePushTargetRequestParams} params
|
|
1312
1438
|
*/
|
|
1313
|
-
const accountDeletePushTarget = async ({
|
|
1314
|
-
let client = !sdk ? await sdkForProject() :
|
|
1439
|
+
const accountDeletePushTarget = async ({targetId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1440
|
+
let client = !sdk ? await sdkForProject() :
|
|
1441
|
+
sdk;
|
|
1315
1442
|
let apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', targetId);
|
|
1316
1443
|
let payload = {};
|
|
1317
1444
|
|
|
@@ -1325,8 +1452,9 @@ const accountDeletePushTarget = async ({ targetId, parseOutput = true, sdk = und
|
|
|
1325
1452
|
parse(response)
|
|
1326
1453
|
success()
|
|
1327
1454
|
}
|
|
1328
|
-
|
|
1455
|
+
|
|
1329
1456
|
return response;
|
|
1457
|
+
|
|
1330
1458
|
}
|
|
1331
1459
|
|
|
1332
1460
|
/**
|
|
@@ -1334,6 +1462,7 @@ const accountDeletePushTarget = async ({ targetId, parseOutput = true, sdk = und
|
|
|
1334
1462
|
* @property {string} userId 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.
|
|
1335
1463
|
* @property {string} email User email.
|
|
1336
1464
|
* @property {boolean} phrase Toggle for security phrase. If enabled, email will be send 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.
|
|
1465
|
+
* @property {boolean} overrideForCli
|
|
1337
1466
|
* @property {boolean} parseOutput
|
|
1338
1467
|
* @property {libClient | undefined} sdk
|
|
1339
1468
|
*/
|
|
@@ -1341,8 +1470,9 @@ const accountDeletePushTarget = async ({ targetId, parseOutput = true, sdk = und
|
|
|
1341
1470
|
/**
|
|
1342
1471
|
* @param {AccountCreateEmailTokenRequestParams} params
|
|
1343
1472
|
*/
|
|
1344
|
-
const accountCreateEmailToken = async ({
|
|
1345
|
-
let client = !sdk ? await sdkForProject() :
|
|
1473
|
+
const accountCreateEmailToken = async ({userId,email,phrase,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1474
|
+
let client = !sdk ? await sdkForProject() :
|
|
1475
|
+
sdk;
|
|
1346
1476
|
let apiPath = '/account/tokens/email';
|
|
1347
1477
|
let payload = {};
|
|
1348
1478
|
if (typeof userId !== 'undefined') {
|
|
@@ -1365,8 +1495,9 @@ const accountCreateEmailToken = async ({ userId, email, phrase, parseOutput = tr
|
|
|
1365
1495
|
parse(response)
|
|
1366
1496
|
success()
|
|
1367
1497
|
}
|
|
1368
|
-
|
|
1498
|
+
|
|
1369
1499
|
return response;
|
|
1500
|
+
|
|
1370
1501
|
}
|
|
1371
1502
|
|
|
1372
1503
|
/**
|
|
@@ -1375,6 +1506,7 @@ const accountCreateEmailToken = async ({ userId, email, phrase, parseOutput = tr
|
|
|
1375
1506
|
* @property {string} email User email.
|
|
1376
1507
|
* @property {string} url URL to redirect the user back to your app from the magic URL login. 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.
|
|
1377
1508
|
* @property {boolean} phrase Toggle for security phrase. If enabled, email will be send 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.
|
|
1509
|
+
* @property {boolean} overrideForCli
|
|
1378
1510
|
* @property {boolean} parseOutput
|
|
1379
1511
|
* @property {libClient | undefined} sdk
|
|
1380
1512
|
*/
|
|
@@ -1382,8 +1514,9 @@ const accountCreateEmailToken = async ({ userId, email, phrase, parseOutput = tr
|
|
|
1382
1514
|
/**
|
|
1383
1515
|
* @param {AccountCreateMagicURLTokenRequestParams} params
|
|
1384
1516
|
*/
|
|
1385
|
-
const accountCreateMagicURLToken = async ({
|
|
1386
|
-
let client = !sdk ? await sdkForProject() :
|
|
1517
|
+
const accountCreateMagicURLToken = async ({userId,email,url,phrase,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1518
|
+
let client = !sdk ? await sdkForProject() :
|
|
1519
|
+
sdk;
|
|
1387
1520
|
let apiPath = '/account/tokens/magic-url';
|
|
1388
1521
|
let payload = {};
|
|
1389
1522
|
if (typeof userId !== 'undefined') {
|
|
@@ -1409,8 +1542,9 @@ const accountCreateMagicURLToken = async ({ userId, email, url, phrase, parseOut
|
|
|
1409
1542
|
parse(response)
|
|
1410
1543
|
success()
|
|
1411
1544
|
}
|
|
1412
|
-
|
|
1545
|
+
|
|
1413
1546
|
return response;
|
|
1547
|
+
|
|
1414
1548
|
}
|
|
1415
1549
|
|
|
1416
1550
|
/**
|
|
@@ -1419,6 +1553,7 @@ const accountCreateMagicURLToken = async ({ userId, email, url, phrase, parseOut
|
|
|
1419
1553
|
* @property {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.
|
|
1420
1554
|
* @property {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.
|
|
1421
1555
|
* @property {string[]} 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.
|
|
1556
|
+
* @property {boolean} overrideForCli
|
|
1422
1557
|
* @property {boolean} parseOutput
|
|
1423
1558
|
* @property {libClient | undefined} sdk
|
|
1424
1559
|
*/
|
|
@@ -1426,8 +1561,9 @@ const accountCreateMagicURLToken = async ({ userId, email, url, phrase, parseOut
|
|
|
1426
1561
|
/**
|
|
1427
1562
|
* @param {AccountCreateOAuth2TokenRequestParams} params
|
|
1428
1563
|
*/
|
|
1429
|
-
const accountCreateOAuth2Token = async ({
|
|
1430
|
-
let client = !sdk ? await sdkForProject() :
|
|
1564
|
+
const accountCreateOAuth2Token = async ({provider,success,failure,scopes,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1565
|
+
let client = !sdk ? await sdkForProject() :
|
|
1566
|
+
sdk;
|
|
1431
1567
|
let apiPath = '/account/tokens/oauth2/{provider}'.replace('{provider}', provider);
|
|
1432
1568
|
let payload = {};
|
|
1433
1569
|
if (typeof success !== 'undefined') {
|
|
@@ -1450,14 +1586,16 @@ const accountCreateOAuth2Token = async ({ provider, success, failure, scopes, pa
|
|
|
1450
1586
|
parse(response)
|
|
1451
1587
|
success()
|
|
1452
1588
|
}
|
|
1453
|
-
|
|
1589
|
+
|
|
1454
1590
|
return response;
|
|
1591
|
+
|
|
1455
1592
|
}
|
|
1456
1593
|
|
|
1457
1594
|
/**
|
|
1458
1595
|
* @typedef {Object} AccountCreatePhoneTokenRequestParams
|
|
1459
1596
|
* @property {string} userId Unique 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.
|
|
1460
1597
|
* @property {string} phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
1598
|
+
* @property {boolean} overrideForCli
|
|
1461
1599
|
* @property {boolean} parseOutput
|
|
1462
1600
|
* @property {libClient | undefined} sdk
|
|
1463
1601
|
*/
|
|
@@ -1465,8 +1603,9 @@ const accountCreateOAuth2Token = async ({ provider, success, failure, scopes, pa
|
|
|
1465
1603
|
/**
|
|
1466
1604
|
* @param {AccountCreatePhoneTokenRequestParams} params
|
|
1467
1605
|
*/
|
|
1468
|
-
const accountCreatePhoneToken = async ({
|
|
1469
|
-
let client = !sdk ? await sdkForProject() :
|
|
1606
|
+
const accountCreatePhoneToken = async ({userId,phone,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1607
|
+
let client = !sdk ? await sdkForProject() :
|
|
1608
|
+
sdk;
|
|
1470
1609
|
let apiPath = '/account/tokens/phone';
|
|
1471
1610
|
let payload = {};
|
|
1472
1611
|
if (typeof userId !== 'undefined') {
|
|
@@ -1486,13 +1625,15 @@ const accountCreatePhoneToken = async ({ userId, phone, parseOutput = true, sdk
|
|
|
1486
1625
|
parse(response)
|
|
1487
1626
|
success()
|
|
1488
1627
|
}
|
|
1489
|
-
|
|
1628
|
+
|
|
1490
1629
|
return response;
|
|
1630
|
+
|
|
1491
1631
|
}
|
|
1492
1632
|
|
|
1493
1633
|
/**
|
|
1494
1634
|
* @typedef {Object} AccountCreateVerificationRequestParams
|
|
1495
1635
|
* @property {string} 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.
|
|
1636
|
+
* @property {boolean} overrideForCli
|
|
1496
1637
|
* @property {boolean} parseOutput
|
|
1497
1638
|
* @property {libClient | undefined} sdk
|
|
1498
1639
|
*/
|
|
@@ -1500,8 +1641,9 @@ const accountCreatePhoneToken = async ({ userId, phone, parseOutput = true, sdk
|
|
|
1500
1641
|
/**
|
|
1501
1642
|
* @param {AccountCreateVerificationRequestParams} params
|
|
1502
1643
|
*/
|
|
1503
|
-
const accountCreateVerification = async ({
|
|
1504
|
-
let client = !sdk ? await sdkForProject() :
|
|
1644
|
+
const accountCreateVerification = async ({url,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1645
|
+
let client = !sdk ? await sdkForProject() :
|
|
1646
|
+
sdk;
|
|
1505
1647
|
let apiPath = '/account/verification';
|
|
1506
1648
|
let payload = {};
|
|
1507
1649
|
if (typeof url !== 'undefined') {
|
|
@@ -1518,14 +1660,16 @@ const accountCreateVerification = async ({ url, parseOutput = true, sdk = undefi
|
|
|
1518
1660
|
parse(response)
|
|
1519
1661
|
success()
|
|
1520
1662
|
}
|
|
1521
|
-
|
|
1663
|
+
|
|
1522
1664
|
return response;
|
|
1665
|
+
|
|
1523
1666
|
}
|
|
1524
1667
|
|
|
1525
1668
|
/**
|
|
1526
1669
|
* @typedef {Object} AccountUpdateVerificationRequestParams
|
|
1527
1670
|
* @property {string} userId User ID.
|
|
1528
1671
|
* @property {string} secret Valid verification token.
|
|
1672
|
+
* @property {boolean} overrideForCli
|
|
1529
1673
|
* @property {boolean} parseOutput
|
|
1530
1674
|
* @property {libClient | undefined} sdk
|
|
1531
1675
|
*/
|
|
@@ -1533,8 +1677,9 @@ const accountCreateVerification = async ({ url, parseOutput = true, sdk = undefi
|
|
|
1533
1677
|
/**
|
|
1534
1678
|
* @param {AccountUpdateVerificationRequestParams} params
|
|
1535
1679
|
*/
|
|
1536
|
-
const accountUpdateVerification = async ({
|
|
1537
|
-
let client = !sdk ? await sdkForProject() :
|
|
1680
|
+
const accountUpdateVerification = async ({userId,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1681
|
+
let client = !sdk ? await sdkForProject() :
|
|
1682
|
+
sdk;
|
|
1538
1683
|
let apiPath = '/account/verification';
|
|
1539
1684
|
let payload = {};
|
|
1540
1685
|
if (typeof userId !== 'undefined') {
|
|
@@ -1554,12 +1699,14 @@ const accountUpdateVerification = async ({ userId, secret, parseOutput = true, s
|
|
|
1554
1699
|
parse(response)
|
|
1555
1700
|
success()
|
|
1556
1701
|
}
|
|
1557
|
-
|
|
1702
|
+
|
|
1558
1703
|
return response;
|
|
1704
|
+
|
|
1559
1705
|
}
|
|
1560
1706
|
|
|
1561
1707
|
/**
|
|
1562
1708
|
* @typedef {Object} AccountCreatePhoneVerificationRequestParams
|
|
1709
|
+
* @property {boolean} overrideForCli
|
|
1563
1710
|
* @property {boolean} parseOutput
|
|
1564
1711
|
* @property {libClient | undefined} sdk
|
|
1565
1712
|
*/
|
|
@@ -1567,8 +1714,9 @@ const accountUpdateVerification = async ({ userId, secret, parseOutput = true, s
|
|
|
1567
1714
|
/**
|
|
1568
1715
|
* @param {AccountCreatePhoneVerificationRequestParams} params
|
|
1569
1716
|
*/
|
|
1570
|
-
const accountCreatePhoneVerification = async ({
|
|
1571
|
-
let client = !sdk ? await sdkForProject() :
|
|
1717
|
+
const accountCreatePhoneVerification = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1718
|
+
let client = !sdk ? await sdkForProject() :
|
|
1719
|
+
sdk;
|
|
1572
1720
|
let apiPath = '/account/verification/phone';
|
|
1573
1721
|
let payload = {};
|
|
1574
1722
|
|
|
@@ -1582,14 +1730,16 @@ const accountCreatePhoneVerification = async ({ parseOutput = true, sdk = undefi
|
|
|
1582
1730
|
parse(response)
|
|
1583
1731
|
success()
|
|
1584
1732
|
}
|
|
1585
|
-
|
|
1733
|
+
|
|
1586
1734
|
return response;
|
|
1735
|
+
|
|
1587
1736
|
}
|
|
1588
1737
|
|
|
1589
1738
|
/**
|
|
1590
1739
|
* @typedef {Object} AccountUpdatePhoneVerificationRequestParams
|
|
1591
1740
|
* @property {string} userId User ID.
|
|
1592
1741
|
* @property {string} secret Valid verification token.
|
|
1742
|
+
* @property {boolean} overrideForCli
|
|
1593
1743
|
* @property {boolean} parseOutput
|
|
1594
1744
|
* @property {libClient | undefined} sdk
|
|
1595
1745
|
*/
|
|
@@ -1597,8 +1747,9 @@ const accountCreatePhoneVerification = async ({ parseOutput = true, sdk = undefi
|
|
|
1597
1747
|
/**
|
|
1598
1748
|
* @param {AccountUpdatePhoneVerificationRequestParams} params
|
|
1599
1749
|
*/
|
|
1600
|
-
const accountUpdatePhoneVerification = async ({
|
|
1601
|
-
let client = !sdk ? await sdkForProject() :
|
|
1750
|
+
const accountUpdatePhoneVerification = async ({userId,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1751
|
+
let client = !sdk ? await sdkForProject() :
|
|
1752
|
+
sdk;
|
|
1602
1753
|
let apiPath = '/account/verification/phone';
|
|
1603
1754
|
let payload = {};
|
|
1604
1755
|
if (typeof userId !== 'undefined') {
|
|
@@ -1618,13 +1769,15 @@ const accountUpdatePhoneVerification = async ({ userId, secret, parseOutput = tr
|
|
|
1618
1769
|
parse(response)
|
|
1619
1770
|
success()
|
|
1620
1771
|
}
|
|
1621
|
-
|
|
1772
|
+
|
|
1622
1773
|
return response;
|
|
1774
|
+
|
|
1623
1775
|
}
|
|
1624
1776
|
|
|
1625
1777
|
account
|
|
1626
1778
|
.command(`get`)
|
|
1627
1779
|
.description(`Get the currently logged in user.`)
|
|
1780
|
+
.option(`--console`, `Get the resource console url`)
|
|
1628
1781
|
.action(actionRunner(accountGet))
|
|
1629
1782
|
|
|
1630
1783
|
account
|
|
@@ -1679,13 +1832,13 @@ account
|
|
|
1679
1832
|
|
|
1680
1833
|
account
|
|
1681
1834
|
.command(`createMfaAuthenticator`)
|
|
1682
|
-
.description(`Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#
|
|
1835
|
+
.description(`Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.`)
|
|
1683
1836
|
.requiredOption(`--type <type>`, `Type of authenticator. Must be 'totp'`)
|
|
1684
1837
|
.action(actionRunner(accountCreateMfaAuthenticator))
|
|
1685
1838
|
|
|
1686
1839
|
account
|
|
1687
1840
|
.command(`updateMfaAuthenticator`)
|
|
1688
|
-
.description(`Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#
|
|
1841
|
+
.description(`Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.`)
|
|
1689
1842
|
.requiredOption(`--type <type>`, `Type of authenticator.`)
|
|
1690
1843
|
.requiredOption(`--otp <otp>`, `Valid verification token.`)
|
|
1691
1844
|
.action(actionRunner(accountUpdateMfaAuthenticator))
|
|
@@ -1779,6 +1932,7 @@ account
|
|
|
1779
1932
|
account
|
|
1780
1933
|
.command(`listSessions`)
|
|
1781
1934
|
.description(`Get the list of active sessions across different devices for the currently logged in user.`)
|
|
1935
|
+
.option(`--console`, `Get the resource console url`)
|
|
1782
1936
|
.action(actionRunner(accountListSessions))
|
|
1783
1937
|
|
|
1784
1938
|
account
|
|
@@ -1980,4 +2134,4 @@ module.exports = {
|
|
|
1980
2134
|
accountUpdateVerification,
|
|
1981
2135
|
accountCreatePhoneVerification,
|
|
1982
2136
|
accountUpdatePhoneVerification
|
|
1983
|
-
};
|
|
2137
|
+
};
|