@seedprotocol/feed 0.4.32 → 0.5.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/README.md +38 -2
- package/dist/bootstrap.d.ts +13 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/cache/CacheManager.d.ts +5 -59
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/FileCache.d.ts +2 -54
- package/dist/cache/FileCache.d.ts.map +1 -1
- package/dist/cache/MemoryCache.d.ts +4 -48
- package/dist/cache/MemoryCache.d.ts.map +1 -1
- package/dist/cache/config.d.ts.map +1 -1
- package/dist/cache/types.d.ts +3 -11
- package/dist/cache/types.d.ts.map +1 -1
- package/dist/config.d.ts +23 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/feedFieldStorageModel.d.ts +2 -11
- package/dist/feedFieldStorageModel.d.ts.map +1 -1
- package/dist/getFeedItems.d.ts +10 -0
- package/dist/getFeedItems.d.ts.map +1 -1
- package/dist/hydrateArweaveRichText.d.ts +1 -10
- package/dist/hydrateArweaveRichText.d.ts.map +1 -1
- package/dist/imageRelationEnrichment.d.ts +1 -5
- package/dist/imageRelationEnrichment.d.ts.map +1 -1
- package/dist/index.d.ts +9 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +456 -931
- package/dist/index.js.map +1 -1
- package/dist/listRelationKey.d.ts +1 -12
- package/dist/listRelationKey.d.ts.map +1 -1
- package/dist/parseEasPropertyMetadataForFeed.d.ts +2 -24
- package/dist/parseEasPropertyMetadataForFeed.d.ts.map +1 -1
- package/dist/services/arweaveImageService.d.ts.map +1 -1
- package/dist/utils/arweaveUrl.d.ts +1 -6
- package/dist/utils/arweaveUrl.d.ts.map +1 -1
- package/dist/utils/etag.d.ts +0 -4
- package/dist/utils/etag.d.ts.map +1 -1
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# @seedprotocol/feed
|
|
2
2
|
|
|
3
|
-
Generates **RSS 2.0**, **Atom**, and **JSON Feed** from Seed items. For EAS-assembled feeds,
|
|
3
|
+
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`](../query); 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](../../docs/FEED_RICH_FIELDS.md) (including **Publishing feeds** and trust boundaries).
|
|
4
|
+
|
|
5
|
+
## P2P distribution
|
|
6
|
+
|
|
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 the `seed feed` CLI. See [packages/feed-hyper/README.md](../feed-hyper/README.md) and [docs/FEED_HYPER.md](../../docs/FEED_HYPER.md).
|
|
8
|
+
|
|
9
|
+
Channel self-links use `feedUrl` from site config (`setSiteConfig` / `createFeed` overrides). Home/channel links use `siteUrl`.
|
|
4
10
|
|
|
5
11
|
## Configuration
|
|
6
12
|
|
|
@@ -10,7 +16,34 @@ Revoked attestations are excluded from feed queries by default. Items that have
|
|
|
10
16
|
|
|
11
17
|
### Caching (dev mode)
|
|
12
18
|
|
|
13
|
-
In development (`NODE_ENV=development`),
|
|
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`](../query); this package caches serialized feed bodies, HTTP ETags, and image metadata. See `packages/feed/src/cache/README.md` and the query README.
|
|
20
|
+
|
|
21
|
+
### Arweave gateway URLs
|
|
22
|
+
|
|
23
|
+
Feed generation resolves Arweave transaction IDs to gateway URLs (RSS enclosures, image relations, rich-text hydration). Configure the primary gateway with any of these (first match wins):
|
|
24
|
+
|
|
25
|
+
- `ARWEAVE_HOST` — server-side (Node, Bun, etc.)
|
|
26
|
+
- `NEXT_PUBLIC_ARWEAVE_HOST` — Next.js / universal apps
|
|
27
|
+
- `VITE_ARWEAVE_HOST` — Vite apps (also set this for Bun if you use a `VITE_`-prefixed `.env`)
|
|
28
|
+
|
|
29
|
+
Or pass an explicit domain at init time (takes precedence over env):
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { initializeFeedPlatform } from '@seedprotocol/feed'
|
|
33
|
+
|
|
34
|
+
await initializeFeedPlatform({ arweaveDomain: 'arweave.net' })
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
When unset, the default primary gateway is `ar.seedprotocol.io`.
|
|
38
|
+
|
|
39
|
+
**Read fallbacks** (image metadata probing, gateway health checks) use additional public gateways. To override the fallback list:
|
|
40
|
+
|
|
41
|
+
- `ARWEAVE_READ_GATEWAYS` or `NEXT_PUBLIC_ARWEAVE_READ_GATEWAYS` — comma-separated hostnames
|
|
42
|
+
- `IMAGE_METADATA_GATEWAYS` — comma-separated hostnames for RSS image dimension detection
|
|
43
|
+
|
|
44
|
+
When a custom primary gateway is configured, `ar.seedprotocol.io` is omitted from automatic fallbacks (unless you include it explicitly in one of the env lists above).
|
|
45
|
+
|
|
46
|
+
**Note:** Items already stored with full `https://ar.seedprotocol.io/...` URLs are passed through unchanged. Only newly resolved transaction IDs use the configured gateway.
|
|
14
47
|
|
|
15
48
|
### Feed Item URLs (EASScan attestation links)
|
|
16
49
|
|
|
@@ -25,6 +58,9 @@ Item links in the feed can point to EASScan attestation pages. Set these environ
|
|
|
25
58
|
### Example .env
|
|
26
59
|
|
|
27
60
|
```bash
|
|
61
|
+
# Arweave gateway for feed media / relation URLs
|
|
62
|
+
ARWEAVE_HOST=arweave.net
|
|
63
|
+
|
|
28
64
|
# Default: item links use https://easscan.org/attestation/view/{uid}
|
|
29
65
|
# Override for testnet:
|
|
30
66
|
FEED_ITEM_URL_BASE=https://optimism-sepolia.easscan.org
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type InitializeFeedPlatformOptions = {
|
|
2
|
+
arweaveDomain?: string;
|
|
3
|
+
};
|
|
4
|
+
/** Register Node EAS + Arweave clients for feed generation (no full SDK client). */
|
|
5
|
+
export declare function initializeFeedPlatform(options?: InitializeFeedPlatformOptions): Promise<void>;
|
|
6
|
+
/** @deprecated Use initializeFeedPlatform */
|
|
7
|
+
export declare const initializeSeedClient: typeof initializeFeedPlatform;
|
|
8
|
+
export declare function getClient(): Promise<{
|
|
9
|
+
isInitialized: () => boolean;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function teardownSeedClient(): Promise<void>;
|
|
12
|
+
export { DEFAULT_ARWEAVE_HOST } from '@seedprotocol/arweave';
|
|
13
|
+
//# sourceMappingURL=bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAMD,oFAAoF;AACpF,wBAAsB,sBAAsB,CAC1C,OAAO,CAAC,EAAE,6BAA6B,GACtC,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,6CAA6C;AAC7C,eAAO,MAAM,oBAAoB,+BAAyB,CAAA;AAE1D,wBAAsB,SAAS,IAAI,OAAO,CAAC;IAAE,aAAa,EAAE,MAAM,OAAO,CAAA;CAAE,CAAC,CAG3E;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAExD;AAED,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { MemoryCache } from './MemoryCache';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { CachedFeedContent, CacheConfig, CacheContentKeyOptions, CacheStats } from './types';
|
|
3
|
+
import type { ImageMetadata } from '../types';
|
|
4
4
|
import type { FeedFormat } from '../types';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Feed cache manager: serialized content + image metadata only.
|
|
7
|
+
* Collection/item caching is owned by @seedprotocol/query.
|
|
7
8
|
*/
|
|
8
9
|
export declare class CacheManager {
|
|
9
10
|
private memoryCache;
|
|
@@ -11,71 +12,16 @@ export declare class CacheManager {
|
|
|
11
12
|
private config;
|
|
12
13
|
private stats;
|
|
13
14
|
constructor(config: CacheConfig);
|
|
14
|
-
/**
|
|
15
|
-
* Get cached feed data for a schema
|
|
16
|
-
* Checks memory cache first, then file cache
|
|
17
|
-
*/
|
|
18
|
-
getFeedData(schemaName: string): Promise<CachedFeedData | null>;
|
|
19
|
-
/**
|
|
20
|
-
* Set cached feed data for a schema
|
|
21
|
-
* Updates both memory and file cache
|
|
22
|
-
*/
|
|
23
|
-
setFeedData(schemaName: string, items: GraphQLItem[]): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Get cached feed content for a schema and format
|
|
26
|
-
* Checks memory cache first, then file cache
|
|
27
|
-
*/
|
|
28
15
|
getFeedContent(schemaName: string, format: FeedFormat, contentKeyOptions?: CacheContentKeyOptions): Promise<CachedFeedContent | null>;
|
|
29
|
-
/**
|
|
30
|
-
* Set cached feed content for a schema and format
|
|
31
|
-
* Updates both memory and file cache
|
|
32
|
-
*/
|
|
33
16
|
setFeedContent(schemaName: string, format: FeedFormat, content: string, contentType: string, contentKeyOptions?: CacheContentKeyOptions): Promise<void>;
|
|
34
|
-
|
|
35
|
-
* Clear feed data cache for a schema
|
|
36
|
-
*/
|
|
37
|
-
clearFeedData(schemaName: string): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Clear all caches
|
|
40
|
-
*/
|
|
17
|
+
clearContent(schemaName: string): Promise<void>;
|
|
41
18
|
clearAll(): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* Get or create a refresh lock for a schema
|
|
44
|
-
* Prevents concurrent fetches for the same schema
|
|
45
|
-
*/
|
|
46
|
-
withRefreshLock<T>(schemaName: string, fn: () => Promise<T>): Promise<T>;
|
|
47
|
-
/**
|
|
48
|
-
* Merge new items with cached items
|
|
49
|
-
* Deduplicates by item ID and sorts by timeCreated (descending)
|
|
50
|
-
*/
|
|
51
|
-
mergeItems(cachedItems: GraphQLItem[], newItems: GraphQLItem[]): GraphQLItem[];
|
|
52
|
-
/**
|
|
53
|
-
* Filter items to only include those newer than the given timestamp
|
|
54
|
-
*/
|
|
55
|
-
filterNewItems(items: GraphQLItem[], lastProcessedTimestamp: number): GraphQLItem[];
|
|
56
|
-
/**
|
|
57
|
-
* Update configuration
|
|
58
|
-
*/
|
|
59
19
|
updateConfig(config: Partial<CacheConfig>): void;
|
|
60
|
-
/**
|
|
61
|
-
* Get cache statistics
|
|
62
|
-
*/
|
|
63
20
|
getStats(): CacheStats & {
|
|
64
21
|
memoryStats: ReturnType<MemoryCache['getStats']>;
|
|
65
22
|
};
|
|
66
|
-
/**
|
|
67
|
-
* Get cached image metadata for a transaction ID
|
|
68
|
-
* Checks memory cache first, then file cache
|
|
69
|
-
*/
|
|
70
23
|
getImageMetadata(transactionId: string): Promise<ImageMetadata | null>;
|
|
71
|
-
/**
|
|
72
|
-
* Set cached image metadata for a transaction ID
|
|
73
|
-
* Updates both memory and file cache
|
|
74
|
-
*/
|
|
75
24
|
setImageMetadata(transactionId: string, metadata: ImageMetadata): Promise<void>;
|
|
76
|
-
/**
|
|
77
|
-
* Reset statistics
|
|
78
|
-
*/
|
|
79
25
|
resetStats(): void;
|
|
80
26
|
}
|
|
81
27
|
//# sourceMappingURL=CacheManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CacheManager.d.ts","sourceRoot":"","sources":["../../src/cache/CacheManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,C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4BtE,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAcrF,UAAU,IAAI,IAAI;CAQnB"}
|
|
@@ -1,75 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CachedFeedContent, CacheConfig, CacheContentKeyOptions } from './types';
|
|
2
2
|
import type { ImageMetadata } from '../types';
|
|
3
3
|
/**
|
|
4
|
-
* File-based persistent cache
|
|
4
|
+
* File-based persistent cache for serialized feed content and image metadata.
|
|
5
5
|
*/
|
|
6
6
|
export declare class FileCache {
|
|
7
7
|
private cacheDir;
|
|
8
8
|
private config;
|
|
9
9
|
constructor(config: CacheConfig);
|
|
10
|
-
/**
|
|
11
|
-
* Ensure cache directory exists
|
|
12
|
-
*/
|
|
13
10
|
private ensureCacheDir;
|
|
14
|
-
/**
|
|
15
|
-
* Get file path for feed data
|
|
16
|
-
*/
|
|
17
|
-
private getFeedDataPath;
|
|
18
|
-
/**
|
|
19
|
-
* Get file path for feed content
|
|
20
|
-
*/
|
|
21
11
|
private getFeedContentPath;
|
|
22
|
-
/**
|
|
23
|
-
* Get file path for image metadata
|
|
24
|
-
*/
|
|
25
12
|
private getImageMetadataPath;
|
|
26
|
-
/**
|
|
27
|
-
* Ensure image metadata directory exists
|
|
28
|
-
*/
|
|
29
13
|
private ensureImageMetadataDir;
|
|
30
|
-
/**
|
|
31
|
-
* Get cached feed data for a schema
|
|
32
|
-
*/
|
|
33
|
-
getFeedData(schemaName: string): Promise<CachedFeedData | null>;
|
|
34
|
-
/**
|
|
35
|
-
* Set cached feed data for a schema
|
|
36
|
-
*/
|
|
37
|
-
setFeedData(schemaName: string, data: CachedFeedData): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Get cached feed content for a schema and format
|
|
40
|
-
*/
|
|
41
14
|
getFeedContent(schemaName: string, format: string, contentKeyOptions?: CacheContentKeyOptions): Promise<CachedFeedContent | null>;
|
|
42
|
-
/**
|
|
43
|
-
* Set cached feed content for a schema and format
|
|
44
|
-
*/
|
|
45
15
|
setFeedContent(schemaName: string, format: string, content: CachedFeedContent, contentKeyOptions?: CacheContentKeyOptions): Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Clear feed data cache for a schema
|
|
48
|
-
*/
|
|
49
|
-
clearFeedData(schemaName: string): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* Clear content cache for a schema and format
|
|
52
|
-
*/
|
|
53
16
|
clearFeedContent(schemaName: string, format: string, contentKeyOptions?: CacheContentKeyOptions): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Clear all content cache for a schema (all formats)
|
|
56
|
-
*/
|
|
57
17
|
clearAllContentCache(schemaName: string): Promise<void>;
|
|
58
|
-
/**
|
|
59
|
-
* Get cached image metadata for a transaction ID
|
|
60
|
-
*/
|
|
61
18
|
getImageMetadata(transactionId: string): Promise<ImageMetadata | null>;
|
|
62
|
-
/**
|
|
63
|
-
* Set cached image metadata for a transaction ID
|
|
64
|
-
*/
|
|
65
19
|
setImageMetadata(transactionId: string, metadata: ImageMetadata): Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Clear image metadata cache for a transaction ID
|
|
68
|
-
*/
|
|
69
20
|
clearImageMetadata(transactionId: string): Promise<void>;
|
|
70
|
-
/**
|
|
71
|
-
* Clear all caches
|
|
72
|
-
*/
|
|
73
21
|
clearAll(): Promise<void>;
|
|
74
22
|
}
|
|
75
23
|
//# sourceMappingURL=FileCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileCache.d.ts","sourceRoot":"","sources":["../../src/cache/FileCache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"FileCache.d.ts","sourceRoot":"","sources":["../../src/cache/FileCache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,sBAAsB,EAAuB,MAAM,SAAS,CAAC;AAE3G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAc;gBAEhB,MAAM,EAAE,WAAW;YAQjB,cAAc;IAU5B,OAAO,CAAC,kBAAkB;IAU1B,OAAO,CAAC,oBAAoB;YAKd,sBAAsB;IAW9B,cAAc,CAClB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,iBAAiB,CAAC,EAAE,sBAAsB,GACzC,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAyB9B,cAAc,CAClB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,iBAAiB,EAC1B,iBAAiB,CAAC,EAAE,sBAAsB,GACzC,OAAO,CAAC,IAAI,CAAC;IAaV,gBAAgB,CACpB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,iBAAiB,CAAC,EAAE,sBAAsB,GACzC,OAAO,CAAC,IAAI,CAAC;IAcV,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBvD,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAsBtE,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB/E,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWxD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAwBhC"}
|
|
@@ -1,68 +1,24 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { CachedFeedContent, CacheConfig, CacheContentKeyOptions } from './types';
|
|
2
|
+
import type { ImageMetadata } from '../types';
|
|
3
3
|
/**
|
|
4
|
-
* In-memory cache
|
|
4
|
+
* In-memory cache for serialized feed content and image metadata.
|
|
5
|
+
* Collection/item caching is owned by @seedprotocol/query.
|
|
5
6
|
*/
|
|
6
7
|
export declare class MemoryCache {
|
|
7
|
-
private feedDataCache;
|
|
8
8
|
private feedContentCache;
|
|
9
9
|
private imageMetadataCache;
|
|
10
10
|
private config;
|
|
11
|
-
private refreshLocks;
|
|
12
11
|
constructor(config: CacheConfig);
|
|
13
|
-
/**
|
|
14
|
-
* Get cached feed data for a schema
|
|
15
|
-
*/
|
|
16
|
-
getFeedData(schemaName: string): CachedFeedData | null;
|
|
17
|
-
/**
|
|
18
|
-
* Set cached feed data for a schema
|
|
19
|
-
*/
|
|
20
|
-
setFeedData(schemaName: string, items: GraphQLItem[]): void;
|
|
21
|
-
/**
|
|
22
|
-
* Get cached feed content for a schema and format
|
|
23
|
-
*/
|
|
24
12
|
getFeedContent(schemaName: string, format: string, contentKeyOptions?: CacheContentKeyOptions): CachedFeedContent | null;
|
|
25
|
-
/**
|
|
26
|
-
* Set cached feed content for a schema and format
|
|
27
|
-
*/
|
|
28
13
|
setFeedContent(schemaName: string, format: string, content: string, contentType: string, contentKeyOptions?: CacheContentKeyOptions, ttlOverride?: number): void;
|
|
29
|
-
/**
|
|
30
|
-
* Clear feed data cache for a schema
|
|
31
|
-
*/
|
|
32
|
-
clearFeedData(schemaName: string): void;
|
|
33
|
-
/**
|
|
34
|
-
* Clear content cache for a schema (all formats)
|
|
35
|
-
*/
|
|
36
14
|
clearContentCache(schemaName: string): void;
|
|
37
|
-
/**
|
|
38
|
-
* Get cached image metadata for a transaction ID
|
|
39
|
-
*/
|
|
40
15
|
getImageMetadata(transactionId: string): ImageMetadata | null;
|
|
41
|
-
/**
|
|
42
|
-
* Set cached image metadata for a transaction ID
|
|
43
|
-
*/
|
|
44
16
|
setImageMetadata(transactionId: string, metadata: ImageMetadata): void;
|
|
45
|
-
/**
|
|
46
|
-
* Clear all caches
|
|
47
|
-
*/
|
|
48
17
|
clearAll(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Get or create a refresh lock for a schema
|
|
51
|
-
* Prevents concurrent fetches for the same schema
|
|
52
|
-
*/
|
|
53
|
-
withRefreshLock<T>(schemaName: string, fn: () => Promise<T>): Promise<T>;
|
|
54
|
-
/**
|
|
55
|
-
* Update configuration
|
|
56
|
-
*/
|
|
57
18
|
updateConfig(config: Partial<CacheConfig>): void;
|
|
58
|
-
/**
|
|
59
|
-
* Get cache statistics
|
|
60
|
-
*/
|
|
61
19
|
getStats(): {
|
|
62
|
-
feedDataCount: number;
|
|
63
20
|
feedContentCount: number;
|
|
64
21
|
imageMetadataCount: number;
|
|
65
|
-
activeLocks: number;
|
|
66
22
|
};
|
|
67
23
|
}
|
|
68
24
|
//# sourceMappingURL=MemoryCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryCache.d.ts","sourceRoot":"","sources":["../../src/cache/MemoryCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"MemoryCache.d.ts","sourceRoot":"","sources":["../../src/cache/MemoryCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,sBAAsB,EAAuB,MAAM,SAAS,CAAC;AAE3G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C;;;GAGG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,gBAAgB,CAA6C;IACrE,OAAO,CAAC,kBAAkB,CAA+C;IACzE,OAAO,CAAC,MAAM,CAAc;gBAEhB,MAAM,EAAE,WAAW;IAI/B,cAAc,CACZ,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,iBAAiB,CAAC,EAAE,sBAAsB,GACzC,iBAAiB,GAAG,IAAI;IAgB3B,cAAc,CACZ,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,iBAAiB,CAAC,EAAE,sBAAsB,EAC1C,WAAW,CAAC,EAAE,MAAM,GACnB,IAAI;IAmBP,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAU3C,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAe7D,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI;IActE,QAAQ,IAAI,IAAI;IAKhB,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI;IAIhD,QAAQ,IAAI;QACV,gBAAgB,EAAE,MAAM,CAAC;QACzB,kBAAkB,EAAE,MAAM,CAAC;KAC5B;CAMF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cache/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cache/config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,SAAS,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,IAAI,WAAW,CA0E7C"}
|
package/dist/cache/types.d.ts
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import type { GraphQLItem, ImageMetadata } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Cached feed data for a specific schema
|
|
4
|
-
*/
|
|
5
|
-
export interface CachedFeedData {
|
|
6
|
-
items: GraphQLItem[];
|
|
7
|
-
lastProcessedTimestamp: number;
|
|
8
|
-
lastProcessedItemId: string;
|
|
9
|
-
lastUpdated: number;
|
|
10
|
-
etag: string;
|
|
11
|
-
}
|
|
12
2
|
/**
|
|
13
3
|
* Cached image metadata for an Arweave transaction ID
|
|
14
4
|
*/
|
|
@@ -37,7 +27,8 @@ export interface ImageMetadataConfig {
|
|
|
37
27
|
timeout: number;
|
|
38
28
|
}
|
|
39
29
|
/**
|
|
40
|
-
* Cache configuration options
|
|
30
|
+
* Cache configuration options (serialized content + image metadata).
|
|
31
|
+
* Collection/item caching lives in @seedprotocol/query.
|
|
41
32
|
*/
|
|
42
33
|
export interface CacheConfig {
|
|
43
34
|
ttl: number;
|
|
@@ -69,4 +60,5 @@ export interface CacheStats {
|
|
|
69
60
|
refreshes: number;
|
|
70
61
|
errors: number;
|
|
71
62
|
}
|
|
63
|
+
export type { GraphQLItem };
|
|
72
64
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cache/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cache/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,aAAa,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,sBAAsB,GAC/B,MAAM,CAQR;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAGD,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
import type { FeedConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Partial site/feed metadata overrides. Unspecified fields keep current/default values.
|
|
4
|
+
* `author` fields are merged individually when provided.
|
|
5
|
+
*/
|
|
6
|
+
export type SiteConfigOverrides = Partial<Omit<FeedConfig, 'author'>> & {
|
|
7
|
+
author?: Partial<NonNullable<FeedConfig['author']>>;
|
|
8
|
+
};
|
|
9
|
+
/** Hardcoded Seed Protocol defaults for feed channel metadata. */
|
|
10
|
+
export declare const DEFAULT_SITE_CONFIG: FeedConfig;
|
|
11
|
+
/**
|
|
12
|
+
* Merge overrides onto a base site config. Missing fields keep the base values.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveSiteConfig(overrides?: SiteConfigOverrides, base?: FeedConfig): FeedConfig;
|
|
15
|
+
/** Current site/feed channel config (defaults until `setSiteConfig` is called). */
|
|
16
|
+
export declare function getSiteConfig(): FeedConfig;
|
|
17
|
+
/**
|
|
18
|
+
* Override site/feed channel metadata for this process.
|
|
19
|
+
* Partial values are merged onto the Seed Protocol defaults (not the previous override set).
|
|
20
|
+
*/
|
|
21
|
+
export declare function setSiteConfig(overrides: SiteConfigOverrides): FeedConfig;
|
|
22
|
+
/** Restore hardcoded Seed Protocol site config defaults. */
|
|
23
|
+
export declare function resetSiteConfig(): void;
|
|
1
24
|
/**
|
|
2
25
|
* Load feed configuration from environment variables
|
|
3
26
|
*
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,IAAI;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,YAAY,GAAG,eAAe,CAAC;CACvD,CAcA"}
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,GAAG;IACtE,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,EAAE,UAYjC,CAAC;AAWF;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,CAAC,EAAE,mBAAmB,EAC/B,IAAI,GAAE,UAAuB,GAC5B,UAAU,CAoBZ;AAED,mFAAmF;AACnF,wBAAgB,aAAa,IAAI,UAAU,CAE1C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,mBAAmB,GAAG,UAAU,CAGxE;AAED,4DAA4D;AAC5D,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,IAAI;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,YAAY,GAAG,eAAe,CAAC;CACvD,CAcA"}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export type FeedFieldStorageModels = Record<string, string>;
|
|
4
|
-
export type FeedListElementStorageModels = Record<string, string[]>;
|
|
5
|
-
export declare function isFeedRichBodyStorageSchema(schemaName: string): boolean;
|
|
6
|
-
/** html < file < json for tie-breaking among rich body fields. */
|
|
7
|
-
export declare function feedRichBodyModelPriority(schemaName: string): number;
|
|
8
|
-
export declare function getFeedFieldStorageModels(item: Record<string, unknown>): FeedFieldStorageModels | undefined;
|
|
9
|
-
export declare function getFeedListElementStorageModels(item: Record<string, unknown>): FeedListElementStorageModels | undefined;
|
|
10
|
-
export declare function setFeedFieldStorageModel(item: Record<string, unknown>, fieldKey: string, schemaName: string): void;
|
|
11
|
-
export declare function setFeedListElementStorageModels(item: Record<string, unknown>, outputKey: string, models: string[]): void;
|
|
1
|
+
export { FEED_RICH_BODY_STORAGE_SCHEMAS, RICH_BODY_STORAGE_SCHEMAS, isFeedRichBodyStorageSchema, isRichBodyStorageSchema, feedRichBodyModelPriority, richBodyModelPriority, getFeedFieldStorageModels, getFieldStorageModels, getFeedListElementStorageModels, getListElementStorageModels, setFeedFieldStorageModel, setFieldStorageModel, setFeedListElementStorageModels, setListElementStorageModels, } from '@seedprotocol/query';
|
|
2
|
+
export type { FeedFieldStorageModels, FieldStorageModels, FeedListElementStorageModels, ListElementStorageModels, } from '@seedprotocol/query';
|
|
12
3
|
//# sourceMappingURL=feedFieldStorageModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedFieldStorageModel.d.ts","sourceRoot":"","sources":["../src/feedFieldStorageModel.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"feedFieldStorageModel.d.ts","sourceRoot":"","sources":["../src/feedFieldStorageModel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,+BAA+B,EAC/B,2BAA2B,EAC3B,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,sBAAsB,EACtB,kBAAkB,EAClB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,qBAAqB,CAAA"}
|
package/dist/getFeedItems.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
type SetFeedItemDefaultsOptions = {
|
|
2
|
+
itemUrlBase?: string;
|
|
3
|
+
itemUrlPath: string;
|
|
4
|
+
siteUrl: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Set default values for feed items (title, link, guid, pubDate, dual-case keys).
|
|
8
|
+
*/
|
|
9
|
+
export declare const setFeedItemDefaults: (item: Record<string, unknown>, seedUid: string, schemaName: string, options: SetFeedItemDefaultsOptions) => void;
|
|
1
10
|
export declare const getFeedItemsBySchemaName: (schemaName: string, options?: {
|
|
2
11
|
limit?: number;
|
|
3
12
|
skip?: number;
|
|
4
13
|
}) => Promise<Record<string, unknown>[]>;
|
|
5
14
|
export declare const getFeedItemsBySchemaNameForMonth: (schemaName: string, year: number, month: number) => Promise<Record<string, unknown>[]>;
|
|
15
|
+
export {};
|
|
6
16
|
//# sourceMappingURL=getFeedItems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFeedItems.d.ts","sourceRoot":"","sources":["../src/getFeedItems.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getFeedItems.d.ts","sourceRoot":"","sources":["../src/getFeedItems.ts"],"names":[],"mappings":"AASA,KAAK,0BAA0B,GAAG;IAChC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AA0BD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,SAAS,MAAM,EACf,YAAY,MAAM,EAClB,SAAS,0BAA0B,KAClC,IAgHF,CAAA;AA+ID,eAAO,MAAM,wBAAwB,GACnC,YAAY,MAAM,EAClB,UAAU;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KAC1C,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAanC,CAAA;AAED,eAAO,MAAM,gCAAgC,GAC3C,YAAY,MAAM,EAClB,MAAM,MAAM,EACZ,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CASnC,CAAA"}
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* True for a single-path gateway URL whose path looks like an Arweave transaction id
|
|
3
|
-
* (e.g. `https://arweave.net/<43-char tx id>`), matching {@link getArweaveUrlForTransaction}.
|
|
4
|
-
*/
|
|
5
|
-
export declare function isArweaveTransactionGatewayUrl(raw: string): boolean;
|
|
6
|
-
/**
|
|
7
|
-
* After {@link resolveRelationPropertiesToUrls}, Html/File relation fields may be gateway URLs.
|
|
8
|
-
* For RSS/Atom `content:encoded`, replace those with the fetched UTF-8 body (typically HTML).
|
|
9
|
-
*/
|
|
10
|
-
export declare function hydrateArweaveRichTextInFeedItems(items: Record<string, unknown>[]): Promise<void>;
|
|
1
|
+
export { hydrateArweaveRichTextInFeedItems, hydrateArweaveRichTextInItems, isArweaveTransactionGatewayUrl, } from '@seedprotocol/query';
|
|
11
2
|
//# sourceMappingURL=hydrateArweaveRichText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrateArweaveRichText.d.ts","sourceRoot":"","sources":["../src/hydrateArweaveRichText.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hydrateArweaveRichText.d.ts","sourceRoot":"","sources":["../src/hydrateArweaveRichText.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,qBAAqB,CAAA"}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Adds `arweaveUrl` to an assembled Image seed clone when `storageTransactionId`
|
|
3
|
-
* (or snake_case) is present, so RSS/JSON feeds can expose both tx id and gateway URL.
|
|
4
|
-
*/
|
|
5
|
-
export declare function enrichImageSeedCloneForFeed(clone: Record<string, unknown>): void;
|
|
1
|
+
export { enrichImageSeedCloneForFeed, enrichImageSeedClone, } from '@seedprotocol/query';
|
|
6
2
|
//# sourceMappingURL=imageRelationEnrichment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageRelationEnrichment.d.ts","sourceRoot":"","sources":["../src/imageRelationEnrichment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"imageRelationEnrichment.d.ts","sourceRoot":"","sources":["../src/imageRelationEnrichment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,GACrB,MAAM,qBAAqB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export { getFeedItemsBySchemaName, getFeedItemsBySchemaNameForMonth } from './getFeedItems';
|
|
2
|
-
export { loadFeedConfig } from './config';
|
|
2
|
+
export { loadFeedConfig, DEFAULT_SITE_CONFIG, getSiteConfig, setSiteConfig, resetSiteConfig, resolveSiteConfig, type SiteConfigOverrides, } from './config';
|
|
3
3
|
export { parseRssString, type ParsedRssChannel } from './consume/parseRss';
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
4
|
+
export type { FeedConfig, FeedFormat, GraphQLItem } from './types';
|
|
5
|
+
export { initializeFeedPlatform, initializeSeedClient, getClient, teardownSeedClient, DEFAULT_ARWEAVE_HOST, } from './bootstrap';
|
|
6
|
+
export { classifyMediaRef, normalizeFeedItemFields, getFeedItemStringField, isEasAttestationExplorerUrl, resolveSeedRssImageRelationRef, resolveSeedRssImageRelationFromItem, SEED_RSS_IMAGE_RELATION_FIELD_KEYS, } from '@seedprotocol/arweave';
|
|
7
|
+
export type { FeedFieldManifest, FeedFieldDescriptor, FeedFieldRole, ClassifyMediaRefOptions, MediaRefClassification, ResolveMediaRefResult, ResolveMediaRefOptions, NormalizedMediaField, NormalizedHtmlField, NormalizedTextField, NormalizedFeedFieldValue, SeedRssImageRelationRef, } from '@seedprotocol/arweave';
|
|
6
8
|
import type { FeedFormat, GraphQLItem, TransformOptions } from './types';
|
|
7
9
|
export type { TransformOptions } from './types';
|
|
10
|
+
import { type SiteConfigOverrides } from './config';
|
|
8
11
|
export { enrichImageSeedCloneForFeed } from './imageRelationEnrichment';
|
|
9
12
|
export { pickFeedItemContent, pickFeedItemDescription, feedItemRichTextContainsDataUriImage, filterItemsByRichTextDataUriImagePolicy, } from './pickFeedItemRichText';
|
|
10
13
|
export { FEED_RICH_BODY_STORAGE_SCHEMAS, isFeedRichBodyStorageSchema, } from './feedFieldStorageModel';
|
|
@@ -12,21 +15,6 @@ export { FEED_RICH_BODY_STORAGE_SCHEMAS, isFeedRichBodyStorageSchema, } from './
|
|
|
12
15
|
* Reset cache manager (useful for testing)
|
|
13
16
|
*/
|
|
14
17
|
export declare function resetCacheManager(): void;
|
|
15
|
-
/**
|
|
16
|
-
* Initialize the Seed Protocol client
|
|
17
|
-
* This should be called as soon as the app is ready
|
|
18
|
-
*/
|
|
19
|
-
export declare const initializeSeedClient: () => Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Get the Seed Protocol client, initializing it if necessary
|
|
22
|
-
* This function can be called from any context (Electron main process or Vite dev server)
|
|
23
|
-
*/
|
|
24
|
-
export declare const getClient: () => Promise<any>;
|
|
25
|
-
/**
|
|
26
|
-
* Teardown the Seed Protocol client
|
|
27
|
-
* This should be called when the app is quitting
|
|
28
|
-
*/
|
|
29
|
-
export declare const teardownSeedClient: () => Promise<void>;
|
|
30
18
|
export interface FeedPaginationOptions {
|
|
31
19
|
page: number;
|
|
32
20
|
pageSize: number;
|
|
@@ -37,7 +25,7 @@ export interface FeedArchiveLink {
|
|
|
37
25
|
rel: string;
|
|
38
26
|
href: string;
|
|
39
27
|
}
|
|
40
|
-
export declare const createFeed: (items: GraphQLItem[], schemaName: string, format: FeedFormat, cacheBust?: string, pagination?: FeedPaginationOptions, archiveLinks?: FeedArchiveLink[], isArchive?: boolean, transformOverrides?: Partial<TransformOptions
|
|
28
|
+
export declare const createFeed: (items: GraphQLItem[], schemaName: string, format: FeedFormat, cacheBust?: string, pagination?: FeedPaginationOptions, archiveLinks?: FeedArchiveLink[], isArchive?: boolean, transformOverrides?: Partial<TransformOptions>, siteConfigOverrides?: SiteConfigOverrides) => Promise<string>;
|
|
41
29
|
/**
|
|
42
30
|
* Main route handler for feed generation.
|
|
43
31
|
*
|
|
@@ -48,7 +36,7 @@ export declare const createFeed: (items: GraphQLItem[], schemaName: string, form
|
|
|
48
36
|
* - /identities/json → JSON feed of identities
|
|
49
37
|
* - /posts/rss?v=1234567890 → RSS feed with cache busting parameter
|
|
50
38
|
*/
|
|
51
|
-
export declare function handleFeedRequest(collectionSegment: string, formatSegment: string, ifNoneMatch?: string | null, cacheBust?: string, page?: number): Promise<Response>;
|
|
39
|
+
export declare function handleFeedRequest(collectionSegment: string, formatSegment: string, ifNoneMatch?: string | null, cacheBust?: string, page?: number, siteConfigOverrides?: SiteConfigOverrides): Promise<Response>;
|
|
52
40
|
/**
|
|
53
41
|
* Route handler for monthly archive feeds (RFC 5005).
|
|
54
42
|
*
|
|
@@ -56,5 +44,5 @@ export declare function handleFeedRequest(collectionSegment: string, formatSegme
|
|
|
56
44
|
* Examples:
|
|
57
45
|
* - /posts/archive/2024/02/rss → RSS feed of posts from February 2024
|
|
58
46
|
*/
|
|
59
|
-
export declare function handleArchiveFeedRequest(collectionSegment: string, year: number, month: number, formatSegment: string, ifNoneMatch?: string | null, cacheBust?: string): Promise<Response>;
|
|
47
|
+
export declare function handleArchiveFeedRequest(collectionSegment: string, year: number, month: number, formatSegment: string, ifNoneMatch?: string | null, cacheBust?: string, siteConfigOverrides?: SiteConfigOverrides): Promise<Response>;
|
|
60
48
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,wBAAwB,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,KAAK,mBAAmB,GACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAA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