n8n-nodes-atproto 0.1.2 → 0.2.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/README.md +77 -0
- package/dist/_chunks/shared.js +1 -1
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/credentials/AtprotoApi.credentials.js +1 -1
- package/dist/credentials/AtprotoApi.credentials.js.map +1 -1
- package/dist/nodes/Atproto/Atproto.node.js +432 -37
- package/dist/nodes/Atproto/Atproto.node.js.map +1 -1
- package/dist/nodes/Atproto/{AtprotoJetstreamTrigger.node.js → AtprotoTrigger.node.js} +36 -39
- package/dist/nodes/Atproto/AtprotoTrigger.node.js.map +1 -0
- package/dist/nodes/Atproto/atproto.svg +6 -7
- package/dist/nodes/Bluesky/{Bluesky.node.js → AtprotoBluesky.node.js} +7 -7
- package/dist/nodes/Bluesky/AtprotoBluesky.node.js.map +1 -0
- package/dist/nodes/Bluesky/bluesky.svg +5 -6
- package/package.json +3 -3
- package/dist/nodes/Atproto/AtprotoJetstreamTrigger.node.js.map +0 -1
- package/dist/nodes/Bluesky/Bluesky.node.js.map +0 -1
package/README.md
CHANGED
|
@@ -61,6 +61,83 @@ Or install from the Community Nodes panel in n8n settings.
|
|
|
61
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
62
|
- **Nested objects** — sub-refs beyond the first level show as JSON fields with a template of the expected structure
|
|
63
63
|
|
|
64
|
+
## Recipes
|
|
65
|
+
|
|
66
|
+
Worked examples of common workflows. Each one is a chain of nodes — names in **bold**, key parameters inline.
|
|
67
|
+
|
|
68
|
+
### Compose a multi-image Bluesky post
|
|
69
|
+
|
|
70
|
+
`app.bsky.feed.post` supports up to 4 images, but the blobs live nested inside `embed.images[].image`, so the record's own lexicon doesn't know they're blobs. Use the standalone **Upload Blob** op to upload each image, then compose the embed by hand.
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
[HTTP Request: image 1]─┐
|
|
74
|
+
[HTTP Request: image 2]─┼─▶[AT Protocol: Blob → Upload] (run once per image, via Loop or three parallel branches)
|
|
75
|
+
[HTTP Request: image 3]─┘
|
|
76
|
+
│
|
|
77
|
+
▼
|
|
78
|
+
[Aggregate / Set: collect blob refs into `images` array]
|
|
79
|
+
│
|
|
80
|
+
▼
|
|
81
|
+
[AT Protocol: Record → Create]
|
|
82
|
+
Collection: app.bsky.feed.post
|
|
83
|
+
recordData: {
|
|
84
|
+
"text": "three pictures",
|
|
85
|
+
"embed": {
|
|
86
|
+
"$type": "app.bsky.embed.images",
|
|
87
|
+
"images": [
|
|
88
|
+
{ "alt": "...", "image": {{ $node["Upload 1"].json.blob }} },
|
|
89
|
+
{ "alt": "...", "image": {{ $node["Upload 2"].json.blob }} },
|
|
90
|
+
{ "alt": "...", "image": {{ $node["Upload 3"].json.blob }} }
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Why this works:** `Upload Blob` outputs the canonical BlobRef shape (`{ $type, ref, mimeType, size }`) under `blob`, which is exactly what `embed.images[].image` expects. n8n's expression engine drops the object straight in.
|
|
97
|
+
|
|
98
|
+
**Convenience fields:** the upload also exposes `cid` / `mimeType` / `size` at the top level, so `{{ $json.cid }}` works without drilling into `blob.ref.$link`.
|
|
99
|
+
|
|
100
|
+
### Round-trip a blob (download, transform, re-upload)
|
|
101
|
+
|
|
102
|
+
Mirror a blob from another user's repo into your own. Useful for archival, format conversion, or re-hosting.
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
[AT Protocol: Record → Get] ← fetch a post that contains an image
|
|
106
|
+
Collection: app.bsky.feed.post
|
|
107
|
+
Repo: alice.bsky.social
|
|
108
|
+
rkey: 3jzfc...
|
|
109
|
+
│
|
|
110
|
+
▼
|
|
111
|
+
[Set: extract blob ref] ← {{ $json.value.embed.images[0].image }}
|
|
112
|
+
│
|
|
113
|
+
▼
|
|
114
|
+
[AT Protocol: Blob → Download] ← paste the BlobRef into Blob Reference;
|
|
115
|
+
(no Repo needed if pasting a CDN URL, Repo = alice.bsky.social for at:// refs
|
|
116
|
+
otherwise paste the source handle)
|
|
117
|
+
│
|
|
118
|
+
▼
|
|
119
|
+
[Edit Image / Sharp / Compress] ← optional: re-encode, resize, watermark
|
|
120
|
+
│
|
|
121
|
+
▼
|
|
122
|
+
[AT Protocol: Blob → Upload] ← now lives in YOUR repo as a fresh blob
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Tip:** `Download Blob` accepts whichever input is most convenient — a bare CID, the BlobRef JSON pasted from a previous op, or a `https://cdn.bsky.app/img/.../<did>/<cid>@jpeg` URL. CDN URLs also fill in the Repo automatically.
|
|
126
|
+
|
|
127
|
+
### List every blob in your repo
|
|
128
|
+
|
|
129
|
+
For audits, migrations, or finding orphaned blobs not referenced by any record.
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
[AT Protocol: Blob → List]
|
|
133
|
+
Return All: ✅ ← paginates internally; emits one item per CID
|
|
134
|
+
│
|
|
135
|
+
▼
|
|
136
|
+
[Filter / Set / Aggregate to taste]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Without `Return All`, the node emits one item per CID for the current page and attaches the next-page `cursor` to each item, so manual pagination is also possible.
|
|
140
|
+
|
|
64
141
|
## Credentials
|
|
65
142
|
|
|
66
143
|
| Field | Description |
|
package/dist/_chunks/shared.js
CHANGED
|
@@ -37817,7 +37817,7 @@ function extractType({ headers }) {
|
|
|
37817
37817
|
}
|
|
37818
37818
|
new Lexicons(lexicons$1);
|
|
37819
37819
|
//#endregion
|
|
37820
|
-
//#region
|
|
37820
|
+
//#region nodes/Atproto/shared.ts
|
|
37821
37821
|
async function createAgent(credentials) {
|
|
37822
37822
|
const identifier = credentials.identifier;
|
|
37823
37823
|
const appPassword = credentials.appPassword;
|