appwrite-cli 5.0.5 → 6.0.0-rc.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/README.md +4 -4
- package/docs/examples/functions/create-build.md +1 -1
- package/docs/examples/functions/create-execution.md +1 -0
- package/docs/examples/functions/create.md +1 -0
- package/docs/examples/functions/delete-execution.md +3 -0
- package/docs/examples/functions/update-deployment-build.md +3 -0
- package/docs/examples/functions/update.md +1 -0
- package/docs/examples/projects/create-j-w-t.md +4 -0
- package/docs/examples/projects/update-mock-numbers.md +3 -0
- package/docs/examples/projects/update-session-alerts.md +3 -0
- package/docs/examples/users/create-j-w-t.md +4 -0
- package/docs/examples/vcs/get-repository-contents.md +4 -0
- package/index.js +34 -7
- package/install.ps1 +3 -3
- package/install.sh +2 -2
- package/lib/client.js +17 -3
- package/lib/commands/account.js +306 -152
- package/lib/commands/assistant.js +8 -5
- package/lib/commands/avatars.js +114 -58
- package/lib/commands/console.js +8 -5
- package/lib/commands/databases.js +353 -164
- package/lib/commands/functions.js +310 -100
- package/lib/commands/generic.js +206 -54
- package/lib/commands/graphql.js +14 -8
- package/lib/commands/health.js +140 -71
- package/lib/commands/init.js +250 -155
- package/lib/commands/locale.js +50 -26
- package/lib/commands/messaging.js +334 -156
- package/lib/commands/migrations.js +98 -50
- package/lib/commands/project.js +38 -20
- package/lib/commands/projects.js +449 -144
- package/lib/commands/proxy.js +32 -17
- package/lib/commands/pull.js +231 -0
- package/lib/commands/push.js +1518 -0
- package/lib/commands/run.js +282 -0
- package/lib/commands/storage.js +160 -76
- package/lib/commands/teams.js +102 -50
- package/lib/commands/users.js +324 -134
- package/lib/commands/vcs.js +102 -29
- package/lib/config.js +190 -18
- package/lib/emulation/docker.js +187 -0
- package/lib/emulation/utils.js +177 -0
- package/lib/id.js +30 -0
- package/lib/paginate.js +1 -2
- package/lib/parser.js +69 -12
- package/lib/questions.js +452 -80
- package/lib/sdks.js +1 -1
- package/lib/spinner.js +103 -0
- package/lib/utils.js +242 -4
- package/lib/validations.js +17 -0
- package/package.json +6 -2
- package/scoop/appwrite.json +3 -3
- package/lib/commands/deploy.js +0 -940
package/lib/commands/teams.js
CHANGED
|
@@ -4,7 +4,7 @@ const tar = require("tar");
|
|
|
4
4
|
const ignore = require("ignore");
|
|
5
5
|
const { promisify } = require('util');
|
|
6
6
|
const libClient = require('../client.js');
|
|
7
|
-
const { getAllFiles } = require('../utils.js');
|
|
7
|
+
const { getAllFiles, showConsoleLink } = require('../utils.js');
|
|
8
8
|
const { Command } = require('commander');
|
|
9
9
|
const { sdkForProject, sdkForConsole } = require('../sdks')
|
|
10
10
|
const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser')
|
|
@@ -43,6 +43,7 @@ const teams = new Command("teams").description(commandDescriptions['teams']).con
|
|
|
43
43
|
* @typedef {Object} TeamsListRequestParams
|
|
44
44
|
* @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan
|
|
45
45
|
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
46
|
+
* @property {boolean} overrideForCli
|
|
46
47
|
* @property {boolean} parseOutput
|
|
47
48
|
* @property {libClient | undefined} sdk
|
|
48
49
|
*/
|
|
@@ -50,8 +51,9 @@ const teams = new Command("teams").description(commandDescriptions['teams']).con
|
|
|
50
51
|
/**
|
|
51
52
|
* @param {TeamsListRequestParams} params
|
|
52
53
|
*/
|
|
53
|
-
const teamsList = async ({
|
|
54
|
-
let client = !sdk ? await sdkForProject() :
|
|
54
|
+
const teamsList = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
55
|
+
let client = !sdk ? await sdkForProject() :
|
|
56
|
+
sdk;
|
|
55
57
|
let apiPath = '/teams';
|
|
56
58
|
let payload = {};
|
|
57
59
|
if (typeof queries !== 'undefined') {
|
|
@@ -68,11 +70,16 @@ const teamsList = async ({ queries, search, parseOutput = true, sdk = undefined}
|
|
|
68
70
|
}, payload);
|
|
69
71
|
|
|
70
72
|
if (parseOutput) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
if(console) {
|
|
74
|
+
showConsoleLink('teams', 'list');
|
|
75
|
+
} else {
|
|
76
|
+
parse(response)
|
|
77
|
+
success()
|
|
78
|
+
}
|
|
73
79
|
}
|
|
74
|
-
|
|
80
|
+
|
|
75
81
|
return response;
|
|
82
|
+
|
|
76
83
|
}
|
|
77
84
|
|
|
78
85
|
/**
|
|
@@ -80,6 +87,7 @@ const teamsList = async ({ queries, search, parseOutput = true, sdk = undefined}
|
|
|
80
87
|
* @property {string} teamId Team ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
81
88
|
* @property {string} name Team name. Max length: 128 chars.
|
|
82
89
|
* @property {string[]} roles Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
|
90
|
+
* @property {boolean} overrideForCli
|
|
83
91
|
* @property {boolean} parseOutput
|
|
84
92
|
* @property {libClient | undefined} sdk
|
|
85
93
|
*/
|
|
@@ -87,8 +95,9 @@ const teamsList = async ({ queries, search, parseOutput = true, sdk = undefined}
|
|
|
87
95
|
/**
|
|
88
96
|
* @param {TeamsCreateRequestParams} params
|
|
89
97
|
*/
|
|
90
|
-
const teamsCreate = async ({
|
|
91
|
-
let client = !sdk ? await sdkForProject() :
|
|
98
|
+
const teamsCreate = async ({teamId,name,roles,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
99
|
+
let client = !sdk ? await sdkForProject() :
|
|
100
|
+
sdk;
|
|
92
101
|
let apiPath = '/teams';
|
|
93
102
|
let payload = {};
|
|
94
103
|
if (typeof teamId !== 'undefined') {
|
|
@@ -112,13 +121,15 @@ const teamsCreate = async ({ teamId, name, roles, parseOutput = true, sdk = unde
|
|
|
112
121
|
parse(response)
|
|
113
122
|
success()
|
|
114
123
|
}
|
|
115
|
-
|
|
124
|
+
|
|
116
125
|
return response;
|
|
126
|
+
|
|
117
127
|
}
|
|
118
128
|
|
|
119
129
|
/**
|
|
120
130
|
* @typedef {Object} TeamsGetRequestParams
|
|
121
131
|
* @property {string} teamId Team ID.
|
|
132
|
+
* @property {boolean} overrideForCli
|
|
122
133
|
* @property {boolean} parseOutput
|
|
123
134
|
* @property {libClient | undefined} sdk
|
|
124
135
|
*/
|
|
@@ -126,8 +137,9 @@ const teamsCreate = async ({ teamId, name, roles, parseOutput = true, sdk = unde
|
|
|
126
137
|
/**
|
|
127
138
|
* @param {TeamsGetRequestParams} params
|
|
128
139
|
*/
|
|
129
|
-
const teamsGet = async ({
|
|
130
|
-
let client = !sdk ? await sdkForProject() :
|
|
140
|
+
const teamsGet = async ({teamId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
141
|
+
let client = !sdk ? await sdkForProject() :
|
|
142
|
+
sdk;
|
|
131
143
|
let apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
|
|
132
144
|
let payload = {};
|
|
133
145
|
|
|
@@ -138,17 +150,23 @@ const teamsGet = async ({ teamId, parseOutput = true, sdk = undefined}) => {
|
|
|
138
150
|
}, payload);
|
|
139
151
|
|
|
140
152
|
if (parseOutput) {
|
|
141
|
-
|
|
142
|
-
|
|
153
|
+
if(console) {
|
|
154
|
+
showConsoleLink('teams', 'get', teamId);
|
|
155
|
+
} else {
|
|
156
|
+
parse(response)
|
|
157
|
+
success()
|
|
158
|
+
}
|
|
143
159
|
}
|
|
144
|
-
|
|
160
|
+
|
|
145
161
|
return response;
|
|
162
|
+
|
|
146
163
|
}
|
|
147
164
|
|
|
148
165
|
/**
|
|
149
166
|
* @typedef {Object} TeamsUpdateNameRequestParams
|
|
150
167
|
* @property {string} teamId Team ID.
|
|
151
168
|
* @property {string} name New team name. Max length: 128 chars.
|
|
169
|
+
* @property {boolean} overrideForCli
|
|
152
170
|
* @property {boolean} parseOutput
|
|
153
171
|
* @property {libClient | undefined} sdk
|
|
154
172
|
*/
|
|
@@ -156,8 +174,9 @@ const teamsGet = async ({ teamId, parseOutput = true, sdk = undefined}) => {
|
|
|
156
174
|
/**
|
|
157
175
|
* @param {TeamsUpdateNameRequestParams} params
|
|
158
176
|
*/
|
|
159
|
-
const teamsUpdateName = async ({
|
|
160
|
-
let client = !sdk ? await sdkForProject() :
|
|
177
|
+
const teamsUpdateName = async ({teamId,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
178
|
+
let client = !sdk ? await sdkForProject() :
|
|
179
|
+
sdk;
|
|
161
180
|
let apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
|
|
162
181
|
let payload = {};
|
|
163
182
|
if (typeof name !== 'undefined') {
|
|
@@ -174,13 +193,15 @@ const teamsUpdateName = async ({ teamId, name, parseOutput = true, sdk = undefin
|
|
|
174
193
|
parse(response)
|
|
175
194
|
success()
|
|
176
195
|
}
|
|
177
|
-
|
|
196
|
+
|
|
178
197
|
return response;
|
|
198
|
+
|
|
179
199
|
}
|
|
180
200
|
|
|
181
201
|
/**
|
|
182
202
|
* @typedef {Object} TeamsDeleteRequestParams
|
|
183
203
|
* @property {string} teamId Team ID.
|
|
204
|
+
* @property {boolean} overrideForCli
|
|
184
205
|
* @property {boolean} parseOutput
|
|
185
206
|
* @property {libClient | undefined} sdk
|
|
186
207
|
*/
|
|
@@ -188,8 +209,9 @@ const teamsUpdateName = async ({ teamId, name, parseOutput = true, sdk = undefin
|
|
|
188
209
|
/**
|
|
189
210
|
* @param {TeamsDeleteRequestParams} params
|
|
190
211
|
*/
|
|
191
|
-
const teamsDelete = async ({
|
|
192
|
-
let client = !sdk ? await sdkForProject() :
|
|
212
|
+
const teamsDelete = async ({teamId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
213
|
+
let client = !sdk ? await sdkForProject() :
|
|
214
|
+
sdk;
|
|
193
215
|
let apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
|
|
194
216
|
let payload = {};
|
|
195
217
|
|
|
@@ -203,14 +225,16 @@ const teamsDelete = async ({ teamId, parseOutput = true, sdk = undefined}) => {
|
|
|
203
225
|
parse(response)
|
|
204
226
|
success()
|
|
205
227
|
}
|
|
206
|
-
|
|
228
|
+
|
|
207
229
|
return response;
|
|
230
|
+
|
|
208
231
|
}
|
|
209
232
|
|
|
210
233
|
/**
|
|
211
234
|
* @typedef {Object} TeamsListLogsRequestParams
|
|
212
235
|
* @property {string} teamId Team ID.
|
|
213
236
|
* @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
237
|
+
* @property {boolean} overrideForCli
|
|
214
238
|
* @property {boolean} parseOutput
|
|
215
239
|
* @property {libClient | undefined} sdk
|
|
216
240
|
*/
|
|
@@ -218,8 +242,9 @@ const teamsDelete = async ({ teamId, parseOutput = true, sdk = undefined}) => {
|
|
|
218
242
|
/**
|
|
219
243
|
* @param {TeamsListLogsRequestParams} params
|
|
220
244
|
*/
|
|
221
|
-
const teamsListLogs = async ({
|
|
222
|
-
let client = !sdk ? await sdkForProject() :
|
|
245
|
+
const teamsListLogs = async ({teamId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
246
|
+
let client = !sdk ? await sdkForProject() :
|
|
247
|
+
sdk;
|
|
223
248
|
let apiPath = '/teams/{teamId}/logs'.replace('{teamId}', teamId);
|
|
224
249
|
let payload = {};
|
|
225
250
|
if (typeof queries !== 'undefined') {
|
|
@@ -236,8 +261,9 @@ const teamsListLogs = async ({ teamId, queries, parseOutput = true, sdk = undefi
|
|
|
236
261
|
parse(response)
|
|
237
262
|
success()
|
|
238
263
|
}
|
|
239
|
-
|
|
264
|
+
|
|
240
265
|
return response;
|
|
266
|
+
|
|
241
267
|
}
|
|
242
268
|
|
|
243
269
|
/**
|
|
@@ -245,6 +271,7 @@ const teamsListLogs = async ({ teamId, queries, parseOutput = true, sdk = undefi
|
|
|
245
271
|
* @property {string} teamId Team ID.
|
|
246
272
|
* @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm
|
|
247
273
|
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
274
|
+
* @property {boolean} overrideForCli
|
|
248
275
|
* @property {boolean} parseOutput
|
|
249
276
|
* @property {libClient | undefined} sdk
|
|
250
277
|
*/
|
|
@@ -252,8 +279,9 @@ const teamsListLogs = async ({ teamId, queries, parseOutput = true, sdk = undefi
|
|
|
252
279
|
/**
|
|
253
280
|
* @param {TeamsListMembershipsRequestParams} params
|
|
254
281
|
*/
|
|
255
|
-
const teamsListMemberships = async ({
|
|
256
|
-
let client = !sdk ? await sdkForProject() :
|
|
282
|
+
const teamsListMemberships = async ({teamId,queries,search,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
283
|
+
let client = !sdk ? await sdkForProject() :
|
|
284
|
+
sdk;
|
|
257
285
|
let apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
|
|
258
286
|
let payload = {};
|
|
259
287
|
if (typeof queries !== 'undefined') {
|
|
@@ -273,8 +301,9 @@ const teamsListMemberships = async ({ teamId, queries, search, parseOutput = tru
|
|
|
273
301
|
parse(response)
|
|
274
302
|
success()
|
|
275
303
|
}
|
|
276
|
-
|
|
304
|
+
|
|
277
305
|
return response;
|
|
306
|
+
|
|
278
307
|
}
|
|
279
308
|
|
|
280
309
|
/**
|
|
@@ -284,8 +313,9 @@ const teamsListMemberships = async ({ teamId, queries, search, parseOutput = tru
|
|
|
284
313
|
* @property {string} email Email of the new team member.
|
|
285
314
|
* @property {string} userId ID of the user to be added to a team.
|
|
286
315
|
* @property {string} phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
287
|
-
* @property {string} url URL to redirect the user back to your app from the invitation email.
|
|
316
|
+
* @property {string} url URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
|
288
317
|
* @property {string} name Name of the new team member. Max length: 128 chars.
|
|
318
|
+
* @property {boolean} overrideForCli
|
|
289
319
|
* @property {boolean} parseOutput
|
|
290
320
|
* @property {libClient | undefined} sdk
|
|
291
321
|
*/
|
|
@@ -293,8 +323,9 @@ const teamsListMemberships = async ({ teamId, queries, search, parseOutput = tru
|
|
|
293
323
|
/**
|
|
294
324
|
* @param {TeamsCreateMembershipRequestParams} params
|
|
295
325
|
*/
|
|
296
|
-
const teamsCreateMembership = async ({
|
|
297
|
-
let client = !sdk ? await sdkForProject() :
|
|
326
|
+
const teamsCreateMembership = async ({teamId,roles,email,userId,phone,url,name,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
327
|
+
let client = !sdk ? await sdkForProject() :
|
|
328
|
+
sdk;
|
|
298
329
|
let apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
|
|
299
330
|
let payload = {};
|
|
300
331
|
if (typeof email !== 'undefined') {
|
|
@@ -327,14 +358,16 @@ const teamsCreateMembership = async ({ teamId, roles, email, userId, phone, url,
|
|
|
327
358
|
parse(response)
|
|
328
359
|
success()
|
|
329
360
|
}
|
|
330
|
-
|
|
361
|
+
|
|
331
362
|
return response;
|
|
363
|
+
|
|
332
364
|
}
|
|
333
365
|
|
|
334
366
|
/**
|
|
335
367
|
* @typedef {Object} TeamsGetMembershipRequestParams
|
|
336
368
|
* @property {string} teamId Team ID.
|
|
337
369
|
* @property {string} membershipId Membership ID.
|
|
370
|
+
* @property {boolean} overrideForCli
|
|
338
371
|
* @property {boolean} parseOutput
|
|
339
372
|
* @property {libClient | undefined} sdk
|
|
340
373
|
*/
|
|
@@ -342,8 +375,9 @@ const teamsCreateMembership = async ({ teamId, roles, email, userId, phone, url,
|
|
|
342
375
|
/**
|
|
343
376
|
* @param {TeamsGetMembershipRequestParams} params
|
|
344
377
|
*/
|
|
345
|
-
const teamsGetMembership = async ({
|
|
346
|
-
let client = !sdk ? await sdkForProject() :
|
|
378
|
+
const teamsGetMembership = async ({teamId,membershipId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
379
|
+
let client = !sdk ? await sdkForProject() :
|
|
380
|
+
sdk;
|
|
347
381
|
let apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
348
382
|
let payload = {};
|
|
349
383
|
|
|
@@ -357,8 +391,9 @@ const teamsGetMembership = async ({ teamId, membershipId, parseOutput = true, sd
|
|
|
357
391
|
parse(response)
|
|
358
392
|
success()
|
|
359
393
|
}
|
|
360
|
-
|
|
394
|
+
|
|
361
395
|
return response;
|
|
396
|
+
|
|
362
397
|
}
|
|
363
398
|
|
|
364
399
|
/**
|
|
@@ -366,6 +401,7 @@ const teamsGetMembership = async ({ teamId, membershipId, parseOutput = true, sd
|
|
|
366
401
|
* @property {string} teamId Team ID.
|
|
367
402
|
* @property {string} membershipId Membership ID.
|
|
368
403
|
* @property {string[]} roles An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
|
404
|
+
* @property {boolean} overrideForCli
|
|
369
405
|
* @property {boolean} parseOutput
|
|
370
406
|
* @property {libClient | undefined} sdk
|
|
371
407
|
*/
|
|
@@ -373,8 +409,9 @@ const teamsGetMembership = async ({ teamId, membershipId, parseOutput = true, sd
|
|
|
373
409
|
/**
|
|
374
410
|
* @param {TeamsUpdateMembershipRequestParams} params
|
|
375
411
|
*/
|
|
376
|
-
const teamsUpdateMembership = async ({
|
|
377
|
-
let client = !sdk ? await sdkForProject() :
|
|
412
|
+
const teamsUpdateMembership = async ({teamId,membershipId,roles,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
413
|
+
let client = !sdk ? await sdkForProject() :
|
|
414
|
+
sdk;
|
|
378
415
|
let apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
379
416
|
let payload = {};
|
|
380
417
|
roles = roles === true ? [] : roles;
|
|
@@ -392,14 +429,16 @@ const teamsUpdateMembership = async ({ teamId, membershipId, roles, parseOutput
|
|
|
392
429
|
parse(response)
|
|
393
430
|
success()
|
|
394
431
|
}
|
|
395
|
-
|
|
432
|
+
|
|
396
433
|
return response;
|
|
434
|
+
|
|
397
435
|
}
|
|
398
436
|
|
|
399
437
|
/**
|
|
400
438
|
* @typedef {Object} TeamsDeleteMembershipRequestParams
|
|
401
439
|
* @property {string} teamId Team ID.
|
|
402
440
|
* @property {string} membershipId Membership ID.
|
|
441
|
+
* @property {boolean} overrideForCli
|
|
403
442
|
* @property {boolean} parseOutput
|
|
404
443
|
* @property {libClient | undefined} sdk
|
|
405
444
|
*/
|
|
@@ -407,8 +446,9 @@ const teamsUpdateMembership = async ({ teamId, membershipId, roles, parseOutput
|
|
|
407
446
|
/**
|
|
408
447
|
* @param {TeamsDeleteMembershipRequestParams} params
|
|
409
448
|
*/
|
|
410
|
-
const teamsDeleteMembership = async ({
|
|
411
|
-
let client = !sdk ? await sdkForProject() :
|
|
449
|
+
const teamsDeleteMembership = async ({teamId,membershipId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
450
|
+
let client = !sdk ? await sdkForProject() :
|
|
451
|
+
sdk;
|
|
412
452
|
let apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
413
453
|
let payload = {};
|
|
414
454
|
|
|
@@ -422,8 +462,9 @@ const teamsDeleteMembership = async ({ teamId, membershipId, parseOutput = true,
|
|
|
422
462
|
parse(response)
|
|
423
463
|
success()
|
|
424
464
|
}
|
|
425
|
-
|
|
465
|
+
|
|
426
466
|
return response;
|
|
467
|
+
|
|
427
468
|
}
|
|
428
469
|
|
|
429
470
|
/**
|
|
@@ -432,6 +473,7 @@ const teamsDeleteMembership = async ({ teamId, membershipId, parseOutput = true,
|
|
|
432
473
|
* @property {string} membershipId Membership ID.
|
|
433
474
|
* @property {string} userId User ID.
|
|
434
475
|
* @property {string} secret Secret key.
|
|
476
|
+
* @property {boolean} overrideForCli
|
|
435
477
|
* @property {boolean} parseOutput
|
|
436
478
|
* @property {libClient | undefined} sdk
|
|
437
479
|
*/
|
|
@@ -439,8 +481,9 @@ const teamsDeleteMembership = async ({ teamId, membershipId, parseOutput = true,
|
|
|
439
481
|
/**
|
|
440
482
|
* @param {TeamsUpdateMembershipStatusRequestParams} params
|
|
441
483
|
*/
|
|
442
|
-
const teamsUpdateMembershipStatus = async ({
|
|
443
|
-
let client = !sdk ? await sdkForProject() :
|
|
484
|
+
const teamsUpdateMembershipStatus = async ({teamId,membershipId,userId,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
485
|
+
let client = !sdk ? await sdkForProject() :
|
|
486
|
+
sdk;
|
|
444
487
|
let apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
445
488
|
let payload = {};
|
|
446
489
|
if (typeof userId !== 'undefined') {
|
|
@@ -460,13 +503,15 @@ const teamsUpdateMembershipStatus = async ({ teamId, membershipId, userId, secre
|
|
|
460
503
|
parse(response)
|
|
461
504
|
success()
|
|
462
505
|
}
|
|
463
|
-
|
|
506
|
+
|
|
464
507
|
return response;
|
|
508
|
+
|
|
465
509
|
}
|
|
466
510
|
|
|
467
511
|
/**
|
|
468
512
|
* @typedef {Object} TeamsGetPrefsRequestParams
|
|
469
513
|
* @property {string} teamId Team ID.
|
|
514
|
+
* @property {boolean} overrideForCli
|
|
470
515
|
* @property {boolean} parseOutput
|
|
471
516
|
* @property {libClient | undefined} sdk
|
|
472
517
|
*/
|
|
@@ -474,8 +519,9 @@ const teamsUpdateMembershipStatus = async ({ teamId, membershipId, userId, secre
|
|
|
474
519
|
/**
|
|
475
520
|
* @param {TeamsGetPrefsRequestParams} params
|
|
476
521
|
*/
|
|
477
|
-
const teamsGetPrefs = async ({
|
|
478
|
-
let client = !sdk ? await sdkForProject() :
|
|
522
|
+
const teamsGetPrefs = async ({teamId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
523
|
+
let client = !sdk ? await sdkForProject() :
|
|
524
|
+
sdk;
|
|
479
525
|
let apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
|
|
480
526
|
let payload = {};
|
|
481
527
|
|
|
@@ -489,14 +535,16 @@ const teamsGetPrefs = async ({ teamId, parseOutput = true, sdk = undefined}) =>
|
|
|
489
535
|
parse(response)
|
|
490
536
|
success()
|
|
491
537
|
}
|
|
492
|
-
|
|
538
|
+
|
|
493
539
|
return response;
|
|
540
|
+
|
|
494
541
|
}
|
|
495
542
|
|
|
496
543
|
/**
|
|
497
544
|
* @typedef {Object} TeamsUpdatePrefsRequestParams
|
|
498
545
|
* @property {string} teamId Team ID.
|
|
499
546
|
* @property {object} prefs Prefs key-value JSON object.
|
|
547
|
+
* @property {boolean} overrideForCli
|
|
500
548
|
* @property {boolean} parseOutput
|
|
501
549
|
* @property {libClient | undefined} sdk
|
|
502
550
|
*/
|
|
@@ -504,8 +552,9 @@ const teamsGetPrefs = async ({ teamId, parseOutput = true, sdk = undefined}) =>
|
|
|
504
552
|
/**
|
|
505
553
|
* @param {TeamsUpdatePrefsRequestParams} params
|
|
506
554
|
*/
|
|
507
|
-
const teamsUpdatePrefs = async ({
|
|
508
|
-
let client = !sdk ? await sdkForProject() :
|
|
555
|
+
const teamsUpdatePrefs = async ({teamId,prefs,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
556
|
+
let client = !sdk ? await sdkForProject() :
|
|
557
|
+
sdk;
|
|
509
558
|
let apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
|
|
510
559
|
let payload = {};
|
|
511
560
|
if (typeof prefs !== 'undefined') {
|
|
@@ -522,8 +571,9 @@ const teamsUpdatePrefs = async ({ teamId, prefs, parseOutput = true, sdk = undef
|
|
|
522
571
|
parse(response)
|
|
523
572
|
success()
|
|
524
573
|
}
|
|
525
|
-
|
|
574
|
+
|
|
526
575
|
return response;
|
|
576
|
+
|
|
527
577
|
}
|
|
528
578
|
|
|
529
579
|
teams
|
|
@@ -531,6 +581,7 @@ teams
|
|
|
531
581
|
.description(`Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.`)
|
|
532
582
|
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan`)
|
|
533
583
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
584
|
+
.option(`--console`, `Get the resource console url`)
|
|
534
585
|
.action(actionRunner(teamsList))
|
|
535
586
|
|
|
536
587
|
teams
|
|
@@ -545,6 +596,7 @@ teams
|
|
|
545
596
|
.command(`get`)
|
|
546
597
|
.description(`Get a team by its ID. All team members have read access for this resource.`)
|
|
547
598
|
.requiredOption(`--teamId <teamId>`, `Team ID.`)
|
|
599
|
+
.option(`--console`, `Get the resource console url`)
|
|
548
600
|
.action(actionRunner(teamsGet))
|
|
549
601
|
|
|
550
602
|
teams
|
|
@@ -583,7 +635,7 @@ teams
|
|
|
583
635
|
.option(`--email <email>`, `Email of the new team member.`)
|
|
584
636
|
.option(`--userId <userId>`, `ID of the user to be added to a team.`)
|
|
585
637
|
.option(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
|
|
586
|
-
.option(`--url <url>`, `URL to redirect the user back to your app from the invitation email.
|
|
638
|
+
.option(`--url <url>`, `URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`)
|
|
587
639
|
.option(`--name <name>`, `Name of the new team member. Max length: 128 chars.`)
|
|
588
640
|
.action(actionRunner(teamsCreateMembership))
|
|
589
641
|
|
|
@@ -647,4 +699,4 @@ module.exports = {
|
|
|
647
699
|
teamsUpdateMembershipStatus,
|
|
648
700
|
teamsGetPrefs,
|
|
649
701
|
teamsUpdatePrefs
|
|
650
|
-
};
|
|
702
|
+
};
|