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,20 @@ function convertReadStreamToReadableStream(readStream) {
|
|
|
35
31
|
});
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
const project = new Command("project").description(commandDescriptions['project'] ?? '').configureHelp({
|
|
34
|
+
export const project = new Command("project").description(commandDescriptions['project'] ?? '').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 {ProjectGetUsageRequestParams} params
|
|
54
|
-
*/
|
|
55
|
-
const projectGetUsage = async ({startDate,endDate,period,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
38
|
+
interface ProjectGetUsageRequestParams {
|
|
39
|
+
startDate: string;
|
|
40
|
+
endDate: string;
|
|
41
|
+
period?: ProjectUsageRange;
|
|
42
|
+
overrideForCli?: boolean;
|
|
43
|
+
parseOutput?: boolean;
|
|
44
|
+
sdk?: Client;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const projectGetUsage = async ({startDate,endDate,period,parseOutput = true, overrideForCli = false, sdk = undefined}: ProjectGetUsageRequestParams): Promise<any> => {
|
|
56
48
|
let client = !sdk ? await sdkForProject() :
|
|
57
49
|
sdk;
|
|
58
50
|
let apiPath = '/project/usage';
|
|
@@ -79,17 +71,13 @@ const projectGetUsage = async ({startDate,endDate,period,parseOutput = true, ove
|
|
|
79
71
|
return response;
|
|
80
72
|
|
|
81
73
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @param {ProjectListVariablesRequestParams} params
|
|
91
|
-
*/
|
|
92
|
-
const projectListVariables = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
74
|
+
interface ProjectListVariablesRequestParams {
|
|
75
|
+
overrideForCli?: boolean;
|
|
76
|
+
parseOutput?: boolean;
|
|
77
|
+
sdk?: Client;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const projectListVariables = async ({parseOutput = true, overrideForCli = false, sdk = undefined}: ProjectListVariablesRequestParams): Promise<any> => {
|
|
93
81
|
let client = !sdk ? await sdkForProject() :
|
|
94
82
|
sdk;
|
|
95
83
|
let apiPath = '/project/variables';
|
|
@@ -107,20 +95,16 @@ const projectListVariables = async ({parseOutput = true, overrideForCli = false,
|
|
|
107
95
|
return response;
|
|
108
96
|
|
|
109
97
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* @param {ProjectCreateVariableRequestParams} params
|
|
122
|
-
*/
|
|
123
|
-
const projectCreateVariable = async ({key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
98
|
+
interface ProjectCreateVariableRequestParams {
|
|
99
|
+
key: string;
|
|
100
|
+
value: string;
|
|
101
|
+
secret?: boolean;
|
|
102
|
+
overrideForCli?: boolean;
|
|
103
|
+
parseOutput?: boolean;
|
|
104
|
+
sdk?: Client;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const projectCreateVariable = async ({key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}: ProjectCreateVariableRequestParams): Promise<any> => {
|
|
124
108
|
let client = !sdk ? await sdkForProject() :
|
|
125
109
|
sdk;
|
|
126
110
|
let apiPath = '/project/variables';
|
|
@@ -148,18 +132,14 @@ const projectCreateVariable = async ({key,value,secret,parseOutput = true, overr
|
|
|
148
132
|
return response;
|
|
149
133
|
|
|
150
134
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* @param {ProjectGetVariableRequestParams} params
|
|
161
|
-
*/
|
|
162
|
-
const projectGetVariable = async ({variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
135
|
+
interface ProjectGetVariableRequestParams {
|
|
136
|
+
variableId: string;
|
|
137
|
+
overrideForCli?: boolean;
|
|
138
|
+
parseOutput?: boolean;
|
|
139
|
+
sdk?: Client;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export const projectGetVariable = async ({variableId,parseOutput = true, overrideForCli = false, sdk = undefined}: ProjectGetVariableRequestParams): Promise<any> => {
|
|
163
143
|
let client = !sdk ? await sdkForProject() :
|
|
164
144
|
sdk;
|
|
165
145
|
let apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
|
|
@@ -177,21 +157,17 @@ const projectGetVariable = async ({variableId,parseOutput = true, overrideForCli
|
|
|
177
157
|
return response;
|
|
178
158
|
|
|
179
159
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* @param {ProjectUpdateVariableRequestParams} params
|
|
193
|
-
*/
|
|
194
|
-
const projectUpdateVariable = async ({variableId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
160
|
+
interface ProjectUpdateVariableRequestParams {
|
|
161
|
+
variableId: string;
|
|
162
|
+
key: string;
|
|
163
|
+
value?: string;
|
|
164
|
+
secret?: boolean;
|
|
165
|
+
overrideForCli?: boolean;
|
|
166
|
+
parseOutput?: boolean;
|
|
167
|
+
sdk?: Client;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export const projectUpdateVariable = async ({variableId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}: ProjectUpdateVariableRequestParams): Promise<any> => {
|
|
195
171
|
let client = !sdk ? await sdkForProject() :
|
|
196
172
|
sdk;
|
|
197
173
|
let apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
|
|
@@ -219,18 +195,14 @@ const projectUpdateVariable = async ({variableId,key,value,secret,parseOutput =
|
|
|
219
195
|
return response;
|
|
220
196
|
|
|
221
197
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* @param {ProjectDeleteVariableRequestParams} params
|
|
232
|
-
*/
|
|
233
|
-
const projectDeleteVariable = async ({variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
198
|
+
interface ProjectDeleteVariableRequestParams {
|
|
199
|
+
variableId: string;
|
|
200
|
+
overrideForCli?: boolean;
|
|
201
|
+
parseOutput?: boolean;
|
|
202
|
+
sdk?: Client;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export const projectDeleteVariable = async ({variableId,parseOutput = true, overrideForCli = false, sdk = undefined}: ProjectDeleteVariableRequestParams): Promise<any> => {
|
|
234
206
|
let client = !sdk ? await sdkForProject() :
|
|
235
207
|
sdk;
|
|
236
208
|
let apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
|
|
@@ -267,7 +239,7 @@ project
|
|
|
267
239
|
.description(`Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime.`)
|
|
268
240
|
.requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
|
|
269
241
|
.requiredOption(`--value <value>`, `Variable value. Max length: 8192 chars.`)
|
|
270
|
-
.option(`--secret [value]`, `Secret variables can be updated or deleted, but only projects can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
|
|
242
|
+
.option(`--secret [value]`, `Secret variables can be updated or deleted, but only projects can read them during build and runtime.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
271
243
|
.action(actionRunner(projectCreateVariable))
|
|
272
244
|
|
|
273
245
|
project
|
|
@@ -282,7 +254,7 @@ project
|
|
|
282
254
|
.requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
|
|
283
255
|
.requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
|
|
284
256
|
.option(`--value <value>`, `Variable value. Max length: 8192 chars.`)
|
|
285
|
-
.option(`--secret [value]`, `Secret variables can be updated or deleted, but only projects can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
|
|
257
|
+
.option(`--secret [value]`, `Secret variables can be updated or deleted, but only projects can read them during build and runtime.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
286
258
|
.action(actionRunner(projectUpdateVariable))
|
|
287
259
|
|
|
288
260
|
project
|
|
@@ -291,12 +263,4 @@ project
|
|
|
291
263
|
.requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
|
|
292
264
|
.action(actionRunner(projectDeleteVariable))
|
|
293
265
|
|
|
294
|
-
|
|
295
|
-
project,
|
|
296
|
-
projectGetUsage,
|
|
297
|
-
projectListVariables,
|
|
298
|
-
projectCreateVariable,
|
|
299
|
-
projectGetVariable,
|
|
300
|
-
projectUpdateVariable,
|
|
301
|
-
projectDeleteVariable
|
|
302
|
-
};
|
|
266
|
+
|