n8n-nodes-atproto 0.1.0
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 +93 -0
- package/dist/_chunks/dist.js +6987 -0
- package/dist/_chunks/dist.js.map +1 -0
- package/dist/_chunks/dist2.js +31102 -0
- package/dist/_chunks/dist2.js.map +1 -0
- package/dist/credentials/AtprotoApi.credentials.js +53 -0
- package/dist/credentials/AtprotoApi.credentials.js.map +1 -0
- package/dist/nodes/Atproto/Atproto.node.js +32296 -0
- package/dist/nodes/Atproto/Atproto.node.js.map +1 -0
- package/dist/nodes/Atproto/atproto.svg +7 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Andri Óskarsson
|
|
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
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# n8n-nodes-atproto
|
|
2
|
+
|
|
3
|
+
A generic AT Protocol node for [n8n](https://n8n.io) that works with **any** lexicon — Bluesky, [standard.site](https://standard.site), or any community-defined schema — without hardcoded knowledge of any of them.
|
|
4
|
+
|
|
5
|
+
Instead of building one node per AT Protocol app, this node speaks the protocol itself. Point it at a collection NSID, and it resolves the lexicon schema from the network to present you with the right fields, automatically.
|
|
6
|
+
|
|
7
|
+
## Why This Exists
|
|
8
|
+
|
|
9
|
+
The AT Protocol ecosystem is growing fast. New lexicons are appearing for long-form publishing ([standard.site](https://standard.site)), link aggregation, recipes, events, and more. Each one uses the same underlying record operations — `createRecord`, `putRecord`, `getRecord`, `deleteRecord`, `listRecords` — with different collection names and record shapes.
|
|
10
|
+
|
|
11
|
+
Building a separate n8n node for each lexicon doesn't scale. Building one node that understands the protocol does.
|
|
12
|
+
|
|
13
|
+
## What It Does
|
|
14
|
+
|
|
15
|
+
- **CRUD any AT Protocol record** — create, read, update, delete, and list records in any collection
|
|
16
|
+
- **Dynamic field mapping** — resolves lexicon schemas from the network and presents typed form fields in the n8n editor, so you fill in `title`, `publishedAt`, `tags` rather than crafting raw JSON
|
|
17
|
+
- **Deep schema resolution** — follows `ref` chains, resolves single-ref unions, flattens nested objects, and enforces schema constraints (enums, length limits, required fields)
|
|
18
|
+
- **Smart defaults** — auto-injects `$type` and `createdAt`, auto-resolves literal record keys (e.g. `app.bsky.actor.profile` → `self`), uploads blobs from binary input
|
|
19
|
+
- **Validation before submission** — checks required fields, types, constraints (string length, grapheme count, numeric range, enums), and `$type` discriminators at execution time with clear error messages, before the PDS ever sees the record
|
|
20
|
+
- **Works with any PDS** — Bluesky, self-hosted, Blacksky, or any AT Protocol–compatible server
|
|
21
|
+
|
|
22
|
+
## Use Cases
|
|
23
|
+
|
|
24
|
+
### Publish your blog to the ATmosphere
|
|
25
|
+
|
|
26
|
+
You have an Astro/Hugo/Next.js site with an RSS feed. An n8n workflow picks up new posts, generates summaries, and cross-posts to Bluesky, LinkedIn, and Mastodon. With this node, add standard.site as another lane — publish `site.standard.document` records so your posts appear on [Leaflet](https://leaflet.pub), [Pckt](https://read.pckt.blog), and other federated readers.
|
|
27
|
+
|
|
28
|
+
### Automate Bluesky beyond posting
|
|
29
|
+
|
|
30
|
+
The existing Bluesky n8n node covers social posting well. This node covers the rest — manage lists, labels, or any `app.bsky.*` record type directly, without waiting for someone to add support for each operation.
|
|
31
|
+
|
|
32
|
+
### Build on future lexicons without waiting
|
|
33
|
+
|
|
34
|
+
When a new AT Protocol app launches with its own lexicon, this node works with it on day one. No code changes, no new npm package, no PR to merge. Just type the NSID.
|
|
35
|
+
|
|
36
|
+
### Sync data between AT Protocol services
|
|
37
|
+
|
|
38
|
+
Read records from one collection, transform them, write to another. Mirror content, aggregate feeds, or build bridges between ATProto apps using n8n's visual workflow builder.
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# In your n8n instance
|
|
44
|
+
pnpm add n8n-nodes-atproto
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Or install from the Community Nodes panel in n8n settings.
|
|
48
|
+
|
|
49
|
+
## Quick Start
|
|
50
|
+
|
|
51
|
+
1. **Create credentials** — add your AT Protocol handle and an [app password](https://bsky.app/settings/app-passwords)
|
|
52
|
+
2. **Add the node** to a workflow
|
|
53
|
+
3. **Choose an operation** — Create Record, Get Record, etc.
|
|
54
|
+
4. **Pick a collection** — select from the searchable dropdown (lists your repo's collections) or type any NSID manually
|
|
55
|
+
5. **Map your fields** — the node resolves the lexicon and shows you typed form fields with constraints, enums as dropdowns, and blob fields that explain what to attach
|
|
56
|
+
6. **Run it** — the node validates your data, injects `$type`/`createdAt`, uploads blobs, and sends the record
|
|
57
|
+
|
|
58
|
+
### Tips
|
|
59
|
+
|
|
60
|
+
- **Profiles and other singleton records** — leave the Record Key empty. The node auto-resolves literal keys (e.g. `app.bsky.actor.profile` uses `self`)
|
|
61
|
+
- **Blob fields** — the field label tells you to provide a binary property name. Use an HTTP Request or Read Binary File node upstream to attach the file
|
|
62
|
+
- **Nested objects** — sub-refs beyond the first level show as JSON fields with a template of the expected structure
|
|
63
|
+
|
|
64
|
+
## Credentials
|
|
65
|
+
|
|
66
|
+
| Field | Description |
|
|
67
|
+
|-------|-------------|
|
|
68
|
+
| Identifier | Your handle (e.g. `you.bsky.social`) or DID |
|
|
69
|
+
| App Password | Generated at [bsky.app/settings/app-passwords](https://bsky.app/settings/app-passwords) |
|
|
70
|
+
| Service URL | PDS endpoint (default: `https://bsky.social`) |
|
|
71
|
+
|
|
72
|
+
## Architecture
|
|
73
|
+
|
|
74
|
+
The node is deliberately thin — it speaks the AT Protocol and defers everything else to lexicon schemas.
|
|
75
|
+
|
|
76
|
+
| File | Purpose |
|
|
77
|
+
|------|---------|
|
|
78
|
+
| `Atproto.node.ts` | Node description, collection picker, execute flow |
|
|
79
|
+
| `lexicon.ts` | Schema resolution (PDS endpoint → DNS fallback → null) |
|
|
80
|
+
| `fieldMapping.ts` | Lexicon → n8n ResourceMapperFields (ref flattening, enums, constraints) |
|
|
81
|
+
| `typeInjection.ts` | Nested `$type` injection at execution time |
|
|
82
|
+
| `validation.ts` | Pre-submission schema validation with friendly errors |
|
|
83
|
+
| `blob.ts` | Binary upload via `com.atproto.repo.uploadBlob` |
|
|
84
|
+
| `operations.ts` | CRUD wrappers with `$type`/`createdAt` auto-injection |
|
|
85
|
+
| `tid.ts` | Timestamp ID generation |
|
|
86
|
+
|
|
87
|
+
## Contributing
|
|
88
|
+
|
|
89
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, testing, and architecture overview.
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|