@seedprotocol/query 0.7.1 → 0.7.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.
Files changed (43) hide show
  1. package/README.md +14 -5
  2. package/dist/{FileCache-BZ2cHsU3.js → FileCache-CQuj0MeF.js} +21 -16
  3. package/dist/FileCache-CQuj0MeF.js.map +1 -0
  4. package/dist/api.d.ts +5 -0
  5. package/dist/api.d.ts.map +1 -1
  6. package/dist/assembleSeeds.d.ts +21 -0
  7. package/dist/assembleSeeds.d.ts.map +1 -1
  8. package/dist/cache/CacheManager.d.ts +12 -14
  9. package/dist/cache/CacheManager.d.ts.map +1 -1
  10. package/dist/cache/FileCache.d.ts +4 -2
  11. package/dist/cache/FileCache.d.ts.map +1 -1
  12. package/dist/cache/MemoryCache.d.ts +12 -6
  13. package/dist/cache/MemoryCache.d.ts.map +1 -1
  14. package/dist/cache/changes.d.ts +28 -0
  15. package/dist/cache/changes.d.ts.map +1 -0
  16. package/dist/cache/config.d.ts +9 -0
  17. package/dist/cache/config.d.ts.map +1 -1
  18. package/dist/cache/etag.d.ts +7 -4
  19. package/dist/cache/etag.d.ts.map +1 -1
  20. package/dist/cache/freeze.d.ts +7 -0
  21. package/dist/cache/freeze.d.ts.map +1 -0
  22. package/dist/cache/types.d.ts +34 -7
  23. package/dist/cache/types.d.ts.map +1 -1
  24. package/dist/hydrateArweaveRichText.d.ts +3 -0
  25. package/dist/hydrateArweaveRichText.d.ts.map +1 -1
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +2 -2
  29. package/dist/index.node.js +4 -4
  30. package/dist/index.node.js.map +1 -1
  31. package/dist/node.js +1 -1
  32. package/dist/source/remote.d.ts.map +1 -1
  33. package/dist/source/types.d.ts +19 -1
  34. package/dist/source/types.d.ts.map +1 -1
  35. package/dist/src-CBgjwvGT.js +1207 -0
  36. package/dist/src-CBgjwvGT.js.map +1 -0
  37. package/dist/types-DHRoT30t.js.map +1 -1
  38. package/dist/types.d.ts +30 -7
  39. package/dist/types.d.ts.map +1 -1
  40. package/package.json +8 -3
  41. package/dist/FileCache-BZ2cHsU3.js.map +0 -1
  42. package/dist/src-BV0eFNvW.js +0 -993
  43. package/dist/src-BV0eFNvW.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { a as e, i as t, o as n, r as ee, t as r } from "./types-DHRoT30t.js";
2
- import { A as i, B as a, C as o, D as s, E as c, F as l, G as u, H as d, I as f, J as p, K as m, L as h, M as g, N as _, O as v, P as y, R as b, S as x, T as S, U as C, V as w, W as T, X as te, Y as E, Z as D, _ as O, a as k, b as A, c as j, d as M, f as N, g as P, h as F, i as I, j as L, k as R, l as z, m as B, n as V, o as H, p as U, q as W, r as G, s as K, t as q, u as J, v as Y, w as X, x as Z, y as Q, z as ne } from "./src-BV0eFNvW.js";
3
- import { t as $ } from "./FileCache-BZ2cHsU3.js";
2
+ import { $ as i, A as a, B as o, C as s, D as c, E as l, F as u, G as d, H as f, I as p, J as m, K as h, L as g, M as _, N as v, O as y, P as b, Q as x, R as S, S as C, T as w, U as T, V as E, W as D, X as O, Y as k, Z as te, _ as A, a as j, b as M, c as N, d as P, f as F, g as I, h as L, i as R, j as z, k as B, l as V, m as H, n as U, o as W, p as G, q as K, r as q, s as J, t as Y, u as X, v as Z, w as Q, x as ne, y as re, z as ie } from "./src-CBgjwvGT.js";
3
+ import { t as $ } from "./FileCache-CQuj0MeF.js";
4
4
  //#region src/index.node.ts
