n8n-nodes-proofofauthenticity 1.0.5 → 1.0.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.
package/README.md CHANGED
@@ -30,6 +30,28 @@ Certify content with blockchain timestamp.
30
30
  | Description | Description (optional) |
31
31
  | Certification Mode | Simple or AI + C2PA |
32
32
 
33
+ ### Download C2PA File
34
+
35
+ Download the C2PA signed image file as binary output. Use this after creating a certificate with AI + C2PA mode.
36
+
37
+ | Parameter | Description |
38
+ |-----------|-------------|
39
+ | C2PA Download URL | The `c2pa_download_url` returned by Create Certificate (AI mode) |
40
+ | Binary Property Name | Output binary property name (default: `c2pa_file`) |
41
+
42
+ **Output**: Binary file with C2PA metadata embedded.
43
+
44
+ ### Download PDF Certificate
45
+
46
+ Download the PDF certificate as binary output.
47
+
48
+ | Parameter | Description |
49
+ |-----------|-------------|
50
+ | C2PA File ID | The `c2pa_file_id` returned by Create Certificate (AI mode) |
51
+ | Binary Property Name | Output binary property name (default: `pdf_certificate`) |
52
+
53
+ **Output**: PDF document with certification details.
54
+
33
55
  ### List Certificates
34
56
 
35
57
  List blockchain certificates with optional filters (hash, filename, signature).
@@ -411,7 +411,7 @@ class ProofOfAuthenticity {
411
411
  default: '',
412
412
  required: true,
413
413
  placeholder: '/api/c2pa/download/abc123',
414
- description: 'The c2pa_download_url returned by createCertificate (AI mode). Will be appended to DigiCryptoStore URL.',
414
+ description: 'The c2pa_download_url returned by Create Certificate (AI mode)',
415
415
  },
416
416
  {
417
417
  displayName: 'Binary Property Name',
@@ -440,7 +440,7 @@ class ProofOfAuthenticity {
440
440
  default: '',
441
441
  required: true,
442
442
  placeholder: 'abc123-def456-ghi789',
443
- description: 'The c2pa_file_id returned by createCertificate (AI mode)',
443
+ description: 'The c2pa_file_id returned by Create Certificate (AI mode)',
444
444
  },
445
445
  {
446
446
  displayName: 'Binary Property Name',
@@ -589,7 +589,6 @@ class ProofOfAuthenticity {
589
589
  else if (operation === 'downloadC2paFile') {
590
590
  const c2paDownloadUrl = this.getNodeParameter('c2paDownloadUrl', i);
591
591
  const binaryPropertyName = this.getNodeParameter('c2paBinaryProperty', i, 'c2pa_file');
592
- // Build full URL: baseUrl + c2paDownloadUrl
593
592
  const fullUrl = c2paDownloadUrl.startsWith('http')
594
593
  ? c2paDownloadUrl
595
594
  : `${baseUrl}${c2paDownloadUrl.startsWith('/') ? '' : '/'}${c2paDownloadUrl}`;
@@ -606,13 +605,11 @@ class ProofOfAuthenticity {
606
605
  const contentType = response.headers['content-type'] || 'image/jpeg';
607
606
  const contentDisposition = response.headers['content-disposition'] || '';
608
607
  let fileName = 'c2pa_file';
609
- // Extract filename from Content-Disposition header if available
610
- const filenameMatch = contentDisposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
611
- if (filenameMatch && filenameMatch[1]) {
612
- fileName = filenameMatch[1].replace(/['"]/g, '');
608
+ const filenameMatch = contentDisposition.match(/filename[^;=\n]*=(['"]?)([^'"\n;]*)['"]?/);
609
+ if (filenameMatch && filenameMatch[2]) {
610
+ fileName = filenameMatch[2];
613
611
  }
614
612
  else {
615
- // Generate filename based on content type
616
613
  const ext = contentType.split('/')[1] || 'jpg';
617
614
  fileName = `c2pa_file.${ext}`;
618
615
  }
@@ -637,7 +634,6 @@ class ProofOfAuthenticity {
637
634
  else if (operation === 'downloadPdfCertificate') {
638
635
  const c2paFileId = this.getNodeParameter('c2paFileId', i);
639
636
  const binaryPropertyName = this.getNodeParameter('pdfBinaryProperty', i, 'pdf_certificate');
640
- // Build PDF download URL
641
637
  const pdfUrl = `${baseUrl}/api/c2pa/certificate/${c2paFileId}/pdf`;
642
638
  const response = await axios_1.default.get(pdfUrl, {
643
639
  timeout: DOWNLOAD_TIMEOUT,
@@ -652,10 +648,9 @@ class ProofOfAuthenticity {
652
648
  const contentType = response.headers['content-type'] || 'application/pdf';
653
649
  const contentDisposition = response.headers['content-disposition'] || '';
654
650
  let fileName = `certificate_${c2paFileId}.pdf`;
655
- // Extract filename from Content-Disposition header if available
656
- const filenameMatch = contentDisposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
657
- if (filenameMatch && filenameMatch[1]) {
658
- fileName = filenameMatch[1].replace(/['"]/g, '');
651
+ const filenameMatch = contentDisposition.match(/filename[^;=\n]*=(['"]?)([^'"\n;]*)['"]?/);
652
+ if (filenameMatch && filenameMatch[2]) {
653
+ fileName = filenameMatch[2];
659
654
  }
660
655
  const binaryData = await this.helpers.prepareBinaryData(Buffer.from(response.data), fileName, contentType);
661
656
  returnData.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-proofofauthenticity",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "ProofOfAuthenticity by CHECKHC - Blockchain timestamping with AI detection and C2PA content authenticity.",
5
5
  "keywords": [
6
6
  "n8n",
@@ -49,7 +49,7 @@
49
49
  "@types/node": "^20.0.0",
50
50
  "eslint": "^8.0.0",
51
51
  "gulp": "^4.0.2",
52
- "n8n-workflow": "^2.2.2",
52
+ "n8n-workflow": "^1.0.0",
53
53
  "prettier": "^3.0.0",
54
54
  "typescript": "^5.0.0"
55
55
  },