@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.
Files changed (66) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +341 -0
  3. package/lib/commands/action/add.d.ts +10 -0
  4. package/lib/commands/action/add.js +88 -0
  5. package/lib/commands/action/add.js.map +1 -0
  6. package/lib/commands/action/input.d.ts +13 -0
  7. package/lib/commands/action/input.js +69 -0
  8. package/lib/commands/action/input.js.map +1 -0
  9. package/lib/commands/action/output.d.ts +13 -0
  10. package/lib/commands/action/output.js +68 -0
  11. package/lib/commands/action/output.js.map +1 -0
  12. package/lib/commands/action/run.d.ts +23 -0
  13. package/lib/commands/action/run.js +142 -0
  14. package/lib/commands/action/run.js.map +1 -0
  15. package/lib/commands/asset/add.d.ts +10 -0
  16. package/lib/commands/asset/add.js +50 -0
  17. package/lib/commands/asset/add.js.map +1 -0
  18. package/lib/commands/connector/build.d.ts +17 -0
  19. package/lib/commands/connector/build.js +71 -0
  20. package/lib/commands/connector/build.js.map +1 -0
  21. package/lib/commands/connector/create-source.d.ts +9 -0
  22. package/lib/commands/connector/create-source.js +31 -0
  23. package/lib/commands/connector/create-source.js.map +1 -0
  24. package/lib/commands/connector/create.d.ts +21 -0
  25. package/lib/commands/connector/create.js +169 -0
  26. package/lib/commands/connector/create.js.map +1 -0
  27. package/lib/commands/connector/logo.d.ts +10 -0
  28. package/lib/commands/connector/logo.js +31 -0
  29. package/lib/commands/connector/logo.js.map +1 -0
  30. package/lib/commands/connector/save.d.ts +12 -0
  31. package/lib/commands/connector/save.js +37 -0
  32. package/lib/commands/connector/save.js.map +1 -0
  33. package/lib/commands/connector/sign.d.ts +15 -0
  34. package/lib/commands/connector/sign.js +58 -0
  35. package/lib/commands/connector/sign.js.map +1 -0
  36. package/lib/commands/connector/update.d.ts +11 -0
  37. package/lib/commands/connector/update.js +54 -0
  38. package/lib/commands/connector/update.js.map +1 -0
  39. package/lib/commands/connector/validate.d.ts +14 -0
  40. package/lib/commands/connector/validate.js +90 -0
  41. package/lib/commands/connector/validate.js.map +1 -0
  42. package/lib/common.d.ts +3 -0
  43. package/lib/common.js +43 -0
  44. package/lib/common.js.map +1 -0
  45. package/lib/index.d.ts +2 -0
  46. package/lib/index.js +4 -0
  47. package/lib/index.js.map +1 -0
  48. package/lib/templates/assets/apikey.yaml +34 -0
  49. package/lib/templates/assets/custom.yaml +22 -0
  50. package/lib/templates/assets/http_basic.yaml +38 -0
  51. package/lib/templates/assets/http_bearer.yaml +34 -0
  52. package/lib/templates/assets/oauth2_client_credentials.yaml +51 -0
  53. package/lib/templates/python_310_definition/template/connector/config/actions/example.yaml +40 -0
  54. package/lib/templates/python_310_definition/template/connector/config/assets/example.yaml +27 -0
  55. package/lib/templates/python_310_definition/template/data/asset.json +1 -0
  56. package/lib/templates/python_310_definition/template/docs/CHANGELOG.md.t +7 -0
  57. package/lib/templates/python_310_definition/template/docs/README.md +38 -0
  58. package/lib/templates/python_310_definition/template/requirements.txt +0 -0
  59. package/lib/types/connector-types.d.ts +29 -0
  60. package/lib/types/connector-types.js +14 -0
  61. package/lib/types/connector-types.js.map +1 -0
  62. package/lib/types/index.d.ts +1 -0
  63. package/lib/types/index.js +5 -0
  64. package/lib/types/index.js.map +1 -0
  65. package/oclif.manifest.json +1 -0
  66. package/package.json +91 -0
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Save = 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 docker_1 = require("@sw-tsdk/docker");
9
+ // noinspection JSUnusedGlobalSymbols
10
+ class Save extends core_2.Base {
11
+ async run() {
12
+ const { flags } = await this.parse(Save);
13
+ let { directory } = flags;
14
+ const { image, output, 'skip-pull': skipPull } = flags;
15
+ directory = (0, node_path_1.resolve)(directory || process.cwd());
16
+ try {
17
+ await node_fs_1.promises.access(directory);
18
+ }
19
+ catch (_a) {
20
+ this.error(`Could not access ${directory}`);
21
+ }
22
+ const docker = await new docker_1.Docker();
23
+ if (!skipPull) {
24
+ core_1.CliUx.ux.action.start(`Pulling image (${image})...`);
25
+ await docker.pullImage(image);
26
+ core_1.CliUx.ux.action.stop();
27
+ }
28
+ const filePath = (0, node_path_1.isAbsolute)(output) ? output : (0, node_path_1.resolve)((0, node_path_1.join)(directory, output));
29
+ core_1.CliUx.ux.action.start('Saving Image...');
30
+ await docker.saveImage(image, filePath);
31
+ core_1.CliUx.ux.action.stop();
32
+ }
33
+ }
34
+ exports.Save = Save;
35
+ Save.description = 'Save a docker image locally as .tar.gz';
36
+ Save.flags = Object.assign(Object.assign({}, core_2.Base.flags), { directory: core_1.Flags.string({ char: 'd', description: 'Root directory of the repo.', default: '.' }), output: core_1.Flags.string({ char: 'o', description: 'output file to where to store the image.', required: true }), image: core_1.Flags.string({ char: 'i', description: 'image to save.', required: true }), 'skip-pull': core_1.Flags.boolean({ char: 's', description: 'skips pulling the image' }), help: core_1.Flags.help({ char: 'h' }) });
37
+ //# sourceMappingURL=save.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save.js","sourceRoot":"","sources":["../../../src/commands/connector/save.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;AACxC,wCAAkC;AAClC,yCAAmD;AACnD,qCAAgC;AAChC,4CAAsC;AAEtC,qCAAqC;AACrC,MAAa,IAAK,SAAQ,WAAI;IAY5B,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,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAC,GAAG,KAAK,CAAA;QAEpD,SAAS,GAAG,IAAA,mBAAO,EAAC,S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AC1G,KAAK,EAAE,YAAK,CAAC,MAAM,CAAC,EAAC,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EAC/E,WAAW,EAAE,YAAK,CAAC,OAAO,CAAC,EAAC,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,yBAAyB,EAAC,CAAC,EAC/E,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,IAC9B"}
@@ -0,0 +1,15 @@
1
+ import { Base } from '@sw-tsdk/core';
2
+ export declare class Sign extends Base {
3
+ static description: string;
4
+ static flags: {
5
+ directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
6
+ image: import("@oclif/core/lib/interfaces").OptionFlag<string>;
7
+ 'signing-password': import("@oclif/core/lib/interfaces").OptionFlag<string>;
8
+ save: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ 'key-name': import("@oclif/core/lib/interfaces").OptionFlag<string>;
10
+ 'skip-upload': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ registry: import("@oclif/core/lib/interfaces").OptionFlag<string>;
12
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Sign = 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 cosign_1 = require("@swimlane/cosign");
9
+ const docker_1 = require("@sw-tsdk/docker");
10
+ const docker_reference_1 = require("@swimlane/docker-reference");
11
+ // noinspection JSUnusedGlobalSymbols
12
+ class Sign extends core_2.Base {
13
+ async run() {
14
+ const { flags } = await this.parse(Sign);
15
+ const { directory } = flags;
16
+ const { save, 'skip-upload': skipUpload, image: imageName, 'signing-password': signingPassword, 'key-name': keyName, registry, } = flags;
17
+ const storagePath = (0, node_path_1.join)(this.config.configDir, 'keys', keyName);
18
+ const privateKeyPath = (0, node_path_1.join)(storagePath, 'cosign.key');
19
+ try {
20
+ await node_fs_1.promises.access(privateKeyPath);
21
+ }
22
+ catch (_a) {
23
+ this.error(`Could not find key ${privateKeyPath}`);
24
+ }
25
+ const docker = new docker_1.Docker();
26
+ const taggedImage = await docker.pushImage({
27
+ imageReference: imageName,
28
+ domain: registry,
29
+ });
30
+ core_1.CliUx.ux.action.start('Signing Image...');
31
+ await (0, cosign_1.signImage)(signingPassword, privateKeyPath, taggedImage, !skipUpload);
32
+ core_1.CliUx.ux.action.stop();
33
+ if (save) {
34
+ core_1.CliUx.ux.action.start('Saving Image...');
35
+ const { repository, tag } = (0, docker_reference_1.parseQualifiedName)(taggedImage);
36
+ const fileName = (0, node_path_1.join)(directory, `${repository.replace('/', '-')}-${tag}.tar.gz`);
37
+ await (0, cosign_1.save)(taggedImage, (0, node_fs_1.createWriteStream)(fileName));
38
+ core_1.CliUx.ux.action.stop();
39
+ }
40
+ }
41
+ }
42
+ exports.Sign = Sign;
43
+ Sign.description = 'Builds a local docker image of the connector.';
44
+ Sign.flags = Object.assign(Object.assign({}, core_2.Base.flags), { directory: core_1.Flags.string({
45
+ char: 'd',
46
+ description: 'root directory of the repository.',
47
+ default: './',
48
+ }), image: core_1.Flags.string({
49
+ description: 'image name to sign',
50
+ required: true,
51
+ }), 'signing-password': core_1.Flags.string({ description: 'password used for the private key', default: '' }), save: core_1.Flags.boolean({
52
+ description: 'saves docker image as tar in local directory.',
53
+ }), 'key-name': core_1.Flags.string({ description: 'name used for the key (default: username)', required: true }), 'skip-upload': core_1.Flags.boolean({
54
+ hidden: true,
55
+ }), registry: core_1.Flags.string({ description: 'registry to use for signing', default: 'localhost:50000' }), help: core_1.Flags.help({
56
+ char: 'h',
57
+ }) });
58
+ //# sourceMappingURL=sign.js.map
@@ -0,0 +1 @@
1
+ {"version":3,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,YAAK,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,6BAA6B,EAAE,OAAO,EAAE,iBAAiB,EAAC,CAAC,EAChG,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC;QACf,IAAI,EAAE,GAAG;KACV,CAAC,IACH"}
@@ -0,0 +1,11 @@
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>;
6
+ version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
7
+ 'manifest-path': import("@oclif/core/lib/interfaces").OptionFlag<string>;
8
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,54 @@
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 node_path_1 = require("node:path");
8
+ const node_fs_1 = require("node:fs");
9
+ const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
10
+ const fs_extra_1 = require("fs-extra");
11
+ const fs = tslib_1.__importStar(require("node:fs"));
12
+ // noinspection JSUnusedGlobalSymbols
13
+ class Update extends core_2.Base {
14
+ async run() {
15
+ const { flags } = await this.parse(Update);
16
+ let { directory, 'manifest-path': 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 (_a) {
28
+ this.error(`Could not access ${manifestPath}`);
29
+ }
30
+ core_1.CliUx.ux.action.start('Updating connector');
31
+ const manifest = js_yaml_1.default.load(await fs.promises.readFile(manifestPath, 'utf-8'));
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.CliUx.ux.action.stop();
38
+ }
39
+ }
40
+ exports.Update = Update;
41
+ Update.description = 'Update a connector.';
42
+ Update.flags = Object.assign(Object.assign({}, core_2.Base.flags), { directory: core_1.Flags.string({
43
+ char: 'd',
44
+ description: 'root directory of the connector folder.',
45
+ default: '.',
46
+ }), version: core_1.Flags.string({
47
+ char: 'v',
48
+ description: 'new version of the connector.',
49
+ }), 'manifest-path': core_1.Flags.string({
50
+ char: 'f',
51
+ description: 'connector manifest path relative to directory.',
52
+ default: '/connector/connector.yaml',
53
+ }), help: core_1.Flags.help({ char: 'h' }) });
54
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/connector/update.ts"],"names":[],"mappings":";;;;AAAA,sCAAwC;AACxC,wCAAkC;AAClC,yCAAuC;AACvC,qCAAgC;AAChC,8DAA0B;AAC1B,uCAAkC;AAClC,oDAA6B;AAG7B,qCAAqC;AACrC,MAAa,MAAO,SAAQ,WAAI;IAsB9B,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAExC,IAAI,EAAC,SAAS,EAAE,eAAe,EAAE,YAAY,EAAC,GAAG,KAAK,CAAA;QACtD,MAAM,EAAC,OAAO,EAAC,GAAG,KAAK,CAAA;QACvB,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAE/C,2CAA2C;QAC3C,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YAChC,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,C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EAAE,YAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,IAC9B"}
@@ -0,0 +1,14 @@
1
+ import { Base } from '@sw-tsdk/core';
2
+ export declare class Validate 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>;
7
+ connector: import("@oclif/core/lib/interfaces").OptionFlag<string>;
8
+ signed: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ key: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
+ 'skip-pull': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Validate = 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 Validate extends core_3.Base {
12
+ async run() {
13
+ const { flags } = await this.parse(Validate);
14
+ const { 'skip-pull': skipPull, connector, signed, key, } = flags;
15
+ let { image } = flags;
16
+ let { directory } = flags;
17
+ directory = (0, node_path_1.resolve)(directory);
18
+ if (!image) {
19
+ image = `${docker_1.DockerDefaults.SdkTurbineValidateImage}`;
20
+ }
21
+ try {
22
+ await node_fs_1.promises.access(directory);
23
+ }
24
+ catch (_a) {
25
+ this.error(`Could not access ${directory}`);
26
+ }
27
+ const docker = new docker_1.Docker();
28
+ core_2.CliUx.ux.action.start('Checking for docker...');
29
+ await docker.ping();
30
+ core_2.CliUx.ux.action.stop();
31
+ if (!skipPull) {
32
+ core_2.CliUx.ux.action.start(`Pulling image (${image})...`);
33
+ await docker.pullImage(image);
34
+ core_2.CliUx.ux.action.stop();
35
+ }
36
+ const bindings = [`${directory}:/connector`];
37
+ const commands = ['connector:validate'];
38
+ if (signed) {
39
+ commands.push('--signed');
40
+ if (key === undefined) {
41
+ commands.push('--skip-verification');
42
+ }
43
+ else {
44
+ commands.push('--key', key || '');
45
+ }
46
+ }
47
+ commands.push(`/connector/${connector}`);
48
+ const createOptions = {
49
+ Cmd: commands,
50
+ HostConfig: {
51
+ AutoRemove: true,
52
+ Binds: bindings,
53
+ },
54
+ };
55
+ core_2.CliUx.ux.action.start('Validating...');
56
+ const outputStream = (0, core_3.writableNoopStream)();
57
+ const errorStream = (0, core_3.writableNoopStream)();
58
+ const success = await docker.runImage(image, createOptions, outputStream, errorStream);
59
+ core_2.CliUx.ux.action.stop();
60
+ if (!success) {
61
+ core_2.Errors.exit(1);
62
+ }
63
+ }
64
+ }
65
+ exports.Validate = Validate;
66
+ Validate.description = 'Use to validate an integration';
67
+ Validate.flags = Object.assign(Object.assign({}, core_3.Base.flags), { help: core_1.Flags.help({ char: 'h' }),
68
+ // flag with a value (-n, --name=VALUE)
69
+ image: core_1.Flags.string({
70
+ char: 'i',
71
+ description: 'image to use',
72
+ }), connector: core_1.Flags.string({
73
+ char: 'c',
74
+ description: 'connector to validate (relative to directory)',
75
+ required: true,
76
+ }), signed: core_1.Flags.boolean({
77
+ description: 'validates a signed connector',
78
+ }), key: core_1.Flags.string({
79
+ description: 'public key for verfication',
80
+ dependsOn: ['signed'],
81
+ exclusive: ['skip-verification'],
82
+ }), 'skip-pull': core_1.Flags.boolean({
83
+ char: 's',
84
+ description: 'skips pulling the image',
85
+ }), directory: core_1.Flags.string({
86
+ char: 'd',
87
+ description: 'current directory to mount',
88
+ default: './',
89
+ }) });
90
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/commands/connector/validate.ts"],"names":[],"mappings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AAW,EAAE,cAAc;KAC5B,CAAC,EACF,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,+CAA+C;QAC5D,QAAQ,EAAE,IAAI;KACf,CAAC,EACF,MAAM,EAAE,YAAK,CAAC,OAAO,CAAC;QACpB,WAAW,EAAE,8BAA8B;KAC5C,CAAC,EACF,GAAG,EAAE,YAAK,CAAC,MAAM,CAAC;QAChB,WAAW,EAAE,4BAA4B;QACzC,SAAS,EAAE,CAAC,QAAQ,CAAC;QACrB,SAAS,EAAE,CAAC,mBAAmB,CAAC;KACjC,CAAC,EACF,WAAW,EAAE,YAAK,CAAC,OAAO,CAAC;QACzB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,yBAAyB;KACvC,CAAC,EACF,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE,IAAI;KACd,CAAC,IACF"}
@@ -0,0 +1,3 @@
1
+ export declare function chooseAction(directory: string): Promise<string>;
2
+ export declare const connectorCategories: string[];
3
+ export declare const connectorTemplates: string[];
package/lib/common.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.connectorTemplates = exports.connectorCategories = exports.chooseAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
6
+ const inquirer_autocomplete_prompt_1 = tslib_1.__importDefault(require("inquirer-autocomplete-prompt"));
7
+ const connector_1 = require("@sw-tsdk/connector");
8
+ async function chooseAction(directory) {
9
+ inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
10
+ const manifests = await (0, connector_1.allManifests)(directory);
11
+ const actions = manifests.filter(m => (0, connector_1.isConnectorActionManifest)(m))
12
+ .map(m => {
13
+ return m.name;
14
+ });
15
+ const answers = await inquirer_1.default.prompt([{
16
+ type: 'autocomplete',
17
+ name: 'name',
18
+ message: 'Choose an action to run',
19
+ source: () => Promise.resolve(actions),
20
+ }]);
21
+ return answers.name;
22
+ }
23
+ exports.chooseAction = chooseAction;
24
+ exports.connectorCategories = [
25
+ 'Investigation',
26
+ 'Endpoint Security & Management',
27
+ 'Network Security & Management',
28
+ 'Communication',
29
+ 'SIEM & Log Management',
30
+ 'Governance & Risk Management',
31
+ 'Vulnerability & Patch Management',
32
+ 'Ticket Management',
33
+ 'DevOps & Application Security',
34
+ 'Identity & Access Management',
35
+ 'Infrastructure',
36
+ 'Miscellaneous',
37
+ ];
38
+ exports.connectorTemplates = [
39
+ 'python_310_definition',
40
+ 'node_18',
41
+ 'python_3.7_swimlane',
42
+ ];
43
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;;;AAAA,gEAA+B;AAC/B,wGAA6D;AAC7D,kDAAoF;AAE7E,KAAK,UAAU,YAAY,CAAC,SAAiB;IAClD,kBAAQ,CAAC,cAAc,CAAC,cAAc,EAAE,sCAAkB,CAAC,CAAA;IAC3D,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAY,EAAC,SAAS,CAAe,CAAA;IAC7D,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,qCAAyB,EAAC,CAAC,CAAC,CAAC;SAClE,GAAG,CAAC,CAAC,CAAC,EAAE;QACP,OAAO,CAAC,CAAC,IAAI,CAAA;IACf,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,MAAM,kBAAQ,CAAC,MAAM,CAAC,CAAC;YACrC,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,yBAAyB;YAClC,MAAM,EAAE,GAAG,EAAE,CACX,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;SAC3B,CAAC,CAAC,CAAA;IAEH,OAAO,OAAO,CAAC,IAAI,CAAA;AACrB,CAAC;AAjBD,oCAiBC;AAEY,QAAA,mBAAmB,GAAG;IACjC,eAAe;IACf,gCAAgC;IAChC,+BAA+B;IAC/B,eAAe;IACf,uBAAuB;IACvB,8BAA8B;IAC9B,kCAAkC;IAClC,mBAAmB;IACnB,+BAA+B;IAC/B,8BAA8B;IAC9B,gBAAgB;IAChB,eAAe;CAChB,CAAA;AAEY,QAAA,kBAAkB,GAAG;IAChC,uBAAuB;IACvB,SAAS;IACT,qBAAqB;CACtB,CAAA"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
package/lib/index.js ADDED
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {};
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,kBAAe,EAAE,CAAA"}
@@ -0,0 +1,34 @@
1
+ schema: asset/1
2
+ name: apikey
3
+ title: API Key Authentication
4
+ description: 'Authenticates using an API Key'
5
+ inputs:
6
+ type: object
7
+ properties:
8
+ url:
9
+ title: URL
10
+ description: A URL to the target host.
11
+ type: string
12
+ default: https://www.example.com # change if it has a default cloud URL or remove if always custom.
13
+ x-apikey: # example, replace with correct key name for product.
14
+ title: API Key
15
+ description: API key
16
+ type: string
17
+ format: password
18
+ verify_ssl:
19
+ title: Verify SSL Certificates
20
+ description: Verify SSL certificate
21
+ type: boolean
22
+ http_proxy:
23
+ title: HTTP(s) Proxy
24
+ description: A proxy to route requests through.
25
+ type: string
26
+ required:
27
+ - url
28
+ - x-apikey # example, replace with correct key name for product.
29
+ meta:
30
+ asset_url_key: url
31
+ security:
32
+ type: apiKey
33
+ name: x-apikey # example, replace with correct key name for product.
34
+ in: header, cookie or query # please select the one applicable to the API and remove the others.
@@ -0,0 +1,22 @@
1
+ schema: asset/1
2
+ name: asset
3
+ title: Asset
4
+ description: ''
5
+ inputs:
6
+ type: object
7
+ properties:
8
+ url:
9
+ title: URL
10
+ description: A URL to the target host.
11
+ type: string
12
+ default: https://www.example.com # change if it has a default cloud URL or remove if always custom.
13
+ verify_ssl:
14
+ title: Verify SSL Certificates
15
+ description: Verify SSL certificate
16
+ type: boolean
17
+ http_proxy:
18
+ title: HTTP(s) Proxy
19
+ description: A proxy to route requests through.
20
+ type: string
21
+ required: []
22
+ meta: {}
@@ -0,0 +1,38 @@
1
+ schema: asset/1
2
+ name: http_basic
3
+ title: HTTP Basic Authentication
4
+ description: 'Authenticates using username and password.'
5
+ inputs:
6
+ type: object
7
+ properties:
8
+ url:
9
+ title: URL
10
+ description: A URL to the target host.
11
+ type: string
12
+ default: https://www.example.com # change if it has a default cloud URL or remove if always custom.
13
+ username:
14
+ title: Username
15
+ description: Username
16
+ type: string
17
+ password:
18
+ title: Password
19
+ description: Password
20
+ type: string
21
+ format: password
22
+ verify_ssl:
23
+ title: Verify SSL Certificates
24
+ description: Verify SSL certificate
25
+ type: boolean
26
+ http_proxy:
27
+ title: HTTP(s) Proxy
28
+ description: A proxy to route requests through.
29
+ type: string
30
+ required:
31
+ - url
32
+ - username
33
+ - password
34
+ meta:
35
+ asset_url_key: url
36
+ security:
37
+ type: http
38
+ scheme: basic
@@ -0,0 +1,34 @@
1
+ schema: asset/1
2
+ name: http_basic
3
+ title: HTTP Bearer Authentication
4
+ description: 'Authenticates using bearer token such as a JWT, etc.'
5
+ inputs:
6
+ type: object
7
+ properties:
8
+ url:
9
+ title: URL
10
+ description: A URL to the target host.
11
+ type: string
12
+ default: https://www.example.com # change if it has a default cloud URL or remove if always custom.
13
+ token: # NEVER CHANGE THIS
14
+ title: Token # name this properly
15
+ description: The API key, token, etc. # name this properly
16
+ type: string
17
+ format: password
18
+ verify_ssl:
19
+ title: Verify SSL Certificates
20
+ description: Verify SSL certificate
21
+ type: boolean
22
+ http_proxy:
23
+ title: HTTP(s) Proxy
24
+ description: A proxy to route requests through.
25
+ type: string
26
+ required:
27
+ - url
28
+ - username
29
+ - password
30
+ meta:
31
+ asset_url_key: url
32
+ security:
33
+ type: http
34
+ scheme: bearer
@@ -0,0 +1,51 @@
1
+ schema: asset/1
2
+ name: oauth2_client_credentials
3
+ title: Oauth 2.0 Client Credentials
4
+ description: 'Authenticates using oauth 2.0 client credentials'
5
+ inputs:
6
+ type: object
7
+ properties:
8
+ url:
9
+ title: URL
10
+ description: A URL to the target host.
11
+ type: string
12
+ default: https://www.example.com # change if it has a default cloud URL or remove if always custom.
13
+ token_url:
14
+ title: Token URL
15
+ type: string
16
+ default: https://www.example.com/oauth/token # remove if this is static. Graph API requires tenant ID and would need the user input.
17
+ client_id:
18
+ title: Client ID
19
+ description: The client ID
20
+ type: string
21
+ client_secret:
22
+ title: Client Secret
23
+ description: The client secret.
24
+ type: string
25
+ format: password
26
+ scope:
27
+ title: Scopes
28
+ description: Permission scopes for this action.
29
+ type: array
30
+ items:
31
+ type: string
32
+ default: [] # Add array of scopes we think are needed for the action.
33
+ verify_ssl:
34
+ title: Verify SSL Certificates
35
+ description: Verify SSL certificate
36
+ type: boolean
37
+ http_proxy:
38
+ title: HTTP(s) Proxy
39
+ description: A proxy to route requests through.
40
+ type: string
41
+ required:
42
+ - url
43
+ - client_id
44
+ - client_secret
45
+ - token_url
46
+ meta:
47
+ asset_url_key: url
48
+ security:
49
+ type: oauth2
50
+ flow: client_credentials
51
+
@@ -0,0 +1,40 @@
1
+ # THIS IS AN EXAMPLE, PLEASE USE THE SDK TO CREATE A NEW ACTION and DELETE
2
+ name: action_name
3
+ schema: action/1
4
+ title: ''
5
+ description: ''
6
+ inputs: # Use the SDK to autogenerate the inputs, can be 'object' or 'array' type.
7
+ type: object
8
+ properties: # the following are used for definition runner.
9
+ path_parameters: # remove if path parameters are not needed.
10
+ type: object
11
+ description: Path Parameters
12
+ properties:
13
+ required:
14
+ parameters:
15
+ type: object
16
+ description: URL Query Parameters
17
+ properties:
18
+ required:
19
+ json_body: # remove if no json_body is needed.
20
+ type: object
21
+ description: Body
22
+ properties:
23
+ required:
24
+ data_body: # remove if no data_body is needed.
25
+ type: object
26
+ description: Body
27
+ properties:
28
+ required:
29
+ headers: # remove if no custom headers are needed.
30
+ type: object
31
+ description: Body
32
+ properties:
33
+ required:
34
+ output: # use the SDK to autogenerate the output schema. This can be 'object' or 'array' type.
35
+ type: object
36
+ properties:
37
+ additionalProperties: true
38
+ meta:
39
+ endpoint: api/v3/turbine # full path to endpoint after host.
40
+ method: GET
@@ -0,0 +1,27 @@
1
+ # THIS IS AN EXAMPLE, PLEASE USE THE SDK TO CREATE A NEW ASSET and DELETE
2
+ schema: asset/1
3
+ name: asset
4
+ title: Virus Total API Key Authentication
5
+ description: ''
6
+ inputs:
7
+ type: object
8
+ properties:
9
+ url:
10
+ type: string
11
+ default: https://www.swimlane.com # add the default if cloud.
12
+ x-apikey:
13
+ type: string
14
+ verify_ssl:
15
+ type: boolean
16
+ http_proxy:
17
+ type: string
18
+ default: https://www.proxy.com
19
+ required:
20
+ - url
21
+ - x-apikey # example
22
+ meta:
23
+ asset_url_key: url
24
+ security: # example of header auth. All security objects must follow OpenAPI spec auth.
25
+ type: apiKey
26
+ name: x-apikey # example
27
+ in: header
@@ -0,0 +1,7 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project are documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## 1.0.0 - {{{timestamp}}}
7
+ * Initial Release