5
- F((e) => new $(e));
5
+ L((e) => new $(e));
6
6
  //#endregion
7
- export { B as CacheManager, ee as DEFAULT_ARWEAVE_HOST, g as FEED_RICH_BODY_STORAGE_SCHEMAS, $ as FileCache, _ as RICH_BODY_STORAGE_SCHEMAS, O as applyChangelogFilters, P as assembleSeedChangelog, o as assembleSeeds, r as buildAssembleOptionsKey, Y as buildFlatSnapshotFromProperties, Q as changelogValuesEqual, H as clearLocalQuerySource, J as createQueryCacheManager, X as createRemoteQueryDataSource, A as decodePropertyAttestation, Z as diffPropertyAttestations, x as diffVersionSnapshots, m as enrichImageSeedClone, W as enrichImageSeedCloneForFeed, y as feedRichBodyModelPriority, D as getArweaveUrlForTransaction, l as getFeedFieldStorageModels, f as getFeedListElementStorageModels, h as getFieldStorageModels, b as getListElementStorageModels, M as getQueryCacheManager, K as getRegisteredLocalQuerySource, S as getRemoteQueryDataSource, q as getSeed, j as hasLocalQuerySource, R as hydrateArweaveRichTextInFeedItems, i as hydrateArweaveRichTextInItems, t as initializeQueryPlatform, L as isArweaveTransactionGatewayUrl, ne as isFeedRichBodyStorageSchema, e as isQueryPlatformInitialized, a as isRichBodyStorageSchema, U as loadQueryCacheConfig, I as normalizeSourceMode, s as parseEasPropertyMetadata, v as parseEasPropertyMetadataForFeed, c as parseEasRelationPropertyName, p as publicListRelationPropertyKey, V as queryBySchema, G as queryBySchemaForMonth, z as registerLocalQuerySource, N as resetQueryCacheManager, k as resolveQuerySource, w as richBodyModelPriority, d as setFeedFieldStorageModel, C as setFeedListElementStorageModels, T as setFieldStorageModel, u as setListElementStorageModels, E as stripListRelationStorageAliasesForPublicKey, n as teardownQueryPlatform, te as tryCoerceJsonStringArray };
7
+ export { H as CacheManager, ee as DEFAULT_ARWEAVE_HOST, b as FEED_RICH_BODY_STORAGE_SCHEMAS, $ as FileCache, u as RICH_BODY_STORAGE_SCHEMAS, Z as applyChangelogFilters, A as assembleSeedChangelog, Q as assembleSeeds, r as buildAssembleOptionsKey, re as buildFlatSnapshotFromProperties, M as changelogValuesEqual, J as clearLocalQuerySource, P as createQueryCacheManager, w as createRemoteQueryDataSource, ne as decodePropertyAttestation, C as diffPropertyAttestations, s as diffVersionSnapshots, m as enrichImageSeedClone, k as enrichImageSeedCloneForFeed, p as feedRichBodyModelPriority, i as getArweaveUrlForTransaction, g as getFeedFieldStorageModels, S as getFeedListElementStorageModels, ie as getFieldStorageModels, o as getListElementStorageModels, F as getQueryCacheManager, N as getRegisteredLocalQuerySource, l as getRemoteQueryDataSource, Y as getSeed, V as hasLocalQuerySource, a as hydrateArweaveRichTextInFeedItems, z as hydrateArweaveRichTextInItems, t as initializeQueryPlatform, _ as isArweaveTransactionGatewayUrl, E as isFeedRichBodyStorageSchema, e as isQueryPlatformInitialized, f as isRichBodyStorageSchema, I as loadQueryCacheConfig, j as normalizeSourceMode, U as normalizeUidPrefix, y as parseEasPropertyMetadata, B as parseEasPropertyMetadataForFeed, c as parseEasRelationPropertyName, O as publicListRelationPropertyKey, q as queryBySchema, R as queryBySchemaForMonth, X as registerLocalQuerySource, v as resetArweaveBodyCache, G as resetQueryCacheManager, W as resolveQuerySource, T as richBodyModelPriority, D as setFeedFieldStorageModel, d as setFeedListElementStorageModels, h as setFieldStorageModel, K as setListElementStorageModels, te as stripListRelationStorageAliasesForPublicKey, n as teardownQueryPlatform, x as tryCoerceJsonStringArray };
8
8
 
