@custom-js/n8n-nodes-pdf-toolkit 1.38.0 → 1.40.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.
@@ -85,12 +85,10 @@ class CompressPDF {
85
85
  return PDF_COMPRESS(input);`,
86
86
  returnBinary: "true",
87
87
  },
88
+ encoding: null,
88
89
  json: true,
89
- returnFullResponse: true,
90
- responseType: 'arraybuffer',
91
90
  };
92
- const responseData = await this.helpers.httpRequest(options);
93
- const response = responseData.body;
91
+ const response = await this.helpers.request(options);
94
92
  if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
95
93
  // No binary data returned; emit only JSON without a binary property
96
94
  returnData.push({
@@ -95,12 +95,10 @@ class ExtractPages {
95
95
  return EXTRACT_PAGES_FROM_PDF(pdfBuffer, input.pageRange);`,
96
96
  returnBinary: "true",
97
97
  },
98
+ encoding: null,
98
99
  json: true,
99
- returnFullResponse: true,
100
- responseType: 'arraybuffer',
101
100
  };
102
- const responseData = await this.helpers.httpRequest(options);
103
- const response = responseData.body;
101
+ const response = await this.helpers.request(options);
104
102
  if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
105
103
  // No binary data returned; emit only JSON without a binary property
106
104
  returnData.push({
@@ -81,7 +81,7 @@ class GetFormFieldNames {
81
81
  },
82
82
  json: true,
83
83
  };
84
- const response = await this.helpers.httpRequest(options);
84
+ const response = await this.helpers.request(options);
85
85
  returnData.push({
86
86
  json: {
87
87
  output: JSON.parse(response.toString()),
@@ -54,12 +54,10 @@ class Html2Docx {
54
54
  code: "const { HTML2DOCX } = require('./utils'); return HTML2DOCX(input)",
55
55
  returnBinary: "true",
56
56
  },
57
+ encoding: null,
57
58
  json: true,
58
- returnFullResponse: true,
59
- responseType: 'arraybuffer',
60
59
  };
61
- const responseData = await this.helpers.httpRequest(options);
62
- const response = responseData.body;
60
+ const response = await this.helpers.request(options);
63
61
  if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
64
62
  // No binary data returned; emit only JSON without a binary property
65
63
  returnData.push({
@@ -54,12 +54,10 @@ class Html2Pdf {
54
54
  code: "const { HTML2PDF } = require('./utils'); return HTML2PDF(input)",
55
55
  returnBinary: "true",
56
56
  },
57
+ encoding: null,
57
58
  json: true,
58
- returnFullResponse: true,
59
- responseType: 'arraybuffer',
60
59
  };
61
- const responseData = await this.helpers.httpRequest(options);
62
- const response = responseData.body;
60
+ const response = await this.helpers.request(options);
63
61
  if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
64
62
  // No binary data returned; emit only JSON without a binary property
65
63
  returnData.push({
@@ -260,17 +260,15 @@ class InvoiceGenerator {
260
260
  code: code,
261
261
  returnBinary: 'true',
262
262
  },
263
+ encoding: null,
263
264
  json: true,
264
- returnFullResponse: true,
265
- responseType: 'arraybuffer',
266
265
  };
267
- const responseData = await this.helpers.httpRequest(options);
268
- const response = responseData.body;
266
+ const response = await this.helpers.request(options);
269
267
  if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
270
- // No binary data returned; emit only JSON without a binary property
271
268
  returnData.push({
272
269
  json: items[i].json,
273
270
  });
271
+ continue;
274
272
  }
275
273
  const binaryData = await this.helpers.prepareBinaryData(response, "Invoice.pdf");
276
274
  returnData.push({
@@ -56,7 +56,7 @@ class Markdown2Html {
56
56
  },
57
57
  json: true,
58
58
  };
59
- const response = await this.helpers.httpRequest(options);
59
+ const response = await this.helpers.request(options);
60
60
  returnData.push({
61
61
  json: {
62
62
  output: response.toString(),
@@ -77,12 +77,10 @@ class MergePdfs {
77
77
  return PDF_MERGE(input);`,
78
78
  returnBinary: "true",
79
79
  },
80
+ encoding: null,
80
81
  json: true,
81
- returnFullResponse: true,
82
- responseType: 'arraybuffer',
83
82
  };
84
- const responseData = await this.helpers.httpRequest(options);
85
- const response = responseData.body;
83
+ const response = await this.helpers.request(options);
86
84
  if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
87
85
  // No binary data returned; emit only JSON without a binary property
88
86
  returnData.push({
@@ -117,12 +117,10 @@ class PdfFormFill {
117
117
  return PDF_FILL_FORM(pdfInput, fieldValues);`,
118
118
  returnBinary: "true",
119
119
  },
120
+ encoding: null,
120
121
  json: true,
121
- returnFullResponse: true,
122
- responseType: 'arraybuffer',
123
122
  };
124
- const responseData = await this.helpers.httpRequest(options);
125
- const response = responseData.body;
123
+ const response = await this.helpers.request(options);
126
124
  if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
127
125
  // No binary data returned; emit only JSON without a binary property
128
126
  returnData.push({
@@ -85,12 +85,10 @@ class PdfToPng {
85
85
  return PDF2PNG(input);`,
86
86
  returnBinary: "true",
87
87
  },
88
+ encoding: null,
88
89
  json: true,
89
- returnFullResponse: true,
90
- responseType: 'arraybuffer',
91
90
  };
92
- const responseData = await this.helpers.httpRequest(options);
93
- const response = responseData.body;
91
+ const response = await this.helpers.request(options);
94
92
  if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
95
93
  // No binary data returned; emit only JSON without a binary property
96
94
  returnData.push({
@@ -87,7 +87,7 @@ class PdfToText {
87
87
  },
88
88
  json: true,
89
89
  };
90
- const response = await this.helpers.httpRequest(options);
90
+ const response = await this.helpers.request(options);
91
91
  returnData.push({
92
92
  json: {
93
93
  output: response.toString(),
@@ -60,7 +60,7 @@ class SSLChecker {
60
60
  },
61
61
  json: true,
62
62
  };
63
- const response = await this.helpers.httpRequest(options);
63
+ const response = await this.helpers.request(options);
64
64
  returnData.push({
65
65
  json: {
66
66
  output: response,
@@ -145,12 +145,10 @@ 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,
148
149
  json: true,
149
- returnFullResponse: returnValueType === "binary",
150
- responseType: returnValueType === "binary" ? 'arraybuffer' : undefined,
151
150
  };
152
- const responseData = await this.helpers.httpRequest(options);
153
- const response = returnValueType === "binary" ? responseData.body : responseData;
151
+ const response = await this.helpers.request(options);
154
152
  if (returnValueType === "binary") {
155
153
  if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
156
154
  // No binary data returned; emit only JSON without a binary property
@@ -51,12 +51,10 @@ class WebsiteScreenshot {
51
51
  code: "const { SCREENSHOT } = require('./utils'); return SCREENSHOT(input);",
52
52
  returnBinary: "true",
53
53
  },
54
+ encoding: null,
54
55
  json: true,
55
- returnFullResponse: true,
56
- responseType: 'arraybuffer',
57
56
  };
58
- const responseData = await this.helpers.httpRequest(options);
59
- const response = responseData.body;
57
+ const response = await this.helpers.request(options);
60
58
  if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
61
59
  // No binary data returned; emit only JSON without a binary property
62
60
  returnData.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@custom-js/n8n-nodes-pdf-toolkit",
3
- "version": "1.38.0",
3
+ "version": "1.40.0",
4
4
  "description": "This is official node for interacting with APIs from customjs.space",
5
5
  "keywords": [
6
6
  "customjs",