appwrite-cli 12.0.0 → 13.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/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +145 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/client.d.ts +89 -0
- package/dist/lib/client.d.ts.map +1 -0
- package/dist/lib/client.js +227 -0
- package/dist/lib/client.js.map +1 -0
- package/dist/lib/commands/account.d.ts +379 -0
- package/dist/lib/commands/account.d.ts.map +1 -0
- package/dist/lib/commands/account.js +1228 -0
- package/dist/lib/commands/account.js.map +1 -0
- package/dist/lib/commands/console.d.ts +20 -0
- package/dist/lib/commands/console.d.ts.map +1 -0
- package/dist/lib/commands/console.js +78 -0
- package/dist/lib/commands/console.js.map +1 -0
- package/dist/lib/commands/databases.d.ts +732 -0
- package/dist/lib/commands/databases.d.ts.map +1 -0
- package/dist/lib/commands/databases.js +2196 -0
- package/dist/lib/commands/databases.js.map +1 -0
- package/dist/lib/commands/functions.d.ts +310 -0
- package/dist/lib/commands/functions.d.ts.map +1 -0
- package/dist/lib/commands/functions.js +1100 -0
- package/dist/lib/commands/functions.js.map +1 -0
- package/dist/lib/commands/generic.d.ts +17 -0
- package/dist/lib/commands/generic.d.ts.map +1 -0
- package/dist/lib/commands/generic.js +279 -0
- package/dist/lib/commands/generic.js.map +1 -0
- package/dist/lib/commands/graphql.d.ts +19 -0
- package/dist/lib/commands/graphql.d.ts.map +1 -0
- package/dist/lib/commands/graphql.js +77 -0
- package/dist/lib/commands/graphql.js.map +1 -0
- package/dist/lib/commands/health.d.ts +153 -0
- package/dist/lib/commands/health.d.ts.map +1 -0
- package/dist/lib/commands/health.js +464 -0
- package/dist/lib/commands/health.js.map +1 -0
- package/dist/lib/commands/init.d.ts +3 -0
- package/dist/lib/commands/init.d.ts.map +1 -0
- package/dist/lib/commands/init.js +518 -0
- package/dist/lib/commands/init.js.map +1 -0
- package/dist/lib/commands/locale.d.ts +53 -0
- package/dist/lib/commands/locale.d.ts.map +1 -0
- package/dist/lib/commands/locale.js +165 -0
- package/dist/lib/commands/locale.js.map +1 -0
- package/dist/lib/commands/messaging.d.ts +588 -0
- package/dist/lib/commands/messaging.d.ts.map +1 -0
- package/dist/lib/commands/messaging.js +2042 -0
- package/dist/lib/commands/messaging.js.map +1 -0
- package/dist/lib/commands/migrations.d.ts +150 -0
- package/dist/lib/commands/migrations.d.ts.map +1 -0
- package/dist/lib/commands/migrations.js +524 -0
- package/dist/lib/commands/migrations.js.map +1 -0
- package/dist/lib/commands/organizations.d.ts +11 -0
- package/dist/lib/commands/organizations.d.ts.map +1 -0
- package/dist/lib/commands/organizations.js +31 -0
- package/dist/lib/commands/organizations.js.map +1 -0
- package/dist/lib/commands/project.d.ts +53 -0
- package/dist/lib/commands/project.d.ts.map +1 -0
- package/dist/lib/commands/project.js +176 -0
- package/dist/lib/commands/project.js.map +1 -0
- package/dist/lib/commands/projects.d.ts +516 -0
- package/dist/lib/commands/projects.d.ts.map +1 -0
- package/dist/lib/commands/projects.js +1590 -0
- package/dist/lib/commands/projects.js.map +1 -0
- package/dist/lib/commands/proxy.d.ts +71 -0
- package/dist/lib/commands/proxy.d.ts.map +1 -0
- package/dist/lib/commands/proxy.js +240 -0
- package/dist/lib/commands/proxy.js.map +1 -0
- package/dist/lib/commands/pull.d.ts +8 -0
- package/dist/lib/commands/pull.d.ts.map +1 -0
- package/dist/lib/commands/pull.js +455 -0
- package/dist/lib/commands/pull.js.map +1 -0
- package/dist/lib/commands/push.d.ts +4 -0
- package/dist/lib/commands/push.d.ts.map +1 -0
- package/dist/lib/commands/push.js +2154 -0
- package/dist/lib/commands/push.js.map +1 -0
- package/dist/lib/commands/run.d.ts +3 -0
- package/dist/lib/commands/run.d.ts.map +1 -0
- package/dist/lib/commands/run.js +287 -0
- package/dist/lib/commands/run.js.map +1 -0
- package/dist/lib/commands/sites.d.ts +296 -0
- package/dist/lib/commands/sites.d.ts.map +1 -0
- package/dist/lib/commands/sites.js +1046 -0
- package/dist/lib/commands/sites.js.map +1 -0
- package/dist/lib/commands/storage.d.ts +170 -0
- package/dist/lib/commands/storage.d.ts.map +1 -0
- package/dist/lib/commands/storage.js +651 -0
- package/dist/lib/commands/storage.js.map +1 -0
- package/dist/lib/commands/tables-db.d.ts +728 -0
- package/dist/lib/commands/tables-db.d.ts.map +1 -0
- package/dist/lib/commands/tables-db.js +2198 -0
- package/dist/lib/commands/tables-db.js.map +1 -0
- package/dist/lib/commands/teams.d.ts +129 -0
- package/dist/lib/commands/teams.d.ts.map +1 -0
- package/dist/lib/commands/teams.js +403 -0
- package/dist/lib/commands/teams.js.map +1 -0
- package/dist/lib/commands/tokens.d.ts +48 -0
- package/dist/lib/commands/tokens.d.ts.map +1 -0
- package/dist/lib/commands/tokens.js +156 -0
- package/dist/lib/commands/tokens.js.map +1 -0
- package/dist/lib/commands/types.d.ts +3 -0
- package/dist/lib/commands/types.d.ts.map +1 -0
- package/dist/lib/commands/types.js +155 -0
- package/dist/lib/commands/types.js.map +1 -0
- package/dist/lib/commands/update.d.ts +3 -0
- package/dist/lib/commands/update.d.ts.map +1 -0
- package/dist/lib/commands/update.js +202 -0
- package/dist/lib/commands/update.js.map +1 -0
- package/dist/lib/commands/users.d.ts +382 -0
- package/dist/lib/commands/users.d.ts.map +1 -0
- package/dist/lib/commands/users.js +1195 -0
- package/dist/lib/commands/users.js.map +1 -0
- package/dist/lib/commands/vcs.d.ts +92 -0
- package/dist/lib/commands/vcs.d.ts.map +1 -0
- package/dist/lib/commands/vcs.js +276 -0
- package/dist/lib/commands/vcs.js.map +1 -0
- package/dist/lib/config.d.ts +118 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/{lib → dist/lib}/config.js +204 -325
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/emulation/docker.d.ts +15 -0
- package/dist/lib/emulation/docker.d.ts.map +1 -0
- package/dist/lib/emulation/docker.js +220 -0
- package/dist/lib/emulation/docker.js.map +1 -0
- package/dist/lib/emulation/utils.d.ts +29 -0
- package/dist/lib/emulation/utils.d.ts.map +1 -0
- package/dist/lib/emulation/utils.js +168 -0
- package/dist/lib/emulation/utils.js.map +1 -0
- package/dist/lib/exception.d.ts +8 -0
- package/dist/lib/exception.d.ts.map +1 -0
- package/dist/lib/exception.js +16 -0
- package/dist/lib/exception.js.map +1 -0
- package/dist/lib/id.d.ts +7 -0
- package/dist/lib/id.d.ts.map +1 -0
- package/dist/lib/id.js +32 -0
- package/dist/lib/id.js.map +1 -0
- package/dist/lib/paginate.d.ts +10 -0
- package/dist/lib/paginate.d.ts.map +1 -0
- package/{lib → dist/lib}/paginate.js +9 -15
- package/dist/lib/paginate.js.map +1 -0
- package/dist/lib/parser.d.ts +18 -0
- package/dist/lib/parser.d.ts.map +1 -0
- package/dist/lib/parser.js +237 -0
- package/dist/lib/parser.js.map +1 -0
- package/dist/lib/questions.d.ts +59 -0
- package/dist/lib/questions.d.ts.map +1 -0
- package/dist/lib/questions.js +995 -0
- package/dist/lib/questions.js.map +1 -0
- package/dist/lib/sdks.d.ts +4 -0
- package/dist/lib/sdks.d.ts.map +1 -0
- package/dist/lib/sdks.js +51 -0
- package/dist/lib/sdks.js.map +1 -0
- package/dist/lib/spinner.d.ts +28 -0
- package/dist/lib/spinner.d.ts.map +1 -0
- package/{lib → dist/lib}/spinner.js +34 -45
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/type-generation/attribute.d.ts +17 -0
- package/dist/lib/type-generation/attribute.d.ts.map +1 -0
- package/dist/lib/type-generation/attribute.js +19 -0
- package/dist/lib/type-generation/attribute.js.map +1 -0
- package/dist/lib/type-generation/languages/csharp.d.ts +7 -0
- package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/csharp.js +180 -0
- package/dist/lib/type-generation/languages/csharp.js.map +1 -0
- package/dist/lib/type-generation/languages/dart.d.ts +8 -0
- package/dist/lib/type-generation/languages/dart.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/dart.js +197 -0
- package/dist/lib/type-generation/languages/dart.js.map +1 -0
- package/dist/lib/type-generation/languages/java.d.ts +7 -0
- package/dist/lib/type-generation/languages/java.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/java.js +140 -0
- package/dist/lib/type-generation/languages/java.js.map +1 -0
- package/dist/lib/type-generation/languages/javascript.d.ts +9 -0
- package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/javascript.js +108 -0
- package/dist/lib/type-generation/languages/javascript.js.map +1 -0
- package/dist/lib/type-generation/languages/kotlin.d.ts +7 -0
- package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/kotlin.js +95 -0
- package/dist/lib/type-generation/languages/kotlin.js.map +1 -0
- package/dist/lib/type-generation/languages/language.d.ts +43 -0
- package/dist/lib/type-generation/languages/language.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/language.js +82 -0
- package/dist/lib/type-generation/languages/language.js.map +1 -0
- package/dist/lib/type-generation/languages/php.d.ts +7 -0
- package/dist/lib/type-generation/languages/php.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/php.js +116 -0
- package/dist/lib/type-generation/languages/php.js.map +1 -0
- package/dist/lib/type-generation/languages/swift.d.ts +7 -0
- package/dist/lib/type-generation/languages/swift.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/swift.js +179 -0
- package/dist/lib/type-generation/languages/swift.js.map +1 -0
- package/dist/lib/type-generation/languages/typescript.d.ts +9 -0
- package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/typescript.js +112 -0
- package/dist/lib/type-generation/languages/typescript.js.map +1 -0
- package/dist/lib/types.d.ts +133 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +3 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +15 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/{lib → dist/lib}/utils.js +74 -120
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/validations.d.ts +2 -0
- package/dist/lib/validations.d.ts.map +1 -0
- package/dist/lib/validations.js +20 -0
- package/dist/lib/validations.js.map +1 -0
- package/docs/examples/databases/upsert-document.md +1 -2
- package/index.ts +152 -0
- package/install.ps1 +2 -5
- package/install.sh +1 -2
- package/lib/client.ts +259 -0
- package/lib/commands/{account.js → account.ts} +410 -664
- package/lib/commands/console.ts +112 -0
- package/lib/commands/{databases.js → databases.ts} +818 -1136
- package/lib/commands/{functions.js → functions.ts} +381 -526
- package/lib/commands/{generic.js → generic.ts} +47 -39
- package/lib/commands/graphql.ts +110 -0
- package/lib/commands/{health.js → health.ts} +168 -284
- package/lib/commands/{init.js → init.ts} +68 -66
- package/lib/commands/{locale.js → locale.ts} +75 -121
- package/lib/commands/{messaging.js → messaging.ts} +699 -937
- package/lib/commands/{migrations.js → migrations.ts} +182 -258
- package/lib/commands/organizations.ts +46 -0
- package/lib/commands/{project.js → project.ts} +75 -111
- package/lib/commands/{projects.js → projects.ts} +587 -843
- package/lib/commands/{proxy.js → proxy.ts} +94 -140
- package/lib/commands/{pull.js → pull.ts} +54 -44
- package/lib/commands/{push.js → push.ts} +235 -191
- package/lib/commands/{run.js → run.ts} +61 -55
- package/lib/commands/{sites.js → sites.ts} +364 -504
- package/lib/commands/{storage.js → storage.ts} +216 -292
- package/lib/commands/{tables-db.js → tables-db.ts} +817 -1126
- package/lib/commands/{teams.js → teams.ts} +162 -236
- package/lib/commands/{tokens.js → tokens.ts} +70 -99
- package/lib/commands/{types.js → types.ts} +37 -35
- package/lib/commands/{update.js → update.ts} +25 -27
- package/lib/commands/{users.js → users.ts} +426 -644
- package/lib/commands/{vcs.js → vcs.ts} +122 -173
- package/lib/config.ts +854 -0
- package/lib/emulation/{docker.js → docker.ts} +39 -38
- package/lib/emulation/utils.ts +193 -0
- package/lib/exception.ts +20 -0
- package/lib/{id.js → id.ts} +5 -5
- package/lib/paginate.ts +63 -0
- package/lib/parser.ts +238 -0
- package/lib/{questions.js → questions.ts} +148 -156
- package/lib/sdks.ts +55 -0
- package/lib/spinner.ts +118 -0
- package/lib/type-generation/attribute.ts +17 -0
- package/lib/type-generation/languages/{csharp.js → csharp.ts} +59 -48
- package/lib/type-generation/languages/{dart.js → dart.ts} +91 -80
- package/lib/type-generation/languages/{java.js → java.ts} +58 -47
- package/lib/type-generation/languages/javascript.ts +111 -0
- package/lib/type-generation/languages/kotlin.ts +96 -0
- package/lib/type-generation/languages/language.ts +119 -0
- package/lib/type-generation/languages/{php.js → php.ts} +55 -48
- package/lib/type-generation/languages/{swift.js → swift.ts} +59 -48
- package/lib/type-generation/languages/typescript.ts +116 -0
- package/lib/types.ts +150 -0
- package/lib/utils.ts +322 -0
- package/lib/validations.ts +17 -0
- package/package.json +21 -12
- package/scoop/appwrite.config.json +3 -3
- package/tsconfig.json +30 -0
- package/index.js +0 -147
- package/lib/client.js +0 -254
- package/lib/commands/console.js +0 -127
- package/lib/commands/graphql.js +0 -126
- package/lib/commands/organizations.js +0 -48
- package/lib/emulation/utils.js +0 -186
- package/lib/exception.js +0 -9
- package/lib/parser.js +0 -250
- package/lib/sdks.js +0 -60
- package/lib/type-generation/attribute.js +0 -16
- package/lib/type-generation/languages/javascript.js +0 -102
- package/lib/type-generation/languages/kotlin.js +0 -85
- package/lib/type-generation/languages/language.js +0 -125
- package/lib/type-generation/languages/typescript.js +0 -107
- package/lib/validations.js +0 -17
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* @param {fs.ReadStream} readStream
|
|
17
|
-
* @returns {ReadableStream}
|
|
18
|
-
*/
|
|
19
|
-
function convertReadStreamToReadableStream(readStream) {
|
|
1
|
+
import fs = require('fs');
|
|
2
|
+
import pathLib = require('path');
|
|
3
|
+
import tar = require('tar');
|
|
4
|
+
import ignore = require('ignore');
|
|
5
|
+
import { promisify } from 'util';
|
|
6
|
+
import Client from '../client';
|
|
7
|
+
import { getAllFiles, showConsoleLink } from '../utils';
|
|
8
|
+
import { Command } from 'commander';
|
|
9
|
+
import { sdkForProject, sdkForConsole } from '../sdks';
|
|
10
|
+
import { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } from '../parser';
|
|
11
|
+
import { localConfig, globalConfig } from '../config';
|
|
12
|
+
import { File } from 'undici';
|
|
13
|
+
import { ReadableStream } from 'stream/web';
|
|
14
|
+
|
|
15
|
+
function convertReadStreamToReadableStream(readStream: fs.ReadStream): ReadableStream {
|
|
20
16
|
return new ReadableStream({
|
|
21
17
|
start(controller) {
|
|
22
|
-
readStream.on("data", (chunk) => {
|
|
18
|
+
readStream.on("data", (chunk: Buffer) => {
|
|
23
19
|
controller.enqueue(chunk);
|
|
24
20
|
});
|
|
25
21
|
readStream.on("end", () => {
|
|
26
22
|
controller.close();
|
|
27
23
|
});
|
|
28
|
-
readStream.on("error", (err) => {
|
|
24
|
+
readStream.on("error", (err: Error) => {
|
|
29
25
|
controller.error(err);
|
|
30
26
|
});
|
|
31
27
|
},
|
|
@@ -35,24 +31,21 @@ function convertReadStreamToReadableStream(readStream) {
|
|
|
35
31
|
});
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
const storage = new Command("storage").description(commandDescriptions['storage'] ?? '').configureHelp({
|
|
34
|
+
export const storage = new Command("storage").description(commandDescriptions['storage'] ?? '').configureHelp({
|
|
39
35
|
helpWidth: process.stdout.columns || 80
|
|
40
36
|
})
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
* @param {StorageListBucketsRequestParams} params
|
|
54
|
-
*/
|
|
55
|
-
const storageListBuckets = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
38
|
+
interface StorageListBucketsRequestParams {
|
|
39
|
+
queries?: string[];
|
|
40
|
+
search?: string;
|
|
41
|
+
total?: boolean;
|
|
42
|
+
overrideForCli?: boolean;
|
|
43
|
+
parseOutput?: boolean;
|
|
44
|
+
sdk?: Client;
|
|
45
|
+
console?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const storageListBuckets = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: StorageListBucketsRequestParams): Promise<any> => {
|
|
56
49
|
let client = !sdk ? await sdkForProject() :
|
|
57
50
|
sdk;
|
|
58
51
|
let apiPath = '/storage/buckets';
|
|
@@ -73,7 +66,7 @@ const storageListBuckets = async ({queries,search,total,parseOutput = true, over
|
|
|
73
66
|
}, payload);
|
|
74
67
|
|
|
75
68
|
if (parseOutput) {
|
|
76
|
-
if(
|
|
69
|
+
if(showConsole) {
|
|
77
70
|
showConsoleLink('storage', 'listBuckets');
|
|
78
71
|
} else {
|
|
79
72
|
parse(response)
|
|
@@ -83,28 +76,24 @@ const storageListBuckets = async ({queries,search,total,parseOutput = true, over
|
|
|
83
76
|
return response;
|
|
84
77
|
|
|
85
78
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* @param {StorageCreateBucketRequestParams} params
|
|
106
|
-
*/
|
|
107
|
-
const storageCreateBucket = async ({bucketId,name,permissions,fileSecurity,enabled,maximumFileSize,allowedFileExtensions,compression,encryption,antivirus,transformations,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
79
|
+
interface StorageCreateBucketRequestParams {
|
|
80
|
+
bucketId: string;
|
|
81
|
+
name: string;
|
|
82
|
+
permissions?: string[];
|
|
83
|
+
fileSecurity?: boolean;
|
|
84
|
+
enabled?: boolean;
|
|
85
|
+
maximumFileSize?: number;
|
|
86
|
+
allowedFileExtensions?: string[];
|
|
87
|
+
compression?: Compression;
|
|
88
|
+
encryption?: boolean;
|
|
89
|
+
antivirus?: boolean;
|
|
90
|
+
transformations?: boolean;
|
|
91
|
+
overrideForCli?: boolean;
|
|
92
|
+
parseOutput?: boolean;
|
|
93
|
+
sdk?: Client;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const storageCreateBucket = async ({bucketId,name,permissions,fileSecurity,enabled,maximumFileSize,allowedFileExtensions,compression,encryption,antivirus,transformations,parseOutput = true, overrideForCli = false, sdk = undefined}: StorageCreateBucketRequestParams): Promise<any> => {
|
|
108
97
|
let client = !sdk ? await sdkForProject() :
|
|
109
98
|
sdk;
|
|
110
99
|
let apiPath = '/storage/buckets';
|
|
@@ -158,18 +147,15 @@ const storageCreateBucket = async ({bucketId,name,permissions,fileSecurity,enabl
|
|
|
158
147
|
return response;
|
|
159
148
|
|
|
160
149
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
* @param {StorageGetBucketRequestParams} params
|
|
171
|
-
*/
|
|
172
|
-
const storageGetBucket = async ({bucketId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
150
|
+
interface StorageGetBucketRequestParams {
|
|
151
|
+
bucketId: string;
|
|
152
|
+
overrideForCli?: boolean;
|
|
153
|
+
parseOutput?: boolean;
|
|
154
|
+
sdk?: Client;
|
|
155
|
+
console?: boolean;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export const storageGetBucket = async ({bucketId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: StorageGetBucketRequestParams): Promise<any> => {
|
|
173
159
|
let client = !sdk ? await sdkForProject() :
|
|
174
160
|
sdk;
|
|
175
161
|
let apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);
|
|
@@ -181,7 +167,7 @@ const storageGetBucket = async ({bucketId,parseOutput = true, overrideForCli = f
|
|
|
181
167
|
}, payload);
|
|
182
168
|
|
|
183
169
|
if (parseOutput) {
|
|
184
|
-
if(
|
|
170
|
+
if(showConsole) {
|
|
185
171
|
showConsoleLink('storage', 'getBucket', bucketId);
|
|
186
172
|
} else {
|
|
187
173
|
parse(response)
|
|
@@ -191,28 +177,24 @@ const storageGetBucket = async ({bucketId,parseOutput = true, overrideForCli = f
|
|
|
191
177
|
return response;
|
|
192
178
|
|
|
193
179
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* @param {StorageUpdateBucketRequestParams} params
|
|
214
|
-
*/
|
|
215
|
-
const storageUpdateBucket = async ({bucketId,name,permissions,fileSecurity,enabled,maximumFileSize,allowedFileExtensions,compression,encryption,antivirus,transformations,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
180
|
+
interface StorageUpdateBucketRequestParams {
|
|
181
|
+
bucketId: string;
|
|
182
|
+
name: string;
|
|
183
|
+
permissions?: string[];
|
|
184
|
+
fileSecurity?: boolean;
|
|
185
|
+
enabled?: boolean;
|
|
186
|
+
maximumFileSize?: number;
|
|
187
|
+
allowedFileExtensions?: string[];
|
|
188
|
+
compression?: Compression;
|
|
189
|
+
encryption?: boolean;
|
|
190
|
+
antivirus?: boolean;
|
|
191
|
+
transformations?: boolean;
|
|
192
|
+
overrideForCli?: boolean;
|
|
193
|
+
parseOutput?: boolean;
|
|
194
|
+
sdk?: Client;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export const storageUpdateBucket = async ({bucketId,name,permissions,fileSecurity,enabled,maximumFileSize,allowedFileExtensions,compression,encryption,antivirus,transformations,parseOutput = true, overrideForCli = false, sdk = undefined}: StorageUpdateBucketRequestParams): Promise<any> => {
|
|
216
198
|
let client = !sdk ? await sdkForProject() :
|
|
217
199
|
sdk;
|
|
218
200
|
let apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);
|
|
@@ -263,18 +245,14 @@ const storageUpdateBucket = async ({bucketId,name,permissions,fileSecurity,enabl
|
|
|
263
245
|
return response;
|
|
264
246
|
|
|
265
247
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* @param {StorageDeleteBucketRequestParams} params
|
|
276
|
-
*/
|
|
277
|
-
const storageDeleteBucket = async ({bucketId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
248
|
+
interface StorageDeleteBucketRequestParams {
|
|
249
|
+
bucketId: string;
|
|
250
|
+
overrideForCli?: boolean;
|
|
251
|
+
parseOutput?: boolean;
|
|
252
|
+
sdk?: Client;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export const storageDeleteBucket = async ({bucketId,parseOutput = true, overrideForCli = false, sdk = undefined}: StorageDeleteBucketRequestParams): Promise<any> => {
|
|
278
256
|
let client = !sdk ? await sdkForProject() :
|
|
279
257
|
sdk;
|
|
280
258
|
let apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);
|
|
@@ -293,21 +271,18 @@ const storageDeleteBucket = async ({bucketId,parseOutput = true, overrideForCli
|
|
|
293
271
|
return response;
|
|
294
272
|
|
|
295
273
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
* @param {StorageListFilesRequestParams} params
|
|
309
|
-
*/
|
|
310
|
-
const storageListFiles = async ({bucketId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
274
|
+
interface StorageListFilesRequestParams {
|
|
275
|
+
bucketId: string;
|
|
276
|
+
queries?: string[];
|
|
277
|
+
search?: string;
|
|
278
|
+
total?: boolean;
|
|
279
|
+
overrideForCli?: boolean;
|
|
280
|
+
parseOutput?: boolean;
|
|
281
|
+
sdk?: Client;
|
|
282
|
+
console?: boolean;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export const storageListFiles = async ({bucketId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: StorageListFilesRequestParams): Promise<any> => {
|
|
311
286
|
let client = !sdk ? await sdkForProject() :
|
|
312
287
|
sdk;
|
|
313
288
|
let apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);
|
|
@@ -328,7 +303,7 @@ const storageListFiles = async ({bucketId,queries,search,total,parseOutput = tru
|
|
|
328
303
|
}, payload);
|
|
329
304
|
|
|
330
305
|
if (parseOutput) {
|
|
331
|
-
if(
|
|
306
|
+
if(showConsole) {
|
|
332
307
|
showConsoleLink('storage', 'listFiles', bucketId);
|
|
333
308
|
} else {
|
|
334
309
|
parse(response)
|
|
@@ -338,22 +313,18 @@ const storageListFiles = async ({bucketId,queries,search,total,parseOutput = tru
|
|
|
338
313
|
return response;
|
|
339
314
|
|
|
340
315
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* @param {StorageCreateFileRequestParams} params
|
|
355
|
-
*/
|
|
356
|
-
const storageCreateFile = async ({bucketId,fileId,file,permissions,parseOutput = true, overrideForCli = false, sdk = undefined,onProgress = () => {}}) => {
|
|
316
|
+
interface StorageCreateFileRequestParams {
|
|
317
|
+
bucketId: string;
|
|
318
|
+
fileId: string;
|
|
319
|
+
file: string;
|
|
320
|
+
permissions?: string[];
|
|
321
|
+
overrideForCli?: boolean;
|
|
322
|
+
parseOutput?: boolean;
|
|
323
|
+
sdk?: Client;
|
|
324
|
+
onProgress?: (progress: number) => void;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export const storageCreateFile = async ({bucketId,fileId,file,permissions,parseOutput = true, overrideForCli = false, sdk = undefined,onProgress = () => {}}: StorageCreateFileRequestParams): Promise<any> => {
|
|
357
328
|
let client = !sdk ? await sdkForProject() :
|
|
358
329
|
sdk;
|
|
359
330
|
let apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);
|
|
@@ -470,19 +441,16 @@ const storageCreateFile = async ({bucketId,fileId,file,permissions,parseOutput =
|
|
|
470
441
|
|
|
471
442
|
return response;
|
|
472
443
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
* @param {StorageGetFileRequestParams} params
|
|
484
|
-
*/
|
|
485
|
-
const storageGetFile = async ({bucketId,fileId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
444
|
+
interface StorageGetFileRequestParams {
|
|
445
|
+
bucketId: string;
|
|
446
|
+
fileId: string;
|
|
447
|
+
overrideForCli?: boolean;
|
|
448
|
+
parseOutput?: boolean;
|
|
449
|
+
sdk?: Client;
|
|
450
|
+
console?: boolean;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export const storageGetFile = async ({bucketId,fileId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: StorageGetFileRequestParams): Promise<any> => {
|
|
486
454
|
let client = !sdk ? await sdkForProject() :
|
|
487
455
|
sdk;
|
|
488
456
|
let apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
@@ -494,7 +462,7 @@ const storageGetFile = async ({bucketId,fileId,parseOutput = true, overrideForCl
|
|
|
494
462
|
}, payload);
|
|
495
463
|
|
|
496
464
|
if (parseOutput) {
|
|
497
|
-
if(
|
|
465
|
+
if(showConsole) {
|
|
498
466
|
showConsoleLink('storage', 'getFile', bucketId, fileId);
|
|
499
467
|
} else {
|
|
500
468
|
parse(response)
|
|
@@ -504,21 +472,17 @@ const storageGetFile = async ({bucketId,fileId,parseOutput = true, overrideForCl
|
|
|
504
472
|
return response;
|
|
505
473
|
|
|
506
474
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
* @param {StorageUpdateFileRequestParams} params
|
|
520
|
-
*/
|
|
521
|
-
const storageUpdateFile = async ({bucketId,fileId,name,permissions,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
475
|
+
interface StorageUpdateFileRequestParams {
|
|
476
|
+
bucketId: string;
|
|
477
|
+
fileId: string;
|
|
478
|
+
name?: string;
|
|
479
|
+
permissions?: string[];
|
|
480
|
+
overrideForCli?: boolean;
|
|
481
|
+
parseOutput?: boolean;
|
|
482
|
+
sdk?: Client;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export const storageUpdateFile = async ({bucketId,fileId,name,permissions,parseOutput = true, overrideForCli = false, sdk = undefined}: StorageUpdateFileRequestParams): Promise<any> => {
|
|
522
486
|
let client = !sdk ? await sdkForProject() :
|
|
523
487
|
sdk;
|
|
524
488
|
let apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
@@ -544,19 +508,15 @@ const storageUpdateFile = async ({bucketId,fileId,name,permissions,parseOutput =
|
|
|
544
508
|
return response;
|
|
545
509
|
|
|
546
510
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* @param {StorageDeleteFileRequestParams} params
|
|
558
|
-
*/
|
|
559
|
-
const storageDeleteFile = async ({bucketId,fileId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
511
|
+
interface StorageDeleteFileRequestParams {
|
|
512
|
+
bucketId: string;
|
|
513
|
+
fileId: string;
|
|
514
|
+
overrideForCli?: boolean;
|
|
515
|
+
parseOutput?: boolean;
|
|
516
|
+
sdk?: Client;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export const storageDeleteFile = async ({bucketId,fileId,parseOutput = true, overrideForCli = false, sdk = undefined}: StorageDeleteFileRequestParams): Promise<any> => {
|
|
560
520
|
let client = !sdk ? await sdkForProject() :
|
|
561
521
|
sdk;
|
|
562
522
|
let apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
@@ -575,21 +535,17 @@ const storageDeleteFile = async ({bucketId,fileId,parseOutput = true, overrideFo
|
|
|
575
535
|
return response;
|
|
576
536
|
|
|
577
537
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
* @param {StorageGetFileDownloadRequestParams} params
|
|
591
|
-
*/
|
|
592
|
-
const storageGetFileDownload = async ({bucketId,fileId,token,parseOutput = true, overrideForCli = false, sdk = undefined, destination}) => {
|
|
538
|
+
interface StorageGetFileDownloadRequestParams {
|
|
539
|
+
bucketId: string;
|
|
540
|
+
fileId: string;
|
|
541
|
+
token?: string;
|
|
542
|
+
overrideForCli?: boolean;
|
|
543
|
+
parseOutput?: boolean;
|
|
544
|
+
sdk?: Client;
|
|
545
|
+
destination?: string;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
export const storageGetFileDownload = async ({bucketId,fileId,token,parseOutput = true, overrideForCli = false, sdk = undefined, destination}: StorageGetFileDownloadRequestParams): Promise<any> => {
|
|
593
549
|
let client = !sdk ? await sdkForProject() :
|
|
594
550
|
sdk;
|
|
595
551
|
let apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
@@ -621,32 +577,28 @@ const storageGetFileDownload = async ({bucketId,fileId,token,parseOutput = true,
|
|
|
621
577
|
return response;
|
|
622
578
|
|
|
623
579
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
/**
|
|
647
|
-
* @param {StorageGetFilePreviewRequestParams} params
|
|
648
|
-
*/
|
|
649
|
-
const storageGetFilePreview = async ({bucketId,fileId,width,height,gravity,quality,borderWidth,borderColor,borderRadius,opacity,rotation,background,output,token,parseOutput = true, overrideForCli = false, sdk = undefined, destination}) => {
|
|
580
|
+
interface StorageGetFilePreviewRequestParams {
|
|
581
|
+
bucketId: string;
|
|
582
|
+
fileId: string;
|
|
583
|
+
width?: number;
|
|
584
|
+
height?: number;
|
|
585
|
+
gravity?: ImageGravity;
|
|
586
|
+
quality?: number;
|
|
587
|
+
borderWidth?: number;
|
|
588
|
+
borderColor?: string;
|
|
589
|
+
borderRadius?: number;
|
|
590
|
+
opacity?: number;
|
|
591
|
+
rotation?: number;
|
|
592
|
+
background?: string;
|
|
593
|
+
output?: ImageFormat;
|
|
594
|
+
token?: string;
|
|
595
|
+
overrideForCli?: boolean;
|
|
596
|
+
parseOutput?: boolean;
|
|
597
|
+
sdk?: Client;
|
|
598
|
+
destination?: string;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export const storageGetFilePreview = async ({bucketId,fileId,width,height,gravity,quality,borderWidth,borderColor,borderRadius,opacity,rotation,background,output,token,parseOutput = true, overrideForCli = false, sdk = undefined, destination}: StorageGetFilePreviewRequestParams): Promise<any> => {
|
|
650
602
|
let client = !sdk ? await sdkForProject() :
|
|
651
603
|
sdk;
|
|
652
604
|
let apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
@@ -711,21 +663,17 @@ const storageGetFilePreview = async ({bucketId,fileId,width,height,gravity,quali
|
|
|
711
663
|
return response;
|
|
712
664
|
|
|
713
665
|
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
* @param {StorageGetFileViewRequestParams} params
|
|
727
|
-
*/
|
|
728
|
-
const storageGetFileView = async ({bucketId,fileId,token,parseOutput = true, overrideForCli = false, sdk = undefined, destination}) => {
|
|
666
|
+
interface StorageGetFileViewRequestParams {
|
|
667
|
+
bucketId: string;
|
|
668
|
+
fileId: string;
|
|
669
|
+
token?: string;
|
|
670
|
+
overrideForCli?: boolean;
|
|
671
|
+
parseOutput?: boolean;
|
|
672
|
+
sdk?: Client;
|
|
673
|
+
destination?: string;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
export const storageGetFileView = async ({bucketId,fileId,token,parseOutput = true, overrideForCli = false, sdk = undefined, destination}: StorageGetFileViewRequestParams): Promise<any> => {
|
|
729
677
|
let client = !sdk ? await sdkForProject() :
|
|
730
678
|
sdk;
|
|
731
679
|
let apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
@@ -757,18 +705,14 @@ const storageGetFileView = async ({bucketId,fileId,token,parseOutput = true, ove
|
|
|
757
705
|
return response;
|
|
758
706
|
|
|
759
707
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
/**
|
|
769
|
-
* @param {StorageGetUsageRequestParams} params
|
|
770
|
-
*/
|
|
771
|
-
const storageGetUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
708
|
+
interface StorageGetUsageRequestParams {
|
|
709
|
+
range?: UsageRange;
|
|
710
|
+
overrideForCli?: boolean;
|
|
711
|
+
parseOutput?: boolean;
|
|
712
|
+
sdk?: Client;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
export const storageGetUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined}: StorageGetUsageRequestParams): Promise<any> => {
|
|
772
716
|
let client = !sdk ? await sdkForProject() :
|
|
773
717
|
sdk;
|
|
774
718
|
let apiPath = '/storage/usage';
|
|
@@ -789,19 +733,16 @@ const storageGetUsage = async ({range,parseOutput = true, overrideForCli = false
|
|
|
789
733
|
return response;
|
|
790
734
|
|
|
791
735
|
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
* @param {StorageGetBucketUsageRequestParams} params
|
|
803
|
-
*/
|
|
804
|
-
const storageGetBucketUsage = async ({bucketId,range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
736
|
+
interface StorageGetBucketUsageRequestParams {
|
|
737
|
+
bucketId: string;
|
|
738
|
+
range?: UsageRange;
|
|
739
|
+
overrideForCli?: boolean;
|
|
740
|
+
parseOutput?: boolean;
|
|
741
|
+
sdk?: Client;
|
|
742
|
+
console?: boolean;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
export const storageGetBucketUsage = async ({bucketId,range,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: StorageGetBucketUsageRequestParams): Promise<any> => {
|
|
805
746
|
let client = !sdk ? await sdkForProject() :
|
|
806
747
|
sdk;
|
|
807
748
|
let apiPath = '/storage/{bucketId}/usage'.replace('{bucketId}', bucketId);
|
|
@@ -816,7 +757,7 @@ const storageGetBucketUsage = async ({bucketId,range,parseOutput = true, overrid
|
|
|
816
757
|
}, payload);
|
|
817
758
|
|
|
818
759
|
if (parseOutput) {
|
|
819
|
-
if(
|
|
760
|
+
if(showConsole) {
|
|
820
761
|
showConsoleLink('storage', 'getBucketUsage', bucketId);
|
|
821
762
|
} else {
|
|
822
763
|
parse(response)
|
|
@@ -831,7 +772,7 @@ storage
|
|
|
831
772
|
.description(`Get a list of all the storage buckets. You can use the query params to filter your results.`)
|
|
832
773
|
.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, transformations`)
|
|
833
774
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
834
|
-
.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))
|
|
775
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
835
776
|
.option(`--console`, `Get the resource console url`)
|
|
836
777
|
.action(actionRunner(storageListBuckets))
|
|
837
778
|
|
|
@@ -841,14 +782,14 @@ storage
|
|
|
841
782
|
.requiredOption(`--bucket-id <bucket-id>`, `Unique 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.`)
|
|
842
783
|
.requiredOption(`--name <name>`, `Bucket name`)
|
|
843
784
|
.option(`--permissions [permissions...]`, `An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
|
|
844
|
-
.option(`--file-security [value]`, `Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : parseBool(value))
|
|
845
|
-
.option(`--enabled [value]`, `Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
|
|
785
|
+
.option(`--file-security [value]`, `Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
786
|
+
.option(`--enabled [value]`, `Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
846
787
|
.option(`--maximum-file-size <maximum-file-size>`, `Maximum file size allowed in bytes. Maximum allowed value is 30MB.`, parseInteger)
|
|
847
788
|
.option(`--allowed-file-extensions [allowed-file-extensions...]`, `Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.`)
|
|
848
789
|
.option(`--compression <compression>`, `Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled`)
|
|
849
|
-
.option(`--encryption [value]`, `Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`, (value) => value === undefined ? true : parseBool(value))
|
|
850
|
-
.option(`--antivirus [value]`, `Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled`, (value) => value === undefined ? true : parseBool(value))
|
|
851
|
-
.option(`--transformations [value]`, `Are image transformations enabled?`, (value) => value === undefined ? true : parseBool(value))
|
|
790
|
+
.option(`--encryption [value]`, `Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
791
|
+
.option(`--antivirus [value]`, `Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
792
|
+
.option(`--transformations [value]`, `Are image transformations enabled?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
852
793
|
.action(actionRunner(storageCreateBucket))
|
|
853
794
|
|
|
854
795
|
storage
|
|
@@ -864,14 +805,14 @@ storage
|
|
|
864
805
|
.requiredOption(`--bucket-id <bucket-id>`, `Bucket unique ID.`)
|
|
865
806
|
.requiredOption(`--name <name>`, `Bucket name`)
|
|
866
807
|
.option(`--permissions [permissions...]`, `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
|
|
867
|
-
.option(`--file-security [value]`, `Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : parseBool(value))
|
|
868
|
-
.option(`--enabled [value]`, `Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
|
|
808
|
+
.option(`--file-security [value]`, `Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
809
|
+
.option(`--enabled [value]`, `Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
869
810
|
.option(`--maximum-file-size <maximum-file-size>`, `Maximum file size allowed in bytes. Maximum allowed value is 30MB.`, parseInteger)
|
|
870
811
|
.option(`--allowed-file-extensions [allowed-file-extensions...]`, `Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.`)
|
|
871
812
|
.option(`--compression <compression>`, `Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled`)
|
|
872
|
-
.option(`--encryption [value]`, `Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`, (value) => value === undefined ? true : parseBool(value))
|
|
873
|
-
.option(`--antivirus [value]`, `Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled`, (value) => value === undefined ? true : parseBool(value))
|
|
874
|
-
.option(`--transformations [value]`, `Are image transformations enabled?`, (value) => value === undefined ? true : parseBool(value))
|
|
813
|
+
.option(`--encryption [value]`, `Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
814
|
+
.option(`--antivirus [value]`, `Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
815
|
+
.option(`--transformations [value]`, `Are image transformations enabled?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
875
816
|
.action(actionRunner(storageUpdateBucket))
|
|
876
817
|
|
|
877
818
|
storage
|
|
@@ -886,7 +827,7 @@ storage
|
|
|
886
827
|
.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).`)
|
|
887
828
|
.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`)
|
|
888
829
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
889
|
-
.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))
|
|
830
|
+
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
890
831
|
.option(`--console`, `Get the resource console url`)
|
|
891
832
|
.action(actionRunner(storageListFiles))
|
|
892
833
|
|
|
@@ -975,21 +916,4 @@ storage
|
|
|
975
916
|
.option(`--console`, `Get the resource console url`)
|
|
976
917
|
.action(actionRunner(storageGetBucketUsage))
|
|
977
918
|
|
|
978
|
-
|
|
979
|
-
storage,
|
|
980
|
-
storageListBuckets,
|
|
981
|
-
storageCreateBucket,
|
|
982
|
-
storageGetBucket,
|
|
983
|
-
storageUpdateBucket,
|
|
984
|
-
storageDeleteBucket,
|
|
985
|
-
storageListFiles,
|
|
986
|
-
storageCreateFile,
|
|
987
|
-
storageGetFile,
|
|
988
|
-
storageUpdateFile,
|
|
989
|
-
storageDeleteFile,
|
|
990
|
-
storageGetFileDownload,
|
|
991
|
-
storageGetFilePreview,
|
|
992
|
-
storageGetFileView,
|
|
993
|
-
storageGetUsage,
|
|
994
|
-
storageGetBucketUsage
|
|
995
|
-
};
|
|
919
|
+
|