@sw-tsdk/plugin-connector 2.17.4 → 2.19.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.
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Logo = 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 inquirer_1 = tslib_1.__importDefault(require("inquirer"));
8
+ const fs = tslib_1.__importStar(require("node:fs"));
9
+ const path = tslib_1.__importStar(require("node:path"));
10
+ const node_path_1 = require("node:path");
11
+ const common_1 = require("../../common");
12
+ // noinspection JSUnusedGlobalSymbols
13
+ class Logo extends core_2.Base {
14
+ async run() {
15
+ const { flags } = await this.parse(Logo);
16
+ let { directory } = flags;
17
+ directory = (0, node_path_1.resolve)(directory || process.cwd());
18
+ const masterQuestions = [
19
+ {
20
+ type: 'input',
21
+ name: 'sspPath',
22
+ message: 'Absolute path to .SSP file',
23
+ },
24
+ ];
25
+ const componentTypeSelected = await (0, common_1.chooseComponentType)();
26
+ const componentNameSelected = await (0, common_1.chooseComponentName)(directory, componentTypeSelected);
27
+ const filteredQuestions = masterQuestions.filter(q => !flags[q.name]);
28
+ const answers = Object.assign(await inquirer_1.default.prompt(filteredQuestions), flags);
29
+ const componentDirectory = (0, node_path_1.join)(directory, componentTypeSelected, componentNameSelected);
30
+ if (answers.sspPath?.endsWith('.ssp')) {
31
+ core_1.ux.action.start('Processing SSP File');
32
+ const destinationPath = path.join(componentDirectory, `${componentNameSelected}.ssp`);
33
+ await fs.promises.copyFile(answers.sspPath, destinationPath);
34
+ core_1.ux.action.stop();
35
+ }
36
+ else {
37
+ this.error('Invalid ssp file provided');
38
+ }
39
+ }
40
+ }
41
+ exports.Logo = Logo;
42
+ Logo.description = 'Update an SSP.';
43
+ Logo.flags = {
44
+ ...core_2.Base.flags,
45
+ directory: core_1.Flags.string({
46
+ char: 'd',
47
+ description: 'root directory of the component folder.',
48
+ default: './',
49
+ }),
50
+ componentType: core_1.Flags.string({
51
+ description: 'Component Type (e.g. classic)',
52
+ char: 't',
53
+ }),
54
+ componentName: core_1.Flags.string({
55
+ description: 'Component Name (e.g. google_alert_ingestion)',
56
+ char: 'n',
57
+ }),
58
+ sspPath: core_1.Flags.string({
59
+ char: 'p',
60
+ description: 'Absolute path to .SSP file',
61
+ }),
62
+ help: core_1.Flags.help({ char: 'h' }),
63
+ };
64
+ //# sourceMappingURL=ssp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssp.js","sourceRoot":"","sources":["../../../src/commands/component/ssp.ts"],"names":[],"mappings":";;;;AAAA,sCAAqC;AACrC,wCAAkC;AAClC,gEAA+B;AAC/B,oDAA6B;AAC7B,wDAAiC;AACjC,yCAAuC;AACvC,yCAAqE;AAGrE,qCAAqC;AACrC,MAAa,IAAK,SAAQ,WAAI;IAyB5B,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,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAE/C,MAAM,eAAe,GAAG;YACtB;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,4BAA4B;aACtC;SACF,CAAA;QAED,MAAM,qBAAqB,GAAG,MAAM,IAAA,4BAAmB,GAAE,CAAA;QACzD,MAAM,qBAAqB,GAAG,MAAM,IAAA,4BAAmB,EAAC,SAAS,EAAE,qBAAqB,CAAC,CAAA;QACzF,MAAM,iBAAiB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAE,KAA6B,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;QAC9F,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C,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC;CAC9B,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { Base } from '@sw-tsdk/core';
2
+ export declare class Update extends Base {
3
+ static description: string;
4
+ static flags: {
5
+ directory: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
6
+ version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
+ componentType: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
+ componentName: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
+ manifestPath: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Update = 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 fs_extra_1 = require("fs-extra");
8
+ const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
9
+ const fs = tslib_1.__importStar(require("node:fs"));
10
+ const node_fs_1 = require("node:fs");
11
+ const node_path_1 = require("node:path");
12
+ // noinspection JSUnusedGlobalSymbols
13
+ class Update extends core_2.Base {
14
+ async run() {
15
+ const { flags } = await this.parse(Update);
16
+ let { directory, manifestPath } = flags;
17
+ const { version } = flags;
18
+ directory = (0, node_path_1.resolve)(directory || process.cwd());
19
+ // remove relative dir notation if provided
20
+ if (manifestPath.startsWith('.')) {
21
+ manifestPath = manifestPath.slice(1);
22
+ }
23
+ manifestPath = (0, node_path_1.join)(directory, manifestPath);
24
+ try {
25
+ await node_fs_1.promises.access(manifestPath);
26
+ }
27
+ catch {
28
+ this.error(`Could not access ${manifestPath}`);
29
+ }
30
+ core_1.ux.action.start('Updating Component');
31
+ const manifest = js_yaml_1.default.load(await fs.promises.readFile(manifestPath, 'utf8'));
32
+ // For now, version is supplied.
33
+ if (version) {
34
+ manifest.version = version;
35
+ }
36
+ await (0, fs_extra_1.writeFile)(manifestPath, js_yaml_1.default.dump(manifest, { indent: 2 }), { flag: 'w' });
37
+ core_1.ux.action.stop();
38
+ }
39
+ }
40
+ exports.Update = Update;
41
+ Update.description = 'Update Component Version.';
42
+ Update.flags = {
43
+ ...core_2.Base.flags,
44
+ directory: core_1.Flags.string({
45
+ char: 'd',
46
+ description: 'root directory of the all Components',
47
+ default: '.',
48
+ }),
49
+ version: core_1.Flags.string({
50
+ char: 'v',
51
+ description: 'new version of the component.',
52
+ }),
53
+ componentType: core_1.Flags.string({
54
+ description: 'Component Type (e.g. classic)',
55
+ char: 't',
56
+ }),
57
+ componentName: core_1.Flags.string({
58
+ description: 'Component Name (e.g. google_alert_ingestion)',
59
+ char: 'n',
60
+ }),
61
+ manifestPath: core_1.Flags.string({
62
+ char: 'f',
63
+ description: 'Component manifest path relative to directory.',
64
+ default: 'manifest.yml',
65
+ }),
66
+ help: core_1.Flags.help({ char: 'h' }),
67
+ };
68
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/component/update.ts"],"names":[],"mappings":";;;;AAAA,sCAAqC;AACrC,wCAAkC;AAClC,uCAAkC;AAClC,8DAA0B;AAC1B,oDAA6B;AAC7B,qCAAgC;AAChC,yCAAuC;AAEvC,qCAAqC;AACrC,MAAa,MAAO,SAAQ,WAAI;IA8B9B,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAExC,IAAI,EAAC,SAAS,EAAE,YAAY,EAAC,GAAG,KAAK,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;IACF,OAAO,EAAE,YAAK,CAAC,MAAM,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,+BAA+B;KAC7C,CAAC;IACF,aAAa,EAAE,YAAK,CAAC,MAAM,CAAC;QAC1B,WAAW,EAAE,+BAA+B;QAC5C,IAAI,EAAE,GAAG;KACV,CAAC;IACF,aAAa,EAAE,YAAK,CAAC,MAAM,CAAC;QAC1B,WAAW,EAAE,8CAA8C;QAC3D,IAAI,EAAE,GAAG;KACV,CAAC;IACF,YAAY,EAAE,YAAK,CAAC,MAAM,CAAC;QACzB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,gDAAgD;QAC7D,OAAO,EAAE,cAAc;KACxB,CAAC;IACF,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC;CAC9B,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { Base } from '@sw-tsdk/core';
2
+ export declare class Action extends Base {
3
+ static description: string;
4
+ static flags: {
5
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
+ image: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
+ 'skip-pull': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ directory: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
+ action: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Action = void 0;
4
+ const core_1 = require("@oclif/core");
5
+ const node_path_1 = require("node:path");
6
+ const docker_1 = require("@sw-tsdk/docker");
7
+ const core_2 = require("@oclif/core");
8
+ const node_fs_1 = require("node:fs");
9
+ const core_3 = require("@sw-tsdk/core");
10
+ const common_1 = require("../../common");
11
+ // noinspection JSUnusedGlobalSymbols
12
+ class Action extends core_3.Base {
13
+ async run() {
14
+ const { flags } = await this.parse(Action);
15
+ const { 'skip-pull': skipPull, action, } = flags;
16
+ let { image } = flags;
17
+ let { directory } = flags;
18
+ directory = (0, node_path_1.resolve)(directory);
19
+ const typeOfContent = 'action';
20
+ if (!image) {
21
+ image = `${docker_1.DockerDefaults.SdkTurbineContentDescriptionImage}`;
22
+ }
23
+ try {
24
+ await node_fs_1.promises.access(directory);
25
+ }
26
+ catch {
27
+ this.error(`Could not access ${directory}`);
28
+ }
29
+ const docker = new docker_1.Docker();
30
+ core_2.ux.action.start('Checking for docker...');
31
+ await docker.ping();
32
+ core_2.ux.action.stop();
33
+ if (!skipPull) {
34
+ core_2.ux.action.start(`Pulling image (${image})...`);
35
+ await docker.pullImage(image);
36
+ core_2.ux.action.stop();
37
+ }
38
+ const actionToExecute = action || await (0, common_1.chooseAction)(directory);
39
+ const bindings = [`${directory}:/app/content`];
40
+ const commands = ['main.py'];
41
+ commands.push('-t', typeOfContent, '-a', actionToExecute);
42
+ const envVars = [
43
+ `OPENAI_API_KEY=${process.env.OPENAI_API_KEY}`,
44
+ `OPENAI_ORGANIZATION=${process.env.OPENAI_ORGANIZATION}`,
45
+ ];
46
+ const createOptions = {
47
+ Cmd: commands,
48
+ HostConfig: {
49
+ AutoRemove: false,
50
+ Binds: bindings,
51
+ },
52
+ Env: envVars,
53
+ };
54
+ core_2.ux.action.start('Generating Action Description...');
55
+ const outputStream = (0, core_3.writableNoopStream)();
56
+ const errorStream = (0, core_3.writableNoopStream)();
57
+ const success = await docker.runImage(image, createOptions, outputStream, errorStream);
58
+ core_2.ux.action.stop();
59
+ if (!success) {
60
+ core_2.Errors.exit(1);
61
+ }
62
+ }
63
+ }
64
+ exports.Action = Action;
65
+ Action.description = 'Use to generate action description';
66
+ Action.flags = {
67
+ ...core_3.Base.flags,
68
+ help: core_1.Flags.help({ char: 'h' }),
69
+ image: core_1.Flags.string({
70
+ char: 'i',
71
+ description: 'image to use',
72
+ }),
73
+ 'skip-pull': core_1.Flags.boolean({
74
+ char: 's',
75
+ description: 'skips pulling the image',
76
+ }),
77
+ directory: core_1.Flags.string({
78
+ char: 'd',
79
+ description: 'current directory to mount',
80
+ default: './',
81
+ }),
82
+ action: core_1.Flags.string({
83
+ char: 'a',
84
+ description: 'Generate description for specific action',
85
+ }),
86
+ };
87
+ //# sourceMappingURL=action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/commands/description/action.ts"],"names":[],"mappings":";;;AAAA,sCAAiC;AACjC,yCAAiC;AACjC,4CAAsD;AACtD,sCAAsC;AACtC,qCAAgC;AAChC,wCAAsD;AACtD,yCAAyC;AAEzC,qCAAqC;AACrC,MAAa,MAAO,SAAQ,WAAI;IAyB9B,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QACxC,MAAM,EACJ,WAAW,EAAE,QAAQ,EAAE,MAAM,GAC9B,GAAG,KAAK,CAAA;QACT,IAAI,EAAC,KAAK,EAAC,GAAG,KAAK,CAAA;QAEnB,IAAI,EAAC,SAAS,EAAC,GAAG,KAAK,CAAA;QACvB,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,CAAC,CAAA;QAE9B,MAAM,aAAa,GAAG,QAAQ,CAAA;QAC9B,IAAI,CAAC,KAAK,EAAE;YACV,KAAK,GAAG,GAAG,uBAAc,CAAC,iCAAiC,EAAE,CAAA;SAC9D;QAED,IAAI;YACF,MAAM,kBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;SACjC;QAAC,MAAM;YACN,IAAI,CAAC,KAAK,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAA;SAC5C;QAED,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAA;QAC3B,SAAE,CAAC,MAAM,CAAC,KAAK,CAAC,wB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,OAAO,EAAE;YACZ,aAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;SACf;IACH,CAAC;;AA5FH,wBA6FC;AA5FQ,kBAAW,GAAG,oCAAoC,CAAC;AAEnD,YAAK,GAAG;IACb,GAAG,WAAI,CAAC,KAAK;IACb,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC;IAC7B,KAAK,EAAE,YAAK,CAAC,MAAM,CAAC;QAClB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,cAAc;KAC5B,CAAC;IACF,WAAW,EAAE,YAAK,CAAC,OAAO,CAAC;QACzB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,yBAAyB;KACvC,CAAC;IACF,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE,IAAI;KACd,CAAC;IACF,MAAM,EAAE,YAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,0CAA0C;KACxD,CAAC;CACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Base } from '@sw-tsdk/core';
2
+ export declare class Actions extends Base {
3
+ static description: string;
4
+ static flags: {
5
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
+ image: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
+ 'skip-pull': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ directory: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Actions = void 0;
4
+ const core_1 = require("@oclif/core");
5
+ const node_path_1 = require("node:path");
6
+ const docker_1 = require("@sw-tsdk/docker");
7
+ const core_2 = require("@oclif/core");
8
+ const node_fs_1 = require("node:fs");
9
+ const core_3 = require("@sw-tsdk/core");
10
+ // noinspection JSUnusedGlobalSymbols
11
+ class Actions extends core_3.Base {
12
+ async run() {
13
+ const { flags } = await this.parse(Actions);
14
+ const { 'skip-pull': skipPull, } = flags;
15
+ let { image } = flags;
16
+ let { directory } = flags;
17
+ directory = (0, node_path_1.resolve)(directory);
18
+ const typeOfContent = 'actions';
19
+ if (!image) {
20
+ image = `${docker_1.DockerDefaults.SdkTurbineContentDescriptionImage}`;
21
+ }
22
+ try {
23
+ await node_fs_1.promises.access(directory);
24
+ }
25
+ catch {
26
+ this.error(`Could not access ${directory}`);
27
+ }
28
+ const docker = new docker_1.Docker();
29
+ core_2.ux.action.start('Checking for docker...');
30
+ await docker.ping();
31
+ core_2.ux.action.stop();
32
+ if (!skipPull) {
33
+ core_2.ux.action.start(`Pulling image (${image})...`);
34
+ await docker.pullImage(image);
35
+ core_2.ux.action.stop();
36
+ }
37
+ const bindings = [`${directory}:/app/content`];
38
+ const commands = ['main.py'];
39
+ commands.push('-t', typeOfContent);
40
+ const envVars = [
41
+ `OPENAI_API_KEY=${process.env.OPENAI_API_KEY}`,
42
+ `OPENAI_ORGANIZATION=${process.env.OPENAI_ORGANIZATION}`,
43
+ ];
44
+ const createOptions = {
45
+ Cmd: commands,
46
+ HostConfig: {
47
+ AutoRemove: false,
48
+ Binds: bindings,
49
+ },
50
+ Env: envVars,
51
+ };
52
+ core_2.ux.action.start('Generating Actions Description...');
53
+ const outputStream = (0, core_3.writableNoopStream)();
54
+ const errorStream = (0, core_3.writableNoopStream)();
55
+ const success = await docker.runImage(image, createOptions, outputStream, errorStream);
56
+ core_2.ux.action.stop();
57
+ if (!success) {
58
+ core_2.Errors.exit(1);
59
+ }
60
+ }
61
+ }
62
+ exports.Actions = Actions;
63
+ Actions.description = 'Use to generate description for all actions';
64
+ Actions.flags = {
65
+ ...core_3.Base.flags,
66
+ help: core_1.Flags.help({ char: 'h' }),
67
+ image: core_1.Flags.string({
68
+ char: 'i',
69
+ description: 'image to use',
70
+ }),
71
+ 'skip-pull': core_1.Flags.boolean({
72
+ char: 's',
73
+ description: 'skips pulling the image',
74
+ }),
75
+ directory: core_1.Flags.string({
76
+ char: 'd',
77
+ description: 'current directory to mount',
78
+ default: './',
79
+ }),
80
+ };
81
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/commands/description/actions.ts"],"names":[],"mappings":";;;AAAA,sCAAiC;AACjC,yCAAiC;AACjC,4CAAsD;AACtD,sCAAsC;AACtC,qCAAgC;AAChC,wCAAsD;AAEtD,qCAAqC;AACrC,MAAa,OAAQ,SAAQ,WAAI;IAqB/B,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QACzC,MAAM,EACJ,WAAW,EAAE,QAAQ,GACtB,GAAG,KAAK,CAAA;QACT,IAAI,EAAC,KAAK,EAAC,GAAG,KAAK,CAAA;QAEnB,IAAI,EAAC,SAAS,EAAC,GAAG,KAAK,CAAA;QACvB,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,CAAC,CAAA;QAE9B,MAAM,aAAa,GAAG,SAAS,CAAA;QAC/B,IAAI,CAAC,KAAK,EAAE;YACV,KAAK,GAAG,GAAG,uBAAc,CAAC,iCAAiC,EAAE,CAAA;SAC9D;QAED,IAAI;YACF,MAAM,kBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;SACjC;QAAC,MAAM;YACN,IAAI,CAAC,KAAK,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAA;SAC5C;QAED,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAA;QAC3B,SAAE,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;QACzC,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA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,CAAC,KAAK;IACb,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC;IAC7B,KAAK,EAAE,YAAK,CAAC,MAAM,CAAC;QAClB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,cAAc;KAC5B,CAAC;IACF,WAAW,EAAE,YAAK,CAAC,OAAO,CAAC;QACzB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,yBAAyB;KACvC,CAAC;IACF,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE,IAAI;KACd,CAAC;CACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Base } from '@sw-tsdk/core';
2
+ export declare class Connector extends Base {
3
+ static description: string;
4
+ static flags: {
5
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
6
+ image: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
+ 'skip-pull': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ directory: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Connector = void 0;
4
+ const core_1 = require("@oclif/core");
5
+ const node_path_1 = require("node:path");
6
+ const docker_1 = require("@sw-tsdk/docker");
7
+ const core_2 = require("@oclif/core");
8
+ const node_fs_1 = require("node:fs");
9
+ const core_3 = require("@sw-tsdk/core");
10
+ // noinspection JSUnusedGlobalSymbols
11
+ class Connector extends core_3.Base {
12
+ async run() {
13
+ const { flags } = await this.parse(Connector);
14
+ const { 'skip-pull': skipPull, } = flags;
15
+ let { image } = flags;
16
+ let { directory } = flags;
17
+ directory = (0, node_path_1.resolve)(directory);
18
+ const typeOfContent = 'connector';
19
+ if (!image) {
20
+ image = `${docker_1.DockerDefaults.SdkTurbineContentDescriptionImage}`;
21
+ }
22
+ try {
23
+ await node_fs_1.promises.access(directory);
24
+ }
25
+ catch {
26
+ this.error(`Could not access ${directory}`);
27
+ }
28
+ const docker = new docker_1.Docker();
29
+ core_2.ux.action.start('Checking for docker...');
30
+ await docker.ping();
31
+ core_2.ux.action.stop();
32
+ if (!skipPull) {
33
+ core_2.ux.action.start(`Pulling image (${image})...`);
34
+ await docker.pullImage(image);
35
+ core_2.ux.action.stop();
36
+ }
37
+ const bindings = [`${directory}:/app/content`];
38
+ const commands = ['main.py'];
39
+ commands.push('-t', typeOfContent);
40
+ const envVars = [
41
+ `OPENAI_API_KEY=${process.env.OPENAI_API_KEY}`,
42
+ `OPENAI_ORGANIZATION=${process.env.OPENAI_ORGANIZATION}`,
43
+ ];
44
+ const createOptions = {
45
+ Cmd: commands,
46
+ HostConfig: {
47
+ AutoRemove: false,
48
+ Binds: bindings,
49
+ },
50
+ Env: envVars,
51
+ };
52
+ core_2.ux.action.start('Generating Connector Description...');
53
+ const outputStream = (0, core_3.writableNoopStream)();
54
+ const errorStream = (0, core_3.writableNoopStream)();
55
+ const success = await docker.runImage(image, createOptions, outputStream, errorStream);
56
+ core_2.ux.action.stop();
57
+ if (!success) {
58
+ core_2.Errors.exit(1);
59
+ }
60
+ }
61
+ }
62
+ exports.Connector = Connector;
63
+ Connector.description = 'Use to generate connector descriptions';
64
+ Connector.flags = {
65
+ ...core_3.Base.flags,
66
+ help: core_1.Flags.help({ char: 'h' }),
67
+ image: core_1.Flags.string({
68
+ char: 'i',
69
+ description: 'image to use',
70
+ }),
71
+ 'skip-pull': core_1.Flags.boolean({
72
+ char: 's',
73
+ description: 'skips pulling the image',
74
+ }),
75
+ directory: core_1.Flags.string({
76
+ char: 'd',
77
+ description: 'current directory to mount',
78
+ default: './',
79
+ }),
80
+ };
81
+ //# sourceMappingURL=connector.js.map
@@ -0,0 +1 @@
1
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W,EAAE,yBAAyB;KACvC,CAAC;IACF,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE,IAAI;KACd,CAAC;CACH,CAAC"}
package/lib/common.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  export declare function chooseAction(directory: string): Promise<string>;
2
+ export declare function chooseComponentName(directory: string, componentType: string): Promise<string>;
3
+ export declare function chooseComponentType(): Promise<string>;
2
4
  export declare function chooseAsset(directory: string): Promise<string>;
3
5
  export declare const connectorCategories: string[];
6
+ export declare const contentCategories: string[];
4
7
  export declare const connectorTemplates: string[];
package/lib/common.js CHANGED
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.connectorTemplates = exports.connectorCategories = exports.chooseAsset = exports.chooseAction = void 0;
3
+ exports.connectorTemplates = exports.contentCategories = exports.connectorCategories = exports.chooseAsset = exports.chooseComponentType = exports.chooseComponentName = exports.chooseAction = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const connector_1 = require("@sw-tsdk/connector");
5
6
  const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
6
7
  const inquirer_autocomplete_prompt_1 = tslib_1.__importDefault(require("inquirer-autocomplete-prompt"));
7
- const connector_1 = require("@sw-tsdk/connector");
8
+ const fs = tslib_1.__importStar(require("node:fs"));
9
+ const node_path_1 = tslib_1.__importDefault(require("node:path"));
8
10
  async function chooseAction(directory) {
9
11
  inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
10
12
  const manifests = await (0, connector_1.allManifests)(directory);
@@ -24,6 +26,57 @@ async function chooseAction(directory) {
24
26
  return answers.name;
25
27
  }
26
28
  exports.chooseAction = chooseAction;
29
+ async function getFoldersInDirectory(directoryPath) {
30
+ try {
31
+ const filesAndFolders = await fs.promises.readdir(directoryPath);
32
+ // Filter out only directories
33
+ const folderPromises = filesAndFolders.map(async (item) => {
34
+ const fullPath = `${directoryPath}/${item}`;
35
+ const stats = await fs.promises.stat(fullPath);
36
+ if (stats.isDirectory()) {
37
+ return item;
38
+ }
39
+ return null;
40
+ });
41
+ const folders = await Promise.all(folderPromises);
42
+ return folders.filter(folder => folder !== null).sort();
43
+ }
44
+ catch (error) {
45
+ console.error('Error reading directory:', error);
46
+ return [];
47
+ }
48
+ }
49
+ async function chooseComponentName(directory, componentType) {
50
+ inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
51
+ const componentFolders = await getFoldersInDirectory(node_path_1.default.join(directory, componentType));
52
+ if (componentFolders.length === 0) {
53
+ throw new Error('Could not find any Component.');
54
+ }
55
+ const answers = await inquirer_1.default.prompt([
56
+ {
57
+ type: 'autocomplete',
58
+ name: 'name',
59
+ message: 'Choose a Component',
60
+ source: (_, input) => componentFolders.filter((r) => !input || r.includes(input)),
61
+ },
62
+ ]);
63
+ return answers.name;
64
+ }
65
+ exports.chooseComponentName = chooseComponentName;
66
+ async function chooseComponentType() {
67
+ inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
68
+ const ComponentTypes = exports.contentCategories;
69
+ const answers = await inquirer_1.default.prompt([
70
+ {
71
+ type: 'autocomplete',
72
+ name: 'name',
73
+ message: 'Choose a Component Type',
74
+ source: (_, input) => ComponentTypes.filter((r) => !input || r.includes(input)),
75
+ },
76
+ ]);
77
+ return answers.name;
78
+ }
79
+ exports.chooseComponentType = chooseComponentType;
27
80
  async function chooseAsset(directory) {
28
81
  inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
29
82
  const manifests = await (0, connector_1.allManifests)(directory);
@@ -59,6 +112,10 @@ exports.connectorCategories = [
59
112
  'Swimlane Utilities',
60
113
  'Vulnerability & Patch Management',
61
114
  ];
115
+ exports.contentCategories = [
116
+ 'classic',
117
+ 'canvas',
118
+ ];
62
119
  exports.connectorTemplates = [
63
120
  'python_311_definition',
64
121
  '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C,CAAyB,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAyB,EAAE,EAAE,CAAC,CAAC,CAAC;SACxH;KACF,CAAC,CAAA;IAEF,OAAO,OAAO,CAAC,IAAI,CAAA;AACrB,CAAC;AAjBD,kCAiBC;AAEY,QAAA,mBAAmB,GAAG;IACjC,gBAAgB;IAChB,0BAA0B;IAC1B,2BAA2B;IAC3B,+BAA+B;IAC/B,uCAAuC;IACvC,+BAA+B;IAC/B,wBAAwB;IACxB,gCAAgC;IAChC,8BAA8B;IAC9B,8BAA8B;IAC9B,8BAA8B;IAC9B,8BAA8B;IAC9B,eAAe;IACf,+BAA+B;IAC/B,uBAAuB;IACvB,oBAAoB;IACpB,kCAAkC;CACnC,CAAA;AAEY,QAAA,iBAAiB,GAAG;IAC/B,SAAS;IACT,QAAQ;CACT,CAAA;AAEY,QAAA,kBAAkB,GAAG;IAChC,uBAAuB;IACvB,uBAAuB;IACvB,SAAS;IACT,SAAS;IACT,oBAAoB;CACrB,CAAA"}
@@ -16,6 +16,26 @@ export type ConnectorQuestions = {
16
16
  homepage: string;
17
17
  aspirationalConnector: string;
18
18
  };
19
+ export type ComponentQuestions = {
20
+ componentType: string;
21
+ vendor: string;
22
+ componentName: string;
23
+ description: string;
24
+ logoPath?: string;
25
+ sspPath?: string;
26
+ author: string;
27
+ authorEmail: string;
28
+ homepage: string;
29
+ keywords: string;
30
+ };
31
+ export type ComponentLogoInfo = {
32
+ componentType: string;
33
+ logoPath: string;
34
+ };
35
+ export type ComponentSSPInfo = {
36
+ componentType: string;
37
+ sspPath: string;
38
+ };
19
39
  export type ActionQuestions = {
20
40
  title: string;
21
41
  method?: string;