9
9
  //# sourceMappingURL=index.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.js","names":["isQueryPlatformInitialized","initializeQueryPlatform","teardownQueryPlatform","DEFAULT_ARWEAVE_HOST","buildAssembleOptionsKey","hydrateArweaveRichTextInItems","isRichBodyStorageSchema","assembleSeeds","parseEasPropertyMetadata","parseEasRelationPropertyName","getFeedFieldStorageModels","setListElementStorageModels","setFeedFieldStorageModel","getFeedListElementStorageModels","publicListRelationPropertyKey","enrichImageSeedClone","getFieldStorageModels","FEED_RICH_BODY_STORAGE_SCHEMAS","RICH_BODY_STORAGE_SCHEMAS","parseEasPropertyMetadataForFeed","feedRichBodyModelPriority","getListElementStorageModels","diffVersionSnapshots","getRemoteQueryDataSource","setFeedListElementStorageModels","richBodyModelPriority","setFieldStorageModel","tryCoerceJsonStringArray","stripListRelationStorageAliasesForPublicKey","getArweaveUrlForTransaction","applyChangelogFilters","resolveQuerySource","decodePropertyAttestation","hasLocalQuerySource","getQueryCacheManager","resetQueryCacheManager","assembleSeedChangelog","configurePersistentCacheFactory","normalizeSourceMode","isArweaveTransactionGatewayUrl","hydrateArweaveRichTextInFeedItems","registerLocalQuerySource","CacheManager","queryBySchema","clearLocalQuerySource","loadQueryCacheConfig","enrichImageSeedCloneForFeed","queryBySchemaForMonth","getRegisteredLocalQuerySource","getSeed","createQueryCacheManager","buildFlatSnapshotFromProperties","createRemoteQueryDataSource","diffPropertyAttestations","changelogValuesEqual","isFeedRichBodyStorageSchema","FileCache","config"],"sources":["../src/index.node.ts"],"sourcesContent":["import { FileCache } from './cache/FileCache.js'\nimport { configurePersistentCacheFactory } from './cache/CacheManager.js'\n\nconfigurePersistentCacheFactory((config) => new FileCache(config))\n\nexport * from './index.js'\nexport { FileCache } from './cache/FileCache.js'\n"],"mappings":";;;;AAGAqC,GAAiC,MAAW,IAAImB,EAAUC,CAAM,CAAC"}
