@custom-js/n8n-nodes-pdf-toolkit 1.47.0 → 1.49.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.
|
@@ -234,20 +234,20 @@ class InvoiceGenerator {
|
|
|
234
234
|
items: invoiceItems,
|
|
235
235
|
};
|
|
236
236
|
const code = `
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
237
|
+
const { HTML2PDF } = require('./utils');
|
|
238
|
+
const nunjucks = require('nunjucks');
|
|
239
|
+
const fetch = require('node-fetch');
|
|
240
|
+
const tpl = 'https://www.customjs.space/pdf-templates/Invoice1.html';
|
|
241
|
+
const templateString = await fetch(tpl).then(r => r.text());
|
|
242
|
+
const renderedHtml = await nunjucks.renderString(
|
|
243
|
+
templateString,
|
|
244
|
+
{ invoiceData: JSON.stringify(input).replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\").replace(/\\n/g, '\\\\n')
|
|
245
|
+
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
console.log('renderedHtml', renderedHtml);
|
|
249
|
+
return HTML2PDF(renderedHtml);
|
|
250
|
+
`;
|
|
251
251
|
const options = {
|
|
252
252
|
url: `https://e.customjs.io/__js1-${credentials.apiKey}`,
|
|
253
253
|
method: 'POST',
|
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.49.0",
|
|
4
4
|
"description": "This is official node for interacting with APIs from customjs.space",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"customjs",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"dist/nodes/InvoiceGenerator/InvoiceGenerator.node.js"
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"n8n-workflow": "^0.141.0"
|
|
49
|
-
},
|
|
50
47
|
"devDependencies": {
|
|
51
48
|
"typescript": "~4.8.4",
|
|
52
49
|
"gulp": "^4.0.2",
|
|
53
50
|
"@types/node": "^16.11.7"
|
|
54
51
|
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"n8n-workflow": "*"
|
|
54
|
+
},
|
|
55
55
|
"type": "commonjs",
|
|
56
56
|
"main": "index.js",
|
|
57
57
|
"scripts": {
|