n8n-nodes-base 1.88.0 → 1.89.0
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/Aws.credentials.js +16 -2
- package/dist/credentials/Aws.credentials.js.map +1 -1
- package/dist/nodes/Airtable/v2/actions/record/update.operation.js +15 -3
- package/dist/nodes/Airtable/v2/actions/record/update.operation.js.map +1 -1
- package/dist/nodes/Form/utils.js +2 -7
- package/dist/nodes/Form/utils.js.map +1 -1
- package/dist/nodes/Freshdesk/Freshdesk.node.js +3 -6
- package/dist/nodes/Freshdesk/Freshdesk.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/Description.js +8 -0
- package/dist/nodes/HttpRequest/V3/Description.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +23 -5
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
- package/dist/nodes/HttpRequest/shared/optimizeResponse.js +387 -0
- package/dist/nodes/HttpRequest/shared/optimizeResponse.js.map +1 -0
- package/dist/nodes/Hubspot/V2/HubspotV2.node.js +10 -2
- package/dist/nodes/Hubspot/V2/HubspotV2.node.js.map +1 -1
- package/dist/nodes/LinkedIn/GenericFunctions.js +1 -1
- package/dist/nodes/LinkedIn/GenericFunctions.js.map +1 -1
- package/dist/nodes/Postgres/v2/helpers/utils.js +3 -1
- package/dist/nodes/Postgres/v2/helpers/utils.js.map +1 -1
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js +57 -48
- package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js.map +1 -1
- package/dist/nodes/Supabase/GenericFunctions.js +13 -4
- package/dist/nodes/Supabase/GenericFunctions.js.map +1 -1
- package/dist/nodes/Supabase/RowDescription.js +1 -0
- package/dist/nodes/Supabase/RowDescription.js.map +1 -1
- package/dist/nodes/Supabase/Supabase.node.js +17 -0
- package/dist/nodes/Supabase/Supabase.node.js.map +1 -1
- package/dist/nodes/Telegram/TelegramTrigger.node.js +4 -60
- package/dist/nodes/Telegram/TelegramTrigger.node.js.map +1 -1
- package/dist/nodes/Telegram/util/triggerUtils.js +88 -0
- package/dist/nodes/Telegram/util/triggerUtils.js.map +1 -0
- package/dist/nodes/Wait/Wait.node.js +5 -6
- package/dist/nodes/Wait/Wait.node.js.map +1 -1
- package/dist/test/nodes/Helpers.js +4 -2
- package/dist/test/nodes/Helpers.js.map +1 -1
- package/dist/test/nodes/TriggerHelpers.js +5 -2
- package/dist/test/nodes/TriggerHelpers.js.map +1 -1
- package/dist/types/nodes.json +5 -5
- package/package.json +8 -6
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var optimizeResponse_exports = {};
|
|
30
|
+
__export(optimizeResponse_exports, {
|
|
31
|
+
configureResponseOptimizer: () => configureResponseOptimizer,
|
|
32
|
+
optimizeResponseProperties: () => optimizeResponseProperties
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(optimizeResponse_exports);
|
|
35
|
+
var import_readability = require("@mozilla/readability");
|
|
36
|
+
var cheerio = __toESM(require("cheerio"));
|
|
37
|
+
var import_html_to_text = require("html-to-text");
|
|
38
|
+
var import_jsdom = require("jsdom");
|
|
39
|
+
var import_lodash = require("lodash");
|
|
40
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
41
|
+
function htmlOptimizer(ctx, itemIndex, maxLength) {
|
|
42
|
+
const cssSelector = ctx.getNodeParameter("cssSelector", itemIndex, "");
|
|
43
|
+
const onlyContent = ctx.getNodeParameter("onlyContent", itemIndex, false);
|
|
44
|
+
let elementsToOmit = [];
|
|
45
|
+
if (onlyContent) {
|
|
46
|
+
const elementsToOmitUi = ctx.getNodeParameter("elementsToOmit", itemIndex, "");
|
|
47
|
+
if (typeof elementsToOmitUi === "string") {
|
|
48
|
+
elementsToOmit = elementsToOmitUi.split(",").filter((s) => s).map((s) => s.trim());
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return (response) => {
|
|
52
|
+
if (typeof response !== "string") {
|
|
53
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
54
|
+
ctx.getNode(),
|
|
55
|
+
`The response type must be a string. Received: ${typeof response}`,
|
|
56
|
+
{ itemIndex }
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
const returnData = [];
|
|
60
|
+
const html = cheerio.load(response);
|
|
61
|
+
const htmlElements = html(cssSelector);
|
|
62
|
+
htmlElements.each((_, el) => {
|
|
63
|
+
let value = html(el).html() || "";
|
|
64
|
+
if (onlyContent) {
|
|
65
|
+
let htmlToTextOptions;
|
|
66
|
+
if (elementsToOmit?.length) {
|
|
67
|
+
htmlToTextOptions = {
|
|
68
|
+
selectors: elementsToOmit.map((selector) => ({
|
|
69
|
+
selector,
|
|
70
|
+
format: "skip"
|
|
71
|
+
}))
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
value = (0, import_html_to_text.convert)(value, htmlToTextOptions);
|
|
75
|
+
}
|
|
76
|
+
value = value.trim().replace(/^\s+|\s+$/g, "").replace(/(\r\n|\n|\r)/gm, "").replace(/\s+/g, " ");
|
|
77
|
+
returnData.push(value);
|
|
78
|
+
});
|
|
79
|
+
const text = JSON.stringify(returnData, null, 2);
|
|
80
|
+
if (maxLength > 0 && text.length > maxLength) {
|
|
81
|
+
return text.substring(0, maxLength);
|
|
82
|
+
}
|
|
83
|
+
return text;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const textOptimizer = (ctx, itemIndex, maxLength) => {
|
|
87
|
+
return (response) => {
|
|
88
|
+
if (typeof response === "object") {
|
|
89
|
+
try {
|
|
90
|
+
response = JSON.stringify(response, null, 2);
|
|
91
|
+
} catch (error) {
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (typeof response !== "string") {
|
|
95
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
96
|
+
ctx.getNode(),
|
|
97
|
+
`The response type must be a string. Received: ${typeof response}`,
|
|
98
|
+
{ itemIndex }
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
const dom = new import_jsdom.JSDOM(response);
|
|
102
|
+
const article = new import_readability.Readability(dom.window.document, {
|
|
103
|
+
keepClasses: true
|
|
104
|
+
}).parse();
|
|
105
|
+
const text = article?.textContent || "";
|
|
106
|
+
if (maxLength > 0 && text.length > maxLength) {
|
|
107
|
+
return text.substring(0, maxLength);
|
|
108
|
+
}
|
|
109
|
+
return text;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
const jsonOptimizer = (ctx, itemIndex) => {
|
|
113
|
+
return (response) => {
|
|
114
|
+
let responseData = response;
|
|
115
|
+
if (typeof response === "string") {
|
|
116
|
+
try {
|
|
117
|
+
responseData = (0, import_n8n_workflow.jsonParse)(response, { errorMessage: "Invalid JSON response" });
|
|
118
|
+
} catch (error) {
|
|
119
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
120
|
+
ctx.getNode(),
|
|
121
|
+
`Received invalid JSON from response '${response}'`,
|
|
122
|
+
{ itemIndex }
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (typeof responseData !== "object" || !responseData) {
|
|
127
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
128
|
+
ctx.getNode(),
|
|
129
|
+
"The response type must be an object or an array of objects",
|
|
130
|
+
{ itemIndex }
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
const dataField = ctx.getNodeParameter("dataField", itemIndex, "");
|
|
134
|
+
let returnData = [];
|
|
135
|
+
if (!Array.isArray(responseData)) {
|
|
136
|
+
if (dataField) {
|
|
137
|
+
if (!Object.prototype.hasOwnProperty.call(responseData, dataField)) {
|
|
138
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
139
|
+
ctx.getNode(),
|
|
140
|
+
`Target field "${dataField}" not found in response.`,
|
|
141
|
+
{
|
|
142
|
+
itemIndex,
|
|
143
|
+
description: `The response contained these fields: [${Object.keys(responseData).join(", ")}]`
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
const data = responseData[dataField];
|
|
148
|
+
if (Array.isArray(data)) {
|
|
149
|
+
responseData = data;
|
|
150
|
+
} else {
|
|
151
|
+
responseData = [data];
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
responseData = [responseData];
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
if (dataField) {
|
|
158
|
+
responseData = responseData.map((data) => data[dataField]);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const fieldsToInclude = ctx.getNodeParameter("fieldsToInclude", itemIndex, "all");
|
|
162
|
+
let fields = [];
|
|
163
|
+
if (fieldsToInclude !== "all") {
|
|
164
|
+
fields = ctx.getNodeParameter("fields", itemIndex, []);
|
|
165
|
+
if (typeof fields === "string") {
|
|
166
|
+
fields = fields.split(",").map((field) => field.trim());
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
returnData = responseData;
|
|
170
|
+
}
|
|
171
|
+
if (fieldsToInclude === "selected") {
|
|
172
|
+
for (const item of responseData) {
|
|
173
|
+
const newItem = {};
|
|
174
|
+
for (const field of fields) {
|
|
175
|
+
(0, import_lodash.set)(newItem, field, (0, import_lodash.get)(item, field));
|
|
176
|
+
}
|
|
177
|
+
returnData.push(newItem);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (fieldsToInclude === "except") {
|
|
181
|
+
for (const item of responseData) {
|
|
182
|
+
for (const field of fields) {
|
|
183
|
+
(0, import_lodash.unset)(item, field);
|
|
184
|
+
}
|
|
185
|
+
returnData.push(item);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return returnData;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
const configureResponseOptimizer = (ctx, itemIndex) => {
|
|
192
|
+
const optimizeResponse = ctx.getNodeParameter("optimizeResponse", itemIndex, false);
|
|
193
|
+
if (optimizeResponse) {
|
|
194
|
+
const responseType = ctx.getNodeParameter("responseType", itemIndex);
|
|
195
|
+
let maxLength = 0;
|
|
196
|
+
const truncateResponse = ctx.getNodeParameter("truncateResponse", itemIndex, false);
|
|
197
|
+
if (truncateResponse) {
|
|
198
|
+
maxLength = ctx.getNodeParameter("maxLength", itemIndex, 0);
|
|
199
|
+
}
|
|
200
|
+
switch (responseType) {
|
|
201
|
+
case "html":
|
|
202
|
+
return htmlOptimizer(ctx, itemIndex, maxLength);
|
|
203
|
+
case "text":
|
|
204
|
+
return textOptimizer(ctx, itemIndex, maxLength);
|
|
205
|
+
case "json":
|
|
206
|
+
return jsonOptimizer(ctx, itemIndex);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return (x) => x;
|
|
210
|
+
};
|
|
211
|
+
const optimizeResponseProperties = [
|
|
212
|
+
{
|
|
213
|
+
displayName: "Optimize Response",
|
|
214
|
+
name: "optimizeResponse",
|
|
215
|
+
type: "boolean",
|
|
216
|
+
default: false,
|
|
217
|
+
noDataExpression: true,
|
|
218
|
+
description: "Whether the optimize the tool response to reduce amount of data passed to the LLM that could lead to better result and reduce cost"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
displayName: "Expected Response Type",
|
|
222
|
+
name: "responseType",
|
|
223
|
+
type: "options",
|
|
224
|
+
displayOptions: {
|
|
225
|
+
show: {
|
|
226
|
+
optimizeResponse: [true]
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
options: [
|
|
230
|
+
{
|
|
231
|
+
name: "JSON",
|
|
232
|
+
value: "json"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "HTML",
|
|
236
|
+
value: "html"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "Text",
|
|
240
|
+
value: "text"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
default: "json"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
displayName: "Field Containing Data",
|
|
247
|
+
name: "dataField",
|
|
248
|
+
type: "string",
|
|
249
|
+
default: "",
|
|
250
|
+
placeholder: "e.g. records",
|
|
251
|
+
description: "Specify the name of the field in the response containing the data",
|
|
252
|
+
hint: "leave blank to use whole response",
|
|
253
|
+
requiresDataPath: "single",
|
|
254
|
+
displayOptions: {
|
|
255
|
+
show: {
|
|
256
|
+
optimizeResponse: [true],
|
|
257
|
+
responseType: ["json"]
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
displayName: "Include Fields",
|
|
263
|
+
name: "fieldsToInclude",
|
|
264
|
+
type: "options",
|
|
265
|
+
description: "What fields response object should include",
|
|
266
|
+
default: "all",
|
|
267
|
+
displayOptions: {
|
|
268
|
+
show: {
|
|
269
|
+
optimizeResponse: [true],
|
|
270
|
+
responseType: ["json"]
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
options: [
|
|
274
|
+
{
|
|
275
|
+
name: "All",
|
|
276
|
+
value: "all",
|
|
277
|
+
description: "Include all fields"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: "Selected",
|
|
281
|
+
value: "selected",
|
|
282
|
+
description: "Include only fields specified below"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: "Except",
|
|
286
|
+
value: "except",
|
|
287
|
+
description: "Exclude fields specified below"
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
displayName: "Fields",
|
|
293
|
+
name: "fields",
|
|
294
|
+
type: "string",
|
|
295
|
+
default: "",
|
|
296
|
+
placeholder: "e.g. field1,field2",
|
|
297
|
+
description: "Comma-separated list of the field names. Supports dot notation. You can drag the selected fields from the input panel.",
|
|
298
|
+
requiresDataPath: "multiple",
|
|
299
|
+
displayOptions: {
|
|
300
|
+
show: {
|
|
301
|
+
optimizeResponse: [true],
|
|
302
|
+
responseType: ["json"]
|
|
303
|
+
},
|
|
304
|
+
hide: {
|
|
305
|
+
fieldsToInclude: ["all"]
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
displayName: "Selector (CSS)",
|
|
311
|
+
name: "cssSelector",
|
|
312
|
+
type: "string",
|
|
313
|
+
description: "Select specific element(e.g. body) or multiple elements(e.g. div) of chosen type in the response HTML.",
|
|
314
|
+
placeholder: "e.g. body",
|
|
315
|
+
default: "body",
|
|
316
|
+
displayOptions: {
|
|
317
|
+
show: {
|
|
318
|
+
optimizeResponse: [true],
|
|
319
|
+
responseType: ["html"]
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
displayName: "Return Only Content",
|
|
325
|
+
name: "onlyContent",
|
|
326
|
+
type: "boolean",
|
|
327
|
+
default: false,
|
|
328
|
+
description: "Whether to return only content of html elements, stripping html tags and attributes",
|
|
329
|
+
hint: "Uses less tokens and may be easier for model to understand",
|
|
330
|
+
displayOptions: {
|
|
331
|
+
show: {
|
|
332
|
+
optimizeResponse: [true],
|
|
333
|
+
responseType: ["html"]
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
displayName: "Elements To Omit",
|
|
339
|
+
name: "elementsToOmit",
|
|
340
|
+
type: "string",
|
|
341
|
+
displayOptions: {
|
|
342
|
+
show: {
|
|
343
|
+
optimizeResponse: [true],
|
|
344
|
+
responseType: ["html"],
|
|
345
|
+
onlyContent: [true]
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
default: "",
|
|
349
|
+
placeholder: "e.g. img, .className, #ItemId",
|
|
350
|
+
description: "Comma-separated list of selectors that would be excluded when extracting content"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
displayName: "Truncate Response",
|
|
354
|
+
name: "truncateResponse",
|
|
355
|
+
type: "boolean",
|
|
356
|
+
default: false,
|
|
357
|
+
hint: "Helps save tokens",
|
|
358
|
+
displayOptions: {
|
|
359
|
+
show: {
|
|
360
|
+
optimizeResponse: [true],
|
|
361
|
+
responseType: ["text", "html"]
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
displayName: "Max Response Characters",
|
|
367
|
+
name: "maxLength",
|
|
368
|
+
type: "number",
|
|
369
|
+
default: 1e3,
|
|
370
|
+
typeOptions: {
|
|
371
|
+
minValue: 1
|
|
372
|
+
},
|
|
373
|
+
displayOptions: {
|
|
374
|
+
show: {
|
|
375
|
+
optimizeResponse: [true],
|
|
376
|
+
responseType: ["text", "html"],
|
|
377
|
+
truncateResponse: [true]
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
];
|
|
382
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
383
|
+
0 && (module.exports = {
|
|
384
|
+
configureResponseOptimizer,
|
|
385
|
+
optimizeResponseProperties
|
|
386
|
+
});
|
|
387
|
+
//# sourceMappingURL=optimizeResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/HttpRequest/shared/optimizeResponse.ts"],"sourcesContent":["import { Readability } from '@mozilla/readability';\nimport * as cheerio from 'cheerio';\nimport { convert } from 'html-to-text';\nimport { JSDOM } from 'jsdom';\nimport { get, set, unset } from 'lodash';\nimport {\n\ttype INodeProperties,\n\tjsonParse,\n\tNodeOperationError,\n\ttype IDataObject,\n\ttype IExecuteFunctions,\n} from 'n8n-workflow';\n\ntype ResponseOptimizerFn = (\n\tx: IDataObject | IDataObject[] | string,\n) => IDataObject | IDataObject[] | string;\n\nfunction htmlOptimizer(\n\tctx: IExecuteFunctions,\n\titemIndex: number,\n\tmaxLength: number,\n): ResponseOptimizerFn {\n\tconst cssSelector = ctx.getNodeParameter('cssSelector', itemIndex, '') as string;\n\tconst onlyContent = ctx.getNodeParameter('onlyContent', itemIndex, false) as boolean;\n\tlet elementsToOmit: string[] = [];\n\n\tif (onlyContent) {\n\t\tconst elementsToOmitUi = ctx.getNodeParameter('elementsToOmit', itemIndex, '') as\n\t\t\t| string\n\t\t\t| string[];\n\n\t\tif (typeof elementsToOmitUi === 'string') {\n\t\t\telementsToOmit = elementsToOmitUi\n\t\t\t\t.split(',')\n\t\t\t\t.filter((s) => s)\n\t\t\t\t.map((s) => s.trim());\n\t\t}\n\t}\n\n\treturn (response) => {\n\t\tif (typeof response !== 'string') {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t`The response type must be a string. Received: ${typeof response}`,\n\t\t\t\t{ itemIndex },\n\t\t\t);\n\t\t}\n\t\tconst returnData: string[] = [];\n\n\t\tconst html = cheerio.load(response);\n\t\tconst htmlElements = html(cssSelector);\n\n\t\thtmlElements.each((_, el) => {\n\t\t\tlet value = html(el).html() || '';\n\n\t\t\tif (onlyContent) {\n\t\t\t\tlet htmlToTextOptions;\n\n\t\t\t\tif (elementsToOmit?.length) {\n\t\t\t\t\thtmlToTextOptions = {\n\t\t\t\t\t\tselectors: elementsToOmit.map((selector) => ({\n\t\t\t\t\t\t\tselector,\n\t\t\t\t\t\t\tformat: 'skip',\n\t\t\t\t\t\t})),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tvalue = convert(value, htmlToTextOptions);\n\t\t\t}\n\n\t\t\tvalue = value\n\t\t\t\t.trim()\n\t\t\t\t.replace(/^\\s+|\\s+$/g, '')\n\t\t\t\t.replace(/(\\r\\n|\\n|\\r)/gm, '')\n\t\t\t\t.replace(/\\s+/g, ' ');\n\n\t\t\treturnData.push(value);\n\t\t});\n\n\t\tconst text = JSON.stringify(returnData, null, 2);\n\n\t\tif (maxLength > 0 && text.length > maxLength) {\n\t\t\treturn text.substring(0, maxLength);\n\t\t}\n\n\t\treturn text;\n\t};\n}\n\nconst textOptimizer = (\n\tctx: IExecuteFunctions,\n\titemIndex: number,\n\tmaxLength: number,\n): ResponseOptimizerFn => {\n\treturn (response) => {\n\t\tif (typeof response === 'object') {\n\t\t\ttry {\n\t\t\t\tresponse = JSON.stringify(response, null, 2);\n\t\t\t} catch (error) {}\n\t\t}\n\n\t\tif (typeof response !== 'string') {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t`The response type must be a string. Received: ${typeof response}`,\n\t\t\t\t{ itemIndex },\n\t\t\t);\n\t\t}\n\n\t\tconst dom = new JSDOM(response);\n\t\tconst article = new Readability(dom.window.document, {\n\t\t\tkeepClasses: true,\n\t\t}).parse();\n\n\t\tconst text = article?.textContent || '';\n\n\t\tif (maxLength > 0 && text.length > maxLength) {\n\t\t\treturn text.substring(0, maxLength);\n\t\t}\n\n\t\treturn text;\n\t};\n};\n\nconst jsonOptimizer = (ctx: IExecuteFunctions, itemIndex: number): ResponseOptimizerFn => {\n\treturn (response) => {\n\t\tlet responseData: IDataObject | IDataObject[] | string | null = response;\n\n\t\tif (typeof response === 'string') {\n\t\t\ttry {\n\t\t\t\tresponseData = jsonParse(response, { errorMessage: 'Invalid JSON response' });\n\t\t\t} catch (error) {\n\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\tctx.getNode(),\n\t\t\t\t\t`Received invalid JSON from response '${response}'`,\n\t\t\t\t\t{ itemIndex },\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (typeof responseData !== 'object' || !responseData) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t'The response type must be an object or an array of objects',\n\t\t\t\t{ itemIndex },\n\t\t\t);\n\t\t}\n\n\t\tconst dataField = ctx.getNodeParameter('dataField', itemIndex, '') as string;\n\t\tlet returnData: IDataObject[] = [];\n\n\t\tif (!Array.isArray(responseData)) {\n\t\t\tif (dataField) {\n\t\t\t\tif (!Object.prototype.hasOwnProperty.call(responseData, dataField)) {\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tctx.getNode(),\n\t\t\t\t\t\t`Target field \"${dataField}\" not found in response.`,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\tdescription: `The response contained these fields: [${Object.keys(responseData).join(', ')}]`,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst data = responseData[dataField] as IDataObject | IDataObject[];\n\n\t\t\t\tif (Array.isArray(data)) {\n\t\t\t\t\tresponseData = data;\n\t\t\t\t} else {\n\t\t\t\t\tresponseData = [data];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresponseData = [responseData];\n\t\t\t}\n\t\t} else {\n\t\t\tif (dataField) {\n\t\t\t\tresponseData = responseData.map((data) => data[dataField]) as IDataObject[];\n\t\t\t}\n\t\t}\n\n\t\tconst fieldsToInclude = ctx.getNodeParameter('fieldsToInclude', itemIndex, 'all') as\n\t\t\t| 'all'\n\t\t\t| 'selected'\n\t\t\t| 'except';\n\n\t\tlet fields: string | string[] = [];\n\n\t\tif (fieldsToInclude !== 'all') {\n\t\t\tfields = ctx.getNodeParameter('fields', itemIndex, []) as string[] | string;\n\n\t\t\tif (typeof fields === 'string') {\n\t\t\t\tfields = fields.split(',').map((field) => field.trim());\n\t\t\t}\n\t\t} else {\n\t\t\treturnData = responseData;\n\t\t}\n\n\t\tif (fieldsToInclude === 'selected') {\n\t\t\tfor (const item of responseData) {\n\t\t\t\tconst newItem: IDataObject = {};\n\n\t\t\t\tfor (const field of fields) {\n\t\t\t\t\tset(newItem, field, get(item, field));\n\t\t\t\t}\n\n\t\t\t\treturnData.push(newItem);\n\t\t\t}\n\t\t}\n\n\t\tif (fieldsToInclude === 'except') {\n\t\t\tfor (const item of responseData) {\n\t\t\t\tfor (const field of fields) {\n\t\t\t\t\tunset(item, field);\n\t\t\t\t}\n\n\t\t\t\treturnData.push(item);\n\t\t\t}\n\t\t}\n\n\t\treturn returnData;\n\t};\n};\n\nexport const configureResponseOptimizer = (\n\tctx: IExecuteFunctions,\n\titemIndex: number,\n): ResponseOptimizerFn => {\n\tconst optimizeResponse = ctx.getNodeParameter('optimizeResponse', itemIndex, false) as boolean;\n\n\tif (optimizeResponse) {\n\t\tconst responseType = ctx.getNodeParameter('responseType', itemIndex) as\n\t\t\t| 'json'\n\t\t\t| 'text'\n\t\t\t| 'html';\n\n\t\tlet maxLength = 0;\n\t\tconst truncateResponse = ctx.getNodeParameter('truncateResponse', itemIndex, false) as boolean;\n\n\t\tif (truncateResponse) {\n\t\t\tmaxLength = ctx.getNodeParameter('maxLength', itemIndex, 0) as number;\n\t\t}\n\n\t\tswitch (responseType) {\n\t\t\tcase 'html':\n\t\t\t\treturn htmlOptimizer(ctx, itemIndex, maxLength);\n\t\t\tcase 'text':\n\t\t\t\treturn textOptimizer(ctx, itemIndex, maxLength);\n\t\t\tcase 'json':\n\t\t\t\treturn jsonOptimizer(ctx, itemIndex);\n\t\t}\n\t}\n\n\treturn (x) => x;\n};\n\nexport const optimizeResponseProperties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Optimize Response',\n\t\tname: 'optimizeResponse',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tnoDataExpression: true,\n\t\tdescription:\n\t\t\t'Whether the optimize the tool response to reduce amount of data passed to the LLM that could lead to better result and reduce cost',\n\t},\n\t{\n\t\tdisplayName: 'Expected Response Type',\n\t\tname: 'responseType',\n\t\ttype: 'options',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'JSON',\n\t\t\t\tvalue: 'json',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'HTML',\n\t\t\t\tvalue: 'html',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Text',\n\t\t\t\tvalue: 'text',\n\t\t\t},\n\t\t],\n\t\tdefault: 'json',\n\t},\n\t{\n\t\tdisplayName: 'Field Containing Data',\n\t\tname: 'dataField',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. records',\n\t\tdescription: 'Specify the name of the field in the response containing the data',\n\t\thint: 'leave blank to use whole response',\n\t\trequiresDataPath: 'single',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['json'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Include Fields',\n\t\tname: 'fieldsToInclude',\n\t\ttype: 'options',\n\t\tdescription: 'What fields response object should include',\n\t\tdefault: 'all',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['json'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'All',\n\t\t\t\tvalue: 'all',\n\t\t\t\tdescription: 'Include all fields',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Selected',\n\t\t\t\tvalue: 'selected',\n\t\t\t\tdescription: 'Include only fields specified below',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Except',\n\t\t\t\tvalue: 'except',\n\t\t\t\tdescription: 'Exclude fields specified below',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'Fields',\n\t\tname: 'fields',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. field1,field2',\n\t\tdescription:\n\t\t\t'Comma-separated list of the field names. Supports dot notation. You can drag the selected fields from the input panel.',\n\t\trequiresDataPath: 'multiple',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['json'],\n\t\t\t},\n\t\t\thide: {\n\t\t\t\tfieldsToInclude: ['all'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Selector (CSS)',\n\t\tname: 'cssSelector',\n\t\ttype: 'string',\n\t\tdescription:\n\t\t\t'Select specific element(e.g. body) or multiple elements(e.g. div) of chosen type in the response HTML.',\n\t\tplaceholder: 'e.g. body',\n\t\tdefault: 'body',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['html'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Return Only Content',\n\t\tname: 'onlyContent',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to return only content of html elements, stripping html tags and attributes',\n\t\thint: 'Uses less tokens and may be easier for model to understand',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['html'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Elements To Omit',\n\t\tname: 'elementsToOmit',\n\t\ttype: 'string',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['html'],\n\t\t\t\tonlyContent: [true],\n\t\t\t},\n\t\t},\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. img, .className, #ItemId',\n\t\tdescription: 'Comma-separated list of selectors that would be excluded when extracting content',\n\t},\n\t{\n\t\tdisplayName: 'Truncate Response',\n\t\tname: 'truncateResponse',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\thint: 'Helps save tokens',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['text', 'html'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Max Response Characters',\n\t\tname: 'maxLength',\n\t\ttype: 'number',\n\t\tdefault: 1000,\n\t\ttypeOptions: {\n\t\t\tminValue: 1,\n\t\t},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toptimizeResponse: [true],\n\t\t\t\tresponseType: ['text', 'html'],\n\t\t\t\ttruncateResponse: [true],\n\t\t\t},\n\t\t},\n\t},\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAC5B,cAAyB;AACzB,0BAAwB;AACxB,mBAAsB;AACtB,oBAAgC;AAChC,0BAMO;AAMP,SAAS,cACR,KACA,WACA,WACsB;AACtB,QAAM,cAAc,IAAI,iBAAiB,eAAe,WAAW,EAAE;AACrE,QAAM,cAAc,IAAI,iBAAiB,eAAe,WAAW,KAAK;AACxE,MAAI,iBAA2B,CAAC;AAEhC,MAAI,aAAa;AAChB,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AAA,MACf,MAAM;AAAA,QACL,kBAAkB,CAAC,IAAI;AAAA,QACvB,cAAc,CAAC,MAAM;AAAA,MACtB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,kBAAkB,CAAC,IAAI;AAAA,QACvB,cAAc,CAAC,MAAM;AAAA,QACrB,aAAa,CAAC,IAAI;AAAA,MACnB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,IACT,aAAa;AAAA,IACb,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,IACN,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,kBAAkB,CAAC,IAAI;AAAA,QACvB,cAAc,CAAC,QAAQ,MAAM;AAAA,MAC9B;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,MACZ,UAAU;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,kBAAkB,CAAC,IAAI;AAAA,QACvB,cAAc,CAAC,QAAQ,MAAM;AAAA,QAC7B,kBAAkB,CAAC,IAAI;AAAA,MACxB;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
|
@@ -1536,7 +1536,11 @@ class HubspotV2 {
|
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
1538
|
if (body.filterGroups.length > 3) {
|
|
1539
|
-
throw new import_n8n_workflow.NodeOperationError(
|
|
1539
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
1540
|
+
this.getNode(),
|
|
1541
|
+
"You can only have 3 filter groups",
|
|
1542
|
+
{ itemIndex: i }
|
|
1543
|
+
);
|
|
1540
1544
|
}
|
|
1541
1545
|
}
|
|
1542
1546
|
Object.assign(body, additionalFields);
|
|
@@ -2385,7 +2389,11 @@ class HubspotV2 {
|
|
|
2385
2389
|
}
|
|
2386
2390
|
}
|
|
2387
2391
|
if (body.filterGroups.length > 3) {
|
|
2388
|
-
throw new import_n8n_workflow.NodeOperationError(
|
|
2392
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
2393
|
+
this.getNode(),
|
|
2394
|
+
"You can only have 3 filter groups",
|
|
2395
|
+
{ itemIndex: i }
|
|
2396
|
+
);
|
|
2389
2397
|
}
|
|
2390
2398
|
}
|
|
2391
2399
|
Object.assign(body, additionalFields);
|