1
+ {"version":3,"file":"index.node.js","names":["isQueryPlatformInitialized","initializeQueryPlatform","teardownQueryPlatform","DEFAULT_ARWEAVE_HOST","buildAssembleOptionsKey","getArweaveUrlForTransaction","hydrateArweaveRichTextInFeedItems","getListElementStorageModels","diffVersionSnapshots","parseEasRelationPropertyName","getRemoteQueryDataSource","RICH_BODY_STORAGE_SCHEMAS","setFeedListElementStorageModels","isRichBodyStorageSchema","feedRichBodyModelPriority","enrichImageSeedClone","setFieldStorageModel","getFeedFieldStorageModels","isArweaveTransactionGatewayUrl","resetArweaveBodyCache","parseEasPropertyMetadata","FEED_RICH_BODY_STORAGE_SCHEMAS","tryCoerceJsonStringArray","getFeedListElementStorageModels","diffPropertyAttestations","createRemoteQueryDataSource","richBodyModelPriority","isFeedRichBodyStorageSchema","setFeedFieldStorageModel","publicListRelationPropertyKey","enrichImageSeedCloneForFeed","stripListRelationStorageAliasesForPublicKey","assembleSeedChangelog","normalizeSourceMode","changelogValuesEqual","getRegisteredLocalQuerySource","createQueryCacheManager","getQueryCacheManager","loadQueryCacheConfig","configurePersistentCacheFactory","queryBySchemaForMonth","hydrateArweaveRichTextInItems","parseEasPropertyMetadataForFeed","hasLocalQuerySource","CacheManager","normalizeUidPrefix","resolveQuerySource","resetQueryCacheManager","setListElementStorageModels","queryBySchema","clearLocalQuerySource","getSeed","registerLocalQuerySource","applyChangelogFilters","assembleSeeds","decodePropertyAttestation","buildFlatSnapshotFromProperties","getFieldStorageModels","FileCache","config"],"sources":["../src/index.node.ts"],"sourcesContent":["import { FileCache } from './cache/FileCache.js'\nimport { configurePersistentCacheFactory } from './cache/CacheManager.js'\n\nconfigurePersistentCacheFactory((config) => new FileCache(config))\n\nexport * from './index.js'\nexport { FileCache } from './cache/FileCache.js'\n"],"mappings":";;;;AAGAuC,GAAiC,MAAW,IAAImB,EAAUC,CAAM,CAAC"}
package/dist/node.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { a as e, i as t, o as n } from "./types-DHRoT30t.js";
2
- import { t as r } from "./FileCache-BZ2cHsU3.js";
2
+ import { t as r } from "./FileCache-CQuj0MeF.js";
3
3
  export { r as FileCache, t as initializeQueryPlatform, e as isQueryPlatformInitialized, n as teardownQueryPlatform };
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/source/remote.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAUjD;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,eAAe,CAqG7D;AAID,wBAAgB,wBAAwB,IAAI,eAAe,CAK1D;AAED,kBAAkB;AAClB,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD"}
1
+ {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/source/remote.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAUjD;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,eAAe,CAwG7D;AAID,wBAAgB,wBAAwB,IAAI,eAAe,CAK1D;AAED,kBAAkB;AAClB,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD"}
@@ -1,4 +1,4 @@
1
- import type { AttestationLike } from '../types.js';
1
+ import type { AttestationChange, AttestationLike } from '../types.js';
2
2
  /**
3
3
  * Pluggable backend for Seed / Version / property attestation reads.
4
4
  * Remote uses EAS GraphQL; local (SDK) maps SQLite rows into the same shape.
@@ -10,6 +10,14 @@ export type QueryDataSource = {
10
10
  limit: number;
11
11
  skip: number;
12
12
  }): Promise<AttestationLike[]>;
13
+ /**
14
+ * Like listSeedsBySchemaName, limited to seeds whose UID starts with `uidPrefix`
15
+ * (normalized: `0x` + lowercase hex).
16
+ */
17
+ listSeedsByUidPrefix(schemaName: string, uidPrefix: string, opts: {
18
+ limit: number;
19
+ skip: number;
20
+ }): Promise<AttestationLike[]>;
13
21
  listSeedsBySchemaNameForMonth(schemaName: string, year: number, month: number): Promise<AttestationLike[]>;
14
22
  getVersionsForSeed(seedUid: string): Promise<AttestationLike[]>;
15
23
  /**
@@ -23,6 +31,16 @@ export type QueryDataSource = {
23
31
  }): Promise<AttestationLike[]>;
24
32
  getPropertiesForVersionUids(versionUids: string[]): Promise<AttestationLike[]>;
25
33
  getSeedsByUids(uids: string[]): Promise<AttestationLike[]>;
34
+ /**
35
+ * Optional: attestations created or revoked after `since` (unix seconds) that reference one of
36
+ * `refUIDs` or are one of `ids`. The query cache uses it to tell which cached seeds changed;
37
+ * without it, a cache hit re-assembles everything.
38
+ */
39
+ listChangesSince?(opts: {
40
+ refUIDs: string[];
41
+ ids: string[];
42
+ since: number;
43
+ }): Promise<AttestationChange[]>;
26
44
  /**
27
45
  * Optional: read html/image bodies from local files instead of Arweave gateway.
28
46
  * Return null to fall back to remote hydrate.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/source/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAA;IAEjC,YAAY,CAAC,OAA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