@trayio/cdk-cli 0.0.3 → 0.0.4-beta
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/INTRODUCTION.md +54 -0
- package/LICENSE.txt +22 -0
- package/README.md +150 -46
- package/bin/dev +0 -0
- package/dist/commands/add-operation.d.ts +11 -0
- package/dist/commands/add-operation.d.ts.map +1 -0
- package/dist/commands/add-operation.js +102 -0
- package/dist/commands/add-operation.unit.test.d.ts +2 -0
- package/dist/commands/add-operation.unit.test.d.ts.map +1 -0
- package/dist/commands/add-operation.unit.test.js +119 -0
- package/dist/commands/build.d.ts +8 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +34 -0
- package/dist/commands/deploy.d.ts +8 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +90 -0
- package/dist/commands/deployment-status.d.ts +12 -0
- package/dist/commands/deployment-status.d.ts.map +1 -0
- package/dist/commands/deployment-status.js +78 -0
- package/dist/commands/deployment-status.unit.test.d.ts +2 -0
- package/dist/commands/deployment-status.unit.test.d.ts.map +1 -0
- package/dist/commands/deployment-status.unit.test.js +82 -0
- package/dist/commands/import-openapi-spec-tst.d.ts +10 -0
- package/dist/commands/import-openapi-spec-tst.d.ts.map +1 -0
- package/dist/commands/import-openapi-spec-tst.js +101 -0
- package/dist/commands/import-openapi-spec.d.ts +10 -0
- package/dist/commands/import-openapi-spec.d.ts.map +1 -0
- package/dist/commands/import-openapi-spec.js +101 -0
- package/dist/commands/index.d.ts +2 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +5 -0
- package/dist/commands/init.d.ts +13 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +85 -0
- package/dist/commands/init.unit.test.d.ts +2 -0
- package/dist/commands/init.unit.test.d.ts.map +1 -0
- package/dist/commands/init.unit.test.js +127 -0
- package/dist/commands/test.d.ts +12 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/test.js +55 -0
- package/dist/templates/composite-operation-template.zip +0 -0
- package/dist/templates/connector-template.zip +0 -0
- package/dist/templates/http-operation-template.zip +0 -0
- package/dist/utils/check-env.d.ts +2 -0
- package/dist/utils/check-env.d.ts.map +1 -0
- package/dist/utils/check-env.js +35 -0
- package/dist/utils/check-env.unit.test.d.ts +2 -0
- package/dist/utils/check-env.unit.test.d.ts.map +1 -0
- package/dist/utils/check-env.unit.test.js +46 -0
- package/dist/utils/colorizeString.d.ts +5 -0
- package/dist/utils/colorizeString.d.ts.map +1 -0
- package/dist/utils/colorizeString.js +15 -0
- package/oclif.manifest.json +243 -16
- package/package.json +68 -53
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const stdout_stderr_1 = require("stdout-stderr");
|
|
16
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
17
|
+
const child_process_1 = require("child_process");
|
|
18
|
+
const init_1 = __importDefault(require("./init"));
|
|
19
|
+
jest.mock('inquirer', () => ({
|
|
20
|
+
prompt: jest.fn(),
|
|
21
|
+
registerPrompt: jest.requireActual('inquirer').registerPrompt,
|
|
22
|
+
}));
|
|
23
|
+
jest.mock('child_process', () => (Object.assign(Object.assign({}, jest.requireActual('child_process')), { execSync: jest.fn() })));
|
|
24
|
+
describe('Init', () => {
|
|
25
|
+
let connectorName = 'my-test-connector';
|
|
26
|
+
const mockInquirer = inquirer_1.default;
|
|
27
|
+
beforeAll(() => {
|
|
28
|
+
mockInquirer.prompt.mockResolvedValue({
|
|
29
|
+
shouldContinue: true,
|
|
30
|
+
connectorName,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
afterAll(() => {
|
|
34
|
+
jest.restoreAllMocks();
|
|
35
|
+
});
|
|
36
|
+
it('should prompt for connector name if not provided', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
const init = new init_1.default([], {});
|
|
38
|
+
const mockGenerate = jest
|
|
39
|
+
.fn()
|
|
40
|
+
.mockImplementation(() => jest.fn().mockResolvedValue(true));
|
|
41
|
+
init['generator'] = {
|
|
42
|
+
generate: mockGenerate,
|
|
43
|
+
};
|
|
44
|
+
stdout_stderr_1.stdout.start();
|
|
45
|
+
yield init.run();
|
|
46
|
+
stdout_stderr_1.stdout.stop();
|
|
47
|
+
expect(stdout_stderr_1.stdout.output).toContain('Success! Added my-test-connector');
|
|
48
|
+
expect(mockInquirer.prompt).toBeCalledWith([
|
|
49
|
+
{
|
|
50
|
+
name: 'connectorName',
|
|
51
|
+
message: 'Connector directory name to generate template files',
|
|
52
|
+
type: 'input',
|
|
53
|
+
when: true,
|
|
54
|
+
default: 'my-connector',
|
|
55
|
+
},
|
|
56
|
+
]);
|
|
57
|
+
expect(mockGenerate).toBeCalledWith(expect.stringContaining('modules/cdk-cli/src/templates/connector-template.zip'), process.cwd(), {
|
|
58
|
+
connectorNameCamelCase: 'myTestConnector',
|
|
59
|
+
connectorNameKebabCase: 'my-test-connector',
|
|
60
|
+
connectorNamePascalCase: 'MyTestConnector',
|
|
61
|
+
connectorNameTitleCase: 'My test connector',
|
|
62
|
+
});
|
|
63
|
+
expect(child_process_1.execSync).not.toBeCalled();
|
|
64
|
+
}));
|
|
65
|
+
it('should not prompt for connector name if provided', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
66
|
+
connectorName = 'my-new-connector';
|
|
67
|
+
const init = new init_1.default([connectorName], {});
|
|
68
|
+
const mockGenerate = jest
|
|
69
|
+
.fn()
|
|
70
|
+
.mockImplementation(() => jest.fn().mockResolvedValue(true));
|
|
71
|
+
init['generator'] = {
|
|
72
|
+
generate: mockGenerate,
|
|
73
|
+
};
|
|
74
|
+
stdout_stderr_1.stdout.start();
|
|
75
|
+
yield init.run();
|
|
76
|
+
stdout_stderr_1.stdout.stop();
|
|
77
|
+
expect(stdout_stderr_1.stdout.output).toContain('Success! Added my-new-connector');
|
|
78
|
+
expect(mockInquirer.prompt).toBeCalledWith([
|
|
79
|
+
{
|
|
80
|
+
name: 'connectorName',
|
|
81
|
+
message: 'Connector directory name to generate template files',
|
|
82
|
+
type: 'input',
|
|
83
|
+
when: false,
|
|
84
|
+
default: 'my-connector',
|
|
85
|
+
},
|
|
86
|
+
]);
|
|
87
|
+
expect(mockGenerate).toBeCalledWith(expect.stringContaining('modules/cdk-cli/src/templates/connector-template.zip'), process.cwd(), {
|
|
88
|
+
connectorNameCamelCase: 'myNewConnector',
|
|
89
|
+
connectorNameKebabCase: 'my-new-connector',
|
|
90
|
+
connectorNamePascalCase: 'MyNewConnector',
|
|
91
|
+
connectorNameTitleCase: 'My new connector',
|
|
92
|
+
});
|
|
93
|
+
expect(child_process_1.execSync).not.toBeCalled();
|
|
94
|
+
}));
|
|
95
|
+
it('should run npm install if "-i" install flag is passed', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
96
|
+
connectorName = 'my-install-connector';
|
|
97
|
+
const init = new init_1.default([connectorName, '-i'], {});
|
|
98
|
+
const mockGenerate = jest
|
|
99
|
+
.fn()
|
|
100
|
+
.mockImplementation(() => jest.fn().mockResolvedValue(true));
|
|
101
|
+
init['generator'] = {
|
|
102
|
+
generate: mockGenerate,
|
|
103
|
+
};
|
|
104
|
+
stdout_stderr_1.stdout.start();
|
|
105
|
+
yield init.run();
|
|
106
|
+
stdout_stderr_1.stdout.stop();
|
|
107
|
+
expect(stdout_stderr_1.stdout.output).toContain('Success! Added my-install-connector');
|
|
108
|
+
expect(mockInquirer.prompt).toBeCalledWith([
|
|
109
|
+
{
|
|
110
|
+
name: 'connectorName',
|
|
111
|
+
message: 'Connector directory name to generate template files',
|
|
112
|
+
type: 'input',
|
|
113
|
+
when: false,
|
|
114
|
+
default: 'my-connector',
|
|
115
|
+
},
|
|
116
|
+
]);
|
|
117
|
+
expect(mockGenerate).toBeCalledWith(expect.stringContaining('modules/cdk-cli/src/templates/connector-template.zip'), process.cwd(), {
|
|
118
|
+
connectorNameCamelCase: 'myInstallConnector',
|
|
119
|
+
connectorNameKebabCase: 'my-install-connector',
|
|
120
|
+
connectorNamePascalCase: 'MyInstallConnector',
|
|
121
|
+
connectorNameTitleCase: 'My install connector',
|
|
122
|
+
});
|
|
123
|
+
expect(child_process_1.execSync).toBeCalledWith(`cd ${connectorName} && npm install`, {
|
|
124
|
+
stdio: 'inherit',
|
|
125
|
+
});
|
|
126
|
+
}));
|
|
127
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class Test extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
operationName: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static flags: {
|
|
8
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/commands/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,aAAa,CAAC;AAMnD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACxC,MAAM,CAAC,WAAW,SAAsD;IAExE,MAAM,CAAC,IAAI;;MAMT;IAEF,MAAM,CAAC,KAAK;;MAMV;IAEI,GAAG;CAwBT"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const core_1 = require("@oclif/core");
|
|
16
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
17
|
+
const lodash_1 = require("lodash");
|
|
18
|
+
const child_process_1 = require("child_process");
|
|
19
|
+
class Test extends core_1.Command {
|
|
20
|
+
run() {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const { args, flags } = yield this.parse(Test);
|
|
23
|
+
const operationNameSnakeCase = (0, lodash_1.snakeCase)(args.operationName);
|
|
24
|
+
this.log(chalk_1.default.bold(chalk_1.default.gray('Running npm compile...')));
|
|
25
|
+
(0, child_process_1.execSync)('npm run compile', { stdio: 'inherit' });
|
|
26
|
+
if (operationNameSnakeCase) {
|
|
27
|
+
const verboseFlag = flags.verbose ? '-- --verbose=true' : '';
|
|
28
|
+
this.log(chalk_1.default.bold(chalk_1.default.gray(`Running test for ${operationNameSnakeCase}...`)));
|
|
29
|
+
(0, child_process_1.execSync)(`npm run test ./src/${operationNameSnakeCase}/handler.test.ts ${verboseFlag}`, {
|
|
30
|
+
stdio: 'inherit',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.log(chalk_1.default.bold(chalk_1.default.gray('Running npm test...')));
|
|
35
|
+
(0, child_process_1.execSync)('npm run test', { stdio: 'inherit' });
|
|
36
|
+
}
|
|
37
|
+
this.log(chalk_1.default.bold(chalk_1.default.green('Tests ran successfully')));
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
Test.description = 'Build and test connector project or an operation';
|
|
42
|
+
Test.args = {
|
|
43
|
+
operationName: core_1.Args.string({
|
|
44
|
+
name: 'Operation name',
|
|
45
|
+
required: false,
|
|
46
|
+
description: 'Operation name to run the test against',
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
Test.flags = {
|
|
50
|
+
verbose: core_1.Flags.boolean({
|
|
51
|
+
char: 'v',
|
|
52
|
+
description: 'Logs the input and output of an operation, requires operation name argument to be specified',
|
|
53
|
+
}),
|
|
54
|
+
};
|
|
55
|
+
exports.default = Test;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-env.d.ts","sourceRoot":"","sources":["../../src/utils/check-env.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,YAIpB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkEnv = void 0;
|
|
4
|
+
const checkEnv = () => {
|
|
5
|
+
checkMissingEnv();
|
|
6
|
+
isApiUrlValid();
|
|
7
|
+
isValidApiToken();
|
|
8
|
+
};
|
|
9
|
+
exports.checkEnv = checkEnv;
|
|
10
|
+
const checkMissingEnv = () => {
|
|
11
|
+
if (!process.env.TRAY_API_URL) {
|
|
12
|
+
throw new Error('required env TRAY_API_URL is not set');
|
|
13
|
+
}
|
|
14
|
+
if (!process.env.TRAY_API_TOKEN) {
|
|
15
|
+
throw new Error('required env TRAY_API_TOKEN is not set');
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const isApiUrlValid = () => {
|
|
19
|
+
const apiUrl = process.env.TRAY_API_URL;
|
|
20
|
+
const validApiUrlRegex = /^https:\/\/api\.(?:ap1\.|eu1\.|staging\.)?tray\.io$/;
|
|
21
|
+
if (!validApiUrlRegex.test(apiUrl)) {
|
|
22
|
+
throw new Error(`TRAY_API_URL is invalid. It should be one of the following: https://api.tray.io, https://api.ap1.tray.io, https://api.eu1.tray.io`);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const isValidApiToken = () => {
|
|
26
|
+
let apiToken = process.env.TRAY_API_TOKEN;
|
|
27
|
+
if (apiToken.includes('Bearer ') || apiToken.includes('bearer ')) {
|
|
28
|
+
apiToken = apiToken.replace(/Bearer |bearer /, '');
|
|
29
|
+
process.env.TRAY_API_TOKEN = apiToken;
|
|
30
|
+
}
|
|
31
|
+
const validApiTokenRegex = /^.{36,}$/; // Token length is atleast 36 characters
|
|
32
|
+
if (!validApiTokenRegex.test(apiToken)) {
|
|
33
|
+
throw new Error(`TRAY_API_TOKEN is in a invalid format.`);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-env.unit.test.d.ts","sourceRoot":"","sources":["../../src/utils/check-env.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const check_env_1 = require("./check-env");
|
|
4
|
+
describe('checkEnv', () => {
|
|
5
|
+
const subject = check_env_1.checkEnv;
|
|
6
|
+
const { env } = process;
|
|
7
|
+
afterEach(() => {
|
|
8
|
+
process.env = env;
|
|
9
|
+
});
|
|
10
|
+
it('should throw an error if TRAY_API_URL is not set', () => {
|
|
11
|
+
expect(() => subject()).toThrowError('required env TRAY_API_URL is not set');
|
|
12
|
+
});
|
|
13
|
+
it('should throw an error if TRAY_API_TOKEN is not set', () => {
|
|
14
|
+
process.env = { TRAY_API_URL: 'https://api.tray.io' };
|
|
15
|
+
expect(() => subject()).toThrowError('required env TRAY_API_TOKEN is not set');
|
|
16
|
+
});
|
|
17
|
+
it('should throw an error if TRAY_API_URL is invalid', () => {
|
|
18
|
+
process.env = {
|
|
19
|
+
TRAY_API_URL: 'https://api.tray.io/invalid',
|
|
20
|
+
TRAY_API_TOKEN: 'random',
|
|
21
|
+
};
|
|
22
|
+
expect(() => subject()).toThrowError('TRAY_API_URL is invalid. It should be one of the following: https://api.tray.io, https://api.ap1.tray.io, https://api.eu1.tray.io');
|
|
23
|
+
});
|
|
24
|
+
it('should remove bearer prefix if TRAY_API_TOKEN contains Bearer prefix', () => {
|
|
25
|
+
process.env = {
|
|
26
|
+
TRAY_API_URL: 'https://api.tray.io',
|
|
27
|
+
TRAY_API_TOKEN: 'Bearer 1234567890123456789012345678901234567890123456789012345678901234',
|
|
28
|
+
};
|
|
29
|
+
subject();
|
|
30
|
+
expect(process.env.TRAY_API_TOKEN).toEqual('1234567890123456789012345678901234567890123456789012345678901234');
|
|
31
|
+
});
|
|
32
|
+
it('should throw an error if TRAY_API_TOKEN is in an invalid format', () => {
|
|
33
|
+
process.env = {
|
|
34
|
+
TRAY_API_URL: 'https://api.tray.io',
|
|
35
|
+
TRAY_API_TOKEN: '123',
|
|
36
|
+
};
|
|
37
|
+
expect(() => subject()).toThrowError('TRAY_API_TOKEN is in a invalid format.');
|
|
38
|
+
});
|
|
39
|
+
it('should not throw an error if TRAY_API_URL and TRAY_API_TOKEN are valid', () => {
|
|
40
|
+
process.env = {
|
|
41
|
+
TRAY_API_URL: 'https://api.tray.io',
|
|
42
|
+
TRAY_API_TOKEN: '1234567890123456789012345678901234567890123456789012345678901234',
|
|
43
|
+
};
|
|
44
|
+
expect(() => subject()).not.toThrowError();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const success: (message: string) => string;
|
|
2
|
+
export declare const error: (message: string) => string;
|
|
3
|
+
export declare const warning: (message: string) => string;
|
|
4
|
+
export declare const info: (message: string) => string;
|
|
5
|
+
//# sourceMappingURL=colorizeString.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorizeString.d.ts","sourceRoot":"","sources":["../../src/utils/colorizeString.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,YAAa,MAAM,WAAqC,CAAC;AAE7E,eAAO,MAAM,KAAK,YAAa,MAAM,WAAmC,CAAC;AAEzE,eAAO,MAAM,OAAO,YAAa,MAAM,WAAsC,CAAC;AAE9E,eAAO,MAAM,IAAI,YAAa,MAAM,WAAoC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.info = exports.warning = exports.error = exports.success = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const success = (message) => chalk_1.default.bold(chalk_1.default.green(message));
|
|
9
|
+
exports.success = success;
|
|
10
|
+
const error = (message) => chalk_1.default.bold(chalk_1.default.red(message));
|
|
11
|
+
exports.error = error;
|
|
12
|
+
const warning = (message) => chalk_1.default.bold(chalk_1.default.yellow(message));
|
|
13
|
+
exports.warning = warning;
|
|
14
|
+
const info = (message) => chalk_1.default.bold(chalk_1.default.blue(message));
|
|
15
|
+
exports.info = info;
|
package/oclif.manifest.json
CHANGED
|
@@ -1,36 +1,263 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.3",
|
|
3
2
|
"commands": {
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"add-operation": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {
|
|
6
|
+
"operationName": {
|
|
7
|
+
"description": "Operation name",
|
|
8
|
+
"name": "operationName",
|
|
9
|
+
"required": false
|
|
10
|
+
},
|
|
11
|
+
"operationType": {
|
|
12
|
+
"description": "Operation type",
|
|
13
|
+
"name": "operationType",
|
|
14
|
+
"options": [
|
|
15
|
+
"http",
|
|
16
|
+
"composite"
|
|
17
|
+
],
|
|
18
|
+
"required": false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"description": "Add an operation to connector project",
|
|
22
|
+
"flags": {},
|
|
23
|
+
"hasDynamicHelp": false,
|
|
24
|
+
"hiddenAliases": [],
|
|
25
|
+
"id": "add-operation",
|
|
7
26
|
"pluginAlias": "@trayio/cdk-cli",
|
|
27
|
+
"pluginName": "@trayio/cdk-cli",
|
|
8
28
|
"pluginType": "core",
|
|
29
|
+
"strict": true,
|
|
30
|
+
"enableJsonFlag": false,
|
|
31
|
+
"isESM": false,
|
|
32
|
+
"relativePath": [
|
|
33
|
+
"dist",
|
|
34
|
+
"commands",
|
|
35
|
+
"add-operation.js"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"build": {
|
|
9
39
|
"aliases": [],
|
|
40
|
+
"args": {},
|
|
41
|
+
"description": "Builds a connector project",
|
|
10
42
|
"flags": {},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
43
|
+
"hasDynamicHelp": false,
|
|
44
|
+
"hiddenAliases": [],
|
|
45
|
+
"id": "build",
|
|
46
|
+
"pluginAlias": "@trayio/cdk-cli",
|
|
47
|
+
"pluginName": "@trayio/cdk-cli",
|
|
48
|
+
"pluginType": "core",
|
|
16
49
|
"strict": true,
|
|
50
|
+
"enableJsonFlag": false,
|
|
51
|
+
"isESM": false,
|
|
52
|
+
"relativePath": [
|
|
53
|
+
"dist",
|
|
54
|
+
"commands",
|
|
55
|
+
"build.js"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"deploy": {
|
|
59
|
+
"aliases": [],
|
|
60
|
+
"args": {},
|
|
61
|
+
"description": "Deploys a connector project",
|
|
62
|
+
"flags": {},
|
|
63
|
+
"hasDynamicHelp": false,
|
|
64
|
+
"hiddenAliases": [],
|
|
65
|
+
"id": "deploy",
|
|
66
|
+
"pluginAlias": "@trayio/cdk-cli",
|
|
17
67
|
"pluginName": "@trayio/cdk-cli",
|
|
68
|
+
"pluginType": "core",
|
|
69
|
+
"strict": true,
|
|
70
|
+
"enableJsonFlag": false,
|
|
71
|
+
"isESM": false,
|
|
72
|
+
"relativePath": [
|
|
73
|
+
"dist",
|
|
74
|
+
"commands",
|
|
75
|
+
"deploy.js"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"deployment-status": {
|
|
79
|
+
"aliases": [],
|
|
80
|
+
"args": {
|
|
81
|
+
"connectorName": {
|
|
82
|
+
"description": "The name of the connector",
|
|
83
|
+
"name": "connectorName",
|
|
84
|
+
"required": true
|
|
85
|
+
},
|
|
86
|
+
"connectorVersion": {
|
|
87
|
+
"description": "The version of the connector",
|
|
88
|
+
"name": "connectorVersion",
|
|
89
|
+
"required": true
|
|
90
|
+
},
|
|
91
|
+
"uuid": {
|
|
92
|
+
"description": "The UUID of the deployment, this is included in the tray-cdk deploy output",
|
|
93
|
+
"name": "uuid",
|
|
94
|
+
"required": true
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"description": "Retrieves the status of a connector deployment",
|
|
98
|
+
"flags": {},
|
|
99
|
+
"hasDynamicHelp": false,
|
|
100
|
+
"hiddenAliases": [],
|
|
101
|
+
"id": "deployment-status",
|
|
18
102
|
"pluginAlias": "@trayio/cdk-cli",
|
|
103
|
+
"pluginName": "@trayio/cdk-cli",
|
|
19
104
|
"pluginType": "core",
|
|
105
|
+
"strict": true,
|
|
106
|
+
"enableJsonFlag": false,
|
|
107
|
+
"isESM": false,
|
|
108
|
+
"relativePath": [
|
|
109
|
+
"dist",
|
|
110
|
+
"commands",
|
|
111
|
+
"deployment-status.js"
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"import-openapi-spec-tst": {
|
|
20
115
|
"aliases": [],
|
|
116
|
+
"args": {
|
|
117
|
+
"openApiSpec": {
|
|
118
|
+
"description": "Location of the OpenAPI specification file",
|
|
119
|
+
"name": "openApiSpec",
|
|
120
|
+
"required": false
|
|
121
|
+
},
|
|
122
|
+
"connectorName": {
|
|
123
|
+
"description": "The name of the connector",
|
|
124
|
+
"name": "connectorName",
|
|
125
|
+
"required": false
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"description": "Create a connector from an OpenAPI specification: Command is still in BETA",
|
|
21
129
|
"flags": {},
|
|
22
|
-
"
|
|
130
|
+
"hasDynamicHelp": false,
|
|
131
|
+
"hiddenAliases": [],
|
|
132
|
+
"id": "import-openapi-spec-tst",
|
|
133
|
+
"pluginAlias": "@trayio/cdk-cli",
|
|
134
|
+
"pluginName": "@trayio/cdk-cli",
|
|
135
|
+
"pluginType": "core",
|
|
136
|
+
"strict": true,
|
|
137
|
+
"enableJsonFlag": false,
|
|
138
|
+
"isESM": false,
|
|
139
|
+
"relativePath": [
|
|
140
|
+
"dist",
|
|
141
|
+
"commands",
|
|
142
|
+
"import-openapi-spec-tst.js"
|
|
143
|
+
]
|
|
23
144
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
145
|
+
"import-openapi-spec": {
|
|
146
|
+
"aliases": [],
|
|
147
|
+
"args": {
|
|
148
|
+
"openApiSpec": {
|
|
149
|
+
"description": "Location of the OpenAPI specification file",
|
|
150
|
+
"name": "openApiSpec",
|
|
151
|
+
"required": false
|
|
152
|
+
},
|
|
153
|
+
"connectorName": {
|
|
154
|
+
"description": "The name of the connector",
|
|
155
|
+
"name": "connectorName",
|
|
156
|
+
"required": false
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"description": "Create a connector from an OpenAPI specification: Command is still in BETA",
|
|
160
|
+
"flags": {},
|
|
161
|
+
"hasDynamicHelp": false,
|
|
162
|
+
"hiddenAliases": [],
|
|
163
|
+
"id": "import-openapi-spec",
|
|
164
|
+
"pluginAlias": "@trayio/cdk-cli",
|
|
165
|
+
"pluginName": "@trayio/cdk-cli",
|
|
166
|
+
"pluginType": "core",
|
|
27
167
|
"strict": true,
|
|
168
|
+
"enableJsonFlag": false,
|
|
169
|
+
"isESM": false,
|
|
170
|
+
"relativePath": [
|
|
171
|
+
"dist",
|
|
172
|
+
"commands",
|
|
173
|
+
"import-openapi-spec.js"
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
".": {
|
|
177
|
+
"aliases": [],
|
|
178
|
+
"args": {},
|
|
179
|
+
"flags": {},
|
|
180
|
+
"hasDynamicHelp": false,
|
|
181
|
+
"hiddenAliases": [],
|
|
182
|
+
"id": ".",
|
|
183
|
+
"pluginAlias": "@trayio/cdk-cli",
|
|
28
184
|
"pluginName": "@trayio/cdk-cli",
|
|
185
|
+
"pluginType": "core",
|
|
186
|
+
"isESM": false,
|
|
187
|
+
"relativePath": [
|
|
188
|
+
"dist",
|
|
189
|
+
"commands",
|
|
190
|
+
"index.js"
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
"init": {
|
|
194
|
+
"aliases": [],
|
|
195
|
+
"args": {
|
|
196
|
+
"connectorName": {
|
|
197
|
+
"description": "Connector directory name to generate template files",
|
|
198
|
+
"name": "connectorName",
|
|
199
|
+
"required": false
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"description": "Initialize a connector project",
|
|
203
|
+
"flags": {
|
|
204
|
+
"install": {
|
|
205
|
+
"char": "i",
|
|
206
|
+
"description": "Runs `npm install` after successful generation",
|
|
207
|
+
"name": "install",
|
|
208
|
+
"allowNo": false,
|
|
209
|
+
"type": "boolean"
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"hasDynamicHelp": false,
|
|
213
|
+
"hiddenAliases": [],
|
|
214
|
+
"id": "init",
|
|
29
215
|
"pluginAlias": "@trayio/cdk-cli",
|
|
216
|
+
"pluginName": "@trayio/cdk-cli",
|
|
30
217
|
"pluginType": "core",
|
|
218
|
+
"strict": true,
|
|
219
|
+
"enableJsonFlag": false,
|
|
220
|
+
"isESM": false,
|
|
221
|
+
"relativePath": [
|
|
222
|
+
"dist",
|
|
223
|
+
"commands",
|
|
224
|
+
"init.js"
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
"test": {
|
|
31
228
|
"aliases": [],
|
|
32
|
-
"
|
|
33
|
-
|
|
229
|
+
"args": {
|
|
230
|
+
"operationName": {
|
|
231
|
+
"description": "Operation name to run the test against",
|
|
232
|
+
"name": "operationName",
|
|
233
|
+
"required": false
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"description": "Build and test connector project or an operation",
|
|
237
|
+
"flags": {
|
|
238
|
+
"verbose": {
|
|
239
|
+
"char": "v",
|
|
240
|
+
"description": "Logs the input and output of an operation, requires operation name argument to be specified",
|
|
241
|
+
"name": "verbose",
|
|
242
|
+
"allowNo": false,
|
|
243
|
+
"type": "boolean"
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"hasDynamicHelp": false,
|
|
247
|
+
"hiddenAliases": [],
|
|
248
|
+
"id": "test",
|
|
249
|
+
"pluginAlias": "@trayio/cdk-cli",
|
|
250
|
+
"pluginName": "@trayio/cdk-cli",
|
|
251
|
+
"pluginType": "core",
|
|
252
|
+
"strict": true,
|
|
253
|
+
"enableJsonFlag": false,
|
|
254
|
+
"isESM": false,
|
|
255
|
+
"relativePath": [
|
|
256
|
+
"dist",
|
|
257
|
+
"commands",
|
|
258
|
+
"test.js"
|
|
259
|
+
]
|
|
34
260
|
}
|
|
35
|
-
}
|
|
261
|
+
},
|
|
262
|
+
"version": "0.0.4-beta"
|
|
36
263
|
}
|