@sw-tsdk/plugin-connector 0.1.1-next.23
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/LICENSE +8 -0
- package/README.md +341 -0
- package/lib/commands/action/add.d.ts +10 -0
- package/lib/commands/action/add.js +88 -0
- package/lib/commands/action/add.js.map +1 -0
- package/lib/commands/action/input.d.ts +13 -0
- package/lib/commands/action/input.js +69 -0
- package/lib/commands/action/input.js.map +1 -0
- package/lib/commands/action/output.d.ts +13 -0
- package/lib/commands/action/output.js +68 -0
- package/lib/commands/action/output.js.map +1 -0
- package/lib/commands/action/run.d.ts +23 -0
- package/lib/commands/action/run.js +142 -0
- package/lib/commands/action/run.js.map +1 -0
- package/lib/commands/asset/add.d.ts +10 -0
- package/lib/commands/asset/add.js +50 -0
- package/lib/commands/asset/add.js.map +1 -0
- package/lib/commands/connector/build.d.ts +17 -0
- package/lib/commands/connector/build.js +71 -0
- package/lib/commands/connector/build.js.map +1 -0
- package/lib/commands/connector/create-source.d.ts +9 -0
- package/lib/commands/connector/create-source.js +31 -0
- package/lib/commands/connector/create-source.js.map +1 -0
- package/lib/commands/connector/create.d.ts +21 -0
- package/lib/commands/connector/create.js +169 -0
- package/lib/commands/connector/create.js.map +1 -0
- package/lib/commands/connector/logo.d.ts +10 -0
- package/lib/commands/connector/logo.js +31 -0
- package/lib/commands/connector/logo.js.map +1 -0
- package/lib/commands/connector/save.d.ts +12 -0
- package/lib/commands/connector/save.js +37 -0
- package/lib/commands/connector/save.js.map +1 -0
- package/lib/commands/connector/sign.d.ts +15 -0
- package/lib/commands/connector/sign.js +58 -0
- package/lib/commands/connector/sign.js.map +1 -0
- package/lib/commands/connector/update.d.ts +11 -0
- package/lib/commands/connector/update.js +54 -0
- package/lib/commands/connector/update.js.map +1 -0
- package/lib/commands/connector/validate.d.ts +14 -0
- package/lib/commands/connector/validate.js +90 -0
- package/lib/commands/connector/validate.js.map +1 -0
- package/lib/common.d.ts +3 -0
- package/lib/common.js +43 -0
- package/lib/common.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -0
- package/lib/templates/assets/apikey.yaml +34 -0
- package/lib/templates/assets/custom.yaml +22 -0
- package/lib/templates/assets/http_basic.yaml +38 -0
- package/lib/templates/assets/http_bearer.yaml +34 -0
- package/lib/templates/assets/oauth2_client_credentials.yaml +51 -0
- package/lib/templates/python_310_definition/template/connector/config/actions/example.yaml +40 -0
- package/lib/templates/python_310_definition/template/connector/config/assets/example.yaml +27 -0
- package/lib/templates/python_310_definition/template/data/asset.json +1 -0
- package/lib/templates/python_310_definition/template/docs/CHANGELOG.md.t +7 -0
- package/lib/templates/python_310_definition/template/docs/README.md +38 -0
- package/lib/templates/python_310_definition/template/requirements.txt +0 -0
- package/lib/types/connector-types.d.ts +29 -0
- package/lib/types/connector-types.js +14 -0
- package/lib/types/connector-types.js.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +5 -0
- package/lib/types/index.js.map +1 -0
- package/oclif.manifest.json +1 -0
- package/package.json +91 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Run = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const core_2 = require("@sw-tsdk/core");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const fs_extra_1 = require("fs-extra");
|
|
9
|
+
const docker_1 = require("@sw-tsdk/docker");
|
|
10
|
+
const node_process_1 = tslib_1.__importDefault(require("node:process"));
|
|
11
|
+
const connector_1 = require("@sw-tsdk/connector");
|
|
12
|
+
const common_1 = require("../../common");
|
|
13
|
+
// noinspection JSUnusedGlobalSymbols
|
|
14
|
+
class Run extends core_2.Base {
|
|
15
|
+
async run() {
|
|
16
|
+
const { flags, } = await this.parse(Run);
|
|
17
|
+
let { directory, image, 'input-path': inputPath, 'output-path': outputPath, 'error-path': errorPath, 'asset-path': assetPath, action, } = flags;
|
|
18
|
+
const { build, latest, template, 'compile-override': compileOverride, 'runner-override': runnerOverride, 'runtime-override': runtimeOverride, 'force-rebuild': nocache, platform, } = flags;
|
|
19
|
+
directory = (0, node_path_1.resolve)(directory || node_process_1.default.cwd());
|
|
20
|
+
// ensure directory path
|
|
21
|
+
try {
|
|
22
|
+
await fs_extra_1.promises.access(directory);
|
|
23
|
+
}
|
|
24
|
+
catch (_a) {
|
|
25
|
+
this.error(`Could not access ${directory}`);
|
|
26
|
+
}
|
|
27
|
+
// select action if not provided.
|
|
28
|
+
if (!action) {
|
|
29
|
+
action = await (0, common_1.chooseAction)(directory);
|
|
30
|
+
}
|
|
31
|
+
inputPath = inputPath || (0, node_path_1.join)(directory, 'data', `${action}.json`);
|
|
32
|
+
outputPath = outputPath || (0, node_path_1.join)(directory, 'data', `${action}_output.json`);
|
|
33
|
+
errorPath = errorPath || (0, node_path_1.join)(directory, 'data', `${action}_error.txt`);
|
|
34
|
+
assetPath = assetPath || (0, node_path_1.join)(directory, 'data', 'asset.json');
|
|
35
|
+
// merge inputs and asset as 11.x sends it.
|
|
36
|
+
const inputs = JSON.stringify(Object.assign(await (0, fs_extra_1.readJson)(inputPath), await (0, fs_extra_1.readJson)(assetPath)));
|
|
37
|
+
const manifests = await (0, connector_1.allManifests)(directory);
|
|
38
|
+
const connector = manifests.find(m => (0, connector_1.isConnectorManifest)(m));
|
|
39
|
+
// check that docker is running
|
|
40
|
+
const docker = new docker_1.Docker();
|
|
41
|
+
core_1.CliUx.ux.action.start('Checking for docker...');
|
|
42
|
+
await docker.ping();
|
|
43
|
+
core_1.CliUx.ux.action.stop();
|
|
44
|
+
// Can run latest from quay, image provided, or default to the last built.
|
|
45
|
+
if (build) {
|
|
46
|
+
const connector = new connector_1.BuildConnector();
|
|
47
|
+
const result = await connector.build({
|
|
48
|
+
directory,
|
|
49
|
+
template,
|
|
50
|
+
compileOverride,
|
|
51
|
+
runnerOverride,
|
|
52
|
+
runtimeOverride,
|
|
53
|
+
nocache,
|
|
54
|
+
platform,
|
|
55
|
+
squash: false,
|
|
56
|
+
});
|
|
57
|
+
image = result.imageTag;
|
|
58
|
+
}
|
|
59
|
+
else if (latest) {
|
|
60
|
+
image = `${connector.meta.imageRepository}:latest`;
|
|
61
|
+
await docker.pullImage(image);
|
|
62
|
+
}
|
|
63
|
+
else if (!image) {
|
|
64
|
+
core_1.CliUx.ux.error('No image to run, check command flags.');
|
|
65
|
+
}
|
|
66
|
+
await (0, fs_extra_1.ensureDir)((0, node_path_1.join)(directory, 'data'));
|
|
67
|
+
await fs_extra_1.promises.writeFile(outputPath, '{}');
|
|
68
|
+
await fs_extra_1.promises.writeFile(errorPath, '');
|
|
69
|
+
const environmentVars = [`INPUTS=${inputs}`];
|
|
70
|
+
const createOptions = {
|
|
71
|
+
Env: environmentVars,
|
|
72
|
+
name: action,
|
|
73
|
+
AttachStdout: true,
|
|
74
|
+
AttachStderr: true,
|
|
75
|
+
Cmd: [action],
|
|
76
|
+
HostConfig: {
|
|
77
|
+
AutoRemove: true,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
core_1.CliUx.ux.action.start('Executing...');
|
|
81
|
+
const outputFile = await (0, fs_extra_1.createWriteStream)(outputPath);
|
|
82
|
+
const errorFile = await (0, fs_extra_1.createWriteStream)(errorPath);
|
|
83
|
+
const success = await docker.runImage(image, createOptions, outputFile, errorFile);
|
|
84
|
+
core_1.CliUx.ux.action.stop();
|
|
85
|
+
if (!success) {
|
|
86
|
+
core_1.Errors.exit(-1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.Run = Run;
|
|
91
|
+
Run.description = 'Runs a connector action. (Defaults to current image version in local repository).';
|
|
92
|
+
Run.flags = Object.assign(Object.assign({}, core_2.Base.flags), { action: core_1.Flags.string({
|
|
93
|
+
char: 'a',
|
|
94
|
+
description: 'Action name to run',
|
|
95
|
+
}), directory: core_1.Flags.string({
|
|
96
|
+
char: 'd',
|
|
97
|
+
description: 'Root directory of the repository.',
|
|
98
|
+
default: './',
|
|
99
|
+
}), 'input-path': core_1.Flags.string({
|
|
100
|
+
description: 'File to input data JSON file, defaults to /data/<action>.json',
|
|
101
|
+
}), 'output-path': core_1.Flags.string({
|
|
102
|
+
description: 'File to write the outputs to, defaults to /data/<action>_output.json',
|
|
103
|
+
}), 'error-path': core_1.Flags.string({
|
|
104
|
+
description: 'File to write the errors to, defaults to /data/<action>_error.json',
|
|
105
|
+
}), 'asset-path': core_1.Flags.string({
|
|
106
|
+
description: 'File to asset data JSON file, defaults to /data/asset.json',
|
|
107
|
+
}), image: core_1.Flags.string({
|
|
108
|
+
char: 'i',
|
|
109
|
+
description: 'The connector image to run.',
|
|
110
|
+
exclusive: ['build', 'latest'],
|
|
111
|
+
}), latest: core_1.Flags.boolean({
|
|
112
|
+
description: 'Use the latest release image from quay.',
|
|
113
|
+
default: false,
|
|
114
|
+
exclusive: ['build', 'image'],
|
|
115
|
+
}), build: core_1.Flags.boolean({
|
|
116
|
+
description: 'Builds image and runs it.',
|
|
117
|
+
default: false,
|
|
118
|
+
exclusive: ['latest', 'image'],
|
|
119
|
+
}), template: core_1.Flags.string({
|
|
120
|
+
description: 'connector template',
|
|
121
|
+
options: ['python_3.7', 'node_18', 'python_310_definition'],
|
|
122
|
+
default: 'python_310_definition',
|
|
123
|
+
}), 'compile-override': core_1.Flags.string({
|
|
124
|
+
hidden: true,
|
|
125
|
+
default: 'Compile.Dockerfile',
|
|
126
|
+
}), 'runner-override': core_1.Flags.string({
|
|
127
|
+
hidden: true,
|
|
128
|
+
default: 'Runner.Dockerfile',
|
|
129
|
+
}), 'runtime-override': core_1.Flags.string({
|
|
130
|
+
hidden: true,
|
|
131
|
+
dependsOn: ['build'],
|
|
132
|
+
}), 'force-rebuild': core_1.Flags.boolean({
|
|
133
|
+
char: 'f',
|
|
134
|
+
description: 'forces nocache on the image build',
|
|
135
|
+
dependsOn: ['build'],
|
|
136
|
+
}), platform: core_1.Flags.string({
|
|
137
|
+
hidden: true,
|
|
138
|
+
default: 'linux/amd64',
|
|
139
|
+
}), help: core_1.Flags.help({
|
|
140
|
+
char: 'h',
|
|
141
|
+
}) });
|
|
142
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/action/run.ts"],"names":[],"mappings":";;;;AAAA,sCAAgD;AAChD,wCAAkC;AAClC,yCAAuC;AACvC,uCAAyE;AACzE,4CAAqD;AACrD,wEAAkC;AAClC,kDAAoF;AAEpF,yCAAyC;AAEzC,qCAAqC;AACrC,MAAa,GAAI,SAAQ,WAAI;IAwE3B,KAAK,CAAC,GAAG;QACP,MAAM,EACJ,KAAK,GACN,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAEzB,IAAI,EACF,SAAS,EACT,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,UAAU,EACzB,YAAY,EAAE,SAAS,EACvB,YAAY,EAAE,SAAS,EACvB,MAAM,GACP,GAAG,KAAK,CAAA;QAET,MAAM,EACJ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,kBAAkB,EAAE,eAAe,EACnC,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,eAAe,EAAE,OAAO,EACxB,QAAQ,GACT,GAAG,KAAK,CAAA;QAET,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,IAAI,sBAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAE/C,wBAAwB;QACxB,IAAI;YACF,MAAM,mBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;SACjC;QAAC,WAAM;YACN,IAAI,CAAC,KAAK,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAA;SAC5C;QAED,iCAAiC;QACjC,IAAI,CAAC,MAAM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E,CAAC,QAAQ,EAAE,OAAO,CAAC;KAC/B,CAAC,EACF,QAAQ,EAAE,YAAK,CAAC,MAAM,CAAC;QACrB,WAAW,EAAE,oBAAoB;QACjC,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,uBAAuB,CAAC;QAC3D,OAAO,EAAE,uBAAuB;KACjC,CAAC,EACF,kBAAkB,EAAE,YAAK,CAAC,MAAM,CAAC;QAC/B,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,oBAAoB;KAC9B,CAAC,EACF,iBAAiB,EAAE,YAAK,CAAC,MAAM,CAAC;QAC9B,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,mBAAmB;KAC7B,CAAC,EACF,kBAAkB,EAAE,YAAK,CAAC,MAAM,CAAC;QAC/B,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,CAAC,OAAO,CAAC;KACrB,CAAC,EACF,eAAe,EAAE,YAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mCAAmC;QAChD,SAAS,EAAE,CAAC,OAAO,CAAC;KACrB,CAAC,EACF,QAAQ,EAAE,YAAK,CAAC,MAAM,CAAC;QACrB,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,aAAa;KACvB,CAAC,EACF,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC;QACf,IAAI,EAAE,GAAG;KACV,CAAC,IACH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Base } from '@sw-tsdk/core';
|
|
2
|
+
export declare class Add extends Base {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
scheme: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Add = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const core_2 = require("@sw-tsdk/core");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const fs_extra_1 = require("fs-extra");
|
|
9
|
+
const node_process_1 = tslib_1.__importDefault(require("node:process"));
|
|
10
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
11
|
+
// noinspection JSUnusedGlobalSymbols
|
|
12
|
+
class Add extends core_2.Base {
|
|
13
|
+
async run() {
|
|
14
|
+
const { flags, } = await this.parse(Add);
|
|
15
|
+
let { directory, scheme, } = flags;
|
|
16
|
+
directory = (0, node_path_1.resolve)(directory || node_process_1.default.cwd());
|
|
17
|
+
if (!scheme) {
|
|
18
|
+
const answers = await inquirer_1.default.prompt([{
|
|
19
|
+
type: 'list',
|
|
20
|
+
name: 'scheme',
|
|
21
|
+
message: 'Select an asset scheme to scaffold',
|
|
22
|
+
choices: [
|
|
23
|
+
'custom',
|
|
24
|
+
'apikey',
|
|
25
|
+
'oauth2_client_credentials',
|
|
26
|
+
'http_basic',
|
|
27
|
+
'http_bearer',
|
|
28
|
+
],
|
|
29
|
+
}]);
|
|
30
|
+
scheme = answers.scheme;
|
|
31
|
+
}
|
|
32
|
+
core_1.CliUx.ux.action.start('Scaffolding new asset');
|
|
33
|
+
await (0, fs_extra_1.copy)((0, node_path_1.join)(__dirname, '..', '..', 'templates', 'assets', `${scheme}.yaml`), (0, node_path_1.join)(directory, 'connector', 'config', 'assets', `${scheme}.yaml`), { recursive: true });
|
|
34
|
+
core_1.CliUx.ux.action.stop();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.Add = Add;
|
|
38
|
+
Add.description = 'Update a connector action.';
|
|
39
|
+
Add.flags = Object.assign(Object.assign({}, core_2.Base.flags), { directory: core_1.Flags.string({
|
|
40
|
+
char: 'd',
|
|
41
|
+
description: 'Root directory of the repository.',
|
|
42
|
+
default: './',
|
|
43
|
+
}), scheme: core_1.Flags.string({
|
|
44
|
+
char: 's',
|
|
45
|
+
description: 'asset template to scaffold',
|
|
46
|
+
options: ['custom', 'apikey', 'client_credentials', 'basic', 'bearer'],
|
|
47
|
+
}), help: core_1.Flags.help({
|
|
48
|
+
char: 'h',
|
|
49
|
+
}) });
|
|
50
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/commands/asset/add.ts"],"names":[],"mappings":";;;;AAAA,sCAAwC;AACxC,wCAAkC;AAClC,yCAAuC;AACvC,uCAA6B;AAC7B,wEAAkC;AAClC,gEAA+B;AAE/B,qCAAqC;AACrC,MAAa,GAAI,SAAQ,WAAI;IAoB3B,KAAK,CAAC,GAAG;QACP,MAAM,EACJ,KAAK,GACN,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAEzB,IAAI,EACF,SAAS,EACT,MAAM,GACP,GAAG,KAAK,CAAA;QAET,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,IAAI,sBAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAE/C,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,OAAO,GAAG,MAAM,kBAAQ,CAAC,MAAM,CAAC,CAAC;oBACrC,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,oCAAoC;oBAC7C,OAAO,EAAE;wBACP,QAAQ;wBACR,QAAQ;wBACR,2BAA2B;wBAC3B,YAAY;wBACZ,aAAa;qBACd;iBACF,CAAC,CAAC,CAAA;YAEH,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;SACxB;QAED,YAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;QAE9C,MAAM,IAAA,eAAI,EAAC,IAAA,gBAAI,EACb,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,GAAG,MAAM,OAAO,CACjB,EAAE,IAAA,gBAAI,EACL,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,GAAG,MAAM,OAAO,CACjB,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAA;QAErB,YAAK,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;IACxB,CAAC;;AAnEH,kBAoEC;AAnEQ,eAAW,GAAG,4BAA4B,CAAA;AAE1C,SAAK,mCACP,WAAI,CAAC,KAAK,KACb,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,IAAI;KACd,CAAC,EACF,MAAM,EAAE,YAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,QAAQ,CAAC;KACvE,CAAC,EACF,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC;QACf,IAAI,EAAE,GAAG;KACV,CAAC,IACH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Base } from '@sw-tsdk/core';
|
|
2
|
+
export declare class Build extends Base {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
template: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
'compile-override': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
+
'runner-override': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
'runtime-override': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
9
|
+
directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
10
|
+
save: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
squash: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
'force-rebuild': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
14
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Build = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const core_2 = require("@sw-tsdk/core");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const connector_1 = require("@sw-tsdk/connector");
|
|
9
|
+
const save_1 = require("./save");
|
|
10
|
+
// noinspection JSUnusedGlobalSymbols
|
|
11
|
+
class Build extends core_2.Base {
|
|
12
|
+
async run() {
|
|
13
|
+
const { flags } = await this.parse(Build);
|
|
14
|
+
let { directory } = flags;
|
|
15
|
+
const { save, template, 'compile-override': compileOverride, 'runner-override': runnerOverride, 'runtime-override': runtimeOverride, 'force-rebuild': nocache, platform, squash, } = flags;
|
|
16
|
+
directory = (0, node_path_1.resolve)(directory || process.cwd());
|
|
17
|
+
try {
|
|
18
|
+
await node_fs_1.promises.access(directory);
|
|
19
|
+
}
|
|
20
|
+
catch (_a) {
|
|
21
|
+
this.error(`Could not access ${directory}`);
|
|
22
|
+
}
|
|
23
|
+
const connector = new connector_1.BuildConnector();
|
|
24
|
+
const result = await connector.build({ directory, template, compileOverride, runnerOverride, runtimeOverride, nocache, platform, squash });
|
|
25
|
+
if (save) {
|
|
26
|
+
await save_1.Save.run([
|
|
27
|
+
'--directory',
|
|
28
|
+
directory,
|
|
29
|
+
'--image',
|
|
30
|
+
result.imageTag,
|
|
31
|
+
'--output',
|
|
32
|
+
`dockerImages/${result.name}-${result.version}.tar.gz`,
|
|
33
|
+
'--skip-pull',
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.Build = Build;
|
|
39
|
+
Build.description = 'Builds a local docker image of the connector.';
|
|
40
|
+
Build.flags = Object.assign(Object.assign({}, core_2.Base.flags), { template: core_1.Flags.string({
|
|
41
|
+
description: 'connector language',
|
|
42
|
+
options: ['python_3.7_swimlane', 'node_18', 'python_310_definition'],
|
|
43
|
+
default: 'python_310_definition',
|
|
44
|
+
required: true,
|
|
45
|
+
}), 'compile-override': core_1.Flags.string({
|
|
46
|
+
hidden: true,
|
|
47
|
+
default: 'Compile.Dockerfile',
|
|
48
|
+
}), 'runner-override': core_1.Flags.string({
|
|
49
|
+
hidden: true,
|
|
50
|
+
default: 'Runner.Dockerfile',
|
|
51
|
+
}), 'runtime-override': core_1.Flags.string({
|
|
52
|
+
hidden: true,
|
|
53
|
+
}), directory: core_1.Flags.string({
|
|
54
|
+
char: 'd',
|
|
55
|
+
description: 'root directory of the repository.',
|
|
56
|
+
default: './',
|
|
57
|
+
}), save: core_1.Flags.boolean({
|
|
58
|
+
description: 'saves docker image as tar in local directory.',
|
|
59
|
+
}), squash: core_1.Flags.boolean({
|
|
60
|
+
description: 'squashes the docker layers.',
|
|
61
|
+
hidden: true,
|
|
62
|
+
}), 'force-rebuild': core_1.Flags.boolean({
|
|
63
|
+
char: 'f',
|
|
64
|
+
description: 'forces nocache on the image build',
|
|
65
|
+
}), platform: core_1.Flags.string({
|
|
66
|
+
hidden: true,
|
|
67
|
+
default: 'linux/amd64',
|
|
68
|
+
}), help: core_1.Flags.help({
|
|
69
|
+
char: 'h',
|
|
70
|
+
}) });
|
|
71
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/commands/connector/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Base {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateSource = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const core_2 = require("@sw-tsdk/core");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const connector_1 = require("@sw-tsdk/connector");
|
|
9
|
+
// noinspection JSUnusedGlobalSymbols
|
|
10
|
+
class CreateSource extends core_2.Base {
|
|
11
|
+
async run() {
|
|
12
|
+
const { flags } = await this.parse(CreateSource);
|
|
13
|
+
let { directory } = flags;
|
|
14
|
+
directory = (0, node_path_1.resolve)(directory || process.cwd());
|
|
15
|
+
try {
|
|
16
|
+
await node_fs_1.promises.access(directory);
|
|
17
|
+
}
|
|
18
|
+
catch (_a) {
|
|
19
|
+
this.error(`Could not access ${directory}`);
|
|
20
|
+
}
|
|
21
|
+
directory = (0, node_path_1.resolve)(directory);
|
|
22
|
+
core_1.CliUx.ux.action.start('Generating Turbine connector source from 10.x code');
|
|
23
|
+
const connector = new connector_1.ConnectorFrom10x();
|
|
24
|
+
await connector.createConnectorSource(directory);
|
|
25
|
+
core_1.CliUx.ux.action.stop();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.CreateSource = CreateSource;
|
|
29
|
+
CreateSource.description = 'Generates 11x source from 10x';
|
|
30
|
+
CreateSource.flags = Object.assign(Object.assign({}, core_2.Base.flags), { directory: core_1.Flags.string({ char: 'd', description: 'root directory of the repository.', default: './' }), help: core_1.Flags.help({ char: 'h' }) });
|
|
31
|
+
//# sourceMappingURL=create-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-source.js","sourceRoot":"","sources":["../../../src/commands/connector/create-source.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;AACxC,wCAAkC;AAClC,yCAAiC;AACjC,qCAAgC;AAChC,kDAAmD;AAEnD,qCAAqC;AACrC,MAAa,YAAa,SAAQ,WAAI;IASpC,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QAE9C,IAAI,EAAC,SAAS,EAAC,GAAG,KAAK,CAAA;QACvB,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAE/C,IAAI;YACF,MAAM,kBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;SACjC;QAAC,WAAM;YACN,IAAI,CAAC,KAAK,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAA;SAC5C;QAED,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,CAAC,CAAA;QAC9B,YAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAA;QAC3E,MAAM,SAAS,GAAG,IAAI,4BAAgB,EAAE,CAAA;QACxC,MAAM,SAAS,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAA;QAChD,YAAK,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;IACxB,CAAC;;AA1BH,oCA2BC;AA1BQ,wBAAW,GAAG,+BAA+B,CAAA;AAE7C,kBAAK,mCACP,WAAI,CAAC,KAAK,KACb,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC,EAAC,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,mCAAmC,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,EACrG,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,IAC9B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Base } from '@sw-tsdk/core';
|
|
2
|
+
export declare class Create extends Base {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
template: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
+
'skip-repo': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
clientId: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
9
|
+
vendor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
10
|
+
product: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
11
|
+
keywords: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
|
+
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
13
|
+
logoPath: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
14
|
+
author: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
15
|
+
authorEmail: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
16
|
+
homepage: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
17
|
+
'repo-base-template': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
18
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
19
|
+
};
|
|
20
|
+
run(): Promise<void>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Create = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const core_2 = require("@sw-tsdk/core");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const connector_1 = require("@sw-tsdk/connector");
|
|
10
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
11
|
+
const common_1 = require("../../common");
|
|
12
|
+
const fs_extra_1 = require("fs-extra");
|
|
13
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
14
|
+
const snake_case_1 = require("snake-case");
|
|
15
|
+
const handlebars_1 = require("handlebars");
|
|
16
|
+
// noinspection JSUnusedGlobalSymbols
|
|
17
|
+
class Create extends core_2.Base {
|
|
18
|
+
async run() {
|
|
19
|
+
const { flags } = await this.parse(Create);
|
|
20
|
+
let { directory } = flags;
|
|
21
|
+
directory = (0, node_path_1.resolve)(directory || process.cwd());
|
|
22
|
+
const { template: connectorTemplate, } = flags;
|
|
23
|
+
try {
|
|
24
|
+
await node_fs_1.promises.access(directory);
|
|
25
|
+
}
|
|
26
|
+
catch (_a) {
|
|
27
|
+
this.error(`Could not access ${directory}`);
|
|
28
|
+
}
|
|
29
|
+
const masterQuestions = [{
|
|
30
|
+
type: 'input',
|
|
31
|
+
name: 'vendor',
|
|
32
|
+
message: 'Vendor (e.g. CrowdStrike)',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'input',
|
|
36
|
+
name: 'product',
|
|
37
|
+
message: 'Product (e.g. Falcon)',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: 'list',
|
|
41
|
+
name: 'keywords',
|
|
42
|
+
message: 'Choose a category',
|
|
43
|
+
choices: common_1.connectorCategories,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: 'input',
|
|
47
|
+
name: 'description',
|
|
48
|
+
message: 'Description (e.g. CrowdStrike Host Query API)',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'input',
|
|
52
|
+
name: 'logoPath',
|
|
53
|
+
message: 'URL or absolute path to logo file',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: 'list',
|
|
57
|
+
name: 'template',
|
|
58
|
+
message: 'Connector template and language.',
|
|
59
|
+
choices: common_1.connectorTemplates,
|
|
60
|
+
default: 'python_310_definition',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: 'input',
|
|
64
|
+
name: 'author',
|
|
65
|
+
message: 'Integration Author',
|
|
66
|
+
default: 'Swimlane',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: 'input',
|
|
70
|
+
name: 'authorEmail',
|
|
71
|
+
message: 'Integration Author Email',
|
|
72
|
+
default: 'info@swimlane.com',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: 'input',
|
|
76
|
+
name: 'homepage',
|
|
77
|
+
message: 'Author URL',
|
|
78
|
+
default: 'https://swimlane.com',
|
|
79
|
+
}];
|
|
80
|
+
const filteredQuestions = masterQuestions.filter(q => !flags[q.name]);
|
|
81
|
+
const answers = Object.assign(await inquirer_1.default.prompt(filteredQuestions), flags);
|
|
82
|
+
// used for connector name, directory and t_${name} for repo.
|
|
83
|
+
const vendor = answers.vendor;
|
|
84
|
+
const product = answers.product;
|
|
85
|
+
let name;
|
|
86
|
+
if (vendor.toLowerCase() === product.toLowerCase() || !product) {
|
|
87
|
+
name = answers.vendor.toLowerCase();
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
const string = `${answers.vendor} ${answers.product}`;
|
|
91
|
+
name = (0, snake_case_1.snakeCase)(string);
|
|
92
|
+
}
|
|
93
|
+
// connectorDirectory
|
|
94
|
+
const connectorDirectory = (0, node_path_1.join)(directory, `t_${name}`);
|
|
95
|
+
await (0, fs_extra_1.ensureDir)(connectorDirectory);
|
|
96
|
+
const connector = {
|
|
97
|
+
vendor: answers.vendor,
|
|
98
|
+
product: answers.product,
|
|
99
|
+
name: name,
|
|
100
|
+
schema: 'connector/1',
|
|
101
|
+
author: answers.author,
|
|
102
|
+
bugs: '',
|
|
103
|
+
iconImage: '../image/logo.png',
|
|
104
|
+
description: answers.description,
|
|
105
|
+
homepage: answers.homepage,
|
|
106
|
+
keywords: [answers.family],
|
|
107
|
+
license: 'AGPL-3.0',
|
|
108
|
+
meta: {
|
|
109
|
+
imageRepository: `quay.io/swimlane-connectors/${name}`,
|
|
110
|
+
private: false,
|
|
111
|
+
publishConfig: {
|
|
112
|
+
access: 'public',
|
|
113
|
+
},
|
|
114
|
+
buildConfig: {
|
|
115
|
+
template: answers.template,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
repository: `https://github.com/swimlane/t_${name}`,
|
|
119
|
+
title: await (0, connector_1.titleCaseString)(`${answers.vendor} ${answers.product}`),
|
|
120
|
+
version: '1.0.0',
|
|
121
|
+
};
|
|
122
|
+
core_1.CliUx.ux.action.start('Generating folder structure.');
|
|
123
|
+
// copy the examples over.
|
|
124
|
+
await (0, fs_extra_1.copy)((0, node_path_1.join)(__dirname, '..', '..', 'templates', connectorTemplate, 'template'), connectorDirectory, { recursive: true });
|
|
125
|
+
// write connector.yaml from answers
|
|
126
|
+
const connectorFilePath = (0, node_path_1.join)(connectorDirectory, 'connector', 'connector.yaml');
|
|
127
|
+
await (0, fs_extra_1.writeFile)(connectorFilePath, js_yaml_1.default.dump(connector));
|
|
128
|
+
// Update changelog with today's date
|
|
129
|
+
const changelogTemplatePath = (0, node_path_1.join)(connectorDirectory, 'docs', 'CHANGELOG.md.t');
|
|
130
|
+
const content = await node_fs_1.promises.readFile(changelogTemplatePath);
|
|
131
|
+
const template = (0, handlebars_1.compile)(content.toString());
|
|
132
|
+
const now = new Date().toISOString().slice(0, 10);
|
|
133
|
+
await (0, fs_extra_1.writeFile)((0, node_path_1.join)(connectorDirectory, 'docs', 'CHANGELOG.md'), template({ timestamp: now }));
|
|
134
|
+
await (0, fs_extra_1.unlink)(changelogTemplatePath);
|
|
135
|
+
// process logo and write to file.
|
|
136
|
+
if (answers.logoPath) {
|
|
137
|
+
core_1.CliUx.ux.action.start('Processing Logo');
|
|
138
|
+
await (0, connector_1.updateImage)(connectorDirectory, answers.logoPath);
|
|
139
|
+
core_1.CliUx.ux.action.stop();
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
core_1.CliUx.ux.warn('No logo path provided. Must use update command to add logo before building.');
|
|
143
|
+
}
|
|
144
|
+
core_1.CliUx.ux.action.stop();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
exports.Create = Create;
|
|
148
|
+
Create.description = 'Scaffold a new connector';
|
|
149
|
+
Create.flags = Object.assign(Object.assign({}, core_2.Base.flags), { directory: core_1.Flags.string({
|
|
150
|
+
char: 'd',
|
|
151
|
+
description: 'root directory for where to store connectors, the connector directory will be generated.',
|
|
152
|
+
default: './',
|
|
153
|
+
}), template: core_1.Flags.string({
|
|
154
|
+
char: 't',
|
|
155
|
+
description: 'connector template to scaffold',
|
|
156
|
+
default: 'python_310_definition',
|
|
157
|
+
options: ['node_18', 'python_310_definition', 'python_3.7_swimlane'],
|
|
158
|
+
}), 'skip-repo': core_1.Flags.boolean({ description: 'skips the repository creation process' }), clientId: core_1.Flags.string({
|
|
159
|
+
char: 'c',
|
|
160
|
+
description: 'client id of the authentication app',
|
|
161
|
+
default: '0d418a5615c458b0b593',
|
|
162
|
+
hidden: true,
|
|
163
|
+
}), vendor: core_1.Flags.string({ description: 'Vendor (e.g. CrowdStrike)' }), product: core_1.Flags.string({ description: 'Product (e.g. Falcon)' }), keywords: core_1.Flags.string({ description: 'Please enter keyword (Comma-Separated)' }), description: core_1.Flags.string({ description: 'Description (e.g. CrowdStrike Host Query API)' }), logoPath: core_1.Flags.string({ description: 'URL or absolute path to logo file' }), author: core_1.Flags.string({ description: 'Connector Author' }), authorEmail: core_1.Flags.string({ description: 'Connector Author Email' }), homepage: core_1.Flags.string({ description: 'Connector Author Support URL' }), 'repo-base-template': core_1.Flags.string({
|
|
164
|
+
char: 't',
|
|
165
|
+
description: 'github base template override to create repo from.',
|
|
166
|
+
default: 'connector-python-definition-template',
|
|
167
|
+
hidden: true,
|
|
168
|
+
}), help: core_1.Flags.help({ char: 'h' }) });
|
|
169
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/connector/create.ts"],"names":[],"mappings":";;;;AAAA,sCAAwC;AACxC,wCAAkC;AAClC,yCAAuC;AACvC,qCAAgC;AAChC,kDAA+D;AAC/D,gEAA+B;AAC/B,yCAAoE;AAGpE,uCAA2D;AAC3D,8DAA0B;AAC1B,2CAAoC;AACpC,2CAAkC;AAElC,qCAAqC;AACrC,MAAa,MAAO,SAAQ,WAAI;IAwC9B,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAExC,IAAI,EAAC,SAAS,EAAC,GAAG,KAAK,CAAA;QACvB,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAE/C,MAAM,EACJ,QAAQ,EAAE,iBAAiB,GAC5B,GAAG,KAAK,CAAA;QAET,IAAI;YACF,MAAM,kBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;SACjC;QAAC,WAAM;YACN,IAAI,CAAC,KAAK,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAA;SAC5C;QAED,MAAM,eAAe,GAAG,CAAC;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,2BAA2B;aACrC;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,uBAAuB;aACjC;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,mBAAmB;gBAC5B,OAAO,EAAE,4BAAmB;aAC7B;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,+CAA+C;aACzD;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C,EAAC,WAAW,EAAE,8BAA8B,EAAC,CAAC,EACrE,oBAAoB,EAAE,YAAK,CAAC,MAAM,CAAC;QACjC,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,oDAAoD;QACjE,OAAO,EAAE,sCAAsC;QAC/C,MAAM,EAAE,IAAI;KACb,CAAC,EACF,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,IAC9B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Base } from '@sw-tsdk/core';
|
|
2
|
+
export declare class Logo extends Base {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
path: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Logo = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const core_2 = require("@sw-tsdk/core");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const connector_1 = require("@sw-tsdk/connector");
|
|
8
|
+
// noinspection JSUnusedGlobalSymbols
|
|
9
|
+
class Logo extends core_2.Base {
|
|
10
|
+
async run() {
|
|
11
|
+
const { flags } = await this.parse(Logo);
|
|
12
|
+
let { directory } = flags;
|
|
13
|
+
const { path } = flags;
|
|
14
|
+
directory = (0, node_path_1.resolve)(directory || process.cwd());
|
|
15
|
+
core_1.CliUx.ux.action.start('Updating Logo');
|
|
16
|
+
await (0, connector_1.updateImage)(directory, path);
|
|
17
|
+
core_1.CliUx.ux.action.stop();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.Logo = Logo;
|
|
21
|
+
Logo.description = 'Update a connector.';
|
|
22
|
+
Logo.flags = Object.assign(Object.assign({}, core_2.Base.flags), { directory: core_1.Flags.string({
|
|
23
|
+
char: 'd',
|
|
24
|
+
description: 'root directory of the connector folder.',
|
|
25
|
+
default: '.',
|
|
26
|
+
}), path: core_1.Flags.string({
|
|
27
|
+
char: 'p',
|
|
28
|
+
description: 'path or URL to product logo in PNG format.',
|
|
29
|
+
required: true,
|
|
30
|
+
}), help: core_1.Flags.help({ char: 'h' }) });
|
|
31
|
+
//# sourceMappingURL=logo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logo.js","sourceRoot":"","sources":["../../../src/commands/connector/logo.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;AACxC,wCAAkC;AAClC,yCAAiC;AACjC,kDAA8C;AAE9C,qCAAqC;AACrC,MAAa,IAAK,SAAQ,WAAI;IAkB5B,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAEtC,IAAI,EAAC,SAAS,EAAC,GAAG,KAAK,CAAA;QACvB,MAAM,EAAC,IAAI,EAAC,GAAG,KAAK,CAAA;QAEpB,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAE/C,YAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;QACtC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,IAAI,CAAC,CAAA;QAClC,YAAK,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;IACxB,CAAC;;AA7BH,oBA8BC;AA7BQ,gBAAW,GAAG,qBAAqB,CAAA;AAEnC,UAAK,mCACP,WAAI,CAAC,KAAK,KACb,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,yCAAyC;QACtD,OAAO,EAAE,GAAG;KACb,CAAC,EACF,IAAI,EAAE,YAAK,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,4CAA4C;QACzD,QAAQ,EAAE,IAAI;KACf,CAAC,EACF,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,IAC9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Base } from '@sw-tsdk/core';
|
|
2
|
+
export declare class Save extends Base {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
+
image: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
'skip-pull': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|