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