@seedprotocol/feed 0.4.7 → 0.4.8

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 CHANGED
@@ -2,26 +2,27 @@
2
2
 
3
3
  ## Configuration
4
4
 
5
+ ### Caching (dev mode)
6
+
7
+ In development (`NODE_ENV=development`), feed caching is **disabled by default** so you always see fresh content. Set `CACHE_ENABLED=true` to enable caching in dev. See `packages/feed/src/cache/README.md` for full cache configuration.
8
+
5
9
  ### Feed Item URLs (EASScan attestation links)
6
10
 
7
11
  Item links in the feed can point to EASScan attestation pages. Set these environment variables:
8
12
 
9
- - `FEED_ITEM_URL_BASE` - Base URL for attestation links. When set, item URLs use `{base}/attestation/view/{uid}`.
13
+ - `FEED_ITEM_URL_BASE` - Base URL for attestation links. Item URLs use `{base}/attestation/view/{uid}`. Default: `https://easscan.org`. Set to override.
10
14
  - **Testnet**: `https://optimism-sepolia.easscan.org`
11
- - **Mainnet**: `https://easscan.org`
15
+ - **Mainnet**: `https://easscan.org` (default)
12
16
  - `FEED_ITEM_URL_PATH` - Path segment (default: `attestation/view`). Only used when `FEED_ITEM_URL_BASE` is set.
13
-
14
- When `FEED_ITEM_URL_BASE` is not set, item URLs fall back to `{siteUrl}/{collection}/{uid}` (e.g. `https://seedprotocol.io/posts/{uid}`).
17
+ - `FEED_SITE_URL` - Site URL for fallback when `FEED_ITEM_URL_BASE` is unset (default: `https://seedprotocol.io`).
15
18
 
16
19
  ### Example .env
17
20
 
18
21
  ```bash
19
- # EASScan attestation links (testnet)
22
+ # Default: item links use https://easscan.org/attestation/view/{uid}
23
+ # Override for testnet:
20
24
  FEED_ITEM_URL_BASE=https://optimism-sepolia.easscan.org
21
25
  FEED_ITEM_URL_PATH=attestation/view
22
-
23
- # When going live, switch to:
24
- # FEED_ITEM_URL_BASE=https://easscan.org
25
26
  ```
26
27
 
27
28
  ---
@@ -3,7 +3,8 @@ import type { CacheConfig } from './types';
3
3
  * Load cache configuration from environment variables
4
4
  *
5
5
  * Environment variables:
6
- * - CACHE_ENABLED: Set to 'false' to disable caching (default: 'true')
6
+ * - CACHE_ENABLED: Set to 'false' to disable caching. Set to 'true' to enable (overrides NODE_ENV).
7
+ * In development (NODE_ENV=development), cache is disabled by default unless CACHE_ENABLED='true'.
7
8
  * - CACHE_TTL: Cache time-to-live in seconds (default: 3600)
8
9
  * - CACHE_DIR: Directory for cache files (default: './cache')
9
10
  * - CACHE_BACKGROUND_REFRESH: Enable background refresh (default: 'false')
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cache/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,SAAS,CAAC;AAEhE;;;;;;;;;GASG;AACH,wBAAgB,eAAe,IAAI,WAAW,CA4C7C"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cache/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,SAAS,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,IAAI,WAAW,CAmE7C"}
package/dist/config.d.ts CHANGED
@@ -3,12 +3,14 @@
3
3
  *
4
4
  * Environment variables:
5
5
  * - FEED_ITEM_URL_BASE: Base URL for attestation links (e.g. https://optimism-sepolia.easscan.org or https://easscan.org).
6
- * When set, item links use {base}/attestation/view/{uid}. When unset, falls back to siteUrl/{collection}/{uid}.
6
+ * When set, item links use {base}/attestation/view/{uid}. Default: 'https://easscan.org'. Set to override.
7
7
  * - FEED_ITEM_URL_PATH: Path segment for attestation links (default: 'attestation/view').
8
8
  * Only used when FEED_ITEM_URL_BASE is set.
9
+ * - FEED_SITE_URL: Site URL for fallback when FEED_ITEM_URL_BASE is unset (default: 'https://seedprotocol.io').
9
10
  */
10
11
  export declare function loadFeedConfig(): {
11
- itemUrlBase: string | undefined;
12
+ itemUrlBase: string;
12
13
  itemUrlPath: string;
14
+ siteUrl: string;
13
15
  };
14
16
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI;IAChC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;CACrB,CAMA"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,cAAc,IAAI;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAQA"}
@@ -0,0 +1,2 @@
1
+ export declare const getFeedItemsBySchemaName: (schemaName: string) => Promise<Record<string, unknown>[]>;
2
+ //# sourceMappingURL=getFeedItems.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFeedItems.d.ts","sourceRoot":"","sources":["../src/getFeedItems.ts"],"names":[],"mappings":"AAsbA,eAAO,MAAM,wBAAwB,GAAU,YAAY,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAmCpG,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { getFeedItemsBySchemaName } from './getFeedItems';
2
+ export { getFeedItemsBySchemaName };
1
3
  import type { FeedFormat, GraphQLItem } from './types';
2
4
  /**
3
5
  * Reset cache manager (useful for testing)
@@ -18,7 +20,6 @@ export declare const getClient: () => Promise<any>;
18
20
  * This should be called when the app is quitting
19
21
  */
20
22
  export declare const teardownSeedClient: () => Promise<void>;
21
- export declare const GET_SEEDS: string;
22
23
  export declare const createFeed: (items: GraphQLItem[], schemaName: string, format: FeedFormat, cacheBust?: string) => Promise<string>;
23
24
  /**
24
25
  * Main route handler for feed generation.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAA+C,MAAM,SAAS,CAAC;AAuBpG;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAa,OAAO,CAAC,IAAI,CAkCzD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,QAAa,OAAO,CAAC,GAAG,CAe7C,CAAA;AAGD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAa,OAAO,CAAC,IAAI,CAmBvD,CAAA;AA0BD,eAAO,MAAM,SAAS,QAkBrB,CAAA;AA4JD,eAAO,MAAM,UAAU,GACrB,OAAO,WAAW,EAAE,EACpB,YAAY,MAAM,EAClB,QAAQ,UAAU,EAClB,YAAY,MAAM,KACjB,OAAO,CAAC,MAAM,CAgUhB,CAAA;AA8BD;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,iBAAiB,EAAE,MAAM,EACzB,aAAa,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,EAC3B,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,QAAQ,CAAC,CAqNnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAEpC,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAA+C,MAAM,SAAS,CAAC;AAuBpG;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAa,OAAO,CAAC,IAAI,CAkCzD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,QAAa,OAAO,CAAC,GAAG,CAe7C,CAAA;AAGD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAa,OAAO,CAAC,IAAI,CAmBvD,CAAA;AAkLD,eAAO,MAAM,UAAU,GACrB,OAAO,WAAW,EAAE,EACpB,YAAY,MAAM,EAClB,QAAQ,UAAU,EAClB,YAAY,MAAM,KACjB,OAAO,CAAC,MAAM,CAgUhB,CAAA;AA8BD;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,iBAAiB,EAAE,MAAM,EACzB,aAAa,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,EAC3B,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,QAAQ,CAAC,CAqNnB"}