@trayio/cdk-cli 4.38.0 → 4.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,7 +19,7 @@ $ npm install -g @trayio/cdk-cli
19
19
  $ tray-cdk COMMAND
20
20
  running command...
21
21
  $ tray-cdk (--version|-v)
22
- @trayio/cdk-cli/4.38.0 linux-x64 node-v18.20.4
22
+ @trayio/cdk-cli/4.39.0 linux-x64 node-v18.20.4
23
23
  $ tray-cdk --help [COMMAND]
24
24
  USAGE
25
25
  $ tray-cdk COMMAND
@@ -45,7 +45,7 @@ class AddOperation extends core_1.Command {
45
45
  message: 'Operation name',
46
46
  type: 'input',
47
47
  when: !args.operationName,
48
- default: 'my-operation',
48
+ default: 'my_operation',
49
49
  },
50
50
  {
51
51
  name: 'operationType',
@@ -60,8 +60,8 @@ class AddOperation extends core_1.Command {
60
60
  },
61
61
  ]);
62
62
  const operationName = args.operationName || promptRes.operationName;
63
- const operationNameKebabCase = (0, lodash_1.kebabCase)(operationName);
64
63
  const operationNamePascalCase = StringExtensions_1.StringExtensions.pascalCase(operationName);
64
+ const operationNameTitleCase = StringExtensions_1.StringExtensions.titleCase(operationName);
65
65
  const operationNameCamelCase = (0, lodash_1.camelCase)(operationName);
66
66
  const operationNameSnakeCase = (0, lodash_1.snakeCase)(operationName);
67
67
  const currentDirectory = process.cwd();
@@ -76,13 +76,13 @@ class AddOperation extends core_1.Command {
76
76
  ? currentDirectory
77
77
  : path_1.default.join(currentDirectory, 'src');
78
78
  await this.generator.generate(templatePath, targetPath, {
79
- operationNameKebabCase,
80
79
  operationNamePascalCase,
80
+ operationNameTitleCase,
81
81
  operationNameCamelCase,
82
82
  operationNameSnakeCase,
83
83
  connectorNamePascalCase,
84
84
  })();
85
- this.log((0, colorizeString_1.success)(`Success! Added operation: ${operationNameKebabCase}`));
85
+ this.log((0, colorizeString_1.success)(`Success! Added operation: ${operationNameSnakeCase}`));
86
86
  }
87
87
  }
88
88
  exports.default = AddOperation;
@@ -11,7 +11,7 @@ jest.mock('inquirer', () => ({
11
11
  registerPrompt: jest.requireActual('inquirer').registerPrompt,
12
12
  }));
13
13
  describe('AddOperation', () => {
14
- let operationName = 'my-operation';
14
+ let operationName = 'my_operation';
15
15
  let operationType = 'http';
16
16
  const mockInquirer = inquirer_1.default;
17
17
  beforeAll(() => {
@@ -36,14 +36,14 @@ describe('AddOperation', () => {
36
36
  stdout_stderr_1.stdout.start();
37
37
  await addOperation.run();
38
38
  stdout_stderr_1.stdout.stop();
39
- expect(stdout_stderr_1.stdout.output).toContain('Success! Added operation: my-operation');
39
+ expect(stdout_stderr_1.stdout.output).toContain('Success! Added operation: my_operation');
40
40
  expect(mockInquirer.prompt).toBeCalledWith([
41
41
  {
42
42
  name: 'operationName',
43
43
  message: 'Operation name',
44
44
  type: 'input',
45
45
  when: true,
46
- default: 'my-operation',
46
+ default: 'my_operation',
47
47
  },
48
48
  {
49
49
  name: 'operationType',
@@ -60,7 +60,7 @@ describe('AddOperation', () => {
60
60
  expect(mockGenerate).toBeCalledWith(expect.stringContaining('modules/cdk-cli/src/templates/http-operation-template.zip'), expect.stringContaining('/src'), {
61
61
  connectorNamePascalCase: 'TrayTypescriptSdk',
62
62
  operationNameCamelCase: 'myOperation',
63
- operationNameKebabCase: 'my-operation',
63
+ operationNameTitleCase: 'My operation',
64
64
  operationNamePascalCase: 'MyOperation',
65
65
  operationNameSnakeCase: 'my_operation',
66
66
  });
@@ -78,14 +78,14 @@ describe('AddOperation', () => {
78
78
  stdout_stderr_1.stdout.start();
79
79
  await addOperation.run();
80
80
  stdout_stderr_1.stdout.stop();
81
- expect(stdout_stderr_1.stdout.output).toContain('Success! Added operation: some-val');
81
+ expect(stdout_stderr_1.stdout.output).toContain('Success! Added operation: some_val');
82
82
  expect(mockInquirer.prompt).toBeCalledWith([
83
83
  {
84
84
  name: 'operationName',
85
85
  message: 'Operation name',
86
86
  type: 'input',
87
87
  when: false,
88
- default: 'my-operation',
88
+ default: 'my_operation',
89
89
  },
90
90
  {
91
91
  name: 'operationType',
@@ -102,7 +102,7 @@ describe('AddOperation', () => {
102
102
  expect(mockGenerate).toBeCalledWith(expect.stringContaining('modules/cdk-cli/src/templates/http-operation-template.zip'), expect.stringContaining('/src'), {
103
103
  connectorNamePascalCase: 'TrayTypescriptSdk',
104
104
  operationNameCamelCase: 'someVal',
105
- operationNameKebabCase: 'some-val',
105
+ operationNameTitleCase: 'Some val',
106
106
  operationNamePascalCase: 'SomeVal',
107
107
  operationNameSnakeCase: 'some_val',
108
108
  });
@@ -430,5 +430,5 @@
430
430
  ]
431
431
  }
432
432
  },
433
- "version": "4.38.0"
433
+ "version": "4.39.0"
434
434
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trayio/cdk-cli",
3
- "version": "4.38.0",
3
+ "version": "4.39.0",
4
4
  "description": "A CLI for connector development",
5
5
  "exports": {
6
6
  "./*": "./dist/*.js"
@@ -22,12 +22,12 @@
22
22
  "@oclif/plugin-version": "2.0.11",
23
23
  "@oclif/plugin-warn-if-update-available": "^3.1.4",
24
24
  "@oclif/test": "3.1.12",
25
- "@trayio/axios": "4.38.0",
26
- "@trayio/cdk-build": "4.38.0",
27
- "@trayio/commons": "4.38.0",
28
- "@trayio/generator": "4.38.0",
29
- "@trayio/tray-client": "4.38.0",
30
- "@trayio/tray-openapi": "4.38.0",
25
+ "@trayio/axios": "4.39.0",
26
+ "@trayio/cdk-build": "4.39.0",
27
+ "@trayio/commons": "4.39.0",
28
+ "@trayio/generator": "4.39.0",
29
+ "@trayio/tray-client": "4.39.0",
30
+ "@trayio/tray-openapi": "4.39.0",
31
31
  "chalk": "4.1.2",
32
32
  "inquirer": "8.2.6"
33
33
  },