@prismatic-io/spectral
Advanced tools
Comparing version 9.0.0-rc.8 to 9.0.0-rc.9
@@ -6,12 +6,12 @@ "use strict"; | ||
return inputs.reduce((acc, input) => { | ||
if (typeof input.type === "string") { | ||
if (typeof input.valueType === "string") { | ||
return acc; | ||
} | ||
return Object.assign(Object.assign({}, acc), { [input.type.module]: acc[input.type.module] | ||
? !acc[input.type.module].includes(input.type.type) | ||
? [...acc[input.type.module], input.type.type] | ||
: acc[input.type.module] | ||
: [input.type.type] }); | ||
return Object.assign(Object.assign({}, acc), { [input.valueType.module]: acc[input.valueType.module] | ||
? !acc[input.valueType.module].includes(input.valueType.type) | ||
? [...acc[input.valueType.module], input.valueType.type] | ||
: acc[input.valueType.module] | ||
: [input.valueType.type] }); | ||
}, {}); | ||
}; | ||
exports.getImports = getImports; |
@@ -9,3 +9,4 @@ import type { Input as InputBase } from "../../serverTypes"; | ||
label: string; | ||
type: InputType; | ||
inputType: string; | ||
valueType: ValueType; | ||
required: boolean | undefined; | ||
@@ -17,3 +18,3 @@ properties: { | ||
} | ||
export declare type InputType = string | { | ||
export declare type ValueType = string | { | ||
type: string; | ||
@@ -33,3 +34,3 @@ module: string; | ||
export declare const getInputs: ({ inputs, docBlock }: GetInputsProps) => Input[]; | ||
export declare const INPUT_TYPE_MAP: Record<InputFieldDefinition["type"], InputType>; | ||
export declare const INPUT_TYPE_MAP: Record<InputFieldDefinition["type"], ValueType>; | ||
export {}; |
@@ -9,7 +9,7 @@ "use strict"; | ||
label: input.label, | ||
type: getInputType(input), | ||
inputType: input.type, | ||
valueType: getInputValueType(input), | ||
required: input.required, | ||
collection: input.collection, | ||
inputType: input.type, | ||
onPremiseControlled: input.onPremiseControlled || input.onPremControlled, | ||
onPremControlled: input.onPremiseControlled || input.onPremControlled, | ||
properties: docBlock.reduce((acc, { propertyKey, inputKey, propertyValue, output }) => { | ||
@@ -81,3 +81,3 @@ if (inputKey && inputKey !== input.key) { | ||
}; | ||
const getInputType = (input) => { | ||
const getInputValueType = (input) => { | ||
const valueType = input.model | ||
@@ -87,3 +87,3 @@ ? input.model.map((choice) => `"${choice.value}"`).join(" | ") | ||
if (input.collection === "keyvaluelist") { | ||
return `Record<string, ${valueType}>`; | ||
return `Record<string, ${valueType}> | Array<{key: string, value: ${valueType}}>`; | ||
} | ||
@@ -90,0 +90,0 @@ if (input.collection === "valuelist") { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.removeComponentManifest = void 0; | ||
const fs_extra_1 = require("fs-extra"); | ||
const fs_1 = require("fs"); | ||
const removeComponentManifest = ({ destinationDir, verbose, }) => { | ||
@@ -10,3 +10,5 @@ if (verbose) { | ||
try { | ||
(0, fs_extra_1.removeSync)(destinationDir); | ||
if ((0, fs_1.existsSync)(destinationDir)) { | ||
(0, fs_1.rmSync)(destinationDir, { recursive: true, force: true }); | ||
} | ||
} | ||
@@ -13,0 +15,0 @@ catch (err) { |
@@ -391,2 +391,9 @@ "use strict"; | ||
const { collection } = action.inputs[inputKey]; | ||
if (collection === "keyvaluelist" && | ||
Array.isArray(inputValue)) { | ||
transformedAccumulator[inputKey] = inputValue.reduce((acc, { key, value }) => { | ||
return [...acc, { key, value }]; | ||
}, []); | ||
return transformedAccumulator; | ||
} | ||
// Transform key-value list inputs | ||
@@ -393,0 +400,0 @@ if (collection === "keyvaluelist" && |
{ | ||
"name": "@prismatic-io/spectral", | ||
"version": "9.0.0-rc.8", | ||
"version": "9.0.0-rc.9", | ||
"description": "Utility library for building Prismatic components", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
298177
6296