n8n-nodes-simple 2.4.5 → 2.4.7
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/credentials/GlobalConstantsApi.credentials.d.ts +11 -0
- package/dist/credentials/GlobalConstantsApi.credentials.js +83 -0
- package/dist/credentials/GlobalConstantsApi.credentials.js.map +1 -0
- package/dist/credentials/globalConstants.svg +31 -0
- package/dist/nodes/GlobalConstants/GlobalConstants.node.d.ts +5 -0
- package/dist/nodes/GlobalConstants/GlobalConstants.node.js +212 -0
- package/dist/nodes/GlobalConstants/GlobalConstants.node.js.map +1 -0
- package/dist/nodes/GlobalConstants/globalConstants.svg +31 -0
- package/dist/nodes/shared/config/parameters.d.ts +2 -2
- package/dist/nodes/shared/config/parameters.js.map +1 -1
- package/dist/nodes/shared/config/properties/options.js +21 -0
- package/dist/nodes/shared/config/properties/options.js.map +1 -1
- package/dist/nodes/shared/core/messages/chatHistory.js +2 -1
- package/dist/nodes/shared/core/messages/chatHistory.js.map +1 -1
- package/dist/nodes/shared/core/messages/types.d.ts +2 -2
- package/dist/nodes/shared/core/request/body.js +7 -0
- package/dist/nodes/shared/core/request/body.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class GlobalConstantsApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: {
|
|
7
|
+
readonly light: "file:globalConstants.svg";
|
|
8
|
+
readonly dark: "file:globalConstants.svg";
|
|
9
|
+
};
|
|
10
|
+
properties: INodeProperties[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GlobalConstantsApi = void 0;
|
|
4
|
+
class GlobalConstantsApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'globalConstantsApi';
|
|
7
|
+
this.displayName = 'Global Constants API';
|
|
8
|
+
this.documentationUrl = 'https://docs.n8n.io/integrations/creating-nodes/';
|
|
9
|
+
this.icon = { light: 'file:globalConstants.svg', dark: 'file:globalConstants.svg' };
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Constants Format',
|
|
13
|
+
name: 'constantsFormat',
|
|
14
|
+
type: 'options',
|
|
15
|
+
default: 'keyValue',
|
|
16
|
+
description: 'Choose how to define your global constants',
|
|
17
|
+
options: [
|
|
18
|
+
{
|
|
19
|
+
name: 'Key-Value Pairs',
|
|
20
|
+
value: 'keyValue',
|
|
21
|
+
description: 'Define constants as key=value pairs (one per line)',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'JSON Object',
|
|
25
|
+
value: 'json',
|
|
26
|
+
description: 'Define constants as a JSON object',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Constants (Key-Value)',
|
|
32
|
+
name: 'keyValueConstants',
|
|
33
|
+
type: 'string',
|
|
34
|
+
typeOptions: {
|
|
35
|
+
password: true,
|
|
36
|
+
rows: 10,
|
|
37
|
+
alwaysOpenEditWindow: true,
|
|
38
|
+
},
|
|
39
|
+
default: 'API_URL=https://api.example.com\nDEFAULT_TIMEOUT=30000\nAPP_NAME=My Application',
|
|
40
|
+
placeholder: 'KEY1=value1\nKEY2=value2\nKEY3=value3',
|
|
41
|
+
description: 'Define constants as key=value pairs, one per line',
|
|
42
|
+
displayOptions: {
|
|
43
|
+
show: {
|
|
44
|
+
constantsFormat: ['keyValue'],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
displayName: 'Constants (JSON)',
|
|
50
|
+
name: 'jsonConstants',
|
|
51
|
+
type: 'json',
|
|
52
|
+
typeOptions: {
|
|
53
|
+
alwaysOpenEditWindow: true,
|
|
54
|
+
},
|
|
55
|
+
default: '{\n "API_URL": "https://api.example.com",\n "DEFAULT_TIMEOUT": 30000,\n "APP_NAME": "My Application"\n}',
|
|
56
|
+
description: 'Define constants as a JSON object',
|
|
57
|
+
displayOptions: {
|
|
58
|
+
show: {
|
|
59
|
+
constantsFormat: ['json'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
displayName: 'Description (Optional)',
|
|
65
|
+
name: 'description',
|
|
66
|
+
type: 'string',
|
|
67
|
+
default: '',
|
|
68
|
+
placeholder: 'Production API configuration',
|
|
69
|
+
description: 'Optional description for this set of global constants',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
displayName: 'Access Key (Optional)',
|
|
73
|
+
name: 'accessKey',
|
|
74
|
+
type: 'string',
|
|
75
|
+
typeOptions: { password: true },
|
|
76
|
+
default: '',
|
|
77
|
+
description: 'Optional access key for secured constant sets',
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.GlobalConstantsApi = GlobalConstantsApi;
|
|
83
|
+
//# sourceMappingURL=GlobalConstantsApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalConstantsApi.credentials.js","sourceRoot":"","sources":["../../credentials/GlobalConstantsApi.credentials.ts"],"names":[],"mappings":";;;AAKA,MAAa,kBAAkB;IAA/B;QACC,SAAI,GAAG,oBAAoB,CAAC;QAE5B,gBAAW,GAAG,sBAAsB,CAAC;QAErC,qBAAgB,GAAG,kDAAkD,CAAC;QAEtE,SAAI,GAAG,EAAE,KAAK,EAAE,0BAA0B,EAAE,IAAI,EAAE,0BAA0B,EAAW,CAAC;QAExF,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,iBA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AAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,+CAA+C;aAC5D;SACD,CAAC;IACH,CAAC;CAAA;AA/ED,gDA+EC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" preserveAspectRatio="xMidYMid" viewBox="0 0 256 256">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="gradient-bl-tr" x1="0%" y1="100%" x2="100%" y2="0%">
|
|
4
|
+
<stop offset="0%" stop-color="#a857fd" />
|
|
5
|
+
<stop offset="100%" stop-color="#60c5d1" />
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<!-- Globe/Circle -->
|
|
9
|
+
<circle cx="128" cy="128" r="100" fill="none" stroke="url(#gradient-bl-tr)" stroke-width="8"/>
|
|
10
|
+
|
|
11
|
+
<!-- Meridian lines -->
|
|
12
|
+
<ellipse cx="128" cy="128" rx="40" ry="100" fill="none" stroke="url(#gradient-bl-tr)" stroke-width="4" opacity="0.7"/>
|
|
13
|
+
<ellipse cx="128" cy="128" rx="70" ry="100" fill="none" stroke="url(#gradient-bl-tr)" stroke-width="3" opacity="0.5"/>
|
|
14
|
+
|
|
15
|
+
<!-- Equator and parallels -->
|
|
16
|
+
<line x1="28" y1="128" x2="228" y2="128" stroke="url(#gradient-bl-tr)" stroke-width="4" opacity="0.7"/>
|
|
17
|
+
<ellipse cx="128" cy="128" rx="100" ry="30" fill="none" stroke="url(#gradient-bl-tr)" stroke-width="3" opacity="0.5"/>
|
|
18
|
+
<ellipse cx="128" cy="128" rx="100" ry="60" fill="none" stroke="url(#gradient-bl-tr)" stroke-width="3" opacity="0.5"/>
|
|
19
|
+
|
|
20
|
+
<!-- Constants symbols -->
|
|
21
|
+
<g fill="url(#gradient-bl-tr)" font-family="Arial, sans-serif" font-weight="bold">
|
|
22
|
+
<!-- Key-value pairs representation -->
|
|
23
|
+
<text x="80" y="90" font-size="16" opacity="0.9">K=V</text>
|
|
24
|
+
<text x="160" y="110" font-size="14" opacity="0.8">X=Y</text>
|
|
25
|
+
<text x="100" y="170" font-size="14" opacity="0.8">A=B</text>
|
|
26
|
+
|
|
27
|
+
<!-- JSON-like braces -->
|
|
28
|
+
<text x="60" y="140" font-size="24" opacity="0.7">{</text>
|
|
29
|
+
<text x="180" y="140" font-size="24" opacity="0.7">}</text>
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IExecuteFunctions, type INodeType, type INodeTypeDescription, type INodeExecutionData } from 'n8n-workflow';
|
|
2
|
+
export declare class GlobalConstants implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GlobalConstants = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
function parseKeyValueConstants(constantsString) {
|
|
6
|
+
const constants = {};
|
|
7
|
+
const lines = constantsString.split('\n');
|
|
8
|
+
for (const line of lines) {
|
|
9
|
+
const trimmedLine = line.trim();
|
|
10
|
+
if (!trimmedLine || trimmedLine.startsWith('#') || trimmedLine.startsWith('//')) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
const equalIndex = trimmedLine.indexOf('=');
|
|
14
|
+
if (equalIndex === -1) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const key = trimmedLine.substring(0, equalIndex).trim();
|
|
18
|
+
const value = trimmedLine.substring(equalIndex + 1).trim();
|
|
19
|
+
if (key) {
|
|
20
|
+
let parsedValue = value;
|
|
21
|
+
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
22
|
+
(value.startsWith("'") && value.endsWith("'"))) {
|
|
23
|
+
parsedValue = value.slice(1, -1);
|
|
24
|
+
}
|
|
25
|
+
else if (value.toLowerCase() === 'true') {
|
|
26
|
+
parsedValue = true;
|
|
27
|
+
}
|
|
28
|
+
else if (value.toLowerCase() === 'false') {
|
|
29
|
+
parsedValue = false;
|
|
30
|
+
}
|
|
31
|
+
else if (!isNaN(Number(value)) && !isNaN(parseFloat(value))) {
|
|
32
|
+
parsedValue = value.includes('.') ? parseFloat(value) : parseInt(value, 10);
|
|
33
|
+
}
|
|
34
|
+
constants[key] = parsedValue;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return constants;
|
|
38
|
+
}
|
|
39
|
+
const globalConstantsDescription = {
|
|
40
|
+
displayName: 'Global Constants',
|
|
41
|
+
name: 'globalConstants',
|
|
42
|
+
group: ['transform'],
|
|
43
|
+
version: 1,
|
|
44
|
+
description: 'Access global constants defined in credentials. Create reusable constants for your workflows.',
|
|
45
|
+
defaults: { name: 'Global Constants' },
|
|
46
|
+
icon: 'file:globalConstants.svg',
|
|
47
|
+
inputs: ['main'],
|
|
48
|
+
outputs: ['main'],
|
|
49
|
+
properties: [
|
|
50
|
+
{
|
|
51
|
+
displayName: 'Credential ID',
|
|
52
|
+
name: 'credentialId',
|
|
53
|
+
type: 'string',
|
|
54
|
+
required: true,
|
|
55
|
+
default: '',
|
|
56
|
+
placeholder: '={{$json.credentialId}}',
|
|
57
|
+
description: 'ID of the Global Constants credential to use. Supports expressions.',
|
|
58
|
+
hint: 'Use expressions like ={{$json.credentialId}} to select credentials dynamically',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Output Format',
|
|
62
|
+
name: 'outputFormat',
|
|
63
|
+
type: 'options',
|
|
64
|
+
default: 'constants',
|
|
65
|
+
description: 'How to output the constants',
|
|
66
|
+
options: [
|
|
67
|
+
{
|
|
68
|
+
name: 'Constants Only',
|
|
69
|
+
value: 'constants',
|
|
70
|
+
description: 'Output only the constants object',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'With Metadata',
|
|
74
|
+
value: 'withMetadata',
|
|
75
|
+
description: 'Output constants with credential metadata',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'Merge with Input',
|
|
79
|
+
value: 'merge',
|
|
80
|
+
description: 'Merge constants with input data',
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
displayName: 'Constant Prefix',
|
|
86
|
+
name: 'constantPrefix',
|
|
87
|
+
type: 'string',
|
|
88
|
+
default: '',
|
|
89
|
+
placeholder: 'GLOBAL_',
|
|
90
|
+
description: 'Optional prefix to add to all constant keys',
|
|
91
|
+
displayOptions: {
|
|
92
|
+
show: {
|
|
93
|
+
outputFormat: ['constants', 'withMetadata'],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
codex: {
|
|
99
|
+
alias: ['Global', 'Constants', 'Variables', 'Config', 'Settings'],
|
|
100
|
+
categories: ['Core Nodes'],
|
|
101
|
+
subcategories: {
|
|
102
|
+
'Core Nodes': ['Data'],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
class GlobalConstants {
|
|
107
|
+
constructor() {
|
|
108
|
+
this.description = globalConstantsDescription;
|
|
109
|
+
}
|
|
110
|
+
async execute() {
|
|
111
|
+
const items = this.getInputData();
|
|
112
|
+
const returnData = [];
|
|
113
|
+
for (let i = 0; i < items.length; i++) {
|
|
114
|
+
try {
|
|
115
|
+
const credentialId = this.getNodeParameter('credentialId', i);
|
|
116
|
+
const outputFormat = this.getNodeParameter('outputFormat', i);
|
|
117
|
+
const constantPrefix = this.getNodeParameter('constantPrefix', i, '');
|
|
118
|
+
if (!credentialId) {
|
|
119
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Credential ID is required', { itemIndex: i });
|
|
120
|
+
}
|
|
121
|
+
let credentials;
|
|
122
|
+
try {
|
|
123
|
+
const baseUrl = process.env.N8N_HOST || 'http://localhost:5678';
|
|
124
|
+
const requestOptions = {
|
|
125
|
+
method: 'GET',
|
|
126
|
+
url: `${baseUrl}/api/v1/credentials/${credentialId}`,
|
|
127
|
+
headers: {
|
|
128
|
+
'Content-Type': 'application/json',
|
|
129
|
+
},
|
|
130
|
+
auth: {
|
|
131
|
+
username: process.env.N8N_BASIC_AUTH_USER || '',
|
|
132
|
+
password: process.env.N8N_BASIC_AUTH_PASSWORD || '',
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
const credentialData = await this.helpers.httpRequest(requestOptions);
|
|
136
|
+
credentials = credentialData.data;
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to access credential '${credentialId}': ${error.message}. Make sure the credential exists and is accessible.`, { itemIndex: i });
|
|
140
|
+
}
|
|
141
|
+
if (!credentials) {
|
|
142
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Global Constants credential not found or access denied', { itemIndex: i });
|
|
143
|
+
}
|
|
144
|
+
let constants = {};
|
|
145
|
+
const constantsFormat = credentials.constantsFormat;
|
|
146
|
+
if (constantsFormat === 'json') {
|
|
147
|
+
try {
|
|
148
|
+
const jsonConstants = credentials.jsonConstants;
|
|
149
|
+
constants = JSON.parse(jsonConstants);
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Invalid JSON in credential: ${error.message}`, { itemIndex: i });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
const keyValueConstants = credentials.keyValueConstants;
|
|
157
|
+
constants = parseKeyValueConstants(keyValueConstants);
|
|
158
|
+
}
|
|
159
|
+
if (constantPrefix) {
|
|
160
|
+
const prefixedConstants = {};
|
|
161
|
+
for (const [key, value] of Object.entries(constants)) {
|
|
162
|
+
prefixedConstants[`${constantPrefix}${key}`] = value;
|
|
163
|
+
}
|
|
164
|
+
constants = prefixedConstants;
|
|
165
|
+
}
|
|
166
|
+
let outputData;
|
|
167
|
+
switch (outputFormat) {
|
|
168
|
+
case 'withMetadata':
|
|
169
|
+
outputData = {
|
|
170
|
+
constants,
|
|
171
|
+
metadata: {
|
|
172
|
+
constantsFormat,
|
|
173
|
+
description: credentials.description || '',
|
|
174
|
+
constantCount: Object.keys(constants).length,
|
|
175
|
+
prefix: constantPrefix || null,
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
break;
|
|
179
|
+
case 'merge':
|
|
180
|
+
outputData = {
|
|
181
|
+
...items[i].json,
|
|
182
|
+
...constants,
|
|
183
|
+
};
|
|
184
|
+
break;
|
|
185
|
+
default:
|
|
186
|
+
outputData = constants;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
returnData.push({
|
|
190
|
+
json: outputData,
|
|
191
|
+
pairedItem: { item: i },
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
if (this.continueOnFail()) {
|
|
196
|
+
returnData.push({
|
|
197
|
+
json: {
|
|
198
|
+
error: error.message,
|
|
199
|
+
credentialId: this.getNodeParameter('credentialId', i, ''),
|
|
200
|
+
},
|
|
201
|
+
pairedItem: { item: i },
|
|
202
|
+
});
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
throw error;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return [returnData];
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
exports.GlobalConstants = GlobalConstants;
|
|
212
|
+
//# sourceMappingURL=GlobalConstants.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalConstants.node.js","sourceRoot":"","sources":["../../../nodes/GlobalConstants/GlobalConstants.node.ts"],"names":[],"mappings":";;;AAAA,+CAMsB;AAKtB,SAAS,sBAAsB,CAAC,eAAuB;IACtD,MAAM,SAAS,GAAwB,EAAE,CAAC;IAC1C,MAAM,KAA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BACF,MAAM;oBAEP;wBACC,UAAU,GAAG,SAAS,CAAC;wBACvB,MAAM;gBACR,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,UAAU;oBAChB,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;iBACvB,CAAC,CAAC;YAEJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE;4BACL,KAAK,EAAE,KAAK,CAAC,OAAO;4BACpB,YAAY,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,EAAE,EAAE,CAAC;yBAC1D;wBACD,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACvB,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA3HD,0CA2HC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" preserveAspectRatio="xMidYMid" viewBox="0 0 256 256">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="gradient-bl-tr" x1="0%" y1="100%" x2="100%" y2="0%">
|
|
4
|
+
<stop offset="0%" stop-color="#a857fd" />
|
|
5
|
+
<stop offset="100%" stop-color="#60c5d1" />
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<!-- Globe/Circle -->
|
|
9
|
+
<circle cx="128" cy="128" r="100" fill="none" stroke="url(#gradient-bl-tr)" stroke-width="8"/>
|
|
10
|
+
|
|
11
|
+
<!-- Meridian lines -->
|
|
12
|
+
<ellipse cx="128" cy="128" rx="40" ry="100" fill="none" stroke="url(#gradient-bl-tr)" stroke-width="4" opacity="0.7"/>
|
|
13
|
+
<ellipse cx="128" cy="128" rx="70" ry="100" fill="none" stroke="url(#gradient-bl-tr)" stroke-width="3" opacity="0.5"/>
|
|
14
|
+
|
|
15
|
+
<!-- Equator and parallels -->
|
|
16
|
+
<line x1="28" y1="128" x2="228" y2="128" stroke="url(#gradient-bl-tr)" stroke-width="4" opacity="0.7"/>
|
|
17
|
+
<ellipse cx="128" cy="128" rx="100" ry="30" fill="none" stroke="url(#gradient-bl-tr)" stroke-width="3" opacity="0.5"/>
|
|
18
|
+
<ellipse cx="128" cy="128" rx="100" ry="60" fill="none" stroke="url(#gradient-bl-tr)" stroke-width="3" opacity="0.5"/>
|
|
19
|
+
|
|
20
|
+
<!-- Constants symbols -->
|
|
21
|
+
<g fill="url(#gradient-bl-tr)" font-family="Arial, sans-serif" font-weight="bold">
|
|
22
|
+
<!-- Key-value pairs representation -->
|
|
23
|
+
<text x="80" y="90" font-size="16" opacity="0.9">K=V</text>
|
|
24
|
+
<text x="160" y="110" font-size="14" opacity="0.8">X=Y</text>
|
|
25
|
+
<text x="100" y="170" font-size="14" opacity="0.8">A=B</text>
|
|
26
|
+
|
|
27
|
+
<!-- JSON-like braces -->
|
|
28
|
+
<text x="60" y="140" font-size="24" opacity="0.7">{</text>
|
|
29
|
+
<text x="180" y="140" font-size="24" opacity="0.7">}</text>
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { IExecuteFunctions, IDataObject } from 'n8n-workflow';
|
|
2
2
|
import { VisualEditorProperties } from '../core/request/visualEditor';
|
|
3
|
-
import {
|
|
3
|
+
import { RawMessage } from '../core/messages/types';
|
|
4
4
|
export type ExtractedParameters = {
|
|
5
5
|
model: string;
|
|
6
6
|
fallbackModel: string;
|
|
7
7
|
agentType: string;
|
|
8
|
-
rawMessagesToSend:
|
|
8
|
+
rawMessagesToSend: RawMessage[];
|
|
9
9
|
responseFormat: string;
|
|
10
10
|
addToOutput: string[];
|
|
11
11
|
outputJsonSchemaDefinition: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../nodes/shared/config/parameters.ts"],"names":[],"mappings":";;AA8BA,8CAyCC;AAzCD,SAAgB,iBAAiB,CAChC,gBAAmC,EACnC,KAAa;;IAEb,MAAM,GAAG,GAAG,CAAI,IAAY,EAAE,YAAe,EAAE,OAAkC,EAAE,EAAE,CACpF,gBAAgB,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,CAAM,CAAC;IAE5E,MAAM,WAAW,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../nodes/shared/config/parameters.ts"],"names":[],"mappings":";;AA8BA,8CAyCC;AAzCD,SAAgB,iBAAiB,CAChC,gBAAmC,EACnC,KAAa;;IAEb,MAAM,GAAG,GAAG,CAAI,IAAY,EAAE,YAAe,EAAE,OAAkC,EAAE,EAAE,CACpF,gBAAgB,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,CAAM,CAAC;IAE5E,MAAM,WAAW,GAAG,GAAG,CAAe,uBAAuB,EAAE,EAAE,CAAC,CAAC;IAGnE,MAAM,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC;IACnF,MAAM,yBAAyB,GAAG,MAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,yBAAyB,mCAAI,IAAI,CAAC;IACvF,MAAM,2BAA2B,GAAG,MAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,2BAA2B,mCAAI,IAAI,CAAC;IAE3F,MAAM,MAAM,GAAwB;QACnC,KAAK,EAAE,GAAG,CAAS,SAAS,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;QACzD,aAAa,EAAE,GAAG,CAAS,yBAAyB,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;QACjF,SAAS,EAAE,GAAG,CAAS,WAAW,EAAE,WAAW,CAAC;QAChD,iBAAiB,EAAE,WAAW;QAC9B,cAAc,EAAE,GAAG,CAAS,gBAAgB,EAAE,EAAE,CAAC;QACjD,WAAW,EAAE,GAAG,CAAW,aAAa,EAAE,EAAE,CAAC;QAC7C,0BAA0B,EAAE,GAAG,CAAS,4BAA4B,EAAE,EAAE,CAAC;QACzE,yBAAyB,EAAE,GAAG,CAAU,2BAA2B,EAAE,KAAK,CAAC;QAC3E,0BAA0B,EAAE,GAAG,CAC9B,mCAAmC,EACnC,EAAE,CACF;QACD,oBAAoB,EAAE,GAAG,CAAS,sBAAsB,EAAE,EAAE,CAAC;QAC7D,2BAA2B,EAAE,GAAG,CAAS,6BAA6B,EAAE,EAAE,CAAC;QAC3E,uBAAuB,EAAE,GAAG,CAAU,yBAAyB,EAAE,KAAK,CAAC;QACvE,yBAAyB,EAAE,GAAG,CAAS,2BAA2B,EAAE,EAAE,CAAC;QACvE,gCAAgC,EAAE,GAAG,CAAS,kCAAkC,EAAE,EAAE,CAAC;QACrF,OAAO,EAAE,GAAG,CAAc,SAAS,EAAE,EAAE,CAAC;QACxC,kBAAkB,EAAE,GAAG,CAAS,4BAA4B,EAAE,EAAE,CAAC;QACjE,gBAAgB,EAAE,GAAG,CAAuB,0BAA0B,EAAE,IAAI,CAAC;QAC7E,yBAAyB;QACzB,2BAA2B;QAC3B,WAAW,EAAE,gBAAgB,CAAC,wBAAwB,EAAE;KACxD,CAAC;IAEF,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -83,6 +83,27 @@ exports.optionsProperties = [
|
|
|
83
83
|
description: "Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics",
|
|
84
84
|
type: 'number',
|
|
85
85
|
},
|
|
86
|
+
{
|
|
87
|
+
displayName: 'Reasoning Effort',
|
|
88
|
+
name: 'reasoning_effort',
|
|
89
|
+
description: 'Controls the amount of reasoning effort for models that support extended thinking. Higher effort may improve output quality but increases latency and token usage.',
|
|
90
|
+
type: 'options',
|
|
91
|
+
options: [
|
|
92
|
+
{
|
|
93
|
+
name: 'High',
|
|
94
|
+
value: 'high',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'Medium',
|
|
98
|
+
value: 'medium',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'Low',
|
|
102
|
+
value: 'low',
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
default: 'medium',
|
|
106
|
+
},
|
|
86
107
|
{
|
|
87
108
|
displayName: 'Temperature',
|
|
88
109
|
name: 'temperature',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../../nodes/shared/config/properties/options.ts"],"names":[],"mappings":";;;AAEa,QAAA,iBAAiB,GAAsB;IACnD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,kBAAkB;gBACxB,OAAO,EAAE,IAAI;gBACb,WAAW,EACV,uQAAuQ;gBACxQ,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;gBACxB,YAAY,EAAE,QAAQ;gBACtB,+BAA+B,EAAE,IAAI;aACrC;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;gBAEhD,WAAW,EAAE,yLAAyL;gBACtM,KAAK,EAAE;oBACN;wBACC,WAAW,EAAE,WA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aACd;YACD;gBACC,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE;gBAC7D,WAAW,EACV,2SAA2S;gBAC5S,IAAI,EAAE,QAAQ;aACd;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE;gBAC7D,WAAW,EACV,6OAA6O;gBAC9O,IAAI,EAAE,QAAQ;aACd;SACD;KACD;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../../nodes/shared/config/properties/options.ts"],"names":[],"mappings":";;;AAEa,QAAA,iBAAiB,GAAsB;IACnD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,kBAAkB;gBACxB,OAAO,EAAE,IAAI;gBACb,WAAW,EACV,uQAAuQ;gBACxQ,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;gBACxB,YAAY,EAAE,QAAQ;gBACtB,+BAA+B,EAAE,IAAI;aACrC;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;gBAEhD,WAAW,EAAE,yLAAyL;gBACtM,KAAK,EAAE;oBACN;wBACC,WAA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AE,QAAQ;aACd;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,kBAAkB;gBACxB,WAAW,EACV,oKAAoK;gBACrK,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,MAAM;qBACb;oBACD;wBACC,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,QAAQ;qBACf;oBACD;wBACC,IAAI,EAAE,KAAK;wBACX,KAAK,EAAE,KAAK;qBACZ;iBACD;gBACD,OAAO,EAAE,QAAQ;aACjB;YACD;gBACC,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE;gBAC7D,WAAW,EACV,2SAA2S;gBAC5S,IAAI,EAAE,QAAQ;aACd;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE;gBAC7D,WAAW,EACV,6OAA6O;gBAC9O,IAAI,EAAE,QAAQ;aACd;SACD;KACD;CACD,CAAC"}
|
|
@@ -26,7 +26,8 @@ async function unpackChatHistoryAndMemory(rawMessagesToSend, loadToolCallsFromCh
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
|
-
|
|
29
|
+
const { chatHistoryJson, saveToolCallsInChatMemory, loadToolCallsFromChatMemory, ...messageProps } = rawMessage;
|
|
30
|
+
processedMessages.push(messageProps);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
return processedMessages;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatHistory.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/messages/chatHistory.ts"],"names":[],"mappings":";;AAgBA,
|
|
1
|
+
{"version":3,"file":"chatHistory.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/messages/chatHistory.ts"],"names":[],"mappings":";;AAgBA,gEA6CC;AA1DD,2CAA8C;AAE9C,KAAK,UAAU,eAAe,CAAC,MAA0B;IACxD,OAAO,CAAC,MAAM,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAkB,CAAC;AAClF,CAAC;AASM,KAAK,UAAU,0BAA0B,CAC/C,iBAA+B,EAC/B,8BAAuC,IAAI,EAC3C,MAA2B;IAE3B,MAAM,iBAAiB,GAAc,EAAE,CAAC;IAExC,KAAK,MAAM,UAAU,IAAI,iBAAiB,EAAE,CAAC;QAC5C,IAAI,UAAU,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;YAE3C,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;YAGnD,MAAM,WAAW,GAAG,OAAO,eAAe,KAAK,QAAQ;gBACtD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;gBAC7B,CAAC,CAAC,eAAe,CAAC;YAGnB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;gBACjC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;YAClD,CAAC;YAED,iBAAiB,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;QAExC,CAAC;aAAM,IAAI,UAAU,CAAC,IAAI,KAAK,gBAAgB,IAAI,MAAM,EAAE,CAAC;YAG3D,MAAM,iBAAiB,GAAkB,MAAM,eAAe,CAAC,MAAM,CAAC,CAAA;YAEtE,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAElC,MAAM,cAAc,GAAc,IAAA,2BAAe,EAChD,iBAAiB,EACjB,2BAA2B,CAC3B,CAAC;gBACF,iBAAiB,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;YAC3C,CAAC;QACF,CAAC;aAAM,CAAC;YAEP,MAAM,EAAE,eAAe,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,GAAG,YAAY,EAAE,GAAG,UAAU,CAAC;YAChH,iBAAiB,CAAC,IAAI,CAAC,YAAuB,CAAC,CAAC;QACjD,CAAC;IACF,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC1B,CAAC"}
|
|
@@ -12,11 +12,11 @@ export type Message = {
|
|
|
12
12
|
tool_calls?: ToolCall[];
|
|
13
13
|
tool_call_id?: string;
|
|
14
14
|
refusal?: string | null;
|
|
15
|
-
saveToolCallsInChatMemory?: boolean;
|
|
16
|
-
loadToolCallsFromChatMemory?: boolean;
|
|
17
15
|
};
|
|
18
16
|
export type RawMessage = Message & {
|
|
19
17
|
chatHistoryJson?: string | object[] | null;
|
|
18
|
+
saveToolCallsInChatMemory?: boolean;
|
|
19
|
+
loadToolCallsFromChatMemory?: boolean;
|
|
20
20
|
};
|
|
21
21
|
type Choice = {
|
|
22
22
|
index: number;
|
|
@@ -8,6 +8,7 @@ const omit_1 = __importDefault(require("lodash/omit"));
|
|
|
8
8
|
const types_1 = require("../messages/types");
|
|
9
9
|
function prepareRequestBody(model, messages, tools, tool_choice, response_format, options, customParameters) {
|
|
10
10
|
(0, types_1.validateMessages)(messages);
|
|
11
|
+
messages = messages.filter((msg) => msg.content !== '' || (msg.role === 'assistant' && msg.tool_calls && msg.tool_calls.length > 0));
|
|
11
12
|
let customParamsObj = {};
|
|
12
13
|
if (customParameters) {
|
|
13
14
|
if (typeof customParameters === 'string' && customParameters.trim()) {
|
|
@@ -26,13 +27,19 @@ function prepareRequestBody(model, messages, tools, tool_choice, response_format
|
|
|
26
27
|
'customParameters',
|
|
27
28
|
'fallbackModelId',
|
|
28
29
|
'maxToolsIterations',
|
|
30
|
+
'reasoning_effort',
|
|
29
31
|
]);
|
|
32
|
+
const reasoningEffort = options.reasoning_effort;
|
|
33
|
+
const reasoning = reasoningEffort && reasoningEffort !== ''
|
|
34
|
+
? { reasoning: { effort: reasoningEffort } }
|
|
35
|
+
: undefined;
|
|
30
36
|
const body = {
|
|
31
37
|
model,
|
|
32
38
|
messages,
|
|
33
39
|
...(tools.length > 0 ? { tools } : {}),
|
|
34
40
|
tool_choice,
|
|
35
41
|
response_format,
|
|
42
|
+
...reasoning,
|
|
36
43
|
...cleanOptions,
|
|
37
44
|
...customParamsObj,
|
|
38
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/request/body.ts"],"names":[],"mappings":";;;;;AAOA,
|
|
1
|
+
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/request/body.ts"],"names":[],"mappings":";;;;;AAOA,gDAwDC;AA9DD,uDAAgC;AAChC,6CAAqD;AAKrD,SAAgB,kBAAkB,CACjC,KAAa,EACb,QAAuB,EACvB,KAAY,EACZ,WAA+B,EAC/B,eAAwC,EACxC,OAAoB,EACpB,gBAAsC;IAGtC,IAAA,wBAAgB,EAAC,QAAQ,CAAC,CAAC;IAG3B,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAQ,EAAE,EAAE,CACvC,GAAG,CAAC,OAAO,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAC/F,CAAC;IAEF,IAAI,eAAe,GAAgB,EAAE,CAAC;IACtC,IAAI,gBAAgB,EAAE,CAAC;QACtB,IAAI,OAAO,gBAAgB,KAAK,QAAQ,IAAI,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC;YACrE,IAAI,CAAC;gBACJ,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,KAAK,EAA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