@warleon/n8n-nodes-payload-cms 1.3.7 → 1.3.9

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.
@@ -378,9 +378,9 @@ class PayloadCms {
378
378
  //console.log("In Authenticated Request auth token:", authToken);
379
379
  // Add authorization header
380
380
  config.headers = {
381
- ...config.headers,
382
381
  Authorization: authToken,
383
382
  "Content-Type": "application/json",
383
+ ...config.headers,
384
384
  };
385
385
  config.validateStatus = (status) => {
386
386
  return status < 500;
@@ -502,7 +502,17 @@ class PayloadCms {
502
502
  },
503
503
  });
504
504
  const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
505
+ returnData.push({
506
+ json: {
507
+ debug: `binarydata type: ${binaryData.mimeType}`,
508
+ },
509
+ });
505
510
  const fileBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
511
+ returnData.push({
512
+ json: {
513
+ debug: `fileBuffer size: ${fileBuffer.length}`,
514
+ },
515
+ });
506
516
  const fileName = binaryData.fileName;
507
517
  const mimeType = binaryData.mimeType;
508
518
  const formData = new form_data_1.default();
@@ -510,9 +520,19 @@ class PayloadCms {
510
520
  filename: fileName,
511
521
  contentType: mimeType,
512
522
  });
523
+ returnData.push({
524
+ json: {
525
+ debug: `formData append file: ${fileName}`,
526
+ },
527
+ });
513
528
  if (data) {
514
529
  const sanitizeData = typeof data === "string" ? JSON.parse(data) : data;
515
530
  formData.append("_payload", JSON.stringify(sanitizeData));
531
+ returnData.push({
532
+ json: {
533
+ debug: `formData append data: ${data}`,
534
+ },
535
+ });
516
536
  }
517
537
  requestConfig = {
518
538
  method: method,
@@ -522,6 +542,7 @@ class PayloadCms {
522
542
  data: formData,
523
543
  headers: {
524
544
  ...formData.getHeaders(),
545
+ "Content-Type": "multipart/form-data",
525
546
  },
526
547
  };
527
548
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warleon/n8n-nodes-payload-cms",
3
- "version": "1.3.7",
3
+ "version": "1.3.9",
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",