@apdf/n8n-nodes-apdf 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +279 -2
- package/dist/credentials/ApdfApi.credentials.d.ts +11 -0
- package/dist/credentials/ApdfApi.credentials.js +53 -0
- package/dist/credentials/ApdfApi.credentials.js.map +1 -0
- package/dist/credentials/apdf.dark.svg +7 -0
- package/dist/credentials/apdf.svg +8 -0
- package/dist/nodes/Apdf/Apdf.node.d.ts +9 -0
- package/dist/nodes/Apdf/Apdf.node.js +102 -0
- package/dist/nodes/Apdf/Apdf.node.js.map +1 -0
- package/dist/nodes/Apdf/Apdf.node.json +34 -0
- package/dist/nodes/Apdf/ApdfTrigger.node.d.ts +12 -0
- package/dist/nodes/Apdf/ApdfTrigger.node.js +194 -0
- package/dist/nodes/Apdf/ApdfTrigger.node.js.map +1 -0
- package/dist/nodes/Apdf/ApdfTrigger.node.json +34 -0
- package/dist/nodes/Apdf/apdf.dark.svg +7 -0
- package/dist/nodes/Apdf/apdf.svg +8 -0
- package/dist/nodes/Apdf/descriptions/AnalyticsDescription.d.ts +3 -0
- package/dist/nodes/Apdf/descriptions/AnalyticsDescription.js +87 -0
- package/dist/nodes/Apdf/descriptions/AnalyticsDescription.js.map +1 -0
- package/dist/nodes/Apdf/descriptions/AutomationDescription.d.ts +3 -0
- package/dist/nodes/Apdf/descriptions/AutomationDescription.js +234 -0
- package/dist/nodes/Apdf/descriptions/AutomationDescription.js.map +1 -0
- package/dist/nodes/Apdf/descriptions/DocumentDescription.d.ts +3 -0
- package/dist/nodes/Apdf/descriptions/DocumentDescription.js +145 -0
- package/dist/nodes/Apdf/descriptions/DocumentDescription.js.map +1 -0
- package/dist/nodes/Apdf/descriptions/JobDescription.d.ts +3 -0
- package/dist/nodes/Apdf/descriptions/JobDescription.js +40 -0
- package/dist/nodes/Apdf/descriptions/JobDescription.js.map +1 -0
- package/dist/nodes/Apdf/descriptions/LinkDescription.d.ts +3 -0
- package/dist/nodes/Apdf/descriptions/LinkDescription.js +114 -0
- package/dist/nodes/Apdf/descriptions/LinkDescription.js.map +1 -0
- package/dist/nodes/Apdf/descriptions/PdfDescription.d.ts +3 -0
- package/dist/nodes/Apdf/descriptions/PdfDescription.js +722 -0
- package/dist/nodes/Apdf/descriptions/PdfDescription.js.map +1 -0
- package/dist/nodes/Apdf/descriptions/index.d.ts +6 -0
- package/dist/nodes/Apdf/descriptions/index.js +23 -0
- package/dist/nodes/Apdf/descriptions/index.js.map +1 -0
- package/dist/nodes/shared/display.d.ts +2 -0
- package/dist/nodes/shared/display.js +13 -0
- package/dist/nodes/shared/display.js.map +1 -0
- package/dist/nodes/shared/events.d.ts +3 -0
- package/dist/nodes/shared/events.js +57 -0
- package/dist/nodes/shared/events.js.map +1 -0
- package/dist/nodes/shared/fields.d.ts +4 -0
- package/dist/nodes/shared/fields.js +66 -0
- package/dist/nodes/shared/fields.js.map +1 -0
- package/dist/nodes/shared/output.d.ts +9 -0
- package/dist/nodes/shared/output.js +72 -0
- package/dist/nodes/shared/output.js.map +1 -0
- package/dist/nodes/shared/pagination.d.ts +2 -0
- package/dist/nodes/shared/pagination.js +60 -0
- package/dist/nodes/shared/pagination.js.map +1 -0
- package/dist/nodes/shared/transport.d.ts +9 -0
- package/dist/nodes/shared/transport.js +39 -0
- package/dist/nodes/shared/transport.js.map +1 -0
- package/dist/package.json +66 -0
- 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,280 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @apdf/n8n-nodes-apdf
|
|
2
2
|
|
|
3
|
-
|
|
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
|
+
Automations, and so this trigger, need a **Pro** or **Business** plan. On the free Hobby plan
|
|
57
|
+
the trigger never fires. See [pricing](https://apdf.io/pricing) for the limits of each plan.
|
|
58
|
+
|
|
59
|
+
### Setup
|
|
60
|
+
|
|
61
|
+
The trigger registers itself. Pick the events you care about and activate the workflow — the
|
|
62
|
+
node creates the matching automation in Apdf, and deletes it again when you deactivate.
|
|
63
|
+
|
|
64
|
+
1. Add the **Apdf Trigger** node and select your **Apdf API** credentials.
|
|
65
|
+
2. Choose one or more **Events**.
|
|
66
|
+
3. Optionally restrict it to certain **Documents** by ID, and add **Conditions** such as
|
|
67
|
+
*page number equals 7*.
|
|
68
|
+
4. Activate the workflow. The automation appears under **Documents → Automations** in Apdf,
|
|
69
|
+
named after your workflow.
|
|
70
|
+
|
|
71
|
+
Nothing needs creating by hand. If you delete the automation in Apdf, deactivating and
|
|
72
|
+
reactivating the workflow recreates it.
|
|
73
|
+
|
|
74
|
+
Under **Options** you can set an **Auth Header Value**. The node sends it to Apdf as a
|
|
75
|
+
webhook header and rejects any incoming request that does not carry it — worth setting, since
|
|
76
|
+
the webhook URL is otherwise the only thing protecting the endpoint. **Auth Header Name**
|
|
77
|
+
changes which header carries it, and **Automation Name** overrides the name the automation
|
|
78
|
+
gets in Apdf.
|
|
79
|
+
|
|
80
|
+
### Events
|
|
81
|
+
|
|
82
|
+
Choose at least one event. Apdf filters on its side, so the workflow only runs for what you
|
|
83
|
+
selected.
|
|
84
|
+
|
|
85
|
+
| Event | Fires when |
|
|
86
|
+
| -------------------- | --------------------------------------------------- |
|
|
87
|
+
| Document Opened | A viewer opens the PDF |
|
|
88
|
+
| Document Downloaded | A viewer downloads the PDF |
|
|
89
|
+
| Document Printed | A viewer prints the PDF |
|
|
90
|
+
| Page Viewed | A viewer navigates to a page |
|
|
91
|
+
| Page Read | A viewer stays on a page, measured every 15 seconds |
|
|
92
|
+
| Page Left | A viewer navigates away from a page |
|
|
93
|
+
| Text Copied | A viewer copies text from the PDF |
|
|
94
|
+
| Link Clicked | A viewer clicks a link in the PDF |
|
|
95
|
+
| Form Submitted | A viewer submits a form in the PDF |
|
|
96
|
+
| Annotation Created | A viewer creates an annotation |
|
|
97
|
+
| Annotation Updated | A viewer modifies an annotation |
|
|
98
|
+
| Annotation Deleted | A viewer removes an annotation |
|
|
99
|
+
|
|
100
|
+
Document and page events — opened, downloaded, printed, viewed, read and left — trigger an
|
|
101
|
+
automation **once per reading session**, even where the underlying measurement repeats. Page
|
|
102
|
+
Read is measured every 15 seconds, but your workflow runs once for that session. Text Copied,
|
|
103
|
+
Link Clicked, Form Submitted and the annotation events fire every time they happen.
|
|
104
|
+
|
|
105
|
+
### Output
|
|
106
|
+
|
|
107
|
+
The trigger emits the automation payload unchanged:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"automation": { "id": "…", "name": "Notify on read" },
|
|
112
|
+
"document": {
|
|
113
|
+
"doc_id": "…",
|
|
114
|
+
"name": "Proposal.pdf",
|
|
115
|
+
"viewer_url": "https://…",
|
|
116
|
+
"file_pages": 12
|
|
117
|
+
},
|
|
118
|
+
"trigger": { "matched_event": "page:read", "conditions_evaluated": true },
|
|
119
|
+
"event": {
|
|
120
|
+
"session_id": "…",
|
|
121
|
+
"viewer_id": "…",
|
|
122
|
+
"recipient": { "name": "Jane Doe", "email": "jane@example.com" },
|
|
123
|
+
"data": { "page": 5, "duration_ms": 45000 }
|
|
124
|
+
},
|
|
125
|
+
"session": { "total_duration_ms": 182000, "pages_viewed": 8, "completion_rate": 66.7 },
|
|
126
|
+
"timestamp": "2026-07-28T12:00:00+00:00"
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`session.completion_rate` is a percentage of the document's pages. `event.recipient` is
|
|
131
|
+
`null` when Apdf cannot tie the reader to a tracking link.
|
|
132
|
+
|
|
133
|
+
`event.data` varies by event:
|
|
134
|
+
|
|
135
|
+
| Event | `event.data` |
|
|
136
|
+
| -------------------------------------- | ------------------------------------------------------------------- |
|
|
137
|
+
| Page Viewed | `page` |
|
|
138
|
+
| Page Read, Page Left | `page`, `duration_ms` |
|
|
139
|
+
| Text Copied | `page`, `text` |
|
|
140
|
+
| Link Clicked | `page`, `url`, `text`, `is_internal` |
|
|
141
|
+
| Form Submitted | `fields` |
|
|
142
|
+
| Annotation Created, Annotation Updated | `page`, `type`, `comment_text`, `comment_author`, `annotated_text` |
|
|
143
|
+
| Annotation Deleted | `page` |
|
|
144
|
+
| Document Opened, Downloaded, Printed | `null` |
|
|
145
|
+
|
|
146
|
+
### Example
|
|
147
|
+
|
|
148
|
+
Alert your team the moment a prospect reads your pricing page:
|
|
149
|
+
|
|
150
|
+
1. **Apdf Trigger** — event **Page Read**, **Documents** set to the proposal's ID, and a
|
|
151
|
+
**Condition** of *page number equals* `5`.
|
|
152
|
+
|
|
153
|
+
Use a condition rather than an IF node downstream. The automation fires once per reading
|
|
154
|
+
session, on the first Page Read that satisfies its conditions, so filtering afterwards in
|
|
155
|
+
n8n would usually see a different page and never match.
|
|
156
|
+
2. **Slack** — post `{{ $json.event.recipient.name }} just read page
|
|
157
|
+
{{ $json.event.data.page }} — {{ $json.session.pages_viewed }} pages in
|
|
158
|
+
{{ $json.session.total_duration_ms / 1000 }}s`.
|
|
159
|
+
|
|
160
|
+
### Conditions
|
|
161
|
+
|
|
162
|
+
| Condition | Tests |
|
|
163
|
+
| ----------------------------- | ---------------------------------------------- |
|
|
164
|
+
| Page Number Equals | The page the event happened on |
|
|
165
|
+
| Time on Page At Least | Seconds spent on that page |
|
|
166
|
+
| Total Reading Time At Least | Seconds spent in the whole session |
|
|
167
|
+
| Pages Viewed At Least | How many distinct pages were seen |
|
|
168
|
+
| Completion Rate At Least | Percentage of the document read |
|
|
169
|
+
|
|
170
|
+
Not every condition works with every event — a page condition needs a page event, for
|
|
171
|
+
instance. Apdf validates the combination when the workflow is activated and returns a clear
|
|
172
|
+
error if it cannot work.
|
|
173
|
+
|
|
174
|
+
## Apdf
|
|
175
|
+
|
|
176
|
+
Wherever an operation needs a document, the node offers a **Document Name or ID** dropdown
|
|
177
|
+
populated from your workspace — pick one, or supply an ID with an expression when it comes
|
|
178
|
+
from an earlier node.
|
|
179
|
+
|
|
180
|
+
List operations follow the n8n convention: **Return All** fetches every page, or leave it off
|
|
181
|
+
and set a **Limit**. Responses are unwrapped, so each record arrives as its own item rather
|
|
182
|
+
than as one item holding the whole response.
|
|
183
|
+
|
|
184
|
+
### Document
|
|
185
|
+
|
|
186
|
+
Create, list, get and delete tracked documents, archive and unarchive them, and switch a
|
|
187
|
+
document between public and link-only access.
|
|
188
|
+
|
|
189
|
+
Creating a document takes a publicly reachable **File URL** and a **Name**.
|
|
190
|
+
|
|
191
|
+
### Tracking Link
|
|
192
|
+
|
|
193
|
+
Mint one link per recipient so that reading activity is attributed to a person rather than an
|
|
194
|
+
anonymous viewer. Create, list, delete, activate and deactivate links.
|
|
195
|
+
|
|
196
|
+
A **Recipient Name** is required; **Recipient Email** is optional.
|
|
197
|
+
|
|
198
|
+
### Analytics
|
|
199
|
+
|
|
200
|
+
| Operation | Returns |
|
|
201
|
+
| --------------------- | ------------------------------------------------------------------- |
|
|
202
|
+
| Get KPIs | Sessions, viewers, completion rate and downloads for a document |
|
|
203
|
+
| Get Sessions | The reading sessions recorded for a document |
|
|
204
|
+
| Get Session | One session, including its per-page detail |
|
|
205
|
+
| Get Annotations | Highlights and comments readers left |
|
|
206
|
+
| Get Form Submissions | What readers typed into the document's forms |
|
|
207
|
+
|
|
208
|
+
### PDF
|
|
209
|
+
|
|
210
|
+
Nineteen operations over the Apdf PDF API: **Create From HTML**, **Convert From Office**,
|
|
211
|
+
**Merge**, **Split**, **Compress**, **Convert to Image**, **Extract Pages**, **Delete
|
|
212
|
+
Pages**, **Rotate Pages**, **Overlay Pages**, **Underlay Pages**, **Search Content**,
|
|
213
|
+
**Read Content**, **OCR Convert**, **OCR Search Content**, **OCR Read Content**, **Add
|
|
214
|
+
Security**, **Remove Security** and **Read Metadata**.
|
|
215
|
+
|
|
216
|
+
Every operation takes its source as a publicly reachable URL and returns a new file. None of
|
|
217
|
+
them modify the source, including **Delete Pages**.
|
|
218
|
+
|
|
219
|
+
**Convert From Office** takes a Word, Excel, PowerPoint, OpenDocument or RTF file (docx, doc,
|
|
220
|
+
xlsx, xls, pptx, ppt, odt, ods, odp, rtf) instead of a PDF.
|
|
221
|
+
|
|
222
|
+
### Automation
|
|
223
|
+
|
|
224
|
+
Full control over the rules that turn reader activity into webhook calls: **Create**, **Get**,
|
|
225
|
+
**Get Many**, **Delete**, **Activate**, **Deactivate**, **Duplicate**, and **Get Executions**
|
|
226
|
+
for the delivery history.
|
|
227
|
+
|
|
228
|
+
Creating one takes a **Name**, one or more **Events** and a **Webhook URL**. Set **Scope** to
|
|
229
|
+
*Specific Documents* to narrow it to given IDs, add **Conditions** to fire only past a
|
|
230
|
+
threshold, and add **Webhook Headers** so your endpoint can authenticate the call.
|
|
231
|
+
|
|
232
|
+
Like the trigger, automations only fire on a Pro or Business plan.
|
|
233
|
+
|
|
234
|
+
If you only want a workflow to react to readers, use the **Apdf Trigger** instead — it creates
|
|
235
|
+
and removes its own automation. Use this resource when you are managing automations
|
|
236
|
+
programmatically, for instance pointing them at systems outside n8n.
|
|
237
|
+
|
|
238
|
+
### Job
|
|
239
|
+
|
|
240
|
+
**Check Status** polls an asynchronous operation for its result.
|
|
241
|
+
|
|
242
|
+
## Asynchronous operations
|
|
243
|
+
|
|
244
|
+
Apdf runs heavy work on a queue. Seven operations always return a job ID instead of a result:
|
|
245
|
+
|
|
246
|
+
- Create From HTML
|
|
247
|
+
- Convert From Office
|
|
248
|
+
- Compress
|
|
249
|
+
- Convert to Image
|
|
250
|
+
- OCR Convert
|
|
251
|
+
- OCR Read Content
|
|
252
|
+
- OCR Search Content
|
|
253
|
+
|
|
254
|
+
The remaining PDF operations run inline by default, and return a job ID only when you enable
|
|
255
|
+
**Run Asynchronously** under **Options**.
|
|
256
|
+
|
|
257
|
+
To get the result of a job, either poll it with the **Job → Check Status** operation, or set
|
|
258
|
+
a **Webhook URL** so Apdf calls you when the job finishes.
|
|
259
|
+
|
|
260
|
+
## Page ranges
|
|
261
|
+
|
|
262
|
+
Operations that take a **Pages** value accept page numbers and ranges, for example `1,3-5`.
|
|
263
|
+
Two shortcuts are available:
|
|
264
|
+
|
|
265
|
+
- `z` — the last page
|
|
266
|
+
- `rN` — the Nth page from the end, so `r2` is the second-to-last page
|
|
267
|
+
|
|
268
|
+
**Split** additionally accepts `nN`, which splits into files of N pages each. `n2` yields
|
|
269
|
+
files of two pages.
|
|
270
|
+
|
|
271
|
+
## Resources
|
|
272
|
+
|
|
273
|
+
- [Apdf documentation](https://apdf.io/docs)
|
|
274
|
+
- [Apdf MCP server](https://apdf.io/product/pdf-mcp-server) — for agent access rather than
|
|
275
|
+
workflow steps
|
|
276
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
277
|
+
|
|
278
|
+
## License
|
|
279
|
+
|
|
280
|
+
[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 & Content",
|
|
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
|
+
}
|