@custom-js/n8n-nodes-pdf-toolkit 1.36.0 → 1.38.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/nodes/CompressPDF/CompressPDF.node.js +5 -3
- package/dist/nodes/ExtractPages/ExtractPages.node.js +5 -3
- package/dist/nodes/GetFormFieldNames/GetFormFieldNames.node.js +2 -3
- package/dist/nodes/Html2Docx/Html2Docx.node.js +5 -3
- package/dist/nodes/Html2Pdf/Html2Pdf.node.js +5 -3
- package/dist/nodes/InvoiceGenerator/InvoiceGenerator.node.js +4 -3
- package/dist/nodes/Markdown2Html/Markdown2Html.node.js +2 -3
- package/dist/nodes/MergePdfs/MergePdfs.node.js +5 -3
- package/dist/nodes/PdfFormFill/PdfFormFill.node.js +5 -3
- package/dist/nodes/PdfToPng/PdfToPng.node.js +5 -3
- package/dist/nodes/PdfToText/PdfToText.node.js +2 -3
- package/dist/nodes/SSLChecker/SSLChecker.node.js +2 -2
- package/dist/nodes/Scraper/Scraper.node.js +5 -3
- package/dist/nodes/WebsiteScreenshot/WebsiteScreenshot.node.js +5 -3
- package/package.json +5 -2
|
@@ -72,7 +72,7 @@ class CompressPDF {
|
|
|
72
72
|
}
|
|
73
73
|
const options = {
|
|
74
74
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
75
|
-
method:
|
|
75
|
+
method: 'POST',
|
|
76
76
|
headers: {
|
|
77
77
|
"customjs-origin": "n8n/compressPdf",
|
|
78
78
|
"x-api-key": credentials.apiKey,
|
|
@@ -85,10 +85,12 @@ class CompressPDF {
|
|
|
85
85
|
return PDF_COMPRESS(input);`,
|
|
86
86
|
returnBinary: "true",
|
|
87
87
|
},
|
|
88
|
-
encoding: null,
|
|
89
88
|
json: true,
|
|
89
|
+
returnFullResponse: true,
|
|
90
|
+
responseType: 'arraybuffer',
|
|
90
91
|
};
|
|
91
|
-
const
|
|
92
|
+
const responseData = await this.helpers.httpRequest(options);
|
|
93
|
+
const response = responseData.body;
|
|
92
94
|
if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
|
|
93
95
|
// No binary data returned; emit only JSON without a binary property
|
|
94
96
|
returnData.push({
|
|
@@ -80,7 +80,7 @@ class ExtractPages {
|
|
|
80
80
|
}
|
|
81
81
|
const options = {
|
|
82
82
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
83
|
-
method:
|
|
83
|
+
method: 'POST',
|
|
84
84
|
headers: {
|
|
85
85
|
"customjs-origin": "n8n/extractPages",
|
|
86
86
|
"x-api-key": credentials.apiKey,
|
|
@@ -95,10 +95,12 @@ class ExtractPages {
|
|
|
95
95
|
return EXTRACT_PAGES_FROM_PDF(pdfBuffer, input.pageRange);`,
|
|
96
96
|
returnBinary: "true",
|
|
97
97
|
},
|
|
98
|
-
encoding: null,
|
|
99
98
|
json: true,
|
|
99
|
+
returnFullResponse: true,
|
|
100
|
+
responseType: 'arraybuffer',
|
|
100
101
|
};
|
|
101
|
-
const
|
|
102
|
+
const responseData = await this.helpers.httpRequest(options);
|
|
103
|
+
const response = responseData.body;
|
|
102
104
|
if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
|
|
103
105
|
// No binary data returned; emit only JSON without a binary property
|
|
104
106
|
returnData.push({
|
|
@@ -66,7 +66,7 @@ class GetFormFieldNames {
|
|
|
66
66
|
}
|
|
67
67
|
const options = {
|
|
68
68
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
69
|
-
method:
|
|
69
|
+
method: 'POST',
|
|
70
70
|
headers: {
|
|
71
71
|
"customjs-origin": "n8n/getFormFieldNames",
|
|
72
72
|
"x-api-key": credentials.apiKey,
|
|
@@ -79,10 +79,9 @@ class GetFormFieldNames {
|
|
|
79
79
|
return PDF_GET_FORM_FIELD_NAMES(pdfInput);`,
|
|
80
80
|
returnBinary: "false",
|
|
81
81
|
},
|
|
82
|
-
encoding: null,
|
|
83
82
|
json: true,
|
|
84
83
|
};
|
|
85
|
-
const response = await this.helpers.
|
|
84
|
+
const response = await this.helpers.httpRequest(options);
|
|
86
85
|
returnData.push({
|
|
87
86
|
json: {
|
|
88
87
|
output: JSON.parse(response.toString()),
|
|
@@ -44,7 +44,7 @@ class Html2Docx {
|
|
|
44
44
|
const htmlInput = this.getNodeParameter("htmlInput", i);
|
|
45
45
|
const options = {
|
|
46
46
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
47
|
-
method:
|
|
47
|
+
method: 'POST',
|
|
48
48
|
headers: {
|
|
49
49
|
"customjs-origin": "n8n/html2Docx",
|
|
50
50
|
"x-api-key": credentials.apiKey,
|
|
@@ -54,10 +54,12 @@ class Html2Docx {
|
|
|
54
54
|
code: "const { HTML2DOCX } = require('./utils'); return HTML2DOCX(input)",
|
|
55
55
|
returnBinary: "true",
|
|
56
56
|
},
|
|
57
|
-
encoding: null,
|
|
58
57
|
json: true,
|
|
58
|
+
returnFullResponse: true,
|
|
59
|
+
responseType: 'arraybuffer',
|
|
59
60
|
};
|
|
60
|
-
const
|
|
61
|
+
const responseData = await this.helpers.httpRequest(options);
|
|
62
|
+
const response = responseData.body;
|
|
61
63
|
if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
|
|
62
64
|
// No binary data returned; emit only JSON without a binary property
|
|
63
65
|
returnData.push({
|
|
@@ -44,7 +44,7 @@ class Html2Pdf {
|
|
|
44
44
|
const htmlInput = this.getNodeParameter("htmlInput", i);
|
|
45
45
|
const options = {
|
|
46
46
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
47
|
-
method:
|
|
47
|
+
method: 'POST',
|
|
48
48
|
headers: {
|
|
49
49
|
"customjs-origin": "n8n/generatePDF",
|
|
50
50
|
"x-api-key": credentials.apiKey,
|
|
@@ -54,10 +54,12 @@ class Html2Pdf {
|
|
|
54
54
|
code: "const { HTML2PDF } = require('./utils'); return HTML2PDF(input)",
|
|
55
55
|
returnBinary: "true",
|
|
56
56
|
},
|
|
57
|
-
encoding: null,
|
|
58
57
|
json: true,
|
|
58
|
+
returnFullResponse: true,
|
|
59
|
+
responseType: 'arraybuffer',
|
|
59
60
|
};
|
|
60
|
-
const
|
|
61
|
+
const responseData = await this.helpers.httpRequest(options);
|
|
62
|
+
const response = responseData.body;
|
|
61
63
|
if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
|
|
62
64
|
// No binary data returned; emit only JSON without a binary property
|
|
63
65
|
returnData.push({
|
|
@@ -260,16 +260,17 @@ class InvoiceGenerator {
|
|
|
260
260
|
code: code,
|
|
261
261
|
returnBinary: 'true',
|
|
262
262
|
},
|
|
263
|
-
encoding: null,
|
|
264
263
|
json: true,
|
|
264
|
+
returnFullResponse: true,
|
|
265
|
+
responseType: 'arraybuffer',
|
|
265
266
|
};
|
|
266
|
-
const
|
|
267
|
+
const responseData = await this.helpers.httpRequest(options);
|
|
268
|
+
const response = responseData.body;
|
|
267
269
|
if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
|
|
268
270
|
// No binary data returned; emit only JSON without a binary property
|
|
269
271
|
returnData.push({
|
|
270
272
|
json: items[i].json,
|
|
271
273
|
});
|
|
272
|
-
continue;
|
|
273
274
|
}
|
|
274
275
|
const binaryData = await this.helpers.prepareBinaryData(response, "Invoice.pdf");
|
|
275
276
|
returnData.push({
|
|
@@ -44,7 +44,7 @@ class Markdown2Html {
|
|
|
44
44
|
const markdownInput = this.getNodeParameter("markdownInput", i);
|
|
45
45
|
const options = {
|
|
46
46
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
47
|
-
method:
|
|
47
|
+
method: 'POST',
|
|
48
48
|
headers: {
|
|
49
49
|
"customjs-origin": "n8n/markdown2html",
|
|
50
50
|
"x-api-key": credentials.apiKey,
|
|
@@ -54,10 +54,9 @@ class Markdown2Html {
|
|
|
54
54
|
code: "const { MD2HTML } = require('./utils'); return MD2HTML(input)",
|
|
55
55
|
returnBinary: "false",
|
|
56
56
|
},
|
|
57
|
-
encoding: null,
|
|
58
57
|
json: true,
|
|
59
58
|
};
|
|
60
|
-
const response = await this.helpers.
|
|
59
|
+
const response = await this.helpers.httpRequest(options);
|
|
61
60
|
returnData.push({
|
|
62
61
|
json: {
|
|
63
62
|
output: response.toString(),
|
|
@@ -64,7 +64,7 @@ class MergePdfs {
|
|
|
64
64
|
const urls = !isBinary ? field_name : [];
|
|
65
65
|
const options = {
|
|
66
66
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
67
|
-
method:
|
|
67
|
+
method: 'POST',
|
|
68
68
|
headers: {
|
|
69
69
|
"customjs-origin": "n8n/mergePDFs",
|
|
70
70
|
"x-api-key": credentials.apiKey,
|
|
@@ -77,10 +77,12 @@ class MergePdfs {
|
|
|
77
77
|
return PDF_MERGE(input);`,
|
|
78
78
|
returnBinary: "true",
|
|
79
79
|
},
|
|
80
|
-
encoding: null,
|
|
81
80
|
json: true,
|
|
81
|
+
returnFullResponse: true,
|
|
82
|
+
responseType: 'arraybuffer',
|
|
82
83
|
};
|
|
83
|
-
const
|
|
84
|
+
const responseData = await this.helpers.httpRequest(options);
|
|
85
|
+
const response = responseData.body;
|
|
84
86
|
if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
|
|
85
87
|
// No binary data returned; emit only JSON without a binary property
|
|
86
88
|
returnData.push({
|
|
@@ -99,7 +99,7 @@ class PdfFormFill {
|
|
|
99
99
|
}
|
|
100
100
|
const options = {
|
|
101
101
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
102
|
-
method:
|
|
102
|
+
method: 'POST',
|
|
103
103
|
headers: {
|
|
104
104
|
"customjs-origin": "n8n/pdfFormFill",
|
|
105
105
|
"x-api-key": credentials.apiKey,
|
|
@@ -117,10 +117,12 @@ class PdfFormFill {
|
|
|
117
117
|
return PDF_FILL_FORM(pdfInput, fieldValues);`,
|
|
118
118
|
returnBinary: "true",
|
|
119
119
|
},
|
|
120
|
-
encoding: null,
|
|
121
120
|
json: true,
|
|
121
|
+
returnFullResponse: true,
|
|
122
|
+
responseType: 'arraybuffer',
|
|
122
123
|
};
|
|
123
|
-
const
|
|
124
|
+
const responseData = await this.helpers.httpRequest(options);
|
|
125
|
+
const response = responseData.body;
|
|
124
126
|
if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
|
|
125
127
|
// No binary data returned; emit only JSON without a binary property
|
|
126
128
|
returnData.push({
|
|
@@ -72,7 +72,7 @@ class PdfToPng {
|
|
|
72
72
|
}
|
|
73
73
|
const options = {
|
|
74
74
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
75
|
-
method:
|
|
75
|
+
method: 'POST',
|
|
76
76
|
headers: {
|
|
77
77
|
"customjs-origin": "n8n/pdfToPng",
|
|
78
78
|
"x-api-key": credentials.apiKey,
|
|
@@ -85,10 +85,12 @@ class PdfToPng {
|
|
|
85
85
|
return PDF2PNG(input);`,
|
|
86
86
|
returnBinary: "true",
|
|
87
87
|
},
|
|
88
|
-
encoding: null,
|
|
89
88
|
json: true,
|
|
89
|
+
returnFullResponse: true,
|
|
90
|
+
responseType: 'arraybuffer',
|
|
90
91
|
};
|
|
91
|
-
const
|
|
92
|
+
const responseData = await this.helpers.httpRequest(options);
|
|
93
|
+
const response = responseData.body;
|
|
92
94
|
if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
|
|
93
95
|
// No binary data returned; emit only JSON without a binary property
|
|
94
96
|
returnData.push({
|
|
@@ -72,7 +72,7 @@ class PdfToText {
|
|
|
72
72
|
}
|
|
73
73
|
const options = {
|
|
74
74
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
75
|
-
method:
|
|
75
|
+
method: 'POST',
|
|
76
76
|
headers: {
|
|
77
77
|
"customjs-origin": "n8n/pdfToText",
|
|
78
78
|
"x-api-key": credentials.apiKey,
|
|
@@ -85,10 +85,9 @@ class PdfToText {
|
|
|
85
85
|
return PDFTOTEXT(input);`,
|
|
86
86
|
returnBinary: "false",
|
|
87
87
|
},
|
|
88
|
-
encoding: null,
|
|
89
88
|
json: true,
|
|
90
89
|
};
|
|
91
|
-
const response = await this.helpers.
|
|
90
|
+
const response = await this.helpers.httpRequest(options);
|
|
92
91
|
returnData.push({
|
|
93
92
|
json: {
|
|
94
93
|
output: response.toString(),
|
|
@@ -49,7 +49,7 @@ class SSLChecker {
|
|
|
49
49
|
const domain = this.getNodeParameter("domain", i);
|
|
50
50
|
const options = {
|
|
51
51
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
52
|
-
method:
|
|
52
|
+
method: 'POST',
|
|
53
53
|
headers: {
|
|
54
54
|
"customjs-origin": "n8n/sslchecker",
|
|
55
55
|
"x-api-key": credentials.apiKey,
|
|
@@ -60,7 +60,7 @@ class SSLChecker {
|
|
|
60
60
|
},
|
|
61
61
|
json: true,
|
|
62
62
|
};
|
|
63
|
-
const response = await this.helpers.
|
|
63
|
+
const response = await this.helpers.httpRequest(options);
|
|
64
64
|
returnData.push({
|
|
65
65
|
json: {
|
|
66
66
|
output: response,
|
|
@@ -133,7 +133,7 @@ class Scraper {
|
|
|
133
133
|
};
|
|
134
134
|
const options = {
|
|
135
135
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
136
|
-
method:
|
|
136
|
+
method: 'POST',
|
|
137
137
|
headers: {
|
|
138
138
|
"customjs-origin": "n8n/scraper",
|
|
139
139
|
"x-api-key": credentials.apiKey,
|
|
@@ -145,10 +145,12 @@ class Scraper {
|
|
|
145
145
|
`return SCRAPER(payload.url, payload.commands || [], "${returnValueType === "binary" ? "image" : "html"}", ${debug ? "true" : "false"});`,
|
|
146
146
|
returnBinary: returnValueType === "binary" ? "true" : "false",
|
|
147
147
|
},
|
|
148
|
-
encoding: null,
|
|
149
148
|
json: true,
|
|
149
|
+
returnFullResponse: returnValueType === "binary",
|
|
150
|
+
responseType: returnValueType === "binary" ? 'arraybuffer' : undefined,
|
|
150
151
|
};
|
|
151
|
-
const
|
|
152
|
+
const responseData = await this.helpers.httpRequest(options);
|
|
153
|
+
const response = returnValueType === "binary" ? responseData.body : responseData;
|
|
152
154
|
if (returnValueType === "binary") {
|
|
153
155
|
if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
|
|
154
156
|
// No binary data returned; emit only JSON without a binary property
|
|
@@ -41,7 +41,7 @@ class WebsiteScreenshot {
|
|
|
41
41
|
const urlInput = this.getNodeParameter("urlInput", i);
|
|
42
42
|
const options = {
|
|
43
43
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
44
|
-
method:
|
|
44
|
+
method: 'POST',
|
|
45
45
|
headers: {
|
|
46
46
|
"customjs-origin": "n8n/screenshot",
|
|
47
47
|
"x-api-key": credentials.apiKey,
|
|
@@ -51,10 +51,12 @@ class WebsiteScreenshot {
|
|
|
51
51
|
code: "const { SCREENSHOT } = require('./utils'); return SCREENSHOT(input);",
|
|
52
52
|
returnBinary: "true",
|
|
53
53
|
},
|
|
54
|
-
encoding: null,
|
|
55
54
|
json: true,
|
|
55
|
+
returnFullResponse: true,
|
|
56
|
+
responseType: 'arraybuffer',
|
|
56
57
|
};
|
|
57
|
-
const
|
|
58
|
+
const responseData = await this.helpers.httpRequest(options);
|
|
59
|
+
const response = responseData.body;
|
|
58
60
|
if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
|
|
59
61
|
// No binary data returned; emit only JSON without a binary property
|
|
60
62
|
returnData.push({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@custom-js/n8n-nodes-pdf-toolkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"description": "This is official node for interacting with APIs from customjs.space",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"customjs",
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
"url": "https://github.com/customjs/n8n-nodes-pdf-toolkit/issues"
|
|
14
14
|
},
|
|
15
15
|
"license": "ISC",
|
|
16
|
-
"author":
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Henrik Lippke",
|
|
18
|
+
"email": "h@customjs.io"
|
|
19
|
+
},
|
|
17
20
|
"files": [
|
|
18
21
|
"dist"
|
|
19
22
|
],
|