@appwrite.io/console 0.3.0 → 0.4.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/.github/workflows/publish.yml +2 -2
- package/README.md +3 -3
- package/dist/cjs/sdk.js +1354 -1197
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1354 -1197
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +1354 -1197
- package/docs/examples/functions/create.md +1 -1
- package/docs/examples/functions/update.md +1 -1
- package/docs/examples/{projects/get-usage.md → health/get-queue-builds.md} +3 -3
- package/docs/examples/{account/create-with-invite-code.md → health/get-queue-databases.md} +3 -3
- package/docs/examples/health/get-queue-deletes.md +18 -0
- package/docs/examples/health/get-queue-mails.md +18 -0
- package/docs/examples/health/get-queue-messaging.md +18 -0
- package/docs/examples/health/get-queue-migrations.md +18 -0
- package/docs/examples/project/get-usage.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/package.json +3 -2
- package/src/client.ts +1 -1
- package/src/models.ts +147 -279
- package/src/query.ts +1 -1
- package/src/role.ts +72 -6
- package/src/services/account.ts +154 -204
- package/src/services/assistant.ts +3 -3
- package/src/services/avatars.ts +32 -31
- package/src/services/console.ts +4 -4
- package/src/services/databases.ts +195 -195
- package/src/services/functions.ts +117 -126
- package/src/services/graphql.ts +8 -8
- package/src/services/health.ts +219 -50
- package/src/services/locale.ts +31 -31
- package/src/services/migrations.ts +48 -48
- package/src/services/project.ts +40 -22
- package/src/services/projects.ts +143 -170
- package/src/services/proxy.ts +15 -15
- package/src/services/storage.ts +74 -84
- package/src/services/teams.ts +62 -66
- package/src/services/users.ts +132 -135
- package/src/services/vcs.ts +27 -27
- package/types/models.d.ts +147 -279
- package/types/role.d.ts +62 -0
- package/types/services/account.d.ts +61 -70
- package/types/services/avatars.d.ts +11 -10
- package/types/services/console.d.ts +1 -1
- package/types/services/databases.d.ts +51 -51
- package/types/services/functions.d.ts +32 -27
- package/types/services/graphql.d.ts +2 -2
- package/types/services/health.d.ts +85 -14
- package/types/services/locale.d.ts +7 -7
- package/types/services/project.d.ts +4 -2
- package/types/services/projects.d.ts +26 -36
- package/types/services/storage.d.ts +13 -13
- package/types/services/teams.d.ts +20 -20
- package/types/services/users.d.ts +45 -44
package/src/services/users.ts
CHANGED
|
@@ -11,7 +11,7 @@ export class Users extends Service {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* List
|
|
14
|
+
* List users
|
|
15
15
|
*
|
|
16
16
|
* Get a list of all the project's users. You can use the query params to
|
|
17
17
|
* filter your results.
|
|
@@ -22,8 +22,8 @@ export class Users extends Service {
|
|
|
22
22
|
* @returns {Promise}
|
|
23
23
|
*/
|
|
24
24
|
async list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences>> {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const apiPath = '/users';
|
|
26
|
+
const payload: Payload = {};
|
|
27
27
|
|
|
28
28
|
if (typeof queries !== 'undefined') {
|
|
29
29
|
payload['queries'] = queries;
|
|
@@ -33,14 +33,14 @@ export class Users extends Service {
|
|
|
33
33
|
payload['search'] = search;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const uri = new URL(this.client.config.endpoint +
|
|
36
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
37
37
|
return await this.client.call('get', uri, {
|
|
38
38
|
'content-type': 'application/json',
|
|
39
39
|
}, payload);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Create
|
|
43
|
+
* Create user
|
|
44
44
|
*
|
|
45
45
|
* Create a new user.
|
|
46
46
|
*
|
|
@@ -57,8 +57,8 @@ export class Users extends Service {
|
|
|
57
57
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
const apiPath = '/users';
|
|
61
|
+
const payload: Payload = {};
|
|
62
62
|
|
|
63
63
|
if (typeof userId !== 'undefined') {
|
|
64
64
|
payload['userId'] = userId;
|
|
@@ -80,19 +80,19 @@ export class Users extends Service {
|
|
|
80
80
|
payload['name'] = name;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
const uri = new URL(this.client.config.endpoint +
|
|
83
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
84
84
|
return await this.client.call('post', uri, {
|
|
85
85
|
'content-type': 'application/json',
|
|
86
86
|
}, payload);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
|
-
* Create
|
|
90
|
+
* Create user with Argon2 password
|
|
91
91
|
*
|
|
92
92
|
* Create a new user. Password provided must be hashed with the
|
|
93
93
|
* [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST
|
|
94
|
-
* /users](/docs/server/users#usersCreate) endpoint to
|
|
95
|
-
* plain text password.
|
|
94
|
+
* /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to
|
|
95
|
+
* create users with a plain text password.
|
|
96
96
|
*
|
|
97
97
|
* @param {string} userId
|
|
98
98
|
* @param {string} email
|
|
@@ -114,8 +114,8 @@ export class Users extends Service {
|
|
|
114
114
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
const apiPath = '/users/argon2';
|
|
118
|
+
const payload: Payload = {};
|
|
119
119
|
|
|
120
120
|
if (typeof userId !== 'undefined') {
|
|
121
121
|
payload['userId'] = userId;
|
|
@@ -133,19 +133,19 @@ export class Users extends Service {
|
|
|
133
133
|
payload['name'] = name;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
const uri = new URL(this.client.config.endpoint +
|
|
136
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
137
137
|
return await this.client.call('post', uri, {
|
|
138
138
|
'content-type': 'application/json',
|
|
139
139
|
}, payload);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
* Create
|
|
143
|
+
* Create user with bcrypt password
|
|
144
144
|
*
|
|
145
145
|
* Create a new user. Password provided must be hashed with the
|
|
146
146
|
* [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST
|
|
147
|
-
* /users](/docs/server/users#usersCreate) endpoint to
|
|
148
|
-
* plain text password.
|
|
147
|
+
* /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to
|
|
148
|
+
* create users with a plain text password.
|
|
149
149
|
*
|
|
150
150
|
* @param {string} userId
|
|
151
151
|
* @param {string} email
|
|
@@ -167,8 +167,8 @@ export class Users extends Service {
|
|
|
167
167
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
const apiPath = '/users/bcrypt';
|
|
171
|
+
const payload: Payload = {};
|
|
172
172
|
|
|
173
173
|
if (typeof userId !== 'undefined') {
|
|
174
174
|
payload['userId'] = userId;
|
|
@@ -186,7 +186,7 @@ export class Users extends Service {
|
|
|
186
186
|
payload['name'] = name;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
const uri = new URL(this.client.config.endpoint +
|
|
189
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
190
190
|
return await this.client.call('post', uri, {
|
|
191
191
|
'content-type': 'application/json',
|
|
192
192
|
}, payload);
|
|
@@ -203,8 +203,8 @@ export class Users extends Service {
|
|
|
203
203
|
* @returns {Promise}
|
|
204
204
|
*/
|
|
205
205
|
async listIdentities(queries?: string, search?: string): Promise<Models.IdentityList> {
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
const apiPath = '/users/identities';
|
|
207
|
+
const payload: Payload = {};
|
|
208
208
|
|
|
209
209
|
if (typeof queries !== 'undefined') {
|
|
210
210
|
payload['queries'] = queries;
|
|
@@ -214,7 +214,7 @@ export class Users extends Service {
|
|
|
214
214
|
payload['search'] = search;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
const uri = new URL(this.client.config.endpoint +
|
|
217
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
218
218
|
return await this.client.call('get', uri, {
|
|
219
219
|
'content-type': 'application/json',
|
|
220
220
|
}, payload);
|
|
@@ -234,22 +234,22 @@ export class Users extends Service {
|
|
|
234
234
|
throw new AppwriteException('Missing required parameter: "identityId"');
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
const apiPath = '/users/identities/{identityId}'.replace('{identityId}', identityId);
|
|
238
|
+
const payload: Payload = {};
|
|
239
239
|
|
|
240
|
-
const uri = new URL(this.client.config.endpoint +
|
|
240
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
241
241
|
return await this.client.call('delete', uri, {
|
|
242
242
|
'content-type': 'application/json',
|
|
243
243
|
}, payload);
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
/**
|
|
247
|
-
* Create
|
|
247
|
+
* Create user with MD5 password
|
|
248
248
|
*
|
|
249
249
|
* Create a new user. Password provided must be hashed with the
|
|
250
250
|
* [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST
|
|
251
|
-
* /users](/docs/server/users#usersCreate) endpoint to
|
|
252
|
-
* plain text password.
|
|
251
|
+
* /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to
|
|
252
|
+
* create users with a plain text password.
|
|
253
253
|
*
|
|
254
254
|
* @param {string} userId
|
|
255
255
|
* @param {string} email
|
|
@@ -271,8 +271,8 @@ export class Users extends Service {
|
|
|
271
271
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
const apiPath = '/users/md5';
|
|
275
|
+
const payload: Payload = {};
|
|
276
276
|
|
|
277
277
|
if (typeof userId !== 'undefined') {
|
|
278
278
|
payload['userId'] = userId;
|
|
@@ -290,19 +290,19 @@ export class Users extends Service {
|
|
|
290
290
|
payload['name'] = name;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
const uri = new URL(this.client.config.endpoint +
|
|
293
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
294
294
|
return await this.client.call('post', uri, {
|
|
295
295
|
'content-type': 'application/json',
|
|
296
296
|
}, payload);
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
/**
|
|
300
|
-
* Create
|
|
300
|
+
* Create user with PHPass password
|
|
301
301
|
*
|
|
302
302
|
* Create a new user. Password provided must be hashed with the
|
|
303
303
|
* [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST
|
|
304
|
-
* /users](/docs/server/users#usersCreate) endpoint to
|
|
305
|
-
* plain text password.
|
|
304
|
+
* /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to
|
|
305
|
+
* create users with a plain text password.
|
|
306
306
|
*
|
|
307
307
|
* @param {string} userId
|
|
308
308
|
* @param {string} email
|
|
@@ -324,8 +324,8 @@ export class Users extends Service {
|
|
|
324
324
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
|
|
328
|
-
|
|
327
|
+
const apiPath = '/users/phpass';
|
|
328
|
+
const payload: Payload = {};
|
|
329
329
|
|
|
330
330
|
if (typeof userId !== 'undefined') {
|
|
331
331
|
payload['userId'] = userId;
|
|
@@ -343,19 +343,19 @@ export class Users extends Service {
|
|
|
343
343
|
payload['name'] = name;
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
const uri = new URL(this.client.config.endpoint +
|
|
346
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
347
347
|
return await this.client.call('post', uri, {
|
|
348
348
|
'content-type': 'application/json',
|
|
349
349
|
}, payload);
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
/**
|
|
353
|
-
* Create
|
|
353
|
+
* Create user with Scrypt password
|
|
354
354
|
*
|
|
355
355
|
* Create a new user. Password provided must be hashed with the
|
|
356
356
|
* [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST
|
|
357
|
-
* /users](/docs/server/users#usersCreate) endpoint to
|
|
358
|
-
* plain text password.
|
|
357
|
+
* /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to
|
|
358
|
+
* create users with a plain text password.
|
|
359
359
|
*
|
|
360
360
|
* @param {string} userId
|
|
361
361
|
* @param {string} email
|
|
@@ -402,8 +402,8 @@ export class Users extends Service {
|
|
|
402
402
|
throw new AppwriteException('Missing required parameter: "passwordLength"');
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
-
|
|
406
|
-
|
|
405
|
+
const apiPath = '/users/scrypt';
|
|
406
|
+
const payload: Payload = {};
|
|
407
407
|
|
|
408
408
|
if (typeof userId !== 'undefined') {
|
|
409
409
|
payload['userId'] = userId;
|
|
@@ -441,19 +441,20 @@ export class Users extends Service {
|
|
|
441
441
|
payload['name'] = name;
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
-
const uri = new URL(this.client.config.endpoint +
|
|
444
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
445
445
|
return await this.client.call('post', uri, {
|
|
446
446
|
'content-type': 'application/json',
|
|
447
447
|
}, payload);
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
/**
|
|
451
|
-
* Create
|
|
451
|
+
* Create user with Scrypt modified password
|
|
452
452
|
*
|
|
453
453
|
* Create a new user. Password provided must be hashed with the [Scrypt
|
|
454
454
|
* Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc)
|
|
455
|
-
* algorithm. Use the [POST
|
|
456
|
-
*
|
|
455
|
+
* algorithm. Use the [POST
|
|
456
|
+
* /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to
|
|
457
|
+
* create users with a plain text password.
|
|
457
458
|
*
|
|
458
459
|
* @param {string} userId
|
|
459
460
|
* @param {string} email
|
|
@@ -490,8 +491,8 @@ export class Users extends Service {
|
|
|
490
491
|
throw new AppwriteException('Missing required parameter: "passwordSignerKey"');
|
|
491
492
|
}
|
|
492
493
|
|
|
493
|
-
|
|
494
|
-
|
|
494
|
+
const apiPath = '/users/scrypt-modified';
|
|
495
|
+
const payload: Payload = {};
|
|
495
496
|
|
|
496
497
|
if (typeof userId !== 'undefined') {
|
|
497
498
|
payload['userId'] = userId;
|
|
@@ -521,19 +522,19 @@ export class Users extends Service {
|
|
|
521
522
|
payload['name'] = name;
|
|
522
523
|
}
|
|
523
524
|
|
|
524
|
-
const uri = new URL(this.client.config.endpoint +
|
|
525
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
525
526
|
return await this.client.call('post', uri, {
|
|
526
527
|
'content-type': 'application/json',
|
|
527
528
|
}, payload);
|
|
528
529
|
}
|
|
529
530
|
|
|
530
531
|
/**
|
|
531
|
-
* Create
|
|
532
|
+
* Create user with SHA password
|
|
532
533
|
*
|
|
533
534
|
* Create a new user. Password provided must be hashed with the
|
|
534
535
|
* [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use
|
|
535
|
-
* the [POST /users](/docs/server/users#usersCreate)
|
|
536
|
-
* with a plain text password.
|
|
536
|
+
* the [POST /users](https://appwrite.io/docs/server/users#usersCreate)
|
|
537
|
+
* endpoint to create users with a plain text password.
|
|
537
538
|
*
|
|
538
539
|
* @param {string} userId
|
|
539
540
|
* @param {string} email
|
|
@@ -556,8 +557,8 @@ export class Users extends Service {
|
|
|
556
557
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
557
558
|
}
|
|
558
559
|
|
|
559
|
-
|
|
560
|
-
|
|
560
|
+
const apiPath = '/users/sha';
|
|
561
|
+
const payload: Payload = {};
|
|
561
562
|
|
|
562
563
|
if (typeof userId !== 'undefined') {
|
|
563
564
|
payload['userId'] = userId;
|
|
@@ -579,7 +580,7 @@ export class Users extends Service {
|
|
|
579
580
|
payload['name'] = name;
|
|
580
581
|
}
|
|
581
582
|
|
|
582
|
-
const uri = new URL(this.client.config.endpoint +
|
|
583
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
583
584
|
return await this.client.call('post', uri, {
|
|
584
585
|
'content-type': 'application/json',
|
|
585
586
|
}, payload);
|
|
@@ -590,30 +591,25 @@ export class Users extends Service {
|
|
|
590
591
|
*
|
|
591
592
|
*
|
|
592
593
|
* @param {string} range
|
|
593
|
-
* @param {string} provider
|
|
594
594
|
* @throws {AppwriteException}
|
|
595
595
|
* @returns {Promise}
|
|
596
596
|
*/
|
|
597
|
-
async getUsage(range?: string
|
|
598
|
-
|
|
599
|
-
|
|
597
|
+
async getUsage(range?: string): Promise<Models.UsageUsers> {
|
|
598
|
+
const apiPath = '/users/usage';
|
|
599
|
+
const payload: Payload = {};
|
|
600
600
|
|
|
601
601
|
if (typeof range !== 'undefined') {
|
|
602
602
|
payload['range'] = range;
|
|
603
603
|
}
|
|
604
604
|
|
|
605
|
-
|
|
606
|
-
payload['provider'] = provider;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
const uri = new URL(this.client.config.endpoint + path);
|
|
605
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
610
606
|
return await this.client.call('get', uri, {
|
|
611
607
|
'content-type': 'application/json',
|
|
612
608
|
}, payload);
|
|
613
609
|
}
|
|
614
610
|
|
|
615
611
|
/**
|
|
616
|
-
* Get
|
|
612
|
+
* Get user
|
|
617
613
|
*
|
|
618
614
|
* Get a user by its unique ID.
|
|
619
615
|
*
|
|
@@ -626,22 +622,23 @@ export class Users extends Service {
|
|
|
626
622
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
627
623
|
}
|
|
628
624
|
|
|
629
|
-
|
|
630
|
-
|
|
625
|
+
const apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
626
|
+
const payload: Payload = {};
|
|
631
627
|
|
|
632
|
-
const uri = new URL(this.client.config.endpoint +
|
|
628
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
633
629
|
return await this.client.call('get', uri, {
|
|
634
630
|
'content-type': 'application/json',
|
|
635
631
|
}, payload);
|
|
636
632
|
}
|
|
637
633
|
|
|
638
634
|
/**
|
|
639
|
-
* Delete
|
|
635
|
+
* Delete user
|
|
640
636
|
*
|
|
641
637
|
* Delete a user by its unique ID, thereby releasing it's ID. Since ID is
|
|
642
638
|
* released and can be reused, all user-related resources like documents or
|
|
643
639
|
* storage files should be deleted before user deletion. If you want to keep
|
|
644
|
-
* ID reserved, use the
|
|
640
|
+
* ID reserved, use the
|
|
641
|
+
* [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus)
|
|
645
642
|
* endpoint instead.
|
|
646
643
|
*
|
|
647
644
|
* @param {string} userId
|
|
@@ -653,17 +650,17 @@ export class Users extends Service {
|
|
|
653
650
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
654
651
|
}
|
|
655
652
|
|
|
656
|
-
|
|
657
|
-
|
|
653
|
+
const apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
654
|
+
const payload: Payload = {};
|
|
658
655
|
|
|
659
|
-
const uri = new URL(this.client.config.endpoint +
|
|
656
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
660
657
|
return await this.client.call('delete', uri, {
|
|
661
658
|
'content-type': 'application/json',
|
|
662
659
|
}, payload);
|
|
663
660
|
}
|
|
664
661
|
|
|
665
662
|
/**
|
|
666
|
-
* Update
|
|
663
|
+
* Update email
|
|
667
664
|
*
|
|
668
665
|
* Update the user email by its unique ID.
|
|
669
666
|
*
|
|
@@ -681,28 +678,28 @@ export class Users extends Service {
|
|
|
681
678
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
682
679
|
}
|
|
683
680
|
|
|
684
|
-
|
|
685
|
-
|
|
681
|
+
const apiPath = '/users/{userId}/email'.replace('{userId}', userId);
|
|
682
|
+
const payload: Payload = {};
|
|
686
683
|
|
|
687
684
|
if (typeof email !== 'undefined') {
|
|
688
685
|
payload['email'] = email;
|
|
689
686
|
}
|
|
690
687
|
|
|
691
|
-
const uri = new URL(this.client.config.endpoint +
|
|
688
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
692
689
|
return await this.client.call('patch', uri, {
|
|
693
690
|
'content-type': 'application/json',
|
|
694
691
|
}, payload);
|
|
695
692
|
}
|
|
696
693
|
|
|
697
694
|
/**
|
|
698
|
-
* Update
|
|
695
|
+
* Update user labels
|
|
699
696
|
*
|
|
700
697
|
* Update the user labels by its unique ID.
|
|
701
698
|
*
|
|
702
699
|
* Labels can be used to grant access to resources. While teams are a way for
|
|
703
700
|
* user's to share access to a resource, labels can be defined by the
|
|
704
701
|
* developer to grant access without an invitation. See the [Permissions
|
|
705
|
-
* docs](/docs/permissions) for more info.
|
|
702
|
+
* docs](https://appwrite.io/docs/permissions) for more info.
|
|
706
703
|
*
|
|
707
704
|
* @param {string} userId
|
|
708
705
|
* @param {string[]} labels
|
|
@@ -718,21 +715,21 @@ export class Users extends Service {
|
|
|
718
715
|
throw new AppwriteException('Missing required parameter: "labels"');
|
|
719
716
|
}
|
|
720
717
|
|
|
721
|
-
|
|
722
|
-
|
|
718
|
+
const apiPath = '/users/{userId}/labels'.replace('{userId}', userId);
|
|
719
|
+
const payload: Payload = {};
|
|
723
720
|
|
|
724
721
|
if (typeof labels !== 'undefined') {
|
|
725
722
|
payload['labels'] = labels;
|
|
726
723
|
}
|
|
727
724
|
|
|
728
|
-
const uri = new URL(this.client.config.endpoint +
|
|
725
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
729
726
|
return await this.client.call('put', uri, {
|
|
730
727
|
'content-type': 'application/json',
|
|
731
728
|
}, payload);
|
|
732
729
|
}
|
|
733
730
|
|
|
734
731
|
/**
|
|
735
|
-
* List
|
|
732
|
+
* List user logs
|
|
736
733
|
*
|
|
737
734
|
* Get the user activity logs list by its unique ID.
|
|
738
735
|
*
|
|
@@ -746,21 +743,21 @@ export class Users extends Service {
|
|
|
746
743
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
747
744
|
}
|
|
748
745
|
|
|
749
|
-
|
|
750
|
-
|
|
746
|
+
const apiPath = '/users/{userId}/logs'.replace('{userId}', userId);
|
|
747
|
+
const payload: Payload = {};
|
|
751
748
|
|
|
752
749
|
if (typeof queries !== 'undefined') {
|
|
753
750
|
payload['queries'] = queries;
|
|
754
751
|
}
|
|
755
752
|
|
|
756
|
-
const uri = new URL(this.client.config.endpoint +
|
|
753
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
757
754
|
return await this.client.call('get', uri, {
|
|
758
755
|
'content-type': 'application/json',
|
|
759
756
|
}, payload);
|
|
760
757
|
}
|
|
761
758
|
|
|
762
759
|
/**
|
|
763
|
-
* List
|
|
760
|
+
* List user memberships
|
|
764
761
|
*
|
|
765
762
|
* Get the user membership list by its unique ID.
|
|
766
763
|
*
|
|
@@ -773,17 +770,17 @@ export class Users extends Service {
|
|
|
773
770
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
774
771
|
}
|
|
775
772
|
|
|
776
|
-
|
|
777
|
-
|
|
773
|
+
const apiPath = '/users/{userId}/memberships'.replace('{userId}', userId);
|
|
774
|
+
const payload: Payload = {};
|
|
778
775
|
|
|
779
|
-
const uri = new URL(this.client.config.endpoint +
|
|
776
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
780
777
|
return await this.client.call('get', uri, {
|
|
781
778
|
'content-type': 'application/json',
|
|
782
779
|
}, payload);
|
|
783
780
|
}
|
|
784
781
|
|
|
785
782
|
/**
|
|
786
|
-
* Update
|
|
783
|
+
* Update name
|
|
787
784
|
*
|
|
788
785
|
* Update the user name by its unique ID.
|
|
789
786
|
*
|
|
@@ -801,21 +798,21 @@ export class Users extends Service {
|
|
|
801
798
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
802
799
|
}
|
|
803
800
|
|
|
804
|
-
|
|
805
|
-
|
|
801
|
+
const apiPath = '/users/{userId}/name'.replace('{userId}', userId);
|
|
802
|
+
const payload: Payload = {};
|
|
806
803
|
|
|
807
804
|
if (typeof name !== 'undefined') {
|
|
808
805
|
payload['name'] = name;
|
|
809
806
|
}
|
|
810
807
|
|
|
811
|
-
const uri = new URL(this.client.config.endpoint +
|
|
808
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
812
809
|
return await this.client.call('patch', uri, {
|
|
813
810
|
'content-type': 'application/json',
|
|
814
811
|
}, payload);
|
|
815
812
|
}
|
|
816
813
|
|
|
817
814
|
/**
|
|
818
|
-
* Update
|
|
815
|
+
* Update password
|
|
819
816
|
*
|
|
820
817
|
* Update the user password by its unique ID.
|
|
821
818
|
*
|
|
@@ -833,21 +830,21 @@ export class Users extends Service {
|
|
|
833
830
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
834
831
|
}
|
|
835
832
|
|
|
836
|
-
|
|
837
|
-
|
|
833
|
+
const apiPath = '/users/{userId}/password'.replace('{userId}', userId);
|
|
834
|
+
const payload: Payload = {};
|
|
838
835
|
|
|
839
836
|
if (typeof password !== 'undefined') {
|
|
840
837
|
payload['password'] = password;
|
|
841
838
|
}
|
|
842
839
|
|
|
843
|
-
const uri = new URL(this.client.config.endpoint +
|
|
840
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
844
841
|
return await this.client.call('patch', uri, {
|
|
845
842
|
'content-type': 'application/json',
|
|
846
843
|
}, payload);
|
|
847
844
|
}
|
|
848
845
|
|
|
849
846
|
/**
|
|
850
|
-
* Update
|
|
847
|
+
* Update phone
|
|
851
848
|
*
|
|
852
849
|
* Update the user phone by its unique ID.
|
|
853
850
|
*
|
|
@@ -865,21 +862,21 @@ export class Users extends Service {
|
|
|
865
862
|
throw new AppwriteException('Missing required parameter: "number"');
|
|
866
863
|
}
|
|
867
864
|
|
|
868
|
-
|
|
869
|
-
|
|
865
|
+
const apiPath = '/users/{userId}/phone'.replace('{userId}', userId);
|
|
866
|
+
const payload: Payload = {};
|
|
870
867
|
|
|
871
868
|
if (typeof number !== 'undefined') {
|
|
872
869
|
payload['number'] = number;
|
|
873
870
|
}
|
|
874
871
|
|
|
875
|
-
const uri = new URL(this.client.config.endpoint +
|
|
872
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
876
873
|
return await this.client.call('patch', uri, {
|
|
877
874
|
'content-type': 'application/json',
|
|
878
875
|
}, payload);
|
|
879
876
|
}
|
|
880
877
|
|
|
881
878
|
/**
|
|
882
|
-
* Get
|
|
879
|
+
* Get user preferences
|
|
883
880
|
*
|
|
884
881
|
* Get the user preferences by its unique ID.
|
|
885
882
|
*
|
|
@@ -892,17 +889,17 @@ export class Users extends Service {
|
|
|
892
889
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
893
890
|
}
|
|
894
891
|
|
|
895
|
-
|
|
896
|
-
|
|
892
|
+
const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
893
|
+
const payload: Payload = {};
|
|
897
894
|
|
|
898
|
-
const uri = new URL(this.client.config.endpoint +
|
|
895
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
899
896
|
return await this.client.call('get', uri, {
|
|
900
897
|
'content-type': 'application/json',
|
|
901
898
|
}, payload);
|
|
902
899
|
}
|
|
903
900
|
|
|
904
901
|
/**
|
|
905
|
-
* Update
|
|
902
|
+
* Update user preferences
|
|
906
903
|
*
|
|
907
904
|
* Update the user preferences by its unique ID. The object you pass is stored
|
|
908
905
|
* as is, and replaces any previous value. The maximum allowed prefs size is
|
|
@@ -922,21 +919,21 @@ export class Users extends Service {
|
|
|
922
919
|
throw new AppwriteException('Missing required parameter: "prefs"');
|
|
923
920
|
}
|
|
924
921
|
|
|
925
|
-
|
|
926
|
-
|
|
922
|
+
const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
923
|
+
const payload: Payload = {};
|
|
927
924
|
|
|
928
925
|
if (typeof prefs !== 'undefined') {
|
|
929
926
|
payload['prefs'] = prefs;
|
|
930
927
|
}
|
|
931
928
|
|
|
932
|
-
const uri = new URL(this.client.config.endpoint +
|
|
929
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
933
930
|
return await this.client.call('patch', uri, {
|
|
934
931
|
'content-type': 'application/json',
|
|
935
932
|
}, payload);
|
|
936
933
|
}
|
|
937
934
|
|
|
938
935
|
/**
|
|
939
|
-
* List
|
|
936
|
+
* List user sessions
|
|
940
937
|
*
|
|
941
938
|
* Get the user sessions list by its unique ID.
|
|
942
939
|
*
|
|
@@ -949,17 +946,17 @@ export class Users extends Service {
|
|
|
949
946
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
950
947
|
}
|
|
951
948
|
|
|
952
|
-
|
|
953
|
-
|
|
949
|
+
const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
950
|
+
const payload: Payload = {};
|
|
954
951
|
|
|
955
|
-
const uri = new URL(this.client.config.endpoint +
|
|
952
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
956
953
|
return await this.client.call('get', uri, {
|
|
957
954
|
'content-type': 'application/json',
|
|
958
955
|
}, payload);
|
|
959
956
|
}
|
|
960
957
|
|
|
961
958
|
/**
|
|
962
|
-
* Delete
|
|
959
|
+
* Delete user sessions
|
|
963
960
|
*
|
|
964
961
|
* Delete all user's sessions by using the user's unique ID.
|
|
965
962
|
*
|
|
@@ -972,17 +969,17 @@ export class Users extends Service {
|
|
|
972
969
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
973
970
|
}
|
|
974
971
|
|
|
975
|
-
|
|
976
|
-
|
|
972
|
+
const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
973
|
+
const payload: Payload = {};
|
|
977
974
|
|
|
978
|
-
const uri = new URL(this.client.config.endpoint +
|
|
975
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
979
976
|
return await this.client.call('delete', uri, {
|
|
980
977
|
'content-type': 'application/json',
|
|
981
978
|
}, payload);
|
|
982
979
|
}
|
|
983
980
|
|
|
984
981
|
/**
|
|
985
|
-
* Delete
|
|
982
|
+
* Delete user session
|
|
986
983
|
*
|
|
987
984
|
* Delete a user sessions by its unique ID.
|
|
988
985
|
*
|
|
@@ -1000,17 +997,17 @@ export class Users extends Service {
|
|
|
1000
997
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1001
998
|
}
|
|
1002
999
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1000
|
+
const apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId);
|
|
1001
|
+
const payload: Payload = {};
|
|
1005
1002
|
|
|
1006
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1003
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1007
1004
|
return await this.client.call('delete', uri, {
|
|
1008
1005
|
'content-type': 'application/json',
|
|
1009
1006
|
}, payload);
|
|
1010
1007
|
}
|
|
1011
1008
|
|
|
1012
1009
|
/**
|
|
1013
|
-
* Update
|
|
1010
|
+
* Update user status
|
|
1014
1011
|
*
|
|
1015
1012
|
* Update the user status by its unique ID. Use this endpoint as an
|
|
1016
1013
|
* alternative to deleting a user if you want to keep user's ID reserved.
|
|
@@ -1029,21 +1026,21 @@ export class Users extends Service {
|
|
|
1029
1026
|
throw new AppwriteException('Missing required parameter: "status"');
|
|
1030
1027
|
}
|
|
1031
1028
|
|
|
1032
|
-
|
|
1033
|
-
|
|
1029
|
+
const apiPath = '/users/{userId}/status'.replace('{userId}', userId);
|
|
1030
|
+
const payload: Payload = {};
|
|
1034
1031
|
|
|
1035
1032
|
if (typeof status !== 'undefined') {
|
|
1036
1033
|
payload['status'] = status;
|
|
1037
1034
|
}
|
|
1038
1035
|
|
|
1039
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1036
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1040
1037
|
return await this.client.call('patch', uri, {
|
|
1041
1038
|
'content-type': 'application/json',
|
|
1042
1039
|
}, payload);
|
|
1043
1040
|
}
|
|
1044
1041
|
|
|
1045
1042
|
/**
|
|
1046
|
-
* Update
|
|
1043
|
+
* Update email verification
|
|
1047
1044
|
*
|
|
1048
1045
|
* Update the user email verification status by its unique ID.
|
|
1049
1046
|
*
|
|
@@ -1061,21 +1058,21 @@ export class Users extends Service {
|
|
|
1061
1058
|
throw new AppwriteException('Missing required parameter: "emailVerification"');
|
|
1062
1059
|
}
|
|
1063
1060
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1061
|
+
const apiPath = '/users/{userId}/verification'.replace('{userId}', userId);
|
|
1062
|
+
const payload: Payload = {};
|
|
1066
1063
|
|
|
1067
1064
|
if (typeof emailVerification !== 'undefined') {
|
|
1068
1065
|
payload['emailVerification'] = emailVerification;
|
|
1069
1066
|
}
|
|
1070
1067
|
|
|
1071
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1068
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1072
1069
|
return await this.client.call('patch', uri, {
|
|
1073
1070
|
'content-type': 'application/json',
|
|
1074
1071
|
}, payload);
|
|
1075
1072
|
}
|
|
1076
1073
|
|
|
1077
1074
|
/**
|
|
1078
|
-
* Update
|
|
1075
|
+
* Update phone verification
|
|
1079
1076
|
*
|
|
1080
1077
|
* Update the user phone verification status by its unique ID.
|
|
1081
1078
|
*
|
|
@@ -1093,14 +1090,14 @@ export class Users extends Service {
|
|
|
1093
1090
|
throw new AppwriteException('Missing required parameter: "phoneVerification"');
|
|
1094
1091
|
}
|
|
1095
1092
|
|
|
1096
|
-
|
|
1097
|
-
|
|
1093
|
+
const apiPath = '/users/{userId}/verification/phone'.replace('{userId}', userId);
|
|
1094
|
+
const payload: Payload = {};
|
|
1098
1095
|
|
|
1099
1096
|
if (typeof phoneVerification !== 'undefined') {
|
|
1100
1097
|
payload['phoneVerification'] = phoneVerification;
|
|
1101
1098
|
}
|
|
1102
1099
|
|
|
1103
|
-
const uri = new URL(this.client.config.endpoint +
|
|
1100
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1104
1101
|
return await this.client.call('patch', uri, {
|
|
1105
1102
|
'content-type': 'application/json',
|
|
1106
1103
|
}, payload);
|