n8n-nodes-proofofauthenticity 1.0.3 → 1.0.4

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.
@@ -230,6 +230,11 @@ class ProofOfAuthenticity {
230
230
  },
231
231
  },
232
232
  options: [
233
+ {
234
+ name: 'Binary (from previous node)',
235
+ value: 'binary',
236
+ description: 'Use binary data from previous node (e.g., Form Trigger)',
237
+ },
233
238
  {
234
239
  name: 'URL',
235
240
  value: 'url',
@@ -241,9 +246,23 @@ class ProofOfAuthenticity {
241
246
  description: 'File content as base64 encoded string',
242
247
  },
243
248
  ],
244
- default: 'url',
249
+ default: 'binary',
245
250
  description: 'How to provide the file content',
246
251
  },
252
+ {
253
+ displayName: 'Binary Property',
254
+ name: 'binaryPropertyName',
255
+ type: 'string',
256
+ displayOptions: {
257
+ show: {
258
+ operation: ['createCertificate'],
259
+ inputType: ['binary'],
260
+ },
261
+ },
262
+ default: 'data',
263
+ placeholder: 'data',
264
+ description: 'Name of the binary property containing the file (default: "data" for Form Trigger)',
265
+ },
247
266
  {
248
267
  displayName: 'File URL',
249
268
  name: 'fileUrl',
@@ -392,7 +411,16 @@ class ProofOfAuthenticity {
392
411
  // Map certification mode to API parameters
393
412
  const usageType = certificationMode === 'simple' ? 'simple' : 'ai';
394
413
  let fileData;
395
- if (inputType === 'url') {
414
+ if (inputType === 'binary') {
415
+ // Read binary data from previous node (e.g., Form Trigger)
416
+ const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i, 'data');
417
+ const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
418
+ const buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
419
+ const mimeType = binaryData.mimeType || 'application/octet-stream';
420
+ const base64Data = buffer.toString('base64');
421
+ fileData = `data:${mimeType};base64,${base64Data}`;
422
+ }
423
+ else if (inputType === 'url') {
396
424
  const fileUrl = this.getNodeParameter('fileUrl', i);
397
425
  // Validate URL to prevent SSRF
398
426
  validateUrl(fileUrl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-proofofauthenticity",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "ProofOfAuthenticity by CHECKHC - Blockchain timestamping with AI detection and C2PA content authenticity.",
5
5
  "keywords": [
6
6
  "n8n",