@factorialco/fcode-cli 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1021 -0
- package/bin/dev +17 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +7 -0
- package/bin/run.cmd +3 -0
- package/dist/commands/add.d.ts +6 -0
- package/dist/commands/add.js +22 -0
- package/dist/commands/clone.d.ts +26 -0
- package/dist/commands/clone.js +177 -0
- package/dist/commands/dependencies/add.d.ts +9 -0
- package/dist/commands/dependencies/add.js +13 -0
- package/dist/commands/dependencies/install.d.ts +14 -0
- package/dist/commands/dependencies/install.js +44 -0
- package/dist/commands/dependencies/pull.d.ts +12 -0
- package/dist/commands/dependencies/pull.js +14 -0
- package/dist/commands/dependencies/push.d.ts +12 -0
- package/dist/commands/dependencies/push.js +14 -0
- package/dist/commands/dependencies/reset.d.ts +9 -0
- package/dist/commands/dependencies/reset.js +13 -0
- package/dist/commands/dependencies/status.d.ts +9 -0
- package/dist/commands/dependencies/status.js +13 -0
- package/dist/commands/http.d.ts +22 -0
- package/dist/commands/http.js +272 -0
- package/dist/commands/login.d.ts +18 -0
- package/dist/commands/login.js +62 -0
- package/dist/commands/logout.d.ts +10 -0
- package/dist/commands/logout.js +34 -0
- package/dist/commands/modules/add.d.ts +9 -0
- package/dist/commands/modules/add.js +13 -0
- package/dist/commands/modules/pull.d.ts +13 -0
- package/dist/commands/modules/pull.js +43 -0
- package/dist/commands/modules/push.d.ts +13 -0
- package/dist/commands/modules/push.js +35 -0
- package/dist/commands/modules/remove.d.ts +9 -0
- package/dist/commands/modules/remove.js +19 -0
- package/dist/commands/modules/reset.d.ts +9 -0
- package/dist/commands/modules/reset.js +13 -0
- package/dist/commands/modules/status.d.ts +11 -0
- package/dist/commands/modules/status.js +40 -0
- package/dist/commands/pre-debug.d.ts +20 -0
- package/dist/commands/pre-debug.js +120 -0
- package/dist/commands/process-metadata.d.ts +18 -0
- package/dist/commands/process-metadata.js +63 -0
- package/dist/commands/processes/add.d.ts +9 -0
- package/dist/commands/processes/add.js +13 -0
- package/dist/commands/processes/install-dependencies.d.ts +14 -0
- package/dist/commands/processes/install-dependencies.js +30 -0
- package/dist/commands/processes/pull.d.ts +13 -0
- package/dist/commands/processes/pull.js +47 -0
- package/dist/commands/processes/push.d.ts +13 -0
- package/dist/commands/processes/push.js +39 -0
- package/dist/commands/processes/remove.d.ts +9 -0
- package/dist/commands/processes/remove.js +19 -0
- package/dist/commands/processes/reset.d.ts +9 -0
- package/dist/commands/processes/reset.js +13 -0
- package/dist/commands/processes/status.d.ts +11 -0
- package/dist/commands/processes/status.js +58 -0
- package/dist/commands/pull.d.ts +9 -0
- package/dist/commands/pull.js +32 -0
- package/dist/commands/push.d.ts +9 -0
- package/dist/commands/push.js +29 -0
- package/dist/commands/remote/add.d.ts +10 -0
- package/dist/commands/remote/add.js +32 -0
- package/dist/commands/remote/list.d.ts +7 -0
- package/dist/commands/remote/list.js +33 -0
- package/dist/commands/remote/set.d.ts +10 -0
- package/dist/commands/remote/set.js +28 -0
- package/dist/commands/reset.d.ts +6 -0
- package/dist/commands/reset.js +19 -0
- package/dist/commands/run.d.ts +16 -0
- package/dist/commands/run.js +56 -0
- package/dist/commands/runtime-env.d.ts +12 -0
- package/dist/commands/runtime-env.js +42 -0
- package/dist/commands/settings/get.d.ts +12 -0
- package/dist/commands/settings/get.js +67 -0
- package/dist/commands/settings/remove.d.ts +9 -0
- package/dist/commands/settings/remove.js +35 -0
- package/dist/commands/settings/set.d.ts +10 -0
- package/dist/commands/settings/set.js +39 -0
- package/dist/commands/setup-debug.d.ts +12 -0
- package/dist/commands/setup-debug.js +118 -0
- package/dist/commands/status.d.ts +6 -0
- package/dist/commands/status.js +22 -0
- package/dist/commands/team/pull.d.ts +8 -0
- package/dist/commands/team/pull.js +23 -0
- package/dist/commands/team/push.d.ts +11 -0
- package/dist/commands/team/push.js +41 -0
- package/dist/commands/team/status.d.ts +8 -0
- package/dist/commands/team/status.js +40 -0
- package/dist/commands/test/scaffold.d.ts +9 -0
- package/dist/commands/test/scaffold.js +61 -0
- package/dist/commands/test.d.ts +13 -0
- package/dist/commands/test.js +72 -0
- package/dist/commands/variables/add.d.ts +12 -0
- package/dist/commands/variables/add.js +21 -0
- package/dist/commands/variables/pull.d.ts +12 -0
- package/dist/commands/variables/pull.js +14 -0
- package/dist/commands/variables/push.d.ts +12 -0
- package/dist/commands/variables/push.js +14 -0
- package/dist/commands/variables/remove.d.ts +9 -0
- package/dist/commands/variables/remove.js +19 -0
- package/dist/commands/variables/reset.d.ts +9 -0
- package/dist/commands/variables/reset.js +13 -0
- package/dist/commands/variables/status.d.ts +12 -0
- package/dist/commands/variables/status.js +58 -0
- package/dist/config/global.d.ts +15 -0
- package/dist/config/global.js +77 -0
- package/dist/config/index.d.ts +14 -0
- package/dist/config/index.js +44 -0
- package/dist/config/remote.d.ts +15 -0
- package/dist/config/remote.js +60 -0
- package/dist/config/settings.d.ts +16 -0
- package/dist/config/settings.js +54 -0
- package/dist/config/workspace.d.ts +28 -0
- package/dist/config/workspace.js +158 -0
- package/dist/core/commands/api-client-command.d.ts +6 -0
- package/dist/core/commands/api-client-command.js +30 -0
- package/dist/core/commands/base-command.d.ts +11 -0
- package/dist/core/commands/base-command.js +61 -0
- package/dist/core/commands/dependency-command.d.ts +5 -0
- package/dist/core/commands/dependency-command.js +16 -0
- package/dist/core/commands/modules-command.d.ts +7 -0
- package/dist/core/commands/modules-command.js +18 -0
- package/dist/core/commands/processes-command.d.ts +8 -0
- package/dist/core/commands/processes-command.js +27 -0
- package/dist/core/commands/resource-command.d.ts +24 -0
- package/dist/core/commands/resource-command.js +92 -0
- package/dist/core/commands/variables-command.d.ts +5 -0
- package/dist/core/commands/variables-command.js +16 -0
- package/dist/core/dependencies/env-dependencies-command.d.ts +19 -0
- package/dist/core/dependencies/env-dependencies-command.js +70 -0
- package/dist/core/dependencies/env-process-dependencies-command.d.ts +15 -0
- package/dist/core/dependencies/env-process-dependencies-command.js +78 -0
- package/dist/core/dependencies/javascript-env-dependencies.d.ts +8 -0
- package/dist/core/dependencies/javascript-env-dependencies.js +77 -0
- package/dist/core/dependencies/python-env-dependencies.d.ts +9 -0
- package/dist/core/dependencies/python-env-dependencies.js +91 -0
- package/dist/core/errors.d.ts +55 -0
- package/dist/core/errors.js +144 -0
- package/dist/core/executors/execution-task.d.ts +29 -0
- package/dist/core/executors/execution-task.js +139 -0
- package/dist/core/executors/javascript-execution-task.d.ts +13 -0
- package/dist/core/executors/javascript-execution-task.js +618 -0
- package/dist/core/executors/python/context.d.ts +2 -0
- package/dist/core/executors/python/context.js +3 -0
- package/dist/core/executors/python/datastore.d.ts +2 -0
- package/dist/core/executors/python/datastore.js +4 -0
- package/dist/core/executors/python-execution-task.d.ts +11 -0
- package/dist/core/executors/python-execution-task.js +173 -0
- package/dist/core/executors/source-code-sanitizer.d.ts +4 -0
- package/dist/core/executors/source-code-sanitizer.js +45 -0
- package/dist/core/resource-merger.d.ts +14 -0
- package/dist/core/resource-merger.js +155 -0
- package/dist/core/resource-pusher.d.ts +12 -0
- package/dist/core/resource-pusher.js +133 -0
- package/dist/core/resource-repository.d.ts +8 -0
- package/dist/core/resource-repository.js +2 -0
- package/dist/core/types.d.ts +290 -0
- package/dist/core/types.js +238 -0
- package/dist/core/utils/dependencies.d.ts +5 -0
- package/dist/core/utils/dependencies.js +82 -0
- package/dist/core/utils/variables.d.ts +4 -0
- package/dist/core/utils/variables.js +10 -0
- package/dist/hooks/init/auth.d.ts +3 -0
- package/dist/hooks/init/auth.js +28 -0
- package/dist/hooks/init/update.d.ts +3 -0
- package/dist/hooks/init/update.js +42 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/repositories/process.d.ts +36 -0
- package/dist/repositories/process.js +339 -0
- package/dist/repositories/programming-language-manifest.d.ts +17 -0
- package/dist/repositories/programming-language-manifest.js +95 -0
- package/dist/repositories/resource.d.ts +29 -0
- package/dist/repositories/resource.js +79 -0
- package/dist/repositories/script-library.d.ts +28 -0
- package/dist/repositories/script-library.js +164 -0
- package/dist/repositories/team.d.ts +23 -0
- package/dist/repositories/team.js +74 -0
- package/dist/repositories/variable.d.ts +26 -0
- package/dist/repositories/variable.js +174 -0
- package/dist/runtime/executor.js +87 -0
- package/dist/runtime/executor.py +81 -0
- package/dist/runtime/libs/node/fcode/index.js +1 -0
- package/dist/runtime/libs/python/fcode/__init__.py +75 -0
- package/dist/runtime/libs/python/fcode/context.py +98 -0
- package/dist/runtime/libs/python/fcode/datastore.py +35 -0
- package/dist/runtime/libs/python/fcode/schedule.py +45 -0
- package/dist/runtime/libs/python/fcode/storage.py +271 -0
- package/dist/runtime/libs/python/fcode/variables.py +102 -0
- package/dist/services/auth-service.d.ts +12 -0
- package/dist/services/auth-service.js +114 -0
- package/dist/services/credential-prompter.d.ts +6 -0
- package/dist/services/credential-prompter.js +60 -0
- package/dist/services/fcode-graphql-client.d.ts +45 -0
- package/dist/services/fcode-graphql-client.js +721 -0
- package/dist/services/http-server.d.ts +3 -0
- package/dist/services/http-server.js +17 -0
- package/dist/services/oauth-browser-service.d.ts +9 -0
- package/dist/services/oauth-browser-service.js +164 -0
- package/dist/services/process-parameters-sampler.d.ts +2 -0
- package/dist/services/process-parameters-sampler.js +41 -0
- package/dist/services/process-runner.d.ts +22 -0
- package/dist/services/process-runner.js +97 -0
- package/dist/services/resource-checker.d.ts +8 -0
- package/dist/services/resource-checker.js +82 -0
- package/dist/services/test-runner.d.ts +17 -0
- package/dist/services/test-runner.js +228 -0
- package/dist/utils/canonical-hash.d.ts +9 -0
- package/dist/utils/canonical-hash.js +30 -0
- package/dist/utils/cli/index.d.ts +14 -0
- package/dist/utils/cli/index.js +50 -0
- package/dist/utils/cli/screen.d.ts +2 -0
- package/dist/utils/cli/screen.js +25 -0
- package/dist/utils/cli/styled/table.d.ts +23 -0
- package/dist/utils/cli/styled/table.js +272 -0
- package/dist/utils/colorize-resource.d.ts +1 -0
- package/dist/utils/colorize-resource.js +7 -0
- package/dist/utils/env-utils.d.ts +2 -0
- package/dist/utils/env-utils.js +16 -0
- package/dist/utils/file-utils.d.ts +11 -0
- package/dist/utils/file-utils.js +33 -0
- package/dist/utils/filenamify.d.ts +4 -0
- package/dist/utils/filenamify.js +73 -0
- package/dist/utils/gitignore.d.ts +17 -0
- package/dist/utils/gitignore.js +60 -0
- package/dist/utils/promise.d.ts +4 -0
- package/dist/utils/promise.js +38 -0
- package/dist/utils/url-utils.d.ts +2 -0
- package/dist/utils/url-utils.js +10 -0
- package/dist/utils/variable-warnings.d.ts +8 -0
- package/dist/utils/variable-warnings.js +38 -0
- package/oclif.manifest.json +1783 -0
- package/package.json +129 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import ProcessRepository from '../repositories/process';
|
|
3
|
+
import VariableRepository from '../repositories/variable';
|
|
4
|
+
export default class PreDebug extends Command {
|
|
5
|
+
static readonly hidden = true;
|
|
6
|
+
static readonly args: {
|
|
7
|
+
slug: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static readonly description = "Debug preparation for Factorial Code processes locally (without execution)";
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
static readonly flags: {
|
|
12
|
+
parameters: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
tempDir: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
_processRepository: ProcessRepository;
|
|
18
|
+
_variableRepository: VariableRepository;
|
|
19
|
+
run(): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
const source_code_sanitizer_1 = require("../core/executors/source-code-sanitizer");
|
|
6
|
+
const core_2 = require("@oclif/core");
|
|
7
|
+
const javascript_execution_task_1 = require("../core/executors/javascript-execution-task");
|
|
8
|
+
const python_execution_task_1 = require("../core/executors/python-execution-task");
|
|
9
|
+
const process_1 = require("../repositories/process");
|
|
10
|
+
const variable_1 = require("../repositories/variable");
|
|
11
|
+
const getSlugFromFilePath = (filePath) => {
|
|
12
|
+
const pathSep = path.sep == '\\' ? '\\\\' : path.sep;
|
|
13
|
+
const processRegexPart = `[${pathSep}]processes[${pathSep}]([^${pathSep}]+)`;
|
|
14
|
+
const versionRegexPart = `[${pathSep}]versions[${pathSep}]([^${pathSep}]+)`;
|
|
15
|
+
const fileRegexPart = `[${pathSep}](main\\.py|index\\.js)`;
|
|
16
|
+
const regex = new RegExp(`${processRegexPart}(${versionRegexPart})?${fileRegexPart}$`);
|
|
17
|
+
const match = regex.exec(filePath);
|
|
18
|
+
if (!match) {
|
|
19
|
+
throw new Error('Invalid file path ' + filePath);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
slug: match[1],
|
|
23
|
+
version: match[3],
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
class PreDebug extends core_2.Command {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
this._processRepository = new process_1.default();
|
|
30
|
+
this._variableRepository = new variable_1.default();
|
|
31
|
+
}
|
|
32
|
+
async run() {
|
|
33
|
+
const parsed = await this.parse(PreDebug);
|
|
34
|
+
const { flags: { parameters: parametersFlag, logLevel, tempDir }, } = parsed;
|
|
35
|
+
let version = parsed.flags.version;
|
|
36
|
+
let { args: { slug }, } = parsed;
|
|
37
|
+
if (slug.includes(path.sep)) {
|
|
38
|
+
const { slug: processSlug, version: processVersion } = getSlugFromFilePath(slug);
|
|
39
|
+
if (processVersion != null && version != null && processVersion != version) {
|
|
40
|
+
throw new Error('Version mismatch: ' + version + ' != ' + processVersion);
|
|
41
|
+
}
|
|
42
|
+
slug = processSlug;
|
|
43
|
+
version = processVersion;
|
|
44
|
+
}
|
|
45
|
+
const processData = await this._processRepository.find(slug, version);
|
|
46
|
+
const sourceCode = processData.script.sourceCode;
|
|
47
|
+
if ((0, source_code_sanitizer_1.isLegacySourceCode)(sourceCode, processData.script.programmingLanguage)) {
|
|
48
|
+
const pad = (text, char = ' ') => '###' + char + char + text.padEnd(82, char) + char + char + '###';
|
|
49
|
+
console.log();
|
|
50
|
+
console.log(pad('#', '#'));
|
|
51
|
+
console.log(pad('WARNING!!: Process does not cointain a main() function, breakpoints will not work.'));
|
|
52
|
+
console.log(pad('You should encapsulate your code in a main() function for full debugging support.'));
|
|
53
|
+
console.log(pad('#', '#'));
|
|
54
|
+
console.log(pad('// Sample process code:'));
|
|
55
|
+
console.log(pad(''));
|
|
56
|
+
if (processData.script.programmingLanguage === 'PYTHON') {
|
|
57
|
+
console.log(pad('from fcode import fcode, logger'));
|
|
58
|
+
console.log(pad('def main():'));
|
|
59
|
+
console.log(pad(' // your code'));
|
|
60
|
+
}
|
|
61
|
+
else if (processData.script.programmingLanguage === 'JAVASCRIPT') {
|
|
62
|
+
console.log(pad('const { fcode } = require("fcode");'));
|
|
63
|
+
console.log(pad('async function main() {'));
|
|
64
|
+
console.log(pad(' // your code'));
|
|
65
|
+
console.log(pad('}'));
|
|
66
|
+
console.log(pad('module.exports = { main }'));
|
|
67
|
+
}
|
|
68
|
+
console.log(pad(''));
|
|
69
|
+
console.log(pad('#', '#'));
|
|
70
|
+
console.log();
|
|
71
|
+
}
|
|
72
|
+
let parameters = {};
|
|
73
|
+
if (parametersFlag) {
|
|
74
|
+
try {
|
|
75
|
+
parameters = JSON.parse(parametersFlag);
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
parameters = await Promise.resolve(`${path.resolve(parametersFlag)}`).then(s => require(s));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
parameters = await this._processRepository.findParameters(slug);
|
|
83
|
+
}
|
|
84
|
+
const variables = await this._variableRepository.findAllForExecution();
|
|
85
|
+
const ExecutionTask = processData.script.programmingLanguage === 'PYTHON' ? python_execution_task_1.default : javascript_execution_task_1.default;
|
|
86
|
+
const executor = new ExecutionTask(processData.script.programmingLanguage, processData, { version, parameters, variables, logLevel }, tempDir);
|
|
87
|
+
await executor.prepare();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
PreDebug.hidden = true;
|
|
91
|
+
PreDebug.args = {
|
|
92
|
+
slug: core_1.Args.string({
|
|
93
|
+
description: 'Process slug',
|
|
94
|
+
name: 'slug',
|
|
95
|
+
required: true,
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
PreDebug.description = 'Debug preparation for Factorial Code processes locally (without execution)';
|
|
99
|
+
PreDebug.examples = ['$ fcode pre-debug [process-slug]', '$ fcode pre-debug --parameters ./parameters.json [process-slug]'];
|
|
100
|
+
PreDebug.flags = {
|
|
101
|
+
parameters: core_1.Flags.string({
|
|
102
|
+
char: 'p',
|
|
103
|
+
description: 'Parameters: stringified JSON or file path',
|
|
104
|
+
}),
|
|
105
|
+
version: core_1.Flags.string({
|
|
106
|
+
char: 'v',
|
|
107
|
+
description: 'Process version',
|
|
108
|
+
}),
|
|
109
|
+
logLevel: core_1.Flags.string({
|
|
110
|
+
char: 'l',
|
|
111
|
+
description: 'Log level to use in process execution',
|
|
112
|
+
default: 'DEBUG',
|
|
113
|
+
options: ['DEBUG', 'INFO', 'WARNING', 'ERROR'],
|
|
114
|
+
}),
|
|
115
|
+
tempDir: core_1.Flags.string({
|
|
116
|
+
char: 't',
|
|
117
|
+
description: 'Temporal directory to use in process build',
|
|
118
|
+
}),
|
|
119
|
+
};
|
|
120
|
+
exports.default = PreDebug;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import ProcessRepository from '../repositories/process';
|
|
3
|
+
import VariableRepository from '../repositories/variable';
|
|
4
|
+
export default class ProcessMetadata extends Command {
|
|
5
|
+
static readonly hidden = true;
|
|
6
|
+
static readonly args: {
|
|
7
|
+
slug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static readonly description = "Debug preparation for Factorial Code processes locally (without execution)";
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
static readonly flags: {
|
|
12
|
+
parameters: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
_processRepository: ProcessRepository;
|
|
16
|
+
_variableRepository: VariableRepository;
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
const javascript_execution_task_1 = require("../core/executors/javascript-execution-task");
|
|
6
|
+
const python_execution_task_1 = require("../core/executors/python-execution-task");
|
|
7
|
+
const process_1 = require("../repositories/process");
|
|
8
|
+
const variable_1 = require("../repositories/variable");
|
|
9
|
+
const variables_1 = require("../core/utils/variables");
|
|
10
|
+
class ProcessMetadata extends core_1.Command {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this._processRepository = new process_1.default();
|
|
14
|
+
this._variableRepository = new variable_1.default();
|
|
15
|
+
}
|
|
16
|
+
async run() {
|
|
17
|
+
const parsed = await this.parse(ProcessMetadata);
|
|
18
|
+
let { args: { slug }, flags: { parameters: parametersFlag, version }, } = parsed;
|
|
19
|
+
const variables = await this._variableRepository.findAllForExecution();
|
|
20
|
+
let parameters = {};
|
|
21
|
+
if (parametersFlag) {
|
|
22
|
+
try {
|
|
23
|
+
parameters = JSON.parse(parametersFlag);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
parameters = await Promise.resolve(`${path.resolve(parametersFlag)}`).then(s => require(s));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else if (slug) {
|
|
30
|
+
parameters = await this._processRepository.findParameters(slug);
|
|
31
|
+
}
|
|
32
|
+
if (slug) {
|
|
33
|
+
const processData = await this._processRepository.find(slug, version);
|
|
34
|
+
const ExecutionTask = processData.script.programmingLanguage === 'PYTHON' ? python_execution_task_1.default : javascript_execution_task_1.default;
|
|
35
|
+
const executor = new ExecutionTask(processData.script.programmingLanguage, processData, { version, parameters, variables, logLevel: 'INFO' }, undefined);
|
|
36
|
+
console.log(JSON.stringify(executor.getMetadata(), null, 2));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
console.log(JSON.stringify({ variables: (0, variables_1.getVariablesObject)(variables), parameters, execution: { process: { name: '', id: '' } } }));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
ProcessMetadata.hidden = true;
|
|
44
|
+
ProcessMetadata.args = {
|
|
45
|
+
slug: core_1.Args.string({
|
|
46
|
+
description: 'Process slug',
|
|
47
|
+
name: 'slug',
|
|
48
|
+
required: false,
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
ProcessMetadata.description = 'Debug preparation for Factorial Code processes locally (without execution)';
|
|
52
|
+
ProcessMetadata.examples = ['$ fcode process-metadata [process-slug]'];
|
|
53
|
+
ProcessMetadata.flags = {
|
|
54
|
+
parameters: core_1.Flags.string({
|
|
55
|
+
char: 'p',
|
|
56
|
+
description: 'Parameters: stringified JSON or file path',
|
|
57
|
+
}),
|
|
58
|
+
version: core_1.Flags.string({
|
|
59
|
+
char: 'v',
|
|
60
|
+
description: 'Process version',
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
63
|
+
exports.default = ProcessMetadata;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ProcessesCommand from '../../core/commands/processes-command';
|
|
2
|
+
export default class ProcessesAdd extends ProcessesCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const processes_command_1 = require("../../core/commands/processes-command");
|
|
4
|
+
const types_1 = require("../../core/types");
|
|
5
|
+
class ProcessesAdd extends processes_command_1.default {
|
|
6
|
+
async run() {
|
|
7
|
+
await super.addResources();
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
ProcessesAdd.description = 'Keeps track of a new local process';
|
|
11
|
+
ProcessesAdd.examples = ['$ fcode processes:add'];
|
|
12
|
+
ProcessesAdd.args = types_1.ResourceSlugArg;
|
|
13
|
+
exports.default = ProcessesAdd;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import BaseCommand from '../../core/commands/base-command';
|
|
2
|
+
export default class ProcessesInstallDependencies extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
check: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
reset: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const base_command_1 = require("../../core/commands/base-command");
|
|
4
|
+
const env_process_dependencies_command_1 = require("../../core/dependencies/env-process-dependencies-command");
|
|
5
|
+
const types_1 = require("../../core/types");
|
|
6
|
+
class ProcessesInstallDependencies extends base_command_1.default {
|
|
7
|
+
async run() {
|
|
8
|
+
await super.init();
|
|
9
|
+
const { args: { resourceSlug }, flags: { check, reset, force }, } = await this.parse(ProcessesInstallDependencies);
|
|
10
|
+
const args = [];
|
|
11
|
+
if (resourceSlug) {
|
|
12
|
+
args.push(resourceSlug);
|
|
13
|
+
}
|
|
14
|
+
if (check) {
|
|
15
|
+
args.push('--check');
|
|
16
|
+
}
|
|
17
|
+
if (reset) {
|
|
18
|
+
args.push('--reset');
|
|
19
|
+
}
|
|
20
|
+
if (force) {
|
|
21
|
+
args.push('--force');
|
|
22
|
+
}
|
|
23
|
+
await env_process_dependencies_command_1.default.run(args);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
ProcessesInstallDependencies.description = 'Install Factorial Code process dependencies';
|
|
27
|
+
ProcessesInstallDependencies.examples = ['$ fcode processes:install-dependencies [processSlug]'];
|
|
28
|
+
ProcessesInstallDependencies.args = types_1.ResourceSlugArg;
|
|
29
|
+
ProcessesInstallDependencies.flags = types_1.DependenciesFlags;
|
|
30
|
+
exports.default = ProcessesInstallDependencies;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ProcessesCommand from '../../core/commands/processes-command';
|
|
2
|
+
export default class ProcessesPull extends ProcessesCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
pullVersioned(): Promise<void>;
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const color_1 = require("@oclif/color");
|
|
4
|
+
const processes_command_1 = require("../../core/commands/processes-command");
|
|
5
|
+
const types_1 = require("../../core/types");
|
|
6
|
+
const cli_1 = require("../../utils/cli");
|
|
7
|
+
const settings_1 = require("../../config/settings");
|
|
8
|
+
class ProcessesPull extends processes_command_1.default {
|
|
9
|
+
async pullVersioned() {
|
|
10
|
+
const processes = await this.getRemoteResources();
|
|
11
|
+
const processRepository = this._resourceRepository;
|
|
12
|
+
const allPromises = [];
|
|
13
|
+
for (const process of processes) {
|
|
14
|
+
allPromises.push(this._versionedResourceQuery(process.id).then(async (remoteVersions) => {
|
|
15
|
+
const remoteVersionTags = new Set(remoteVersions.map((v) => v.tag));
|
|
16
|
+
// Remove local versions that were deleted in remote
|
|
17
|
+
for (const localTag of processRepository.getLocalVersionTags(process)) {
|
|
18
|
+
if (!remoteVersionTags.has(localTag)) {
|
|
19
|
+
cli_1.default.log(color_1.default.cyan(`🗑️ removing version '${localTag}' for process '${process.slug}'...`));
|
|
20
|
+
processRepository.removeVersion(process, localTag);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// Add only new (non-existing) versions
|
|
24
|
+
for (const versionedProcess of remoteVersions) {
|
|
25
|
+
if (!processRepository.versionExistsLocally(process, versionedProcess.tag)) {
|
|
26
|
+
cli_1.default.log(color_1.default.cyan(`🗂️ pulling version '${versionedProcess.tag}' for process '${process.slug}'...`));
|
|
27
|
+
await processRepository.saveVersion(process, versionedProcess);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}));
|
|
31
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
32
|
+
}
|
|
33
|
+
await Promise.allSettled(allPromises);
|
|
34
|
+
}
|
|
35
|
+
async run() {
|
|
36
|
+
await super.pullResources();
|
|
37
|
+
const ignoreProcessVersions = (await this.globalConfig.getSetting(settings_1.SettingKeys.IGNORE_PROCESS_VERSIONS)) === 'true';
|
|
38
|
+
if (!ignoreProcessVersions) {
|
|
39
|
+
await this.pullVersioned();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
ProcessesPull.description = 'Fetch all processes from cloud and save them locally';
|
|
44
|
+
ProcessesPull.examples = ['$ fcode processes:pull'];
|
|
45
|
+
ProcessesPull.args = types_1.ResourceSlugArg;
|
|
46
|
+
ProcessesPull.flags = types_1.ForceFlag;
|
|
47
|
+
exports.default = ProcessesPull;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ProcessesCommand from '../../core/commands/processes-command';
|
|
2
|
+
export default class ProcessesPush extends ProcessesCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
pushVersioned(): Promise<void>;
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const color_1 = require("@oclif/color");
|
|
4
|
+
const processes_command_1 = require("../../core/commands/processes-command");
|
|
5
|
+
const types_1 = require("../../core/types");
|
|
6
|
+
const cli_1 = require("../../utils/cli");
|
|
7
|
+
const settings_1 = require("../../config/settings");
|
|
8
|
+
class ProcessesPush extends processes_command_1.default {
|
|
9
|
+
async pushVersioned() {
|
|
10
|
+
const processes = (await this._resourceRepository.findAll()).filter((process) => process.id);
|
|
11
|
+
const processRepository = this._resourceRepository;
|
|
12
|
+
const allPromises = [];
|
|
13
|
+
for (const process of processes) {
|
|
14
|
+
allPromises.push(this._versionedResourceQuery(process.id).then(async (remoteVersionedProcesses) => {
|
|
15
|
+
const localVersionedProcesses = await processRepository.getVersions(process);
|
|
16
|
+
for (const localVersionedProcess of localVersionedProcesses) {
|
|
17
|
+
if (!remoteVersionedProcesses.find((remoteVersionedProcess) => remoteVersionedProcess.tag === localVersionedProcess.tag)) {
|
|
18
|
+
cli_1.default.log(color_1.default.cyan(`🗂️ pushing version '${localVersionedProcess.tag}' for process '${process.slug}'...`));
|
|
19
|
+
await this._pushVersionedResourceMutation(localVersionedProcess);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}));
|
|
23
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
24
|
+
}
|
|
25
|
+
await Promise.allSettled(allPromises);
|
|
26
|
+
}
|
|
27
|
+
async run() {
|
|
28
|
+
await super.pushResources();
|
|
29
|
+
const ignoreProcessVersions = (await this.globalConfig.getSetting(settings_1.SettingKeys.IGNORE_PROCESS_VERSIONS)) === 'true';
|
|
30
|
+
if (!ignoreProcessVersions) {
|
|
31
|
+
await this.pushVersioned();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
ProcessesPush.description = 'Update cloud processes with local ones';
|
|
36
|
+
ProcessesPush.examples = ['$ fcode processes:push'];
|
|
37
|
+
ProcessesPush.args = types_1.ResourceSlugArg;
|
|
38
|
+
ProcessesPush.flags = types_1.ForceFlag;
|
|
39
|
+
exports.default = ProcessesPush;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ProcessesCommand from '../../core/commands/processes-command';
|
|
2
|
+
export default class ProcessRemove extends ProcessesCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static examples: string[];
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const color_1 = require("@oclif/color");
|
|
4
|
+
const processes_command_1 = require("../../core/commands/processes-command");
|
|
5
|
+
const types_1 = require("../../core/types");
|
|
6
|
+
const cli_1 = require("../../utils/cli");
|
|
7
|
+
class ProcessRemove extends processes_command_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
if (!this.resourceSlug) {
|
|
10
|
+
cli_1.default.log(color_1.default.red(`You must specify a process slug`));
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
await super.removeResource(this.resourceSlug);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
ProcessRemove.description = 'Remove track of local processes';
|
|
17
|
+
ProcessRemove.args = types_1.ResourceSlugArg;
|
|
18
|
+
ProcessRemove.examples = ['$ fcode process:remove process-slug'];
|
|
19
|
+
exports.default = ProcessRemove;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ProcessesCommand from '../../core/commands/processes-command';
|
|
2
|
+
export default class ProcessesReset extends ProcessesCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const processes_command_1 = require("../../core/commands/processes-command");
|
|
4
|
+
const types_1 = require("../../core/types");
|
|
5
|
+
class ProcessesReset extends processes_command_1.default {
|
|
6
|
+
async run() {
|
|
7
|
+
await super.resetResources();
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
ProcessesReset.description = 'Reset processes with contents from current remote';
|
|
11
|
+
ProcessesReset.examples = ['$ fcode processes:reset'];
|
|
12
|
+
ProcessesReset.args = types_1.ResourceSlugArg;
|
|
13
|
+
exports.default = ProcessesReset;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type MergedResource } from '../../core/types';
|
|
2
|
+
import ProcessesCommand from '../../core/commands/processes-command';
|
|
3
|
+
export default class ProcessesStatus extends ProcessesCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
resourceSlug: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
resourcesTableLog(resources: Array<MergedResource>): Promise<void>;
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("../../core/types");
|
|
4
|
+
const processes_command_1 = require("../../core/commands/processes-command");
|
|
5
|
+
const colorize_resource_1 = require("../../utils/colorize-resource");
|
|
6
|
+
const cli_1 = require("../../utils/cli");
|
|
7
|
+
class ProcessesStatus extends processes_command_1.default {
|
|
8
|
+
async resourcesTableLog(resources) {
|
|
9
|
+
const hasInherited = resources.some((resource) => resource.resolvingTeamSlug);
|
|
10
|
+
cli_1.cli.table(resources, {
|
|
11
|
+
slug: {
|
|
12
|
+
get(resource) {
|
|
13
|
+
return (0, colorize_resource_1.colorizeByStatus)(resource.slug, resource.status);
|
|
14
|
+
},
|
|
15
|
+
header: 'slug',
|
|
16
|
+
},
|
|
17
|
+
name: {
|
|
18
|
+
get(resource) {
|
|
19
|
+
return (0, colorize_resource_1.colorizeByStatus)(resource.name, resource.status);
|
|
20
|
+
},
|
|
21
|
+
header: 'name',
|
|
22
|
+
},
|
|
23
|
+
programmingLanguage: {
|
|
24
|
+
get(resource) {
|
|
25
|
+
return (0, colorize_resource_1.colorizeByStatus)(resource.script.programmingLanguage, resource.status);
|
|
26
|
+
},
|
|
27
|
+
header: 'language',
|
|
28
|
+
},
|
|
29
|
+
tags: {
|
|
30
|
+
get(resource) {
|
|
31
|
+
return (0, colorize_resource_1.colorizeByStatus)(resource.tags?.join(', '), resource.status);
|
|
32
|
+
},
|
|
33
|
+
header: 'tags',
|
|
34
|
+
},
|
|
35
|
+
...(hasInherited && {
|
|
36
|
+
inherited: {
|
|
37
|
+
get(resource) {
|
|
38
|
+
return (0, colorize_resource_1.colorizeByStatus)(resource.resolvingTeamSlug ? `🔗 ${resource.resolvingTeamSlug}` : '', resource.status);
|
|
39
|
+
},
|
|
40
|
+
header: 'inherited',
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
status: {
|
|
44
|
+
get({ status }) {
|
|
45
|
+
return (0, colorize_resource_1.colorizeByStatus)(status, status);
|
|
46
|
+
},
|
|
47
|
+
header: 'status',
|
|
48
|
+
},
|
|
49
|
+
}, { sort: 'name' });
|
|
50
|
+
}
|
|
51
|
+
async run() {
|
|
52
|
+
await this.resourcesLog();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
ProcessesStatus.description = 'List all processes status';
|
|
56
|
+
ProcessesStatus.examples = ['$ fcode processes:status'];
|
|
57
|
+
ProcessesStatus.args = types_1.ResourceSlugArg;
|
|
58
|
+
exports.default = ProcessesStatus;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import BaseCommand from '../core/commands/base-command';
|
|
2
|
+
export default class PullCommand extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const base_command_1 = require("../core/commands/base-command");
|
|
4
|
+
const pull_1 = require("./modules/pull");
|
|
5
|
+
const pull_2 = require("./processes/pull");
|
|
6
|
+
const pull_3 = require("./variables/pull");
|
|
7
|
+
const pull_4 = require("./dependencies/pull");
|
|
8
|
+
const pull_5 = require("./team/pull");
|
|
9
|
+
const types_1 = require("../core/types");
|
|
10
|
+
const gitignore_1 = require("../utils/gitignore");
|
|
11
|
+
class PullCommand extends base_command_1.default {
|
|
12
|
+
async run() {
|
|
13
|
+
const { flags: { force }, } = await this.parse(PullCommand);
|
|
14
|
+
const args = [];
|
|
15
|
+
if (force) {
|
|
16
|
+
args.push('--force');
|
|
17
|
+
}
|
|
18
|
+
await pull_2.default.run(args);
|
|
19
|
+
await pull_1.default.run(args);
|
|
20
|
+
await pull_3.default.run(args);
|
|
21
|
+
await pull_4.default.run(args);
|
|
22
|
+
// Team settings are pulled last so process metadata is available to resolve the
|
|
23
|
+
// error-handler process id to its slug.
|
|
24
|
+
await pull_5.default.run([]);
|
|
25
|
+
// Keep inherited resources out of git now that all resource metadata is saved.
|
|
26
|
+
await (0, gitignore_1.syncInheritedGitignore)();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
PullCommand.description = 'Fetch from cloud team workspace and update local workspace';
|
|
30
|
+
PullCommand.examples = ['$ fcode pull'];
|
|
31
|
+
PullCommand.flags = types_1.ForceFlag;
|
|
32
|
+
exports.default = PullCommand;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import BaseCommand from '../core/commands/base-command';
|
|
2
|
+
export default class PushCommand extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const base_command_1 = require("../core/commands/base-command");
|
|
4
|
+
const push_1 = require("./modules/push");
|
|
5
|
+
const push_2 = require("./processes/push");
|
|
6
|
+
const push_3 = require("./variables/push");
|
|
7
|
+
const push_4 = require("./dependencies/push");
|
|
8
|
+
const push_5 = require("./team/push");
|
|
9
|
+
const types_1 = require("../core/types");
|
|
10
|
+
class PushCommand extends base_command_1.default {
|
|
11
|
+
async run() {
|
|
12
|
+
const { flags: { force }, } = await this.parse(PushCommand);
|
|
13
|
+
const args = [];
|
|
14
|
+
if (force) {
|
|
15
|
+
args.push('--force');
|
|
16
|
+
}
|
|
17
|
+
await push_2.default.run(args);
|
|
18
|
+
await push_1.default.run(args);
|
|
19
|
+
await push_3.default.run(args);
|
|
20
|
+
await push_4.default.run(args);
|
|
21
|
+
// Team settings are pushed last so the error-handler process exists to resolve
|
|
22
|
+
// its slug to an id.
|
|
23
|
+
await push_5.default.run(args);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
PushCommand.description = 'Update cloud team workspace with local workspace';
|
|
27
|
+
PushCommand.examples = ['$ fcode push'];
|
|
28
|
+
PushCommand.flags = types_1.ForceFlag;
|
|
29
|
+
exports.default = PushCommand;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import BaseCommand from '../../core/commands/base-command';
|
|
2
|
+
export default class RemoteAdd extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
team: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
init(): Promise<void>;
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|