@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/teams.ts
CHANGED
|
@@ -11,7 +11,7 @@ export class Teams extends Service {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* List
|
|
14
|
+
* List teams
|
|
15
15
|
*
|
|
16
16
|
* Get a list of all the teams in which the current user is a member. You can
|
|
17
17
|
* use the parameters to filter your results.
|
|
@@ -22,8 +22,8 @@ export class Teams extends Service {
|
|
|
22
22
|
* @returns {Promise}
|
|
23
23
|
*/
|
|
24
24
|
async list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>> {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const apiPath = '/teams';
|
|
26
|
+
const payload: Payload = {};
|
|
27
27
|
|
|
28
28
|
if (typeof queries !== 'undefined') {
|
|
29
29
|
payload['queries'] = queries;
|
|
@@ -33,14 +33,14 @@ export class Teams 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 team
|
|
44
44
|
*
|
|
45
45
|
* Create a new team. The user who creates the team will automatically be
|
|
46
46
|
* assigned as the owner of the team. Only the users with the owner role can
|
|
@@ -61,8 +61,8 @@ export class Teams extends Service {
|
|
|
61
61
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
const apiPath = '/teams';
|
|
65
|
+
const payload: Payload = {};
|
|
66
66
|
|
|
67
67
|
if (typeof teamId !== 'undefined') {
|
|
68
68
|
payload['teamId'] = teamId;
|
|
@@ -76,14 +76,14 @@ export class Teams extends Service {
|
|
|
76
76
|
payload['roles'] = roles;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
const uri = new URL(this.client.config.endpoint +
|
|
79
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
80
80
|
return await this.client.call('post', uri, {
|
|
81
81
|
'content-type': 'application/json',
|
|
82
82
|
}, payload);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* Get
|
|
86
|
+
* Get team
|
|
87
87
|
*
|
|
88
88
|
* Get a team by its ID. All team members have read access for this resource.
|
|
89
89
|
*
|
|
@@ -96,17 +96,17 @@ export class Teams extends Service {
|
|
|
96
96
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
|
|
100
|
+
const payload: Payload = {};
|
|
101
101
|
|
|
102
|
-
const uri = new URL(this.client.config.endpoint +
|
|
102
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
103
103
|
return await this.client.call('get', uri, {
|
|
104
104
|
'content-type': 'application/json',
|
|
105
105
|
}, payload);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* Update
|
|
109
|
+
* Update name
|
|
110
110
|
*
|
|
111
111
|
* Update the team's name by its unique ID.
|
|
112
112
|
*
|
|
@@ -124,21 +124,21 @@ export class Teams extends Service {
|
|
|
124
124
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
|
|
128
|
+
const payload: Payload = {};
|
|
129
129
|
|
|
130
130
|
if (typeof name !== 'undefined') {
|
|
131
131
|
payload['name'] = name;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
const uri = new URL(this.client.config.endpoint +
|
|
134
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
135
135
|
return await this.client.call('put', uri, {
|
|
136
136
|
'content-type': 'application/json',
|
|
137
137
|
}, payload);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
|
-
* Delete
|
|
141
|
+
* Delete team
|
|
142
142
|
*
|
|
143
143
|
* Delete a team using its ID. Only team members with the owner role can
|
|
144
144
|
* delete the team.
|
|
@@ -152,17 +152,17 @@ export class Teams extends Service {
|
|
|
152
152
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
|
|
156
|
+
const payload: Payload = {};
|
|
157
157
|
|
|
158
|
-
const uri = new URL(this.client.config.endpoint +
|
|
158
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
159
159
|
return await this.client.call('delete', uri, {
|
|
160
160
|
'content-type': 'application/json',
|
|
161
161
|
}, payload);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
|
-
* List
|
|
165
|
+
* List team logs
|
|
166
166
|
*
|
|
167
167
|
* Get the team activity logs list by its unique ID.
|
|
168
168
|
*
|
|
@@ -176,21 +176,21 @@ export class Teams extends Service {
|
|
|
176
176
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
const apiPath = '/teams/{teamId}/logs'.replace('{teamId}', teamId);
|
|
180
|
+
const payload: Payload = {};
|
|
181
181
|
|
|
182
182
|
if (typeof queries !== 'undefined') {
|
|
183
183
|
payload['queries'] = queries;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
const uri = new URL(this.client.config.endpoint +
|
|
186
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
187
187
|
return await this.client.call('get', uri, {
|
|
188
188
|
'content-type': 'application/json',
|
|
189
189
|
}, payload);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
|
-
* List
|
|
193
|
+
* List team memberships
|
|
194
194
|
*
|
|
195
195
|
* Use this endpoint to list a team's members using the team's ID. All team
|
|
196
196
|
* members have read access to this endpoint.
|
|
@@ -206,8 +206,8 @@ export class Teams extends Service {
|
|
|
206
206
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
|
|
210
|
+
const payload: Payload = {};
|
|
211
211
|
|
|
212
212
|
if (typeof queries !== 'undefined') {
|
|
213
213
|
payload['queries'] = queries;
|
|
@@ -217,14 +217,14 @@ export class Teams extends Service {
|
|
|
217
217
|
payload['search'] = search;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
const uri = new URL(this.client.config.endpoint +
|
|
220
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
221
221
|
return await this.client.call('get', uri, {
|
|
222
222
|
'content-type': 'application/json',
|
|
223
223
|
}, payload);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
/**
|
|
227
|
-
* Create
|
|
227
|
+
* Create team membership
|
|
228
228
|
*
|
|
229
229
|
* Invite a new member to join your team. Provide an ID for existing users, or
|
|
230
230
|
* invite unregistered users using an email or phone number. If initiated from
|
|
@@ -239,8 +239,8 @@ export class Teams extends Service {
|
|
|
239
239
|
*
|
|
240
240
|
* Use the `url` parameter to redirect the user from the invitation email to
|
|
241
241
|
* your app. After the user is redirected, use the [Update Team Membership
|
|
242
|
-
* Status](/docs/client/teams#
|
|
243
|
-
* the user to accept the invitation to the team.
|
|
242
|
+
* Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus)
|
|
243
|
+
* endpoint to allow the user to accept the invitation to the team.
|
|
244
244
|
*
|
|
245
245
|
* Please note that to avoid a [Redirect
|
|
246
246
|
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
|
@@ -250,15 +250,15 @@ export class Teams extends Service {
|
|
|
250
250
|
*
|
|
251
251
|
* @param {string} teamId
|
|
252
252
|
* @param {string[]} roles
|
|
253
|
-
* @param {string} url
|
|
254
253
|
* @param {string} email
|
|
255
254
|
* @param {string} userId
|
|
256
255
|
* @param {string} phone
|
|
256
|
+
* @param {string} url
|
|
257
257
|
* @param {string} name
|
|
258
258
|
* @throws {AppwriteException}
|
|
259
259
|
* @returns {Promise}
|
|
260
260
|
*/
|
|
261
|
-
async createMembership(teamId: string, roles: string[],
|
|
261
|
+
async createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership> {
|
|
262
262
|
if (typeof teamId === 'undefined') {
|
|
263
263
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
264
264
|
}
|
|
@@ -267,12 +267,8 @@ export class Teams extends Service {
|
|
|
267
267
|
throw new AppwriteException('Missing required parameter: "roles"');
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
let path = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
|
|
275
|
-
let payload: Payload = {};
|
|
270
|
+
const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
|
|
271
|
+
const payload: Payload = {};
|
|
276
272
|
|
|
277
273
|
if (typeof email !== 'undefined') {
|
|
278
274
|
payload['email'] = email;
|
|
@@ -298,14 +294,14 @@ export class Teams extends Service {
|
|
|
298
294
|
payload['name'] = name;
|
|
299
295
|
}
|
|
300
296
|
|
|
301
|
-
const uri = new URL(this.client.config.endpoint +
|
|
297
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
302
298
|
return await this.client.call('post', uri, {
|
|
303
299
|
'content-type': 'application/json',
|
|
304
300
|
}, payload);
|
|
305
301
|
}
|
|
306
302
|
|
|
307
303
|
/**
|
|
308
|
-
* Get
|
|
304
|
+
* Get team membership
|
|
309
305
|
*
|
|
310
306
|
* Get a team member by the membership unique id. All team members have read
|
|
311
307
|
* access for this resource.
|
|
@@ -324,21 +320,21 @@ export class Teams extends Service {
|
|
|
324
320
|
throw new AppwriteException('Missing required parameter: "membershipId"');
|
|
325
321
|
}
|
|
326
322
|
|
|
327
|
-
|
|
328
|
-
|
|
323
|
+
const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
324
|
+
const payload: Payload = {};
|
|
329
325
|
|
|
330
|
-
const uri = new URL(this.client.config.endpoint +
|
|
326
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
331
327
|
return await this.client.call('get', uri, {
|
|
332
328
|
'content-type': 'application/json',
|
|
333
329
|
}, payload);
|
|
334
330
|
}
|
|
335
331
|
|
|
336
332
|
/**
|
|
337
|
-
* Update
|
|
333
|
+
* Update membership
|
|
338
334
|
*
|
|
339
335
|
* Modify the roles of a team member. Only team members with the owner role
|
|
340
336
|
* have access to this endpoint. Learn more about [roles and
|
|
341
|
-
* permissions](/docs/permissions).
|
|
337
|
+
* permissions](https://appwrite.io/docs/permissions).
|
|
342
338
|
*
|
|
343
339
|
*
|
|
344
340
|
* @param {string} teamId
|
|
@@ -360,21 +356,21 @@ export class Teams extends Service {
|
|
|
360
356
|
throw new AppwriteException('Missing required parameter: "roles"');
|
|
361
357
|
}
|
|
362
358
|
|
|
363
|
-
|
|
364
|
-
|
|
359
|
+
const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
360
|
+
const payload: Payload = {};
|
|
365
361
|
|
|
366
362
|
if (typeof roles !== 'undefined') {
|
|
367
363
|
payload['roles'] = roles;
|
|
368
364
|
}
|
|
369
365
|
|
|
370
|
-
const uri = new URL(this.client.config.endpoint +
|
|
366
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
371
367
|
return await this.client.call('patch', uri, {
|
|
372
368
|
'content-type': 'application/json',
|
|
373
369
|
}, payload);
|
|
374
370
|
}
|
|
375
371
|
|
|
376
372
|
/**
|
|
377
|
-
* Delete
|
|
373
|
+
* Delete team membership
|
|
378
374
|
*
|
|
379
375
|
* This endpoint allows a user to leave a team or for a team owner to delete
|
|
380
376
|
* the membership of any other team member. You can also use this endpoint to
|
|
@@ -394,17 +390,17 @@ export class Teams extends Service {
|
|
|
394
390
|
throw new AppwriteException('Missing required parameter: "membershipId"');
|
|
395
391
|
}
|
|
396
392
|
|
|
397
|
-
|
|
398
|
-
|
|
393
|
+
const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
394
|
+
const payload: Payload = {};
|
|
399
395
|
|
|
400
|
-
const uri = new URL(this.client.config.endpoint +
|
|
396
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
401
397
|
return await this.client.call('delete', uri, {
|
|
402
398
|
'content-type': 'application/json',
|
|
403
399
|
}, payload);
|
|
404
400
|
}
|
|
405
401
|
|
|
406
402
|
/**
|
|
407
|
-
* Update
|
|
403
|
+
* Update team membership status
|
|
408
404
|
*
|
|
409
405
|
* Use this endpoint to allow a user to accept an invitation to join a team
|
|
410
406
|
* after being redirected back to your app from the invitation email received
|
|
@@ -438,8 +434,8 @@ export class Teams extends Service {
|
|
|
438
434
|
throw new AppwriteException('Missing required parameter: "secret"');
|
|
439
435
|
}
|
|
440
436
|
|
|
441
|
-
|
|
442
|
-
|
|
437
|
+
const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
438
|
+
const payload: Payload = {};
|
|
443
439
|
|
|
444
440
|
if (typeof userId !== 'undefined') {
|
|
445
441
|
payload['userId'] = userId;
|
|
@@ -449,18 +445,18 @@ export class Teams extends Service {
|
|
|
449
445
|
payload['secret'] = secret;
|
|
450
446
|
}
|
|
451
447
|
|
|
452
|
-
const uri = new URL(this.client.config.endpoint +
|
|
448
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
453
449
|
return await this.client.call('patch', uri, {
|
|
454
450
|
'content-type': 'application/json',
|
|
455
451
|
}, payload);
|
|
456
452
|
}
|
|
457
453
|
|
|
458
454
|
/**
|
|
459
|
-
* Get
|
|
455
|
+
* Get team preferences
|
|
460
456
|
*
|
|
461
457
|
* Get the team's shared preferences by its unique ID. If a preference doesn't
|
|
462
458
|
* need to be shared by all team members, prefer storing them in [user
|
|
463
|
-
* preferences](/docs/client/account#
|
|
459
|
+
* preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
|
464
460
|
*
|
|
465
461
|
* @param {string} teamId
|
|
466
462
|
* @throws {AppwriteException}
|
|
@@ -471,17 +467,17 @@ export class Teams extends Service {
|
|
|
471
467
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
472
468
|
}
|
|
473
469
|
|
|
474
|
-
|
|
475
|
-
|
|
470
|
+
const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
|
|
471
|
+
const payload: Payload = {};
|
|
476
472
|
|
|
477
|
-
const uri = new URL(this.client.config.endpoint +
|
|
473
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
478
474
|
return await this.client.call('get', uri, {
|
|
479
475
|
'content-type': 'application/json',
|
|
480
476
|
}, payload);
|
|
481
477
|
}
|
|
482
478
|
|
|
483
479
|
/**
|
|
484
|
-
* Update
|
|
480
|
+
* Update preferences
|
|
485
481
|
*
|
|
486
482
|
* Update the team's preferences by its unique ID. The object you pass is
|
|
487
483
|
* stored as is and replaces any previous value. The maximum allowed prefs
|
|
@@ -501,14 +497,14 @@ export class Teams extends Service {
|
|
|
501
497
|
throw new AppwriteException('Missing required parameter: "prefs"');
|
|
502
498
|
}
|
|
503
499
|
|
|
504
|
-
|
|
505
|
-
|
|
500
|
+
const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
|
|
501
|
+
const payload: Payload = {};
|
|
506
502
|
|
|
507
503
|
if (typeof prefs !== 'undefined') {
|
|
508
504
|
payload['prefs'] = prefs;
|
|
509
505
|
}
|
|
510
506
|
|
|
511
|
-
const uri = new URL(this.client.config.endpoint +
|
|
507
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
512
508
|
return await this.client.call('put', uri, {
|
|
513
509
|
'content-type': 'application/json',
|
|
514
510
|
}, payload);
|