@apdf/n8n-nodes-apdf 0.0.0-stage → 0.1.1

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.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +261 -2
  3. package/dist/credentials/ApdfApi.credentials.d.ts +11 -0
  4. package/dist/credentials/ApdfApi.credentials.js +53 -0
  5. package/dist/credentials/ApdfApi.credentials.js.map +1 -0
  6. package/dist/credentials/apdf.dark.svg +7 -0
  7. package/dist/credentials/apdf.svg +8 -0
  8. package/dist/nodes/Apdf/Apdf.node.d.ts +9 -0
  9. package/dist/nodes/Apdf/Apdf.node.js +102 -0
  10. package/dist/nodes/Apdf/Apdf.node.js.map +1 -0
  11. package/dist/nodes/Apdf/Apdf.node.json +34 -0
  12. package/dist/nodes/Apdf/ApdfTrigger.node.d.ts +12 -0
  13. package/dist/nodes/Apdf/ApdfTrigger.node.js +195 -0
  14. package/dist/nodes/Apdf/ApdfTrigger.node.js.map +1 -0
  15. package/dist/nodes/Apdf/ApdfTrigger.node.json +34 -0
  16. package/dist/nodes/Apdf/apdf.dark.svg +7 -0
  17. package/dist/nodes/Apdf/apdf.svg +8 -0
  18. package/dist/nodes/Apdf/descriptions/AnalyticsDescription.d.ts +3 -0
  19. package/dist/nodes/Apdf/descriptions/AnalyticsDescription.js +87 -0
  20. package/dist/nodes/Apdf/descriptions/AnalyticsDescription.js.map +1 -0
  21. package/dist/nodes/Apdf/descriptions/AutomationDescription.d.ts +3 -0
  22. package/dist/nodes/Apdf/descriptions/AutomationDescription.js +234 -0
  23. package/dist/nodes/Apdf/descriptions/AutomationDescription.js.map +1 -0
  24. package/dist/nodes/Apdf/descriptions/DocumentDescription.d.ts +3 -0
  25. package/dist/nodes/Apdf/descriptions/DocumentDescription.js +145 -0
  26. package/dist/nodes/Apdf/descriptions/DocumentDescription.js.map +1 -0
  27. package/dist/nodes/Apdf/descriptions/JobDescription.d.ts +3 -0
  28. package/dist/nodes/Apdf/descriptions/JobDescription.js +40 -0
  29. package/dist/nodes/Apdf/descriptions/JobDescription.js.map +1 -0
  30. package/dist/nodes/Apdf/descriptions/LinkDescription.d.ts +3 -0
  31. package/dist/nodes/Apdf/descriptions/LinkDescription.js +114 -0
  32. package/dist/nodes/Apdf/descriptions/LinkDescription.js.map +1 -0
  33. package/dist/nodes/Apdf/descriptions/PdfDescription.d.ts +3 -0
  34. package/dist/nodes/Apdf/descriptions/PdfDescription.js +722 -0
  35. package/dist/nodes/Apdf/descriptions/PdfDescription.js.map +1 -0
  36. package/dist/nodes/Apdf/descriptions/index.d.ts +6 -0
  37. package/dist/nodes/Apdf/descriptions/index.js +23 -0
  38. package/dist/nodes/Apdf/descriptions/index.js.map +1 -0
  39. package/dist/nodes/shared/display.d.ts +2 -0
  40. package/dist/nodes/shared/display.js +13 -0
  41. package/dist/nodes/shared/display.js.map +1 -0
  42. package/dist/nodes/shared/events.d.ts +3 -0
  43. package/dist/nodes/shared/events.js +57 -0
  44. package/dist/nodes/shared/events.js.map +1 -0
  45. package/dist/nodes/shared/fields.d.ts +4 -0
  46. package/dist/nodes/shared/fields.js +66 -0
  47. package/dist/nodes/shared/fields.js.map +1 -0
  48. package/dist/nodes/shared/output.d.ts +9 -0
  49. package/dist/nodes/shared/output.js +72 -0
  50. package/dist/nodes/shared/output.js.map +1 -0
  51. package/dist/nodes/shared/pagination.d.ts +2 -0
  52. package/dist/nodes/shared/pagination.js +60 -0
  53. package/dist/nodes/shared/pagination.js.map +1 -0
  54. package/dist/nodes/shared/transport.d.ts +9 -0
  55. package/dist/nodes/shared/transport.js +39 -0
  56. package/dist/nodes/shared/transport.js.map +1 -0
  57. package/dist/package.json +66 -0
  58. package/package.json +65 -5
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 apdf.io
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,262 @@
1
- # Temporary Holding Version
1
+ # @apdf/n8n-nodes-apdf
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An n8n node for [Apdf](https://apdf.io) — the PDF engagement layer for apps and agents.
4
+
5
+ Share a PDF as a per-recipient tracking link, then find out who opened it, which pages they
6
+ actually read, how long they stayed and what they typed into its forms. The same node also
7
+ covers the full Apdf PDF toolset: create, convert from Office, merge, split, compress, OCR,
8
+ encrypt and page operations.
9
+
10
+ [n8n](https://n8n.io) is a [fair-code licensed](https://docs.n8n.io/reference/license/)
11
+ workflow automation platform.
12
+
13
+ - [Installation](#installation)
14
+ - [Credentials](#credentials)
15
+ - [Nodes](#nodes)
16
+ - [Apdf Trigger](#apdf-trigger)
17
+ - [Apdf](#apdf)
18
+ - [Asynchronous operations](#asynchronous-operations)
19
+ - [Page ranges](#page-ranges)
20
+ - [Resources](#resources)
21
+
22
+ ## Installation
23
+
24
+ Follow the
25
+ [community node installation guide](https://docs.n8n.io/integrations/community-nodes/installation/)
26
+ and install `@apdf/n8n-nodes-apdf`.
27
+
28
+ ## Credentials
29
+
30
+ The nodes authenticate with an Apdf API token.
31
+
32
+ 1. Sign in at [apdf.io](https://apdf.io) and open **Dashboard → API → Tokens**.
33
+ 2. Create a token and copy it. A token belongs to one workspace, so every request through
34
+ this node acts on that workspace.
35
+ 3. In n8n, create new **Apdf API** credentials and paste the token.
36
+
37
+ The **Base URL** field defaults to `https://apdf.io/api` and only needs changing if you run
38
+ Apdf on another host.
39
+
40
+ Apdf sends the token as `Authorization: Bearer <token>`. The credential test calls
41
+ `GET /docs`, so a valid token with an accessible workspace returns success immediately.
42
+
43
+ ## Nodes
44
+
45
+ This package ships two nodes:
46
+
47
+ | Node | Purpose |
48
+ | ---------------- | -------------------------------------------------------------------- |
49
+ | **Apdf Trigger** | Starts a workflow when someone interacts with a PDF you shared |
50
+ | **Apdf** | Reads engagement data and runs PDF operations |
51
+
52
+ ## Apdf Trigger
53
+
54
+ The trigger receives the webhook that an Apdf automation sends when a reader does something.
55
+
56
+ ### Setup
57
+
58
+ The trigger registers itself. Pick the events you care about and activate the workflow — the
59
+ node creates the matching automation in Apdf, and deletes it again when you deactivate.
60
+
61
+ 1. Add the **Apdf Trigger** node and select your **Apdf API** credentials.
62
+ 2. Choose one or more **Events**.
63
+ 3. Optionally restrict it to certain **Documents** by ID, and add **Conditions** such as
64
+ *page number equals 7*.
65
+ 4. Activate the workflow. The automation appears under **Documents → Automations** in Apdf,
66
+ named after your workflow.
67
+
68
+ Nothing needs creating by hand. If you delete the automation in Apdf, deactivating and
69
+ reactivating the workflow recreates it.
70
+
71
+ Under **Options** you can set an **Auth Header Value**. The node sends it to Apdf as a
72
+ webhook header and rejects any incoming request that does not carry it — worth setting, since
73
+ the webhook URL is otherwise the only thing protecting the endpoint.
74
+
75
+ ### Events
76
+
77
+ Choose at least one event. Apdf filters on its side, so the workflow only runs for what you
78
+ selected.
79
+
80
+ | Event | Fires when |
81
+ | -------------------- | --------------------------------------------------- |
82
+ | Document Opened | A viewer opens the PDF |
83
+ | Document Downloaded | A viewer downloads the PDF |
84
+ | Document Printed | A viewer prints the PDF |
85
+ | Page Viewed | A viewer navigates to a page |
86
+ | Page Read | A viewer stays on a page, measured every 15 seconds |
87
+ | Page Left | A viewer navigates away from a page |
88
+ | Text Copied | A viewer copies text from the PDF |
89
+ | Link Clicked | A viewer clicks a link in the PDF |
90
+ | Form Submitted | A viewer submits a form in the PDF |
91
+ | Annotation Created | A viewer creates an annotation |
92
+ | Annotation Updated | A viewer modifies an annotation |
93
+ | Annotation Deleted | A viewer removes an annotation |
94
+
95
+ Document and page events — opened, downloaded, printed, viewed, read and left — trigger an
96
+ automation **once per reading session**, even where the underlying measurement repeats. Page
97
+ Read is measured every 15 seconds, but your workflow runs once for that session. Text Copied,
98
+ Link Clicked, Form Submitted and the annotation events fire every time they happen.
99
+
100
+ ### Output
101
+
102
+ The trigger emits the automation payload unchanged:
103
+
104
+ ```json
105
+ {
106
+ "automation": { "id": "…", "name": "Notify on read" },
107
+ "document": {
108
+ "doc_id": "…",
109
+ "name": "Proposal.pdf",
110
+ "viewer_url": "https://…",
111
+ "file_pages": 12
112
+ },
113
+ "trigger": { "matched_event": "page:read", "conditions_evaluated": true },
114
+ "event": {
115
+ "session_id": "…",
116
+ "viewer_id": "…",
117
+ "recipient": { "name": "Jane Doe", "email": "jane@example.com" },
118
+ "data": { "page": 5, "duration_ms": 45000 }
119
+ },
120
+ "session": { "total_duration_ms": 182000, "pages_viewed": 8, "completion_rate": 0.67 },
121
+ "timestamp": "2026-07-28T12:00:00+00:00"
122
+ }
123
+ ```
124
+
125
+ `event.data` varies by event. Page events carry `page` and `duration_ms`, `link:clicked`
126
+ carries the `url`, `form:submit` carries the submitted `fields`, and annotation events carry
127
+ the annotation `type` and comment. Document open, download and print events have no extra
128
+ data.
129
+
130
+ ### Example
131
+
132
+ Alert your team the moment a prospect reads your pricing page:
133
+
134
+ 1. **Apdf Trigger** — event **Page Read**, **Documents** set to the proposal's ID, and a
135
+ **Condition** of *page number equals* `5`.
136
+
137
+ Use a condition rather than an IF node downstream. The automation fires once per reading
138
+ session, on the first Page Read that satisfies its conditions, so filtering afterwards in
139
+ n8n would usually see a different page and never match.
140
+ 2. **Slack** — post `{{ $json.event.recipient.name }} just read page
141
+ {{ $json.event.data.page }} — {{ $json.session.pages_viewed }} pages in
142
+ {{ $json.session.total_duration_ms / 1000 }}s`.
143
+
144
+ ### Conditions
145
+
146
+ | Condition | Tests |
147
+ | ----------------------------- | ---------------------------------------------- |
148
+ | Page Number Equals | The page the event happened on |
149
+ | Time on Page At Least | Seconds spent on that page |
150
+ | Total Reading Time At Least | Seconds spent in the whole session |
151
+ | Pages Viewed At Least | How many distinct pages were seen |
152
+ | Completion Rate At Least | Percentage of the document read |
153
+
154
+ Not every condition works with every event — a page condition needs a page event, for
155
+ instance. Apdf validates the combination when the workflow is activated and returns a clear
156
+ error if it cannot work.
157
+
158
+ ## Apdf
159
+
160
+ Wherever an operation needs a document, the node offers a **Document Name or ID** dropdown
161
+ populated from your workspace — pick one, or supply an ID with an expression when it comes
162
+ from an earlier node.
163
+
164
+ List operations follow the n8n convention: **Return All** fetches every page, or leave it off
165
+ and set a **Limit**. Responses are unwrapped, so each record arrives as its own item rather
166
+ than as one item holding the whole response.
167
+
168
+ ### Document
169
+
170
+ Create, list, get and delete tracked documents, archive and unarchive them, and switch a
171
+ document between public and link-only access.
172
+
173
+ Creating a document takes a publicly reachable **File URL** and a **Name**.
174
+
175
+ ### Tracking Link
176
+
177
+ Mint one link per recipient so that reading activity is attributed to a person rather than an
178
+ anonymous viewer. Create, list, delete, activate and deactivate links.
179
+
180
+ A **Recipient Name** is required; **Recipient Email** is optional.
181
+
182
+ ### Analytics
183
+
184
+ | Operation | Returns |
185
+ | --------------------- | ------------------------------------------------------------------- |
186
+ | Get KPIs | Sessions, viewers, completion rate and downloads for a document |
187
+ | Get Sessions | The reading sessions recorded for a document |
188
+ | Get Session | One session, including its per-page detail |
189
+ | Get Annotations | Highlights and comments readers left |
190
+ | Get Form Submissions | What readers typed into the document's forms |
191
+
192
+ ### PDF
193
+
194
+ Nineteen operations over the Apdf PDF API: **Create From HTML**, **Convert From Office**,
195
+ **Merge**, **Split**, **Compress**, **Convert to Image**, **Extract Pages**, **Delete Pages**, **Rotate Pages**,
196
+ **Overlay Pages**, **Underlay Pages**, **Search Content**, **Read Content**, **OCR
197
+ Convert**, **OCR Search Content**, **OCR Read Content**, **Add Security**, **Remove
198
+ Security** and **Read Metadata**.
199
+
200
+ Every operation takes its source as a publicly reachable URL and returns a new file. None of
201
+ them modify the source, including **Delete Pages**.
202
+
203
+ **Convert From Office** takes a Word, Excel, PowerPoint, OpenDocument or RTF file (docx, doc,
204
+ xlsx, xls, pptx, ppt, odt, ods, odp, rtf) instead of a PDF.
205
+
206
+ ### Automation
207
+
208
+ Full control over the rules that turn reader activity into webhook calls: **Create**, **Get**,
209
+ **Get Many**, **Delete**, **Activate**, **Deactivate**, **Duplicate**, and **Get Executions**
210
+ for the delivery history.
211
+
212
+ Creating one takes a **Name**, one or more **Events** and a **Webhook URL**. Set **Scope** to
213
+ *Specific Documents* to narrow it to given IDs, add **Conditions** to fire only past a
214
+ threshold, and add **Webhook Headers** so your endpoint can authenticate the call.
215
+
216
+ If you only want a workflow to react to readers, use the **Apdf Trigger** instead — it creates
217
+ and removes its own automation. Use this resource when you are managing automations
218
+ programmatically, for instance pointing them at systems outside n8n.
219
+
220
+ ### Job
221
+
222
+ **Check Status** polls an asynchronous operation for its result.
223
+
224
+ ## Asynchronous operations
225
+
226
+ Apdf runs heavy work on a queue. Seven operations always return a job ID instead of a result:
227
+
228
+ - Create From HTML
229
+ - Convert From Office
230
+ - Compress
231
+ - Convert to Image
232
+ - OCR Convert
233
+ - OCR Read Content
234
+ - OCR Search Content
235
+
236
+ The remaining PDF operations run inline by default, and return a job ID only when you enable
237
+ **Run Asynchronously** under **Options**.
238
+
239
+ To get the result of a job, either poll it with the **Job → Check Status** operation, or set
240
+ a **Webhook URL** so Apdf calls you when the job finishes.
241
+
242
+ ## Page ranges
243
+
244
+ Operations that take a **Pages** value accept page numbers and ranges, for example `1,3-5`.
245
+ Two shortcuts are available:
246
+
247
+ - `z` — the last page
248
+ - `rN` — the Nth page from the end, so `r2` is the second-to-last page
249
+
250
+ **Split** additionally accepts `nN`, which splits into files of N pages each. `n2` yields
251
+ files of two pages.
252
+
253
+ ## Resources
254
+
255
+ - [Apdf documentation](https://apdf.io/docs)
256
+ - [Apdf MCP server](https://apdf.io/product/pdf-mcp-server) — for agent access rather than
257
+ workflow steps
258
+ - [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
259
+
260
+ ## License
261
+
262
+ [MIT](LICENSE)
@@ -0,0 +1,11 @@
1
+ import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare const APDF_CREDENTIALS = "apdfApi";
3
+ export declare class ApdfApi implements ICredentialType {
4
+ name: string;
5
+ displayName: string;
6
+ icon: Icon;
7
+ documentationUrl: string;
8
+ properties: INodeProperties[];
9
+ authenticate: IAuthenticateGeneric;
10
+ test: ICredentialTestRequest;
11
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApdfApi = exports.APDF_CREDENTIALS = void 0;
4
+ exports.APDF_CREDENTIALS = 'apdfApi';
5
+ class ApdfApi {
6
+ constructor() {
7
+ this.name = exports.APDF_CREDENTIALS;
8
+ this.displayName = 'Apdf API';
9
+ this.icon = { light: 'file:apdf.svg', dark: 'file:apdf.dark.svg' };
10
+ this.documentationUrl = 'https://github.com/apdf-io/n8n-nodes-apdf?tab=readme-ov-file#credentials';
11
+ this.properties = [
12
+ {
13
+ displayName: 'Create a token in <a href="https://apdf.io/dashboard/api/tokens" target="_blank">Dashboard → API → Tokens</a>. A token belongs to one workspace, so this credential acts on that workspace.',
14
+ name: 'notice',
15
+ type: 'notice',
16
+ default: '',
17
+ },
18
+ {
19
+ displayName: 'API Token',
20
+ name: 'apiToken',
21
+ type: 'string',
22
+ typeOptions: { password: true },
23
+ required: true,
24
+ default: '',
25
+ description: 'The API token created in your Apdf dashboard',
26
+ },
27
+ {
28
+ displayName: 'Base URL',
29
+ name: 'baseUrl',
30
+ type: 'string',
31
+ default: 'https://apdf.io/api',
32
+ description: 'Change this only if you run Apdf on a different host',
33
+ },
34
+ ];
35
+ this.authenticate = {
36
+ type: 'generic',
37
+ properties: {
38
+ headers: {
39
+ Authorization: '=Bearer {{$credentials.apiToken}}',
40
+ Accept: 'application/json',
41
+ },
42
+ },
43
+ };
44
+ this.test = {
45
+ request: {
46
+ baseURL: '={{$credentials.baseUrl}}',
47
+ url: '/docs',
48
+ },
49
+ };
50
+ }
51
+ }
52
+ exports.ApdfApi = ApdfApi;
53
+ //# sourceMappingURL=ApdfApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApdfApi.credentials.js","sourceRoot":"","sources":["../../credentials/ApdfApi.credentials.ts"],"names":[],"mappings":";;;AASa,QAAA,gBAAgB,GAAG,SAAS,CAAC;AAE1C,MAAa,OAAO;IAApB;QACC,SAAI,GAAG,wBAAgB,CAAC;QAExB,gBAAW,GAAG,UAAU,CAAC;QAEzB,SAAI,GAAS,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;QAEpE,qBAAgB,GAAG,0EAA0E,CAAC;QAE9F,eAAU,GAAsB;YAC/B;gBACC,WAAW,EACV,6LAA6L;gBAC9L,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,8CAA8C;aAC3D;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,qBAAqB;gBAC9B,WAAW,EAAE,sDAAsD;aACnE;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,mCAAmC;oBAClD,MAAM,EAAE,kBAAkB;iBAC1B;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,OAAO;aACZ;SACD,CAAC;IACH,CAAC;CAAA;AAnDD,0BAmDC"}
@@ -0,0 +1,7 @@
1
+ <svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
2
+ <g transform="translate(-169.34,-96.7) scale(2.51)">
3
+ <path fill="#fcfcfc"
4
+ d="m 71.091088,58.042236 5.570438,-13.53926 h 1.547344 l 5.531755,13.53926 H 81.342242 L 77.009679,47.075435 h 0.812355 l -4.371247,10.966801 z m 2.746535,-2.611143 v -1.93418 h 7.175808 v 1.93418 z"/>
5
+ </g>
6
+ <circle cx="48.9" cy="43" r="6" fill="#f7dc00"/>
7
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="64" height="64" rx="14" fill="#0d0d0b"/>
3
+ <g transform="translate(-169.34,-96.7) scale(2.51)">
4
+ <path fill="#fcfcfc"
5
+ d="m 71.091088,58.042236 5.570438,-13.53926 h 1.547344 l 5.531755,13.53926 H 81.342242 L 77.009679,47.075435 h 0.812355 l -4.371247,10.966801 z m 2.746535,-2.611143 v -1.93418 h 7.175808 v 1.93418 z"/>
6
+ </g>
7
+ <circle cx="48.9" cy="43" r="6" fill="#f7dc00"/>
8
+ </svg>
@@ -0,0 +1,9 @@
1
+ import { type ILoadOptionsFunctions, type INodePropertyOptions, type INodeType, type INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Apdf implements INodeType {
3
+ description: INodeTypeDescription;
4
+ methods: {
5
+ loadOptions: {
6
+ getDocuments(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
7
+ };
8
+ };
9
+ }
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Apdf = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const descriptions_1 = require("./descriptions");
6
+ const ApdfApi_credentials_1 = require("../../credentials/ApdfApi.credentials");
7
+ const transport_1 = require("../shared/transport");
8
+ class Apdf {
9
+ constructor() {
10
+ this.description = {
11
+ displayName: 'Apdf',
12
+ name: 'apdf',
13
+ icon: { light: 'file:apdf.svg', dark: 'file:apdf.dark.svg' },
14
+ group: ['transform'],
15
+ version: 1,
16
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
17
+ description: 'Track shared PDFs, read engagement analytics and process PDF files',
18
+ defaults: {
19
+ name: 'Apdf',
20
+ },
21
+ usableAsTool: true,
22
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
23
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
24
+ credentials: [
25
+ {
26
+ name: ApdfApi_credentials_1.APDF_CREDENTIALS,
27
+ required: true,
28
+ },
29
+ ],
30
+ requestDefaults: {
31
+ baseURL: '={{$credentials.baseUrl}}',
32
+ headers: {
33
+ Accept: 'application/json',
34
+ 'Content-Type': 'application/json',
35
+ },
36
+ },
37
+ properties: [
38
+ {
39
+ displayName: 'Resource',
40
+ name: 'resource',
41
+ type: 'options',
42
+ noDataExpression: true,
43
+ options: [
44
+ {
45
+ name: 'Analytics',
46
+ value: 'analytics',
47
+ },
48
+ {
49
+ name: 'Automation',
50
+ value: 'automation',
51
+ },
52
+ {
53
+ name: 'Document',
54
+ value: 'document',
55
+ },
56
+ {
57
+ name: 'Job',
58
+ value: 'job',
59
+ },
60
+ {
61
+ name: 'PDF',
62
+ value: 'pdf',
63
+ },
64
+ {
65
+ name: 'Tracking Link',
66
+ value: 'link',
67
+ },
68
+ ],
69
+ default: 'document',
70
+ },
71
+ ...descriptions_1.analyticsOperations,
72
+ ...descriptions_1.analyticsFields,
73
+ ...descriptions_1.automationOperations,
74
+ ...descriptions_1.automationFields,
75
+ ...descriptions_1.documentOperations,
76
+ ...descriptions_1.documentFields,
77
+ ...descriptions_1.jobOperations,
78
+ ...descriptions_1.jobFields,
79
+ ...descriptions_1.linkOperations,
80
+ ...descriptions_1.linkFields,
81
+ ...descriptions_1.pdfOperations,
82
+ ...descriptions_1.pdfFields,
83
+ ],
84
+ };
85
+ this.methods = {
86
+ loadOptions: {
87
+ async getDocuments() {
88
+ var _a;
89
+ const response = await (0, transport_1.apdfApiRequest)(this, 'GET', '/docs', {
90
+ qs: { per_page: 100 },
91
+ });
92
+ return ((_a = response.data) !== null && _a !== void 0 ? _a : []).map((document) => ({
93
+ name: document.name || document.doc_id,
94
+ value: document.doc_id,
95
+ }));
96
+ },
97
+ },
98
+ };
99
+ }
100
+ }
101
+ exports.Apdf = Apdf;
102
+ //# sourceMappingURL=Apdf.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Apdf.node.js","sourceRoot":"","sources":["../../../nodes/Apdf/Apdf.node.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AAEtB,iDAawB;AACxB,+EAAyE;AACzE,mDAAqD;AAErD,MAAa,IAAI;IAAjB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,oBAAoB,EAAE;YAC5D,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,oEAAoE;YACjF,QAAQ,EAAE;gBACT,IAAI,EAAE,MAAM;aACZ;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,sCAAgB;oBACtB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,eAAe,EAAE;gBAChB,OAAO,EAAE,2BAA2B;gBACpC,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBAClC;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,WAAW;4BACjB,KAAK,EAAE,WAAW;yBAClB;wBACD;4BACC,IAAI,EAAE,YAAY;4BAClB,KAAK,EAAE,YAAY;yBACnB;wBACD;4BACC,IAAI,EAAE,UAAU;4BAChB,KAAK,EAAE,UAAU;yBACjB;wBACD;4BACC,IAAI,EAAE,KAAK;4BACX,KAAK,EAAE,KAAK;yBACZ;wBACD;4BACC,IAAI,EAAE,KAAK;4BACX,KAAK,EAAE,KAAK;yBACZ;wBACD;4BACC,IAAI,EAAE,eAAe;4BACrB,KAAK,EAAE,MAAM;yBACb;qBACD;oBACD,OAAO,EAAE,UAAU;iBACnB;gBACD,GAAG,kCAAmB;gBACtB,GAAG,8BAAe;gBAClB,GAAG,mCAAoB;gBACvB,GAAG,+BAAgB;gBACnB,GAAG,iCAAkB;gBACrB,GAAG,6BAAc;gBACjB,GAAG,4BAAa;gBAChB,GAAG,wBAAS;gBACZ,GAAG,6BAAc;gBACjB,GAAG,yBAAU;gBACb,GAAG,4BAAa;gBAChB,GAAG,wBAAS;aACZ;SACD,CAAC;QAEF,YAAO,GAAG;YACT,WAAW,EAAE;gBAIZ,KAAK,CAAC,YAAY;;oBACjB,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAc,EAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE;wBAC3D,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;qBACrB,CAAC,CAAC;oBAEH,OAAQ,CAAC,MAAA,QAAQ,CAAC,IAAI,mCAAI,EAAE,CAAmB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;wBAClE,IAAI,EAAG,QAAQ,CAAC,IAAe,IAAK,QAAQ,CAAC,MAAiB;wBAC9D,KAAK,EAAE,QAAQ,CAAC,MAAgB;qBAChC,CAAC,CAAC,CAAC;gBACL,CAAC;aACD;SACD,CAAC;IACH,CAAC;CAAA;AA9FD,oBA8FC"}
@@ -0,0 +1,34 @@
1
+ {
2
+ "node": "@apdf/n8n-nodes-apdf.apdf",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": [
6
+ "Marketing",
7
+ "Sales",
8
+ "Analytics"
9
+ ],
10
+ "resources": {
11
+ "credentialDocumentation": [
12
+ {
13
+ "url": "https://github.com/apdf-io/n8n-nodes-apdf?tab=readme-ov-file#credentials"
14
+ }
15
+ ],
16
+ "primaryDocumentation": [
17
+ {
18
+ "url": "https://github.com/apdf-io/n8n-nodes-apdf?tab=readme-ov-file"
19
+ }
20
+ ]
21
+ },
22
+ "alias": [
23
+ "DocSend",
24
+ "tracking",
25
+ "engagement",
26
+ "analytics",
27
+ "document",
28
+ "PDF",
29
+ "OCR",
30
+ "merge",
31
+ "watermark",
32
+ "viewer"
33
+ ]
34
+ }
@@ -0,0 +1,12 @@
1
+ import { type IHookFunctions, type INodeType, type INodeTypeDescription, type IWebhookFunctions, type IWebhookResponseData } from 'n8n-workflow';
2
+ export declare class ApdfTrigger implements INodeType {
3
+ description: INodeTypeDescription;
4
+ webhookMethods: {
5
+ default: {
6
+ checkExists(this: IHookFunctions): Promise<boolean>;
7
+ create(this: IHookFunctions): Promise<boolean>;
8
+ delete(this: IHookFunctions): Promise<boolean>;
9
+ };
10
+ };
11
+ webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
12
+ }