node-appwrite 15.0.0 → 15.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +7 -4
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +7 -4
- package/dist/client.mjs.map +1 -1
- package/dist/models.d.mts +2 -2
- package/dist/models.d.ts +2 -2
- package/dist/services/account.d.mts +0 -86
- package/dist/services/account.d.ts +0 -86
- package/dist/services/account.js +86 -172
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs +86 -172
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/avatars.d.mts +0 -14
- package/dist/services/avatars.d.ts +0 -14
- package/dist/services/avatars.js +14 -28
- package/dist/services/avatars.js.map +1 -1
- package/dist/services/avatars.mjs +14 -28
- package/dist/services/avatars.mjs.map +1 -1
- package/dist/services/databases.d.mts +0 -84
- package/dist/services/databases.d.ts +0 -84
- package/dist/services/databases.js +84 -168
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +84 -168
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +0 -48
- package/dist/services/functions.d.ts +0 -48
- package/dist/services/functions.js +48 -96
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +48 -96
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/graphql.d.mts +0 -4
- package/dist/services/graphql.d.ts +0 -4
- package/dist/services/graphql.js +4 -8
- package/dist/services/graphql.js.map +1 -1
- package/dist/services/graphql.mjs +4 -8
- package/dist/services/graphql.mjs.map +1 -1
- package/dist/services/health.d.mts +0 -46
- package/dist/services/health.d.ts +0 -46
- package/dist/services/health.js +46 -92
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +46 -92
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/locale.d.mts +0 -16
- package/dist/services/locale.d.ts +0 -16
- package/dist/services/locale.js +16 -32
- package/dist/services/locale.js.map +1 -1
- package/dist/services/locale.mjs +16 -32
- package/dist/services/locale.mjs.map +1 -1
- package/dist/services/messaging.d.mts +3 -95
- package/dist/services/messaging.d.ts +3 -95
- package/dist/services/messaging.js +95 -187
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs +95 -187
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/storage.d.mts +0 -26
- package/dist/services/storage.d.ts +0 -26
- package/dist/services/storage.js +26 -52
- package/dist/services/storage.js.map +1 -1
- package/dist/services/storage.mjs +26 -52
- package/dist/services/storage.mjs.map +1 -1
- package/dist/services/teams.d.mts +0 -26
- package/dist/services/teams.d.ts +0 -26
- package/dist/services/teams.js +26 -52
- package/dist/services/teams.js.map +1 -1
- package/dist/services/teams.mjs +26 -52
- package/dist/services/teams.mjs.map +1 -1
- package/dist/services/users.d.mts +0 -84
- package/dist/services/users.d.ts +0 -84
- package/dist/services/users.js +84 -168
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +84 -168
- package/dist/services/users.mjs.map +1 -1
- package/package.json +1 -1
package/dist/services/users.mjs
CHANGED
|
@@ -6,8 +6,6 @@ var Users = class {
|
|
|
6
6
|
this.client = client;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* List users
|
|
10
|
-
*
|
|
11
9
|
* Get a list of all the project's users. You can use the query params to filter your results.
|
|
12
10
|
*
|
|
13
11
|
* @param {string[]} queries
|
|
@@ -15,7 +13,7 @@ var Users = class {
|
|
|
15
13
|
* @throws {AppwriteException}
|
|
16
14
|
* @returns {Promise<Models.UserList<Preferences>>}
|
|
17
15
|
*/
|
|
18
|
-
|
|
16
|
+
list(queries, search) {
|
|
19
17
|
const apiPath = "/users";
|
|
20
18
|
const payload = {};
|
|
21
19
|
if (typeof queries !== "undefined") {
|
|
@@ -28,7 +26,7 @@ var Users = class {
|
|
|
28
26
|
const apiHeaders = {
|
|
29
27
|
"content-type": "application/json"
|
|
30
28
|
};
|
|
31
|
-
return
|
|
29
|
+
return this.client.call(
|
|
32
30
|
"get",
|
|
33
31
|
uri,
|
|
34
32
|
apiHeaders,
|
|
@@ -36,8 +34,6 @@ var Users = class {
|
|
|
36
34
|
);
|
|
37
35
|
}
|
|
38
36
|
/**
|
|
39
|
-
* Create user
|
|
40
|
-
*
|
|
41
37
|
* Create a new user.
|
|
42
38
|
*
|
|
43
39
|
* @param {string} userId
|
|
@@ -48,7 +44,7 @@ var Users = class {
|
|
|
48
44
|
* @throws {AppwriteException}
|
|
49
45
|
* @returns {Promise<Models.User<Preferences>>}
|
|
50
46
|
*/
|
|
51
|
-
|
|
47
|
+
create(userId, email, phone, password, name) {
|
|
52
48
|
if (typeof userId === "undefined") {
|
|
53
49
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
54
50
|
}
|
|
@@ -73,7 +69,7 @@ var Users = class {
|
|
|
73
69
|
const apiHeaders = {
|
|
74
70
|
"content-type": "application/json"
|
|
75
71
|
};
|
|
76
|
-
return
|
|
72
|
+
return this.client.call(
|
|
77
73
|
"post",
|
|
78
74
|
uri,
|
|
79
75
|
apiHeaders,
|
|
@@ -81,8 +77,6 @@ var Users = class {
|
|
|
81
77
|
);
|
|
82
78
|
}
|
|
83
79
|
/**
|
|
84
|
-
* Create user with Argon2 password
|
|
85
|
-
*
|
|
86
80
|
* 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.
|
|
87
81
|
*
|
|
88
82
|
* @param {string} userId
|
|
@@ -92,7 +86,7 @@ var Users = class {
|
|
|
92
86
|
* @throws {AppwriteException}
|
|
93
87
|
* @returns {Promise<Models.User<Preferences>>}
|
|
94
88
|
*/
|
|
95
|
-
|
|
89
|
+
createArgon2User(userId, email, password, name) {
|
|
96
90
|
if (typeof userId === "undefined") {
|
|
97
91
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
98
92
|
}
|
|
@@ -120,7 +114,7 @@ var Users = class {
|
|
|
120
114
|
const apiHeaders = {
|
|
121
115
|
"content-type": "application/json"
|
|
122
116
|
};
|
|
123
|
-
return
|
|
117
|
+
return this.client.call(
|
|
124
118
|
"post",
|
|
125
119
|
uri,
|
|
126
120
|
apiHeaders,
|
|
@@ -128,8 +122,6 @@ var Users = class {
|
|
|
128
122
|
);
|
|
129
123
|
}
|
|
130
124
|
/**
|
|
131
|
-
* Create user with bcrypt password
|
|
132
|
-
*
|
|
133
125
|
* 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.
|
|
134
126
|
*
|
|
135
127
|
* @param {string} userId
|
|
@@ -139,7 +131,7 @@ var Users = class {
|
|
|
139
131
|
* @throws {AppwriteException}
|
|
140
132
|
* @returns {Promise<Models.User<Preferences>>}
|
|
141
133
|
*/
|
|
142
|
-
|
|
134
|
+
createBcryptUser(userId, email, password, name) {
|
|
143
135
|
if (typeof userId === "undefined") {
|
|
144
136
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
145
137
|
}
|
|
@@ -167,7 +159,7 @@ var Users = class {
|
|
|
167
159
|
const apiHeaders = {
|
|
168
160
|
"content-type": "application/json"
|
|
169
161
|
};
|
|
170
|
-
return
|
|
162
|
+
return this.client.call(
|
|
171
163
|
"post",
|
|
172
164
|
uri,
|
|
173
165
|
apiHeaders,
|
|
@@ -175,8 +167,6 @@ var Users = class {
|
|
|
175
167
|
);
|
|
176
168
|
}
|
|
177
169
|
/**
|
|
178
|
-
* List identities
|
|
179
|
-
*
|
|
180
170
|
* Get identities for all users.
|
|
181
171
|
*
|
|
182
172
|
* @param {string[]} queries
|
|
@@ -184,7 +174,7 @@ var Users = class {
|
|
|
184
174
|
* @throws {AppwriteException}
|
|
185
175
|
* @returns {Promise<Models.IdentityList>}
|
|
186
176
|
*/
|
|
187
|
-
|
|
177
|
+
listIdentities(queries, search) {
|
|
188
178
|
const apiPath = "/users/identities";
|
|
189
179
|
const payload = {};
|
|
190
180
|
if (typeof queries !== "undefined") {
|
|
@@ -197,7 +187,7 @@ var Users = class {
|
|
|
197
187
|
const apiHeaders = {
|
|
198
188
|
"content-type": "application/json"
|
|
199
189
|
};
|
|
200
|
-
return
|
|
190
|
+
return this.client.call(
|
|
201
191
|
"get",
|
|
202
192
|
uri,
|
|
203
193
|
apiHeaders,
|
|
@@ -205,15 +195,13 @@ var Users = class {
|
|
|
205
195
|
);
|
|
206
196
|
}
|
|
207
197
|
/**
|
|
208
|
-
* Delete identity
|
|
209
|
-
*
|
|
210
198
|
* Delete an identity by its unique ID.
|
|
211
199
|
*
|
|
212
200
|
* @param {string} identityId
|
|
213
201
|
* @throws {AppwriteException}
|
|
214
202
|
* @returns {Promise<{}>}
|
|
215
203
|
*/
|
|
216
|
-
|
|
204
|
+
deleteIdentity(identityId) {
|
|
217
205
|
if (typeof identityId === "undefined") {
|
|
218
206
|
throw new AppwriteException('Missing required parameter: "identityId"');
|
|
219
207
|
}
|
|
@@ -223,7 +211,7 @@ var Users = class {
|
|
|
223
211
|
const apiHeaders = {
|
|
224
212
|
"content-type": "application/json"
|
|
225
213
|
};
|
|
226
|
-
return
|
|
214
|
+
return this.client.call(
|
|
227
215
|
"delete",
|
|
228
216
|
uri,
|
|
229
217
|
apiHeaders,
|
|
@@ -231,8 +219,6 @@ var Users = class {
|
|
|
231
219
|
);
|
|
232
220
|
}
|
|
233
221
|
/**
|
|
234
|
-
* Create user with MD5 password
|
|
235
|
-
*
|
|
236
222
|
* 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.
|
|
237
223
|
*
|
|
238
224
|
* @param {string} userId
|
|
@@ -242,7 +228,7 @@ var Users = class {
|
|
|
242
228
|
* @throws {AppwriteException}
|
|
243
229
|
* @returns {Promise<Models.User<Preferences>>}
|
|
244
230
|
*/
|
|
245
|
-
|
|
231
|
+
createMD5User(userId, email, password, name) {
|
|
246
232
|
if (typeof userId === "undefined") {
|
|
247
233
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
248
234
|
}
|
|
@@ -270,7 +256,7 @@ var Users = class {
|
|
|
270
256
|
const apiHeaders = {
|
|
271
257
|
"content-type": "application/json"
|
|
272
258
|
};
|
|
273
|
-
return
|
|
259
|
+
return this.client.call(
|
|
274
260
|
"post",
|
|
275
261
|
uri,
|
|
276
262
|
apiHeaders,
|
|
@@ -278,8 +264,6 @@ var Users = class {
|
|
|
278
264
|
);
|
|
279
265
|
}
|
|
280
266
|
/**
|
|
281
|
-
* Create user with PHPass password
|
|
282
|
-
*
|
|
283
267
|
* 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.
|
|
284
268
|
*
|
|
285
269
|
* @param {string} userId
|
|
@@ -289,7 +273,7 @@ var Users = class {
|
|
|
289
273
|
* @throws {AppwriteException}
|
|
290
274
|
* @returns {Promise<Models.User<Preferences>>}
|
|
291
275
|
*/
|
|
292
|
-
|
|
276
|
+
createPHPassUser(userId, email, password, name) {
|
|
293
277
|
if (typeof userId === "undefined") {
|
|
294
278
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
295
279
|
}
|
|
@@ -317,7 +301,7 @@ var Users = class {
|
|
|
317
301
|
const apiHeaders = {
|
|
318
302
|
"content-type": "application/json"
|
|
319
303
|
};
|
|
320
|
-
return
|
|
304
|
+
return this.client.call(
|
|
321
305
|
"post",
|
|
322
306
|
uri,
|
|
323
307
|
apiHeaders,
|
|
@@ -325,8 +309,6 @@ var Users = class {
|
|
|
325
309
|
);
|
|
326
310
|
}
|
|
327
311
|
/**
|
|
328
|
-
* Create user with Scrypt password
|
|
329
|
-
*
|
|
330
312
|
* 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.
|
|
331
313
|
*
|
|
332
314
|
* @param {string} userId
|
|
@@ -341,7 +323,7 @@ var Users = class {
|
|
|
341
323
|
* @throws {AppwriteException}
|
|
342
324
|
* @returns {Promise<Models.User<Preferences>>}
|
|
343
325
|
*/
|
|
344
|
-
|
|
326
|
+
createScryptUser(userId, email, password, passwordSalt, passwordCpu, passwordMemory, passwordParallel, passwordLength, name) {
|
|
345
327
|
if (typeof userId === "undefined") {
|
|
346
328
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
347
329
|
}
|
|
@@ -399,7 +381,7 @@ var Users = class {
|
|
|
399
381
|
const apiHeaders = {
|
|
400
382
|
"content-type": "application/json"
|
|
401
383
|
};
|
|
402
|
-
return
|
|
384
|
+
return this.client.call(
|
|
403
385
|
"post",
|
|
404
386
|
uri,
|
|
405
387
|
apiHeaders,
|
|
@@ -407,8 +389,6 @@ var Users = class {
|
|
|
407
389
|
);
|
|
408
390
|
}
|
|
409
391
|
/**
|
|
410
|
-
* Create user with Scrypt modified password
|
|
411
|
-
*
|
|
412
392
|
* 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.
|
|
413
393
|
*
|
|
414
394
|
* @param {string} userId
|
|
@@ -421,7 +401,7 @@ var Users = class {
|
|
|
421
401
|
* @throws {AppwriteException}
|
|
422
402
|
* @returns {Promise<Models.User<Preferences>>}
|
|
423
403
|
*/
|
|
424
|
-
|
|
404
|
+
createScryptModifiedUser(userId, email, password, passwordSalt, passwordSaltSeparator, passwordSignerKey, name) {
|
|
425
405
|
if (typeof userId === "undefined") {
|
|
426
406
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
427
407
|
}
|
|
@@ -467,7 +447,7 @@ var Users = class {
|
|
|
467
447
|
const apiHeaders = {
|
|
468
448
|
"content-type": "application/json"
|
|
469
449
|
};
|
|
470
|
-
return
|
|
450
|
+
return this.client.call(
|
|
471
451
|
"post",
|
|
472
452
|
uri,
|
|
473
453
|
apiHeaders,
|
|
@@ -475,8 +455,6 @@ var Users = class {
|
|
|
475
455
|
);
|
|
476
456
|
}
|
|
477
457
|
/**
|
|
478
|
-
* Create user with SHA password
|
|
479
|
-
*
|
|
480
458
|
* 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.
|
|
481
459
|
*
|
|
482
460
|
* @param {string} userId
|
|
@@ -487,7 +465,7 @@ var Users = class {
|
|
|
487
465
|
* @throws {AppwriteException}
|
|
488
466
|
* @returns {Promise<Models.User<Preferences>>}
|
|
489
467
|
*/
|
|
490
|
-
|
|
468
|
+
createSHAUser(userId, email, password, passwordVersion, name) {
|
|
491
469
|
if (typeof userId === "undefined") {
|
|
492
470
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
493
471
|
}
|
|
@@ -518,7 +496,7 @@ var Users = class {
|
|
|
518
496
|
const apiHeaders = {
|
|
519
497
|
"content-type": "application/json"
|
|
520
498
|
};
|
|
521
|
-
return
|
|
499
|
+
return this.client.call(
|
|
522
500
|
"post",
|
|
523
501
|
uri,
|
|
524
502
|
apiHeaders,
|
|
@@ -526,15 +504,13 @@ var Users = class {
|
|
|
526
504
|
);
|
|
527
505
|
}
|
|
528
506
|
/**
|
|
529
|
-
* Get user
|
|
530
|
-
*
|
|
531
507
|
* Get a user by its unique ID.
|
|
532
508
|
*
|
|
533
509
|
* @param {string} userId
|
|
534
510
|
* @throws {AppwriteException}
|
|
535
511
|
* @returns {Promise<Models.User<Preferences>>}
|
|
536
512
|
*/
|
|
537
|
-
|
|
513
|
+
get(userId) {
|
|
538
514
|
if (typeof userId === "undefined") {
|
|
539
515
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
540
516
|
}
|
|
@@ -544,7 +520,7 @@ var Users = class {
|
|
|
544
520
|
const apiHeaders = {
|
|
545
521
|
"content-type": "application/json"
|
|
546
522
|
};
|
|
547
|
-
return
|
|
523
|
+
return this.client.call(
|
|
548
524
|
"get",
|
|
549
525
|
uri,
|
|
550
526
|
apiHeaders,
|
|
@@ -552,15 +528,13 @@ var Users = class {
|
|
|
552
528
|
);
|
|
553
529
|
}
|
|
554
530
|
/**
|
|
555
|
-
* Delete user
|
|
556
|
-
*
|
|
557
531
|
* 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.
|
|
558
532
|
*
|
|
559
533
|
* @param {string} userId
|
|
560
534
|
* @throws {AppwriteException}
|
|
561
535
|
* @returns {Promise<{}>}
|
|
562
536
|
*/
|
|
563
|
-
|
|
537
|
+
delete(userId) {
|
|
564
538
|
if (typeof userId === "undefined") {
|
|
565
539
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
566
540
|
}
|
|
@@ -570,7 +544,7 @@ var Users = class {
|
|
|
570
544
|
const apiHeaders = {
|
|
571
545
|
"content-type": "application/json"
|
|
572
546
|
};
|
|
573
|
-
return
|
|
547
|
+
return this.client.call(
|
|
574
548
|
"delete",
|
|
575
549
|
uri,
|
|
576
550
|
apiHeaders,
|
|
@@ -578,8 +552,6 @@ var Users = class {
|
|
|
578
552
|
);
|
|
579
553
|
}
|
|
580
554
|
/**
|
|
581
|
-
* Update email
|
|
582
|
-
*
|
|
583
555
|
* Update the user email by its unique ID.
|
|
584
556
|
*
|
|
585
557
|
* @param {string} userId
|
|
@@ -587,7 +559,7 @@ var Users = class {
|
|
|
587
559
|
* @throws {AppwriteException}
|
|
588
560
|
* @returns {Promise<Models.User<Preferences>>}
|
|
589
561
|
*/
|
|
590
|
-
|
|
562
|
+
updateEmail(userId, email) {
|
|
591
563
|
if (typeof userId === "undefined") {
|
|
592
564
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
593
565
|
}
|
|
@@ -603,7 +575,7 @@ var Users = class {
|
|
|
603
575
|
const apiHeaders = {
|
|
604
576
|
"content-type": "application/json"
|
|
605
577
|
};
|
|
606
|
-
return
|
|
578
|
+
return this.client.call(
|
|
607
579
|
"patch",
|
|
608
580
|
uri,
|
|
609
581
|
apiHeaders,
|
|
@@ -611,8 +583,6 @@ var Users = class {
|
|
|
611
583
|
);
|
|
612
584
|
}
|
|
613
585
|
/**
|
|
614
|
-
* Create user JWT
|
|
615
|
-
*
|
|
616
586
|
* 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.
|
|
617
587
|
*
|
|
618
588
|
* @param {string} userId
|
|
@@ -621,7 +591,7 @@ var Users = class {
|
|
|
621
591
|
* @throws {AppwriteException}
|
|
622
592
|
* @returns {Promise<Models.Jwt>}
|
|
623
593
|
*/
|
|
624
|
-
|
|
594
|
+
createJWT(userId, sessionId, duration) {
|
|
625
595
|
if (typeof userId === "undefined") {
|
|
626
596
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
627
597
|
}
|
|
@@ -637,7 +607,7 @@ var Users = class {
|
|
|
637
607
|
const apiHeaders = {
|
|
638
608
|
"content-type": "application/json"
|
|
639
609
|
};
|
|
640
|
-
return
|
|
610
|
+
return this.client.call(
|
|
641
611
|
"post",
|
|
642
612
|
uri,
|
|
643
613
|
apiHeaders,
|
|
@@ -645,8 +615,6 @@ var Users = class {
|
|
|
645
615
|
);
|
|
646
616
|
}
|
|
647
617
|
/**
|
|
648
|
-
* Update user labels
|
|
649
|
-
*
|
|
650
618
|
* Update the user labels by its unique ID.
|
|
651
619
|
|
|
652
620
|
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.
|
|
@@ -656,7 +624,7 @@ var Users = class {
|
|
|
656
624
|
* @throws {AppwriteException}
|
|
657
625
|
* @returns {Promise<Models.User<Preferences>>}
|
|
658
626
|
*/
|
|
659
|
-
|
|
627
|
+
updateLabels(userId, labels) {
|
|
660
628
|
if (typeof userId === "undefined") {
|
|
661
629
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
662
630
|
}
|
|
@@ -672,7 +640,7 @@ var Users = class {
|
|
|
672
640
|
const apiHeaders = {
|
|
673
641
|
"content-type": "application/json"
|
|
674
642
|
};
|
|
675
|
-
return
|
|
643
|
+
return this.client.call(
|
|
676
644
|
"put",
|
|
677
645
|
uri,
|
|
678
646
|
apiHeaders,
|
|
@@ -680,8 +648,6 @@ var Users = class {
|
|
|
680
648
|
);
|
|
681
649
|
}
|
|
682
650
|
/**
|
|
683
|
-
* List user logs
|
|
684
|
-
*
|
|
685
651
|
* Get the user activity logs list by its unique ID.
|
|
686
652
|
*
|
|
687
653
|
* @param {string} userId
|
|
@@ -689,7 +655,7 @@ var Users = class {
|
|
|
689
655
|
* @throws {AppwriteException}
|
|
690
656
|
* @returns {Promise<Models.LogList>}
|
|
691
657
|
*/
|
|
692
|
-
|
|
658
|
+
listLogs(userId, queries) {
|
|
693
659
|
if (typeof userId === "undefined") {
|
|
694
660
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
695
661
|
}
|
|
@@ -702,7 +668,7 @@ var Users = class {
|
|
|
702
668
|
const apiHeaders = {
|
|
703
669
|
"content-type": "application/json"
|
|
704
670
|
};
|
|
705
|
-
return
|
|
671
|
+
return this.client.call(
|
|
706
672
|
"get",
|
|
707
673
|
uri,
|
|
708
674
|
apiHeaders,
|
|
@@ -710,15 +676,13 @@ var Users = class {
|
|
|
710
676
|
);
|
|
711
677
|
}
|
|
712
678
|
/**
|
|
713
|
-
* List user memberships
|
|
714
|
-
*
|
|
715
679
|
* Get the user membership list by its unique ID.
|
|
716
680
|
*
|
|
717
681
|
* @param {string} userId
|
|
718
682
|
* @throws {AppwriteException}
|
|
719
683
|
* @returns {Promise<Models.MembershipList>}
|
|
720
684
|
*/
|
|
721
|
-
|
|
685
|
+
listMemberships(userId) {
|
|
722
686
|
if (typeof userId === "undefined") {
|
|
723
687
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
724
688
|
}
|
|
@@ -728,7 +692,7 @@ var Users = class {
|
|
|
728
692
|
const apiHeaders = {
|
|
729
693
|
"content-type": "application/json"
|
|
730
694
|
};
|
|
731
|
-
return
|
|
695
|
+
return this.client.call(
|
|
732
696
|
"get",
|
|
733
697
|
uri,
|
|
734
698
|
apiHeaders,
|
|
@@ -736,8 +700,6 @@ var Users = class {
|
|
|
736
700
|
);
|
|
737
701
|
}
|
|
738
702
|
/**
|
|
739
|
-
* Update MFA
|
|
740
|
-
*
|
|
741
703
|
* Enable or disable MFA on a user account.
|
|
742
704
|
*
|
|
743
705
|
* @param {string} userId
|
|
@@ -745,7 +707,7 @@ var Users = class {
|
|
|
745
707
|
* @throws {AppwriteException}
|
|
746
708
|
* @returns {Promise<Models.User<Preferences>>}
|
|
747
709
|
*/
|
|
748
|
-
|
|
710
|
+
updateMfa(userId, mfa) {
|
|
749
711
|
if (typeof userId === "undefined") {
|
|
750
712
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
751
713
|
}
|
|
@@ -761,7 +723,7 @@ var Users = class {
|
|
|
761
723
|
const apiHeaders = {
|
|
762
724
|
"content-type": "application/json"
|
|
763
725
|
};
|
|
764
|
-
return
|
|
726
|
+
return this.client.call(
|
|
765
727
|
"patch",
|
|
766
728
|
uri,
|
|
767
729
|
apiHeaders,
|
|
@@ -769,8 +731,6 @@ var Users = class {
|
|
|
769
731
|
);
|
|
770
732
|
}
|
|
771
733
|
/**
|
|
772
|
-
* Delete authenticator
|
|
773
|
-
*
|
|
774
734
|
* Delete an authenticator app.
|
|
775
735
|
*
|
|
776
736
|
* @param {string} userId
|
|
@@ -778,7 +738,7 @@ var Users = class {
|
|
|
778
738
|
* @throws {AppwriteException}
|
|
779
739
|
* @returns {Promise<{}>}
|
|
780
740
|
*/
|
|
781
|
-
|
|
741
|
+
deleteMfaAuthenticator(userId, type) {
|
|
782
742
|
if (typeof userId === "undefined") {
|
|
783
743
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
784
744
|
}
|
|
@@ -791,7 +751,7 @@ var Users = class {
|
|
|
791
751
|
const apiHeaders = {
|
|
792
752
|
"content-type": "application/json"
|
|
793
753
|
};
|
|
794
|
-
return
|
|
754
|
+
return this.client.call(
|
|
795
755
|
"delete",
|
|
796
756
|
uri,
|
|
797
757
|
apiHeaders,
|
|
@@ -799,15 +759,13 @@ var Users = class {
|
|
|
799
759
|
);
|
|
800
760
|
}
|
|
801
761
|
/**
|
|
802
|
-
* List factors
|
|
803
|
-
*
|
|
804
762
|
* List the factors available on the account to be used as a MFA challange.
|
|
805
763
|
*
|
|
806
764
|
* @param {string} userId
|
|
807
765
|
* @throws {AppwriteException}
|
|
808
766
|
* @returns {Promise<Models.MfaFactors>}
|
|
809
767
|
*/
|
|
810
|
-
|
|
768
|
+
listMfaFactors(userId) {
|
|
811
769
|
if (typeof userId === "undefined") {
|
|
812
770
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
813
771
|
}
|
|
@@ -817,7 +775,7 @@ var Users = class {
|
|
|
817
775
|
const apiHeaders = {
|
|
818
776
|
"content-type": "application/json"
|
|
819
777
|
};
|
|
820
|
-
return
|
|
778
|
+
return this.client.call(
|
|
821
779
|
"get",
|
|
822
780
|
uri,
|
|
823
781
|
apiHeaders,
|
|
@@ -825,15 +783,13 @@ var Users = class {
|
|
|
825
783
|
);
|
|
826
784
|
}
|
|
827
785
|
/**
|
|
828
|
-
* Get MFA recovery codes
|
|
829
|
-
*
|
|
830
786
|
* 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.
|
|
831
787
|
*
|
|
832
788
|
* @param {string} userId
|
|
833
789
|
* @throws {AppwriteException}
|
|
834
790
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
835
791
|
*/
|
|
836
|
-
|
|
792
|
+
getMfaRecoveryCodes(userId) {
|
|
837
793
|
if (typeof userId === "undefined") {
|
|
838
794
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
839
795
|
}
|
|
@@ -843,7 +799,7 @@ var Users = class {
|
|
|
843
799
|
const apiHeaders = {
|
|
844
800
|
"content-type": "application/json"
|
|
845
801
|
};
|
|
846
|
-
return
|
|
802
|
+
return this.client.call(
|
|
847
803
|
"get",
|
|
848
804
|
uri,
|
|
849
805
|
apiHeaders,
|
|
@@ -851,15 +807,13 @@ var Users = class {
|
|
|
851
807
|
);
|
|
852
808
|
}
|
|
853
809
|
/**
|
|
854
|
-
* Regenerate MFA recovery codes
|
|
855
|
-
*
|
|
856
810
|
* 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.
|
|
857
811
|
*
|
|
858
812
|
* @param {string} userId
|
|
859
813
|
* @throws {AppwriteException}
|
|
860
814
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
861
815
|
*/
|
|
862
|
-
|
|
816
|
+
updateMfaRecoveryCodes(userId) {
|
|
863
817
|
if (typeof userId === "undefined") {
|
|
864
818
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
865
819
|
}
|
|
@@ -869,7 +823,7 @@ var Users = class {
|
|
|
869
823
|
const apiHeaders = {
|
|
870
824
|
"content-type": "application/json"
|
|
871
825
|
};
|
|
872
|
-
return
|
|
826
|
+
return this.client.call(
|
|
873
827
|
"put",
|
|
874
828
|
uri,
|
|
875
829
|
apiHeaders,
|
|
@@ -877,15 +831,13 @@ var Users = class {
|
|
|
877
831
|
);
|
|
878
832
|
}
|
|
879
833
|
/**
|
|
880
|
-
* Create MFA recovery codes
|
|
881
|
-
*
|
|
882
834
|
* 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.
|
|
883
835
|
*
|
|
884
836
|
* @param {string} userId
|
|
885
837
|
* @throws {AppwriteException}
|
|
886
838
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
887
839
|
*/
|
|
888
|
-
|
|
840
|
+
createMfaRecoveryCodes(userId) {
|
|
889
841
|
if (typeof userId === "undefined") {
|
|
890
842
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
891
843
|
}
|
|
@@ -895,7 +847,7 @@ var Users = class {
|
|
|
895
847
|
const apiHeaders = {
|
|
896
848
|
"content-type": "application/json"
|
|
897
849
|
};
|
|
898
|
-
return
|
|
850
|
+
return this.client.call(
|
|
899
851
|
"patch",
|
|
900
852
|
uri,
|
|
901
853
|
apiHeaders,
|
|
@@ -903,8 +855,6 @@ var Users = class {
|
|
|
903
855
|
);
|
|
904
856
|
}
|
|
905
857
|
/**
|
|
906
|
-
* Update name
|
|
907
|
-
*
|
|
908
858
|
* Update the user name by its unique ID.
|
|
909
859
|
*
|
|
910
860
|
* @param {string} userId
|
|
@@ -912,7 +862,7 @@ var Users = class {
|
|
|
912
862
|
* @throws {AppwriteException}
|
|
913
863
|
* @returns {Promise<Models.User<Preferences>>}
|
|
914
864
|
*/
|
|
915
|
-
|
|
865
|
+
updateName(userId, name) {
|
|
916
866
|
if (typeof userId === "undefined") {
|
|
917
867
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
918
868
|
}
|
|
@@ -928,7 +878,7 @@ var Users = class {
|
|
|
928
878
|
const apiHeaders = {
|
|
929
879
|
"content-type": "application/json"
|
|
930
880
|
};
|
|
931
|
-
return
|
|
881
|
+
return this.client.call(
|
|
932
882
|
"patch",
|
|
933
883
|
uri,
|
|
934
884
|
apiHeaders,
|
|
@@ -936,8 +886,6 @@ var Users = class {
|
|
|
936
886
|
);
|
|
937
887
|
}
|
|
938
888
|
/**
|
|
939
|
-
* Update password
|
|
940
|
-
*
|
|
941
889
|
* Update the user password by its unique ID.
|
|
942
890
|
*
|
|
943
891
|
* @param {string} userId
|
|
@@ -945,7 +893,7 @@ var Users = class {
|
|
|
945
893
|
* @throws {AppwriteException}
|
|
946
894
|
* @returns {Promise<Models.User<Preferences>>}
|
|
947
895
|
*/
|
|
948
|
-
|
|
896
|
+
updatePassword(userId, password) {
|
|
949
897
|
if (typeof userId === "undefined") {
|
|
950
898
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
951
899
|
}
|
|
@@ -961,7 +909,7 @@ var Users = class {
|
|
|
961
909
|
const apiHeaders = {
|
|
962
910
|
"content-type": "application/json"
|
|
963
911
|
};
|
|
964
|
-
return
|
|
912
|
+
return this.client.call(
|
|
965
913
|
"patch",
|
|
966
914
|
uri,
|
|
967
915
|
apiHeaders,
|
|
@@ -969,8 +917,6 @@ var Users = class {
|
|
|
969
917
|
);
|
|
970
918
|
}
|
|
971
919
|
/**
|
|
972
|
-
* Update phone
|
|
973
|
-
*
|
|
974
920
|
* Update the user phone by its unique ID.
|
|
975
921
|
*
|
|
976
922
|
* @param {string} userId
|
|
@@ -978,7 +924,7 @@ var Users = class {
|
|
|
978
924
|
* @throws {AppwriteException}
|
|
979
925
|
* @returns {Promise<Models.User<Preferences>>}
|
|
980
926
|
*/
|
|
981
|
-
|
|
927
|
+
updatePhone(userId, number) {
|
|
982
928
|
if (typeof userId === "undefined") {
|
|
983
929
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
984
930
|
}
|
|
@@ -994,7 +940,7 @@ var Users = class {
|
|
|
994
940
|
const apiHeaders = {
|
|
995
941
|
"content-type": "application/json"
|
|
996
942
|
};
|
|
997
|
-
return
|
|
943
|
+
return this.client.call(
|
|
998
944
|
"patch",
|
|
999
945
|
uri,
|
|
1000
946
|
apiHeaders,
|
|
@@ -1002,15 +948,13 @@ var Users = class {
|
|
|
1002
948
|
);
|
|
1003
949
|
}
|
|
1004
950
|
/**
|
|
1005
|
-
* Get user preferences
|
|
1006
|
-
*
|
|
1007
951
|
* Get the user preferences by its unique ID.
|
|
1008
952
|
*
|
|
1009
953
|
* @param {string} userId
|
|
1010
954
|
* @throws {AppwriteException}
|
|
1011
955
|
* @returns {Promise<Preferences>}
|
|
1012
956
|
*/
|
|
1013
|
-
|
|
957
|
+
getPrefs(userId) {
|
|
1014
958
|
if (typeof userId === "undefined") {
|
|
1015
959
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1016
960
|
}
|
|
@@ -1020,7 +964,7 @@ var Users = class {
|
|
|
1020
964
|
const apiHeaders = {
|
|
1021
965
|
"content-type": "application/json"
|
|
1022
966
|
};
|
|
1023
|
-
return
|
|
967
|
+
return this.client.call(
|
|
1024
968
|
"get",
|
|
1025
969
|
uri,
|
|
1026
970
|
apiHeaders,
|
|
@@ -1028,8 +972,6 @@ var Users = class {
|
|
|
1028
972
|
);
|
|
1029
973
|
}
|
|
1030
974
|
/**
|
|
1031
|
-
* Update user preferences
|
|
1032
|
-
*
|
|
1033
975
|
* 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.
|
|
1034
976
|
*
|
|
1035
977
|
* @param {string} userId
|
|
@@ -1037,7 +979,7 @@ var Users = class {
|
|
|
1037
979
|
* @throws {AppwriteException}
|
|
1038
980
|
* @returns {Promise<Preferences>}
|
|
1039
981
|
*/
|
|
1040
|
-
|
|
982
|
+
updatePrefs(userId, prefs) {
|
|
1041
983
|
if (typeof userId === "undefined") {
|
|
1042
984
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1043
985
|
}
|
|
@@ -1053,7 +995,7 @@ var Users = class {
|
|
|
1053
995
|
const apiHeaders = {
|
|
1054
996
|
"content-type": "application/json"
|
|
1055
997
|
};
|
|
1056
|
-
return
|
|
998
|
+
return this.client.call(
|
|
1057
999
|
"patch",
|
|
1058
1000
|
uri,
|
|
1059
1001
|
apiHeaders,
|
|
@@ -1061,15 +1003,13 @@ var Users = class {
|
|
|
1061
1003
|
);
|
|
1062
1004
|
}
|
|
1063
1005
|
/**
|
|
1064
|
-
* List user sessions
|
|
1065
|
-
*
|
|
1066
1006
|
* Get the user sessions list by its unique ID.
|
|
1067
1007
|
*
|
|
1068
1008
|
* @param {string} userId
|
|
1069
1009
|
* @throws {AppwriteException}
|
|
1070
1010
|
* @returns {Promise<Models.SessionList>}
|
|
1071
1011
|
*/
|
|
1072
|
-
|
|
1012
|
+
listSessions(userId) {
|
|
1073
1013
|
if (typeof userId === "undefined") {
|
|
1074
1014
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1075
1015
|
}
|
|
@@ -1079,7 +1019,7 @@ var Users = class {
|
|
|
1079
1019
|
const apiHeaders = {
|
|
1080
1020
|
"content-type": "application/json"
|
|
1081
1021
|
};
|
|
1082
|
-
return
|
|
1022
|
+
return this.client.call(
|
|
1083
1023
|
"get",
|
|
1084
1024
|
uri,
|
|
1085
1025
|
apiHeaders,
|
|
@@ -1087,8 +1027,6 @@ var Users = class {
|
|
|
1087
1027
|
);
|
|
1088
1028
|
}
|
|
1089
1029
|
/**
|
|
1090
|
-
* Create session
|
|
1091
|
-
*
|
|
1092
1030
|
* Creates a session for a user. Returns an immediately usable session object.
|
|
1093
1031
|
|
|
1094
1032
|
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.
|
|
@@ -1097,7 +1035,7 @@ var Users = class {
|
|
|
1097
1035
|
* @throws {AppwriteException}
|
|
1098
1036
|
* @returns {Promise<Models.Session>}
|
|
1099
1037
|
*/
|
|
1100
|
-
|
|
1038
|
+
createSession(userId) {
|
|
1101
1039
|
if (typeof userId === "undefined") {
|
|
1102
1040
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1103
1041
|
}
|
|
@@ -1107,7 +1045,7 @@ var Users = class {
|
|
|
1107
1045
|
const apiHeaders = {
|
|
1108
1046
|
"content-type": "application/json"
|
|
1109
1047
|
};
|
|
1110
|
-
return
|
|
1048
|
+
return this.client.call(
|
|
1111
1049
|
"post",
|
|
1112
1050
|
uri,
|
|
1113
1051
|
apiHeaders,
|
|
@@ -1115,15 +1053,13 @@ var Users = class {
|
|
|
1115
1053
|
);
|
|
1116
1054
|
}
|
|
1117
1055
|
/**
|
|
1118
|
-
* Delete user sessions
|
|
1119
|
-
*
|
|
1120
1056
|
* Delete all user's sessions by using the user's unique ID.
|
|
1121
1057
|
*
|
|
1122
1058
|
* @param {string} userId
|
|
1123
1059
|
* @throws {AppwriteException}
|
|
1124
1060
|
* @returns {Promise<{}>}
|
|
1125
1061
|
*/
|
|
1126
|
-
|
|
1062
|
+
deleteSessions(userId) {
|
|
1127
1063
|
if (typeof userId === "undefined") {
|
|
1128
1064
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1129
1065
|
}
|
|
@@ -1133,7 +1069,7 @@ var Users = class {
|
|
|
1133
1069
|
const apiHeaders = {
|
|
1134
1070
|
"content-type": "application/json"
|
|
1135
1071
|
};
|
|
1136
|
-
return
|
|
1072
|
+
return this.client.call(
|
|
1137
1073
|
"delete",
|
|
1138
1074
|
uri,
|
|
1139
1075
|
apiHeaders,
|
|
@@ -1141,8 +1077,6 @@ var Users = class {
|
|
|
1141
1077
|
);
|
|
1142
1078
|
}
|
|
1143
1079
|
/**
|
|
1144
|
-
* Delete user session
|
|
1145
|
-
*
|
|
1146
1080
|
* Delete a user sessions by its unique ID.
|
|
1147
1081
|
*
|
|
1148
1082
|
* @param {string} userId
|
|
@@ -1150,7 +1084,7 @@ var Users = class {
|
|
|
1150
1084
|
* @throws {AppwriteException}
|
|
1151
1085
|
* @returns {Promise<{}>}
|
|
1152
1086
|
*/
|
|
1153
|
-
|
|
1087
|
+
deleteSession(userId, sessionId) {
|
|
1154
1088
|
if (typeof userId === "undefined") {
|
|
1155
1089
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1156
1090
|
}
|
|
@@ -1163,7 +1097,7 @@ var Users = class {
|
|
|
1163
1097
|
const apiHeaders = {
|
|
1164
1098
|
"content-type": "application/json"
|
|
1165
1099
|
};
|
|
1166
|
-
return
|
|
1100
|
+
return this.client.call(
|
|
1167
1101
|
"delete",
|
|
1168
1102
|
uri,
|
|
1169
1103
|
apiHeaders,
|
|
@@ -1171,8 +1105,6 @@ var Users = class {
|
|
|
1171
1105
|
);
|
|
1172
1106
|
}
|
|
1173
1107
|
/**
|
|
1174
|
-
* Update user status
|
|
1175
|
-
*
|
|
1176
1108
|
* 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.
|
|
1177
1109
|
*
|
|
1178
1110
|
* @param {string} userId
|
|
@@ -1180,7 +1112,7 @@ var Users = class {
|
|
|
1180
1112
|
* @throws {AppwriteException}
|
|
1181
1113
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1182
1114
|
*/
|
|
1183
|
-
|
|
1115
|
+
updateStatus(userId, status) {
|
|
1184
1116
|
if (typeof userId === "undefined") {
|
|
1185
1117
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1186
1118
|
}
|
|
@@ -1196,7 +1128,7 @@ var Users = class {
|
|
|
1196
1128
|
const apiHeaders = {
|
|
1197
1129
|
"content-type": "application/json"
|
|
1198
1130
|
};
|
|
1199
|
-
return
|
|
1131
|
+
return this.client.call(
|
|
1200
1132
|
"patch",
|
|
1201
1133
|
uri,
|
|
1202
1134
|
apiHeaders,
|
|
@@ -1204,8 +1136,6 @@ var Users = class {
|
|
|
1204
1136
|
);
|
|
1205
1137
|
}
|
|
1206
1138
|
/**
|
|
1207
|
-
* List user targets
|
|
1208
|
-
*
|
|
1209
1139
|
* List the messaging targets that are associated with a user.
|
|
1210
1140
|
*
|
|
1211
1141
|
* @param {string} userId
|
|
@@ -1213,7 +1143,7 @@ var Users = class {
|
|
|
1213
1143
|
* @throws {AppwriteException}
|
|
1214
1144
|
* @returns {Promise<Models.TargetList>}
|
|
1215
1145
|
*/
|
|
1216
|
-
|
|
1146
|
+
listTargets(userId, queries) {
|
|
1217
1147
|
if (typeof userId === "undefined") {
|
|
1218
1148
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1219
1149
|
}
|
|
@@ -1226,7 +1156,7 @@ var Users = class {
|
|
|
1226
1156
|
const apiHeaders = {
|
|
1227
1157
|
"content-type": "application/json"
|
|
1228
1158
|
};
|
|
1229
|
-
return
|
|
1159
|
+
return this.client.call(
|
|
1230
1160
|
"get",
|
|
1231
1161
|
uri,
|
|
1232
1162
|
apiHeaders,
|
|
@@ -1234,8 +1164,6 @@ var Users = class {
|
|
|
1234
1164
|
);
|
|
1235
1165
|
}
|
|
1236
1166
|
/**
|
|
1237
|
-
* Create user target
|
|
1238
|
-
*
|
|
1239
1167
|
* Create a messaging target.
|
|
1240
1168
|
*
|
|
1241
1169
|
* @param {string} userId
|
|
@@ -1247,7 +1175,7 @@ var Users = class {
|
|
|
1247
1175
|
* @throws {AppwriteException}
|
|
1248
1176
|
* @returns {Promise<Models.Target>}
|
|
1249
1177
|
*/
|
|
1250
|
-
|
|
1178
|
+
createTarget(userId, targetId, providerType, identifier, providerId, name) {
|
|
1251
1179
|
if (typeof userId === "undefined") {
|
|
1252
1180
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1253
1181
|
}
|
|
@@ -1281,7 +1209,7 @@ var Users = class {
|
|
|
1281
1209
|
const apiHeaders = {
|
|
1282
1210
|
"content-type": "application/json"
|
|
1283
1211
|
};
|
|
1284
|
-
return
|
|
1212
|
+
return this.client.call(
|
|
1285
1213
|
"post",
|
|
1286
1214
|
uri,
|
|
1287
1215
|
apiHeaders,
|
|
@@ -1289,8 +1217,6 @@ var Users = class {
|
|
|
1289
1217
|
);
|
|
1290
1218
|
}
|
|
1291
1219
|
/**
|
|
1292
|
-
* Get user target
|
|
1293
|
-
*
|
|
1294
1220
|
* Get a user's push notification target by ID.
|
|
1295
1221
|
*
|
|
1296
1222
|
* @param {string} userId
|
|
@@ -1298,7 +1224,7 @@ var Users = class {
|
|
|
1298
1224
|
* @throws {AppwriteException}
|
|
1299
1225
|
* @returns {Promise<Models.Target>}
|
|
1300
1226
|
*/
|
|
1301
|
-
|
|
1227
|
+
getTarget(userId, targetId) {
|
|
1302
1228
|
if (typeof userId === "undefined") {
|
|
1303
1229
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1304
1230
|
}
|
|
@@ -1311,7 +1237,7 @@ var Users = class {
|
|
|
1311
1237
|
const apiHeaders = {
|
|
1312
1238
|
"content-type": "application/json"
|
|
1313
1239
|
};
|
|
1314
|
-
return
|
|
1240
|
+
return this.client.call(
|
|
1315
1241
|
"get",
|
|
1316
1242
|
uri,
|
|
1317
1243
|
apiHeaders,
|
|
@@ -1319,8 +1245,6 @@ var Users = class {
|
|
|
1319
1245
|
);
|
|
1320
1246
|
}
|
|
1321
1247
|
/**
|
|
1322
|
-
* Update user target
|
|
1323
|
-
*
|
|
1324
1248
|
* Update a messaging target.
|
|
1325
1249
|
*
|
|
1326
1250
|
* @param {string} userId
|
|
@@ -1331,7 +1255,7 @@ var Users = class {
|
|
|
1331
1255
|
* @throws {AppwriteException}
|
|
1332
1256
|
* @returns {Promise<Models.Target>}
|
|
1333
1257
|
*/
|
|
1334
|
-
|
|
1258
|
+
updateTarget(userId, targetId, identifier, providerId, name) {
|
|
1335
1259
|
if (typeof userId === "undefined") {
|
|
1336
1260
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1337
1261
|
}
|
|
@@ -1353,7 +1277,7 @@ var Users = class {
|
|
|
1353
1277
|
const apiHeaders = {
|
|
1354
1278
|
"content-type": "application/json"
|
|
1355
1279
|
};
|
|
1356
|
-
return
|
|
1280
|
+
return this.client.call(
|
|
1357
1281
|
"patch",
|
|
1358
1282
|
uri,
|
|
1359
1283
|
apiHeaders,
|
|
@@ -1361,8 +1285,6 @@ var Users = class {
|
|
|
1361
1285
|
);
|
|
1362
1286
|
}
|
|
1363
1287
|
/**
|
|
1364
|
-
* Delete user target
|
|
1365
|
-
*
|
|
1366
1288
|
* Delete a messaging target.
|
|
1367
1289
|
*
|
|
1368
1290
|
* @param {string} userId
|
|
@@ -1370,7 +1292,7 @@ var Users = class {
|
|
|
1370
1292
|
* @throws {AppwriteException}
|
|
1371
1293
|
* @returns {Promise<{}>}
|
|
1372
1294
|
*/
|
|
1373
|
-
|
|
1295
|
+
deleteTarget(userId, targetId) {
|
|
1374
1296
|
if (typeof userId === "undefined") {
|
|
1375
1297
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1376
1298
|
}
|
|
@@ -1383,7 +1305,7 @@ var Users = class {
|
|
|
1383
1305
|
const apiHeaders = {
|
|
1384
1306
|
"content-type": "application/json"
|
|
1385
1307
|
};
|
|
1386
|
-
return
|
|
1308
|
+
return this.client.call(
|
|
1387
1309
|
"delete",
|
|
1388
1310
|
uri,
|
|
1389
1311
|
apiHeaders,
|
|
@@ -1391,8 +1313,6 @@ var Users = class {
|
|
|
1391
1313
|
);
|
|
1392
1314
|
}
|
|
1393
1315
|
/**
|
|
1394
|
-
* Create token
|
|
1395
|
-
*
|
|
1396
1316
|
* 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.
|
|
1397
1317
|
|
|
1398
1318
|
*
|
|
@@ -1402,7 +1322,7 @@ var Users = class {
|
|
|
1402
1322
|
* @throws {AppwriteException}
|
|
1403
1323
|
* @returns {Promise<Models.Token>}
|
|
1404
1324
|
*/
|
|
1405
|
-
|
|
1325
|
+
createToken(userId, length, expire) {
|
|
1406
1326
|
if (typeof userId === "undefined") {
|
|
1407
1327
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1408
1328
|
}
|
|
@@ -1418,7 +1338,7 @@ var Users = class {
|
|
|
1418
1338
|
const apiHeaders = {
|
|
1419
1339
|
"content-type": "application/json"
|
|
1420
1340
|
};
|
|
1421
|
-
return
|
|
1341
|
+
return this.client.call(
|
|
1422
1342
|
"post",
|
|
1423
1343
|
uri,
|
|
1424
1344
|
apiHeaders,
|
|
@@ -1426,8 +1346,6 @@ var Users = class {
|
|
|
1426
1346
|
);
|
|
1427
1347
|
}
|
|
1428
1348
|
/**
|
|
1429
|
-
* Update email verification
|
|
1430
|
-
*
|
|
1431
1349
|
* Update the user email verification status by its unique ID.
|
|
1432
1350
|
*
|
|
1433
1351
|
* @param {string} userId
|
|
@@ -1435,7 +1353,7 @@ var Users = class {
|
|
|
1435
1353
|
* @throws {AppwriteException}
|
|
1436
1354
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1437
1355
|
*/
|
|
1438
|
-
|
|
1356
|
+
updateEmailVerification(userId, emailVerification) {
|
|
1439
1357
|
if (typeof userId === "undefined") {
|
|
1440
1358
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1441
1359
|
}
|
|
@@ -1451,7 +1369,7 @@ var Users = class {
|
|
|
1451
1369
|
const apiHeaders = {
|
|
1452
1370
|
"content-type": "application/json"
|
|
1453
1371
|
};
|
|
1454
|
-
return
|
|
1372
|
+
return this.client.call(
|
|
1455
1373
|
"patch",
|
|
1456
1374
|
uri,
|
|
1457
1375
|
apiHeaders,
|
|
@@ -1459,8 +1377,6 @@ var Users = class {
|
|
|
1459
1377
|
);
|
|
1460
1378
|
}
|
|
1461
1379
|
/**
|
|
1462
|
-
* Update phone verification
|
|
1463
|
-
*
|
|
1464
1380
|
* Update the user phone verification status by its unique ID.
|
|
1465
1381
|
*
|
|
1466
1382
|
* @param {string} userId
|
|
@@ -1468,7 +1384,7 @@ var Users = class {
|
|
|
1468
1384
|
* @throws {AppwriteException}
|
|
1469
1385
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1470
1386
|
*/
|
|
1471
|
-
|
|
1387
|
+
updatePhoneVerification(userId, phoneVerification) {
|
|
1472
1388
|
if (typeof userId === "undefined") {
|
|
1473
1389
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1474
1390
|
}
|
|
@@ -1484,7 +1400,7 @@ var Users = class {
|
|
|
1484
1400
|
const apiHeaders = {
|
|
1485
1401
|
"content-type": "application/json"
|
|
1486
1402
|
};
|
|
1487
|
-
return
|
|
1403
|
+
return this.client.call(
|
|
1488
1404
|
"patch",
|
|
1489
1405
|
uri,
|
|
1490
1406
|
apiHeaders,
|