n8n-nodes-hebing-parameter-input 2.0.1 → 2.0.3
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.
|
@@ -7,6 +7,7 @@ class ParameterInput {
|
|
|
7
7
|
displayName: 'Parameter Input',
|
|
8
8
|
name: 'parameterInput',
|
|
9
9
|
group: ['transform'],
|
|
10
|
+
icon: 'file:parameter-input.svg',
|
|
10
11
|
version: 1,
|
|
11
12
|
description: 'A custom node for parameter input with bilingual support',
|
|
12
13
|
defaults: {
|
|
@@ -16,17 +17,6 @@ class ParameterInput {
|
|
|
16
17
|
outputs: ['main'],
|
|
17
18
|
credentials: [],
|
|
18
19
|
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
20
|
{
|
|
31
21
|
displayName: 'Parameters',
|
|
32
22
|
name: 'parameters',
|
|
@@ -43,20 +33,12 @@ class ParameterInput {
|
|
|
43
33
|
displayName: 'Parameter',
|
|
44
34
|
values: [
|
|
45
35
|
{
|
|
46
|
-
displayName: 'Parameter Name
|
|
36
|
+
displayName: 'Parameter Name',
|
|
47
37
|
name: 'name',
|
|
48
38
|
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',
|
|
39
|
+
default: '',
|
|
40
|
+
description: 'Parameter name (used as JSON key)',
|
|
41
|
+
placeholder: 'e.g., date',
|
|
60
42
|
},
|
|
61
43
|
{
|
|
62
44
|
displayName: 'Parameter Type',
|
|
@@ -84,10 +66,6 @@ class ParameterInput {
|
|
|
84
66
|
name: 'JSON',
|
|
85
67
|
value: 'json',
|
|
86
68
|
},
|
|
87
|
-
{
|
|
88
|
-
name: 'Dropdown',
|
|
89
|
-
value: 'dropdown',
|
|
90
|
-
},
|
|
91
69
|
],
|
|
92
70
|
description: 'Type of the parameter',
|
|
93
71
|
},
|
|
@@ -96,7 +74,7 @@ class ParameterInput {
|
|
|
96
74
|
name: 'value',
|
|
97
75
|
type: 'string',
|
|
98
76
|
default: '',
|
|
99
|
-
description: '
|
|
77
|
+
description: 'Value of the parameter',
|
|
100
78
|
},
|
|
101
79
|
],
|
|
102
80
|
},
|
|
@@ -108,19 +86,15 @@ class ParameterInput {
|
|
|
108
86
|
async execute() {
|
|
109
87
|
const items = this.getInputData();
|
|
110
88
|
const returnData = [];
|
|
111
|
-
if (items.length === 0) {
|
|
112
|
-
return [returnData];
|
|
113
|
-
}
|
|
114
89
|
for (let i = 0; i < items.length; i++) {
|
|
115
90
|
// Get parameters from the UI
|
|
116
|
-
const
|
|
91
|
+
const parametersData = this.getNodeParameter('parameters.parameter', i, []);
|
|
117
92
|
const parameters = {};
|
|
118
93
|
// Loop through all parameters
|
|
119
|
-
for (
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
parameters[parameterName] = parameterValue;
|
|
94
|
+
for (const param of parametersData) {
|
|
95
|
+
const { name, value } = param;
|
|
96
|
+
// Use parameter name as the key
|
|
97
|
+
parameters[name] = value;
|
|
124
98
|
}
|
|
125
99
|
// Add the parameters object to the return data
|
|
126
100
|
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,IAAI,EAAE,0BAA0B;YAChC,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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