n8n-nodes-iterationlayer 1.0.1
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/LICENSE +21 -0
- package/README.md +84 -0
- package/dist/credentials/IterationLayerApi.credentials.d.ts +8 -0
- package/dist/credentials/IterationLayerApi.credentials.js +35 -0
- package/dist/nodes/IterationLayer/IterationLayer.node.d.ts +5 -0
- package/dist/nodes/IterationLayer/IterationLayer.node.js +407 -0
- package/dist/nodes/IterationLayer/descriptions/documentExtraction.d.ts +2 -0
- package/dist/nodes/IterationLayer/descriptions/documentExtraction.js +187 -0
- package/dist/nodes/IterationLayer/descriptions/documentGeneration.d.ts +2 -0
- package/dist/nodes/IterationLayer/descriptions/documentGeneration.js +62 -0
- package/dist/nodes/IterationLayer/descriptions/documentToMarkdown.d.ts +2 -0
- package/dist/nodes/IterationLayer/descriptions/documentToMarkdown.js +22 -0
- package/dist/nodes/IterationLayer/descriptions/imageGeneration.d.ts +2 -0
- package/dist/nodes/IterationLayer/descriptions/imageGeneration.js +99 -0
- package/dist/nodes/IterationLayer/descriptions/imageTransformation.d.ts +2 -0
- package/dist/nodes/IterationLayer/descriptions/imageTransformation.js +364 -0
- package/dist/nodes/IterationLayer/descriptions/shared.d.ts +7 -0
- package/dist/nodes/IterationLayer/descriptions/shared.js +73 -0
- package/dist/nodes/IterationLayer/descriptions/sheetGeneration.d.ts +2 -0
- package/dist/nodes/IterationLayer/descriptions/sheetGeneration.js +73 -0
- package/dist/nodes/IterationLayer/helpers/binaryData.d.ts +2 -0
- package/dist/nodes/IterationLayer/helpers/binaryData.js +23 -0
- package/dist/nodes/IterationLayer/helpers/fileInput.d.ts +15 -0
- package/dist/nodes/IterationLayer/helpers/fileInput.js +43 -0
- package/dist/nodes/IterationLayer/iterationlayer.svg +7 -0
- package/package.json +50 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.documentExtractionProperties = void 0;
|
|
4
|
+
const FIELD_TYPE_OPTIONS = [
|
|
5
|
+
{ name: "Text", value: "TEXT" },
|
|
6
|
+
{ name: "Textarea", value: "TEXTAREA" },
|
|
7
|
+
{ name: "Integer", value: "INTEGER" },
|
|
8
|
+
{ name: "Decimal", value: "DECIMAL" },
|
|
9
|
+
{ name: "Date", value: "DATE" },
|
|
10
|
+
{ name: "Datetime", value: "DATETIME" },
|
|
11
|
+
{ name: "Time", value: "TIME" },
|
|
12
|
+
{ name: "Enum", value: "ENUM" },
|
|
13
|
+
{ name: "Boolean", value: "BOOLEAN" },
|
|
14
|
+
{ name: "Email", value: "EMAIL" },
|
|
15
|
+
{ name: "IBAN", value: "IBAN" },
|
|
16
|
+
{ name: "Country", value: "COUNTRY" },
|
|
17
|
+
{ name: "Currency Code", value: "CURRENCY_CODE" },
|
|
18
|
+
{ name: "Currency Amount", value: "CURRENCY_AMOUNT" },
|
|
19
|
+
{ name: "Address", value: "ADDRESS" },
|
|
20
|
+
{ name: "Array", value: "ARRAY" },
|
|
21
|
+
{ name: "Calculated", value: "CALCULATED" },
|
|
22
|
+
];
|
|
23
|
+
exports.documentExtractionProperties = [
|
|
24
|
+
{
|
|
25
|
+
displayName: "Files",
|
|
26
|
+
name: "files",
|
|
27
|
+
type: "fixedCollection",
|
|
28
|
+
typeOptions: { multipleValues: true },
|
|
29
|
+
default: {},
|
|
30
|
+
placeholder: "Add File",
|
|
31
|
+
description: "Files to extract data from",
|
|
32
|
+
displayOptions: {
|
|
33
|
+
show: {
|
|
34
|
+
resource: ["documentExtraction"],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
options: [
|
|
38
|
+
{
|
|
39
|
+
displayName: "File",
|
|
40
|
+
name: "fileValues",
|
|
41
|
+
values: [
|
|
42
|
+
{
|
|
43
|
+
displayName: "File Input Mode",
|
|
44
|
+
name: "fileInputMode",
|
|
45
|
+
type: "options",
|
|
46
|
+
options: [
|
|
47
|
+
{ name: "Binary Data from Previous Node", value: "binaryData" },
|
|
48
|
+
{ name: "URL", value: "url" },
|
|
49
|
+
],
|
|
50
|
+
default: "binaryData",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
displayName: "Binary Property",
|
|
54
|
+
name: "fileBinaryPropertyName",
|
|
55
|
+
type: "string",
|
|
56
|
+
default: "data",
|
|
57
|
+
displayOptions: { show: { fileInputMode: ["binaryData"] } },
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
displayName: "File URL",
|
|
61
|
+
name: "fileUrl",
|
|
62
|
+
type: "string",
|
|
63
|
+
default: "",
|
|
64
|
+
placeholder: "https://example.com/document.pdf",
|
|
65
|
+
displayOptions: { show: { fileInputMode: ["url"] } },
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
displayName: "File Name",
|
|
69
|
+
name: "fileName",
|
|
70
|
+
type: "string",
|
|
71
|
+
default: "",
|
|
72
|
+
placeholder: "invoice.pdf",
|
|
73
|
+
description: "File name with extension",
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
displayName: "Schema Input Mode",
|
|
81
|
+
name: "schemaInputMode",
|
|
82
|
+
type: "options",
|
|
83
|
+
options: [
|
|
84
|
+
{ name: "UI Builder", value: "uiBuilder" },
|
|
85
|
+
{ name: "Raw JSON", value: "rawJson" },
|
|
86
|
+
],
|
|
87
|
+
default: "uiBuilder",
|
|
88
|
+
description: "Use the UI builder for simple schemas, or raw JSON for advanced features like nested arrays and calculated fields.",
|
|
89
|
+
displayOptions: {
|
|
90
|
+
show: {
|
|
91
|
+
resource: ["documentExtraction"],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
displayName: "Schema Fields",
|
|
97
|
+
name: "schemaFields",
|
|
98
|
+
type: "fixedCollection",
|
|
99
|
+
typeOptions: { multipleValues: true },
|
|
100
|
+
default: {},
|
|
101
|
+
placeholder: "Add Field",
|
|
102
|
+
description: "Fields to extract from the document",
|
|
103
|
+
displayOptions: {
|
|
104
|
+
show: {
|
|
105
|
+
resource: ["documentExtraction"],
|
|
106
|
+
schemaInputMode: ["uiBuilder"],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
options: [
|
|
110
|
+
{
|
|
111
|
+
displayName: "Field",
|
|
112
|
+
name: "fieldValues",
|
|
113
|
+
values: [
|
|
114
|
+
{
|
|
115
|
+
displayName: "Name",
|
|
116
|
+
name: "name",
|
|
117
|
+
type: "string",
|
|
118
|
+
default: "",
|
|
119
|
+
placeholder: "invoice_number",
|
|
120
|
+
description: "Machine-readable field name",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
displayName: "Description",
|
|
124
|
+
name: "description",
|
|
125
|
+
type: "string",
|
|
126
|
+
default: "",
|
|
127
|
+
placeholder: "The invoice number from the document header",
|
|
128
|
+
description: "Describes what to extract — the more specific, the better",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
displayName: "Type",
|
|
132
|
+
name: "type",
|
|
133
|
+
type: "options",
|
|
134
|
+
options: FIELD_TYPE_OPTIONS,
|
|
135
|
+
default: "TEXT",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
displayName: "Required",
|
|
139
|
+
name: "isRequired",
|
|
140
|
+
type: "boolean",
|
|
141
|
+
default: false,
|
|
142
|
+
description: "Whether this field must be found in the document",
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
displayName: "Schema JSON",
|
|
150
|
+
name: "schemaJson",
|
|
151
|
+
type: "json",
|
|
152
|
+
default: '{\n "fields": [\n {\n "name": "invoice_number",\n "type": "TEXT",\n "description": "The invoice number"\n }\n ]\n}',
|
|
153
|
+
description: "Full schema as JSON. Required for advanced field types like ARRAY (nested schemas) and CALCULATED fields.",
|
|
154
|
+
displayOptions: {
|
|
155
|
+
show: {
|
|
156
|
+
resource: ["documentExtraction"],
|
|
157
|
+
schemaInputMode: ["rawJson"],
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
displayName: "Async Mode",
|
|
163
|
+
name: "isAsync",
|
|
164
|
+
type: "boolean",
|
|
165
|
+
default: false,
|
|
166
|
+
description: "Whether to process asynchronously. Results will be delivered to the webhook URL.",
|
|
167
|
+
displayOptions: {
|
|
168
|
+
show: {
|
|
169
|
+
resource: ["documentExtraction"],
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
displayName: "Webhook URL",
|
|
175
|
+
name: "webhookUrl",
|
|
176
|
+
type: "string",
|
|
177
|
+
default: "",
|
|
178
|
+
placeholder: "https://your-app.com/webhooks/result",
|
|
179
|
+
description: "HTTPS URL for async result delivery",
|
|
180
|
+
displayOptions: {
|
|
181
|
+
show: {
|
|
182
|
+
resource: ["documentExtraction"],
|
|
183
|
+
isAsync: [true],
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.documentGenerationProperties = void 0;
|
|
4
|
+
const FORMAT_OPTIONS = [
|
|
5
|
+
{ name: "PDF", value: "pdf" },
|
|
6
|
+
{ name: "DOCX", value: "docx" },
|
|
7
|
+
{ name: "EPUB", value: "epub" },
|
|
8
|
+
{ name: "PPTX", value: "pptx" },
|
|
9
|
+
];
|
|
10
|
+
exports.documentGenerationProperties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: "Output Format",
|
|
13
|
+
name: "format",
|
|
14
|
+
type: "options",
|
|
15
|
+
options: FORMAT_OPTIONS,
|
|
16
|
+
default: "pdf",
|
|
17
|
+
description: "The document format to generate",
|
|
18
|
+
displayOptions: {
|
|
19
|
+
show: {
|
|
20
|
+
resource: ["documentGeneration"],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
displayName: "Document (JSON)",
|
|
26
|
+
name: "documentJson",
|
|
27
|
+
type: "json",
|
|
28
|
+
default: '{\n "metadata": { "title": "My Document" },\n "page": {\n "size": { "preset": "A4" },\n "margins": { "top_in_pt": 72, "right_in_pt": 72, "bottom_in_pt": 72, "left_in_pt": 72 }\n },\n "styles": {\n "text": { "font_family": "Helvetica", "font_size_in_pt": 12, "line_height": 1.5, "color": "#000000" },\n "headline": { "font_family": "Helvetica", "font_size_in_pt": 24, "color": "#000000", "spacing_before_in_pt": 12, "spacing_after_in_pt": 6 },\n "link": { "color": "#0066CC" },\n "list": { "indent_in_pt": 18, "spacing_between_items_in_pt": 4 },\n "table": {\n "header": { "background_color": "#F0F0F0", "font_family": "Helvetica", "font_size_in_pt": 11, "color": "#000000", "padding_in_pt": 6 },\n "body": { "font_family": "Helvetica", "font_size_in_pt": 11, "color": "#333333", "padding_in_pt": 6 }\n },\n "grid": { "gap_in_pt": 12 },\n "separator": { "color": "#CCCCCC", "thickness_in_pt": 1, "margin_top_in_pt": 12, "margin_bottom_in_pt": 12 },\n "image": { "alignment": "center", "margin_top_in_pt": 8, "margin_bottom_in_pt": 8 }\n },\n "content": [\n { "type": "headline", "level": "h1", "text": "Hello World" },\n { "type": "paragraph", "markdown": "This is a sample document." }\n ]\n}',
|
|
29
|
+
description: "Full document definition as JSON including metadata, page, styles, and content blocks. See https://iterationlayer.com/docs/document-generation for the full schema.",
|
|
30
|
+
displayOptions: {
|
|
31
|
+
show: {
|
|
32
|
+
resource: ["documentGeneration"],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
displayName: "Async Mode",
|
|
38
|
+
name: "isAsync",
|
|
39
|
+
type: "boolean",
|
|
40
|
+
default: false,
|
|
41
|
+
description: "Whether to process asynchronously. Results will be delivered to the webhook URL.",
|
|
42
|
+
displayOptions: {
|
|
43
|
+
show: {
|
|
44
|
+
resource: ["documentGeneration"],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
displayName: "Webhook URL",
|
|
50
|
+
name: "webhookUrl",
|
|
51
|
+
type: "string",
|
|
52
|
+
default: "",
|
|
53
|
+
placeholder: "https://your-app.com/webhooks/result",
|
|
54
|
+
description: "HTTPS URL for async result delivery",
|
|
55
|
+
displayOptions: {
|
|
56
|
+
show: {
|
|
57
|
+
resource: ["documentGeneration"],
|
|
58
|
+
isAsync: [true],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.documentToMarkdownProperties = void 0;
|
|
4
|
+
const shared_js_1 = require("./shared.js");
|
|
5
|
+
function withResourceDisplay(property) {
|
|
6
|
+
return {
|
|
7
|
+
...property,
|
|
8
|
+
displayOptions: {
|
|
9
|
+
...property.displayOptions,
|
|
10
|
+
show: {
|
|
11
|
+
...property.displayOptions?.show,
|
|
12
|
+
resource: ["documentToMarkdown"],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
exports.documentToMarkdownProperties = [
|
|
18
|
+
withResourceDisplay(shared_js_1.fileInputModeProperty),
|
|
19
|
+
withResourceDisplay(shared_js_1.fileBinaryPropertyNameProperty),
|
|
20
|
+
withResourceDisplay(shared_js_1.fileUrlProperty),
|
|
21
|
+
withResourceDisplay(shared_js_1.fileNameProperty),
|
|
22
|
+
];
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imageGenerationProperties = void 0;
|
|
4
|
+
const OUTPUT_FORMAT_OPTIONS = [
|
|
5
|
+
{ name: "PNG", value: "png" },
|
|
6
|
+
{ name: "JPEG", value: "jpeg" },
|
|
7
|
+
{ name: "WebP", value: "webp" },
|
|
8
|
+
{ name: "TIFF", value: "tiff" },
|
|
9
|
+
{ name: "GIF", value: "gif" },
|
|
10
|
+
{ name: "AVIF", value: "avif" },
|
|
11
|
+
];
|
|
12
|
+
exports.imageGenerationProperties = [
|
|
13
|
+
{
|
|
14
|
+
displayName: "Width (px)",
|
|
15
|
+
name: "widthInPx",
|
|
16
|
+
type: "number",
|
|
17
|
+
default: 1200,
|
|
18
|
+
description: "Output image width in pixels",
|
|
19
|
+
displayOptions: {
|
|
20
|
+
show: {
|
|
21
|
+
resource: ["imageGeneration"],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
displayName: "Height (px)",
|
|
27
|
+
name: "heightInPx",
|
|
28
|
+
type: "number",
|
|
29
|
+
default: 630,
|
|
30
|
+
description: "Output image height in pixels",
|
|
31
|
+
displayOptions: {
|
|
32
|
+
show: {
|
|
33
|
+
resource: ["imageGeneration"],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
displayName: "Output Format",
|
|
39
|
+
name: "outputFormat",
|
|
40
|
+
type: "options",
|
|
41
|
+
options: OUTPUT_FORMAT_OPTIONS,
|
|
42
|
+
default: "png",
|
|
43
|
+
displayOptions: {
|
|
44
|
+
show: {
|
|
45
|
+
resource: ["imageGeneration"],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
displayName: "Layers (JSON)",
|
|
51
|
+
name: "layersJson",
|
|
52
|
+
type: "json",
|
|
53
|
+
default: '[\n {\n "type": "solid-color",\n "index": 0,\n "hex_color": "#FFFFFF",\n "position": { "x_in_px": 0, "y_in_px": 0 },\n "dimensions": { "width_in_px": 1200, "height_in_px": 630 }\n },\n {\n "type": "text",\n "index": 1,\n "text": "Hello World",\n "font_name": "Roboto",\n "font_size_in_px": 48,\n "text_color": "#000000",\n "position": { "x_in_px": 50, "y_in_px": 50 },\n "dimensions": { "width_in_px": 1100, "height_in_px": 100 }\n }\n]',
|
|
54
|
+
description: "JSON array of layers. Supports types: solid-color, text, image, qr-code, barcode, gradient. See https://iterationlayer.com/docs/image-generation for the full schema.",
|
|
55
|
+
displayOptions: {
|
|
56
|
+
show: {
|
|
57
|
+
resource: ["imageGeneration"],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: "Fonts (JSON)",
|
|
63
|
+
name: "fontsJson",
|
|
64
|
+
type: "json",
|
|
65
|
+
default: "[]",
|
|
66
|
+
description: "Optional JSON array of custom font definitions with name, weight, style, and file (base64 or URL).",
|
|
67
|
+
displayOptions: {
|
|
68
|
+
show: {
|
|
69
|
+
resource: ["imageGeneration"],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: "Async Mode",
|
|
75
|
+
name: "isAsync",
|
|
76
|
+
type: "boolean",
|
|
77
|
+
default: false,
|
|
78
|
+
description: "Whether to process asynchronously. Results will be delivered to the webhook URL.",
|
|
79
|
+
displayOptions: {
|
|
80
|
+
show: {
|
|
81
|
+
resource: ["imageGeneration"],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
displayName: "Webhook URL",
|
|
87
|
+
name: "webhookUrl",
|
|
88
|
+
type: "string",
|
|
89
|
+
default: "",
|
|
90
|
+
placeholder: "https://your-app.com/webhooks/result",
|
|
91
|
+
description: "HTTPS URL for async result delivery",
|
|
92
|
+
displayOptions: {
|
|
93
|
+
show: {
|
|
94
|
+
resource: ["imageGeneration"],
|
|
95
|
+
isAsync: [true],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
];
|