@seedprotocol/feed 0.5.1 → 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 +2 -2
- 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/types.d.ts +3 -11
- package/dist/cache/types.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 +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +314 -820
- 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/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 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
4
|
|
|
5
5
|
## P2P distribution
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ Revoked attestations are excluded from feed queries by default. Items that have
|
|
|
16
16
|
|
|
17
17
|
### Caching (dev mode)
|
|
18
18
|
|
|
19
|
-
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
20
|
|
|
21
21
|
### Arweave gateway URLs
|
|
22
22
|
|
|
@@ -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,CAAC;AAE5C,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"CacheManager.d.ts","sourceRoot":"","sources":["../../src/cache/CacheManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,sBAAsB,EACtB,UAAU,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,KAAK,CAKX;gBAEU,MAAM,EAAE,WAAW;IAMzB,cAAc,CAClB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAClB,iBAAiB,CAAC,EAAE,sBAAsB,GACzC,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAqC9B,cAAc,CAClB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,iBAAiB,CAAC,EAAE,sBAAsB,GACzC,OAAO,CAAC,IAAI,CAAC;IAmCV,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK/C,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/B,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI;IAKhD,QAAQ,IAAI,UAAU,GAAG;QAAE,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;KAAE;IAOvE,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IA4BtE,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"}
|
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,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AAGD,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -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
|
@@ -3,8 +3,8 @@ export { loadFeedConfig, DEFAULT_SITE_CONFIG, getSiteConfig, setSiteConfig, rese
|
|
|
3
3
|
export { parseRssString, type ParsedRssChannel } from './consume/parseRss';
|
|
4
4
|
export type { FeedConfig, FeedFormat, GraphQLItem } from './types';
|
|
5
5
|
export { initializeFeedPlatform, initializeSeedClient, getClient, teardownSeedClient, DEFAULT_ARWEAVE_HOST, } from './bootstrap';
|
|
6
|
-
export { classifyMediaRef, normalizeFeedItemFields, getFeedItemStringField, } from '@seedprotocol/arweave';
|
|
7
|
-
export type { FeedFieldManifest, FeedFieldDescriptor, FeedFieldRole, ClassifyMediaRefOptions, MediaRefClassification, ResolveMediaRefResult, ResolveMediaRefOptions, NormalizedMediaField, NormalizedHtmlField, NormalizedTextField, NormalizedFeedFieldValue, } from '@seedprotocol/arweave';
|
|
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';
|
|
8
8
|
import type { FeedFormat, GraphQLItem, TransformOptions } from './types';
|
|
9
9
|
export type { TransformOptions } from './types';
|
|
10
10
|
import { type SiteConfigOverrides } from './config';
|
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,CAAC;AAC3E,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,SAAS,EACT,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAC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