@prismatic-io/spectral 10.6.3 → 10.6.4

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.
@@ -4,4 +4,5 @@ export declare const helpers: {
4
4
  generatePackageJsonVersion: () => string;
5
5
  formatType: (key: string) => string;
6
6
  camelCase: (string?: string) => string;
7
+ camelizeLowercaseType: (type: string) => string;
7
8
  };
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.helpers = void 0;
7
+ const camelizeLowercaseType_1 = require("../utils/camelizeLowercaseType");
7
8
  const capitalizeFirstLetter_1 = require("../utils/capitalizeFirstLetter");
8
9
  const createDependencyImports_1 = require("../utils/createDependencyImports");
9
10
  const formatType_1 = require("../utils/formatType");
@@ -15,4 +16,5 @@ exports.helpers = {
15
16
  generatePackageJsonVersion: generatePackageJsonVersion_1.generatePackageJsonVersion,
16
17
  formatType: formatType_1.formatType,
17
18
  camelCase: camelCase_1.default,
19
+ camelizeLowercaseType: camelizeLowercaseType_1.camelizeLowercaseType,
18
20
  };
@@ -17,7 +17,7 @@ export const <%= action.import %> = {
17
17
  values: <%= action.typeInterface %>Values
18
18
  ): Promise<TReturn> => {
19
19
  const context = requireContext();
20
- return await context.components.<%= action.componentKey %>.<%= action.key %>({ ...values }) as TReturn;
20
+ return await context.components.<%= helpers.camelCase(action.componentKey) %>.<%= action.key %>({ ...values }) as TReturn;
21
21
  },
22
22
  inputs: {
23
23
  <%- include('../partials/inputs.ejs', { inputs: action.inputs, helpers }) -%>
@@ -29,7 +29,7 @@ export const <%= connection.import %> = {
29
29
  *
30
30
  * @comments Helper for direct usage in config wizard definitions.
31
31
  */
32
- export const <%= connection.componentKey %><%= helpers.capitalizeFirstLetter(helpers.camelCase(connection.key)) %> = (
32
+ export const <%= helpers.camelCase(connection.componentKey) %><%= helpers.capitalizeFirstLetter(helpers.camelCase(connection.key)) %> = (
33
33
  stableKey: string,
34
34
  values: {
35
35
  <% connection.inputs.forEach((input) => { -%>
@@ -16,7 +16,7 @@ export const <%= dataSource.import %> = {
16
16
  perform: (
17
17
  _values: <%= dataSource.typeInterface %>Values
18
18
  ): Promise<void> => Promise.resolve(),
19
- dataSourceType: "<%= dataSource.dataSourceType %>",
19
+ dataSourceType: "<%= helpers.camelizeLowercaseType(dataSource.dataSourceType) %>",
20
20
  inputs: {
21
21
  <%- include('../partials/inputs.ejs', { inputs: dataSource.inputs, helpers }) -%>
22
22
  }
@@ -27,7 +27,7 @@ export const <%= dataSource.import %> = {
27
27
  *
28
28
  * @comments Helper for direct usage in config wizard definitions.
29
29
  */
30
- export const <%= dataSource.componentKey %><%= helpers.capitalizeFirstLetter(helpers.camelCase(dataSource.key)) %> = (
30
+ export const <%= helpers.camelCase(dataSource.componentKey) %><%= helpers.capitalizeFirstLetter(helpers.camelCase(dataSource.key)) %> = (
31
31
  stableKey: string,
32
32
  values: {
33
33
  <% dataSource.inputs.forEach((input) => { -%>
@@ -1,6 +1,6 @@
1
1
  <% inputs.forEach((input) => { -%>
2
2
  <%- helpers.formatType(input.key) %>: {
3
- inputType: "<%= input.inputType %>",
3
+ inputType: "<%= helpers.camelizeLowercaseType(input.inputType) %>",
4
4
  <%_ if (input.collection) { -%>
5
5
  collection: "<%= input.collection %>",
6
6
  <%_ } else { -%>
@@ -0,0 +1 @@
1
+ export declare const camelizeLowercaseType: (type: string) => string;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.camelizeLowercaseType = void 0;
4
+ const LOWER_TO_CAMEL_MAP = {
5
+ objectfieldmap: "objectFieldMap",
6
+ objectselection: "objectSelection",
7
+ dynamicfieldselection: "dynamicFieldSelection",
8
+ dynamicobjectselection: "dynamicObjectSelection",
9
+ jsonform: "jsonForm",
10
+ };
11
+ const camelizeLowercaseType = (type) => {
12
+ var _a;
13
+ return (_a = LOWER_TO_CAMEL_MAP[type]) !== null && _a !== void 0 ? _a : type;
14
+ };
15
+ exports.camelizeLowercaseType = camelizeLowercaseType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "10.6.3",
3
+ "version": "10.6.4",
4
4
  "description": "Utility library for building Prismatic connectors and code-native integrations",
5
5
  "keywords": ["prismatic"],
6
6
  "main": "dist/index.js",