appwrite-cli 0.18.5 → 1.0.0
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/npm-publish.yml +8 -1
- package/LICENSE.md +1 -1
- package/README.md +4 -4
- package/appwrite.json +4 -0
- package/docs/examples/account/create-phone-session.md +1 -1
- package/docs/examples/account/get-logs.md +0 -1
- package/docs/examples/account/list-logs.md +2 -0
- package/docs/examples/account/list-sessions.md +1 -0
- package/docs/examples/account/update-phone.md +1 -1
- package/docs/examples/avatars/get-initials.md +0 -1
- package/docs/examples/databases/create-collection.md +2 -3
- package/docs/examples/databases/create-datetime-attribute.md +7 -0
- package/docs/examples/databases/create-document.md +0 -1
- package/docs/examples/databases/list-collection-logs.md +0 -1
- package/docs/examples/databases/list-collections.md +0 -4
- package/docs/examples/databases/list-document-logs.md +0 -1
- package/docs/examples/databases/list-documents.md +0 -6
- package/docs/examples/databases/list-logs.md +0 -1
- package/docs/examples/databases/list.md +0 -4
- package/docs/examples/databases/update-collection.md +0 -1
- package/docs/examples/databases/update-document.md +0 -1
- package/docs/examples/functions/create-variable.md +4 -0
- package/docs/examples/functions/create.md +1 -1
- package/docs/examples/functions/delete-variable.md +3 -0
- package/docs/examples/functions/get-function-usage.md +3 -0
- package/docs/examples/functions/get-usage.md +0 -1
- package/docs/examples/functions/get-variable.md +3 -0
- package/docs/examples/functions/list-deployments.md +0 -4
- package/docs/examples/functions/list-executions.md +0 -3
- package/docs/examples/functions/list-variables.md +2 -0
- package/docs/examples/functions/list.md +0 -4
- package/docs/examples/functions/update-variable.md +5 -0
- package/docs/examples/functions/update.md +1 -1
- package/docs/examples/locale/list-continents.md +1 -0
- package/docs/examples/locale/list-countries-e-u.md +1 -0
- package/docs/examples/locale/list-countries-phones.md +1 -0
- package/docs/examples/locale/list-countries.md +1 -0
- package/docs/examples/locale/list-currencies.md +1 -0
- package/docs/examples/locale/list-languages.md +1 -0
- package/docs/examples/projects/list.md +0 -4
- package/docs/examples/storage/create-bucket.md +1 -1
- package/docs/examples/storage/create-file.md +0 -1
- package/docs/examples/storage/list-buckets.md +0 -4
- package/docs/examples/storage/list-files.md +0 -4
- package/docs/examples/storage/update-bucket.md +1 -1
- package/docs/examples/storage/update-file.md +0 -1
- package/docs/examples/teams/get-memberships.md +0 -4
- package/docs/examples/teams/list-logs.md +0 -1
- package/docs/examples/teams/list-memberships.md +4 -0
- package/docs/examples/teams/list.md +0 -4
- package/docs/examples/users/create-argon2user.md +5 -0
- package/docs/examples/users/create-bcrypt-user.md +5 -0
- package/docs/examples/users/create-m-d5user.md +5 -0
- package/docs/examples/users/create-p-h-pass-user.md +5 -0
- package/docs/examples/users/create-s-h-a-user.md +6 -0
- package/docs/examples/users/create-scrypt-modified-user.md +8 -0
- package/docs/examples/users/create-scrypt-user.md +10 -0
- package/docs/examples/users/create.md +3 -2
- package/docs/examples/users/get-logs.md +0 -1
- package/docs/examples/users/list-logs.md +3 -0
- package/docs/examples/users/list-memberships.md +2 -0
- package/docs/examples/users/list-sessions.md +2 -0
- package/docs/examples/users/list.md +0 -4
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +7 -3
- package/lib/commands/account.js +24 -29
- package/lib/commands/avatars.js +2 -7
- package/lib/commands/databases.js +154 -210
- package/lib/commands/deploy.js +12 -3
- package/lib/commands/functions.js +227 -93
- package/lib/commands/generic.js +3 -3
- package/lib/commands/locale.js +24 -24
- package/lib/commands/projects.js +10 -30
- package/lib/commands/storage.js +53 -105
- package/lib/commands/teams.js +20 -65
- package/lib/commands/users.js +425 -47
- package/lib/questions.js +1 -1
- package/package.json +1 -1
package/lib/commands/teams.js
CHANGED
|
@@ -12,37 +12,21 @@ const { localConfig, globalConfig } = require("../config");
|
|
|
12
12
|
|
|
13
13
|
const teams = new Command("teams").description(commandDescriptions['teams'])
|
|
14
14
|
|
|
15
|
-
const teamsList = async ({
|
|
15
|
+
const teamsList = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
|
|
16
|
+
/* @param {string[]} queries */
|
|
16
17
|
/* @param {string} search */
|
|
17
|
-
/* @param {number} limit */
|
|
18
|
-
/* @param {number} offset */
|
|
19
|
-
/* @param {string} cursor */
|
|
20
|
-
/* @param {string} cursorDirection */
|
|
21
|
-
/* @param {string} orderType */
|
|
22
18
|
|
|
23
19
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
24
20
|
let path = '/teams';
|
|
25
21
|
let payload = {};
|
|
26
22
|
|
|
27
23
|
/** Query Params */
|
|
24
|
+
if (typeof queries !== 'undefined') {
|
|
25
|
+
payload['queries'] = queries;
|
|
26
|
+
}
|
|
28
27
|
if (typeof search !== 'undefined') {
|
|
29
28
|
payload['search'] = search;
|
|
30
29
|
}
|
|
31
|
-
if (typeof limit !== 'undefined') {
|
|
32
|
-
payload['limit'] = limit;
|
|
33
|
-
}
|
|
34
|
-
if (typeof offset !== 'undefined') {
|
|
35
|
-
payload['offset'] = offset;
|
|
36
|
-
}
|
|
37
|
-
if (typeof cursor !== 'undefined') {
|
|
38
|
-
payload['cursor'] = cursor;
|
|
39
|
-
}
|
|
40
|
-
if (typeof cursorDirection !== 'undefined') {
|
|
41
|
-
payload['cursorDirection'] = cursorDirection;
|
|
42
|
-
}
|
|
43
|
-
if (typeof orderType !== 'undefined') {
|
|
44
|
-
payload['orderType'] = orderType;
|
|
45
|
-
}
|
|
46
30
|
let response = undefined;
|
|
47
31
|
response = await client.call('get', path, {
|
|
48
32
|
'content-type': 'application/json',
|
|
@@ -150,21 +134,17 @@ const teamsDelete = async ({ teamId, parseOutput = true, sdk = undefined}) => {
|
|
|
150
134
|
return response;
|
|
151
135
|
}
|
|
152
136
|
|
|
153
|
-
const teamsListLogs = async ({ teamId,
|
|
137
|
+
const teamsListLogs = async ({ teamId, queries, parseOutput = true, sdk = undefined}) => {
|
|
154
138
|
/* @param {string} teamId */
|
|
155
|
-
/* @param {
|
|
156
|
-
/* @param {number} offset */
|
|
139
|
+
/* @param {string[]} queries */
|
|
157
140
|
|
|
158
141
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
159
142
|
let path = '/teams/{teamId}/logs'.replace('{teamId}', teamId);
|
|
160
143
|
let payload = {};
|
|
161
144
|
|
|
162
145
|
/** Query Params */
|
|
163
|
-
if (typeof
|
|
164
|
-
payload['
|
|
165
|
-
}
|
|
166
|
-
if (typeof offset !== 'undefined') {
|
|
167
|
-
payload['offset'] = offset;
|
|
146
|
+
if (typeof queries !== 'undefined') {
|
|
147
|
+
payload['queries'] = queries;
|
|
168
148
|
}
|
|
169
149
|
let response = undefined;
|
|
170
150
|
response = await client.call('get', path, {
|
|
@@ -178,38 +158,22 @@ const teamsListLogs = async ({ teamId, limit, offset, parseOutput = true, sdk =
|
|
|
178
158
|
return response;
|
|
179
159
|
}
|
|
180
160
|
|
|
181
|
-
const
|
|
161
|
+
const teamsListMemberships = async ({ teamId, queries, search, parseOutput = true, sdk = undefined}) => {
|
|
182
162
|
/* @param {string} teamId */
|
|
163
|
+
/* @param {string[]} queries */
|
|
183
164
|
/* @param {string} search */
|
|
184
|
-
/* @param {number} limit */
|
|
185
|
-
/* @param {number} offset */
|
|
186
|
-
/* @param {string} cursor */
|
|
187
|
-
/* @param {string} cursorDirection */
|
|
188
|
-
/* @param {string} orderType */
|
|
189
165
|
|
|
190
166
|
let client = !sdk ? await sdkForProject() : sdk;
|
|
191
167
|
let path = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
|
|
192
168
|
let payload = {};
|
|
193
169
|
|
|
194
170
|
/** Query Params */
|
|
171
|
+
if (typeof queries !== 'undefined') {
|
|
172
|
+
payload['queries'] = queries;
|
|
173
|
+
}
|
|
195
174
|
if (typeof search !== 'undefined') {
|
|
196
175
|
payload['search'] = search;
|
|
197
176
|
}
|
|
198
|
-
if (typeof limit !== 'undefined') {
|
|
199
|
-
payload['limit'] = limit;
|
|
200
|
-
}
|
|
201
|
-
if (typeof offset !== 'undefined') {
|
|
202
|
-
payload['offset'] = offset;
|
|
203
|
-
}
|
|
204
|
-
if (typeof cursor !== 'undefined') {
|
|
205
|
-
payload['cursor'] = cursor;
|
|
206
|
-
}
|
|
207
|
-
if (typeof cursorDirection !== 'undefined') {
|
|
208
|
-
payload['cursorDirection'] = cursorDirection;
|
|
209
|
-
}
|
|
210
|
-
if (typeof orderType !== 'undefined') {
|
|
211
|
-
payload['orderType'] = orderType;
|
|
212
|
-
}
|
|
213
177
|
let response = undefined;
|
|
214
178
|
response = await client.call('get', path, {
|
|
215
179
|
'content-type': 'application/json',
|
|
@@ -361,12 +325,8 @@ const teamsUpdateMembershipStatus = async ({ teamId, membershipId, userId, secre
|
|
|
361
325
|
teams
|
|
362
326
|
.command(`list`)
|
|
363
327
|
.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.
|
|
364
328
|
|
|
365
329
|
In admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](/docs/admin).`)
|
|
330
|
+
.option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total`)
|
|
366
331
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
367
|
-
.option(`--limit <limit>`, `Maximum number of teams to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
368
|
-
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
369
|
-
.option(`--cursor <cursor>`, `ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)`)
|
|
370
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
371
|
-
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
372
332
|
.action(actionRunner(teamsList))
|
|
373
333
|
|
|
374
334
|
teams
|
|
@@ -400,21 +360,16 @@ teams
|
|
|
400
360
|
.command(`listLogs`)
|
|
401
361
|
.description(`Get the team activity logs list by its unique ID.`)
|
|
402
362
|
.requiredOption(`--teamId <teamId>`, `Team ID.`)
|
|
403
|
-
.option(`--
|
|
404
|
-
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
363
|
+
.option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only supported methods are limit and offset`)
|
|
405
364
|
.action(actionRunner(teamsListLogs))
|
|
406
365
|
|
|
407
366
|
teams
|
|
408
|
-
.command(`
|
|
367
|
+
.command(`listMemberships`)
|
|
409
368
|
.description(`Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.`)
|
|
410
369
|
.requiredOption(`--teamId <teamId>`, `Team ID.`)
|
|
370
|
+
.option(`--queries <queries...>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm`)
|
|
411
371
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
412
|
-
.
|
|
413
|
-
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
414
|
-
.option(`--cursor <cursor>`, `ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)`)
|
|
415
|
-
.option(`--cursorDirection <cursorDirection>`, `Direction of the cursor, can be either 'before' or 'after'.`)
|
|
416
|
-
.option(`--orderType <orderType>`, `Order result by ASC or DESC order.`)
|
|
417
|
-
.action(actionRunner(teamsGetMemberships))
|
|
372
|
+
.action(actionRunner(teamsListMemberships))
|
|
418
373
|
|
|
419
374
|
teams
|
|
420
375
|
.command(`createMembership`)
|
|
@@ -466,7 +421,7 @@ module.exports = {
|
|
|
466
421
|
teamsUpdate,
|
|
467
422
|
teamsDelete,
|
|
468
423
|
teamsListLogs,
|
|
469
|
-
|
|
424
|
+
teamsListMemberships,
|
|
470
425
|
teamsCreateMembership,
|
|
471
426
|
teamsGetMembership,
|
|
472
427
|
teamsUpdateMembershipRoles,
|