n8n-nodes-pdfbro 0.1.6 → 0.1.7

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.
@@ -93,7 +93,7 @@ class PdfBro {
93
93
  ],
94
94
  },
95
95
  ],
96
- description: 'List of binary properties to merge (in order)',
96
+ description: 'Add more binary properties to merge (e.g. data2, attachment_1)',
97
97
  },
98
98
  {
99
99
  displayName: 'Input Binary Field',
@@ -101,11 +101,6 @@ class PdfBro {
101
101
  type: 'string',
102
102
  default: 'data',
103
103
  required: true,
104
- displayOptions: {
105
- hide: {
106
- operation: ['merge'],
107
- },
108
- },
109
104
  description: 'The name of the binary field containing the PDF',
110
105
  },
111
106
  {
@@ -143,6 +138,8 @@ class PdfBro {
143
138
  if (operation === 'merge') {
144
139
  // Merge multiple binary properties FROM ALL ITEMS into ONE SINGLE PDF
145
140
  const outputPropertyName = this.getNodeParameter('outputPropertyName', 0);
141
+ // Default primary property
142
+ const primaryBinaryProp = this.getNodeParameter('binaryPropertyName', 0);
146
143
  const mergedPdf = await pdf_lib_1.PDFDocument.create();
147
144
  for (let i = 0; i < items.length; i++) {
148
145
  try {
@@ -151,9 +148,12 @@ class PdfBro {
151
148
  if (binaryProps && binaryProps.properties) {
152
149
  propsToMerge = binaryProps.properties.map((p) => p.property);
153
150
  }
154
- // Fallback: If no properties specified, try 'data' default
151
+ // Fallback: If no ADDITIONAL properties specified, use the PRIMARY one.
152
+ // Also, IF properties ARE specified, do we include the primary one?
153
+ // UX Decision: If user specified explicit list, they likely want just that list.
154
+ // BUT, to keep it simple: If list is empty, use primary.
155
155
  if (propsToMerge.length === 0) {
156
- propsToMerge.push('data');
156
+ propsToMerge.push(primaryBinaryProp);
157
157
  }
158
158
  for (const propName of propsToMerge) {
159
159
  // Check if binary data exists
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-pdfbro",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Offline PDF utility node for n8n",
5
5
  "keywords": [
6
6
  "n8n-community-node"