@appwrite.io/console 1.5.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/cjs/sdk.js +7714 -9758
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +7714 -9758
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +7714 -9758
- package/docs/examples/databases/update-float-attribute.md +2 -2
- package/docs/examples/databases/update-integer-attribute.md +2 -2
- package/docs/examples/health/{get-queue-usage-count.md → get-queue-stats-resources.md} +1 -1
- package/docs/examples/health/{get-queue-usage-dump.md → get-queue-stats-usage-dump.md} +1 -1
- package/docs/examples/organizations/create.md +5 -1
- package/docs/examples/organizations/update-plan.md +5 -1
- package/docs/examples/organizations/validate-invoice.md +14 -0
- package/package.json +1 -1
- package/src/client.ts +21 -4
- package/src/enums/credit-card.ts +1 -0
- package/src/enums/name.ts +3 -2
- package/src/enums/o-auth-provider.ts +1 -0
- package/src/enums/runtime.ts +3 -0
- package/src/models.ts +202 -5
- package/src/services/account.ts +126 -430
- package/src/services/assistant.ts +2 -7
- package/src/services/avatars.ts +7 -21
- package/src/services/backups.ts +24 -84
- package/src/services/console.ts +14 -49
- package/src/services/databases.ts +99 -350
- package/src/services/functions.ts +55 -192
- package/src/services/graphql.ts +4 -14
- package/src/services/health.ts +55 -207
- package/src/services/locale.ts +16 -56
- package/src/services/messaging.ts +92 -322
- package/src/services/migrations.ts +24 -84
- package/src/services/organizations.ts +118 -196
- package/src/services/project.ts +12 -42
- package/src/services/projects.ts +92 -322
- package/src/services/proxy.ts +10 -35
- package/src/services/storage.ts +27 -93
- package/src/services/teams.ts +28 -98
- package/src/services/users.ts +86 -301
- package/src/services/vcs.ts +20 -70
- package/types/enums/credit-card.d.ts +2 -1
- package/types/enums/name.d.ts +3 -2
- package/types/enums/o-auth-provider.d.ts +1 -0
- package/types/enums/runtime.d.ts +3 -0
- package/types/models.d.ts +202 -5
- package/types/services/account.d.ts +4 -128
- package/types/services/assistant.d.ts +0 -2
- package/types/services/avatars.d.ts +0 -14
- package/types/services/backups.d.ts +0 -24
- package/types/services/console.d.ts +0 -14
- package/types/services/databases.d.ts +5 -100
- package/types/services/functions.d.ts +0 -56
- package/types/services/graphql.d.ts +0 -4
- package/types/services/health.d.ts +5 -64
- package/types/services/locale.d.ts +0 -16
- package/types/services/messaging.d.ts +0 -92
- package/types/services/migrations.d.ts +0 -24
- package/types/services/organizations.d.ts +21 -60
- package/types/services/project.d.ts +0 -12
- package/types/services/projects.d.ts +0 -92
- package/types/services/proxy.d.ts +0 -10
- package/types/services/storage.d.ts +0 -30
- package/types/services/teams.d.ts +0 -28
- package/types/services/users.d.ts +0 -86
- package/types/services/vcs.d.ts +0 -20
- package/docs/examples/health/get-queue.md +0 -11
package/src/services/account.ts
CHANGED
|
@@ -13,14 +13,12 @@ export class Account {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Get account
|
|
17
|
-
*
|
|
18
16
|
* Get the currently logged in user.
|
|
19
17
|
*
|
|
20
18
|
* @throws {AppwriteException}
|
|
21
19
|
* @returns {Promise<Models.User<Preferences>>}
|
|
22
20
|
*/
|
|
23
|
-
|
|
21
|
+
get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>> {
|
|
24
22
|
const apiPath = '/account';
|
|
25
23
|
const payload: Payload = {};
|
|
26
24
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -29,10 +27,7 @@ export class Account {
|
|
|
29
27
|
'content-type': 'application/json',
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return await this.client.call(
|
|
30
|
+
return this.client.call(
|
|
36
31
|
'get',
|
|
37
32
|
uri,
|
|
38
33
|
apiHeaders,
|
|
@@ -40,8 +35,6 @@ export class Account {
|
|
|
40
35
|
);
|
|
41
36
|
}
|
|
42
37
|
/**
|
|
43
|
-
* Create account
|
|
44
|
-
*
|
|
45
38
|
* Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).
|
|
46
39
|
*
|
|
47
40
|
* @param {string} userId
|
|
@@ -51,7 +44,7 @@ export class Account {
|
|
|
51
44
|
* @throws {AppwriteException}
|
|
52
45
|
* @returns {Promise<Models.User<Preferences>>}
|
|
53
46
|
*/
|
|
54
|
-
|
|
47
|
+
create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
|
|
55
48
|
if (typeof userId === 'undefined') {
|
|
56
49
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
57
50
|
}
|
|
@@ -81,10 +74,7 @@ export class Account {
|
|
|
81
74
|
'content-type': 'application/json',
|
|
82
75
|
}
|
|
83
76
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return await this.client.call(
|
|
77
|
+
return this.client.call(
|
|
88
78
|
'post',
|
|
89
79
|
uri,
|
|
90
80
|
apiHeaders,
|
|
@@ -92,14 +82,12 @@ export class Account {
|
|
|
92
82
|
);
|
|
93
83
|
}
|
|
94
84
|
/**
|
|
95
|
-
* Delete account
|
|
96
|
-
*
|
|
97
85
|
* Delete the currently logged in user.
|
|
98
86
|
*
|
|
99
87
|
* @throws {AppwriteException}
|
|
100
88
|
* @returns {Promise<{}>}
|
|
101
89
|
*/
|
|
102
|
-
|
|
90
|
+
delete(): Promise<{}> {
|
|
103
91
|
const apiPath = '/account';
|
|
104
92
|
const payload: Payload = {};
|
|
105
93
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -108,10 +96,7 @@ export class Account {
|
|
|
108
96
|
'content-type': 'application/json',
|
|
109
97
|
}
|
|
110
98
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return await this.client.call(
|
|
99
|
+
return this.client.call(
|
|
115
100
|
'delete',
|
|
116
101
|
uri,
|
|
117
102
|
apiHeaders,
|
|
@@ -119,15 +104,13 @@ export class Account {
|
|
|
119
104
|
);
|
|
120
105
|
}
|
|
121
106
|
/**
|
|
122
|
-
* List billing addresses
|
|
123
|
-
*
|
|
124
107
|
* List all billing addresses for a user.
|
|
125
108
|
*
|
|
126
109
|
* @param {string[]} queries
|
|
127
110
|
* @throws {AppwriteException}
|
|
128
111
|
* @returns {Promise<Models.BillingAddressList>}
|
|
129
112
|
*/
|
|
130
|
-
|
|
113
|
+
listBillingAddresses(queries?: string[]): Promise<Models.BillingAddressList> {
|
|
131
114
|
const apiPath = '/account/billing-addresses';
|
|
132
115
|
const payload: Payload = {};
|
|
133
116
|
if (typeof queries !== 'undefined') {
|
|
@@ -139,10 +122,7 @@ export class Account {
|
|
|
139
122
|
'content-type': 'application/json',
|
|
140
123
|
}
|
|
141
124
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return await this.client.call(
|
|
125
|
+
return this.client.call(
|
|
146
126
|
'get',
|
|
147
127
|
uri,
|
|
148
128
|
apiHeaders,
|
|
@@ -150,8 +130,6 @@ export class Account {
|
|
|
150
130
|
);
|
|
151
131
|
}
|
|
152
132
|
/**
|
|
153
|
-
* Create new billing address
|
|
154
|
-
*
|
|
155
133
|
* Add a new billing address to a user's account.
|
|
156
134
|
*
|
|
157
135
|
* @param {string} country
|
|
@@ -163,7 +141,7 @@ export class Account {
|
|
|
163
141
|
* @throws {AppwriteException}
|
|
164
142
|
* @returns {Promise<Models.BillingAddress>}
|
|
165
143
|
*/
|
|
166
|
-
|
|
144
|
+
createBillingAddress(country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress> {
|
|
167
145
|
if (typeof country === 'undefined') {
|
|
168
146
|
throw new AppwriteException('Missing required parameter: "country"');
|
|
169
147
|
}
|
|
@@ -202,10 +180,7 @@ export class Account {
|
|
|
202
180
|
'content-type': 'application/json',
|
|
203
181
|
}
|
|
204
182
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return await this.client.call(
|
|
183
|
+
return this.client.call(
|
|
209
184
|
'post',
|
|
210
185
|
uri,
|
|
211
186
|
apiHeaders,
|
|
@@ -213,15 +188,13 @@ export class Account {
|
|
|
213
188
|
);
|
|
214
189
|
}
|
|
215
190
|
/**
|
|
216
|
-
* Get billing address
|
|
217
|
-
*
|
|
218
191
|
* Get a specific billing address for a user using it's ID.
|
|
219
192
|
*
|
|
220
193
|
* @param {string} billingAddressId
|
|
221
194
|
* @throws {AppwriteException}
|
|
222
195
|
* @returns {Promise<Models.BillingAddress>}
|
|
223
196
|
*/
|
|
224
|
-
|
|
197
|
+
getBillingAddress(billingAddressId: string): Promise<Models.BillingAddress> {
|
|
225
198
|
if (typeof billingAddressId === 'undefined') {
|
|
226
199
|
throw new AppwriteException('Missing required parameter: "billingAddressId"');
|
|
227
200
|
}
|
|
@@ -233,10 +206,7 @@ export class Account {
|
|
|
233
206
|
'content-type': 'application/json',
|
|
234
207
|
}
|
|
235
208
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
return await this.client.call(
|
|
209
|
+
return this.client.call(
|
|
240
210
|
'get',
|
|
241
211
|
uri,
|
|
242
212
|
apiHeaders,
|
|
@@ -244,8 +214,6 @@ export class Account {
|
|
|
244
214
|
);
|
|
245
215
|
}
|
|
246
216
|
/**
|
|
247
|
-
* Update billing address
|
|
248
|
-
*
|
|
249
217
|
* Update a specific billing address using it's ID.
|
|
250
218
|
*
|
|
251
219
|
* @param {string} billingAddressId
|
|
@@ -258,7 +226,7 @@ export class Account {
|
|
|
258
226
|
* @throws {AppwriteException}
|
|
259
227
|
* @returns {Promise<Models.BillingAddress>}
|
|
260
228
|
*/
|
|
261
|
-
|
|
229
|
+
updateBillingAddress(billingAddressId: string, country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress> {
|
|
262
230
|
if (typeof billingAddressId === 'undefined') {
|
|
263
231
|
throw new AppwriteException('Missing required parameter: "billingAddressId"');
|
|
264
232
|
}
|
|
@@ -300,10 +268,7 @@ export class Account {
|
|
|
300
268
|
'content-type': 'application/json',
|
|
301
269
|
}
|
|
302
270
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
return await this.client.call(
|
|
271
|
+
return this.client.call(
|
|
307
272
|
'put',
|
|
308
273
|
uri,
|
|
309
274
|
apiHeaders,
|
|
@@ -311,15 +276,13 @@ export class Account {
|
|
|
311
276
|
);
|
|
312
277
|
}
|
|
313
278
|
/**
|
|
314
|
-
* Delete billing address
|
|
315
|
-
*
|
|
316
279
|
* Delete a specific billing address using it's ID.
|
|
317
280
|
*
|
|
318
281
|
* @param {string} billingAddressId
|
|
319
282
|
* @throws {AppwriteException}
|
|
320
283
|
* @returns {Promise<{}>}
|
|
321
284
|
*/
|
|
322
|
-
|
|
285
|
+
deleteBillingAddress(billingAddressId: string): Promise<{}> {
|
|
323
286
|
if (typeof billingAddressId === 'undefined') {
|
|
324
287
|
throw new AppwriteException('Missing required parameter: "billingAddressId"');
|
|
325
288
|
}
|
|
@@ -331,10 +294,7 @@ export class Account {
|
|
|
331
294
|
'content-type': 'application/json',
|
|
332
295
|
}
|
|
333
296
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
return await this.client.call(
|
|
297
|
+
return this.client.call(
|
|
338
298
|
'delete',
|
|
339
299
|
uri,
|
|
340
300
|
apiHeaders,
|
|
@@ -342,15 +302,13 @@ export class Account {
|
|
|
342
302
|
);
|
|
343
303
|
}
|
|
344
304
|
/**
|
|
345
|
-
* Get coupon details
|
|
346
|
-
*
|
|
347
305
|
* Get coupon details for an account.
|
|
348
306
|
*
|
|
349
307
|
* @param {string} couponId
|
|
350
308
|
* @throws {AppwriteException}
|
|
351
309
|
* @returns {Promise<Models.Coupon>}
|
|
352
310
|
*/
|
|
353
|
-
|
|
311
|
+
getCoupon(couponId: string): Promise<Models.Coupon> {
|
|
354
312
|
if (typeof couponId === 'undefined') {
|
|
355
313
|
throw new AppwriteException('Missing required parameter: "couponId"');
|
|
356
314
|
}
|
|
@@ -362,10 +320,7 @@ export class Account {
|
|
|
362
320
|
'content-type': 'application/json',
|
|
363
321
|
}
|
|
364
322
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
return await this.client.call(
|
|
323
|
+
return this.client.call(
|
|
369
324
|
'get',
|
|
370
325
|
uri,
|
|
371
326
|
apiHeaders,
|
|
@@ -373,8 +328,6 @@ export class Account {
|
|
|
373
328
|
);
|
|
374
329
|
}
|
|
375
330
|
/**
|
|
376
|
-
* Update email
|
|
377
|
-
*
|
|
378
331
|
* Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
|
|
379
332
|
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
|
|
380
333
|
|
|
@@ -384,7 +337,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
384
337
|
* @throws {AppwriteException}
|
|
385
338
|
* @returns {Promise<Models.User<Preferences>>}
|
|
386
339
|
*/
|
|
387
|
-
|
|
340
|
+
updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>> {
|
|
388
341
|
if (typeof email === 'undefined') {
|
|
389
342
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
390
343
|
}
|
|
@@ -405,10 +358,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
405
358
|
'content-type': 'application/json',
|
|
406
359
|
}
|
|
407
360
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
return await this.client.call(
|
|
361
|
+
return this.client.call(
|
|
412
362
|
'patch',
|
|
413
363
|
uri,
|
|
414
364
|
apiHeaders,
|
|
@@ -416,15 +366,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
416
366
|
);
|
|
417
367
|
}
|
|
418
368
|
/**
|
|
419
|
-
* List identities
|
|
420
|
-
*
|
|
421
369
|
* Get the list of identities for the currently logged in user.
|
|
422
370
|
*
|
|
423
371
|
* @param {string[]} queries
|
|
424
372
|
* @throws {AppwriteException}
|
|
425
373
|
* @returns {Promise<Models.IdentityList>}
|
|
426
374
|
*/
|
|
427
|
-
|
|
375
|
+
listIdentities(queries?: string[]): Promise<Models.IdentityList> {
|
|
428
376
|
const apiPath = '/account/identities';
|
|
429
377
|
const payload: Payload = {};
|
|
430
378
|
if (typeof queries !== 'undefined') {
|
|
@@ -436,10 +384,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
436
384
|
'content-type': 'application/json',
|
|
437
385
|
}
|
|
438
386
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
return await this.client.call(
|
|
387
|
+
return this.client.call(
|
|
443
388
|
'get',
|
|
444
389
|
uri,
|
|
445
390
|
apiHeaders,
|
|
@@ -447,15 +392,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
447
392
|
);
|
|
448
393
|
}
|
|
449
394
|
/**
|
|
450
|
-
* Delete identity
|
|
451
|
-
*
|
|
452
395
|
* Delete an identity by its unique ID.
|
|
453
396
|
*
|
|
454
397
|
* @param {string} identityId
|
|
455
398
|
* @throws {AppwriteException}
|
|
456
399
|
* @returns {Promise<{}>}
|
|
457
400
|
*/
|
|
458
|
-
|
|
401
|
+
deleteIdentity(identityId: string): Promise<{}> {
|
|
459
402
|
if (typeof identityId === 'undefined') {
|
|
460
403
|
throw new AppwriteException('Missing required parameter: "identityId"');
|
|
461
404
|
}
|
|
@@ -467,10 +410,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
467
410
|
'content-type': 'application/json',
|
|
468
411
|
}
|
|
469
412
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
return await this.client.call(
|
|
413
|
+
return this.client.call(
|
|
474
414
|
'delete',
|
|
475
415
|
uri,
|
|
476
416
|
apiHeaders,
|
|
@@ -478,15 +418,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
478
418
|
);
|
|
479
419
|
}
|
|
480
420
|
/**
|
|
481
|
-
* List invoices
|
|
482
|
-
*
|
|
483
421
|
* List all invoices tied to an account.
|
|
484
422
|
*
|
|
485
423
|
* @param {string[]} queries
|
|
486
424
|
* @throws {AppwriteException}
|
|
487
425
|
* @returns {Promise<Models.InvoiceList>}
|
|
488
426
|
*/
|
|
489
|
-
|
|
427
|
+
listInvoices(queries?: string[]): Promise<Models.InvoiceList> {
|
|
490
428
|
const apiPath = '/account/invoices';
|
|
491
429
|
const payload: Payload = {};
|
|
492
430
|
if (typeof queries !== 'undefined') {
|
|
@@ -498,10 +436,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
498
436
|
'content-type': 'application/json',
|
|
499
437
|
}
|
|
500
438
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
return await this.client.call(
|
|
439
|
+
return this.client.call(
|
|
505
440
|
'get',
|
|
506
441
|
uri,
|
|
507
442
|
apiHeaders,
|
|
@@ -509,14 +444,12 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
509
444
|
);
|
|
510
445
|
}
|
|
511
446
|
/**
|
|
512
|
-
* Create JWT
|
|
513
|
-
*
|
|
514
447
|
* Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
|
|
515
448
|
*
|
|
516
449
|
* @throws {AppwriteException}
|
|
517
450
|
* @returns {Promise<Models.Jwt>}
|
|
518
451
|
*/
|
|
519
|
-
|
|
452
|
+
createJWT(): Promise<Models.Jwt> {
|
|
520
453
|
const apiPath = '/account/jwts';
|
|
521
454
|
const payload: Payload = {};
|
|
522
455
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -525,10 +458,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
525
458
|
'content-type': 'application/json',
|
|
526
459
|
}
|
|
527
460
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
return await this.client.call(
|
|
461
|
+
return this.client.call(
|
|
532
462
|
'post',
|
|
533
463
|
uri,
|
|
534
464
|
apiHeaders,
|
|
@@ -536,15 +466,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
536
466
|
);
|
|
537
467
|
}
|
|
538
468
|
/**
|
|
539
|
-
* List logs
|
|
540
|
-
*
|
|
541
469
|
* Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
|
|
542
470
|
*
|
|
543
471
|
* @param {string[]} queries
|
|
544
472
|
* @throws {AppwriteException}
|
|
545
473
|
* @returns {Promise<Models.LogList>}
|
|
546
474
|
*/
|
|
547
|
-
|
|
475
|
+
listLogs(queries?: string[]): Promise<Models.LogList> {
|
|
548
476
|
const apiPath = '/account/logs';
|
|
549
477
|
const payload: Payload = {};
|
|
550
478
|
if (typeof queries !== 'undefined') {
|
|
@@ -556,10 +484,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
556
484
|
'content-type': 'application/json',
|
|
557
485
|
}
|
|
558
486
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
return await this.client.call(
|
|
487
|
+
return this.client.call(
|
|
563
488
|
'get',
|
|
564
489
|
uri,
|
|
565
490
|
apiHeaders,
|
|
@@ -567,15 +492,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
567
492
|
);
|
|
568
493
|
}
|
|
569
494
|
/**
|
|
570
|
-
* Update MFA
|
|
571
|
-
*
|
|
572
495
|
* Enable or disable MFA on an account.
|
|
573
496
|
*
|
|
574
497
|
* @param {boolean} mfa
|
|
575
498
|
* @throws {AppwriteException}
|
|
576
499
|
* @returns {Promise<Models.User<Preferences>>}
|
|
577
500
|
*/
|
|
578
|
-
|
|
501
|
+
updateMFA<Preferences extends Models.Preferences>(mfa: boolean): Promise<Models.User<Preferences>> {
|
|
579
502
|
if (typeof mfa === 'undefined') {
|
|
580
503
|
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
581
504
|
}
|
|
@@ -590,10 +513,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
590
513
|
'content-type': 'application/json',
|
|
591
514
|
}
|
|
592
515
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
return await this.client.call(
|
|
516
|
+
return this.client.call(
|
|
597
517
|
'patch',
|
|
598
518
|
uri,
|
|
599
519
|
apiHeaders,
|
|
@@ -601,15 +521,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
601
521
|
);
|
|
602
522
|
}
|
|
603
523
|
/**
|
|
604
|
-
* Create authenticator
|
|
605
|
-
*
|
|
606
524
|
* 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.
|
|
607
525
|
*
|
|
608
526
|
* @param {AuthenticatorType} type
|
|
609
527
|
* @throws {AppwriteException}
|
|
610
528
|
* @returns {Promise<Models.MfaType>}
|
|
611
529
|
*/
|
|
612
|
-
|
|
530
|
+
createMfaAuthenticator(type: AuthenticatorType): Promise<Models.MfaType> {
|
|
613
531
|
if (typeof type === 'undefined') {
|
|
614
532
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
615
533
|
}
|
|
@@ -621,10 +539,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
621
539
|
'content-type': 'application/json',
|
|
622
540
|
}
|
|
623
541
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
return await this.client.call(
|
|
542
|
+
return this.client.call(
|
|
628
543
|
'post',
|
|
629
544
|
uri,
|
|
630
545
|
apiHeaders,
|
|
@@ -632,8 +547,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
632
547
|
);
|
|
633
548
|
}
|
|
634
549
|
/**
|
|
635
|
-
* Verify authenticator
|
|
636
|
-
*
|
|
637
550
|
* Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
|
|
638
551
|
*
|
|
639
552
|
* @param {AuthenticatorType} type
|
|
@@ -641,7 +554,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
641
554
|
* @throws {AppwriteException}
|
|
642
555
|
* @returns {Promise<Models.User<Preferences>>}
|
|
643
556
|
*/
|
|
644
|
-
|
|
557
|
+
updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> {
|
|
645
558
|
if (typeof type === 'undefined') {
|
|
646
559
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
647
560
|
}
|
|
@@ -659,10 +572,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
659
572
|
'content-type': 'application/json',
|
|
660
573
|
}
|
|
661
574
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
return await this.client.call(
|
|
575
|
+
return this.client.call(
|
|
666
576
|
'put',
|
|
667
577
|
uri,
|
|
668
578
|
apiHeaders,
|
|
@@ -670,15 +580,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
670
580
|
);
|
|
671
581
|
}
|
|
672
582
|
/**
|
|
673
|
-
* Delete authenticator
|
|
674
|
-
*
|
|
675
583
|
* Delete an authenticator for a user by ID.
|
|
676
584
|
*
|
|
677
585
|
* @param {AuthenticatorType} type
|
|
678
586
|
* @throws {AppwriteException}
|
|
679
587
|
* @returns {Promise<{}>}
|
|
680
588
|
*/
|
|
681
|
-
|
|
589
|
+
deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> {
|
|
682
590
|
if (typeof type === 'undefined') {
|
|
683
591
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
684
592
|
}
|
|
@@ -690,10 +598,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
690
598
|
'content-type': 'application/json',
|
|
691
599
|
}
|
|
692
600
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
return await this.client.call(
|
|
601
|
+
return this.client.call(
|
|
697
602
|
'delete',
|
|
698
603
|
uri,
|
|
699
604
|
apiHeaders,
|
|
@@ -701,15 +606,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
701
606
|
);
|
|
702
607
|
}
|
|
703
608
|
/**
|
|
704
|
-
* Create MFA challenge
|
|
705
|
-
*
|
|
706
609
|
* Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
|
|
707
610
|
*
|
|
708
611
|
* @param {AuthenticationFactor} factor
|
|
709
612
|
* @throws {AppwriteException}
|
|
710
613
|
* @returns {Promise<Models.MfaChallenge>}
|
|
711
614
|
*/
|
|
712
|
-
|
|
615
|
+
createMfaChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge> {
|
|
713
616
|
if (typeof factor === 'undefined') {
|
|
714
617
|
throw new AppwriteException('Missing required parameter: "factor"');
|
|
715
618
|
}
|
|
@@ -724,10 +627,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
724
627
|
'content-type': 'application/json',
|
|
725
628
|
}
|
|
726
629
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
return await this.client.call(
|
|
630
|
+
return this.client.call(
|
|
731
631
|
'post',
|
|
732
632
|
uri,
|
|
733
633
|
apiHeaders,
|
|
@@ -735,8 +635,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
735
635
|
);
|
|
736
636
|
}
|
|
737
637
|
/**
|
|
738
|
-
* Create MFA challenge (confirmation)
|
|
739
|
-
*
|
|
740
638
|
* Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
|
|
741
639
|
*
|
|
742
640
|
* @param {string} challengeId
|
|
@@ -744,7 +642,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
744
642
|
* @throws {AppwriteException}
|
|
745
643
|
* @returns {Promise<Models.Session>}
|
|
746
644
|
*/
|
|
747
|
-
|
|
645
|
+
updateMfaChallenge(challengeId: string, otp: string): Promise<Models.Session> {
|
|
748
646
|
if (typeof challengeId === 'undefined') {
|
|
749
647
|
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
750
648
|
}
|
|
@@ -765,10 +663,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
765
663
|
'content-type': 'application/json',
|
|
766
664
|
}
|
|
767
665
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
return await this.client.call(
|
|
666
|
+
return this.client.call(
|
|
772
667
|
'put',
|
|
773
668
|
uri,
|
|
774
669
|
apiHeaders,
|
|
@@ -776,14 +671,12 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
776
671
|
);
|
|
777
672
|
}
|
|
778
673
|
/**
|
|
779
|
-
* List factors
|
|
780
|
-
*
|
|
781
674
|
* List the factors available on the account to be used as a MFA challange.
|
|
782
675
|
*
|
|
783
676
|
* @throws {AppwriteException}
|
|
784
677
|
* @returns {Promise<Models.MfaFactors>}
|
|
785
678
|
*/
|
|
786
|
-
|
|
679
|
+
listMfaFactors(): Promise<Models.MfaFactors> {
|
|
787
680
|
const apiPath = '/account/mfa/factors';
|
|
788
681
|
const payload: Payload = {};
|
|
789
682
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -792,10 +685,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
792
685
|
'content-type': 'application/json',
|
|
793
686
|
}
|
|
794
687
|
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
return await this.client.call(
|
|
688
|
+
return this.client.call(
|
|
799
689
|
'get',
|
|
800
690
|
uri,
|
|
801
691
|
apiHeaders,
|
|
@@ -803,14 +693,12 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
803
693
|
);
|
|
804
694
|
}
|
|
805
695
|
/**
|
|
806
|
-
* Get MFA recovery codes
|
|
807
|
-
*
|
|
808
696
|
* Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.
|
|
809
697
|
*
|
|
810
698
|
* @throws {AppwriteException}
|
|
811
699
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
812
700
|
*/
|
|
813
|
-
|
|
701
|
+
getMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
814
702
|
const apiPath = '/account/mfa/recovery-codes';
|
|
815
703
|
const payload: Payload = {};
|
|
816
704
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -819,10 +707,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
819
707
|
'content-type': 'application/json',
|
|
820
708
|
}
|
|
821
709
|
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
return await this.client.call(
|
|
710
|
+
return this.client.call(
|
|
826
711
|
'get',
|
|
827
712
|
uri,
|
|
828
713
|
apiHeaders,
|
|
@@ -830,14 +715,12 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
830
715
|
);
|
|
831
716
|
}
|
|
832
717
|
/**
|
|
833
|
-
* Create MFA recovery codes
|
|
834
|
-
*
|
|
835
718
|
* Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
|
|
836
719
|
*
|
|
837
720
|
* @throws {AppwriteException}
|
|
838
721
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
839
722
|
*/
|
|
840
|
-
|
|
723
|
+
createMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
841
724
|
const apiPath = '/account/mfa/recovery-codes';
|
|
842
725
|
const payload: Payload = {};
|
|
843
726
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -846,10 +729,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
846
729
|
'content-type': 'application/json',
|
|
847
730
|
}
|
|
848
731
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
return await this.client.call(
|
|
732
|
+
return this.client.call(
|
|
853
733
|
'post',
|
|
854
734
|
uri,
|
|
855
735
|
apiHeaders,
|
|
@@ -857,14 +737,12 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
857
737
|
);
|
|
858
738
|
}
|
|
859
739
|
/**
|
|
860
|
-
* Regenerate MFA recovery codes
|
|
861
|
-
*
|
|
862
740
|
* Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.
|
|
863
741
|
*
|
|
864
742
|
* @throws {AppwriteException}
|
|
865
743
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
866
744
|
*/
|
|
867
|
-
|
|
745
|
+
updateMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
868
746
|
const apiPath = '/account/mfa/recovery-codes';
|
|
869
747
|
const payload: Payload = {};
|
|
870
748
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -873,10 +751,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
873
751
|
'content-type': 'application/json',
|
|
874
752
|
}
|
|
875
753
|
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
return await this.client.call(
|
|
754
|
+
return this.client.call(
|
|
880
755
|
'patch',
|
|
881
756
|
uri,
|
|
882
757
|
apiHeaders,
|
|
@@ -884,15 +759,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
884
759
|
);
|
|
885
760
|
}
|
|
886
761
|
/**
|
|
887
|
-
* Update name
|
|
888
|
-
*
|
|
889
762
|
* Update currently logged in user account name.
|
|
890
763
|
*
|
|
891
764
|
* @param {string} name
|
|
892
765
|
* @throws {AppwriteException}
|
|
893
766
|
* @returns {Promise<Models.User<Preferences>>}
|
|
894
767
|
*/
|
|
895
|
-
|
|
768
|
+
updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>> {
|
|
896
769
|
if (typeof name === 'undefined') {
|
|
897
770
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
898
771
|
}
|
|
@@ -907,10 +780,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
907
780
|
'content-type': 'application/json',
|
|
908
781
|
}
|
|
909
782
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
return await this.client.call(
|
|
783
|
+
return this.client.call(
|
|
914
784
|
'patch',
|
|
915
785
|
uri,
|
|
916
786
|
apiHeaders,
|
|
@@ -918,8 +788,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
918
788
|
);
|
|
919
789
|
}
|
|
920
790
|
/**
|
|
921
|
-
* Update password
|
|
922
|
-
*
|
|
923
791
|
* Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.
|
|
924
792
|
*
|
|
925
793
|
* @param {string} password
|
|
@@ -927,7 +795,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
927
795
|
* @throws {AppwriteException}
|
|
928
796
|
* @returns {Promise<Models.User<Preferences>>}
|
|
929
797
|
*/
|
|
930
|
-
|
|
798
|
+
updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>> {
|
|
931
799
|
if (typeof password === 'undefined') {
|
|
932
800
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
933
801
|
}
|
|
@@ -945,10 +813,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
945
813
|
'content-type': 'application/json',
|
|
946
814
|
}
|
|
947
815
|
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
return await this.client.call(
|
|
816
|
+
return this.client.call(
|
|
952
817
|
'patch',
|
|
953
818
|
uri,
|
|
954
819
|
apiHeaders,
|
|
@@ -956,15 +821,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
956
821
|
);
|
|
957
822
|
}
|
|
958
823
|
/**
|
|
959
|
-
* List payment methods
|
|
960
|
-
*
|
|
961
824
|
* List payment methods for this account.
|
|
962
825
|
*
|
|
963
826
|
* @param {string[]} queries
|
|
964
827
|
* @throws {AppwriteException}
|
|
965
828
|
* @returns {Promise<Models.PaymentMethodList>}
|
|
966
829
|
*/
|
|
967
|
-
|
|
830
|
+
listPaymentMethods(queries?: string[]): Promise<Models.PaymentMethodList> {
|
|
968
831
|
const apiPath = '/account/payment-methods';
|
|
969
832
|
const payload: Payload = {};
|
|
970
833
|
if (typeof queries !== 'undefined') {
|
|
@@ -976,10 +839,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
976
839
|
'content-type': 'application/json',
|
|
977
840
|
}
|
|
978
841
|
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
return await this.client.call(
|
|
842
|
+
return this.client.call(
|
|
983
843
|
'get',
|
|
984
844
|
uri,
|
|
985
845
|
apiHeaders,
|
|
@@ -987,14 +847,12 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
987
847
|
);
|
|
988
848
|
}
|
|
989
849
|
/**
|
|
990
|
-
* Create new payment method
|
|
991
|
-
*
|
|
992
850
|
* Create a new payment method for the current user account.
|
|
993
851
|
*
|
|
994
852
|
* @throws {AppwriteException}
|
|
995
853
|
* @returns {Promise<Models.PaymentMethod>}
|
|
996
854
|
*/
|
|
997
|
-
|
|
855
|
+
createPaymentMethod(): Promise<Models.PaymentMethod> {
|
|
998
856
|
const apiPath = '/account/payment-methods';
|
|
999
857
|
const payload: Payload = {};
|
|
1000
858
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1003,10 +861,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1003
861
|
'content-type': 'application/json',
|
|
1004
862
|
}
|
|
1005
863
|
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
return await this.client.call(
|
|
864
|
+
return this.client.call(
|
|
1010
865
|
'post',
|
|
1011
866
|
uri,
|
|
1012
867
|
apiHeaders,
|
|
@@ -1014,15 +869,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1014
869
|
);
|
|
1015
870
|
}
|
|
1016
871
|
/**
|
|
1017
|
-
* Get payment method
|
|
1018
|
-
*
|
|
1019
872
|
* Get a specific payment method for the user.
|
|
1020
873
|
*
|
|
1021
874
|
* @param {string} paymentMethodId
|
|
1022
875
|
* @throws {AppwriteException}
|
|
1023
876
|
* @returns {Promise<Models.PaymentMethod>}
|
|
1024
877
|
*/
|
|
1025
|
-
|
|
878
|
+
getPaymentMethod(paymentMethodId: string): Promise<Models.PaymentMethod> {
|
|
1026
879
|
if (typeof paymentMethodId === 'undefined') {
|
|
1027
880
|
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
1028
881
|
}
|
|
@@ -1034,10 +887,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1034
887
|
'content-type': 'application/json',
|
|
1035
888
|
}
|
|
1036
889
|
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
return await this.client.call(
|
|
890
|
+
return this.client.call(
|
|
1041
891
|
'get',
|
|
1042
892
|
uri,
|
|
1043
893
|
apiHeaders,
|
|
@@ -1045,8 +895,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1045
895
|
);
|
|
1046
896
|
}
|
|
1047
897
|
/**
|
|
1048
|
-
* Update payment method
|
|
1049
|
-
*
|
|
1050
898
|
* Update a new payment method for the current user account.
|
|
1051
899
|
*
|
|
1052
900
|
* @param {string} paymentMethodId
|
|
@@ -1055,7 +903,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1055
903
|
* @throws {AppwriteException}
|
|
1056
904
|
* @returns {Promise<Models.PaymentMethod>}
|
|
1057
905
|
*/
|
|
1058
|
-
|
|
906
|
+
updatePaymentMethod(paymentMethodId: string, expiryMonth: number, expiryYear: number): Promise<Models.PaymentMethod> {
|
|
1059
907
|
if (typeof paymentMethodId === 'undefined') {
|
|
1060
908
|
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
1061
909
|
}
|
|
@@ -1079,10 +927,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1079
927
|
'content-type': 'application/json',
|
|
1080
928
|
}
|
|
1081
929
|
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
return await this.client.call(
|
|
930
|
+
return this.client.call(
|
|
1086
931
|
'patch',
|
|
1087
932
|
uri,
|
|
1088
933
|
apiHeaders,
|
|
@@ -1090,15 +935,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1090
935
|
);
|
|
1091
936
|
}
|
|
1092
937
|
/**
|
|
1093
|
-
* Delete payment method
|
|
1094
|
-
*
|
|
1095
938
|
* Delete a specific payment method from a user's account.
|
|
1096
939
|
*
|
|
1097
940
|
* @param {string} paymentMethodId
|
|
1098
941
|
* @throws {AppwriteException}
|
|
1099
942
|
* @returns {Promise<{}>}
|
|
1100
943
|
*/
|
|
1101
|
-
|
|
944
|
+
deletePaymentMethod(paymentMethodId: string): Promise<{}> {
|
|
1102
945
|
if (typeof paymentMethodId === 'undefined') {
|
|
1103
946
|
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
1104
947
|
}
|
|
@@ -1110,10 +953,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1110
953
|
'content-type': 'application/json',
|
|
1111
954
|
}
|
|
1112
955
|
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
return await this.client.call(
|
|
956
|
+
return this.client.call(
|
|
1117
957
|
'delete',
|
|
1118
958
|
uri,
|
|
1119
959
|
apiHeaders,
|
|
@@ -1121,8 +961,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1121
961
|
);
|
|
1122
962
|
}
|
|
1123
963
|
/**
|
|
1124
|
-
* Update payment method provider id
|
|
1125
|
-
*
|
|
1126
964
|
* Update payment method provider.
|
|
1127
965
|
*
|
|
1128
966
|
* @param {string} paymentMethodId
|
|
@@ -1131,7 +969,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1131
969
|
* @throws {AppwriteException}
|
|
1132
970
|
* @returns {Promise<Models.PaymentMethod>}
|
|
1133
971
|
*/
|
|
1134
|
-
|
|
972
|
+
updatePaymentMethodProvider(paymentMethodId: string, providerMethodId: string, name: string): Promise<Models.PaymentMethod> {
|
|
1135
973
|
if (typeof paymentMethodId === 'undefined') {
|
|
1136
974
|
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
1137
975
|
}
|
|
@@ -1155,10 +993,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1155
993
|
'content-type': 'application/json',
|
|
1156
994
|
}
|
|
1157
995
|
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
return await this.client.call(
|
|
996
|
+
return this.client.call(
|
|
1162
997
|
'patch',
|
|
1163
998
|
uri,
|
|
1164
999
|
apiHeaders,
|
|
@@ -1166,15 +1001,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1166
1001
|
);
|
|
1167
1002
|
}
|
|
1168
1003
|
/**
|
|
1169
|
-
* Update payment method with new setup with mandates for indian cards
|
|
1170
|
-
*
|
|
1171
1004
|
* Update payment method mandate options.
|
|
1172
1005
|
*
|
|
1173
1006
|
* @param {string} paymentMethodId
|
|
1174
1007
|
* @throws {AppwriteException}
|
|
1175
1008
|
* @returns {Promise<Models.PaymentMethod>}
|
|
1176
1009
|
*/
|
|
1177
|
-
|
|
1010
|
+
updatePaymentMethodMandateOptions(paymentMethodId: string): Promise<Models.PaymentMethod> {
|
|
1178
1011
|
if (typeof paymentMethodId === 'undefined') {
|
|
1179
1012
|
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
1180
1013
|
}
|
|
@@ -1186,10 +1019,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1186
1019
|
'content-type': 'application/json',
|
|
1187
1020
|
}
|
|
1188
1021
|
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
return await this.client.call(
|
|
1022
|
+
return this.client.call(
|
|
1193
1023
|
'patch',
|
|
1194
1024
|
uri,
|
|
1195
1025
|
apiHeaders,
|
|
@@ -1197,8 +1027,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1197
1027
|
);
|
|
1198
1028
|
}
|
|
1199
1029
|
/**
|
|
1200
|
-
* Update phone
|
|
1201
|
-
*
|
|
1202
1030
|
* Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.
|
|
1203
1031
|
*
|
|
1204
1032
|
* @param {string} phone
|
|
@@ -1206,7 +1034,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1206
1034
|
* @throws {AppwriteException}
|
|
1207
1035
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1208
1036
|
*/
|
|
1209
|
-
|
|
1037
|
+
updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.User<Preferences>> {
|
|
1210
1038
|
if (typeof phone === 'undefined') {
|
|
1211
1039
|
throw new AppwriteException('Missing required parameter: "phone"');
|
|
1212
1040
|
}
|
|
@@ -1227,10 +1055,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1227
1055
|
'content-type': 'application/json',
|
|
1228
1056
|
}
|
|
1229
1057
|
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
return await this.client.call(
|
|
1058
|
+
return this.client.call(
|
|
1234
1059
|
'patch',
|
|
1235
1060
|
uri,
|
|
1236
1061
|
apiHeaders,
|
|
@@ -1238,14 +1063,12 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1238
1063
|
);
|
|
1239
1064
|
}
|
|
1240
1065
|
/**
|
|
1241
|
-
* Get account preferences
|
|
1242
|
-
*
|
|
1243
1066
|
* Get the preferences as a key-value object for the currently logged in user.
|
|
1244
1067
|
*
|
|
1245
1068
|
* @throws {AppwriteException}
|
|
1246
1069
|
* @returns {Promise<Preferences>}
|
|
1247
1070
|
*/
|
|
1248
|
-
|
|
1071
|
+
getPrefs<Preferences extends Models.Preferences>(): Promise<Preferences> {
|
|
1249
1072
|
const apiPath = '/account/prefs';
|
|
1250
1073
|
const payload: Payload = {};
|
|
1251
1074
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1254,10 +1077,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1254
1077
|
'content-type': 'application/json',
|
|
1255
1078
|
}
|
|
1256
1079
|
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
return await this.client.call(
|
|
1080
|
+
return this.client.call(
|
|
1261
1081
|
'get',
|
|
1262
1082
|
uri,
|
|
1263
1083
|
apiHeaders,
|
|
@@ -1265,15 +1085,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1265
1085
|
);
|
|
1266
1086
|
}
|
|
1267
1087
|
/**
|
|
1268
|
-
* Update preferences
|
|
1269
|
-
*
|
|
1270
1088
|
* Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
|
|
1271
1089
|
*
|
|
1272
1090
|
* @param {Partial<Preferences>} prefs
|
|
1273
1091
|
* @throws {AppwriteException}
|
|
1274
1092
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1275
1093
|
*/
|
|
1276
|
-
|
|
1094
|
+
updatePrefs<Preferences extends Models.Preferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>> {
|
|
1277
1095
|
if (typeof prefs === 'undefined') {
|
|
1278
1096
|
throw new AppwriteException('Missing required parameter: "prefs"');
|
|
1279
1097
|
}
|
|
@@ -1288,10 +1106,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1288
1106
|
'content-type': 'application/json',
|
|
1289
1107
|
}
|
|
1290
1108
|
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
return await this.client.call(
|
|
1109
|
+
return this.client.call(
|
|
1295
1110
|
'patch',
|
|
1296
1111
|
uri,
|
|
1297
1112
|
apiHeaders,
|
|
@@ -1299,8 +1114,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1299
1114
|
);
|
|
1300
1115
|
}
|
|
1301
1116
|
/**
|
|
1302
|
-
* Create password recovery
|
|
1303
|
-
*
|
|
1304
1117
|
* Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.
|
|
1305
1118
|
*
|
|
1306
1119
|
* @param {string} email
|
|
@@ -1308,7 +1121,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1308
1121
|
* @throws {AppwriteException}
|
|
1309
1122
|
* @returns {Promise<Models.Token>}
|
|
1310
1123
|
*/
|
|
1311
|
-
|
|
1124
|
+
createRecovery(email: string, url: string): Promise<Models.Token> {
|
|
1312
1125
|
if (typeof email === 'undefined') {
|
|
1313
1126
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
1314
1127
|
}
|
|
@@ -1329,10 +1142,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1329
1142
|
'content-type': 'application/json',
|
|
1330
1143
|
}
|
|
1331
1144
|
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
return await this.client.call(
|
|
1145
|
+
return this.client.call(
|
|
1336
1146
|
'post',
|
|
1337
1147
|
uri,
|
|
1338
1148
|
apiHeaders,
|
|
@@ -1340,8 +1150,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1340
1150
|
);
|
|
1341
1151
|
}
|
|
1342
1152
|
/**
|
|
1343
|
-
* Create password recovery (confirmation)
|
|
1344
|
-
*
|
|
1345
1153
|
* Use this endpoint to complete the user account password reset. 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/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint.
|
|
1346
1154
|
|
|
1347
1155
|
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.
|
|
@@ -1352,7 +1160,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1352
1160
|
* @throws {AppwriteException}
|
|
1353
1161
|
* @returns {Promise<Models.Token>}
|
|
1354
1162
|
*/
|
|
1355
|
-
|
|
1163
|
+
updateRecovery(userId: string, secret: string, password: string): Promise<Models.Token> {
|
|
1356
1164
|
if (typeof userId === 'undefined') {
|
|
1357
1165
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1358
1166
|
}
|
|
@@ -1379,10 +1187,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1379
1187
|
'content-type': 'application/json',
|
|
1380
1188
|
}
|
|
1381
1189
|
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
return await this.client.call(
|
|
1190
|
+
return this.client.call(
|
|
1386
1191
|
'put',
|
|
1387
1192
|
uri,
|
|
1388
1193
|
apiHeaders,
|
|
@@ -1390,14 +1195,12 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1390
1195
|
);
|
|
1391
1196
|
}
|
|
1392
1197
|
/**
|
|
1393
|
-
* List sessions
|
|
1394
|
-
*
|
|
1395
1198
|
* Get the list of active sessions across different devices for the currently logged in user.
|
|
1396
1199
|
*
|
|
1397
1200
|
* @throws {AppwriteException}
|
|
1398
1201
|
* @returns {Promise<Models.SessionList>}
|
|
1399
1202
|
*/
|
|
1400
|
-
|
|
1203
|
+
listSessions(): Promise<Models.SessionList> {
|
|
1401
1204
|
const apiPath = '/account/sessions';
|
|
1402
1205
|
const payload: Payload = {};
|
|
1403
1206
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1406,10 +1209,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1406
1209
|
'content-type': 'application/json',
|
|
1407
1210
|
}
|
|
1408
1211
|
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
return await this.client.call(
|
|
1212
|
+
return this.client.call(
|
|
1413
1213
|
'get',
|
|
1414
1214
|
uri,
|
|
1415
1215
|
apiHeaders,
|
|
@@ -1417,14 +1217,12 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1417
1217
|
);
|
|
1418
1218
|
}
|
|
1419
1219
|
/**
|
|
1420
|
-
* Delete sessions
|
|
1421
|
-
*
|
|
1422
1220
|
* Delete all sessions from the user account and remove any sessions cookies from the end client.
|
|
1423
1221
|
*
|
|
1424
1222
|
* @throws {AppwriteException}
|
|
1425
1223
|
* @returns {Promise<{}>}
|
|
1426
1224
|
*/
|
|
1427
|
-
|
|
1225
|
+
deleteSessions(): Promise<{}> {
|
|
1428
1226
|
const apiPath = '/account/sessions';
|
|
1429
1227
|
const payload: Payload = {};
|
|
1430
1228
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1433,10 +1231,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1433
1231
|
'content-type': 'application/json',
|
|
1434
1232
|
}
|
|
1435
1233
|
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
return await this.client.call(
|
|
1234
|
+
return this.client.call(
|
|
1440
1235
|
'delete',
|
|
1441
1236
|
uri,
|
|
1442
1237
|
apiHeaders,
|
|
@@ -1444,14 +1239,12 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1444
1239
|
);
|
|
1445
1240
|
}
|
|
1446
1241
|
/**
|
|
1447
|
-
* Create anonymous session
|
|
1448
|
-
*
|
|
1449
1242
|
* 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](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).
|
|
1450
1243
|
*
|
|
1451
1244
|
* @throws {AppwriteException}
|
|
1452
1245
|
* @returns {Promise<Models.Session>}
|
|
1453
1246
|
*/
|
|
1454
|
-
|
|
1247
|
+
createAnonymousSession(): Promise<Models.Session> {
|
|
1455
1248
|
const apiPath = '/account/sessions/anonymous';
|
|
1456
1249
|
const payload: Payload = {};
|
|
1457
1250
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1460,10 +1253,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1460
1253
|
'content-type': 'application/json',
|
|
1461
1254
|
}
|
|
1462
1255
|
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
return await this.client.call(
|
|
1256
|
+
return this.client.call(
|
|
1467
1257
|
'post',
|
|
1468
1258
|
uri,
|
|
1469
1259
|
apiHeaders,
|
|
@@ -1471,8 +1261,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1471
1261
|
);
|
|
1472
1262
|
}
|
|
1473
1263
|
/**
|
|
1474
|
-
* Create email password session
|
|
1475
|
-
*
|
|
1476
1264
|
* 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.
|
|
1477
1265
|
|
|
1478
1266
|
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
@@ -1482,7 +1270,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1482
1270
|
* @throws {AppwriteException}
|
|
1483
1271
|
* @returns {Promise<Models.Session>}
|
|
1484
1272
|
*/
|
|
1485
|
-
|
|
1273
|
+
createEmailPasswordSession(email: string, password: string): Promise<Models.Session> {
|
|
1486
1274
|
if (typeof email === 'undefined') {
|
|
1487
1275
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
1488
1276
|
}
|
|
@@ -1503,10 +1291,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1503
1291
|
'content-type': 'application/json',
|
|
1504
1292
|
}
|
|
1505
1293
|
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
return await this.client.call(
|
|
1294
|
+
return this.client.call(
|
|
1510
1295
|
'post',
|
|
1511
1296
|
uri,
|
|
1512
1297
|
apiHeaders,
|
|
@@ -1514,8 +1299,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1514
1299
|
);
|
|
1515
1300
|
}
|
|
1516
1301
|
/**
|
|
1517
|
-
* Update magic URL session
|
|
1518
|
-
*
|
|
1519
1302
|
* Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
|
|
1520
1303
|
*
|
|
1521
1304
|
* @param {string} userId
|
|
@@ -1523,7 +1306,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1523
1306
|
* @throws {AppwriteException}
|
|
1524
1307
|
* @returns {Promise<Models.Session>}
|
|
1525
1308
|
*/
|
|
1526
|
-
|
|
1309
|
+
updateMagicURLSession(userId: string, secret: string): Promise<Models.Session> {
|
|
1527
1310
|
if (typeof userId === 'undefined') {
|
|
1528
1311
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1529
1312
|
}
|
|
@@ -1544,10 +1327,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1544
1327
|
'content-type': 'application/json',
|
|
1545
1328
|
}
|
|
1546
1329
|
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
return await this.client.call(
|
|
1330
|
+
return this.client.call(
|
|
1551
1331
|
'put',
|
|
1552
1332
|
uri,
|
|
1553
1333
|
apiHeaders,
|
|
@@ -1555,8 +1335,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1555
1335
|
);
|
|
1556
1336
|
}
|
|
1557
1337
|
/**
|
|
1558
|
-
* Create OAuth2 session
|
|
1559
|
-
*
|
|
1560
1338
|
* 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.
|
|
1561
1339
|
|
|
1562
1340
|
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.
|
|
@@ -1569,9 +1347,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1569
1347
|
* @param {string} failure
|
|
1570
1348
|
* @param {string[]} scopes
|
|
1571
1349
|
* @throws {AppwriteException}
|
|
1572
|
-
* @returns {
|
|
1350
|
+
* @returns {void | string}
|
|
1573
1351
|
*/
|
|
1574
|
-
|
|
1352
|
+
createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | string {
|
|
1575
1353
|
if (typeof provider === 'undefined') {
|
|
1576
1354
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
1577
1355
|
}
|
|
@@ -1597,7 +1375,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1597
1375
|
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
1598
1376
|
uri.searchParams.append(key, value);
|
|
1599
1377
|
}
|
|
1600
|
-
|
|
1378
|
+
|
|
1601
1379
|
if (typeof window !== 'undefined' && window?.location) {
|
|
1602
1380
|
window.location.href = uri.toString();
|
|
1603
1381
|
return;
|
|
@@ -1606,8 +1384,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1606
1384
|
}
|
|
1607
1385
|
}
|
|
1608
1386
|
/**
|
|
1609
|
-
* Update phone session
|
|
1610
|
-
*
|
|
1611
1387
|
* Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
|
|
1612
1388
|
*
|
|
1613
1389
|
* @param {string} userId
|
|
@@ -1615,7 +1391,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1615
1391
|
* @throws {AppwriteException}
|
|
1616
1392
|
* @returns {Promise<Models.Session>}
|
|
1617
1393
|
*/
|
|
1618
|
-
|
|
1394
|
+
updatePhoneSession(userId: string, secret: string): Promise<Models.Session> {
|
|
1619
1395
|
if (typeof userId === 'undefined') {
|
|
1620
1396
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1621
1397
|
}
|
|
@@ -1636,10 +1412,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1636
1412
|
'content-type': 'application/json',
|
|
1637
1413
|
}
|
|
1638
1414
|
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
return await this.client.call(
|
|
1415
|
+
return this.client.call(
|
|
1643
1416
|
'put',
|
|
1644
1417
|
uri,
|
|
1645
1418
|
apiHeaders,
|
|
@@ -1647,8 +1420,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1647
1420
|
);
|
|
1648
1421
|
}
|
|
1649
1422
|
/**
|
|
1650
|
-
* Create session
|
|
1651
|
-
*
|
|
1652
1423
|
* Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
|
|
1653
1424
|
*
|
|
1654
1425
|
* @param {string} userId
|
|
@@ -1656,7 +1427,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1656
1427
|
* @throws {AppwriteException}
|
|
1657
1428
|
* @returns {Promise<Models.Session>}
|
|
1658
1429
|
*/
|
|
1659
|
-
|
|
1430
|
+
createSession(userId: string, secret: string): Promise<Models.Session> {
|
|
1660
1431
|
if (typeof userId === 'undefined') {
|
|
1661
1432
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1662
1433
|
}
|
|
@@ -1677,10 +1448,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1677
1448
|
'content-type': 'application/json',
|
|
1678
1449
|
}
|
|
1679
1450
|
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
return await this.client.call(
|
|
1451
|
+
return this.client.call(
|
|
1684
1452
|
'post',
|
|
1685
1453
|
uri,
|
|
1686
1454
|
apiHeaders,
|
|
@@ -1688,15 +1456,13 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1688
1456
|
);
|
|
1689
1457
|
}
|
|
1690
1458
|
/**
|
|
1691
|
-
* Get session
|
|
1692
|
-
*
|
|
1693
1459
|
* Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.
|
|
1694
1460
|
*
|
|
1695
1461
|
* @param {string} sessionId
|
|
1696
1462
|
* @throws {AppwriteException}
|
|
1697
1463
|
* @returns {Promise<Models.Session>}
|
|
1698
1464
|
*/
|
|
1699
|
-
|
|
1465
|
+
getSession(sessionId: string): Promise<Models.Session> {
|
|
1700
1466
|
if (typeof sessionId === 'undefined') {
|
|
1701
1467
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1702
1468
|
}
|
|
@@ -1708,10 +1474,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1708
1474
|
'content-type': 'application/json',
|
|
1709
1475
|
}
|
|
1710
1476
|
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
return await this.client.call(
|
|
1477
|
+
return this.client.call(
|
|
1715
1478
|
'get',
|
|
1716
1479
|
uri,
|
|
1717
1480
|
apiHeaders,
|
|
@@ -1719,15 +1482,13 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1719
1482
|
);
|
|
1720
1483
|
}
|
|
1721
1484
|
/**
|
|
1722
|
-
* Update session
|
|
1723
|
-
*
|
|
1724
1485
|
* Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.
|
|
1725
1486
|
*
|
|
1726
1487
|
* @param {string} sessionId
|
|
1727
1488
|
* @throws {AppwriteException}
|
|
1728
1489
|
* @returns {Promise<Models.Session>}
|
|
1729
1490
|
*/
|
|
1730
|
-
|
|
1491
|
+
updateSession(sessionId: string): Promise<Models.Session> {
|
|
1731
1492
|
if (typeof sessionId === 'undefined') {
|
|
1732
1493
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1733
1494
|
}
|
|
@@ -1739,10 +1500,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1739
1500
|
'content-type': 'application/json',
|
|
1740
1501
|
}
|
|
1741
1502
|
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
return await this.client.call(
|
|
1503
|
+
return this.client.call(
|
|
1746
1504
|
'patch',
|
|
1747
1505
|
uri,
|
|
1748
1506
|
apiHeaders,
|
|
@@ -1750,15 +1508,13 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1750
1508
|
);
|
|
1751
1509
|
}
|
|
1752
1510
|
/**
|
|
1753
|
-
* Delete session
|
|
1754
|
-
*
|
|
1755
1511
|
* Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.
|
|
1756
1512
|
*
|
|
1757
1513
|
* @param {string} sessionId
|
|
1758
1514
|
* @throws {AppwriteException}
|
|
1759
1515
|
* @returns {Promise<{}>}
|
|
1760
1516
|
*/
|
|
1761
|
-
|
|
1517
|
+
deleteSession(sessionId: string): Promise<{}> {
|
|
1762
1518
|
if (typeof sessionId === 'undefined') {
|
|
1763
1519
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1764
1520
|
}
|
|
@@ -1770,10 +1526,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1770
1526
|
'content-type': 'application/json',
|
|
1771
1527
|
}
|
|
1772
1528
|
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
return await this.client.call(
|
|
1529
|
+
return this.client.call(
|
|
1777
1530
|
'delete',
|
|
1778
1531
|
uri,
|
|
1779
1532
|
apiHeaders,
|
|
@@ -1781,14 +1534,12 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1781
1534
|
);
|
|
1782
1535
|
}
|
|
1783
1536
|
/**
|
|
1784
|
-
* Update status
|
|
1785
|
-
*
|
|
1786
1537
|
* Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.
|
|
1787
1538
|
*
|
|
1788
1539
|
* @throws {AppwriteException}
|
|
1789
1540
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1790
1541
|
*/
|
|
1791
|
-
|
|
1542
|
+
updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>> {
|
|
1792
1543
|
const apiPath = '/account/status';
|
|
1793
1544
|
const payload: Payload = {};
|
|
1794
1545
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1797,10 +1548,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1797
1548
|
'content-type': 'application/json',
|
|
1798
1549
|
}
|
|
1799
1550
|
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
return await this.client.call(
|
|
1551
|
+
return this.client.call(
|
|
1804
1552
|
'patch',
|
|
1805
1553
|
uri,
|
|
1806
1554
|
apiHeaders,
|
|
@@ -1808,8 +1556,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1808
1556
|
);
|
|
1809
1557
|
}
|
|
1810
1558
|
/**
|
|
1811
|
-
* Create push target
|
|
1812
|
-
*
|
|
1813
1559
|
* Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.
|
|
1814
1560
|
*
|
|
1815
1561
|
* @param {string} targetId
|
|
@@ -1818,7 +1564,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1818
1564
|
* @throws {AppwriteException}
|
|
1819
1565
|
* @returns {Promise<Models.Target>}
|
|
1820
1566
|
*/
|
|
1821
|
-
|
|
1567
|
+
createPushTarget(targetId: string, identifier: string, providerId?: string): Promise<Models.Target> {
|
|
1822
1568
|
if (typeof targetId === 'undefined') {
|
|
1823
1569
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1824
1570
|
}
|
|
@@ -1842,10 +1588,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1842
1588
|
'content-type': 'application/json',
|
|
1843
1589
|
}
|
|
1844
1590
|
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
return await this.client.call(
|
|
1591
|
+
return this.client.call(
|
|
1849
1592
|
'post',
|
|
1850
1593
|
uri,
|
|
1851
1594
|
apiHeaders,
|
|
@@ -1853,8 +1596,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1853
1596
|
);
|
|
1854
1597
|
}
|
|
1855
1598
|
/**
|
|
1856
|
-
* Update push target
|
|
1857
|
-
*
|
|
1858
1599
|
* Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.
|
|
1859
1600
|
*
|
|
1860
1601
|
* @param {string} targetId
|
|
@@ -1862,7 +1603,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1862
1603
|
* @throws {AppwriteException}
|
|
1863
1604
|
* @returns {Promise<Models.Target>}
|
|
1864
1605
|
*/
|
|
1865
|
-
|
|
1606
|
+
updatePushTarget(targetId: string, identifier: string): Promise<Models.Target> {
|
|
1866
1607
|
if (typeof targetId === 'undefined') {
|
|
1867
1608
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1868
1609
|
}
|
|
@@ -1880,10 +1621,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1880
1621
|
'content-type': 'application/json',
|
|
1881
1622
|
}
|
|
1882
1623
|
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
return await this.client.call(
|
|
1624
|
+
return this.client.call(
|
|
1887
1625
|
'put',
|
|
1888
1626
|
uri,
|
|
1889
1627
|
apiHeaders,
|
|
@@ -1891,15 +1629,13 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1891
1629
|
);
|
|
1892
1630
|
}
|
|
1893
1631
|
/**
|
|
1894
|
-
* Delete push target
|
|
1895
|
-
*
|
|
1896
1632
|
* Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.
|
|
1897
1633
|
*
|
|
1898
1634
|
* @param {string} targetId
|
|
1899
1635
|
* @throws {AppwriteException}
|
|
1900
1636
|
* @returns {Promise<{}>}
|
|
1901
1637
|
*/
|
|
1902
|
-
|
|
1638
|
+
deletePushTarget(targetId: string): Promise<{}> {
|
|
1903
1639
|
if (typeof targetId === 'undefined') {
|
|
1904
1640
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1905
1641
|
}
|
|
@@ -1911,10 +1647,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1911
1647
|
'content-type': 'application/json',
|
|
1912
1648
|
}
|
|
1913
1649
|
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
return await this.client.call(
|
|
1650
|
+
return this.client.call(
|
|
1918
1651
|
'delete',
|
|
1919
1652
|
uri,
|
|
1920
1653
|
apiHeaders,
|
|
@@ -1922,8 +1655,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1922
1655
|
);
|
|
1923
1656
|
}
|
|
1924
1657
|
/**
|
|
1925
|
-
* Create email token (OTP)
|
|
1926
|
-
*
|
|
1927
1658
|
* Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
|
|
1928
1659
|
|
|
1929
1660
|
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
@@ -1934,7 +1665,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1934
1665
|
* @throws {AppwriteException}
|
|
1935
1666
|
* @returns {Promise<Models.Token>}
|
|
1936
1667
|
*/
|
|
1937
|
-
|
|
1668
|
+
createEmailToken(userId: string, email: string, phrase?: boolean): Promise<Models.Token> {
|
|
1938
1669
|
if (typeof userId === 'undefined') {
|
|
1939
1670
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1940
1671
|
}
|
|
@@ -1958,10 +1689,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1958
1689
|
'content-type': 'application/json',
|
|
1959
1690
|
}
|
|
1960
1691
|
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
return await this.client.call(
|
|
1692
|
+
return this.client.call(
|
|
1965
1693
|
'post',
|
|
1966
1694
|
uri,
|
|
1967
1695
|
apiHeaders,
|
|
@@ -1969,8 +1697,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1969
1697
|
);
|
|
1970
1698
|
}
|
|
1971
1699
|
/**
|
|
1972
|
-
* Create magic URL token
|
|
1973
|
-
*
|
|
1974
1700
|
* Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. 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 [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.
|
|
1975
1701
|
|
|
1976
1702
|
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
@@ -1983,7 +1709,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1983
1709
|
* @throws {AppwriteException}
|
|
1984
1710
|
* @returns {Promise<Models.Token>}
|
|
1985
1711
|
*/
|
|
1986
|
-
|
|
1712
|
+
createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise<Models.Token> {
|
|
1987
1713
|
if (typeof userId === 'undefined') {
|
|
1988
1714
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1989
1715
|
}
|
|
@@ -2010,10 +1736,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2010
1736
|
'content-type': 'application/json',
|
|
2011
1737
|
}
|
|
2012
1738
|
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
return await this.client.call(
|
|
1739
|
+
return this.client.call(
|
|
2017
1740
|
'post',
|
|
2018
1741
|
uri,
|
|
2019
1742
|
apiHeaders,
|
|
@@ -2021,8 +1744,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2021
1744
|
);
|
|
2022
1745
|
}
|
|
2023
1746
|
/**
|
|
2024
|
-
* Create OAuth2 token
|
|
2025
|
-
*
|
|
2026
1747
|
* 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.
|
|
2027
1748
|
|
|
2028
1749
|
If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint.
|
|
@@ -2034,9 +1755,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2034
1755
|
* @param {string} failure
|
|
2035
1756
|
* @param {string[]} scopes
|
|
2036
1757
|
* @throws {AppwriteException}
|
|
2037
|
-
* @returns {
|
|
1758
|
+
* @returns {void | string}
|
|
2038
1759
|
*/
|
|
2039
|
-
|
|
1760
|
+
createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | string {
|
|
2040
1761
|
if (typeof provider === 'undefined') {
|
|
2041
1762
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
2042
1763
|
}
|
|
@@ -2062,7 +1783,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2062
1783
|
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2063
1784
|
uri.searchParams.append(key, value);
|
|
2064
1785
|
}
|
|
2065
|
-
|
|
1786
|
+
|
|
2066
1787
|
if (typeof window !== 'undefined' && window?.location) {
|
|
2067
1788
|
window.location.href = uri.toString();
|
|
2068
1789
|
return;
|
|
@@ -2071,8 +1792,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2071
1792
|
}
|
|
2072
1793
|
}
|
|
2073
1794
|
/**
|
|
2074
|
-
* Create phone token
|
|
2075
|
-
*
|
|
2076
1795
|
* Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.
|
|
2077
1796
|
|
|
2078
1797
|
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
@@ -2082,7 +1801,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2082
1801
|
* @throws {AppwriteException}
|
|
2083
1802
|
* @returns {Promise<Models.Token>}
|
|
2084
1803
|
*/
|
|
2085
|
-
|
|
1804
|
+
createPhoneToken(userId: string, phone: string): Promise<Models.Token> {
|
|
2086
1805
|
if (typeof userId === 'undefined') {
|
|
2087
1806
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
2088
1807
|
}
|
|
@@ -2103,10 +1822,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2103
1822
|
'content-type': 'application/json',
|
|
2104
1823
|
}
|
|
2105
1824
|
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
return await this.client.call(
|
|
1825
|
+
return this.client.call(
|
|
2110
1826
|
'post',
|
|
2111
1827
|
uri,
|
|
2112
1828
|
apiHeaders,
|
|
@@ -2114,8 +1830,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2114
1830
|
);
|
|
2115
1831
|
}
|
|
2116
1832
|
/**
|
|
2117
|
-
* Create email verification
|
|
2118
|
-
*
|
|
2119
1833
|
* 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](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.
|
|
2120
1834
|
|
|
2121
1835
|
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.
|
|
@@ -2125,7 +1839,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2125
1839
|
* @throws {AppwriteException}
|
|
2126
1840
|
* @returns {Promise<Models.Token>}
|
|
2127
1841
|
*/
|
|
2128
|
-
|
|
1842
|
+
createVerification(url: string): Promise<Models.Token> {
|
|
2129
1843
|
if (typeof url === 'undefined') {
|
|
2130
1844
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
2131
1845
|
}
|
|
@@ -2140,10 +1854,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2140
1854
|
'content-type': 'application/json',
|
|
2141
1855
|
}
|
|
2142
1856
|
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
return await this.client.call(
|
|
1857
|
+
return this.client.call(
|
|
2147
1858
|
'post',
|
|
2148
1859
|
uri,
|
|
2149
1860
|
apiHeaders,
|
|
@@ -2151,8 +1862,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2151
1862
|
);
|
|
2152
1863
|
}
|
|
2153
1864
|
/**
|
|
2154
|
-
* Create email verification (confirmation)
|
|
2155
|
-
*
|
|
2156
1865
|
* Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
|
|
2157
1866
|
*
|
|
2158
1867
|
* @param {string} userId
|
|
@@ -2160,7 +1869,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2160
1869
|
* @throws {AppwriteException}
|
|
2161
1870
|
* @returns {Promise<Models.Token>}
|
|
2162
1871
|
*/
|
|
2163
|
-
|
|
1872
|
+
updateVerification(userId: string, secret: string): Promise<Models.Token> {
|
|
2164
1873
|
if (typeof userId === 'undefined') {
|
|
2165
1874
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
2166
1875
|
}
|
|
@@ -2181,10 +1890,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2181
1890
|
'content-type': 'application/json',
|
|
2182
1891
|
}
|
|
2183
1892
|
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
return await this.client.call(
|
|
1893
|
+
return this.client.call(
|
|
2188
1894
|
'put',
|
|
2189
1895
|
uri,
|
|
2190
1896
|
apiHeaders,
|
|
@@ -2192,14 +1898,12 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2192
1898
|
);
|
|
2193
1899
|
}
|
|
2194
1900
|
/**
|
|
2195
|
-
* Create phone verification
|
|
2196
|
-
*
|
|
2197
1901
|
* Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.
|
|
2198
1902
|
*
|
|
2199
1903
|
* @throws {AppwriteException}
|
|
2200
1904
|
* @returns {Promise<Models.Token>}
|
|
2201
1905
|
*/
|
|
2202
|
-
|
|
1906
|
+
createPhoneVerification(): Promise<Models.Token> {
|
|
2203
1907
|
const apiPath = '/account/verification/phone';
|
|
2204
1908
|
const payload: Payload = {};
|
|
2205
1909
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -2208,10 +1912,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2208
1912
|
'content-type': 'application/json',
|
|
2209
1913
|
}
|
|
2210
1914
|
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
return await this.client.call(
|
|
1915
|
+
return this.client.call(
|
|
2215
1916
|
'post',
|
|
2216
1917
|
uri,
|
|
2217
1918
|
apiHeaders,
|
|
@@ -2219,8 +1920,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2219
1920
|
);
|
|
2220
1921
|
}
|
|
2221
1922
|
/**
|
|
2222
|
-
* Update phone verification (confirmation)
|
|
2223
|
-
*
|
|
2224
1923
|
* 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.
|
|
2225
1924
|
*
|
|
2226
1925
|
* @param {string} userId
|
|
@@ -2228,7 +1927,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2228
1927
|
* @throws {AppwriteException}
|
|
2229
1928
|
* @returns {Promise<Models.Token>}
|
|
2230
1929
|
*/
|
|
2231
|
-
|
|
1930
|
+
updatePhoneVerification(userId: string, secret: string): Promise<Models.Token> {
|
|
2232
1931
|
if (typeof userId === 'undefined') {
|
|
2233
1932
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
2234
1933
|
}
|
|
@@ -2249,10 +1948,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2249
1948
|
'content-type': 'application/json',
|
|
2250
1949
|
}
|
|
2251
1950
|
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
return await this.client.call(
|
|
1951
|
+
return this.client.call(
|
|
2256
1952
|
'put',
|
|
2257
1953
|
uri,
|
|
2258
1954
|
apiHeaders,
|