n8n-nodes-simple 2.2.1 → 2.2.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.
- package/dist/nodes/shared/config/parameters.d.ts +1 -1
- package/dist/nodes/shared/config/properties/toolParameters.d.ts +2 -0
- package/dist/nodes/shared/config/properties/toolParameters.js +101 -0
- package/dist/nodes/shared/config/properties/toolParameters.js.map +1 -0
- package/dist/nodes/shared/core/execution/executor.js +6 -6
- package/dist/nodes/shared/core/execution/executor.js.map +1 -1
- package/dist/nodes/shared/core/execution/outputData.d.ts +5 -0
- package/dist/nodes/shared/core/execution/outputData.js +108 -0
- package/dist/nodes/shared/core/execution/outputData.js.map +1 -0
- package/dist/nodes/shared/core/memory/supplier.d.ts +2 -0
- package/dist/nodes/shared/core/memory/supplier.js +53 -0
- package/dist/nodes/shared/core/memory/supplier.js.map +1 -0
- package/dist/nodes/shared/core/messages/processor.js +10 -4
- package/dist/nodes/shared/core/messages/processor.js.map +1 -1
- package/dist/nodes/shared/core/output/processor.d.ts +5 -0
- package/dist/nodes/shared/core/output/processor.js +108 -0
- package/dist/nodes/shared/core/output/processor.js.map +1 -0
- package/dist/nodes/shared/core/request/body.d.ts +2 -0
- package/dist/nodes/shared/core/request/body.js +43 -0
- package/dist/nodes/shared/core/request/body.js.map +1 -0
- package/dist/nodes/shared/core/request/builder.d.ts +2 -0
- package/dist/nodes/shared/core/request/builder.js +43 -0
- package/dist/nodes/shared/core/request/builder.js.map +1 -0
- package/dist/nodes/shared/core/request/structuredOutput.d.ts +3 -0
- package/dist/nodes/shared/core/request/structuredOutput.js +26 -0
- package/dist/nodes/shared/core/request/structuredOutput.js.map +1 -0
- package/dist/nodes/shared/core/request/visualEditor.d.ts +32 -0
- package/dist/nodes/shared/core/request/visualEditor.js +70 -0
- package/dist/nodes/shared/core/request/visualEditor.js.map +1 -0
- package/dist/nodes/shared/core/response/config.d.ts +3 -0
- package/dist/nodes/shared/core/response/config.js +26 -0
- package/dist/nodes/shared/core/response/config.js.map +1 -0
- package/dist/nodes/shared/core/schema/visualEditor.d.ts +32 -0
- package/dist/nodes/shared/core/schema/visualEditor.js +70 -0
- package/dist/nodes/shared/core/schema/visualEditor.js.map +1 -0
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -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":"","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|
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":";;AAmC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