@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/users.ts
CHANGED
|
@@ -14,8 +14,6 @@ export class Users {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* List users
|
|
18
|
-
*
|
|
19
17
|
* Get a list of all the project's users. You can use the query params to filter your results.
|
|
20
18
|
*
|
|
21
19
|
* @param {string[]} queries
|
|
@@ -23,7 +21,7 @@ export class Users {
|
|
|
23
21
|
* @throws {AppwriteException}
|
|
24
22
|
* @returns {Promise<Models.UserList<Preferences>>}
|
|
25
23
|
*/
|
|
26
|
-
|
|
24
|
+
list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences>> {
|
|
27
25
|
const apiPath = '/users';
|
|
28
26
|
const payload: Payload = {};
|
|
29
27
|
if (typeof queries !== 'undefined') {
|
|
@@ -38,10 +36,7 @@ export class Users {
|
|
|
38
36
|
'content-type': 'application/json',
|
|
39
37
|
}
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return await this.client.call(
|
|
39
|
+
return this.client.call(
|
|
45
40
|
'get',
|
|
46
41
|
uri,
|
|
47
42
|
apiHeaders,
|
|
@@ -49,8 +44,6 @@ export class Users {
|
|
|
49
44
|
);
|
|
50
45
|
}
|
|
51
46
|
/**
|
|
52
|
-
* Create user
|
|
53
|
-
*
|
|
54
47
|
* Create a new user.
|
|
55
48
|
*
|
|
56
49
|
* @param {string} userId
|
|
@@ -61,7 +54,7 @@ export class Users {
|
|
|
61
54
|
* @throws {AppwriteException}
|
|
62
55
|
* @returns {Promise<Models.User<Preferences>>}
|
|
63
56
|
*/
|
|
64
|
-
|
|
57
|
+
create<Preferences extends Models.Preferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>> {
|
|
65
58
|
if (typeof userId === 'undefined') {
|
|
66
59
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
67
60
|
}
|
|
@@ -88,10 +81,7 @@ export class Users {
|
|
|
88
81
|
'content-type': 'application/json',
|
|
89
82
|
}
|
|
90
83
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return await this.client.call(
|
|
84
|
+
return this.client.call(
|
|
95
85
|
'post',
|
|
96
86
|
uri,
|
|
97
87
|
apiHeaders,
|
|
@@ -99,8 +89,6 @@ export class Users {
|
|
|
99
89
|
);
|
|
100
90
|
}
|
|
101
91
|
/**
|
|
102
|
-
* Create user with Argon2 password
|
|
103
|
-
*
|
|
104
92
|
* Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
105
93
|
*
|
|
106
94
|
* @param {string} userId
|
|
@@ -110,7 +98,7 @@ export class Users {
|
|
|
110
98
|
* @throws {AppwriteException}
|
|
111
99
|
* @returns {Promise<Models.User<Preferences>>}
|
|
112
100
|
*/
|
|
113
|
-
|
|
101
|
+
createArgon2User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
|
|
114
102
|
if (typeof userId === 'undefined') {
|
|
115
103
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
116
104
|
}
|
|
@@ -140,10 +128,7 @@ export class Users {
|
|
|
140
128
|
'content-type': 'application/json',
|
|
141
129
|
}
|
|
142
130
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return await this.client.call(
|
|
131
|
+
return this.client.call(
|
|
147
132
|
'post',
|
|
148
133
|
uri,
|
|
149
134
|
apiHeaders,
|
|
@@ -151,8 +136,6 @@ export class Users {
|
|
|
151
136
|
);
|
|
152
137
|
}
|
|
153
138
|
/**
|
|
154
|
-
* Create user with bcrypt password
|
|
155
|
-
*
|
|
156
139
|
* Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
157
140
|
*
|
|
158
141
|
* @param {string} userId
|
|
@@ -162,7 +145,7 @@ export class Users {
|
|
|
162
145
|
* @throws {AppwriteException}
|
|
163
146
|
* @returns {Promise<Models.User<Preferences>>}
|
|
164
147
|
*/
|
|
165
|
-
|
|
148
|
+
createBcryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
|
|
166
149
|
if (typeof userId === 'undefined') {
|
|
167
150
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
168
151
|
}
|
|
@@ -192,10 +175,7 @@ export class Users {
|
|
|
192
175
|
'content-type': 'application/json',
|
|
193
176
|
}
|
|
194
177
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return await this.client.call(
|
|
178
|
+
return this.client.call(
|
|
199
179
|
'post',
|
|
200
180
|
uri,
|
|
201
181
|
apiHeaders,
|
|
@@ -203,8 +183,6 @@ export class Users {
|
|
|
203
183
|
);
|
|
204
184
|
}
|
|
205
185
|
/**
|
|
206
|
-
* List identities
|
|
207
|
-
*
|
|
208
186
|
* Get identities for all users.
|
|
209
187
|
*
|
|
210
188
|
* @param {string[]} queries
|
|
@@ -212,7 +190,7 @@ export class Users {
|
|
|
212
190
|
* @throws {AppwriteException}
|
|
213
191
|
* @returns {Promise<Models.IdentityList>}
|
|
214
192
|
*/
|
|
215
|
-
|
|
193
|
+
listIdentities(queries?: string[], search?: string): Promise<Models.IdentityList> {
|
|
216
194
|
const apiPath = '/users/identities';
|
|
217
195
|
const payload: Payload = {};
|
|
218
196
|
if (typeof queries !== 'undefined') {
|
|
@@ -227,10 +205,7 @@ export class Users {
|
|
|
227
205
|
'content-type': 'application/json',
|
|
228
206
|
}
|
|
229
207
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return await this.client.call(
|
|
208
|
+
return this.client.call(
|
|
234
209
|
'get',
|
|
235
210
|
uri,
|
|
236
211
|
apiHeaders,
|
|
@@ -238,15 +213,13 @@ export class Users {
|
|
|
238
213
|
);
|
|
239
214
|
}
|
|
240
215
|
/**
|
|
241
|
-
* Delete identity
|
|
242
|
-
*
|
|
243
216
|
* Delete an identity by its unique ID.
|
|
244
217
|
*
|
|
245
218
|
* @param {string} identityId
|
|
246
219
|
* @throws {AppwriteException}
|
|
247
220
|
* @returns {Promise<{}>}
|
|
248
221
|
*/
|
|
249
|
-
|
|
222
|
+
deleteIdentity(identityId: string): Promise<{}> {
|
|
250
223
|
if (typeof identityId === 'undefined') {
|
|
251
224
|
throw new AppwriteException('Missing required parameter: "identityId"');
|
|
252
225
|
}
|
|
@@ -258,10 +231,7 @@ export class Users {
|
|
|
258
231
|
'content-type': 'application/json',
|
|
259
232
|
}
|
|
260
233
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return await this.client.call(
|
|
234
|
+
return this.client.call(
|
|
265
235
|
'delete',
|
|
266
236
|
uri,
|
|
267
237
|
apiHeaders,
|
|
@@ -269,8 +239,6 @@ export class Users {
|
|
|
269
239
|
);
|
|
270
240
|
}
|
|
271
241
|
/**
|
|
272
|
-
* Create user with MD5 password
|
|
273
|
-
*
|
|
274
242
|
* Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
275
243
|
*
|
|
276
244
|
* @param {string} userId
|
|
@@ -280,7 +248,7 @@ export class Users {
|
|
|
280
248
|
* @throws {AppwriteException}
|
|
281
249
|
* @returns {Promise<Models.User<Preferences>>}
|
|
282
250
|
*/
|
|
283
|
-
|
|
251
|
+
createMD5User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
|
|
284
252
|
if (typeof userId === 'undefined') {
|
|
285
253
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
286
254
|
}
|
|
@@ -310,10 +278,7 @@ export class Users {
|
|
|
310
278
|
'content-type': 'application/json',
|
|
311
279
|
}
|
|
312
280
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
return await this.client.call(
|
|
281
|
+
return this.client.call(
|
|
317
282
|
'post',
|
|
318
283
|
uri,
|
|
319
284
|
apiHeaders,
|
|
@@ -321,8 +286,6 @@ export class Users {
|
|
|
321
286
|
);
|
|
322
287
|
}
|
|
323
288
|
/**
|
|
324
|
-
* Create user with PHPass password
|
|
325
|
-
*
|
|
326
289
|
* Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
327
290
|
*
|
|
328
291
|
* @param {string} userId
|
|
@@ -332,7 +295,7 @@ export class Users {
|
|
|
332
295
|
* @throws {AppwriteException}
|
|
333
296
|
* @returns {Promise<Models.User<Preferences>>}
|
|
334
297
|
*/
|
|
335
|
-
|
|
298
|
+
createPHPassUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
|
|
336
299
|
if (typeof userId === 'undefined') {
|
|
337
300
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
338
301
|
}
|
|
@@ -362,10 +325,7 @@ export class Users {
|
|
|
362
325
|
'content-type': 'application/json',
|
|
363
326
|
}
|
|
364
327
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
return await this.client.call(
|
|
328
|
+
return this.client.call(
|
|
369
329
|
'post',
|
|
370
330
|
uri,
|
|
371
331
|
apiHeaders,
|
|
@@ -373,8 +333,6 @@ export class Users {
|
|
|
373
333
|
);
|
|
374
334
|
}
|
|
375
335
|
/**
|
|
376
|
-
* Create user with Scrypt password
|
|
377
|
-
*
|
|
378
336
|
* Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
379
337
|
*
|
|
380
338
|
* @param {string} userId
|
|
@@ -389,7 +347,7 @@ export class Users {
|
|
|
389
347
|
* @throws {AppwriteException}
|
|
390
348
|
* @returns {Promise<Models.User<Preferences>>}
|
|
391
349
|
*/
|
|
392
|
-
|
|
350
|
+
createScryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences>> {
|
|
393
351
|
if (typeof userId === 'undefined') {
|
|
394
352
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
395
353
|
}
|
|
@@ -449,10 +407,7 @@ export class Users {
|
|
|
449
407
|
'content-type': 'application/json',
|
|
450
408
|
}
|
|
451
409
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
return await this.client.call(
|
|
410
|
+
return this.client.call(
|
|
456
411
|
'post',
|
|
457
412
|
uri,
|
|
458
413
|
apiHeaders,
|
|
@@ -460,8 +415,6 @@ export class Users {
|
|
|
460
415
|
);
|
|
461
416
|
}
|
|
462
417
|
/**
|
|
463
|
-
* Create user with Scrypt modified password
|
|
464
|
-
*
|
|
465
418
|
* Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
466
419
|
*
|
|
467
420
|
* @param {string} userId
|
|
@@ -474,7 +427,7 @@ export class Users {
|
|
|
474
427
|
* @throws {AppwriteException}
|
|
475
428
|
* @returns {Promise<Models.User<Preferences>>}
|
|
476
429
|
*/
|
|
477
|
-
|
|
430
|
+
createScryptModifiedUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences>> {
|
|
478
431
|
if (typeof userId === 'undefined') {
|
|
479
432
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
480
433
|
}
|
|
@@ -522,10 +475,7 @@ export class Users {
|
|
|
522
475
|
'content-type': 'application/json',
|
|
523
476
|
}
|
|
524
477
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
return await this.client.call(
|
|
478
|
+
return this.client.call(
|
|
529
479
|
'post',
|
|
530
480
|
uri,
|
|
531
481
|
apiHeaders,
|
|
@@ -533,8 +483,6 @@ export class Users {
|
|
|
533
483
|
);
|
|
534
484
|
}
|
|
535
485
|
/**
|
|
536
|
-
* Create user with SHA password
|
|
537
|
-
*
|
|
538
486
|
* Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
539
487
|
*
|
|
540
488
|
* @param {string} userId
|
|
@@ -545,7 +493,7 @@ export class Users {
|
|
|
545
493
|
* @throws {AppwriteException}
|
|
546
494
|
* @returns {Promise<Models.User<Preferences>>}
|
|
547
495
|
*/
|
|
548
|
-
|
|
496
|
+
createSHAUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise<Models.User<Preferences>> {
|
|
549
497
|
if (typeof userId === 'undefined') {
|
|
550
498
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
551
499
|
}
|
|
@@ -578,10 +526,7 @@ export class Users {
|
|
|
578
526
|
'content-type': 'application/json',
|
|
579
527
|
}
|
|
580
528
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
return await this.client.call(
|
|
529
|
+
return this.client.call(
|
|
585
530
|
'post',
|
|
586
531
|
uri,
|
|
587
532
|
apiHeaders,
|
|
@@ -589,8 +534,6 @@ export class Users {
|
|
|
589
534
|
);
|
|
590
535
|
}
|
|
591
536
|
/**
|
|
592
|
-
* Get users usage stats
|
|
593
|
-
*
|
|
594
537
|
* Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
|
|
595
538
|
|
|
596
539
|
*
|
|
@@ -598,7 +541,7 @@ export class Users {
|
|
|
598
541
|
* @throws {AppwriteException}
|
|
599
542
|
* @returns {Promise<Models.UsageUsers>}
|
|
600
543
|
*/
|
|
601
|
-
|
|
544
|
+
getUsage(range?: UserUsageRange): Promise<Models.UsageUsers> {
|
|
602
545
|
const apiPath = '/users/usage';
|
|
603
546
|
const payload: Payload = {};
|
|
604
547
|
if (typeof range !== 'undefined') {
|
|
@@ -610,10 +553,7 @@ export class Users {
|
|
|
610
553
|
'content-type': 'application/json',
|
|
611
554
|
}
|
|
612
555
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
return await this.client.call(
|
|
556
|
+
return this.client.call(
|
|
617
557
|
'get',
|
|
618
558
|
uri,
|
|
619
559
|
apiHeaders,
|
|
@@ -621,15 +561,13 @@ export class Users {
|
|
|
621
561
|
);
|
|
622
562
|
}
|
|
623
563
|
/**
|
|
624
|
-
* Get user
|
|
625
|
-
*
|
|
626
564
|
* Get a user by its unique ID.
|
|
627
565
|
*
|
|
628
566
|
* @param {string} userId
|
|
629
567
|
* @throws {AppwriteException}
|
|
630
568
|
* @returns {Promise<Models.User<Preferences>>}
|
|
631
569
|
*/
|
|
632
|
-
|
|
570
|
+
get<Preferences extends Models.Preferences>(userId: string): Promise<Models.User<Preferences>> {
|
|
633
571
|
if (typeof userId === 'undefined') {
|
|
634
572
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
635
573
|
}
|
|
@@ -641,10 +579,7 @@ export class Users {
|
|
|
641
579
|
'content-type': 'application/json',
|
|
642
580
|
}
|
|
643
581
|
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
return await this.client.call(
|
|
582
|
+
return this.client.call(
|
|
648
583
|
'get',
|
|
649
584
|
uri,
|
|
650
585
|
apiHeaders,
|
|
@@ -652,15 +587,13 @@ export class Users {
|
|
|
652
587
|
);
|
|
653
588
|
}
|
|
654
589
|
/**
|
|
655
|
-
* Delete user
|
|
656
|
-
*
|
|
657
590
|
* Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead.
|
|
658
591
|
*
|
|
659
592
|
* @param {string} userId
|
|
660
593
|
* @throws {AppwriteException}
|
|
661
594
|
* @returns {Promise<{}>}
|
|
662
595
|
*/
|
|
663
|
-
|
|
596
|
+
delete(userId: string): Promise<{}> {
|
|
664
597
|
if (typeof userId === 'undefined') {
|
|
665
598
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
666
599
|
}
|
|
@@ -672,10 +605,7 @@ export class Users {
|
|
|
672
605
|
'content-type': 'application/json',
|
|
673
606
|
}
|
|
674
607
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
return await this.client.call(
|
|
608
|
+
return this.client.call(
|
|
679
609
|
'delete',
|
|
680
610
|
uri,
|
|
681
611
|
apiHeaders,
|
|
@@ -683,8 +613,6 @@ export class Users {
|
|
|
683
613
|
);
|
|
684
614
|
}
|
|
685
615
|
/**
|
|
686
|
-
* Update email
|
|
687
|
-
*
|
|
688
616
|
* Update the user email by its unique ID.
|
|
689
617
|
*
|
|
690
618
|
* @param {string} userId
|
|
@@ -692,7 +620,7 @@ export class Users {
|
|
|
692
620
|
* @throws {AppwriteException}
|
|
693
621
|
* @returns {Promise<Models.User<Preferences>>}
|
|
694
622
|
*/
|
|
695
|
-
|
|
623
|
+
updateEmail<Preferences extends Models.Preferences>(userId: string, email: string): Promise<Models.User<Preferences>> {
|
|
696
624
|
if (typeof userId === 'undefined') {
|
|
697
625
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
698
626
|
}
|
|
@@ -710,10 +638,7 @@ export class Users {
|
|
|
710
638
|
'content-type': 'application/json',
|
|
711
639
|
}
|
|
712
640
|
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
return await this.client.call(
|
|
641
|
+
return this.client.call(
|
|
717
642
|
'patch',
|
|
718
643
|
uri,
|
|
719
644
|
apiHeaders,
|
|
@@ -721,8 +646,6 @@ export class Users {
|
|
|
721
646
|
);
|
|
722
647
|
}
|
|
723
648
|
/**
|
|
724
|
-
* Create user JWT
|
|
725
|
-
*
|
|
726
649
|
* Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
|
|
727
650
|
*
|
|
728
651
|
* @param {string} userId
|
|
@@ -731,7 +654,7 @@ export class Users {
|
|
|
731
654
|
* @throws {AppwriteException}
|
|
732
655
|
* @returns {Promise<Models.Jwt>}
|
|
733
656
|
*/
|
|
734
|
-
|
|
657
|
+
createJWT(userId: string, sessionId?: string, duration?: number): Promise<Models.Jwt> {
|
|
735
658
|
if (typeof userId === 'undefined') {
|
|
736
659
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
737
660
|
}
|
|
@@ -749,10 +672,7 @@ export class Users {
|
|
|
749
672
|
'content-type': 'application/json',
|
|
750
673
|
}
|
|
751
674
|
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
return await this.client.call(
|
|
675
|
+
return this.client.call(
|
|
756
676
|
'post',
|
|
757
677
|
uri,
|
|
758
678
|
apiHeaders,
|
|
@@ -760,8 +680,6 @@ export class Users {
|
|
|
760
680
|
);
|
|
761
681
|
}
|
|
762
682
|
/**
|
|
763
|
-
* Update user labels
|
|
764
|
-
*
|
|
765
683
|
* Update the user labels by its unique ID.
|
|
766
684
|
|
|
767
685
|
Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
|
|
@@ -771,7 +689,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
771
689
|
* @throws {AppwriteException}
|
|
772
690
|
* @returns {Promise<Models.User<Preferences>>}
|
|
773
691
|
*/
|
|
774
|
-
|
|
692
|
+
updateLabels<Preferences extends Models.Preferences>(userId: string, labels: string[]): Promise<Models.User<Preferences>> {
|
|
775
693
|
if (typeof userId === 'undefined') {
|
|
776
694
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
777
695
|
}
|
|
@@ -789,10 +707,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
789
707
|
'content-type': 'application/json',
|
|
790
708
|
}
|
|
791
709
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
return await this.client.call(
|
|
710
|
+
return this.client.call(
|
|
796
711
|
'put',
|
|
797
712
|
uri,
|
|
798
713
|
apiHeaders,
|
|
@@ -800,8 +715,6 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
800
715
|
);
|
|
801
716
|
}
|
|
802
717
|
/**
|
|
803
|
-
* List user logs
|
|
804
|
-
*
|
|
805
718
|
* Get the user activity logs list by its unique ID.
|
|
806
719
|
*
|
|
807
720
|
* @param {string} userId
|
|
@@ -809,7 +722,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
809
722
|
* @throws {AppwriteException}
|
|
810
723
|
* @returns {Promise<Models.LogList>}
|
|
811
724
|
*/
|
|
812
|
-
|
|
725
|
+
listLogs(userId: string, queries?: string[]): Promise<Models.LogList> {
|
|
813
726
|
if (typeof userId === 'undefined') {
|
|
814
727
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
815
728
|
}
|
|
@@ -824,10 +737,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
824
737
|
'content-type': 'application/json',
|
|
825
738
|
}
|
|
826
739
|
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
return await this.client.call(
|
|
740
|
+
return this.client.call(
|
|
831
741
|
'get',
|
|
832
742
|
uri,
|
|
833
743
|
apiHeaders,
|
|
@@ -835,15 +745,13 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
835
745
|
);
|
|
836
746
|
}
|
|
837
747
|
/**
|
|
838
|
-
* List user memberships
|
|
839
|
-
*
|
|
840
748
|
* Get the user membership list by its unique ID.
|
|
841
749
|
*
|
|
842
750
|
* @param {string} userId
|
|
843
751
|
* @throws {AppwriteException}
|
|
844
752
|
* @returns {Promise<Models.MembershipList>}
|
|
845
753
|
*/
|
|
846
|
-
|
|
754
|
+
listMemberships(userId: string): Promise<Models.MembershipList> {
|
|
847
755
|
if (typeof userId === 'undefined') {
|
|
848
756
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
849
757
|
}
|
|
@@ -855,10 +763,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
855
763
|
'content-type': 'application/json',
|
|
856
764
|
}
|
|
857
765
|
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
return await this.client.call(
|
|
766
|
+
return this.client.call(
|
|
862
767
|
'get',
|
|
863
768
|
uri,
|
|
864
769
|
apiHeaders,
|
|
@@ -866,8 +771,6 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
866
771
|
);
|
|
867
772
|
}
|
|
868
773
|
/**
|
|
869
|
-
* Update MFA
|
|
870
|
-
*
|
|
871
774
|
* Enable or disable MFA on a user account.
|
|
872
775
|
*
|
|
873
776
|
* @param {string} userId
|
|
@@ -875,7 +778,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
875
778
|
* @throws {AppwriteException}
|
|
876
779
|
* @returns {Promise<Models.User<Preferences>>}
|
|
877
780
|
*/
|
|
878
|
-
|
|
781
|
+
updateMfa<Preferences extends Models.Preferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>> {
|
|
879
782
|
if (typeof userId === 'undefined') {
|
|
880
783
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
881
784
|
}
|
|
@@ -893,10 +796,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
893
796
|
'content-type': 'application/json',
|
|
894
797
|
}
|
|
895
798
|
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
return await this.client.call(
|
|
799
|
+
return this.client.call(
|
|
900
800
|
'patch',
|
|
901
801
|
uri,
|
|
902
802
|
apiHeaders,
|
|
@@ -904,8 +804,6 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
904
804
|
);
|
|
905
805
|
}
|
|
906
806
|
/**
|
|
907
|
-
* Delete authenticator
|
|
908
|
-
*
|
|
909
807
|
* Delete an authenticator app.
|
|
910
808
|
*
|
|
911
809
|
* @param {string} userId
|
|
@@ -913,7 +811,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
913
811
|
* @throws {AppwriteException}
|
|
914
812
|
* @returns {Promise<{}>}
|
|
915
813
|
*/
|
|
916
|
-
|
|
814
|
+
deleteMfaAuthenticator(userId: string, type: AuthenticatorType): Promise<{}> {
|
|
917
815
|
if (typeof userId === 'undefined') {
|
|
918
816
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
919
817
|
}
|
|
@@ -928,10 +826,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
928
826
|
'content-type': 'application/json',
|
|
929
827
|
}
|
|
930
828
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
return await this.client.call(
|
|
829
|
+
return this.client.call(
|
|
935
830
|
'delete',
|
|
936
831
|
uri,
|
|
937
832
|
apiHeaders,
|
|
@@ -939,15 +834,13 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
939
834
|
);
|
|
940
835
|
}
|
|
941
836
|
/**
|
|
942
|
-
* List factors
|
|
943
|
-
*
|
|
944
837
|
* List the factors available on the account to be used as a MFA challange.
|
|
945
838
|
*
|
|
946
839
|
* @param {string} userId
|
|
947
840
|
* @throws {AppwriteException}
|
|
948
841
|
* @returns {Promise<Models.MfaFactors>}
|
|
949
842
|
*/
|
|
950
|
-
|
|
843
|
+
listMfaFactors(userId: string): Promise<Models.MfaFactors> {
|
|
951
844
|
if (typeof userId === 'undefined') {
|
|
952
845
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
953
846
|
}
|
|
@@ -959,10 +852,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
959
852
|
'content-type': 'application/json',
|
|
960
853
|
}
|
|
961
854
|
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
return await this.client.call(
|
|
855
|
+
return this.client.call(
|
|
966
856
|
'get',
|
|
967
857
|
uri,
|
|
968
858
|
apiHeaders,
|
|
@@ -970,15 +860,13 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
970
860
|
);
|
|
971
861
|
}
|
|
972
862
|
/**
|
|
973
|
-
* Get MFA recovery codes
|
|
974
|
-
*
|
|
975
863
|
* Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
976
864
|
*
|
|
977
865
|
* @param {string} userId
|
|
978
866
|
* @throws {AppwriteException}
|
|
979
867
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
980
868
|
*/
|
|
981
|
-
|
|
869
|
+
getMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> {
|
|
982
870
|
if (typeof userId === 'undefined') {
|
|
983
871
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
984
872
|
}
|
|
@@ -990,10 +878,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
990
878
|
'content-type': 'application/json',
|
|
991
879
|
}
|
|
992
880
|
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
return await this.client.call(
|
|
881
|
+
return this.client.call(
|
|
997
882
|
'get',
|
|
998
883
|
uri,
|
|
999
884
|
apiHeaders,
|
|
@@ -1001,15 +886,13 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1001
886
|
);
|
|
1002
887
|
}
|
|
1003
888
|
/**
|
|
1004
|
-
* Regenerate MFA recovery codes
|
|
1005
|
-
*
|
|
1006
889
|
* Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
1007
890
|
*
|
|
1008
891
|
* @param {string} userId
|
|
1009
892
|
* @throws {AppwriteException}
|
|
1010
893
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
1011
894
|
*/
|
|
1012
|
-
|
|
895
|
+
updateMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> {
|
|
1013
896
|
if (typeof userId === 'undefined') {
|
|
1014
897
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1015
898
|
}
|
|
@@ -1021,10 +904,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1021
904
|
'content-type': 'application/json',
|
|
1022
905
|
}
|
|
1023
906
|
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
return await this.client.call(
|
|
907
|
+
return this.client.call(
|
|
1028
908
|
'put',
|
|
1029
909
|
uri,
|
|
1030
910
|
apiHeaders,
|
|
@@ -1032,15 +912,13 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1032
912
|
);
|
|
1033
913
|
}
|
|
1034
914
|
/**
|
|
1035
|
-
* Create MFA recovery codes
|
|
1036
|
-
*
|
|
1037
915
|
* Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
|
|
1038
916
|
*
|
|
1039
917
|
* @param {string} userId
|
|
1040
918
|
* @throws {AppwriteException}
|
|
1041
919
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
1042
920
|
*/
|
|
1043
|
-
|
|
921
|
+
createMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> {
|
|
1044
922
|
if (typeof userId === 'undefined') {
|
|
1045
923
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1046
924
|
}
|
|
@@ -1052,10 +930,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1052
930
|
'content-type': 'application/json',
|
|
1053
931
|
}
|
|
1054
932
|
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
return await this.client.call(
|
|
933
|
+
return this.client.call(
|
|
1059
934
|
'patch',
|
|
1060
935
|
uri,
|
|
1061
936
|
apiHeaders,
|
|
@@ -1063,8 +938,6 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1063
938
|
);
|
|
1064
939
|
}
|
|
1065
940
|
/**
|
|
1066
|
-
* Update name
|
|
1067
|
-
*
|
|
1068
941
|
* Update the user name by its unique ID.
|
|
1069
942
|
*
|
|
1070
943
|
* @param {string} userId
|
|
@@ -1072,7 +945,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1072
945
|
* @throws {AppwriteException}
|
|
1073
946
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1074
947
|
*/
|
|
1075
|
-
|
|
948
|
+
updateName<Preferences extends Models.Preferences>(userId: string, name: string): Promise<Models.User<Preferences>> {
|
|
1076
949
|
if (typeof userId === 'undefined') {
|
|
1077
950
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1078
951
|
}
|
|
@@ -1090,10 +963,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1090
963
|
'content-type': 'application/json',
|
|
1091
964
|
}
|
|
1092
965
|
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
return await this.client.call(
|
|
966
|
+
return this.client.call(
|
|
1097
967
|
'patch',
|
|
1098
968
|
uri,
|
|
1099
969
|
apiHeaders,
|
|
@@ -1101,8 +971,6 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1101
971
|
);
|
|
1102
972
|
}
|
|
1103
973
|
/**
|
|
1104
|
-
* Update password
|
|
1105
|
-
*
|
|
1106
974
|
* Update the user password by its unique ID.
|
|
1107
975
|
*
|
|
1108
976
|
* @param {string} userId
|
|
@@ -1110,7 +978,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1110
978
|
* @throws {AppwriteException}
|
|
1111
979
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1112
980
|
*/
|
|
1113
|
-
|
|
981
|
+
updatePassword<Preferences extends Models.Preferences>(userId: string, password: string): Promise<Models.User<Preferences>> {
|
|
1114
982
|
if (typeof userId === 'undefined') {
|
|
1115
983
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1116
984
|
}
|
|
@@ -1128,10 +996,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1128
996
|
'content-type': 'application/json',
|
|
1129
997
|
}
|
|
1130
998
|
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
return await this.client.call(
|
|
999
|
+
return this.client.call(
|
|
1135
1000
|
'patch',
|
|
1136
1001
|
uri,
|
|
1137
1002
|
apiHeaders,
|
|
@@ -1139,8 +1004,6 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1139
1004
|
);
|
|
1140
1005
|
}
|
|
1141
1006
|
/**
|
|
1142
|
-
* Update phone
|
|
1143
|
-
*
|
|
1144
1007
|
* Update the user phone by its unique ID.
|
|
1145
1008
|
*
|
|
1146
1009
|
* @param {string} userId
|
|
@@ -1148,7 +1011,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1148
1011
|
* @throws {AppwriteException}
|
|
1149
1012
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1150
1013
|
*/
|
|
1151
|
-
|
|
1014
|
+
updatePhone<Preferences extends Models.Preferences>(userId: string, number: string): Promise<Models.User<Preferences>> {
|
|
1152
1015
|
if (typeof userId === 'undefined') {
|
|
1153
1016
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1154
1017
|
}
|
|
@@ -1166,10 +1029,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1166
1029
|
'content-type': 'application/json',
|
|
1167
1030
|
}
|
|
1168
1031
|
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
return await this.client.call(
|
|
1032
|
+
return this.client.call(
|
|
1173
1033
|
'patch',
|
|
1174
1034
|
uri,
|
|
1175
1035
|
apiHeaders,
|
|
@@ -1177,15 +1037,13 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1177
1037
|
);
|
|
1178
1038
|
}
|
|
1179
1039
|
/**
|
|
1180
|
-
* Get user preferences
|
|
1181
|
-
*
|
|
1182
1040
|
* Get the user preferences by its unique ID.
|
|
1183
1041
|
*
|
|
1184
1042
|
* @param {string} userId
|
|
1185
1043
|
* @throws {AppwriteException}
|
|
1186
1044
|
* @returns {Promise<Preferences>}
|
|
1187
1045
|
*/
|
|
1188
|
-
|
|
1046
|
+
getPrefs<Preferences extends Models.Preferences>(userId: string): Promise<Preferences> {
|
|
1189
1047
|
if (typeof userId === 'undefined') {
|
|
1190
1048
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1191
1049
|
}
|
|
@@ -1197,10 +1055,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1197
1055
|
'content-type': 'application/json',
|
|
1198
1056
|
}
|
|
1199
1057
|
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
return await this.client.call(
|
|
1058
|
+
return this.client.call(
|
|
1204
1059
|
'get',
|
|
1205
1060
|
uri,
|
|
1206
1061
|
apiHeaders,
|
|
@@ -1208,8 +1063,6 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1208
1063
|
);
|
|
1209
1064
|
}
|
|
1210
1065
|
/**
|
|
1211
|
-
* Update user preferences
|
|
1212
|
-
*
|
|
1213
1066
|
* Update the user preferences by its unique ID. 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.
|
|
1214
1067
|
*
|
|
1215
1068
|
* @param {string} userId
|
|
@@ -1217,7 +1070,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1217
1070
|
* @throws {AppwriteException}
|
|
1218
1071
|
* @returns {Promise<Preferences>}
|
|
1219
1072
|
*/
|
|
1220
|
-
|
|
1073
|
+
updatePrefs<Preferences extends Models.Preferences>(userId: string, prefs: object): Promise<Preferences> {
|
|
1221
1074
|
if (typeof userId === 'undefined') {
|
|
1222
1075
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1223
1076
|
}
|
|
@@ -1235,10 +1088,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1235
1088
|
'content-type': 'application/json',
|
|
1236
1089
|
}
|
|
1237
1090
|
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
return await this.client.call(
|
|
1091
|
+
return this.client.call(
|
|
1242
1092
|
'patch',
|
|
1243
1093
|
uri,
|
|
1244
1094
|
apiHeaders,
|
|
@@ -1246,15 +1096,13 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1246
1096
|
);
|
|
1247
1097
|
}
|
|
1248
1098
|
/**
|
|
1249
|
-
* List user sessions
|
|
1250
|
-
*
|
|
1251
1099
|
* Get the user sessions list by its unique ID.
|
|
1252
1100
|
*
|
|
1253
1101
|
* @param {string} userId
|
|
1254
1102
|
* @throws {AppwriteException}
|
|
1255
1103
|
* @returns {Promise<Models.SessionList>}
|
|
1256
1104
|
*/
|
|
1257
|
-
|
|
1105
|
+
listSessions(userId: string): Promise<Models.SessionList> {
|
|
1258
1106
|
if (typeof userId === 'undefined') {
|
|
1259
1107
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1260
1108
|
}
|
|
@@ -1266,10 +1114,7 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1266
1114
|
'content-type': 'application/json',
|
|
1267
1115
|
}
|
|
1268
1116
|
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
return await this.client.call(
|
|
1117
|
+
return this.client.call(
|
|
1273
1118
|
'get',
|
|
1274
1119
|
uri,
|
|
1275
1120
|
apiHeaders,
|
|
@@ -1277,8 +1122,6 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1277
1122
|
);
|
|
1278
1123
|
}
|
|
1279
1124
|
/**
|
|
1280
|
-
* Create session
|
|
1281
|
-
*
|
|
1282
1125
|
* Creates a session for a user. Returns an immediately usable session object.
|
|
1283
1126
|
|
|
1284
1127
|
If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.
|
|
@@ -1287,7 +1130,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1287
1130
|
* @throws {AppwriteException}
|
|
1288
1131
|
* @returns {Promise<Models.Session>}
|
|
1289
1132
|
*/
|
|
1290
|
-
|
|
1133
|
+
createSession(userId: string): Promise<Models.Session> {
|
|
1291
1134
|
if (typeof userId === 'undefined') {
|
|
1292
1135
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1293
1136
|
}
|
|
@@ -1299,10 +1142,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1299
1142
|
'content-type': 'application/json',
|
|
1300
1143
|
}
|
|
1301
1144
|
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
return await this.client.call(
|
|
1145
|
+
return this.client.call(
|
|
1306
1146
|
'post',
|
|
1307
1147
|
uri,
|
|
1308
1148
|
apiHeaders,
|
|
@@ -1310,15 +1150,13 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1310
1150
|
);
|
|
1311
1151
|
}
|
|
1312
1152
|
/**
|
|
1313
|
-
* Delete user sessions
|
|
1314
|
-
*
|
|
1315
1153
|
* Delete all user's sessions by using the user's unique ID.
|
|
1316
1154
|
*
|
|
1317
1155
|
* @param {string} userId
|
|
1318
1156
|
* @throws {AppwriteException}
|
|
1319
1157
|
* @returns {Promise<{}>}
|
|
1320
1158
|
*/
|
|
1321
|
-
|
|
1159
|
+
deleteSessions(userId: string): Promise<{}> {
|
|
1322
1160
|
if (typeof userId === 'undefined') {
|
|
1323
1161
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1324
1162
|
}
|
|
@@ -1330,10 +1168,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1330
1168
|
'content-type': 'application/json',
|
|
1331
1169
|
}
|
|
1332
1170
|
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
return await this.client.call(
|
|
1171
|
+
return this.client.call(
|
|
1337
1172
|
'delete',
|
|
1338
1173
|
uri,
|
|
1339
1174
|
apiHeaders,
|
|
@@ -1341,8 +1176,6 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1341
1176
|
);
|
|
1342
1177
|
}
|
|
1343
1178
|
/**
|
|
1344
|
-
* Delete user session
|
|
1345
|
-
*
|
|
1346
1179
|
* Delete a user sessions by its unique ID.
|
|
1347
1180
|
*
|
|
1348
1181
|
* @param {string} userId
|
|
@@ -1350,7 +1183,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1350
1183
|
* @throws {AppwriteException}
|
|
1351
1184
|
* @returns {Promise<{}>}
|
|
1352
1185
|
*/
|
|
1353
|
-
|
|
1186
|
+
deleteSession(userId: string, sessionId: string): Promise<{}> {
|
|
1354
1187
|
if (typeof userId === 'undefined') {
|
|
1355
1188
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1356
1189
|
}
|
|
@@ -1365,10 +1198,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1365
1198
|
'content-type': 'application/json',
|
|
1366
1199
|
}
|
|
1367
1200
|
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
return await this.client.call(
|
|
1201
|
+
return this.client.call(
|
|
1372
1202
|
'delete',
|
|
1373
1203
|
uri,
|
|
1374
1204
|
apiHeaders,
|
|
@@ -1376,8 +1206,6 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1376
1206
|
);
|
|
1377
1207
|
}
|
|
1378
1208
|
/**
|
|
1379
|
-
* Update user status
|
|
1380
|
-
*
|
|
1381
1209
|
* Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.
|
|
1382
1210
|
*
|
|
1383
1211
|
* @param {string} userId
|
|
@@ -1385,7 +1213,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1385
1213
|
* @throws {AppwriteException}
|
|
1386
1214
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1387
1215
|
*/
|
|
1388
|
-
|
|
1216
|
+
updateStatus<Preferences extends Models.Preferences>(userId: string, status: boolean): Promise<Models.User<Preferences>> {
|
|
1389
1217
|
if (typeof userId === 'undefined') {
|
|
1390
1218
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1391
1219
|
}
|
|
@@ -1403,10 +1231,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1403
1231
|
'content-type': 'application/json',
|
|
1404
1232
|
}
|
|
1405
1233
|
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
return await this.client.call(
|
|
1234
|
+
return this.client.call(
|
|
1410
1235
|
'patch',
|
|
1411
1236
|
uri,
|
|
1412
1237
|
apiHeaders,
|
|
@@ -1414,8 +1239,6 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1414
1239
|
);
|
|
1415
1240
|
}
|
|
1416
1241
|
/**
|
|
1417
|
-
* List user targets
|
|
1418
|
-
*
|
|
1419
1242
|
* List the messaging targets that are associated with a user.
|
|
1420
1243
|
*
|
|
1421
1244
|
* @param {string} userId
|
|
@@ -1423,7 +1246,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1423
1246
|
* @throws {AppwriteException}
|
|
1424
1247
|
* @returns {Promise<Models.TargetList>}
|
|
1425
1248
|
*/
|
|
1426
|
-
|
|
1249
|
+
listTargets(userId: string, queries?: string[]): Promise<Models.TargetList> {
|
|
1427
1250
|
if (typeof userId === 'undefined') {
|
|
1428
1251
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1429
1252
|
}
|
|
@@ -1438,10 +1261,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1438
1261
|
'content-type': 'application/json',
|
|
1439
1262
|
}
|
|
1440
1263
|
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
return await this.client.call(
|
|
1264
|
+
return this.client.call(
|
|
1445
1265
|
'get',
|
|
1446
1266
|
uri,
|
|
1447
1267
|
apiHeaders,
|
|
@@ -1449,8 +1269,6 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1449
1269
|
);
|
|
1450
1270
|
}
|
|
1451
1271
|
/**
|
|
1452
|
-
* Create user target
|
|
1453
|
-
*
|
|
1454
1272
|
* Create a messaging target.
|
|
1455
1273
|
*
|
|
1456
1274
|
* @param {string} userId
|
|
@@ -1462,7 +1280,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1462
1280
|
* @throws {AppwriteException}
|
|
1463
1281
|
* @returns {Promise<Models.Target>}
|
|
1464
1282
|
*/
|
|
1465
|
-
|
|
1283
|
+
createTarget(userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string): Promise<Models.Target> {
|
|
1466
1284
|
if (typeof userId === 'undefined') {
|
|
1467
1285
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1468
1286
|
}
|
|
@@ -1498,10 +1316,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1498
1316
|
'content-type': 'application/json',
|
|
1499
1317
|
}
|
|
1500
1318
|
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
return await this.client.call(
|
|
1319
|
+
return this.client.call(
|
|
1505
1320
|
'post',
|
|
1506
1321
|
uri,
|
|
1507
1322
|
apiHeaders,
|
|
@@ -1509,8 +1324,6 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1509
1324
|
);
|
|
1510
1325
|
}
|
|
1511
1326
|
/**
|
|
1512
|
-
* Get user target
|
|
1513
|
-
*
|
|
1514
1327
|
* Get a user's push notification target by ID.
|
|
1515
1328
|
*
|
|
1516
1329
|
* @param {string} userId
|
|
@@ -1518,7 +1331,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1518
1331
|
* @throws {AppwriteException}
|
|
1519
1332
|
* @returns {Promise<Models.Target>}
|
|
1520
1333
|
*/
|
|
1521
|
-
|
|
1334
|
+
getTarget(userId: string, targetId: string): Promise<Models.Target> {
|
|
1522
1335
|
if (typeof userId === 'undefined') {
|
|
1523
1336
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1524
1337
|
}
|
|
@@ -1533,10 +1346,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1533
1346
|
'content-type': 'application/json',
|
|
1534
1347
|
}
|
|
1535
1348
|
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
return await this.client.call(
|
|
1349
|
+
return this.client.call(
|
|
1540
1350
|
'get',
|
|
1541
1351
|
uri,
|
|
1542
1352
|
apiHeaders,
|
|
@@ -1544,8 +1354,6 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1544
1354
|
);
|
|
1545
1355
|
}
|
|
1546
1356
|
/**
|
|
1547
|
-
* Update user target
|
|
1548
|
-
*
|
|
1549
1357
|
* Update a messaging target.
|
|
1550
1358
|
*
|
|
1551
1359
|
* @param {string} userId
|
|
@@ -1556,7 +1364,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1556
1364
|
* @throws {AppwriteException}
|
|
1557
1365
|
* @returns {Promise<Models.Target>}
|
|
1558
1366
|
*/
|
|
1559
|
-
|
|
1367
|
+
updateTarget(userId: string, targetId: string, identifier?: string, providerId?: string, name?: string): Promise<Models.Target> {
|
|
1560
1368
|
if (typeof userId === 'undefined') {
|
|
1561
1369
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1562
1370
|
}
|
|
@@ -1580,10 +1388,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1580
1388
|
'content-type': 'application/json',
|
|
1581
1389
|
}
|
|
1582
1390
|
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
return await this.client.call(
|
|
1391
|
+
return this.client.call(
|
|
1587
1392
|
'patch',
|
|
1588
1393
|
uri,
|
|
1589
1394
|
apiHeaders,
|
|
@@ -1591,8 +1396,6 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1591
1396
|
);
|
|
1592
1397
|
}
|
|
1593
1398
|
/**
|
|
1594
|
-
* Delete user target
|
|
1595
|
-
*
|
|
1596
1399
|
* Delete a messaging target.
|
|
1597
1400
|
*
|
|
1598
1401
|
* @param {string} userId
|
|
@@ -1600,7 +1403,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1600
1403
|
* @throws {AppwriteException}
|
|
1601
1404
|
* @returns {Promise<{}>}
|
|
1602
1405
|
*/
|
|
1603
|
-
|
|
1406
|
+
deleteTarget(userId: string, targetId: string): Promise<{}> {
|
|
1604
1407
|
if (typeof userId === 'undefined') {
|
|
1605
1408
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1606
1409
|
}
|
|
@@ -1615,10 +1418,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1615
1418
|
'content-type': 'application/json',
|
|
1616
1419
|
}
|
|
1617
1420
|
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
return await this.client.call(
|
|
1421
|
+
return this.client.call(
|
|
1622
1422
|
'delete',
|
|
1623
1423
|
uri,
|
|
1624
1424
|
apiHeaders,
|
|
@@ -1626,8 +1426,6 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1626
1426
|
);
|
|
1627
1427
|
}
|
|
1628
1428
|
/**
|
|
1629
|
-
* Create token
|
|
1630
|
-
*
|
|
1631
1429
|
* Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process.
|
|
1632
1430
|
|
|
1633
1431
|
*
|
|
@@ -1637,7 +1435,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1637
1435
|
* @throws {AppwriteException}
|
|
1638
1436
|
* @returns {Promise<Models.Token>}
|
|
1639
1437
|
*/
|
|
1640
|
-
|
|
1438
|
+
createToken(userId: string, length?: number, expire?: number): Promise<Models.Token> {
|
|
1641
1439
|
if (typeof userId === 'undefined') {
|
|
1642
1440
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1643
1441
|
}
|
|
@@ -1655,10 +1453,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1655
1453
|
'content-type': 'application/json',
|
|
1656
1454
|
}
|
|
1657
1455
|
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
return await this.client.call(
|
|
1456
|
+
return this.client.call(
|
|
1662
1457
|
'post',
|
|
1663
1458
|
uri,
|
|
1664
1459
|
apiHeaders,
|
|
@@ -1666,8 +1461,6 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1666
1461
|
);
|
|
1667
1462
|
}
|
|
1668
1463
|
/**
|
|
1669
|
-
* Update email verification
|
|
1670
|
-
*
|
|
1671
1464
|
* Update the user email verification status by its unique ID.
|
|
1672
1465
|
*
|
|
1673
1466
|
* @param {string} userId
|
|
@@ -1675,7 +1468,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1675
1468
|
* @throws {AppwriteException}
|
|
1676
1469
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1677
1470
|
*/
|
|
1678
|
-
|
|
1471
|
+
updateEmailVerification<Preferences extends Models.Preferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>> {
|
|
1679
1472
|
if (typeof userId === 'undefined') {
|
|
1680
1473
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1681
1474
|
}
|
|
@@ -1693,10 +1486,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1693
1486
|
'content-type': 'application/json',
|
|
1694
1487
|
}
|
|
1695
1488
|
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
return await this.client.call(
|
|
1489
|
+
return this.client.call(
|
|
1700
1490
|
'patch',
|
|
1701
1491
|
uri,
|
|
1702
1492
|
apiHeaders,
|
|
@@ -1704,8 +1494,6 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1704
1494
|
);
|
|
1705
1495
|
}
|
|
1706
1496
|
/**
|
|
1707
|
-
* Update phone verification
|
|
1708
|
-
*
|
|
1709
1497
|
* Update the user phone verification status by its unique ID.
|
|
1710
1498
|
*
|
|
1711
1499
|
* @param {string} userId
|
|
@@ -1713,7 +1501,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1713
1501
|
* @throws {AppwriteException}
|
|
1714
1502
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1715
1503
|
*/
|
|
1716
|
-
|
|
1504
|
+
updatePhoneVerification<Preferences extends Models.Preferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences>> {
|
|
1717
1505
|
if (typeof userId === 'undefined') {
|
|
1718
1506
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1719
1507
|
}
|
|
@@ -1731,10 +1519,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1731
1519
|
'content-type': 'application/json',
|
|
1732
1520
|
}
|
|
1733
1521
|
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
return await this.client.call(
|
|
1522
|
+
return this.client.call(
|
|
1738
1523
|
'patch',
|
|
1739
1524
|
uri,
|
|
1740
1525
|
apiHeaders,
|