appwrite-cli 10.2.3 → 11.1.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/CHANGELOG.md +14 -0
- package/README.md +2 -2
- package/docs/examples/messaging/create-resend-provider.md +3 -0
- package/docs/examples/messaging/update-resend-provider.md +2 -0
- package/docs/examples/migrations/create-csv-export.md +4 -0
- package/docs/examples/migrations/{create-csv-migration.md → create-csv-import.md} +1 -1
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +2 -2
- package/lib/commands/account.js +12 -2
- package/lib/commands/databases.js +30 -5
- package/lib/commands/functions.js +24 -4
- package/lib/commands/messaging.js +201 -9
- package/lib/commands/migrations.js +100 -8
- package/lib/commands/projects.js +24 -4
- package/lib/commands/proxy.js +6 -1
- package/lib/commands/push.js +123 -2
- package/lib/commands/sites.js +18 -3
- package/lib/commands/storage.js +12 -2
- package/lib/commands/tables-db.js +30 -5
- package/lib/commands/teams.js +18 -3
- package/lib/commands/tokens.js +6 -1
- package/lib/commands/users.js +36 -6
- package/lib/commands/vcs.js +6 -1
- package/lib/parser.js +1 -1
- package/package.json +2 -2
- package/scoop/appwrite.config.json +3 -3
package/lib/commands/projects.js
CHANGED
|
@@ -43,6 +43,7 @@ const projects = new Command("projects").description(commandDescriptions['projec
|
|
|
43
43
|
* @typedef {Object} ProjectsListRequestParams
|
|
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, teamId
|
|
45
45
|
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
46
|
+
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
|
|
46
47
|
* @property {boolean} overrideForCli
|
|
47
48
|
* @property {boolean} parseOutput
|
|
48
49
|
* @property {libClient | undefined} sdk
|
|
@@ -51,7 +52,7 @@ const projects = new Command("projects").description(commandDescriptions['projec
|
|
|
51
52
|
/**
|
|
52
53
|
* @param {ProjectsListRequestParams} params
|
|
53
54
|
*/
|
|
54
|
-
const projectsList = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
55
|
+
const projectsList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
55
56
|
let client = !sdk ? await sdkForConsole() :
|
|
56
57
|
sdk;
|
|
57
58
|
let apiPath = '/projects';
|
|
@@ -62,6 +63,9 @@ const projectsList = async ({queries,search,parseOutput = true, overrideForCli =
|
|
|
62
63
|
if (typeof search !== 'undefined') {
|
|
63
64
|
payload['search'] = search;
|
|
64
65
|
}
|
|
66
|
+
if (typeof total !== 'undefined') {
|
|
67
|
+
payload['total'] = total;
|
|
68
|
+
}
|
|
65
69
|
|
|
66
70
|
let response = undefined;
|
|
67
71
|
|
|
@@ -970,6 +974,7 @@ const projectsCreateJWT = async ({projectId,scopes,duration,parseOutput = true,
|
|
|
970
974
|
/**
|
|
971
975
|
* @typedef {Object} ProjectsListKeysRequestParams
|
|
972
976
|
* @property {string} projectId Project unique ID.
|
|
977
|
+
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
|
|
973
978
|
* @property {boolean} overrideForCli
|
|
974
979
|
* @property {boolean} parseOutput
|
|
975
980
|
* @property {libClient | undefined} sdk
|
|
@@ -978,11 +983,14 @@ const projectsCreateJWT = async ({projectId,scopes,duration,parseOutput = true,
|
|
|
978
983
|
/**
|
|
979
984
|
* @param {ProjectsListKeysRequestParams} params
|
|
980
985
|
*/
|
|
981
|
-
const projectsListKeys = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
986
|
+
const projectsListKeys = async ({projectId,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
982
987
|
let client = !sdk ? await sdkForConsole() :
|
|
983
988
|
sdk;
|
|
984
989
|
let apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
|
|
985
990
|
let payload = {};
|
|
991
|
+
if (typeof total !== 'undefined') {
|
|
992
|
+
payload['total'] = total;
|
|
993
|
+
}
|
|
986
994
|
|
|
987
995
|
let response = undefined;
|
|
988
996
|
|
|
@@ -1201,6 +1209,7 @@ const projectsUpdateOAuth2 = async ({projectId,provider,appId,secret,enabled,par
|
|
|
1201
1209
|
/**
|
|
1202
1210
|
* @typedef {Object} ProjectsListPlatformsRequestParams
|
|
1203
1211
|
* @property {string} projectId Project unique ID.
|
|
1212
|
+
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
|
|
1204
1213
|
* @property {boolean} overrideForCli
|
|
1205
1214
|
* @property {boolean} parseOutput
|
|
1206
1215
|
* @property {libClient | undefined} sdk
|
|
@@ -1209,11 +1218,14 @@ const projectsUpdateOAuth2 = async ({projectId,provider,appId,secret,enabled,par
|
|
|
1209
1218
|
/**
|
|
1210
1219
|
* @param {ProjectsListPlatformsRequestParams} params
|
|
1211
1220
|
*/
|
|
1212
|
-
const projectsListPlatforms = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
1221
|
+
const projectsListPlatforms = async ({projectId,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
1213
1222
|
let client = !sdk ? await sdkForConsole() :
|
|
1214
1223
|
sdk;
|
|
1215
1224
|
let apiPath = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
|
|
1216
1225
|
let payload = {};
|
|
1226
|
+
if (typeof total !== 'undefined') {
|
|
1227
|
+
payload['total'] = total;
|
|
1228
|
+
}
|
|
1217
1229
|
|
|
1218
1230
|
let response = undefined;
|
|
1219
1231
|
|
|
@@ -1849,6 +1861,7 @@ const projectsDeleteSMSTemplate = async ({projectId,type,locale,parseOutput = tr
|
|
|
1849
1861
|
/**
|
|
1850
1862
|
* @typedef {Object} ProjectsListWebhooksRequestParams
|
|
1851
1863
|
* @property {string} projectId Project unique ID.
|
|
1864
|
+
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
|
|
1852
1865
|
* @property {boolean} overrideForCli
|
|
1853
1866
|
* @property {boolean} parseOutput
|
|
1854
1867
|
* @property {libClient | undefined} sdk
|
|
@@ -1857,11 +1870,14 @@ const projectsDeleteSMSTemplate = async ({projectId,type,locale,parseOutput = tr
|
|
|
1857
1870
|
/**
|
|
1858
1871
|
* @param {ProjectsListWebhooksRequestParams} params
|
|
1859
1872
|
*/
|
|
1860
|
-
const projectsListWebhooks = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
1873
|
+
const projectsListWebhooks = async ({projectId,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
1861
1874
|
let client = !sdk ? await sdkForConsole() :
|
|
1862
1875
|
sdk;
|
|
1863
1876
|
let apiPath = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
|
|
1864
1877
|
let payload = {};
|
|
1878
|
+
if (typeof total !== 'undefined') {
|
|
1879
|
+
payload['total'] = total;
|
|
1880
|
+
}
|
|
1865
1881
|
|
|
1866
1882
|
let response = undefined;
|
|
1867
1883
|
|
|
@@ -2099,6 +2115,7 @@ projects
|
|
|
2099
2115
|
.description(`Get a list of all projects. You can use the query params to filter your results. `)
|
|
2100
2116
|
.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, teamId`)
|
|
2101
2117
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
2118
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
|
|
2102
2119
|
.option(`--console`, `Get the resource console url`)
|
|
2103
2120
|
.action(actionRunner(projectsList))
|
|
2104
2121
|
|
|
@@ -2296,6 +2313,7 @@ projects
|
|
|
2296
2313
|
.command(`list-keys`)
|
|
2297
2314
|
.description(`Get a list of all API keys from the current project. `)
|
|
2298
2315
|
.requiredOption(`--project-id <project-id>`, `Project unique ID.`)
|
|
2316
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
|
|
2299
2317
|
.option(`--console`, `Get the resource console url`)
|
|
2300
2318
|
.action(actionRunner(projectsListKeys))
|
|
2301
2319
|
|
|
@@ -2347,6 +2365,7 @@ projects
|
|
|
2347
2365
|
.command(`list-platforms`)
|
|
2348
2366
|
.description(`Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. `)
|
|
2349
2367
|
.requiredOption(`--project-id <project-id>`, `Project unique ID.`)
|
|
2368
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
|
|
2350
2369
|
.option(`--console`, `Get the resource console url`)
|
|
2351
2370
|
.action(actionRunner(projectsListPlatforms))
|
|
2352
2371
|
|
|
@@ -2497,6 +2516,7 @@ projects
|
|
|
2497
2516
|
.command(`list-webhooks`)
|
|
2498
2517
|
.description(`Get a list of all webhooks belonging to the project. You can use the query params to filter your results. `)
|
|
2499
2518
|
.requiredOption(`--project-id <project-id>`, `Project unique ID.`)
|
|
2519
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
|
|
2500
2520
|
.option(`--console`, `Get the resource console url`)
|
|
2501
2521
|
.action(actionRunner(projectsListWebhooks))
|
|
2502
2522
|
|
package/lib/commands/proxy.js
CHANGED
|
@@ -43,6 +43,7 @@ const proxy = new Command("proxy").description(commandDescriptions['proxy'] ?? '
|
|
|
43
43
|
* @typedef {Object} ProxyListRulesRequestParams
|
|
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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch
|
|
45
45
|
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
46
|
+
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
|
|
46
47
|
* @property {boolean} overrideForCli
|
|
47
48
|
* @property {boolean} parseOutput
|
|
48
49
|
* @property {libClient | undefined} sdk
|
|
@@ -51,7 +52,7 @@ const proxy = new Command("proxy").description(commandDescriptions['proxy'] ?? '
|
|
|
51
52
|
/**
|
|
52
53
|
* @param {ProxyListRulesRequestParams} params
|
|
53
54
|
*/
|
|
54
|
-
const proxyListRules = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
55
|
+
const proxyListRules = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
55
56
|
let client = !sdk ? await sdkForProject() :
|
|
56
57
|
sdk;
|
|
57
58
|
let apiPath = '/proxy/rules';
|
|
@@ -62,6 +63,9 @@ const proxyListRules = async ({queries,search,parseOutput = true, overrideForCli
|
|
|
62
63
|
if (typeof search !== 'undefined') {
|
|
63
64
|
payload['search'] = search;
|
|
64
65
|
}
|
|
66
|
+
if (typeof total !== 'undefined') {
|
|
67
|
+
payload['total'] = total;
|
|
68
|
+
}
|
|
65
69
|
|
|
66
70
|
let response = undefined;
|
|
67
71
|
|
|
@@ -333,6 +337,7 @@ proxy
|
|
|
333
337
|
.description(`Get a list of all the proxy rules. You can use the query params to filter your results.`)
|
|
334
338
|
.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: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch`)
|
|
335
339
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
340
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
|
|
336
341
|
.action(actionRunner(proxyListRules))
|
|
337
342
|
|
|
338
343
|
proxy
|
package/lib/commands/push.js
CHANGED
|
@@ -43,6 +43,12 @@ const {
|
|
|
43
43
|
databasesUpdateEnumAttribute,
|
|
44
44
|
databasesUpdateRelationshipAttribute,
|
|
45
45
|
databasesCreateRelationshipAttribute,
|
|
46
|
+
databasesCreatePointAttribute,
|
|
47
|
+
databasesUpdatePointAttribute,
|
|
48
|
+
databasesCreateLineAttribute,
|
|
49
|
+
databasesUpdateLineAttribute,
|
|
50
|
+
databasesCreatePolygonAttribute,
|
|
51
|
+
databasesUpdatePolygonAttribute,
|
|
46
52
|
databasesDeleteAttribute,
|
|
47
53
|
databasesDeleteIndex,
|
|
48
54
|
databasesListAttributes,
|
|
@@ -58,7 +64,8 @@ const {
|
|
|
58
64
|
tablesDBUpdateTable,
|
|
59
65
|
tablesDBList,
|
|
60
66
|
tablesDBDelete,
|
|
61
|
-
tablesDBListTables
|
|
67
|
+
tablesDBListTables,
|
|
68
|
+
tablesDBDeleteTable
|
|
62
69
|
} = require("./tables-db");
|
|
63
70
|
const {
|
|
64
71
|
storageGetBucket, storageUpdateBucket, storageCreateBucket
|
|
@@ -561,6 +568,33 @@ const createAttribute = (databaseId, collectionId, attribute) => {
|
|
|
561
568
|
onDelete: attribute.onDelete,
|
|
562
569
|
parseOutput: false
|
|
563
570
|
})
|
|
571
|
+
case 'point':
|
|
572
|
+
return databasesCreatePointAttribute({
|
|
573
|
+
databaseId,
|
|
574
|
+
collectionId,
|
|
575
|
+
key:attribute.key,
|
|
576
|
+
required:attribute.required,
|
|
577
|
+
xdefault:attribute.default,
|
|
578
|
+
parseOutput:false
|
|
579
|
+
})
|
|
580
|
+
case 'linestring':
|
|
581
|
+
return databasesCreateLineAttribute({
|
|
582
|
+
databaseId,
|
|
583
|
+
collectionId,
|
|
584
|
+
key:attribute.key,
|
|
585
|
+
required:attribute.required,
|
|
586
|
+
xdefault:attribute.default,
|
|
587
|
+
parseOutput:false
|
|
588
|
+
})
|
|
589
|
+
case 'polygon':
|
|
590
|
+
return databasesCreatePolygonAttribute({
|
|
591
|
+
databaseId,
|
|
592
|
+
collectionId,
|
|
593
|
+
key:attribute.key,
|
|
594
|
+
required:attribute.required,
|
|
595
|
+
xdefault:attribute.default,
|
|
596
|
+
parseOutput:false
|
|
597
|
+
})
|
|
564
598
|
default:
|
|
565
599
|
throw new Error(`Unsupported attribute type: ${attribute.type}`);
|
|
566
600
|
}
|
|
@@ -680,6 +714,33 @@ const updateAttribute = (databaseId, collectionId, attribute) => {
|
|
|
680
714
|
onDelete: attribute.onDelete,
|
|
681
715
|
parseOutput: false
|
|
682
716
|
})
|
|
717
|
+
case 'point':
|
|
718
|
+
return databasesUpdatePointAttribute({
|
|
719
|
+
databaseId,
|
|
720
|
+
collectionId,
|
|
721
|
+
key:attribute.key,
|
|
722
|
+
required:attribute.required,
|
|
723
|
+
xdefault:attribute.default,
|
|
724
|
+
parseOutput:false
|
|
725
|
+
})
|
|
726
|
+
case 'linestring':
|
|
727
|
+
return databasesUpdateLineAttribute({
|
|
728
|
+
databaseId,
|
|
729
|
+
collectionId,
|
|
730
|
+
key:attribute.key,
|
|
731
|
+
required:attribute.required,
|
|
732
|
+
xdefault:attribute.default,
|
|
733
|
+
parseOutput:false
|
|
734
|
+
})
|
|
735
|
+
case 'polygon':
|
|
736
|
+
return databasesUpdatePolygonAttribute({
|
|
737
|
+
databaseId,
|
|
738
|
+
collectionId,
|
|
739
|
+
key:attribute.key,
|
|
740
|
+
required:attribute.required,
|
|
741
|
+
xdefault:attribute.default,
|
|
742
|
+
parseOutput:false
|
|
743
|
+
})
|
|
683
744
|
default:
|
|
684
745
|
throw new Error(`Unsupported attribute type: ${attribute.type}`);
|
|
685
746
|
}
|
|
@@ -768,7 +829,7 @@ const checkAttributeChanges = (remote, local, collection, recreating = true) =>
|
|
|
768
829
|
const keyName = `${chalk.yellow(local.key)} in ${collection.name} (${collection['$id']})`;
|
|
769
830
|
const action = chalk.cyan(recreating ? 'recreating' : 'changing');
|
|
770
831
|
let reason = '';
|
|
771
|
-
let attribute = remote;
|
|
832
|
+
let attribute = recreating ? remote : local;
|
|
772
833
|
|
|
773
834
|
for (let key of Object.keys(remote)) {
|
|
774
835
|
if (!KeysAttributes.has(key)) {
|
|
@@ -1884,6 +1945,65 @@ const pushTable = async ({ returnOnZero, attempts } = { returnOnZero: false }) =
|
|
|
1884
1945
|
console.log();
|
|
1885
1946
|
}
|
|
1886
1947
|
|
|
1948
|
+
log('Checking for deleted tables ...');
|
|
1949
|
+
const localTablesDBs = localConfig.getTablesDBs();
|
|
1950
|
+
const localTables = localConfig.getTables();
|
|
1951
|
+
const tablesToDelete = [];
|
|
1952
|
+
|
|
1953
|
+
for (const db of localTablesDBs) {
|
|
1954
|
+
try {
|
|
1955
|
+
const { tables: remoteTables } = await paginate(tablesDBListTables, {
|
|
1956
|
+
databaseId: db.$id,
|
|
1957
|
+
parseOutput: false
|
|
1958
|
+
}, 100, 'tables');
|
|
1959
|
+
|
|
1960
|
+
for (const remoteTable of remoteTables) {
|
|
1961
|
+
const localTable = localTables.find(t => t.$id === remoteTable.$id && t.databaseId === db.$id);
|
|
1962
|
+
if (!localTable) {
|
|
1963
|
+
tablesToDelete.push({
|
|
1964
|
+
...remoteTable,
|
|
1965
|
+
databaseId: db.$id,
|
|
1966
|
+
databaseName: db.name
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
} catch (e) {
|
|
1971
|
+
// Skip if database doesn't exist or other errors
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
if (tablesToDelete.length > 0) {
|
|
1976
|
+
log('Found tables that exist remotely but not locally:');
|
|
1977
|
+
const deletionChanges = tablesToDelete.map(table => ({
|
|
1978
|
+
id: table.$id,
|
|
1979
|
+
action: chalk.red('deleting'),
|
|
1980
|
+
key: 'Table',
|
|
1981
|
+
database: table.databaseName,
|
|
1982
|
+
remote: table.name,
|
|
1983
|
+
local: '(deleted locally)'
|
|
1984
|
+
}));
|
|
1985
|
+
drawTable(deletionChanges);
|
|
1986
|
+
|
|
1987
|
+
if ((await getConfirmation()) === true) {
|
|
1988
|
+
for (const table of tablesToDelete) {
|
|
1989
|
+
try {
|
|
1990
|
+
log(`Deleting table ${table.name} ( ${table.$id} ) from database ${table.databaseName} ...`);
|
|
1991
|
+
await tablesDBDeleteTable({
|
|
1992
|
+
databaseId: table.databaseId,
|
|
1993
|
+
tableId: table.$id,
|
|
1994
|
+
parseOutput: false
|
|
1995
|
+
});
|
|
1996
|
+
success(`Deleted ${table.name} ( ${table.$id} )`);
|
|
1997
|
+
} catch (e) {
|
|
1998
|
+
error(`Failed to delete table ${table.name} ( ${table.$id} ): ${e.message}`);
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
} else {
|
|
2003
|
+
console.log('No tables found to delete');
|
|
2004
|
+
}
|
|
2005
|
+
console.log();
|
|
2006
|
+
|
|
1887
2007
|
if (cliConfig.all) {
|
|
1888
2008
|
checkDeployConditions(localConfig);
|
|
1889
2009
|
tables.push(...localConfig.getTables());
|
|
@@ -1924,6 +2044,7 @@ const pushTable = async ({ returnOnZero, attempts } = { returnOnZero: false }) =
|
|
|
1924
2044
|
const changes = [];
|
|
1925
2045
|
if (remoteTable.name !== table.name) changes.push('name');
|
|
1926
2046
|
if (remoteTable.rowSecurity !== table.rowSecurity) changes.push('rowSecurity');
|
|
2047
|
+
if (remoteTable.enabled !== table.enabled) changes.push('enabled');
|
|
1927
2048
|
if (JSON.stringify(remoteTable['$permissions']) !== JSON.stringify(table['$permissions'])) changes.push('permissions');
|
|
1928
2049
|
|
|
1929
2050
|
if (changes.length > 0) {
|
package/lib/commands/sites.js
CHANGED
|
@@ -43,6 +43,7 @@ const sites = new Command("sites").description(commandDescriptions['sites'] ?? '
|
|
|
43
43
|
* @typedef {Object} SitesListRequestParams
|
|
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, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId
|
|
45
45
|
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
46
|
+
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
|
|
46
47
|
* @property {boolean} overrideForCli
|
|
47
48
|
* @property {boolean} parseOutput
|
|
48
49
|
* @property {libClient | undefined} sdk
|
|
@@ -51,7 +52,7 @@ const sites = new Command("sites").description(commandDescriptions['sites'] ?? '
|
|
|
51
52
|
/**
|
|
52
53
|
* @param {SitesListRequestParams} params
|
|
53
54
|
*/
|
|
54
|
-
const sitesList = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
55
|
+
const sitesList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
55
56
|
let client = !sdk ? await sdkForProject() :
|
|
56
57
|
sdk;
|
|
57
58
|
let apiPath = '/sites';
|
|
@@ -62,6 +63,9 @@ const sitesList = async ({queries,search,parseOutput = true, overrideForCli = fa
|
|
|
62
63
|
if (typeof search !== 'undefined') {
|
|
63
64
|
payload['search'] = search;
|
|
64
65
|
}
|
|
66
|
+
if (typeof total !== 'undefined') {
|
|
67
|
+
payload['total'] = total;
|
|
68
|
+
}
|
|
65
69
|
|
|
66
70
|
let response = undefined;
|
|
67
71
|
|
|
@@ -561,6 +565,7 @@ const sitesUpdateSiteDeployment = async ({siteId,deploymentId,parseOutput = true
|
|
|
561
565
|
* @property {string} siteId Site ID.
|
|
562
566
|
* @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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
|
563
567
|
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
568
|
+
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
|
|
564
569
|
* @property {boolean} overrideForCli
|
|
565
570
|
* @property {boolean} parseOutput
|
|
566
571
|
* @property {libClient | undefined} sdk
|
|
@@ -569,7 +574,7 @@ const sitesUpdateSiteDeployment = async ({siteId,deploymentId,parseOutput = true
|
|
|
569
574
|
/**
|
|
570
575
|
* @param {SitesListDeploymentsRequestParams} params
|
|
571
576
|
*/
|
|
572
|
-
const sitesListDeployments = async ({siteId,queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
577
|
+
const sitesListDeployments = async ({siteId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
573
578
|
let client = !sdk ? await sdkForProject() :
|
|
574
579
|
sdk;
|
|
575
580
|
let apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId);
|
|
@@ -580,6 +585,9 @@ const sitesListDeployments = async ({siteId,queries,search,parseOutput = true, o
|
|
|
580
585
|
if (typeof search !== 'undefined') {
|
|
581
586
|
payload['search'] = search;
|
|
582
587
|
}
|
|
588
|
+
if (typeof total !== 'undefined') {
|
|
589
|
+
payload['total'] = total;
|
|
590
|
+
}
|
|
583
591
|
|
|
584
592
|
let response = undefined;
|
|
585
593
|
|
|
@@ -1041,6 +1049,7 @@ const sitesUpdateDeploymentStatus = async ({siteId,deploymentId,parseOutput = tr
|
|
|
1041
1049
|
* @typedef {Object} SitesListLogsRequestParams
|
|
1042
1050
|
* @property {string} siteId Site ID.
|
|
1043
1051
|
* @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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
|
1052
|
+
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
|
|
1044
1053
|
* @property {boolean} overrideForCli
|
|
1045
1054
|
* @property {boolean} parseOutput
|
|
1046
1055
|
* @property {libClient | undefined} sdk
|
|
@@ -1049,7 +1058,7 @@ const sitesUpdateDeploymentStatus = async ({siteId,deploymentId,parseOutput = tr
|
|
|
1049
1058
|
/**
|
|
1050
1059
|
* @param {SitesListLogsRequestParams} params
|
|
1051
1060
|
*/
|
|
1052
|
-
const sitesListLogs = async ({siteId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1061
|
+
const sitesListLogs = async ({siteId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1053
1062
|
let client = !sdk ? await sdkForProject() :
|
|
1054
1063
|
sdk;
|
|
1055
1064
|
let apiPath = '/sites/{siteId}/logs'.replace('{siteId}', siteId);
|
|
@@ -1057,6 +1066,9 @@ const sitesListLogs = async ({siteId,queries,parseOutput = true, overrideForCli
|
|
|
1057
1066
|
if (typeof queries !== 'undefined') {
|
|
1058
1067
|
payload['queries'] = queries;
|
|
1059
1068
|
}
|
|
1069
|
+
if (typeof total !== 'undefined') {
|
|
1070
|
+
payload['total'] = total;
|
|
1071
|
+
}
|
|
1060
1072
|
|
|
1061
1073
|
let response = undefined;
|
|
1062
1074
|
|
|
@@ -1348,6 +1360,7 @@ sites
|
|
|
1348
1360
|
.description(`Get a list of all the project's sites. You can use the query params to filter your results.`)
|
|
1349
1361
|
.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, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId`)
|
|
1350
1362
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
1363
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
|
|
1351
1364
|
.option(`--console`, `Get the resource console url`)
|
|
1352
1365
|
.action(actionRunner(sitesList))
|
|
1353
1366
|
|
|
@@ -1459,6 +1472,7 @@ sites
|
|
|
1459
1472
|
.requiredOption(`--site-id <site-id>`, `Site ID.`)
|
|
1460
1473
|
.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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type`)
|
|
1461
1474
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
1475
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
|
|
1462
1476
|
.option(`--console`, `Get the resource console url`)
|
|
1463
1477
|
.action(actionRunner(sitesListDeployments))
|
|
1464
1478
|
|
|
@@ -1537,6 +1551,7 @@ sites
|
|
|
1537
1551
|
.description(`Get a list of all site logs. You can use the query params to filter your results.`)
|
|
1538
1552
|
.requiredOption(`--site-id <site-id>`, `Site ID.`)
|
|
1539
1553
|
.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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId`)
|
|
1554
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
|
|
1540
1555
|
.action(actionRunner(sitesListLogs))
|
|
1541
1556
|
|
|
1542
1557
|
sites
|
package/lib/commands/storage.js
CHANGED
|
@@ -43,6 +43,7 @@ const storage = new Command("storage").description(commandDescriptions['storage'
|
|
|
43
43
|
* @typedef {Object} StorageListBucketsRequestParams
|
|
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: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus
|
|
45
45
|
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
46
|
+
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
|
|
46
47
|
* @property {boolean} overrideForCli
|
|
47
48
|
* @property {boolean} parseOutput
|
|
48
49
|
* @property {libClient | undefined} sdk
|
|
@@ -51,7 +52,7 @@ const storage = new Command("storage").description(commandDescriptions['storage'
|
|
|
51
52
|
/**
|
|
52
53
|
* @param {StorageListBucketsRequestParams} params
|
|
53
54
|
*/
|
|
54
|
-
const storageListBuckets = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
55
|
+
const storageListBuckets = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
55
56
|
let client = !sdk ? await sdkForProject() :
|
|
56
57
|
sdk;
|
|
57
58
|
let apiPath = '/storage/buckets';
|
|
@@ -62,6 +63,9 @@ const storageListBuckets = async ({queries,search,parseOutput = true, overrideFo
|
|
|
62
63
|
if (typeof search !== 'undefined') {
|
|
63
64
|
payload['search'] = search;
|
|
64
65
|
}
|
|
66
|
+
if (typeof total !== 'undefined') {
|
|
67
|
+
payload['total'] = total;
|
|
68
|
+
}
|
|
65
69
|
|
|
66
70
|
let response = undefined;
|
|
67
71
|
|
|
@@ -286,6 +290,7 @@ const storageDeleteBucket = async ({bucketId,parseOutput = true, overrideForCli
|
|
|
286
290
|
* @property {string} bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
|
287
291
|
* @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, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
|
|
288
292
|
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
293
|
+
* @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
|
|
289
294
|
* @property {boolean} overrideForCli
|
|
290
295
|
* @property {boolean} parseOutput
|
|
291
296
|
* @property {libClient | undefined} sdk
|
|
@@ -294,7 +299,7 @@ const storageDeleteBucket = async ({bucketId,parseOutput = true, overrideForCli
|
|
|
294
299
|
/**
|
|
295
300
|
* @param {StorageListFilesRequestParams} params
|
|
296
301
|
*/
|
|
297
|
-
const storageListFiles = async ({bucketId,queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
302
|
+
const storageListFiles = async ({bucketId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
298
303
|
let client = !sdk ? await sdkForProject() :
|
|
299
304
|
sdk;
|
|
300
305
|
let apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);
|
|
@@ -305,6 +310,9 @@ const storageListFiles = async ({bucketId,queries,search,parseOutput = true, ove
|
|
|
305
310
|
if (typeof search !== 'undefined') {
|
|
306
311
|
payload['search'] = search;
|
|
307
312
|
}
|
|
313
|
+
if (typeof total !== 'undefined') {
|
|
314
|
+
payload['total'] = total;
|
|
315
|
+
}
|
|
308
316
|
|
|
309
317
|
let response = undefined;
|
|
310
318
|
|
|
@@ -815,6 +823,7 @@ storage
|
|
|
815
823
|
.description(`Get a list of all the storage buckets. You can use the query params to filter your results.`)
|
|
816
824
|
.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: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus`)
|
|
817
825
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
826
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
|
|
818
827
|
.option(`--console`, `Get the resource console url`)
|
|
819
828
|
.action(actionRunner(storageListBuckets))
|
|
820
829
|
|
|
@@ -867,6 +876,7 @@ storage
|
|
|
867
876
|
.requiredOption(`--bucket-id <bucket-id>`, `Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).`)
|
|
868
877
|
.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, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded`)
|
|
869
878
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
879
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
|
|
870
880
|
.option(`--console`, `Get the resource console url`)
|
|
871
881
|
.action(actionRunner(storageListFiles))
|
|
872
882
|
|