n8n-nodes-hebing-parameter-input 2.0.1 → 2.0.2
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.
|
@@ -16,17 +16,6 @@ class ParameterInput {
|
|
|
16
16
|
outputs: ['main'],
|
|
17
17
|
credentials: [],
|
|
18
18
|
properties: [
|
|
19
|
-
{
|
|
20
|
-
displayName: 'Parameter Count',
|
|
21
|
-
name: 'parameterCount',
|
|
22
|
-
type: 'number',
|
|
23
|
-
default: 1,
|
|
24
|
-
description: 'Number of parameters to define',
|
|
25
|
-
typeOptions: {
|
|
26
|
-
minValue: 1,
|
|
27
|
-
maxValue: 20,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
19
|
{
|
|
31
20
|
displayName: 'Parameters',
|
|
32
21
|
name: 'parameters',
|
|
@@ -43,20 +32,12 @@ class ParameterInput {
|
|
|
43
32
|
displayName: 'Parameter',
|
|
44
33
|
values: [
|
|
45
34
|
{
|
|
46
|
-
displayName: 'Parameter Name
|
|
35
|
+
displayName: 'Parameter Name',
|
|
47
36
|
name: 'name',
|
|
48
37
|
type: 'string',
|
|
49
|
-
default: '
|
|
50
|
-
description: '
|
|
51
|
-
placeholder: 'e.g.,
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
displayName: 'Parameter Name (Chinese)',
|
|
55
|
-
name: 'chineseName',
|
|
56
|
-
type: 'string',
|
|
57
|
-
default: '参数1',
|
|
58
|
-
description: 'Chinese name of the parameter (for display only)',
|
|
59
|
-
placeholder: 'e.g., API密钥, 用户ID',
|
|
38
|
+
default: '',
|
|
39
|
+
description: 'Parameter name (used as JSON key)',
|
|
40
|
+
placeholder: 'e.g., date',
|
|
60
41
|
},
|
|
61
42
|
{
|
|
62
43
|
displayName: 'Parameter Type',
|
|
@@ -84,10 +65,6 @@ class ParameterInput {
|
|
|
84
65
|
name: 'JSON',
|
|
85
66
|
value: 'json',
|
|
86
67
|
},
|
|
87
|
-
{
|
|
88
|
-
name: 'Dropdown',
|
|
89
|
-
value: 'dropdown',
|
|
90
|
-
},
|
|
91
68
|
],
|
|
92
69
|
description: 'Type of the parameter',
|
|
93
70
|
},
|
|
@@ -96,7 +73,7 @@ class ParameterInput {
|
|
|
96
73
|
name: 'value',
|
|
97
74
|
type: 'string',
|
|
98
75
|
default: '',
|
|
99
|
-
description: '
|
|
76
|
+
description: 'Value of the parameter',
|
|
100
77
|
},
|
|
101
78
|
],
|
|
102
79
|
},
|
|
@@ -108,19 +85,15 @@ class ParameterInput {
|
|
|
108
85
|
async execute() {
|
|
109
86
|
const items = this.getInputData();
|
|
110
87
|
const returnData = [];
|
|
111
|
-
if (items.length === 0) {
|
|
112
|
-
return [returnData];
|
|
113
|
-
}
|
|
114
88
|
for (let i = 0; i < items.length; i++) {
|
|
115
89
|
// Get parameters from the UI
|
|
116
|
-
const
|
|
90
|
+
const parametersData = this.getNodeParameter('parameters.parameter', i, []);
|
|
117
91
|
const parameters = {};
|
|
118
92
|
// Loop through all parameters
|
|
119
|
-
for (
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
parameters[parameterName] = parameterValue;
|
|
93
|
+
for (const param of parametersData) {
|
|
94
|
+
const { name, value } = param;
|
|
95
|
+
// Use parameter name as the key
|
|
96
|
+
parameters[name] = value;
|
|
124
97
|
}
|
|
125
98
|
// Add the parameters object to the return data
|
|
126
99
|
returnData.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParameterInput.node.js","sourceRoot":"","sources":["../../../nodes/ParameterInput/ParameterInput.node.ts"],"names":[],"mappings":";;;AAOA,MAAa,cAAc;IAA3B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE;gBACT,IAAI,EAAE,iBAAiB;aACvB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,EAAE;YACf,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"ParameterInput.node.js","sourceRoot":"","sources":["../../../nodes/ParameterInput/ParameterInput.node.ts"],"names":[],"mappings":";;;AAOA,MAAa,cAAc;IAA3B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE;gBACT,IAAI,EAAE,iBAAiB;aACvB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,EAAE;YACf,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,YAAY;oBACzB,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,iBAAiB;oBACvB,WAAW,EAAE,eAAe;oBAC5B,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE;wBACZ,cAAc,EAAE,IAAI;wBACpB,YAAY,EAAE,CAAC;qBACf;oBACD,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,WAAW;4BACjB,WAAW,EAAE,WAAW;4BACxB,MAAM,EAAE;gCACP;oCACC,WAAW,EAAE,gBAAgB;oCAC7B,IAAI,EAAE,MAAM;oCACZ,IAAI,EAAE,QAAQ;oCACd,OAAO,EAAE,EAAE;oCACX,WAAW,EAAE,mCAAmC;oCAChD,WAAW,EAAE,YAAY;iCACzB;gCACD;oCACC,WAAW,EAAE,gBAAgB;oCAC7B,IAAI,EAAE,MAAM;oCACZ,IAAI,EAAE,SAAS;oCACf,OAAO,EAAE,QAAQ;oCACjB,OAAO,EAAE;wCACR;4CACC,IAAI,EAAE,QAAQ;4CACd,KAAK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