@prismatic-io/spectral
Advanced tools
Comparing version 2.0.0-beta.7 to 2.0.0-beta.8
@@ -14,10 +14,10 @@ "use strict"; | ||
exports.input = exports.action = exports.component = void 0; | ||
const convertAction = (action) => { | ||
const convertAction = (actionKey, action) => { | ||
const items = Object.entries(action.inputs); | ||
const inputDefinitions = items.map(([key, value]) => (Object.assign({ key }, (typeof value === "object" ? value : {})))); | ||
return Object.assign(Object.assign({}, action), { inputs: inputDefinitions, perform: action.perform, examplePayload: action.examplePayload }); | ||
return Object.assign(Object.assign({}, action), { key: actionKey, inputs: inputDefinitions, perform: action.perform, examplePayload: action.examplePayload }); | ||
}; | ||
exports.component = (definition) => (Object.assign(Object.assign({}, definition), { actions: Object.fromEntries(Object.entries(definition.actions).map(([actionKey, action]) => [ | ||
actionKey, | ||
convertAction(action), | ||
convertAction(actionKey, action), | ||
])) })); | ||
@@ -24,0 +24,0 @@ exports.action = (action) => action; |
import { PerformReturn, ActionDisplayDefinition, ActionPerformFunction, Inputs } from "."; | ||
/** Configuration of an Action. */ | ||
export interface ActionDefinition<T extends Inputs, AllowsBranching extends boolean, ReturnData extends PerformReturn<AllowsBranching, unknown>> { | ||
/** Key used for the Actions map and to uniquely identify this Component in your tenant. */ | ||
key: string; | ||
/** Defines how the Action is displayed in the Prismatic interface. */ | ||
@@ -7,0 +5,0 @@ display: ActionDisplayDefinition; |
{ | ||
"name": "@prismatic-io/spectral", | ||
"version": "2.0.0-beta.7", | ||
"version": "2.0.0-beta.8", | ||
"description": "Utility library for building Prismatic components", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -50,3 +50,4 @@ # @prismatic-io/spectral | ||
To build spectral locally, you'll need `yarn` and `node` installed. Run `yarn build` to build the package, or `yarn pack` to build a tarball that can be used in custom components for testing changes to spectral. | ||
To build spectral locally, you'll need `yarn` and `node` installed. | ||
Run `yarn build` to build the package, or `yarn pack` to build a tarball that can be used in custom components for testing changes to spectral. | ||
@@ -53,0 +54,0 @@ ## License |
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
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
56
59278
1129