n8n-nodes-simple 2.2.0 → 2.2.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.
Files changed (44) hide show
  1. package/dist/nodes/shared/config/parameters.d.ts +2 -2
  2. package/dist/nodes/shared/config/parameters.js.map +1 -1
  3. package/dist/nodes/shared/config/properties/output.js +1 -13
  4. package/dist/nodes/shared/config/properties/output.js.map +1 -1
  5. package/dist/nodes/shared/config/properties/toolParameters.d.ts +2 -0
  6. package/dist/nodes/shared/config/properties/toolParameters.js +101 -0
  7. package/dist/nodes/shared/config/properties/toolParameters.js.map +1 -0
  8. package/dist/nodes/shared/core/execution/executor.js +6 -6
  9. package/dist/nodes/shared/core/execution/executor.js.map +1 -1
  10. package/dist/nodes/shared/core/execution/outputData.d.ts +5 -0
  11. package/dist/nodes/shared/core/execution/outputData.js +108 -0
  12. package/dist/nodes/shared/core/execution/outputData.js.map +1 -0
  13. package/dist/nodes/shared/core/memory/supplier.d.ts +2 -0
  14. package/dist/nodes/shared/core/memory/supplier.js +53 -0
  15. package/dist/nodes/shared/core/memory/supplier.js.map +1 -0
  16. package/dist/nodes/shared/core/output/processor.d.ts +5 -0
  17. package/dist/nodes/shared/core/output/processor.js +108 -0
  18. package/dist/nodes/shared/core/output/processor.js.map +1 -0
  19. package/dist/nodes/shared/core/request/body.d.ts +2 -0
  20. package/dist/nodes/shared/core/request/body.js +43 -0
  21. package/dist/nodes/shared/core/request/body.js.map +1 -0
  22. package/dist/nodes/shared/core/request/builder.d.ts +2 -0
  23. package/dist/nodes/shared/core/request/builder.js +43 -0
  24. package/dist/nodes/shared/core/request/builder.js.map +1 -0
  25. package/dist/nodes/shared/core/request/structuredOutput.d.ts +3 -0
  26. package/dist/nodes/shared/core/request/structuredOutput.js +26 -0
  27. package/dist/nodes/shared/core/request/structuredOutput.js.map +1 -0
  28. package/dist/nodes/shared/core/request/visualEditor.d.ts +32 -0
  29. package/dist/nodes/shared/core/request/visualEditor.js +70 -0
  30. package/dist/nodes/shared/core/request/visualEditor.js.map +1 -0
  31. package/dist/nodes/shared/core/response/config.d.ts +3 -0
  32. package/dist/nodes/shared/core/response/config.js +26 -0
  33. package/dist/nodes/shared/core/response/config.js.map +1 -0
  34. package/dist/nodes/shared/core/schema/visualEditor.d.ts +32 -0
  35. package/dist/nodes/shared/core/schema/visualEditor.js +70 -0
  36. package/dist/nodes/shared/core/schema/visualEditor.js.map +1 -0
  37. package/dist/nodes/shared/processing/outputProcessor.js +2 -6
  38. package/dist/nodes/shared/processing/outputProcessor.js.map +1 -1
  39. package/dist/nodes/shared/processing/requestBuilder.d.ts +1 -1
  40. package/dist/nodes/shared/processing/requestBuilder.js +10 -5
  41. package/dist/nodes/shared/processing/requestBuilder.js.map +1 -1
  42. package/dist/package.json +1 -1
  43. package/dist/tsconfig.tsbuildinfo +1 -1
  44. package/package.json +1 -1
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.prepareRequestBody = prepareRequestBody;
7
+ const omit_1 = __importDefault(require("lodash/omit"));
8
+ const types_1 = require("../messages/types");
9
+ function prepareRequestBody(model, messages, tools, tool_choice, response_format, options, customParameters) {
10
+ let customParamsObj = {};
11
+ if (customParameters) {
12
+ if (typeof customParameters === 'string' && customParameters.trim()) {
13
+ try {
14
+ customParamsObj = JSON.parse(customParameters);
15
+ }
16
+ catch (error) {
17
+ throw new Error('Invalid JSON in customParameters');
18
+ }
19
+ }
20
+ else if (typeof customParameters !== 'string') {
21
+ customParamsObj = customParameters;
22
+ }
23
+ }
24
+ const cleanOptions = (0, omit_1.default)(options, [
25
+ 'customParameters',
26
+ 'fallbackModelId',
27
+ 'maxToolsIterations',
28
+ ]);
29
+ const body = {
30
+ model,
31
+ messages,
32
+ ...(tools.length > 0 ? { tools } : {}),
33
+ tool_choice,
34
+ response_format,
35
+ ...cleanOptions,
36
+ ...customParamsObj,
37
+ };
38
+ if (!Array.isArray(messages) || !messages.every(types_1.isValidMessage)) {
39
+ throw new Error("Invalid or missing 'messages' in the request body.");
40
+ }
41
+ return body;
42
+ }
43
+ //# sourceMappingURL=builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/request/builder.ts"],"names":[],"mappings":";;;;;AAOA,gDA6CC;AAnDD,uDAAgC;AAChC,6CAAmD;AAKnD,SAAgB,kBAAkB,CACjC,KAAa,EACb,QAAuB,EACvB,KAAY,EACZ,WAA+B,EAC/B,eAAwC,EACxC,OAAoB,EACpB,gBAAsC;IAEtC,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,EAAE,CAAC;gBAChB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;YACrD,CAAC;QACF,CAAC;aAAM,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE,CAAC;YACjD,eAAe,GAAG,gBAAgB,CAAC;QACpC,CAAC;IACF,CAAC;IAGD,MAAM,YAAY,GAAG,IAAA,cAAK,EAAC,OAAO,EAAE;QACnC,kBAAkB;QAClB,iBAAiB;QACjB,oBAAoB;KACpB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAgB;QACzB,KAAK;QACL,QAAQ;QACR,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,WAAW;QACX,eAAe;QACf,GAAG,YAAY;QACf,GAAG,eAAe;KAClB,CAAC;IAGF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,sBAAc,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { IDataObject } from 'n8n-workflow';
2
+ import { VisualEditorProperties } from './visualEditor';
3
+ export declare function configureResponseFormat(responseFormat: string, outputJsonSchemaDefinition: string, structuredOutputName: string, structuredOutputDescription: string, structuredOutputProperties: VisualEditorProperties[], structuredOutputIsArray: boolean, structuredOutputArrayName: string, structuredOutputArrayDescription: string): IDataObject | undefined;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.configureResponseFormat = configureResponseFormat;
4
+ const visualEditor_1 = require("./visualEditor");
5
+ function configureResponseFormat(responseFormat, outputJsonSchemaDefinition, structuredOutputName, structuredOutputDescription, structuredOutputProperties, structuredOutputIsArray, structuredOutputArrayName, structuredOutputArrayDescription) {
6
+ let response_format;
7
+ if (responseFormat === 'structuredOutputSchema') {
8
+ response_format = { type: 'json_schema', json_schema: JSON.parse(outputJsonSchemaDefinition) };
9
+ }
10
+ else if (responseFormat === 'structuredOutputVisual') {
11
+ response_format = {
12
+ type: 'json_schema',
13
+ json_schema: {
14
+ name: structuredOutputName,
15
+ ...(structuredOutputDescription.trim() && { description: structuredOutputDescription }),
16
+ schema: (0, visualEditor_1.convertVisualEditorToSchema)(structuredOutputProperties, structuredOutputIsArray, structuredOutputArrayName, structuredOutputArrayDescription),
17
+ strict: true,
18
+ },
19
+ };
20
+ }
21
+ else if (responseFormat === 'jsonMode') {
22
+ response_format = { type: 'json_object' };
23
+ }
24
+ return response_format;
25
+ }
26
+ //# sourceMappingURL=structuredOutput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structuredOutput.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/request/structuredOutput.ts"],"names":[],"mappings":";;AAMA,0DAiCC;AAtCD,iDAAqF;AAKrF,SAAgB,uBAAuB,CACtC,cAAsB,EACtB,0BAAkC,EAClC,oBAA4B,EAC5B,2BAAmC,EACnC,0BAAoD,EACpD,uBAAgC,EAChC,yBAAiC,EACjC,gCAAwC;IAExC,IAAI,eAAe,CAAC;IACpB,IAAI,cAAc,KAAK,wBAAwB,EAAE,CAAC;QACjD,eAAe,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC;IAChG,CAAC;SAAM,IAAI,cAAc,KAAK,wBAAwB,EAAE,CAAC;QACxD,eAAe,GAAG;YACjB,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE;gBACZ,IAAI,EAAE,oBAAoB;gBAC1B,GAAG,CAAC,2BAA2B,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;gBACvF,MAAM,EAAE,IAAA,0CAA2B,EAClC,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,gCAAgC,CAChC;gBACD,MAAM,EAAE,IAAI;aACZ;SACD,CAAC;IACH,CAAC;SAAM,IAAI,cAAc,KAAK,UAAU,EAAE,CAAC;QAC1C,eAAe,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IAC3C,CAAC;IAED,OAAO,eAAe,CAAC;AACxB,CAAC"}
@@ -0,0 +1,32 @@
1
+ export type VisualEditorProperties = {
2
+ name: string;
3
+ type: string;
4
+ description: string;
5
+ isEnum: boolean;
6
+ enumValues?: string[];
7
+ elementDescription?: string;
8
+ isOptional: boolean;
9
+ };
10
+ type SchemaProperty = {
11
+ name?: string;
12
+ type?: string | string[];
13
+ enum?: string[];
14
+ description?: string;
15
+ items?: SchemaProperty | RefProperty;
16
+ properties?: Record<string, SchemaProperty>;
17
+ $ref?: string;
18
+ required?: string[];
19
+ additionalProperties?: boolean;
20
+ };
21
+ type RefProperty = {
22
+ $ref: string;
23
+ };
24
+ type Schema = {
25
+ type: 'object';
26
+ properties: Record<string, SchemaProperty>;
27
+ required: string[];
28
+ additionalProperties: false;
29
+ $defs?: Record<string, Schema>;
30
+ };
31
+ export declare function convertVisualEditorToSchema(visualEditorProperties: VisualEditorProperties[], structuredOutputIsArray?: boolean, structuredOutputArrayName?: string, structuredOutputArrayDescription?: string): Schema;
32
+ export {};
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertVisualEditorToSchema = convertVisualEditorToSchema;
4
+ function convertVisualEditorToSchema(visualEditorProperties, structuredOutputIsArray = false, structuredOutputArrayName = '', structuredOutputArrayDescription = '') {
5
+ var _a, _b;
6
+ const properties = {};
7
+ const required = [];
8
+ for (var visualProperty of visualEditorProperties) {
9
+ var propertyIsArray = visualProperty.type === 'stringArray';
10
+ var baseType = propertyIsArray ? 'string' : visualProperty.type;
11
+ var property = {
12
+ type: visualProperty.isOptional ? [baseType, 'null'] : baseType,
13
+ };
14
+ if (propertyIsArray && visualProperty.description.trim()) {
15
+ property.description = visualProperty.elementDescription;
16
+ }
17
+ if (!propertyIsArray && visualProperty.description.trim()) {
18
+ property.description = visualProperty.description;
19
+ }
20
+ if (visualProperty.isEnum) {
21
+ property.enum = visualProperty.enumValues;
22
+ }
23
+ if (propertyIsArray) {
24
+ const arrayProperty = {
25
+ type: visualProperty.isOptional ? ['array', 'null'] : 'array',
26
+ ...(((_a = visualProperty.description) === null || _a === void 0 ? void 0 : _a.trim()) && { description: visualProperty.description }),
27
+ items: {
28
+ type: baseType,
29
+ ...(((_b = visualProperty.elementDescription) === null || _b === void 0 ? void 0 : _b.trim()) && {
30
+ description: visualProperty.elementDescription,
31
+ }),
32
+ ...(visualProperty.isEnum && { enum: visualProperty.enumValues }),
33
+ },
34
+ };
35
+ properties[visualProperty.name] = arrayProperty;
36
+ }
37
+ else {
38
+ properties[visualProperty.name] = property;
39
+ }
40
+ required.push(visualProperty.name);
41
+ }
42
+ if (structuredOutputIsArray) {
43
+ return {
44
+ type: 'object',
45
+ properties: {
46
+ [structuredOutputArrayName]: {
47
+ type: 'array',
48
+ ...(structuredOutputArrayDescription.trim() && {
49
+ description: structuredOutputArrayDescription,
50
+ }),
51
+ items: {
52
+ type: 'object',
53
+ properties,
54
+ required,
55
+ additionalProperties: false,
56
+ },
57
+ },
58
+ },
59
+ required: [structuredOutputArrayName],
60
+ additionalProperties: false,
61
+ };
62
+ }
63
+ return {
64
+ type: 'object',
65
+ properties,
66
+ required,
67
+ additionalProperties: false,
68
+ };
69
+ }
70
+ //# sourceMappingURL=visualEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visualEditor.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/request/visualEditor.ts"],"names":[],"mappings":";;AAmCA,kEA+EC;AA/ED,SAAgB,2BAA2B,CAC1C,sBAAgD,EAChD,0BAAmC,KAAK,EACxC,4BAAoC,EAAE,EACtC,mCAA2C,EAAE;;IAE7C,MAAM,UAAU,GAAmC,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,IAAI,cAAc,IAAI,sBAAsB,EAAE,CAAC;QACnD,IAAI,eAAe,GAAY,cAAc,CAAC,IAAI,KAAK,aAAa,CAAC;QAErE,IAAI,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC;QAChE,IAAI,QAAQ,GAAmB;YAC9B,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ;SAC/D,CAAC;QAEF,IAAI,eAAe,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC;YAC1D,QAAQ,CAAC,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,IAAI,EAAE,OAAO;oBACb,GAAG,CAAC,gCAAgC,CAAC,IAAI,EAAE,IAAI;wBAC9C,WAAW,EAAE,gCAAgC;qBAC7C,CAAC;oBACF,KAAK,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,UAAU;wBACV,QAAQ;wBACR,oBAAoB,EAAE,KAAK;qBAC3B;iBACD;aACD;YACD,QAAQ,EAAE,CAAC,yBAAyB,CAAC;YACrC,oBAAoB,EAAE,KAAK;SAC3B,CAAC;IACH,CAAC;IAED,OAAO;QACN,IAAI,EAAE,QAAQ;QACd,UAAU;QACV,QAAQ;QACR,oBAAoB,EAAE,KAAK;KAC3B,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { IDataObject } from 'n8n-workflow';
2
+ import { VisualEditorProperties } from '../schema/visualEditor';
3
+ export declare function configureResponseFormat(responseFormat: string, outputJsonSchemaDefinition: string, structuredOutputName: string, structuredOutputDescription: string, structuredOutputProperties: VisualEditorProperties[], structuredOutputIsArray: boolean, structuredOutputArrayName: string, structuredOutputArrayDescription: string): IDataObject | undefined;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.configureResponseFormat = configureResponseFormat;
4
+ const visualEditor_1 = require("../schema/visualEditor");
5
+ function configureResponseFormat(responseFormat, outputJsonSchemaDefinition, structuredOutputName, structuredOutputDescription, structuredOutputProperties, structuredOutputIsArray, structuredOutputArrayName, structuredOutputArrayDescription) {
6
+ let response_format;
7
+ if (responseFormat === 'structuredOutputSchema') {
8
+ response_format = { type: 'json_schema', json_schema: JSON.parse(outputJsonSchemaDefinition) };
9
+ }
10
+ else if (responseFormat === 'structuredOutputVisual') {
11
+ response_format = {
12
+ type: 'json_schema',
13
+ json_schema: {
14
+ name: structuredOutputName,
15
+ ...(structuredOutputDescription.trim() && { description: structuredOutputDescription }),
16
+ schema: (0, visualEditor_1.convertVisualEditorToSchema)(structuredOutputProperties, structuredOutputIsArray, structuredOutputArrayName, structuredOutputArrayDescription),
17
+ strict: true,
18
+ },
19
+ };
20
+ }
21
+ else if (responseFormat === 'jsonMode') {
22
+ response_format = { type: 'json_object' };
23
+ }
24
+ return response_format;
25
+ }
26
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/response/config.ts"],"names":[],"mappings":";;AAMA,0DAiCC;AAtCD,yDAA6F;AAK7F,SAAgB,uBAAuB,CACtC,cAAsB,EACtB,0BAAkC,EAClC,oBAA4B,EAC5B,2BAAmC,EACnC,0BAAoD,EACpD,uBAAgC,EAChC,yBAAiC,EACjC,gCAAwC;IAExC,IAAI,eAAe,CAAC;IACpB,IAAI,cAAc,KAAK,wBAAwB,EAAE,CAAC;QACjD,eAAe,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC;IAChG,CAAC;SAAM,IAAI,cAAc,KAAK,wBAAwB,EAAE,CAAC;QACxD,eAAe,GAAG;YACjB,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE;gBACZ,IAAI,EAAE,oBAAoB;gBAC1B,GAAG,CAAC,2BAA2B,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;gBACvF,MAAM,EAAE,IAAA,0CAA2B,EAClC,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,gCAAgC,CAChC;gBACD,MAAM,EAAE,IAAI;aACZ;SACD,CAAC;IACH,CAAC;SAAM,IAAI,cAAc,KAAK,UAAU,EAAE,CAAC;QAC1C,eAAe,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IAC3C,CAAC;IAED,OAAO,eAAe,CAAC;AACxB,CAAC"}
@@ -0,0 +1,32 @@
1
+ export type VisualEditorProperties = {
2
+ name: string;
3
+ type: string;
4
+ description: string;
5
+ isEnum: boolean;
6
+ enumValues?: string[];
7
+ elementDescription?: string;
8
+ isOptional: boolean;
9
+ };
10
+ type SchemaProperty = {
11
+ name?: string;
12
+ type?: string | string[];
13
+ enum?: string[];
14
+ description?: string;
15
+ items?: SchemaProperty | RefProperty;
16
+ properties?: Record<string, SchemaProperty>;
17
+ $ref?: string;
18
+ required?: string[];
19
+ additionalProperties?: boolean;
20
+ };
21
+ type RefProperty = {
22
+ $ref: string;
23
+ };
24
+ type Schema = {
25
+ type: 'object';
26
+ properties: Record<string, SchemaProperty>;
27
+ required: string[];
28
+ additionalProperties: false;
29
+ $defs?: Record<string, Schema>;
30
+ };
31
+ export declare function convertVisualEditorToSchema(visualEditorProperties: VisualEditorProperties[], structuredOutputIsArray?: boolean, structuredOutputArrayName?: string, structuredOutputArrayDescription?: string): Schema;
32
+ export {};
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertVisualEditorToSchema = convertVisualEditorToSchema;
4
+ function convertVisualEditorToSchema(visualEditorProperties, structuredOutputIsArray = false, structuredOutputArrayName = '', structuredOutputArrayDescription = '') {
5
+ var _a, _b;
6
+ const properties = {};
7
+ const required = [];
8
+ for (var visualProperty of visualEditorProperties) {
9
+ var propertyIsArray = visualProperty.type === 'stringArray';
10
+ var baseType = propertyIsArray ? 'string' : visualProperty.type;
11
+ var property = {
12
+ type: visualProperty.isOptional ? [baseType, 'null'] : baseType,
13
+ };
14
+ if (propertyIsArray && visualProperty.description.trim()) {
15
+ property.description = visualProperty.elementDescription;
16
+ }
17
+ if (!propertyIsArray && visualProperty.description.trim()) {
18
+ property.description = visualProperty.description;
19
+ }
20
+ if (visualProperty.isEnum) {
21
+ property.enum = visualProperty.enumValues;
22
+ }
23
+ if (propertyIsArray) {
24
+ const arrayProperty = {
25
+ type: visualProperty.isOptional ? ['array', 'null'] : 'array',
26
+ ...(((_a = visualProperty.description) === null || _a === void 0 ? void 0 : _a.trim()) && { description: visualProperty.description }),
27
+ items: {
28
+ type: baseType,
29
+ ...(((_b = visualProperty.elementDescription) === null || _b === void 0 ? void 0 : _b.trim()) && {
30
+ description: visualProperty.elementDescription,
31
+ }),
32
+ ...(visualProperty.isEnum && { enum: visualProperty.enumValues }),
33
+ },
34
+ };
35
+ properties[visualProperty.name] = arrayProperty;
36
+ }
37
+ else {
38
+ properties[visualProperty.name] = property;
39
+ }
40
+ required.push(visualProperty.name);
41
+ }
42
+ if (structuredOutputIsArray) {
43
+ return {
44
+ type: 'object',
45
+ properties: {
46
+ [structuredOutputArrayName]: {
47
+ type: 'array',
48
+ ...(structuredOutputArrayDescription.trim() && {
49
+ description: structuredOutputArrayDescription,
50
+ }),
51
+ items: {
52
+ type: 'object',
53
+ properties,
54
+ required,
55
+ additionalProperties: false,
56
+ },
57
+ },
58
+ },
59
+ required: [structuredOutputArrayName],
60
+ additionalProperties: false,
61
+ };
62
+ }
63
+ return {
64
+ type: 'object',
65
+ properties,
66
+ required,
67
+ additionalProperties: false,
68
+ };
69
+ }
70
+ //# sourceMappingURL=visualEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visualEditor.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/schema/visualEditor.ts"],"names":[],"mappings":";;AAmCA,kEA+EC;AA/ED,SAAgB,2BAA2B,CAC1C,sBAAgD,EAChD,0BAAmC,KAAK,EACxC,4BAAoC,EAAE,EACtC,mCAA2C,EAAE;;IAE7C,MAAM,UAAU,GAAmC,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,IAAI,cAAc,IAAI,sBAAsB,EAAE,CAAC;QACnD,IAAI,eAAe,GAAY,cAAc,CAAC,IAAI,KAAK,aAAa,CAAC;QAErE,IAAI,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC;QAChE,IAAI,QAAQ,GAAmB;YAC9B,IAAI,EAAE,cAAc,CAAC,UAAU,C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IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,uBAAuB,EAAE,CAAC;QAC7B,OAAO;YACN,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACX,CAAC,yBAAyB,CAAC,EAAE;oBAC5B,IAAI,EAAE,OAAO;oBACb,GAAG,CAAC,gCAAgC,CAAC,IAAI,EAAE,IAAI;wBAC9C,WAAW,EAAE,gCAAgC;qBAC7C,CAAC;oBACF,KAAK,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,UAAU;wBACV,QAAQ;wBACR,oBAAoB,EAAE,KAAK;qBAC3B;iBACD;aACD;YACD,QAAQ,EAAE,CAAC,yBAAyB,CAAC;YACrC,oBAAoB,EAAE,KAAK;SAC3B,CAAC;IACH,CAAC;IAED,OAAO;QACN,IAAI,EAAE,QAAQ;QACd,UAAU;QACV,QAAQ;QACR,oBAAoB,EAAE,KAAK;KAC3B,CAAC;AACH,CAAC"}
@@ -39,7 +39,6 @@ async function prepareOutputData(response, output, messages, originalMessagesLen
39
39
  if (addToOutput.includes('chatHistory')) {
40
40
  const includeToolCallsInChatHistory = executeFunctions.getNodeParameter('includeToolCallsInChatHistory', index, true);
41
41
  const includeSystemMessagesInChatHistory = executeFunctions.getNodeParameter('includeSystemMessagesInChatHistory', index, true);
42
- const includeReasoningInChatHistory = executeFunctions.getNodeParameter('includeReasoningInChatHistory', index, false);
43
42
  let chatHistoryMessages = structuredClone(messages);
44
43
  if (!includeToolCallsInChatHistory) {
45
44
  chatHistoryMessages = chatHistoryMessages
@@ -57,13 +56,10 @@ async function prepareOutputData(response, output, messages, originalMessagesLen
57
56
  };
58
57
  chatHistoryMessages.push(rootMessage);
59
58
  }
60
- for (let i = 0; i < chatHistoryMessages.length; i++) {
61
- const msg = chatHistoryMessages[i];
59
+ for (const msg of chatHistoryMessages) {
62
60
  if (msg.role === 'assistant') {
63
61
  delete msg.reasoning_details;
64
- if (!includeReasoningInChatHistory) {
65
- delete msg.reasoning;
66
- }
62
+ delete msg.reasoning;
67
63
  }
68
64
  }
69
65
  outputData.forEach((item) => {
@@ -1 +1 @@
1
- {"version":3,"file":"outputProcessor.js","sourceRoot":"","sources":["../../../../nodes/shared/processing/outputProcessor.ts"],"names":[],"mappings":";;AAcA,8CAmIC;AAKD,4CAkBC;AAKD,kDAgBC;AArLD,qEAAqE;AAM9D,KAAK,UAAU,iBAAiB,CACtC,QAAwB,EACxB,MAAW,EACX,QAAuB,EACvB,sBAA8B,EAC9B,WAAqB,EACrB,SAAiB,EACjB,gBAAmC,EACnC,KAAa,EACb,IAAiB,EACjB,KAAa,EACb,uBAA+B;IAE/B,MAAM,UAAU,GAAyB,EAAE,CAAC;IAG5C,IAAI,SAAS,IAAI,UAAU,IAAI,uBAAuB,KAAK,EAAE,EAAE,CAAC;QAC/D,UAAU,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;YAC5B,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;SACvB,CAAC,CAAC;QACH,OAAO,UAAU,CAAC;IACnB,CAAC;IAGD,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QAC1B,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAClD,IAAI,CAAC;gBACJ,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAC7D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC,CAAA,CAAC;YAClB,OAAO,MAAM,CAAC;QACf,CAAC,CAAC,CAAC;IACJ,CAAC;IAGD,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IAC/D,IAAI,iBAAiB,GAAG,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UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3B,MAAM,SAAS,GAAG;YACjB,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM;YACxB,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO;YAC1B,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU;YAChC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ;YAC5B,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY;YACpC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc;SACxC,CAAC;QAGF,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,WAAW,CAC7B,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CACrE,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -1,2 +1,2 @@
1
1
  import type { IDataObject } from 'n8n-workflow';
2
- export declare function prepareRequestBody(model: string, messages: IDataObject[], tools: any[], tool_choice: string | undefined, response_format: IDataObject | undefined, options: IDataObject, customParameters: string): IDataObject;
2
+ export declare function prepareRequestBody(model: string, messages: IDataObject[], tools: any[], tool_choice: string | undefined, response_format: IDataObject | undefined, options: IDataObject, customParameters: string | IDataObject): IDataObject;
@@ -8,12 +8,17 @@ const omit_1 = __importDefault(require("lodash/omit"));
8
8
  const types_1 = require("../core/messages/types");
9
9
  function prepareRequestBody(model, messages, tools, tool_choice, response_format, options, customParameters) {
10
10
  let customParamsObj = {};
11
- if (customParameters && customParameters.trim()) {
12
- try {
13
- customParamsObj = JSON.parse(customParameters);
11
+ if (customParameters) {
12
+ if (typeof customParameters === 'string' && customParameters.trim()) {
13
+ try {
14
+ customParamsObj = JSON.parse(customParameters);
15
+ }
16
+ catch (error) {
17
+ throw new Error('Invalid JSON in customParameters');
18
+ }
14
19
  }
15
- catch (error) {
16
- throw new Error('Invalid JSON in customParameters');
20
+ else if (typeof customParameters !== 'string') {
21
+ customParamsObj = customParameters;
17
22
  }
18
23
  }
19
24
  const cleanOptions = (0, omit_1.default)(options, [
@@ -1 +1 @@
1
- {"version":3,"file":"requestBuilder.js","sourceRoot":"","sources":["../../../../nodes/shared/processing/requestBuilder.ts"],"names":[],"mappings":";;;;;AAOA,gDAyCC;AA/CD,uDAAgC;AAChC,kDAAwD;AAKxD,SAAgB,kBAAkB,CACjC,KAAa,EACb,QAAuB,EACvB,KAAY,EACZ,WAA+B,EAC/B,eAAwC,EACxC,OAAoB,EACpB,gBAAwB;IAExB,IAAI,eAAe,GAAgB,EAAE,CAAC;IACtC,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC;QACjD,IAAI,CAAC;YACJ,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAgB,CAAC;QAC/D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACrD,CAAC;IACF,CAAC;IAGD,MAAM,YAAY,GAAG,IAAA,cAAK,EAAC,OAAO,EAAE;QACnC,kBAAkB;QAClB,iBAAiB;QACjB,oBAAoB;KACpB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAgB;QACzB,KAAK;QACL,QAAQ;QACR,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,WAAW;QACX,eAAe;QACf,GAAG,YAAY;QACf,GAAG,eAAe;KAClB,CAAC;IAGF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,sBAAc,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"requestBuilder.js","sourceRoot":"","sources":["../../../../nodes/shared/processing/requestBuilder.ts"],"names":[],"mappings":";;;;;AAOA,gDA6CC;AAnDD,uDAAgC;AAChC,kDAAwD;AAKxD,SAAgB,kBAAkB,CACjC,KAAa,EACb,QAAuB,EACvB,KAAY,EACZ,WAA+B,EAC/B,eAAwC,EACxC,OAAoB,EACpB,gBAAsC;IAEtC,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,EAAE,CAAC;gBAChB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;YACrD,CAAC;QACF,CAAC;aAAM,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE,CAAC;YACjD,eAAe,GAAG,gBAAgB,CAAC;QACpC,CAAC;IACF,CAAC;IAGD,MAAM,YAAY,GAAG,IAAA,cAAK,EAAC,OAAO,EAAE;QACnC,kBAAkB;QAClB,iBAAiB;QACjB,oBAAoB;KACpB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAgB;QACzB,KAAK;QACL,QAAQ;QACR,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,WAAW;QACX,eAAe;QACf,GAAG,YAAY;QACf,GAAG,eAAe;KAClB,CAAC;IAGF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,sBAAc,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-simple",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Simple",
5
5
  "keywords": [
6
6
  "n8n-community-node-package"