@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,19 @@
|
|
|
1
|
+
import { ProgrammingLanguageManifest, type ProgrammingLanguage, type Dependency } from '../types';
|
|
2
|
+
import ApiClientCommand from '../commands/api-client-command';
|
|
3
|
+
declare abstract class EnvDependenciesCommand extends ApiClientCommand {
|
|
4
|
+
abstract readonly programmingLanguage: ProgrammingLanguage;
|
|
5
|
+
static flags: {
|
|
6
|
+
check: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
reset: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
protected get envPath(): string;
|
|
11
|
+
abstract createEnv(): Promise<void>;
|
|
12
|
+
abstract installDependencies(installationPath: string, dependencies: Array<Dependency>): Promise<void>;
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
check(): Promise<void>;
|
|
15
|
+
getManifest(): Promise<ProgrammingLanguageManifest>;
|
|
16
|
+
installationPath(dependencies: Array<Dependency>): string;
|
|
17
|
+
}
|
|
18
|
+
export declare function dependenciesHash(dependencies: Array<Dependency>): string;
|
|
19
|
+
export default EnvDependenciesCommand;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dependenciesHash = dependenciesHash;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const workspace_1 = require("../../config/workspace");
|
|
6
|
+
const api_client_command_1 = require("../commands/api-client-command");
|
|
7
|
+
const node_crypto_1 = require("node:crypto");
|
|
8
|
+
const fs = require("node:fs");
|
|
9
|
+
const path = require("node:path");
|
|
10
|
+
const color_1 = require("@oclif/color");
|
|
11
|
+
const programming_language_manifest_1 = require("../../repositories/programming-language-manifest");
|
|
12
|
+
const cli_1 = require("../../utils/cli");
|
|
13
|
+
class EnvDependenciesCommand extends api_client_command_1.default {
|
|
14
|
+
get envPath() {
|
|
15
|
+
return (0, workspace_1.baseDependenciesPath)(this.programmingLanguage);
|
|
16
|
+
}
|
|
17
|
+
async run() {
|
|
18
|
+
await super.init();
|
|
19
|
+
const { flags: { check, reset, force }, } = await this.parse(EnvDependenciesCommand);
|
|
20
|
+
if (check) {
|
|
21
|
+
return this.check();
|
|
22
|
+
}
|
|
23
|
+
if (reset) {
|
|
24
|
+
cli_1.default.log(color_1.default.yellow(`Resetting ${(0, types_1.programmingLanguageDisplayName)(this.programmingLanguage)} dependencies...`));
|
|
25
|
+
fs.rmSync(this.envPath, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
const manifest = await this.getManifest();
|
|
28
|
+
const installationPath = this.installationPath(manifest.dependencies);
|
|
29
|
+
if (fs.existsSync(installationPath)) {
|
|
30
|
+
if (force) {
|
|
31
|
+
fs.rmSync(installationPath, { recursive: true });
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
cli_1.default.log(color_1.default.yellow(`Skipping ${(0, types_1.programmingLanguageDisplayName)(this.programmingLanguage)} dependencies installation as they already exist in ${installationPath}.`));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
await this.createEnv();
|
|
39
|
+
cli_1.default.log(`Installing Factorial Code ${(0, types_1.programmingLanguageDisplayName)(this.programmingLanguage)} dependencies... (This process might take some time ⌛️)`);
|
|
40
|
+
cli_1.default.log('====================================');
|
|
41
|
+
await this.installDependencies(installationPath, manifest.dependencies);
|
|
42
|
+
cli_1.default.log('====================================');
|
|
43
|
+
cli_1.default.log(color_1.default.green(`Factorial Code ${(0, types_1.programmingLanguageDisplayName)(this.programmingLanguage)} dependencies successfully installed in ${installationPath} 🤩\n\n`));
|
|
44
|
+
}
|
|
45
|
+
async check() {
|
|
46
|
+
const installationPath = this.installationPath((await this.getManifest()).dependencies);
|
|
47
|
+
if (!fs.existsSync(installationPath)) {
|
|
48
|
+
cli_1.default.log(color_1.default.yellow(`⚠️ ${(0, types_1.programmingLanguageDisplayName)(this.programmingLanguage)} dependencies need to be installed.`));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
cli_1.default.log(color_1.default.green(`✅ ${(0, types_1.programmingLanguageDisplayName)(this.programmingLanguage)} dependencies already installed at ${installationPath}`));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
getManifest() {
|
|
55
|
+
const repo = new programming_language_manifest_1.default();
|
|
56
|
+
return repo.find(this.programmingLanguage);
|
|
57
|
+
}
|
|
58
|
+
installationPath(dependencies) {
|
|
59
|
+
return path.join(this.envPath, dependenciesHash(dependencies));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
EnvDependenciesCommand.flags = types_1.DependenciesFlags;
|
|
63
|
+
function dependenciesHash(dependencies) {
|
|
64
|
+
const dependenciesString = dependencies
|
|
65
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
66
|
+
.map(({ name, specifier }) => `${name}: ${specifier}`)
|
|
67
|
+
.join('\n');
|
|
68
|
+
return (0, node_crypto_1.createHash)('md5').update(dependenciesString).digest('hex');
|
|
69
|
+
}
|
|
70
|
+
exports.default = EnvDependenciesCommand;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import ProcessRepository from '../../repositories/process';
|
|
2
|
+
import BaseCommand from '../commands/base-command';
|
|
3
|
+
export default class EnvProcessDependenciesCommand extends BaseCommand {
|
|
4
|
+
_resourceRepository: ProcessRepository;
|
|
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
|
+
private installDependencies;
|
|
15
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("../types");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const color_1 = require("@oclif/color");
|
|
7
|
+
const cli_1 = require("../../utils/cli");
|
|
8
|
+
const dependencies_1 = require("../utils/dependencies");
|
|
9
|
+
const javascript_env_dependencies_1 = require("./javascript-env-dependencies");
|
|
10
|
+
const python_env_dependencies_1 = require("./python-env-dependencies");
|
|
11
|
+
const process_1 = require("../../repositories/process");
|
|
12
|
+
const base_command_1 = require("../commands/base-command");
|
|
13
|
+
const PROGRAMMING_LANGUAGE_ENV_DEPENDENCIES = {
|
|
14
|
+
JAVASCRIPT: javascript_env_dependencies_1.default,
|
|
15
|
+
PYTHON: python_env_dependencies_1.default,
|
|
16
|
+
};
|
|
17
|
+
class EnvProcessDependenciesCommand extends base_command_1.default {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this._resourceRepository = new process_1.default();
|
|
21
|
+
}
|
|
22
|
+
async run() {
|
|
23
|
+
await super.init();
|
|
24
|
+
const { args: { resourceSlug }, flags: { check, reset, force }, } = await this.parse(EnvProcessDependenciesCommand);
|
|
25
|
+
let processes = [];
|
|
26
|
+
if (resourceSlug) {
|
|
27
|
+
processes = [await this._resourceRepository.find(resourceSlug)];
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
processes = await this._resourceRepository.findAll();
|
|
31
|
+
}
|
|
32
|
+
for (const process of processes) {
|
|
33
|
+
if (!process.settings.dependencies.scopedToProcess) {
|
|
34
|
+
cli_1.default.log(color_1.default.cyan(`Skipping process '${process.slug}' ${(0, types_1.programmingLanguageDisplayName)(process.script.programmingLanguage)} dependencies installation as they are not scoped to process.`));
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const installationPath = await (0, dependencies_1.getProcessDependenciesPath)(process);
|
|
38
|
+
if (check) {
|
|
39
|
+
if (!fs.existsSync(installationPath)) {
|
|
40
|
+
cli_1.default.log(color_1.default.yellow(`⚠️ Process '${process.slug}' ${(0, types_1.programmingLanguageDisplayName)(process.script.programmingLanguage)} dependencies need to be installed.`));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
cli_1.default.log(color_1.default.green(`✅ Process '${process.slug}' ${(0, types_1.programmingLanguageDisplayName)(process.script.programmingLanguage)} dependencies already installed at ${installationPath}`));
|
|
44
|
+
}
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (reset) {
|
|
48
|
+
cli_1.default.log(color_1.default.yellow(`Resetting ${(0, types_1.programmingLanguageDisplayName)(process.script.programmingLanguage)} dependencies...`));
|
|
49
|
+
fs.rmSync(path.join(installationPath, '..'), { recursive: true });
|
|
50
|
+
}
|
|
51
|
+
if (fs.existsSync(installationPath)) {
|
|
52
|
+
if (force) {
|
|
53
|
+
fs.rmSync(installationPath, { recursive: true });
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
cli_1.default.log(color_1.default.yellow(`Skipping process '${process.slug}' ${(0, types_1.programmingLanguageDisplayName)(process.script.programmingLanguage)} dependencies installation as they already exist in ${installationPath}.`));
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
await this.installDependencies(installationPath, process);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async installDependencies(installationPath, process) {
|
|
64
|
+
const envDependencies = new PROGRAMMING_LANGUAGE_ENV_DEPENDENCIES[process.script.programmingLanguage]([], this.config);
|
|
65
|
+
await envDependencies.createEnv();
|
|
66
|
+
cli_1.default.log(`Installing process '${process.slug}' ${(0, types_1.programmingLanguageDisplayName)(process.script.programmingLanguage)} dependencies... (This process might take some time ⌛️)`);
|
|
67
|
+
cli_1.default.log('====================================');
|
|
68
|
+
await envDependencies.installDependencies(installationPath, process.manifest?.dependencies || []);
|
|
69
|
+
if (process.script.programmingLanguage === 'JAVASCRIPT') {
|
|
70
|
+
fs.writeFileSync(path.join(installationPath, 'index.js'), '');
|
|
71
|
+
}
|
|
72
|
+
cli_1.default.log('====================================');
|
|
73
|
+
cli_1.default.log(color_1.default.green(`Process '${process.slug}' ${(0, types_1.programmingLanguageDisplayName)(process.script.programmingLanguage)} dependencies successfully installed in ${installationPath} 🤩\n\n`));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
EnvProcessDependenciesCommand.args = types_1.ResourceSlugArg;
|
|
77
|
+
EnvProcessDependenciesCommand.flags = types_1.DependenciesFlags;
|
|
78
|
+
exports.default = EnvProcessDependenciesCommand;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import EnvDependenciesCommand from './env-dependencies-command';
|
|
2
|
+
import { ProgrammingLanguage, Dependency } from '../types';
|
|
3
|
+
export default class JavaScriptEnvDependencies extends EnvDependenciesCommand {
|
|
4
|
+
get programmingLanguage(): ProgrammingLanguage;
|
|
5
|
+
createEnv(): Promise<void>;
|
|
6
|
+
installDependencies(installationPath: string, dependencies: Array<Dependency>): Promise<void>;
|
|
7
|
+
private ensurePnpm;
|
|
8
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_child_process_1 = require("node:child_process");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const env_dependencies_command_1 = require("./env-dependencies-command");
|
|
7
|
+
class JavaScriptEnvDependencies extends env_dependencies_command_1.default {
|
|
8
|
+
get programmingLanguage() {
|
|
9
|
+
return 'JAVASCRIPT';
|
|
10
|
+
}
|
|
11
|
+
async createEnv() {
|
|
12
|
+
try {
|
|
13
|
+
fs.mkdirSync(this.envPath, { recursive: true });
|
|
14
|
+
await this.ensurePnpm();
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
fs.rmSync(this.envPath, { recursive: true, force: true });
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async installDependencies(installationPath, dependencies) {
|
|
22
|
+
try {
|
|
23
|
+
const packageObject = {
|
|
24
|
+
name: 'fcode',
|
|
25
|
+
version: '1.0.0',
|
|
26
|
+
dependencies: dependencies.reduce((acc, { name, specifier }) => {
|
|
27
|
+
acc[name] = specifier;
|
|
28
|
+
return acc;
|
|
29
|
+
}, {}),
|
|
30
|
+
};
|
|
31
|
+
fs.mkdirSync(installationPath, { recursive: true });
|
|
32
|
+
fs.writeFileSync(`${installationPath}/package.json`, JSON.stringify(packageObject, null, 2));
|
|
33
|
+
// Backward compatibility
|
|
34
|
+
const pnpmPath = await this.ensurePnpm();
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
const proc = (0, node_child_process_1.spawn)(pnpmPath, ['install', '--no-dev'], {
|
|
37
|
+
cwd: installationPath,
|
|
38
|
+
stdio: 'inherit',
|
|
39
|
+
});
|
|
40
|
+
proc.on('close', (code) => {
|
|
41
|
+
if (code === 0) {
|
|
42
|
+
resolve();
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
fs.rmSync(installationPath, { recursive: true, force: true });
|
|
46
|
+
reject(new Error(`Failed to install dependencies with code ${code}`));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
fs.rmSync(installationPath, { recursive: true, force: true });
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async ensurePnpm() {
|
|
57
|
+
const pnpmPath = path.join(this.envPath, 'node_modules', '.bin', 'pnpm');
|
|
58
|
+
if (!fs.existsSync(pnpmPath)) {
|
|
59
|
+
return new Promise((resolve, reject) => {
|
|
60
|
+
const proc = (0, node_child_process_1.spawn)('npm', ['install', '--prefix', this.envPath, 'pnpm'], {
|
|
61
|
+
cwd: this.envPath,
|
|
62
|
+
stdio: 'inherit',
|
|
63
|
+
});
|
|
64
|
+
proc.on('close', (code) => {
|
|
65
|
+
if (code === 0) {
|
|
66
|
+
resolve(pnpmPath);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
reject(new Error(`Failed to install pnpm with code ${code}`));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return pnpmPath;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.default = JavaScriptEnvDependencies;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProgrammingLanguage, Dependency } from '../types';
|
|
2
|
+
import EnvDependenciesCommand from './env-dependencies-command';
|
|
3
|
+
export default class PythonEnvDependencies extends EnvDependenciesCommand {
|
|
4
|
+
get programmingLanguage(): ProgrammingLanguage;
|
|
5
|
+
createEnv(): Promise<void>;
|
|
6
|
+
installDependencies(installationPath: string, dependencies: Array<Dependency>): Promise<void>;
|
|
7
|
+
generateInit(): string;
|
|
8
|
+
private ensureUv;
|
|
9
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_child_process_1 = require("node:child_process");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const env_dependencies_command_1 = require("./env-dependencies-command");
|
|
7
|
+
const cli_1 = require("../../utils/cli");
|
|
8
|
+
class PythonEnvDependencies extends env_dependencies_command_1.default {
|
|
9
|
+
get programmingLanguage() {
|
|
10
|
+
return 'PYTHON';
|
|
11
|
+
}
|
|
12
|
+
async createEnv() {
|
|
13
|
+
try {
|
|
14
|
+
await new Promise((resolve, reject) => {
|
|
15
|
+
(0, node_child_process_1.exec)(`python3 -m venv ${this.envPath}`, (error) => {
|
|
16
|
+
if (error) {
|
|
17
|
+
reject(error);
|
|
18
|
+
}
|
|
19
|
+
cli_1.default.log(`Python virtual environment successfully created at ${this.envPath}`);
|
|
20
|
+
resolve();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
await this.ensureUv();
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
fs.rmSync(this.envPath, { recursive: true, force: true });
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async installDependencies(installationPath, dependencies) {
|
|
31
|
+
try {
|
|
32
|
+
const requirements = dependencies
|
|
33
|
+
.map(({ name, specifier }) => {
|
|
34
|
+
if (specifier.startsWith('git')) {
|
|
35
|
+
return `${name} @ ${specifier}`;
|
|
36
|
+
}
|
|
37
|
+
return `${name}==${specifier}`;
|
|
38
|
+
})
|
|
39
|
+
.join('\n');
|
|
40
|
+
fs.mkdirSync(installationPath, { recursive: true });
|
|
41
|
+
fs.writeFileSync(`${installationPath}/requirements.txt`, requirements);
|
|
42
|
+
// Backward compatibility
|
|
43
|
+
const uvPath = await this.ensureUv();
|
|
44
|
+
return new Promise((resolve, reject) => {
|
|
45
|
+
const proc = (0, node_child_process_1.spawn)(uvPath, ['pip', 'install', '-r', './requirements.txt', '--target', '.'], {
|
|
46
|
+
cwd: installationPath,
|
|
47
|
+
stdio: 'inherit',
|
|
48
|
+
});
|
|
49
|
+
proc.on('close', (code) => {
|
|
50
|
+
if (code === 0) {
|
|
51
|
+
resolve();
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
fs.rmSync(installationPath, { recursive: true, force: true });
|
|
55
|
+
reject(new Error(`Failed to install dependencies with code ${code}`));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
fs.rmSync(installationPath, { recursive: true, force: true });
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
generateInit() {
|
|
66
|
+
return `import os
|
|
67
|
+
import json
|
|
68
|
+
`;
|
|
69
|
+
}
|
|
70
|
+
async ensureUv() {
|
|
71
|
+
const uvPath = path.join(this.envPath, 'bin', 'uv');
|
|
72
|
+
const pipPath = path.join(this.envPath, 'bin', 'pip');
|
|
73
|
+
if (!fs.existsSync(uvPath)) {
|
|
74
|
+
return new Promise((resolve, reject) => {
|
|
75
|
+
const proc = (0, node_child_process_1.spawn)(pipPath, ['install', '--force-reinstall', 'uv'], {
|
|
76
|
+
cwd: this.envPath,
|
|
77
|
+
});
|
|
78
|
+
proc.on('close', (code) => {
|
|
79
|
+
if (code === 0) {
|
|
80
|
+
resolve(uvPath);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
reject(new Error(`Failed to install uv with code ${code}`));
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return uvPath;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.default = PythonEnvDependencies;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Process, ProgrammingLanguage } from './types';
|
|
2
|
+
export declare abstract class CLIError extends Error {
|
|
3
|
+
suggestions: any;
|
|
4
|
+
constructor(message: string, options?: {
|
|
5
|
+
exit?: false | number;
|
|
6
|
+
code?: string;
|
|
7
|
+
suggestions?: string[];
|
|
8
|
+
} & any);
|
|
9
|
+
}
|
|
10
|
+
export declare abstract class ResourceNotFound extends CLIError {
|
|
11
|
+
constructor(error: Error | string, resourceType: string, resourceId: string, options: {
|
|
12
|
+
exit?: false | number;
|
|
13
|
+
} & any);
|
|
14
|
+
}
|
|
15
|
+
export declare class LocalProcessNotFound extends ResourceNotFound {
|
|
16
|
+
constructor(error: Error | string, processId: string);
|
|
17
|
+
}
|
|
18
|
+
export declare class CloudProcessNotFound extends ResourceNotFound {
|
|
19
|
+
constructor(error: Error | string, processId: string);
|
|
20
|
+
}
|
|
21
|
+
export declare class LocalScriptLibraryNotFound extends ResourceNotFound {
|
|
22
|
+
constructor(error: Error | string, scriptLibraryId: string);
|
|
23
|
+
}
|
|
24
|
+
export declare class CloudScriptLibraryNotFound extends ResourceNotFound {
|
|
25
|
+
constructor(error: Error | string, scriptLibraryId: string);
|
|
26
|
+
}
|
|
27
|
+
export declare class LocalVariableNotFound extends ResourceNotFound {
|
|
28
|
+
constructor(error: Error | string, variableId: string);
|
|
29
|
+
}
|
|
30
|
+
export declare class CloudVariableNotFound extends ResourceNotFound {
|
|
31
|
+
constructor(error: Error | string, variableId: string);
|
|
32
|
+
}
|
|
33
|
+
export declare class LocalProgrammingLanguageManifestNotFound extends ResourceNotFound {
|
|
34
|
+
constructor(error: Error | string, programmingLanguageManifestId: string);
|
|
35
|
+
}
|
|
36
|
+
export declare class CloudProgrammingLanguageManifestNotFound extends ResourceNotFound {
|
|
37
|
+
constructor(error: Error | string, programmingLanguageManifestId: string);
|
|
38
|
+
}
|
|
39
|
+
export declare class NotAuthenticated extends CLIError {
|
|
40
|
+
url: string;
|
|
41
|
+
constructor(url: string);
|
|
42
|
+
getUrl(): string;
|
|
43
|
+
}
|
|
44
|
+
export declare class NotFcodeWorkspace extends CLIError {
|
|
45
|
+
constructor();
|
|
46
|
+
}
|
|
47
|
+
export declare class DependenciesNotInstalled extends CLIError {
|
|
48
|
+
constructor(programmingLanguage: ProgrammingLanguage);
|
|
49
|
+
}
|
|
50
|
+
export declare class ProcessDependenciesNotInstalled extends CLIError {
|
|
51
|
+
constructor(process: Process);
|
|
52
|
+
}
|
|
53
|
+
export declare class ErrorExecutingProcess extends CLIError {
|
|
54
|
+
constructor(message: string);
|
|
55
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorExecutingProcess = exports.ProcessDependenciesNotInstalled = exports.DependenciesNotInstalled = exports.NotFcodeWorkspace = exports.NotAuthenticated = exports.CloudProgrammingLanguageManifestNotFound = exports.LocalProgrammingLanguageManifestNotFound = exports.CloudVariableNotFound = exports.LocalVariableNotFound = exports.CloudScriptLibraryNotFound = exports.LocalScriptLibraryNotFound = exports.CloudProcessNotFound = exports.LocalProcessNotFound = exports.ResourceNotFound = exports.CLIError = void 0;
|
|
4
|
+
const global_1 = require("../config/global");
|
|
5
|
+
class CLIError extends Error {
|
|
6
|
+
constructor(message, options) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = this.constructor.name;
|
|
9
|
+
this.suggestions = options?.suggestions;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.CLIError = CLIError;
|
|
13
|
+
class ResourceNotFound extends CLIError {
|
|
14
|
+
constructor(error, resourceType, resourceId, options) {
|
|
15
|
+
super(`Local ${resourceType} ${resourceId} not found!`, {
|
|
16
|
+
code: 'ERR_RESOURCE_NOT_FOUND',
|
|
17
|
+
exit: 1,
|
|
18
|
+
...options,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.ResourceNotFound = ResourceNotFound;
|
|
23
|
+
class LocalProcessNotFound extends ResourceNotFound {
|
|
24
|
+
constructor(error, processId) {
|
|
25
|
+
super(error, 'process', processId, {
|
|
26
|
+
code: 'ERR_LOCAL_PROCESS_NOT_FOUND',
|
|
27
|
+
suggestions: ['fcode processes'],
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.LocalProcessNotFound = LocalProcessNotFound;
|
|
32
|
+
class CloudProcessNotFound extends ResourceNotFound {
|
|
33
|
+
constructor(error, processId) {
|
|
34
|
+
super(error, 'process', processId, {
|
|
35
|
+
code: 'ERR_CLOUD_PROCESS_NOT_FOUND',
|
|
36
|
+
suggestions: ['fcode processes'],
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.CloudProcessNotFound = CloudProcessNotFound;
|
|
41
|
+
class LocalScriptLibraryNotFound extends ResourceNotFound {
|
|
42
|
+
constructor(error, scriptLibraryId) {
|
|
43
|
+
super(error, 'ScriptLibrary', scriptLibraryId, {
|
|
44
|
+
code: 'ERR_LOCAL_SCRIPT_LIBRARY_NOT_FOUND',
|
|
45
|
+
suggestions: [],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.LocalScriptLibraryNotFound = LocalScriptLibraryNotFound;
|
|
50
|
+
class CloudScriptLibraryNotFound extends ResourceNotFound {
|
|
51
|
+
constructor(error, scriptLibraryId) {
|
|
52
|
+
super(error, 'ScriptLibrary', scriptLibraryId, {
|
|
53
|
+
code: 'ERR_CLOUD_SCRIPT_LIBRARY_NOT_FOUND',
|
|
54
|
+
suggestions: [],
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.CloudScriptLibraryNotFound = CloudScriptLibraryNotFound;
|
|
59
|
+
class LocalVariableNotFound extends ResourceNotFound {
|
|
60
|
+
constructor(error, variableId) {
|
|
61
|
+
super(error, 'Variable', variableId, {
|
|
62
|
+
code: 'ERR_LOCAL_VARIABLE_NOT_FOUND',
|
|
63
|
+
suggestions: [],
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.LocalVariableNotFound = LocalVariableNotFound;
|
|
68
|
+
class CloudVariableNotFound extends ResourceNotFound {
|
|
69
|
+
constructor(error, variableId) {
|
|
70
|
+
super(error, 'Variable', variableId, {
|
|
71
|
+
code: 'ERR_CLOUD_VARIABLE_NOT_FOUND',
|
|
72
|
+
suggestions: [],
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.CloudVariableNotFound = CloudVariableNotFound;
|
|
77
|
+
class LocalProgrammingLanguageManifestNotFound extends ResourceNotFound {
|
|
78
|
+
constructor(error, programmingLanguageManifestId) {
|
|
79
|
+
super(error, 'ProgrammingLanguageManifest', programmingLanguageManifestId, {
|
|
80
|
+
code: 'ERR_LOCAL_PROGRAMMING_LANGUAGE_MANIFEST_NOT_FOUND',
|
|
81
|
+
suggestions: [],
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.LocalProgrammingLanguageManifestNotFound = LocalProgrammingLanguageManifestNotFound;
|
|
86
|
+
class CloudProgrammingLanguageManifestNotFound extends ResourceNotFound {
|
|
87
|
+
constructor(error, programmingLanguageManifestId) {
|
|
88
|
+
super(error, 'ProgrammingLanguageManifest', programmingLanguageManifestId, {
|
|
89
|
+
code: 'ERR_CLOUD_PROGRAMMING_LANGUAGE_MANIFEST_NOT_FOUND',
|
|
90
|
+
suggestions: [],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.CloudProgrammingLanguageManifestNotFound = CloudProgrammingLanguageManifestNotFound;
|
|
95
|
+
class NotAuthenticated extends CLIError {
|
|
96
|
+
constructor(url) {
|
|
97
|
+
super(`⚠️ No session active. Try 'fcode login${url !== global_1.FCODE_CLOUD_URL ? ' --url ' + url : ''}'`);
|
|
98
|
+
this.url = url;
|
|
99
|
+
}
|
|
100
|
+
getUrl() {
|
|
101
|
+
return this.url;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.NotAuthenticated = NotAuthenticated;
|
|
105
|
+
class NotFcodeWorkspace extends CLIError {
|
|
106
|
+
constructor() {
|
|
107
|
+
super('⚠️ Current directory is not a Factorial Code workspace.', {
|
|
108
|
+
code: 'ERR_NOT_FCODE_WORKSPACE',
|
|
109
|
+
exit: 1,
|
|
110
|
+
suggestions: ['fcode clone <team-slug>'],
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.NotFcodeWorkspace = NotFcodeWorkspace;
|
|
115
|
+
class DependenciesNotInstalled extends CLIError {
|
|
116
|
+
constructor(programmingLanguage) {
|
|
117
|
+
super(`Dependencies not installed.`, {
|
|
118
|
+
code: `DEPENDENCIES_NOT_INSTALLED_${programmingLanguage}`,
|
|
119
|
+
exit: 1,
|
|
120
|
+
suggestions: [`fcode dependencies:install ${programmingLanguage.toLowerCase()}`],
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.DependenciesNotInstalled = DependenciesNotInstalled;
|
|
125
|
+
class ProcessDependenciesNotInstalled extends CLIError {
|
|
126
|
+
constructor(process) {
|
|
127
|
+
super(`Process dependencies not installed.`, {
|
|
128
|
+
code: `PROCESS_DEPENDENCIES_NOT_INSTALLED`,
|
|
129
|
+
exit: 1,
|
|
130
|
+
suggestions: [`fcode processes:install-dependencies ${process.slug}`],
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.ProcessDependenciesNotInstalled = ProcessDependenciesNotInstalled;
|
|
135
|
+
class ErrorExecutingProcess extends CLIError {
|
|
136
|
+
constructor(message) {
|
|
137
|
+
super(message, {
|
|
138
|
+
code: 'ERR_PROCESS_EXECUTION',
|
|
139
|
+
exit: 1,
|
|
140
|
+
suggestions: [],
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.ErrorExecutingProcess = ErrorExecutingProcess;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ExecutionOptions, Process, ProgrammingLanguage } from '../types';
|
|
2
|
+
declare abstract class ExecutionTask {
|
|
3
|
+
protected getVariablesObject: () => {};
|
|
4
|
+
_programmingLanguage: ProgrammingLanguage;
|
|
5
|
+
_options: ExecutionOptions;
|
|
6
|
+
_process: Process;
|
|
7
|
+
_dependenciesPath: string;
|
|
8
|
+
_tempDir: string;
|
|
9
|
+
_execFilePath: string;
|
|
10
|
+
constructor(_programmingLanguage: ProgrammingLanguage, process: Process, options: ExecutionOptions, tempDir?: string);
|
|
11
|
+
protected getCliPath(): Promise<string>;
|
|
12
|
+
protected getExecutionSourceCode(): string;
|
|
13
|
+
protected getDependenciesPath(): Promise<string>;
|
|
14
|
+
protected abstract _createExecutionFiles(tempDir: string): Promise<{
|
|
15
|
+
[name: string]: string;
|
|
16
|
+
}>;
|
|
17
|
+
get returnValueFilePath(): string;
|
|
18
|
+
get errorValueFilePath(): string;
|
|
19
|
+
readReturnValue(): unknown;
|
|
20
|
+
readErrorValue(): {
|
|
21
|
+
message: string;
|
|
22
|
+
} | undefined;
|
|
23
|
+
getMetadata(): {
|
|
24
|
+
[name: string]: any;
|
|
25
|
+
};
|
|
26
|
+
prepare(): Promise<string>;
|
|
27
|
+
cleanup(): void;
|
|
28
|
+
}
|
|
29
|
+
export default ExecutionTask;
|