@seedprotocol/feed 0.7.4 → 0.7.5-next.850.g9ab585b
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 +32 -3
- package/package.json +20 -5
package/README.md
CHANGED
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
# @seedprotocol/feed
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@seedprotocol/feed)
|
|
4
|
+
|
|
5
|
+
Generates **RSS 2.0**, **Atom**, and **JSON Feed** from Seed items. Item assembly (Seed → Version → canonical properties, relation expand, Arweave rich-text hydrate) is provided by [`@seedprotocol/query`](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/packages/query/README.md); this package applies feed defaults (`link` / `guid` / `pubDate`) and serializes RSS/Atom/JSON Feed. For EAS-assembled feeds, relation fields are marked with `_feedFieldStorageModels` / `_feedListElementStorageModels` so `pickFeedItemContent` prefers **html** / **file** / **json** storage relations before the legacy `html` / `body` / `content` chain; feed output is **not** sanitized—see [FEED_RICH_FIELDS.md](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/docs/FEED_RICH_FIELDS.md) (including **Publishing feeds** and trust boundaries).
|
|
6
|
+
|
|
7
|
+
Part of [Seed Protocol](https://seedprotocol.io); pairs with [`@seedprotocol/sdk`](https://www.npmjs.com/package/@seedprotocol/sdk).
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @seedprotocol/feed
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Server-side (Node / Bun). Item assembly comes from `@seedprotocol/query`, which is installed as a dependency.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { initializeFeedPlatform, handleFeedRequest } from '@seedprotocol/feed'
|
|
21
|
+
|
|
22
|
+
await initializeFeedPlatform()
|
|
23
|
+
|
|
24
|
+
// GET /:collection/:format (format: rss | atom | json)
|
|
25
|
+
const response: Response = await handleFeedRequest('posts', 'rss', request.headers.get('if-none-match'))
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`handleArchiveFeedRequest(collection, year, month, format)` serves RFC 5005 monthly archives. `createFeed(items, schemaName, format)` serializes items you have already fetched (e.g. via `getFeedItemsBySchemaName`).
|
|
4
29
|
|
|
5
30
|
## P2P distribution
|
|
6
31
|
|
|
7
|
-
HTTP hosting is optional. To publish the same generated feeds onto Hyperdrive / Hyperswarm (and serve them to classic RSS readers over localhost), use **`@seedprotocol/feed-hyper`** and its `seed-feed` CLI. See [packages/feed-hyper/README.md](
|
|
32
|
+
HTTP hosting is optional. To publish the same generated feeds onto Hyperdrive / Hyperswarm (and serve them to classic RSS readers over localhost), use **`@seedprotocol/feed-hyper`** and its `seed-feed` CLI. See [packages/feed-hyper/README.md](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/packages/feed-hyper/README.md) and [docs/FEED_HYPER.md](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/docs/FEED_HYPER.md).
|
|
8
33
|
|
|
9
34
|
Channel self-links use `feedUrl` from site config (`setSiteConfig` / `createFeed` overrides). Home/channel links use `siteUrl`.
|
|
10
35
|
|
|
@@ -16,7 +41,7 @@ Revoked attestations are excluded from feed queries by default. Items that have
|
|
|
16
41
|
|
|
17
42
|
### Caching (dev mode)
|
|
18
43
|
|
|
19
|
-
In development (`NODE_ENV=development`), caching is **disabled by default**. Set `CACHE_ENABLED=true` to enable in dev. Assembled Seed JSON (collection/item) is cached by [`@seedprotocol/query`](
|
|
44
|
+
In development (`NODE_ENV=development`), caching is **disabled by default**. Set `CACHE_ENABLED=true` to enable in dev. Assembled Seed JSON (collection/item) is cached by [`@seedprotocol/query`](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/packages/query/README.md); this package caches serialized feed bodies, HTTP ETags, and image metadata. See [packages/feed/src/cache/README.md](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/packages/feed/src/cache/README.md) and the [query README](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/packages/query/README.md).
|
|
20
45
|
|
|
21
46
|
### Arweave gateway URLs
|
|
22
47
|
|
|
@@ -66,3 +91,7 @@ EAS_CHAIN_ID=8453
|
|
|
66
91
|
# FEED_ITEM_URL_BASE=https://base.easscan.org
|
|
67
92
|
FEED_ITEM_URL_PATH=attestation/view
|
|
68
93
|
```
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seedprotocol/feed",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.7.5-next.850.g9ab585b",
|
|
4
|
+
"description": "RSS 2.0, Atom and JSON Feed generation for Seed Protocol items, with HTTP handlers, ETag caching and RFC 5005 archives",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"seed-protocol",
|
|
7
|
+
"rss",
|
|
8
|
+
"atom",
|
|
9
|
+
"json-feed",
|
|
10
|
+
"feed",
|
|
11
|
+
"syndication",
|
|
12
|
+
"eas",
|
|
13
|
+
"arweave"
|
|
14
|
+
],
|
|
5
15
|
"type": "module",
|
|
6
16
|
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
7
18
|
"exports": {
|
|
8
19
|
".": {
|
|
9
20
|
"import": {
|
|
@@ -25,9 +36,9 @@
|
|
|
25
36
|
"prepublishOnly": "bun run build && node ../../scripts/sync-versions.js"
|
|
26
37
|
},
|
|
27
38
|
"dependencies": {
|
|
28
|
-
"@seedprotocol/arweave": "0.7.
|
|
29
|
-
"@seedprotocol/eas": "0.7.
|
|
30
|
-
"@seedprotocol/query": "0.7.
|
|
39
|
+
"@seedprotocol/arweave": "0.7.5-next.850.g9ab585b",
|
|
40
|
+
"@seedprotocol/eas": "0.7.5-next.850.g9ab585b",
|
|
41
|
+
"@seedprotocol/query": "0.7.5-next.850.g9ab585b",
|
|
31
42
|
"express": "^5.2.1",
|
|
32
43
|
"feedsmith": "^2.9.0",
|
|
33
44
|
"graphql-request": "^7.3.5",
|
|
@@ -48,6 +59,10 @@
|
|
|
48
59
|
"url": "git+https://github.com/JournoLabs/seed-protocol-sdk.git",
|
|
49
60
|
"directory": "packages/feed"
|
|
50
61
|
},
|
|
62
|
+
"homepage": "https://github.com/JournoLabs/seed-protocol-sdk/tree/main/packages/feed#readme",
|
|
63
|
+
"bugs": {
|
|
64
|
+
"url": "https://github.com/JournoLabs/seed-protocol-sdk/issues"
|
|
65
|
+
},
|
|
51
66
|
"publishConfig": {
|
|
52
67
|
"access": "public"
|
|
53
68
|
}
|