@prismatic-io/spectral 9.0.0-rc.7 → 9.0.0-rc.9
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/dist/generators/componentManifest/cli.js +20 -20
- package/dist/generators/componentManifest/createActions.d.ts +1 -1
- package/dist/generators/componentManifest/createActions.js +14 -6
- package/dist/generators/componentManifest/createConnections.d.ts +1 -1
- package/dist/generators/componentManifest/createConnections.js +26 -6
- package/dist/generators/componentManifest/createDataSources.d.ts +1 -1
- package/dist/generators/componentManifest/createDataSources.js +14 -6
- package/dist/generators/componentManifest/createStaticFiles.d.ts +1 -1
- package/dist/generators/componentManifest/createTriggers.d.ts +1 -1
- package/dist/generators/componentManifest/createTriggers.js +14 -6
- package/dist/generators/componentManifest/getImports.d.ts +1 -1
- package/dist/generators/componentManifest/getImports.js +6 -6
- package/dist/generators/componentManifest/getInputs.d.ts +17 -7
- package/dist/generators/componentManifest/getInputs.js +30 -14
- package/dist/generators/componentManifest/index.d.ts +2 -2
- package/dist/generators/componentManifest/removeComponentManifest.js +4 -2
- package/dist/generators/componentManifest/templates/connections/connection.ts.ejs +3 -0
- package/dist/generators/componentManifest/templates/partials/inputs.ejs +4 -3
- package/dist/generators/componentManifest/templates/partials/performArgs.ejs +1 -1
- package/dist/generators/utils/createDependencyImports.d.ts +1 -1
- package/dist/serverTypes/convertIntegration.js +13 -5
- package/package.json +1 -1
|
@@ -26,26 +26,7 @@ const runMain = (process) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
26
26
|
var _a, _b;
|
|
27
27
|
const componentDir = process.cwd();
|
|
28
28
|
const componentDistDir = path_1.default.join(componentDir, "dist", "index.js");
|
|
29
|
-
|
|
30
|
-
console.error("Please run this script using npm or yarn.");
|
|
31
|
-
process.exit(1);
|
|
32
|
-
}
|
|
33
|
-
if (!(0, fs_extra_1.existsSync)(componentDistDir)) {
|
|
34
|
-
console.error("Component build directory `dist` does not exist. Please verify that the component has been built.");
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
37
|
-
const component = require(componentDistDir).default;
|
|
38
|
-
if (!component ||
|
|
39
|
-
!(0, util_1.isObjectWithTruthyKeys)(component, ["key", "display"]) ||
|
|
40
|
-
!(0, util_1.isObjectWithOneTruthyKey)(component, [
|
|
41
|
-
"actions",
|
|
42
|
-
"connections",
|
|
43
|
-
"dataSources",
|
|
44
|
-
])) {
|
|
45
|
-
console.error("Component is invalid.");
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
const args = process.argv.slice(3);
|
|
29
|
+
const args = process.argv.slice(2);
|
|
49
30
|
const flags = {
|
|
50
31
|
name: {
|
|
51
32
|
flag: ["--name", "-n"],
|
|
@@ -111,6 +92,25 @@ const runMain = (process) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
111
92
|
});
|
|
112
93
|
process.exit(0);
|
|
113
94
|
}
|
|
95
|
+
if (!componentDir) {
|
|
96
|
+
console.error("Please run this script using npm or yarn.");
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
if (!(0, fs_extra_1.existsSync)(componentDistDir)) {
|
|
100
|
+
console.error("Component build directory `dist` does not exist. Please verify that the component has been built.");
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
const component = require(componentDistDir).default;
|
|
104
|
+
if (!component ||
|
|
105
|
+
!(0, util_1.isObjectWithTruthyKeys)(component, ["key", "display"]) ||
|
|
106
|
+
!(0, util_1.isObjectWithOneTruthyKey)(component, [
|
|
107
|
+
"actions",
|
|
108
|
+
"connections",
|
|
109
|
+
"dataSources",
|
|
110
|
+
])) {
|
|
111
|
+
console.error("Component is invalid.");
|
|
112
|
+
process.exit(1);
|
|
113
|
+
}
|
|
114
114
|
const packageJson = (0, fs_extra_1.readJsonSync)(path_1.default.join(__dirname, "../../../package.json"));
|
|
115
115
|
yield (0, index_1.createComponentManifest)({
|
|
116
116
|
component,
|
|
@@ -18,11 +18,19 @@ const getInputs_1 = require("./getInputs");
|
|
|
18
18
|
const getImports_1 = require("./getImports");
|
|
19
19
|
const helpers_1 = require("./helpers");
|
|
20
20
|
const createTemplate_1 = require("../utils/createTemplate");
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const DOC_BLOCK = [
|
|
22
|
+
{
|
|
23
|
+
propertyKey: "comments",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
propertyKey: "default",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
propertyKey: "example",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
propertyKey: "placeholder",
|
|
33
|
+
},
|
|
26
34
|
];
|
|
27
35
|
const createActions = ({ component, dryRun, verbose, sourceDir, destinationDir, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
36
|
var _a, _b;
|
|
@@ -43,7 +51,7 @@ const createActions = ({ component, dryRun, verbose, sourceDir, destinationDir,
|
|
|
43
51
|
const actions = yield Promise.all(Object.entries((_b = component.actions) !== null && _b !== void 0 ? _b : {}).map(([actionKey, action]) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
52
|
const inputs = (0, getInputs_1.getInputs)({
|
|
45
53
|
inputs: action.inputs,
|
|
46
|
-
|
|
54
|
+
docBlock: DOC_BLOCK,
|
|
47
55
|
});
|
|
48
56
|
const imports = (0, getImports_1.getImports)({ inputs });
|
|
49
57
|
return yield renderAction({
|
|
@@ -18,11 +18,29 @@ const getInputs_1 = require("./getInputs");
|
|
|
18
18
|
const getImports_1 = require("./getImports");
|
|
19
19
|
const helpers_1 = require("./helpers");
|
|
20
20
|
const createTemplate_1 = require("../utils/createTemplate");
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const DOC_BLOCK = [
|
|
22
|
+
{
|
|
23
|
+
propertyKey: "comments",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
propertyKey: "default",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
propertyKey: "example",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
propertyKey: "placeholder",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
propertyKey: "onPremControlled",
|
|
36
|
+
propertyValue: true,
|
|
37
|
+
output: "This input will be supplied when using an on prem resource.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
propertyKey: "onPremiseControlled",
|
|
41
|
+
propertyValue: true,
|
|
42
|
+
output: "This input will be supplied when using an on prem resource.",
|
|
43
|
+
},
|
|
26
44
|
];
|
|
27
45
|
const createConnections = ({ component, dryRun, verbose, sourceDir, destinationDir, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
46
|
var _a, _b;
|
|
@@ -43,15 +61,17 @@ const createConnections = ({ component, dryRun, verbose, sourceDir, destinationD
|
|
|
43
61
|
const connections = yield Promise.all(((_b = component.connections) !== null && _b !== void 0 ? _b : []).map((connection) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
62
|
const inputs = (0, getInputs_1.getInputs)({
|
|
45
63
|
inputs: connection.inputs,
|
|
46
|
-
|
|
64
|
+
docBlock: DOC_BLOCK,
|
|
47
65
|
});
|
|
48
66
|
const imports = (0, getImports_1.getImports)({ inputs });
|
|
67
|
+
const onPremAvailable = connection.inputs.some((input) => input.onPremControlled || input.onPremiseControlled);
|
|
49
68
|
return yield renderConnection({
|
|
50
69
|
connection: {
|
|
51
70
|
key: connection.key,
|
|
52
71
|
label: connection.label,
|
|
53
72
|
comments: connection.comments,
|
|
54
73
|
inputs,
|
|
74
|
+
onPremAvailable,
|
|
55
75
|
},
|
|
56
76
|
imports,
|
|
57
77
|
dryRun,
|
|
@@ -18,11 +18,19 @@ const getInputs_1 = require("./getInputs");
|
|
|
18
18
|
const getImports_1 = require("./getImports");
|
|
19
19
|
const helpers_1 = require("./helpers");
|
|
20
20
|
const createTemplate_1 = require("../utils/createTemplate");
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const DOC_BLOCK = [
|
|
22
|
+
{
|
|
23
|
+
propertyKey: "comments",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
propertyKey: "default",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
propertyKey: "example",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
propertyKey: "placeholder",
|
|
33
|
+
},
|
|
26
34
|
];
|
|
27
35
|
const createDataSources = ({ component, dryRun, verbose, sourceDir, destinationDir, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
36
|
var _a, _b;
|
|
@@ -43,7 +51,7 @@ const createDataSources = ({ component, dryRun, verbose, sourceDir, destinationD
|
|
|
43
51
|
const dataSources = yield Promise.all(Object.entries((_b = component.dataSources) !== null && _b !== void 0 ? _b : {}).map(([dataSourceKey, dataSource]) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
52
|
const inputs = (0, getInputs_1.getInputs)({
|
|
45
53
|
inputs: dataSource.inputs,
|
|
46
|
-
|
|
54
|
+
docBlock: DOC_BLOCK,
|
|
47
55
|
});
|
|
48
56
|
const imports = (0, getImports_1.getImports)({ inputs });
|
|
49
57
|
return yield renderDataSource({
|
|
@@ -18,11 +18,19 @@ const getInputs_1 = require("./getInputs");
|
|
|
18
18
|
const getImports_1 = require("./getImports");
|
|
19
19
|
const helpers_1 = require("./helpers");
|
|
20
20
|
const createTemplate_1 = require("../utils/createTemplate");
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const DOC_BLOCK = [
|
|
22
|
+
{
|
|
23
|
+
propertyKey: "comments",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
propertyKey: "default",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
propertyKey: "example",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
propertyKey: "placeholder",
|
|
33
|
+
},
|
|
26
34
|
];
|
|
27
35
|
const createTriggers = ({ component, dryRun, verbose, sourceDir, destinationDir, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
36
|
var _a, _b;
|
|
@@ -43,7 +51,7 @@ const createTriggers = ({ component, dryRun, verbose, sourceDir, destinationDir,
|
|
|
43
51
|
const triggers = yield Promise.all(Object.entries((_b = component.triggers) !== null && _b !== void 0 ? _b : {}).map(([triggerKey, trigger]) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
52
|
const inputs = (0, getInputs_1.getInputs)({
|
|
45
53
|
inputs: trigger.inputs,
|
|
46
|
-
|
|
54
|
+
docBlock: DOC_BLOCK,
|
|
47
55
|
});
|
|
48
56
|
const imports = (0, getImports_1.getImports)({ inputs });
|
|
49
57
|
return yield renderTrigger({
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getImports = void 0;
|
|
4
4
|
const getImports = ({ inputs }) => {
|
|
5
5
|
return inputs.reduce((acc, input) => {
|
|
6
|
-
if (typeof input.
|
|
6
|
+
if (typeof input.valueType === "string") {
|
|
7
7
|
return acc;
|
|
8
8
|
}
|
|
9
|
-
return Object.assign(Object.assign({}, acc), { [input.
|
|
10
|
-
? !acc[input.
|
|
11
|
-
? [...acc[input.
|
|
12
|
-
: acc[input.
|
|
13
|
-
: [input.
|
|
9
|
+
return Object.assign(Object.assign({}, acc), { [input.valueType.module]: acc[input.valueType.module]
|
|
10
|
+
? !acc[input.valueType.module].includes(input.valueType.type)
|
|
11
|
+
? [...acc[input.valueType.module], input.valueType.type]
|
|
12
|
+
: acc[input.valueType.module]
|
|
13
|
+
: [input.valueType.type] });
|
|
14
14
|
}, {});
|
|
15
15
|
};
|
|
16
16
|
exports.getImports = getImports;
|
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
import { Input as
|
|
2
|
-
import { InputFieldDefinition } from "../../types/Inputs";
|
|
1
|
+
import type { Input as InputBase } from "../../serverTypes";
|
|
2
|
+
import type { InputFieldDefinition } from "../../types/Inputs";
|
|
3
|
+
declare type ServerTypeInput = InputBase & {
|
|
4
|
+
onPremControlled?: boolean;
|
|
5
|
+
};
|
|
3
6
|
export interface Input {
|
|
4
7
|
key: string;
|
|
5
8
|
label: string;
|
|
6
|
-
|
|
9
|
+
inputType: string;
|
|
10
|
+
valueType: ValueType;
|
|
7
11
|
required: boolean | undefined;
|
|
8
12
|
properties: {
|
|
9
13
|
key: keyof ServerTypeInput;
|
|
10
14
|
value: string;
|
|
11
15
|
}[];
|
|
12
16
|
}
|
|
13
|
-
export declare type
|
|
17
|
+
export declare type ValueType = string | {
|
|
14
18
|
type: string;
|
|
15
19
|
module: string;
|
|
16
20
|
};
|
|
21
|
+
export declare type DocBlock = {
|
|
22
|
+
inputKey?: string;
|
|
23
|
+
propertyKey: keyof ServerTypeInput;
|
|
24
|
+
propertyValue?: unknown;
|
|
25
|
+
output?: string;
|
|
26
|
+
}[];
|
|
17
27
|
interface GetInputsProps {
|
|
18
28
|
inputs: ServerTypeInput[];
|
|
19
|
-
|
|
29
|
+
docBlock: DocBlock;
|
|
20
30
|
}
|
|
21
|
-
export declare const getInputs: ({ inputs,
|
|
22
|
-
export declare const INPUT_TYPE_MAP: Record<InputFieldDefinition["type"],
|
|
31
|
+
export declare const getInputs: ({ inputs, docBlock }: GetInputsProps) => Input[];
|
|
32
|
+
export declare const INPUT_TYPE_MAP: Record<InputFieldDefinition["type"], ValueType>;
|
|
23
33
|
export {};
|
|
@@ -1,29 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.INPUT_TYPE_MAP = exports.getInputs = void 0;
|
|
4
|
-
const getInputs = ({ inputs,
|
|
4
|
+
const getInputs = ({ inputs, docBlock }) => {
|
|
5
5
|
return inputs.map((input) => {
|
|
6
6
|
return {
|
|
7
7
|
key: input.key,
|
|
8
8
|
label: input.label,
|
|
9
|
-
|
|
9
|
+
inputType: input.type,
|
|
10
|
+
valueType: getInputValueType(input),
|
|
10
11
|
required: input.required,
|
|
11
12
|
collection: input.collection,
|
|
12
|
-
|
|
13
|
-
properties:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
onPremControlled: input.onPremiseControlled || input.onPremControlled,
|
|
14
|
+
properties: docBlock.reduce((acc, { propertyKey, inputKey, propertyValue, output }) => {
|
|
15
|
+
if (inputKey && inputKey !== input.key) {
|
|
16
|
+
return acc;
|
|
17
|
+
}
|
|
18
|
+
if (output &&
|
|
19
|
+
(input[propertyKey] === propertyValue ||
|
|
20
|
+
typeof propertyValue === "undefined")) {
|
|
21
|
+
return [
|
|
22
|
+
...acc,
|
|
23
|
+
{
|
|
24
|
+
key: propertyKey,
|
|
25
|
+
value: output,
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
if (typeof input[propertyKey] === "undefined" ||
|
|
30
|
+
input[propertyKey] === null ||
|
|
31
|
+
input[propertyKey] === "" ||
|
|
32
|
+
(typeof propertyValue !== "undefined" &&
|
|
33
|
+
input[propertyKey] !== propertyValue)) {
|
|
20
34
|
return acc;
|
|
21
35
|
}
|
|
22
36
|
return [
|
|
23
37
|
...acc,
|
|
24
38
|
{
|
|
25
|
-
key,
|
|
26
|
-
value
|
|
39
|
+
key: propertyKey,
|
|
40
|
+
value: JSON.stringify(input[propertyKey])
|
|
41
|
+
.replace(/(^"|"$)|(^'|'$)/g, "")
|
|
42
|
+
.trim(),
|
|
27
43
|
},
|
|
28
44
|
];
|
|
29
45
|
}, []),
|
|
@@ -61,12 +77,12 @@ exports.INPUT_TYPE_MAP = {
|
|
|
61
77
|
dynamicObjectSelection: "string",
|
|
62
78
|
dynamicFieldSelection: "string",
|
|
63
79
|
};
|
|
64
|
-
const
|
|
80
|
+
const getInputValueType = (input) => {
|
|
65
81
|
const valueType = input.model
|
|
66
82
|
? input.model.map((choice) => `"${choice.value}"`).join(" | ")
|
|
67
83
|
: exports.INPUT_TYPE_MAP[input.type] || "never";
|
|
68
84
|
if (input.collection === "keyvaluelist") {
|
|
69
|
-
return `Record<string, ${valueType}>`;
|
|
85
|
+
return `Record<string, ${valueType}> | Array<{key: string, value: ${valueType}}>`;
|
|
70
86
|
}
|
|
71
87
|
if (input.collection === "valuelist") {
|
|
72
88
|
return `${valueType}[]`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PackageDependencies } from "./createStaticFiles";
|
|
2
|
-
import { Component } from "../../serverTypes";
|
|
1
|
+
import { type PackageDependencies } from "./createStaticFiles";
|
|
2
|
+
import type { Component } from "../../serverTypes";
|
|
3
3
|
interface CreateComponentManifestProps {
|
|
4
4
|
component: Component;
|
|
5
5
|
dryRun: boolean;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.removeComponentManifest = void 0;
|
|
4
|
-
const
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
5
|
const removeComponentManifest = ({ destinationDir, verbose, }) => {
|
|
6
6
|
if (verbose) {
|
|
7
7
|
console.info("Removing existing component manifest files...");
|
|
8
8
|
}
|
|
9
9
|
try {
|
|
10
|
-
(0,
|
|
10
|
+
if ((0, fs_1.existsSync)(destinationDir)) {
|
|
11
|
+
(0, fs_1.rmSync)(destinationDir, { recursive: true, force: true });
|
|
12
|
+
}
|
|
11
13
|
}
|
|
12
14
|
catch (err) {
|
|
13
15
|
console.error(err);
|
|
@@ -13,6 +13,9 @@ export const <%= connection.key %> = {
|
|
|
13
13
|
perform: (
|
|
14
14
|
_values: <%= helpers.capitalizeFirstLetter(connection.key) %>Values
|
|
15
15
|
): Promise<void> => Promise.resolve(),
|
|
16
|
+
<%_ if (connection.onPremAvailable) { -%>
|
|
17
|
+
onPremAvailable: true,
|
|
18
|
+
<%_ } -%>
|
|
16
19
|
inputs: {
|
|
17
20
|
<%- include('../partials/inputs.ejs', { inputs: connection.inputs }) -%>
|
|
18
21
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<% inputs.forEach((input) => { -%>
|
|
2
2
|
<%= input.key %>: {
|
|
3
|
-
|
|
3
|
+
valueType: "<%- input.valueType.type ? input.valueType.type : input.valueType %>",
|
|
4
|
+
inputType: "<%= input.inputType %>",
|
|
4
5
|
<%_ if (input.collection) { -%>
|
|
5
6
|
collection: "<%= input.collection %>" as const,
|
|
6
7
|
<%_ } else { -%>
|
|
@@ -12,8 +13,8 @@
|
|
|
12
13
|
<%_ if (input.required) { -%>
|
|
13
14
|
required: <%= input.required %>,
|
|
14
15
|
<%_ } -%>
|
|
15
|
-
<%_ if (typeof input.
|
|
16
|
-
|
|
16
|
+
<%_ if (typeof input.onPremControlled !== "undefined") { -%>
|
|
17
|
+
onPremControlled: <%= input.onPremControlled %>,
|
|
17
18
|
<%_ } -%>
|
|
18
19
|
},
|
|
19
20
|
<% }); -%>
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* @<%= property.key %> <%- property.value %>
|
|
7
7
|
<%_ }); -%>
|
|
8
8
|
*/
|
|
9
|
-
<%= input.key %><%= input.required ? "" : "?" %>: <%- input.
|
|
9
|
+
<%= input.key %><%= input.required ? "" : "?" %>: <%- input.valueType.type ? input.valueType.type : input.valueType %>;
|
|
10
10
|
<% }); -%>
|
|
@@ -160,16 +160,17 @@ const convertConfigVarPermissionAndVisibility = ({ permissionAndVisibilityType,
|
|
|
160
160
|
};
|
|
161
161
|
};
|
|
162
162
|
const convertComponentReference = (componentReference, componentRegistry) => {
|
|
163
|
-
var _a, _b
|
|
163
|
+
var _a, _b;
|
|
164
|
+
const manifest = componentRegistry[componentReference.component];
|
|
164
165
|
const ref = {
|
|
165
166
|
component: {
|
|
166
|
-
key:
|
|
167
|
-
signature: (
|
|
168
|
-
isPublic:
|
|
167
|
+
key: manifest.key,
|
|
168
|
+
signature: (_a = manifest.signature) !== null && _a !== void 0 ? _a : "",
|
|
169
|
+
isPublic: manifest.public,
|
|
169
170
|
},
|
|
170
171
|
key: componentReference.key,
|
|
171
172
|
};
|
|
172
|
-
const inputs = Object.entries((
|
|
173
|
+
const inputs = Object.entries((_b = componentReference.values) !== null && _b !== void 0 ? _b : {}).reduce((result, [key, value]) => {
|
|
173
174
|
if ("value" in value) {
|
|
174
175
|
const type = value.value instanceof Object ? "complex" : "value";
|
|
175
176
|
const valueExpr = value.value instanceof Object && !Array.isArray(value.value)
|
|
@@ -387,6 +388,13 @@ const convertOnExecution = (onExecution, componentRegistry) => (context, params)
|
|
|
387
388
|
// Transform the input values based on the action's inputs
|
|
388
389
|
const transformedValues = Object.entries(values).reduce((transformedAccumulator, [inputKey, inputValue]) => {
|
|
389
390
|
const { collection } = action.inputs[inputKey];
|
|
391
|
+
if (collection === "keyvaluelist" &&
|
|
392
|
+
Array.isArray(inputValue)) {
|
|
393
|
+
transformedAccumulator[inputKey] = inputValue.reduce((acc, { key, value }) => {
|
|
394
|
+
return [...acc, { key, value }];
|
|
395
|
+
}, []);
|
|
396
|
+
return transformedAccumulator;
|
|
397
|
+
}
|
|
390
398
|
// Transform key-value list inputs
|
|
391
399
|
if (collection === "keyvaluelist" &&
|
|
392
400
|
Object.keys(inputValue).length) {
|