n8n-nodes-quickpdf 0.1.0 → 0.1.2

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.
@@ -1,8 +1,9 @@
1
- import type { ICredentialType, INodeProperties } from "n8n-workflow";
1
+ import type { ICredentialTestRequest, ICredentialType, INodeProperties } from "n8n-workflow";
2
2
  export declare class QuickPdfApi implements ICredentialType {
3
3
  name: string;
4
4
  displayName: string;
5
5
  documentationUrl: string;
6
+ supportedNodes: string[];
6
7
  properties: INodeProperties[];
7
8
  authenticate: {
8
9
  type: "generic";
@@ -12,4 +13,5 @@ export declare class QuickPdfApi implements ICredentialType {
12
13
  };
13
14
  };
14
15
  };
16
+ test: ICredentialTestRequest;
15
17
  }
@@ -6,6 +6,7 @@ class QuickPdfApi {
6
6
  this.name = "quickPdfApi";
7
7
  this.displayName = "Quick PDF Tools API";
8
8
  this.documentationUrl = "https://quickpdftools.net/developers/";
9
+ this.supportedNodes = ["n8n-nodes-quickpdf.quickPdf"];
9
10
  this.properties = [
10
11
  {
11
12
  displayName: "API Key",
@@ -13,6 +14,7 @@ class QuickPdfApi {
13
14
  type: "string",
14
15
  typeOptions: { password: true },
15
16
  default: "",
17
+ required: true,
16
18
  description: 'Bearer key starting with qpdf_live_ (from quickpdftools.net/developers)',
17
19
  },
18
20
  {
@@ -20,6 +22,7 @@ class QuickPdfApi {
20
22
  name: "apiBase",
21
23
  type: "string",
22
24
  default: "https://api.quickpdftools.net",
25
+ required: true,
23
26
  description: "Override for staging or self-hosted API",
24
27
  },
25
28
  ];
@@ -31,6 +34,13 @@ class QuickPdfApi {
31
34
  },
32
35
  },
33
36
  };
37
+ this.test = {
38
+ request: {
39
+ baseURL: "={{$credentials.apiBase.replace(/\\/$/, '')}}",
40
+ url: "/api/v1/capabilities",
41
+ method: "GET",
42
+ },
43
+ };
34
44
  }
35
45
  }
36
46
  exports.QuickPdfApi = QuickPdfApi;
@@ -9,7 +9,7 @@ class QuickPdf {
9
9
  name: "quickPdf",
10
10
  icon: "file:quickpdf.svg",
11
11
  group: ["transform"],
12
- version: 1,
12
+ version: [1],
13
13
  subtitle: '={{$parameter["operation"]}}',
14
14
  description: "Server-side PDF unlock, protect, and repair (Quick PDF Tools API v1)",
15
15
  defaults: { name: "Quick PDF" },
@@ -17,23 +17,49 @@ class QuickPdf {
17
17
  outputs: ["main" /* NodeConnectionType.Main */],
18
18
  credentials: [{ name: "quickPdfApi", required: true }],
19
19
  properties: [
20
+ {
21
+ displayName: "Resource",
22
+ name: "resource",
23
+ type: "options",
24
+ noDataExpression: true,
25
+ options: [
26
+ {
27
+ name: "Document",
28
+ value: "document",
29
+ description: "PDF file operations via Quick PDF Tools API",
30
+ },
31
+ ],
32
+ default: "document",
33
+ required: true,
34
+ },
20
35
  {
21
36
  displayName: "Operation",
22
37
  name: "operation",
23
38
  type: "options",
24
39
  noDataExpression: true,
40
+ displayOptions: {
41
+ show: {
42
+ resource: ["document"],
43
+ },
44
+ },
25
45
  options: [
26
- { name: "Unlock", value: "unlock", description: "Remove password when password is known" },
27
- { name: "Protect", value: "protect", description: "Encrypt with a password" },
28
- { name: "Repair", value: "repair", description: "Rebuild damaged cross-references" },
46
+ { name: "Unlock", value: "unlock", action: "Unlock a PDF with a known password" },
47
+ { name: "Protect", value: "protect", action: "Encrypt a PDF with a password" },
48
+ { name: "Repair", value: "repair", action: "Repair damaged PDF structure" },
29
49
  ],
30
50
  default: "unlock",
51
+ required: true,
31
52
  },
32
53
  {
33
54
  displayName: "Binary Property",
34
55
  name: "binaryPropertyName",
35
56
  type: "string",
36
57
  default: "data",
58
+ displayOptions: {
59
+ show: {
60
+ resource: ["document"],
61
+ },
62
+ },
37
63
  description: "Input PDF binary field from the previous node",
38
64
  },
39
65
  {
@@ -42,8 +68,12 @@ class QuickPdf {
42
68
  type: "string",
43
69
  typeOptions: { password: true },
44
70
  default: "",
71
+ required: true,
45
72
  displayOptions: {
46
- show: { operation: ["unlock", "protect"] },
73
+ show: {
74
+ resource: ["document"],
75
+ operation: ["unlock", "protect"],
76
+ },
47
77
  },
48
78
  description: "Password for unlock or protect",
49
79
  },
@@ -52,6 +82,11 @@ class QuickPdf {
52
82
  name: "outputBinaryPropertyName",
53
83
  type: "string",
54
84
  default: "data",
85
+ displayOptions: {
86
+ show: {
87
+ resource: ["document"],
88
+ },
89
+ },
55
90
  description: "Where to write the resulting PDF bytes",
56
91
  },
57
92
  ],
@@ -66,6 +101,10 @@ class QuickPdf {
66
101
  const apiKey = String(credentials.apiKey || "");
67
102
  for (let i = 0; i < items.length; i++) {
68
103
  try {
104
+ const resource = this.getNodeParameter("resource", i);
105
+ if (resource !== "document") {
106
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: `Unknown resource "${resource}"` });
107
+ }
69
108
  const operation = this.getNodeParameter("operation", i);
70
109
  const binaryPropertyName = this.getNodeParameter("binaryPropertyName", i);
71
110
  const outputBinaryPropertyName = this.getNodeParameter("outputBinaryPropertyName", i);
@@ -121,7 +160,7 @@ class QuickPdf {
121
160
  const newItem = {
122
161
  json: {
123
162
  ...items[i].json,
124
- quickPdf: { operation, apiBase, bytes: body.length },
163
+ quickPdf: { resource, operation, apiBase, bytes: body.length },
125
164
  },
126
165
  binary: {
127
166
  ...(items[i].binary || {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-quickpdf",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Unlock, protect, and repair PDFs via Quick PDF Tools API v1 (n8n Cloud friendly — no qpdf on host)",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -13,6 +13,7 @@
13
13
  "homepage": "https://quickpdftools.net/developers/n8n/",
14
14
  "author": {
15
15
  "name": "Quick PDF Tools",
16
+ "email": "sutirtharej@gmail.com",
16
17
  "url": "https://quickpdftools.net"
17
18
  },
18
19
  "repository": {
@@ -34,6 +35,7 @@
34
35
  ],
35
36
  "n8n": {
36
37
  "n8nNodesApiVersion": 1,
38
+ "strict": true,
37
39
  "credentials": [
38
40
  "dist/credentials/QuickPdfApi.credentials.js"
39
41
  ],