@warleon/n8n-nodes-payload-cms 1.3.9 → 1.4.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.
|
@@ -490,29 +490,9 @@ class PayloadCms {
|
|
|
490
490
|
let requestConfig = {};
|
|
491
491
|
// handle binary inputs
|
|
492
492
|
const binaryPropertyName = additionalOptions.upload;
|
|
493
|
-
returnData.push({
|
|
494
|
-
json: {
|
|
495
|
-
debug: `upload name: ${binaryPropertyName}`,
|
|
496
|
-
},
|
|
497
|
-
});
|
|
498
493
|
if (binaryPropertyName) {
|
|
499
|
-
returnData.push({
|
|
500
|
-
json: {
|
|
501
|
-
debug: "entered file data, form-data path",
|
|
502
|
-
},
|
|
503
|
-
});
|
|
504
494
|
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
|
505
|
-
returnData.push({
|
|
506
|
-
json: {
|
|
507
|
-
debug: `binarydata type: ${binaryData.mimeType}`,
|
|
508
|
-
},
|
|
509
|
-
});
|
|
510
495
|
const fileBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
511
|
-
returnData.push({
|
|
512
|
-
json: {
|
|
513
|
-
debug: `fileBuffer size: ${fileBuffer.length}`,
|
|
514
|
-
},
|
|
515
|
-
});
|
|
516
496
|
const fileName = binaryData.fileName;
|
|
517
497
|
const mimeType = binaryData.mimeType;
|
|
518
498
|
const formData = new form_data_1.default();
|
|
@@ -520,19 +500,9 @@ class PayloadCms {
|
|
|
520
500
|
filename: fileName,
|
|
521
501
|
contentType: mimeType,
|
|
522
502
|
});
|
|
523
|
-
returnData.push({
|
|
524
|
-
json: {
|
|
525
|
-
debug: `formData append file: ${fileName}`,
|
|
526
|
-
},
|
|
527
|
-
});
|
|
528
503
|
if (data) {
|
|
529
504
|
const sanitizeData = typeof data === "string" ? JSON.parse(data) : data;
|
|
530
505
|
formData.append("_payload", JSON.stringify(sanitizeData));
|
|
531
|
-
returnData.push({
|
|
532
|
-
json: {
|
|
533
|
-
debug: `formData append data: ${data}`,
|
|
534
|
-
},
|
|
535
|
-
});
|
|
536
506
|
}
|
|
537
507
|
requestConfig = {
|
|
538
508
|
method: method,
|
|
@@ -547,11 +517,6 @@ class PayloadCms {
|
|
|
547
517
|
};
|
|
548
518
|
}
|
|
549
519
|
else {
|
|
550
|
-
returnData.push({
|
|
551
|
-
json: {
|
|
552
|
-
debug: "entered normal data, json data path",
|
|
553
|
-
},
|
|
554
|
-
});
|
|
555
520
|
requestConfig = {
|
|
556
521
|
method: method,
|
|
557
522
|
url,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warleon/n8n-nodes-payload-cms",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Dynamic n8n node for Payload CMS that auto-discovers collections and operations forked and extended from https://github.com/leadership-institute/n8n-payload-dynamic",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "warleon",
|