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 functions = new Command("functions").description(commandDescriptions['functions'] ?? '').configureHelp({
|
|
34
|
+
export const functions = new Command("functions").description(commandDescriptions['functions'] ?? '').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 {FunctionsListRequestParams} params
|
|
54
|
-
*/
|
|
55
|
-
const functionsList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
38
|
+
interface FunctionsListRequestParams {
|
|
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 functionsList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: FunctionsListRequestParams): Promise<any> => {
|
|
56
49
|
let client = !sdk ? await sdkForProject() :
|
|
57
50
|
sdk;
|
|
58
51
|
let apiPath = '/functions';
|
|
@@ -73,7 +66,7 @@ const functionsList = async ({queries,search,total,parseOutput = true, overrideF
|
|
|
73
66
|
}, payload);
|
|
74
67
|
|
|
75
68
|
if (parseOutput) {
|
|
76
|
-
if(
|
|
69
|
+
if(showConsole) {
|
|
77
70
|
showConsoleLink('functions', 'list');
|
|
78
71
|
} else {
|
|
79
72
|
parse(response)
|
|
@@ -83,35 +76,31 @@ const functionsList = async ({queries,search,total,parseOutput = true, overrideF
|
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* @param {FunctionsCreateRequestParams} params
|
|
113
|
-
*/
|
|
114
|
-
const functionsCreate = async ({functionId,name,runtime,execute,events,schedule,timeout,enabled,logging,entrypoint,commands,scopes,installationId,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
79
|
+
interface FunctionsCreateRequestParams {
|
|
80
|
+
functionId: string;
|
|
81
|
+
name: string;
|
|
82
|
+
runtime: Runtime;
|
|
83
|
+
execute?: string[];
|
|
84
|
+
events?: string[];
|
|
85
|
+
schedule?: string;
|
|
86
|
+
timeout?: number;
|
|
87
|
+
enabled?: boolean;
|
|
88
|
+
logging?: boolean;
|
|
89
|
+
entrypoint?: string;
|
|
90
|
+
commands?: string;
|
|
91
|
+
scopes?: string[];
|
|
92
|
+
installationId?: string;
|
|
93
|
+
providerRepositoryId?: string;
|
|
94
|
+
providerBranch?: string;
|
|
95
|
+
providerSilentMode?: boolean;
|
|
96
|
+
providerRootDirectory?: string;
|
|
97
|
+
specification?: string;
|
|
98
|
+
overrideForCli?: boolean;
|
|
99
|
+
parseOutput?: boolean;
|
|
100
|
+
sdk?: Client;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export const functionsCreate = async ({functionId,name,runtime,execute,events,schedule,timeout,enabled,logging,entrypoint,commands,scopes,installationId,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsCreateRequestParams): Promise<any> => {
|
|
115
104
|
let client = !sdk ? await sdkForProject() :
|
|
116
105
|
sdk;
|
|
117
106
|
let apiPath = '/functions';
|
|
@@ -187,17 +176,13 @@ const functionsCreate = async ({functionId,name,runtime,execute,events,schedule,
|
|
|
187
176
|
return response;
|
|
188
177
|
|
|
189
178
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* @param {FunctionsListRuntimesRequestParams} params
|
|
199
|
-
*/
|
|
200
|
-
const functionsListRuntimes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
179
|
+
interface FunctionsListRuntimesRequestParams {
|
|
180
|
+
overrideForCli?: boolean;
|
|
181
|
+
parseOutput?: boolean;
|
|
182
|
+
sdk?: Client;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export const functionsListRuntimes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsListRuntimesRequestParams): Promise<any> => {
|
|
201
186
|
let client = !sdk ? await sdkForProject() :
|
|
202
187
|
sdk;
|
|
203
188
|
let apiPath = '/functions/runtimes';
|
|
@@ -215,17 +200,14 @@ const functionsListRuntimes = async ({parseOutput = true, overrideForCli = false
|
|
|
215
200
|
return response;
|
|
216
201
|
|
|
217
202
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
* @param {FunctionsListSpecificationsRequestParams} params
|
|
227
|
-
*/
|
|
228
|
-
const functionsListSpecifications = async ({parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
203
|
+
interface FunctionsListSpecificationsRequestParams {
|
|
204
|
+
overrideForCli?: boolean;
|
|
205
|
+
parseOutput?: boolean;
|
|
206
|
+
sdk?: Client;
|
|
207
|
+
console?: boolean;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export const functionsListSpecifications = async ({parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: FunctionsListSpecificationsRequestParams): Promise<any> => {
|
|
229
211
|
let client = !sdk ? await sdkForProject() :
|
|
230
212
|
sdk;
|
|
231
213
|
let apiPath = '/functions/specifications';
|
|
@@ -237,7 +219,7 @@ const functionsListSpecifications = async ({parseOutput = true, overrideForCli =
|
|
|
237
219
|
}, payload);
|
|
238
220
|
|
|
239
221
|
if (parseOutput) {
|
|
240
|
-
if(
|
|
222
|
+
if(showConsole) {
|
|
241
223
|
showConsoleLink('functions', 'listSpecifications');
|
|
242
224
|
} else {
|
|
243
225
|
parse(response)
|
|
@@ -247,22 +229,19 @@ const functionsListSpecifications = async ({parseOutput = true, overrideForCli =
|
|
|
247
229
|
return response;
|
|
248
230
|
|
|
249
231
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
* @param {FunctionsListTemplatesRequestParams} params
|
|
264
|
-
*/
|
|
265
|
-
const functionsListTemplates = async ({runtimes,useCases,limit,offset,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
232
|
+
interface FunctionsListTemplatesRequestParams {
|
|
233
|
+
runtimes?: string[];
|
|
234
|
+
useCases?: string[];
|
|
235
|
+
limit?: number;
|
|
236
|
+
offset?: number;
|
|
237
|
+
total?: boolean;
|
|
238
|
+
overrideForCli?: boolean;
|
|
239
|
+
parseOutput?: boolean;
|
|
240
|
+
sdk?: Client;
|
|
241
|
+
console?: boolean;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export const functionsListTemplates = async ({runtimes,useCases,limit,offset,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: FunctionsListTemplatesRequestParams): Promise<any> => {
|
|
266
245
|
let client = !sdk ? await sdkForProject() :
|
|
267
246
|
sdk;
|
|
268
247
|
let apiPath = '/functions/templates';
|
|
@@ -289,7 +268,7 @@ const functionsListTemplates = async ({runtimes,useCases,limit,offset,total,pars
|
|
|
289
268
|
}, payload);
|
|
290
269
|
|
|
291
270
|
if (parseOutput) {
|
|
292
|
-
if(
|
|
271
|
+
if(showConsole) {
|
|
293
272
|
showConsoleLink('functions', 'listTemplates');
|
|
294
273
|
} else {
|
|
295
274
|
parse(response)
|
|
@@ -299,18 +278,15 @@ const functionsListTemplates = async ({runtimes,useCases,limit,offset,total,pars
|
|
|
299
278
|
return response;
|
|
300
279
|
|
|
301
280
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
* @param {FunctionsGetTemplateRequestParams} params
|
|
312
|
-
*/
|
|
313
|
-
const functionsGetTemplate = async ({templateId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
281
|
+
interface FunctionsGetTemplateRequestParams {
|
|
282
|
+
templateId: string;
|
|
283
|
+
overrideForCli?: boolean;
|
|
284
|
+
parseOutput?: boolean;
|
|
285
|
+
sdk?: Client;
|
|
286
|
+
console?: boolean;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export const functionsGetTemplate = async ({templateId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: FunctionsGetTemplateRequestParams): Promise<any> => {
|
|
314
290
|
let client = !sdk ? await sdkForProject() :
|
|
315
291
|
sdk;
|
|
316
292
|
let apiPath = '/functions/templates/{templateId}'.replace('{templateId}', templateId);
|
|
@@ -322,7 +298,7 @@ const functionsGetTemplate = async ({templateId,parseOutput = true, overrideForC
|
|
|
322
298
|
}, payload);
|
|
323
299
|
|
|
324
300
|
if (parseOutput) {
|
|
325
|
-
if(
|
|
301
|
+
if(showConsole) {
|
|
326
302
|
showConsoleLink('functions', 'getTemplate', templateId);
|
|
327
303
|
} else {
|
|
328
304
|
parse(response)
|
|
@@ -332,18 +308,15 @@ const functionsGetTemplate = async ({templateId,parseOutput = true, overrideForC
|
|
|
332
308
|
return response;
|
|
333
309
|
|
|
334
310
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
* @param {FunctionsListUsageRequestParams} params
|
|
345
|
-
*/
|
|
346
|
-
const functionsListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
311
|
+
interface FunctionsListUsageRequestParams {
|
|
312
|
+
range?: UsageRange;
|
|
313
|
+
overrideForCli?: boolean;
|
|
314
|
+
parseOutput?: boolean;
|
|
315
|
+
sdk?: Client;
|
|
316
|
+
console?: boolean;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export const functionsListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: FunctionsListUsageRequestParams): Promise<any> => {
|
|
347
320
|
let client = !sdk ? await sdkForProject() :
|
|
348
321
|
sdk;
|
|
349
322
|
let apiPath = '/functions/usage';
|
|
@@ -358,7 +331,7 @@ const functionsListUsage = async ({range,parseOutput = true, overrideForCli = fa
|
|
|
358
331
|
}, payload);
|
|
359
332
|
|
|
360
333
|
if (parseOutput) {
|
|
361
|
-
if(
|
|
334
|
+
if(showConsole) {
|
|
362
335
|
showConsoleLink('functions', 'listUsage');
|
|
363
336
|
} else {
|
|
364
337
|
parse(response)
|
|
@@ -368,18 +341,15 @@ const functionsListUsage = async ({range,parseOutput = true, overrideForCli = fa
|
|
|
368
341
|
return response;
|
|
369
342
|
|
|
370
343
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
* @param {FunctionsGetRequestParams} params
|
|
381
|
-
*/
|
|
382
|
-
const functionsGet = async ({functionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
344
|
+
interface FunctionsGetRequestParams {
|
|
345
|
+
functionId: string;
|
|
346
|
+
overrideForCli?: boolean;
|
|
347
|
+
parseOutput?: boolean;
|
|
348
|
+
sdk?: Client;
|
|
349
|
+
console?: boolean;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export const functionsGet = async ({functionId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: FunctionsGetRequestParams): Promise<any> => {
|
|
383
353
|
let client = !sdk ? await sdkForProject() :
|
|
384
354
|
sdk;
|
|
385
355
|
let apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
|
|
@@ -391,7 +361,7 @@ const functionsGet = async ({functionId,parseOutput = true, overrideForCli = fal
|
|
|
391
361
|
}, payload);
|
|
392
362
|
|
|
393
363
|
if (parseOutput) {
|
|
394
|
-
if(
|
|
364
|
+
if(showConsole) {
|
|
395
365
|
showConsoleLink('functions', 'get', functionId);
|
|
396
366
|
} else {
|
|
397
367
|
parse(response)
|
|
@@ -401,35 +371,31 @@ const functionsGet = async ({functionId,parseOutput = true, overrideForCli = fal
|
|
|
401
371
|
return response;
|
|
402
372
|
|
|
403
373
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* @param {FunctionsUpdateRequestParams} params
|
|
431
|
-
*/
|
|
432
|
-
const functionsUpdate = async ({functionId,name,runtime,execute,events,schedule,timeout,enabled,logging,entrypoint,commands,scopes,installationId,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
374
|
+
interface FunctionsUpdateRequestParams {
|
|
375
|
+
functionId: string;
|
|
376
|
+
name: string;
|
|
377
|
+
runtime?: Runtime;
|
|
378
|
+
execute?: string[];
|
|
379
|
+
events?: string[];
|
|
380
|
+
schedule?: string;
|
|
381
|
+
timeout?: number;
|
|
382
|
+
enabled?: boolean;
|
|
383
|
+
logging?: boolean;
|
|
384
|
+
entrypoint?: string;
|
|
385
|
+
commands?: string;
|
|
386
|
+
scopes?: string[];
|
|
387
|
+
installationId?: string;
|
|
388
|
+
providerRepositoryId?: string;
|
|
389
|
+
providerBranch?: string;
|
|
390
|
+
providerSilentMode?: boolean;
|
|
391
|
+
providerRootDirectory?: string;
|
|
392
|
+
specification?: string;
|
|
393
|
+
overrideForCli?: boolean;
|
|
394
|
+
parseOutput?: boolean;
|
|
395
|
+
sdk?: Client;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export const functionsUpdate = async ({functionId,name,runtime,execute,events,schedule,timeout,enabled,logging,entrypoint,commands,scopes,installationId,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsUpdateRequestParams): Promise<any> => {
|
|
433
399
|
let client = !sdk ? await sdkForProject() :
|
|
434
400
|
sdk;
|
|
435
401
|
let apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
|
|
@@ -502,18 +468,14 @@ const functionsUpdate = async ({functionId,name,runtime,execute,events,schedule,
|
|
|
502
468
|
return response;
|
|
503
469
|
|
|
504
470
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* @param {FunctionsDeleteRequestParams} params
|
|
515
|
-
*/
|
|
516
|
-
const functionsDelete = async ({functionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
471
|
+
interface FunctionsDeleteRequestParams {
|
|
472
|
+
functionId: string;
|
|
473
|
+
overrideForCli?: boolean;
|
|
474
|
+
parseOutput?: boolean;
|
|
475
|
+
sdk?: Client;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
export const functionsDelete = async ({functionId,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsDeleteRequestParams): Promise<any> => {
|
|
517
479
|
let client = !sdk ? await sdkForProject() :
|
|
518
480
|
sdk;
|
|
519
481
|
let apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
|
|
@@ -532,19 +494,15 @@ const functionsDelete = async ({functionId,parseOutput = true, overrideForCli =
|
|
|
532
494
|
return response;
|
|
533
495
|
|
|
534
496
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* @param {FunctionsUpdateFunctionDeploymentRequestParams} params
|
|
546
|
-
*/
|
|
547
|
-
const functionsUpdateFunctionDeployment = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
497
|
+
interface FunctionsUpdateFunctionDeploymentRequestParams {
|
|
498
|
+
functionId: string;
|
|
499
|
+
deploymentId: string;
|
|
500
|
+
overrideForCli?: boolean;
|
|
501
|
+
parseOutput?: boolean;
|
|
502
|
+
sdk?: Client;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export const functionsUpdateFunctionDeployment = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsUpdateFunctionDeploymentRequestParams): Promise<any> => {
|
|
548
506
|
let client = !sdk ? await sdkForProject() :
|
|
549
507
|
sdk;
|
|
550
508
|
let apiPath = '/functions/{functionId}/deployment'.replace('{functionId}', functionId);
|
|
@@ -566,21 +524,18 @@ const functionsUpdateFunctionDeployment = async ({functionId,deploymentId,parseO
|
|
|
566
524
|
return response;
|
|
567
525
|
|
|
568
526
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
* @param {FunctionsListDeploymentsRequestParams} params
|
|
582
|
-
*/
|
|
583
|
-
const functionsListDeployments = async ({functionId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
527
|
+
interface FunctionsListDeploymentsRequestParams {
|
|
528
|
+
functionId: string;
|
|
529
|
+
queries?: string[];
|
|
530
|
+
search?: string;
|
|
531
|
+
total?: boolean;
|
|
532
|
+
overrideForCli?: boolean;
|
|
533
|
+
parseOutput?: boolean;
|
|
534
|
+
sdk?: Client;
|
|
535
|
+
console?: boolean;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export const functionsListDeployments = async ({functionId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: FunctionsListDeploymentsRequestParams): Promise<any> => {
|
|
584
539
|
let client = !sdk ? await sdkForProject() :
|
|
585
540
|
sdk;
|
|
586
541
|
let apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
|
|
@@ -601,7 +556,7 @@ const functionsListDeployments = async ({functionId,queries,search,total,parseOu
|
|
|
601
556
|
}, payload);
|
|
602
557
|
|
|
603
558
|
if (parseOutput) {
|
|
604
|
-
if(
|
|
559
|
+
if(showConsole) {
|
|
605
560
|
showConsoleLink('functions', 'listDeployments', functionId);
|
|
606
561
|
} else {
|
|
607
562
|
parse(response)
|
|
@@ -611,23 +566,19 @@ const functionsListDeployments = async ({functionId,queries,search,total,parseOu
|
|
|
611
566
|
return response;
|
|
612
567
|
|
|
613
568
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
/**
|
|
628
|
-
* @param {FunctionsCreateDeploymentRequestParams} params
|
|
629
|
-
*/
|
|
630
|
-
const functionsCreateDeployment = async ({functionId,code,activate,entrypoint,commands,parseOutput = true, overrideForCli = false, sdk = undefined,onProgress = () => {}}) => {
|
|
569
|
+
interface FunctionsCreateDeploymentRequestParams {
|
|
570
|
+
functionId: string;
|
|
571
|
+
code: string;
|
|
572
|
+
activate: boolean;
|
|
573
|
+
entrypoint?: string;
|
|
574
|
+
commands?: string;
|
|
575
|
+
overrideForCli?: boolean;
|
|
576
|
+
parseOutput?: boolean;
|
|
577
|
+
sdk?: Client;
|
|
578
|
+
onProgress?: (progress: number) => void;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export const functionsCreateDeployment = async ({functionId,code,activate,entrypoint,commands,parseOutput = true, overrideForCli = false, sdk = undefined,onProgress = () => {}}: FunctionsCreateDeploymentRequestParams): Promise<any> => {
|
|
631
582
|
let client = !sdk ? await sdkForProject() :
|
|
632
583
|
sdk;
|
|
633
584
|
let apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
|
|
@@ -775,20 +726,16 @@ const functionsCreateDeployment = async ({functionId,code,activate,entrypoint,co
|
|
|
775
726
|
|
|
776
727
|
return response;
|
|
777
728
|
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
/**
|
|
789
|
-
* @param {FunctionsCreateDuplicateDeploymentRequestParams} params
|
|
790
|
-
*/
|
|
791
|
-
const functionsCreateDuplicateDeployment = async ({functionId,deploymentId,buildId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
729
|
+
interface FunctionsCreateDuplicateDeploymentRequestParams {
|
|
730
|
+
functionId: string;
|
|
731
|
+
deploymentId: string;
|
|
732
|
+
buildId?: string;
|
|
733
|
+
overrideForCli?: boolean;
|
|
734
|
+
parseOutput?: boolean;
|
|
735
|
+
sdk?: Client;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
export const functionsCreateDuplicateDeployment = async ({functionId,deploymentId,buildId,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsCreateDuplicateDeploymentRequestParams): Promise<any> => {
|
|
792
739
|
let client = !sdk ? await sdkForProject() :
|
|
793
740
|
sdk;
|
|
794
741
|
let apiPath = '/functions/{functionId}/deployments/duplicate'.replace('{functionId}', functionId);
|
|
@@ -813,24 +760,20 @@ const functionsCreateDuplicateDeployment = async ({functionId,deploymentId,build
|
|
|
813
760
|
return response;
|
|
814
761
|
|
|
815
762
|
}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
/**
|
|
831
|
-
* @param {FunctionsCreateTemplateDeploymentRequestParams} params
|
|
832
|
-
*/
|
|
833
|
-
const functionsCreateTemplateDeployment = async ({functionId,repository,owner,rootDirectory,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
763
|
+
interface FunctionsCreateTemplateDeploymentRequestParams {
|
|
764
|
+
functionId: string;
|
|
765
|
+
repository: string;
|
|
766
|
+
owner: string;
|
|
767
|
+
rootDirectory: string;
|
|
768
|
+
type: TemplateReferenceType;
|
|
769
|
+
reference: string;
|
|
770
|
+
activate?: boolean;
|
|
771
|
+
overrideForCli?: boolean;
|
|
772
|
+
parseOutput?: boolean;
|
|
773
|
+
sdk?: Client;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
export const functionsCreateTemplateDeployment = async ({functionId,repository,owner,rootDirectory,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsCreateTemplateDeploymentRequestParams): Promise<any> => {
|
|
834
777
|
let client = !sdk ? await sdkForProject() :
|
|
835
778
|
sdk;
|
|
836
779
|
let apiPath = '/functions/{functionId}/deployments/template'.replace('{functionId}', functionId);
|
|
@@ -867,21 +810,17 @@ const functionsCreateTemplateDeployment = async ({functionId,repository,owner,ro
|
|
|
867
810
|
return response;
|
|
868
811
|
|
|
869
812
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
/**
|
|
882
|
-
* @param {FunctionsCreateVcsDeploymentRequestParams} params
|
|
883
|
-
*/
|
|
884
|
-
const functionsCreateVcsDeployment = async ({functionId,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
813
|
+
interface FunctionsCreateVcsDeploymentRequestParams {
|
|
814
|
+
functionId: string;
|
|
815
|
+
type: VCSReferenceType;
|
|
816
|
+
reference: string;
|
|
817
|
+
activate?: boolean;
|
|
818
|
+
overrideForCli?: boolean;
|
|
819
|
+
parseOutput?: boolean;
|
|
820
|
+
sdk?: Client;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
export const functionsCreateVcsDeployment = async ({functionId,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsCreateVcsDeploymentRequestParams): Promise<any> => {
|
|
885
824
|
let client = !sdk ? await sdkForProject() :
|
|
886
825
|
sdk;
|
|
887
826
|
let apiPath = '/functions/{functionId}/deployments/vcs'.replace('{functionId}', functionId);
|
|
@@ -909,19 +848,16 @@ const functionsCreateVcsDeployment = async ({functionId,type,reference,activate,
|
|
|
909
848
|
return response;
|
|
910
849
|
|
|
911
850
|
}
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
* @param {FunctionsGetDeploymentRequestParams} params
|
|
923
|
-
*/
|
|
924
|
-
const functionsGetDeployment = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
851
|
+
interface FunctionsGetDeploymentRequestParams {
|
|
852
|
+
functionId: string;
|
|
853
|
+
deploymentId: string;
|
|
854
|
+
overrideForCli?: boolean;
|
|
855
|
+
parseOutput?: boolean;
|
|
856
|
+
sdk?: Client;
|
|
857
|
+
console?: boolean;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
export const functionsGetDeployment = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: FunctionsGetDeploymentRequestParams): Promise<any> => {
|
|
925
861
|
let client = !sdk ? await sdkForProject() :
|
|
926
862
|
sdk;
|
|
927
863
|
let apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
@@ -933,7 +869,7 @@ const functionsGetDeployment = async ({functionId,deploymentId,parseOutput = tru
|
|
|
933
869
|
}, payload);
|
|
934
870
|
|
|
935
871
|
if (parseOutput) {
|
|
936
|
-
if(
|
|
872
|
+
if(showConsole) {
|
|
937
873
|
showConsoleLink('functions', 'getDeployment', functionId, deploymentId);
|
|
938
874
|
} else {
|
|
939
875
|
parse(response)
|
|
@@ -943,19 +879,15 @@ const functionsGetDeployment = async ({functionId,deploymentId,parseOutput = tru
|
|
|
943
879
|
return response;
|
|
944
880
|
|
|
945
881
|
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
/**
|
|
956
|
-
* @param {FunctionsDeleteDeploymentRequestParams} params
|
|
957
|
-
*/
|
|
958
|
-
const functionsDeleteDeployment = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
882
|
+
interface FunctionsDeleteDeploymentRequestParams {
|
|
883
|
+
functionId: string;
|
|
884
|
+
deploymentId: string;
|
|
885
|
+
overrideForCli?: boolean;
|
|
886
|
+
parseOutput?: boolean;
|
|
887
|
+
sdk?: Client;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
export const functionsDeleteDeployment = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsDeleteDeploymentRequestParams): Promise<any> => {
|
|
959
891
|
let client = !sdk ? await sdkForProject() :
|
|
960
892
|
sdk;
|
|
961
893
|
let apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
@@ -974,21 +906,18 @@ const functionsDeleteDeployment = async ({functionId,deploymentId,parseOutput =
|
|
|
974
906
|
return response;
|
|
975
907
|
|
|
976
908
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
* @param {FunctionsGetDeploymentDownloadRequestParams} params
|
|
990
|
-
*/
|
|
991
|
-
const functionsGetDeploymentDownload = async ({functionId,deploymentId,type,parseOutput = true, overrideForCli = false, sdk = undefined, destination, console}) => {
|
|
909
|
+
interface FunctionsGetDeploymentDownloadRequestParams {
|
|
910
|
+
functionId: string;
|
|
911
|
+
deploymentId: string;
|
|
912
|
+
type?: DeploymentDownloadType;
|
|
913
|
+
overrideForCli?: boolean;
|
|
914
|
+
parseOutput?: boolean;
|
|
915
|
+
sdk?: Client;
|
|
916
|
+
destination?: string;
|
|
917
|
+
console?: boolean;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
export const functionsGetDeploymentDownload = async ({functionId,deploymentId,type,parseOutput = true, overrideForCli = false, sdk = undefined, destination, console: showConsole}: FunctionsGetDeploymentDownloadRequestParams): Promise<any> => {
|
|
992
921
|
let client = !sdk ? await sdkForProject() :
|
|
993
922
|
sdk;
|
|
994
923
|
let apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
@@ -1014,7 +943,7 @@ const functionsGetDeploymentDownload = async ({functionId,deploymentId,type,pars
|
|
|
1014
943
|
|
|
1015
944
|
fs.writeFileSync(destination, response);
|
|
1016
945
|
if (parseOutput) {
|
|
1017
|
-
if(
|
|
946
|
+
if(showConsole) {
|
|
1018
947
|
showConsoleLink('functions', 'getDeploymentDownload', functionId, deploymentId);
|
|
1019
948
|
} else {
|
|
1020
949
|
parse(response)
|
|
@@ -1024,19 +953,15 @@ const functionsGetDeploymentDownload = async ({functionId,deploymentId,type,pars
|
|
|
1024
953
|
return response;
|
|
1025
954
|
|
|
1026
955
|
}
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
/**
|
|
1037
|
-
* @param {FunctionsUpdateDeploymentStatusRequestParams} params
|
|
1038
|
-
*/
|
|
1039
|
-
const functionsUpdateDeploymentStatus = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
956
|
+
interface FunctionsUpdateDeploymentStatusRequestParams {
|
|
957
|
+
functionId: string;
|
|
958
|
+
deploymentId: string;
|
|
959
|
+
overrideForCli?: boolean;
|
|
960
|
+
parseOutput?: boolean;
|
|
961
|
+
sdk?: Client;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
export const functionsUpdateDeploymentStatus = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsUpdateDeploymentStatusRequestParams): Promise<any> => {
|
|
1040
965
|
let client = !sdk ? await sdkForProject() :
|
|
1041
966
|
sdk;
|
|
1042
967
|
let apiPath = '/functions/{functionId}/deployments/{deploymentId}/status'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
|
|
@@ -1055,20 +980,17 @@ const functionsUpdateDeploymentStatus = async ({functionId,deploymentId,parseOut
|
|
|
1055
980
|
return response;
|
|
1056
981
|
|
|
1057
982
|
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
* @param {FunctionsListExecutionsRequestParams} params
|
|
1070
|
-
*/
|
|
1071
|
-
const functionsListExecutions = async ({functionId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
983
|
+
interface FunctionsListExecutionsRequestParams {
|
|
984
|
+
functionId: string;
|
|
985
|
+
queries?: string[];
|
|
986
|
+
total?: boolean;
|
|
987
|
+
overrideForCli?: boolean;
|
|
988
|
+
parseOutput?: boolean;
|
|
989
|
+
sdk?: Client;
|
|
990
|
+
console?: boolean;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
export const functionsListExecutions = async ({functionId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: FunctionsListExecutionsRequestParams): Promise<any> => {
|
|
1072
994
|
let client = !sdk ? await sdkForProject() :
|
|
1073
995
|
sdk;
|
|
1074
996
|
let apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
|
|
@@ -1086,7 +1008,7 @@ const functionsListExecutions = async ({functionId,queries,total,parseOutput = t
|
|
|
1086
1008
|
}, payload);
|
|
1087
1009
|
|
|
1088
1010
|
if (parseOutput) {
|
|
1089
|
-
if(
|
|
1011
|
+
if(showConsole) {
|
|
1090
1012
|
showConsoleLink('functions', 'listExecutions', functionId);
|
|
1091
1013
|
} else {
|
|
1092
1014
|
parse(response)
|
|
@@ -1096,24 +1018,20 @@ const functionsListExecutions = async ({functionId,queries,total,parseOutput = t
|
|
|
1096
1018
|
return response;
|
|
1097
1019
|
|
|
1098
1020
|
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
/**
|
|
1114
|
-
* @param {FunctionsCreateExecutionRequestParams} params
|
|
1115
|
-
*/
|
|
1116
|
-
const functionsCreateExecution = async ({functionId,body,async,xpath,method,headers,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1021
|
+
interface FunctionsCreateExecutionRequestParams {
|
|
1022
|
+
functionId: string;
|
|
1023
|
+
body?: string;
|
|
1024
|
+
async?: boolean;
|
|
1025
|
+
xpath?: string;
|
|
1026
|
+
method?: ExecutionMethod;
|
|
1027
|
+
headers?: object;
|
|
1028
|
+
scheduledAt?: string;
|
|
1029
|
+
overrideForCli?: boolean;
|
|
1030
|
+
parseOutput?: boolean;
|
|
1031
|
+
sdk?: Client;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
export const functionsCreateExecution = async ({functionId,body,async,xpath,method,headers,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsCreateExecutionRequestParams): Promise<any> => {
|
|
1117
1035
|
let client = !sdk ? await sdkForProject() :
|
|
1118
1036
|
sdk;
|
|
1119
1037
|
let apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
|
|
@@ -1150,19 +1068,16 @@ const functionsCreateExecution = async ({functionId,body,async,xpath,method,head
|
|
|
1150
1068
|
return response;
|
|
1151
1069
|
|
|
1152
1070
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
* @param {FunctionsGetExecutionRequestParams} params
|
|
1164
|
-
*/
|
|
1165
|
-
const functionsGetExecution = async ({functionId,executionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
1071
|
+
interface FunctionsGetExecutionRequestParams {
|
|
1072
|
+
functionId: string;
|
|
1073
|
+
executionId: string;
|
|
1074
|
+
overrideForCli?: boolean;
|
|
1075
|
+
parseOutput?: boolean;
|
|
1076
|
+
sdk?: Client;
|
|
1077
|
+
console?: boolean;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
export const functionsGetExecution = async ({functionId,executionId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: FunctionsGetExecutionRequestParams): Promise<any> => {
|
|
1166
1081
|
let client = !sdk ? await sdkForProject() :
|
|
1167
1082
|
sdk;
|
|
1168
1083
|
let apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
|
|
@@ -1174,7 +1089,7 @@ const functionsGetExecution = async ({functionId,executionId,parseOutput = true,
|
|
|
1174
1089
|
}, payload);
|
|
1175
1090
|
|
|
1176
1091
|
if (parseOutput) {
|
|
1177
|
-
if(
|
|
1092
|
+
if(showConsole) {
|
|
1178
1093
|
showConsoleLink('functions', 'getExecution', functionId, executionId);
|
|
1179
1094
|
} else {
|
|
1180
1095
|
parse(response)
|
|
@@ -1184,19 +1099,15 @@ const functionsGetExecution = async ({functionId,executionId,parseOutput = true,
|
|
|
1184
1099
|
return response;
|
|
1185
1100
|
|
|
1186
1101
|
}
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
/**
|
|
1197
|
-
* @param {FunctionsDeleteExecutionRequestParams} params
|
|
1198
|
-
*/
|
|
1199
|
-
const functionsDeleteExecution = async ({functionId,executionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1102
|
+
interface FunctionsDeleteExecutionRequestParams {
|
|
1103
|
+
functionId: string;
|
|
1104
|
+
executionId: string;
|
|
1105
|
+
overrideForCli?: boolean;
|
|
1106
|
+
parseOutput?: boolean;
|
|
1107
|
+
sdk?: Client;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
export const functionsDeleteExecution = async ({functionId,executionId,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsDeleteExecutionRequestParams): Promise<any> => {
|
|
1200
1111
|
let client = !sdk ? await sdkForProject() :
|
|
1201
1112
|
sdk;
|
|
1202
1113
|
let apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
|
|
@@ -1215,19 +1126,15 @@ const functionsDeleteExecution = async ({functionId,executionId,parseOutput = tr
|
|
|
1215
1126
|
return response;
|
|
1216
1127
|
|
|
1217
1128
|
}
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
/**
|
|
1228
|
-
* @param {FunctionsGetUsageRequestParams} params
|
|
1229
|
-
*/
|
|
1230
|
-
const functionsGetUsage = async ({functionId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1129
|
+
interface FunctionsGetUsageRequestParams {
|
|
1130
|
+
functionId: string;
|
|
1131
|
+
range?: UsageRange;
|
|
1132
|
+
overrideForCli?: boolean;
|
|
1133
|
+
parseOutput?: boolean;
|
|
1134
|
+
sdk?: Client;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
export const functionsGetUsage = async ({functionId,range,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsGetUsageRequestParams): Promise<any> => {
|
|
1231
1138
|
let client = !sdk ? await sdkForProject() :
|
|
1232
1139
|
sdk;
|
|
1233
1140
|
let apiPath = '/functions/{functionId}/usage'.replace('{functionId}', functionId);
|
|
@@ -1248,18 +1155,14 @@ const functionsGetUsage = async ({functionId,range,parseOutput = true, overrideF
|
|
|
1248
1155
|
return response;
|
|
1249
1156
|
|
|
1250
1157
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
/**
|
|
1260
|
-
* @param {FunctionsListVariablesRequestParams} params
|
|
1261
|
-
*/
|
|
1262
|
-
const functionsListVariables = async ({functionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1158
|
+
interface FunctionsListVariablesRequestParams {
|
|
1159
|
+
functionId: string;
|
|
1160
|
+
overrideForCli?: boolean;
|
|
1161
|
+
parseOutput?: boolean;
|
|
1162
|
+
sdk?: Client;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
export const functionsListVariables = async ({functionId,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsListVariablesRequestParams): Promise<any> => {
|
|
1263
1166
|
let client = !sdk ? await sdkForProject() :
|
|
1264
1167
|
sdk;
|
|
1265
1168
|
let apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
|
|
@@ -1277,21 +1180,17 @@ const functionsListVariables = async ({functionId,parseOutput = true, overrideFo
|
|
|
1277
1180
|
return response;
|
|
1278
1181
|
|
|
1279
1182
|
}
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
/**
|
|
1292
|
-
* @param {FunctionsCreateVariableRequestParams} params
|
|
1293
|
-
*/
|
|
1294
|
-
const functionsCreateVariable = async ({functionId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1183
|
+
interface FunctionsCreateVariableRequestParams {
|
|
1184
|
+
functionId: string;
|
|
1185
|
+
key: string;
|
|
1186
|
+
value: string;
|
|
1187
|
+
secret?: boolean;
|
|
1188
|
+
overrideForCli?: boolean;
|
|
1189
|
+
parseOutput?: boolean;
|
|
1190
|
+
sdk?: Client;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
export const functionsCreateVariable = async ({functionId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsCreateVariableRequestParams): Promise<any> => {
|
|
1295
1194
|
let client = !sdk ? await sdkForProject() :
|
|
1296
1195
|
sdk;
|
|
1297
1196
|
let apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
|
|
@@ -1319,19 +1218,15 @@ const functionsCreateVariable = async ({functionId,key,value,secret,parseOutput
|
|
|
1319
1218
|
return response;
|
|
1320
1219
|
|
|
1321
1220
|
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
/**
|
|
1332
|
-
* @param {FunctionsGetVariableRequestParams} params
|
|
1333
|
-
*/
|
|
1334
|
-
const functionsGetVariable = async ({functionId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1221
|
+
interface FunctionsGetVariableRequestParams {
|
|
1222
|
+
functionId: string;
|
|
1223
|
+
variableId: string;
|
|
1224
|
+
overrideForCli?: boolean;
|
|
1225
|
+
parseOutput?: boolean;
|
|
1226
|
+
sdk?: Client;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
export const functionsGetVariable = async ({functionId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsGetVariableRequestParams): Promise<any> => {
|
|
1335
1230
|
let client = !sdk ? await sdkForProject() :
|
|
1336
1231
|
sdk;
|
|
1337
1232
|
let apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
|
@@ -1349,22 +1244,18 @@ const functionsGetVariable = async ({functionId,variableId,parseOutput = true, o
|
|
|
1349
1244
|
return response;
|
|
1350
1245
|
|
|
1351
1246
|
}
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
/**
|
|
1365
|
-
* @param {FunctionsUpdateVariableRequestParams} params
|
|
1366
|
-
*/
|
|
1367
|
-
const functionsUpdateVariable = async ({functionId,variableId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1247
|
+
interface FunctionsUpdateVariableRequestParams {
|
|
1248
|
+
functionId: string;
|
|
1249
|
+
variableId: string;
|
|
1250
|
+
key: string;
|
|
1251
|
+
value?: string;
|
|
1252
|
+
secret?: boolean;
|
|
1253
|
+
overrideForCli?: boolean;
|
|
1254
|
+
parseOutput?: boolean;
|
|
1255
|
+
sdk?: Client;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
export const functionsUpdateVariable = async ({functionId,variableId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsUpdateVariableRequestParams): Promise<any> => {
|
|
1368
1259
|
let client = !sdk ? await sdkForProject() :
|
|
1369
1260
|
sdk;
|
|
1370
1261
|
let apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
|
@@ -1392,19 +1283,15 @@ const functionsUpdateVariable = async ({functionId,variableId,key,value,secret,p
|
|
|
1392
1283
|
return response;
|
|
1393
1284
|
|
|
1394
1285
|
}
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
/**
|
|
1405
|
-
* @param {FunctionsDeleteVariableRequestParams} params
|
|
1406
|
-
*/
|
|
1407
|
-
const functionsDeleteVariable = async ({functionId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1286
|
+
interface FunctionsDeleteVariableRequestParams {
|
|
1287
|
+
functionId: string;
|
|
1288
|
+
variableId: string;
|
|
1289
|
+
overrideForCli?: boolean;
|
|
1290
|
+
parseOutput?: boolean;
|
|
1291
|
+
sdk?: Client;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
export const functionsDeleteVariable = async ({functionId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}: FunctionsDeleteVariableRequestParams): Promise<any> => {
|
|
1408
1295
|
let client = !sdk ? await sdkForProject() :
|
|
1409
1296
|
sdk;
|
|
1410
1297
|
let apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
|
|
@@ -1428,7 +1315,7 @@ functions
|
|
|
1428
1315
|
.description(`Get a list of all the project's functions. You can use the query params to filter your results.`)
|
|
1429
1316
|
.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, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId`)
|
|
1430
1317
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
1431
|
-
.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))
|
|
1318
|
+
.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))
|
|
1432
1319
|
.option(`--console`, `Get the resource console url`)
|
|
1433
1320
|
.action(actionRunner(functionsList))
|
|
1434
1321
|
|
|
@@ -1442,15 +1329,15 @@ functions
|
|
|
1442
1329
|
.option(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
|
|
1443
1330
|
.option(`--schedule <schedule>`, `Schedule CRON syntax.`)
|
|
1444
1331
|
.option(`--timeout <timeout>`, `Function maximum execution time in seconds.`, parseInteger)
|
|
1445
|
-
.option(`--enabled [value]`, `Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
|
|
1446
|
-
.option(`--logging [value]`, `When disabled, executions will exclude logs and errors, and will be slightly faster.`, (value) => value === undefined ? true : parseBool(value))
|
|
1332
|
+
.option(`--enabled [value]`, `Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1333
|
+
.option(`--logging [value]`, `When disabled, executions will exclude logs and errors, and will be slightly faster.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1447
1334
|
.option(`--entrypoint <entrypoint>`, `Entrypoint File. This path is relative to the "providerRootDirectory".`)
|
|
1448
1335
|
.option(`--commands <commands>`, `Build Commands.`)
|
|
1449
1336
|
.option(`--scopes [scopes...]`, `List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.`)
|
|
1450
1337
|
.option(`--installation-id <installation-id>`, `Appwrite Installation ID for VCS (Version Control System) deployment.`)
|
|
1451
1338
|
.option(`--provider-repository-id <provider-repository-id>`, `Repository ID of the repo linked to the function.`)
|
|
1452
1339
|
.option(`--provider-branch <provider-branch>`, `Production branch for the repo linked to the function.`)
|
|
1453
|
-
.option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.`, (value) => value === undefined ? true : parseBool(value))
|
|
1340
|
+
.option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1454
1341
|
.option(`--provider-root-directory <provider-root-directory>`, `Path to function code in the linked repo.`)
|
|
1455
1342
|
.option(`--specification <specification>`, `Runtime specification for the function and builds.`)
|
|
1456
1343
|
.action(actionRunner(functionsCreate))
|
|
@@ -1473,7 +1360,7 @@ functions
|
|
|
1473
1360
|
.option(`--use-cases [use-cases...]`, `List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.`)
|
|
1474
1361
|
.option(`--limit <limit>`, `Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.`, parseInteger)
|
|
1475
1362
|
.option(`--offset <offset>`, `Offset the list of returned templates. Maximum offset is 5000.`, parseInteger)
|
|
1476
|
-
.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))
|
|
1363
|
+
.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))
|
|
1477
1364
|
.option(`--console`, `Get the resource console url`)
|
|
1478
1365
|
.action(actionRunner(functionsListTemplates))
|
|
1479
1366
|
|
|
@@ -1508,15 +1395,15 @@ functions
|
|
|
1508
1395
|
.option(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
|
|
1509
1396
|
.option(`--schedule <schedule>`, `Schedule CRON syntax.`)
|
|
1510
1397
|
.option(`--timeout <timeout>`, `Maximum execution time in seconds.`, parseInteger)
|
|
1511
|
-
.option(`--enabled [value]`, `Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
|
|
1512
|
-
.option(`--logging [value]`, `When disabled, executions will exclude logs and errors, and will be slightly faster.`, (value) => value === undefined ? true : parseBool(value))
|
|
1398
|
+
.option(`--enabled [value]`, `Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1399
|
+
.option(`--logging [value]`, `When disabled, executions will exclude logs and errors, and will be slightly faster.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1513
1400
|
.option(`--entrypoint <entrypoint>`, `Entrypoint File. This path is relative to the "providerRootDirectory".`)
|
|
1514
1401
|
.option(`--commands <commands>`, `Build Commands.`)
|
|
1515
1402
|
.option(`--scopes [scopes...]`, `List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.`)
|
|
1516
1403
|
.option(`--installation-id <installation-id>`, `Appwrite Installation ID for VCS (Version Controle System) deployment.`)
|
|
1517
1404
|
.option(`--provider-repository-id <provider-repository-id>`, `Repository ID of the repo linked to the function`)
|
|
1518
1405
|
.option(`--provider-branch <provider-branch>`, `Production branch for the repo linked to the function`)
|
|
1519
|
-
.option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.`, (value) => value === undefined ? true : parseBool(value))
|
|
1406
|
+
.option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1520
1407
|
.option(`--provider-root-directory <provider-root-directory>`, `Path to function code in the linked repo.`)
|
|
1521
1408
|
.option(`--specification <specification>`, `Runtime specification for the function and builds.`)
|
|
1522
1409
|
.action(actionRunner(functionsUpdate))
|
|
@@ -1540,7 +1427,7 @@ functions
|
|
|
1540
1427
|
.requiredOption(`--function-id <function-id>`, `Function ID.`)
|
|
1541
1428
|
.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`)
|
|
1542
1429
|
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
1543
|
-
.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))
|
|
1430
|
+
.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))
|
|
1544
1431
|
.option(`--console`, `Get the resource console url`)
|
|
1545
1432
|
.action(actionRunner(functionsListDeployments))
|
|
1546
1433
|
|
|
@@ -1549,7 +1436,7 @@ functions
|
|
|
1549
1436
|
.description(`Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions). Use the "command" param to set the entrypoint used to execute your code.`)
|
|
1550
1437
|
.requiredOption(`--function-id <function-id>`, `Function ID.`)
|
|
1551
1438
|
.requiredOption(`--code <code>`, `Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.`)
|
|
1552
|
-
.requiredOption(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
|
|
1439
|
+
.requiredOption(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1553
1440
|
.option(`--entrypoint <entrypoint>`, `Entrypoint File.`)
|
|
1554
1441
|
.option(`--commands <commands>`, `Build Commands.`)
|
|
1555
1442
|
.action(actionRunner(functionsCreateDeployment))
|
|
@@ -1571,7 +1458,7 @@ functions
|
|
|
1571
1458
|
.requiredOption(`--root-directory <root-directory>`, `Path to function code in the template repo.`)
|
|
1572
1459
|
.requiredOption(`--type <type>`, `Type for the reference provided. Can be commit, branch, or tag`)
|
|
1573
1460
|
.requiredOption(`--reference <reference>`, `Reference value, can be a commit hash, branch name, or release tag`)
|
|
1574
|
-
.option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
|
|
1461
|
+
.option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1575
1462
|
.action(actionRunner(functionsCreateTemplateDeployment))
|
|
1576
1463
|
|
|
1577
1464
|
functions
|
|
@@ -1580,7 +1467,7 @@ functions
|
|
|
1580
1467
|
.requiredOption(`--function-id <function-id>`, `Function ID.`)
|
|
1581
1468
|
.requiredOption(`--type <type>`, `Type of reference passed. Allowed values are: branch, commit`)
|
|
1582
1469
|
.requiredOption(`--reference <reference>`, `VCS reference to create deployment from. Depending on type this can be: branch name, commit hash`)
|
|
1583
|
-
.option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
|
|
1470
|
+
.option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1584
1471
|
.action(actionRunner(functionsCreateVcsDeployment))
|
|
1585
1472
|
|
|
1586
1473
|
functions
|
|
@@ -1620,7 +1507,7 @@ functions
|
|
|
1620
1507
|
.description(`Get a list of all the current user function execution logs. You can use the query params to filter your results.`)
|
|
1621
1508
|
.requiredOption(`--function-id <function-id>`, `Function ID.`)
|
|
1622
1509
|
.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`)
|
|
1623
|
-
.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))
|
|
1510
|
+
.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))
|
|
1624
1511
|
.option(`--console`, `Get the resource console url`)
|
|
1625
1512
|
.action(actionRunner(functionsListExecutions))
|
|
1626
1513
|
|
|
@@ -1629,7 +1516,7 @@ functions
|
|
|
1629
1516
|
.description(`Trigger a function execution. The returned object will return you the current execution status. You can ping the 'Get Execution' endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.`)
|
|
1630
1517
|
.requiredOption(`--function-id <function-id>`, `Function ID.`)
|
|
1631
1518
|
.option(`--body <body>`, `HTTP body of execution. Default value is empty string.`)
|
|
1632
|
-
.option(`--async [value]`, `Execute code in the background. Default value is false.`, (value) => value === undefined ? true : parseBool(value))
|
|
1519
|
+
.option(`--async [value]`, `Execute code in the background. Default value is false.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1633
1520
|
.option(`--xpath <xpath>`, `HTTP path of execution. Path can include query params. Default value is /`)
|
|
1634
1521
|
.option(`--method <method>`, `HTTP method of execution. Default value is POST.`)
|
|
1635
1522
|
.option(`--headers <headers>`, `HTTP headers of execution. Defaults to empty.`)
|
|
@@ -1670,7 +1557,7 @@ functions
|
|
|
1670
1557
|
.requiredOption(`--function-id <function-id>`, `Function unique ID.`)
|
|
1671
1558
|
.requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
|
|
1672
1559
|
.requiredOption(`--value <value>`, `Variable value. Max length: 8192 chars.`)
|
|
1673
|
-
.option(`--secret [value]`, `Secret variables can be updated or deleted, but only functions can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
|
|
1560
|
+
.option(`--secret [value]`, `Secret variables can be updated or deleted, but only functions can read them during build and runtime.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1674
1561
|
.action(actionRunner(functionsCreateVariable))
|
|
1675
1562
|
|
|
1676
1563
|
functions
|
|
@@ -1687,7 +1574,7 @@ functions
|
|
|
1687
1574
|
.requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
|
|
1688
1575
|
.requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
|
|
1689
1576
|
.option(`--value <value>`, `Variable value. Max length: 8192 chars.`)
|
|
1690
|
-
.option(`--secret [value]`, `Secret variables can be updated or deleted, but only functions can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
|
|
1577
|
+
.option(`--secret [value]`, `Secret variables can be updated or deleted, but only functions can read them during build and runtime.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1691
1578
|
.action(actionRunner(functionsUpdateVariable))
|
|
1692
1579
|
|
|
1693
1580
|
functions
|
|
@@ -1697,36 +1584,4 @@ functions
|
|
|
1697
1584
|
.requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
|
|
1698
1585
|
.action(actionRunner(functionsDeleteVariable))
|
|
1699
1586
|
|
|
1700
|
-
|
|
1701
|
-
functions,
|
|
1702
|
-
functionsList,
|
|
1703
|
-
functionsCreate,
|
|
1704
|
-
functionsListRuntimes,
|
|
1705
|
-
functionsListSpecifications,
|
|
1706
|
-
functionsListTemplates,
|
|
1707
|
-
functionsGetTemplate,
|
|
1708
|
-
functionsListUsage,
|
|
1709
|
-
functionsGet,
|
|
1710
|
-
functionsUpdate,
|
|
1711
|
-
functionsDelete,
|
|
1712
|
-
functionsUpdateFunctionDeployment,
|
|
1713
|
-
functionsListDeployments,
|
|
1714
|
-
functionsCreateDeployment,
|
|
1715
|
-
functionsCreateDuplicateDeployment,
|
|
1716
|
-
functionsCreateTemplateDeployment,
|
|
1717
|
-
functionsCreateVcsDeployment,
|
|
1718
|
-
functionsGetDeployment,
|
|
1719
|
-
functionsDeleteDeployment,
|
|
1720
|
-
functionsGetDeploymentDownload,
|
|
1721
|
-
functionsUpdateDeploymentStatus,
|
|
1722
|
-
functionsListExecutions,
|
|
1723
|
-
functionsCreateExecution,
|
|
1724
|
-
functionsGetExecution,
|
|
1725
|
-
functionsDeleteExecution,
|
|
1726
|
-
functionsGetUsage,
|
|
1727
|
-
functionsListVariables,
|
|
1728
|
-
functionsCreateVariable,
|
|
1729
|
-
functionsGetVariable,
|
|
1730
|
-
functionsUpdateVariable,
|
|
1731
|
-
functionsDeleteVariable
|
|
1732
|
-
};
|
|
1587
|
+
|