@fireproof/core 0.19.11-dev-dryrun → 0.19.11-dev-dryrun2

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 (37) hide show
  1. package/{chunk-MAK4D54P.js → chunk-OFGPKRCM.js} +11 -1
  2. package/chunk-OFGPKRCM.js.map +1 -0
  3. package/{chunk-XINRLWR3.js → chunk-WS3YRPIA.js} +4 -4
  4. package/{gateway-VWWKLHUI.js → gateway-5FCWPX5W.js} +3 -3
  5. package/{gateway-7OM6OSYK.js → gateway-H7UD6TNB.js} +2 -2
  6. package/index.cjs +331 -378
  7. package/index.cjs.map +1 -1
  8. package/index.d.cts +9 -5
  9. package/index.d.ts +9 -5
  10. package/index.global.js +270 -318
  11. package/index.global.js.map +1 -1
  12. package/index.js +273 -329
  13. package/index.js.map +1 -1
  14. package/{key-bag-file-DFMW6ZM6.js → key-bag-file-WADZBHYG.js} +3 -3
  15. package/{key-bag-indexdb-R2RWGSQ4.js → key-bag-indexdb-PGVAI3FJ.js} +3 -3
  16. package/{mem-filesystem-BZQZLUR6.js → mem-filesystem-YPPJV7Q2.js} +3 -3
  17. package/metafile-cjs.json +1 -1
  18. package/metafile-esm.json +1 -1
  19. package/metafile-iife.json +1 -1
  20. package/{node-filesystem-7YZR3POJ.js → node-filesystem-INX4ZTHE.js} +3 -3
  21. package/package.json +1 -1
  22. package/tests/fireproof/all-gateway.test.ts +12 -13
  23. package/tests/fireproof/utils.test.ts +19 -0
  24. package/tests/www/todo-local.html +1 -1
  25. package/tests/www/todo.html +12 -15
  26. package/{utils-AISQB3PB.js → utils-QO2HIWGI.js} +3 -3
  27. package/chunk-MAK4D54P.js.map +0 -1
  28. package/tests/fireproof/convert_uint8.py +0 -27
  29. /package/{chunk-XINRLWR3.js.map → chunk-WS3YRPIA.js.map} +0 -0
  30. /package/{gateway-VWWKLHUI.js.map → gateway-5FCWPX5W.js.map} +0 -0
  31. /package/{gateway-7OM6OSYK.js.map → gateway-H7UD6TNB.js.map} +0 -0
  32. /package/{key-bag-file-DFMW6ZM6.js.map → key-bag-file-WADZBHYG.js.map} +0 -0
  33. /package/{key-bag-indexdb-R2RWGSQ4.js.map → key-bag-indexdb-PGVAI3FJ.js.map} +0 -0
  34. /package/{mem-filesystem-BZQZLUR6.js.map → mem-filesystem-YPPJV7Q2.js.map} +0 -0
  35. /package/{node-filesystem-7YZR3POJ.js.map → node-filesystem-INX4ZTHE.js.map} +0 -0
  36. /package/tests/fireproof/cars/{bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.js → bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.ts} +0 -0
  37. /package/{utils-AISQB3PB.js.map → utils-QO2HIWGI.js.map} +0 -0
package/index.d.cts CHANGED
@@ -441,7 +441,7 @@ interface WALState {
441
441
  }
442
442
  interface WALStore extends BaseStore {
443
443
  readonly storeType: "wal";
444
- ready: () => Promise<void>;
444
+ ready(): Promise<void>;
445
445
  readonly processing?: Promise<void> | undefined;
446
446
  readonly processQueue: CommitQueue<void>;
447
447
  process(): Promise<void>;
@@ -510,6 +510,7 @@ type VoidResult = Result<void>;
510
510
  interface TestGateway {
511
511
  get(url: URI, key: string): Promise<Uint8Array>;
512
512
  }
513
+ type UnsubscribeResult = Result<() => void>;
513
514
  interface Gateway {
514
515
  buildUrl(baseUrl: URI, key: string): Promise<Result<URI>>;
515
516
  start(baseUrl: URI): Promise<Result<URI>>;
@@ -518,7 +519,7 @@ interface Gateway {
518
519
  put(url: URI, body: Uint8Array): Promise<VoidResult>;
519
520
  get(url: URI): Promise<GetResult>;
520
521
  delete(url: URI): Promise<VoidResult>;
521
- subscribe?(url: URI, callback: (meta: Uint8Array) => void): Promise<VoidResult>;
522
+ subscribe?(url: URI, callback: (meta: Uint8Array) => void): Promise<UnsubscribeResult>;
522
523
  }
523
524
 
524
525
  interface GatewayFactoryItem {
@@ -554,7 +555,7 @@ declare class FragmentGateway implements Gateway {
554
555
  close(url: URI): Promise<VoidResult>;
555
556
  put(url: URI, body: Uint8Array): Promise<VoidResult>;
556
557
  get(url: URI): Promise<GetResult>;
557
- subscribe(url: URI, callback: (msg: Uint8Array) => void): Promise<VoidResult>;
558
+ subscribe(url: URI, callback: (msg: Uint8Array) => void): Promise<UnsubscribeResult>;
558
559
  delete(url: URI): Promise<VoidResult>;
559
560
  }
560
561
 
@@ -564,7 +565,6 @@ interface Connectable {
564
565
  readonly ebOpts: BlockstoreRuntime;
565
566
  };
566
567
  readonly name?: string;
567
- readonly sthis: SuperThis;
568
568
  }
569
569
  declare abstract class ConnectionBase implements Connection {
570
570
  loader?: Loadable;
@@ -654,6 +654,7 @@ type index$3_StoreRuntime = StoreRuntime;
654
654
  type index$3_TestGateway = TestGateway;
655
655
  type index$3_TransactionMeta = TransactionMeta;
656
656
  type index$3_TransactionWrapper<M extends TransactionMeta> = TransactionWrapper<M>;
657
+ type index$3_UnsubscribeResult = UnsubscribeResult;
657
658
  type index$3_VoidResult = VoidResult;
658
659
  type index$3_WALState = WALState;
659
660
  type index$3_WALStore = WALStore;
@@ -667,7 +668,7 @@ declare const index$3_testStoreFactory: typeof testStoreFactory;
667
668
  declare const index$3_toCIDBlock: typeof toCIDBlock;
668
669
  declare const index$3_toStoreRuntime: typeof toStoreRuntime;
669
670
  declare namespace index$3 {
670
- export { type index$3_AnyAnyBlock as AnyAnyBlock, type index$3_AnyAnyLink as AnyAnyLink, type index$3_AnyBlock as AnyBlock, type index$3_AnyDecodedBlock as AnyDecodedBlock, type index$3_AnyLink as AnyLink, type index$3_AnyLinkFn as AnyLinkFn, index$3_BaseBlockstore as BaseBlockstore, type index$3_BaseStore as BaseStore, type index$3_BlobLike as BlobLike, type index$3_BlockFetcher as BlockFetcher, type index$3_BlockstoreOpts as BlockstoreOpts, type index$3_BlockstoreRuntime as BlockstoreRuntime, type index$3_BytesWithIv as BytesWithIv, type index$3_CIDBlock as CIDBlock, type index$3_CarClockHead as CarClockHead, type index$3_CarClockLink as CarClockLink, type index$3_CarGroup as CarGroup, type index$3_CarHeader as CarHeader, type index$3_CarLog as CarLog, type index$3_CarMakeable as CarMakeable, index$3_CarTransaction as CarTransaction, type index$3_CodecOpts as CodecOpts, type index$3_CommitOpts as CommitOpts, type index$3_CompactFetcher as CompactFetcher, type index$3_CompactFn as CompactFn, index$3_CompactionFetcher as CompactionFetcher, type index$3_Connectable as Connectable, type index$3_Connection as Connection, index$3_ConnectionBase as ConnectionBase, type index$3_DataSaveOpts as DataSaveOpts, type index$3_DataStore as DataStore, type index$3_DbMeta as DbMeta, type index$3_DbMetaEventBlock as DbMetaEventBlock, type index$3_EncryptedBlock as EncryptedBlock, index$3_EncryptedBlockstore as EncryptedBlockstore, index$3_FragmentGateway as FragmentGateway, type index$3_Gateway as Gateway, type index$3_GatewayFactoryItem as GatewayFactoryItem, type index$3_GatewayOpts as GatewayOpts, type index$3_GetResult as GetResult, type index$3_IvAndBytes as IvAndBytes, type index$3_IvKeyIdData as IvKeyIdData, type index$3_KeyMaterial as KeyMaterial, type index$3_KeyWithFingerExtract as KeyWithFingerExtract, type index$3_KeyWithFingerPrint as KeyWithFingerPrint, type index$3_KeyedCrypto as KeyedCrypto, type index$3_LoadHandler as LoadHandler, type index$3_Loadable as Loadable, index$3_Loader as Loader, type index$3_MetaStore as MetaStore, type index$3_StoreFactory as StoreFactory, type index$3_StoreOpts as StoreOpts, type index$3_StoreRuntime as StoreRuntime, type index$3_TestGateway as TestGateway, type index$3_TransactionMeta as TransactionMeta, type index$3_TransactionWrapper as TransactionWrapper, type index$3_VoidResult as VoidResult, type index$3_WALState as WALState, type index$3_WALStore as WALStore, index$3_addCryptoKeyToGatewayMetaPayload as addCryptoKeyToGatewayMetaPayload, index$3_ensureStart as ensureStart, index$3_getGatewayFromURL as getGatewayFromURL, index$3_parseCarFile as parseCarFile, index$3_registerStoreProtocol as registerStoreProtocol, index$3_setCryptoKeyFromGatewayMetaPayload as setCryptoKeyFromGatewayMetaPayload, index$3_testStoreFactory as testStoreFactory, index$3_toCIDBlock as toCIDBlock, index$3_toStoreRuntime as toStoreRuntime };
671
+ export { type index$3_AnyAnyBlock as AnyAnyBlock, type index$3_AnyAnyLink as AnyAnyLink, type index$3_AnyBlock as AnyBlock, type index$3_AnyDecodedBlock as AnyDecodedBlock, type index$3_AnyLink as AnyLink, type index$3_AnyLinkFn as AnyLinkFn, index$3_BaseBlockstore as BaseBlockstore, type index$3_BaseStore as BaseStore, type index$3_BlobLike as BlobLike, type index$3_BlockFetcher as BlockFetcher, type index$3_BlockstoreOpts as BlockstoreOpts, type index$3_BlockstoreRuntime as BlockstoreRuntime, type index$3_BytesWithIv as BytesWithIv, type index$3_CIDBlock as CIDBlock, type index$3_CarClockHead as CarClockHead, type index$3_CarClockLink as CarClockLink, type index$3_CarGroup as CarGroup, type index$3_CarHeader as CarHeader, type index$3_CarLog as CarLog, type index$3_CarMakeable as CarMakeable, index$3_CarTransaction as CarTransaction, type index$3_CodecOpts as CodecOpts, type index$3_CommitOpts as CommitOpts, type index$3_CompactFetcher as CompactFetcher, type index$3_CompactFn as CompactFn, index$3_CompactionFetcher as CompactionFetcher, type index$3_Connectable as Connectable, type index$3_Connection as Connection, index$3_ConnectionBase as ConnectionBase, type index$3_DataSaveOpts as DataSaveOpts, type index$3_DataStore as DataStore, type index$3_DbMeta as DbMeta, type index$3_DbMetaEventBlock as DbMetaEventBlock, type index$3_EncryptedBlock as EncryptedBlock, index$3_EncryptedBlockstore as EncryptedBlockstore, index$3_FragmentGateway as FragmentGateway, type index$3_Gateway as Gateway, type index$3_GatewayFactoryItem as GatewayFactoryItem, type index$3_GatewayOpts as GatewayOpts, type index$3_GetResult as GetResult, type index$3_IvAndBytes as IvAndBytes, type index$3_IvKeyIdData as IvKeyIdData, type index$3_KeyMaterial as KeyMaterial, type index$3_KeyWithFingerExtract as KeyWithFingerExtract, type index$3_KeyWithFingerPrint as KeyWithFingerPrint, type index$3_KeyedCrypto as KeyedCrypto, type index$3_LoadHandler as LoadHandler, type index$3_Loadable as Loadable, index$3_Loader as Loader, type index$3_MetaStore as MetaStore, type index$3_StoreFactory as StoreFactory, type index$3_StoreOpts as StoreOpts, type index$3_StoreRuntime as StoreRuntime, type index$3_TestGateway as TestGateway, type index$3_TransactionMeta as TransactionMeta, type index$3_TransactionWrapper as TransactionWrapper, type index$3_UnsubscribeResult as UnsubscribeResult, type index$3_VoidResult as VoidResult, type index$3_WALState as WALState, type index$3_WALStore as WALStore, index$3_addCryptoKeyToGatewayMetaPayload as addCryptoKeyToGatewayMetaPayload, index$3_ensureStart as ensureStart, index$3_getGatewayFromURL as getGatewayFromURL, index$3_parseCarFile as parseCarFile, index$3_registerStoreProtocol as registerStoreProtocol, index$3_setCryptoKeyFromGatewayMetaPayload as setCryptoKeyFromGatewayMetaPayload, index$3_testStoreFactory as testStoreFactory, index$3_toCIDBlock as toCIDBlock, index$3_toStoreRuntime as toStoreRuntime };
671
672
  }
672
673
 
673
674
  type Falsy = false | null | undefined;
@@ -719,6 +720,9 @@ interface SuperThis {
719
720
  str: string;
720
721
  bin: Uint8Array;
721
722
  };
723
+ timeOrderedNextId(time?: number): {
724
+ str: string;
725
+ };
722
726
  start(): Promise<void>;
723
727
  clone(override: Partial<SuperThisOpts>): SuperThis;
724
728
  }
package/index.d.ts CHANGED
@@ -441,7 +441,7 @@ interface WALState {
441
441
  }
442
442
  interface WALStore extends BaseStore {
443
443
  readonly storeType: "wal";
444
- ready: () => Promise<void>;
444
+ ready(): Promise<void>;
445
445
  readonly processing?: Promise<void> | undefined;
446
446
  readonly processQueue: CommitQueue<void>;
447
447
  process(): Promise<void>;
@@ -510,6 +510,7 @@ type VoidResult = Result<void>;
510
510
  interface TestGateway {
511
511
  get(url: URI, key: string): Promise<Uint8Array>;
512
512
  }
513
+ type UnsubscribeResult = Result<() => void>;
513
514
  interface Gateway {
514
515
  buildUrl(baseUrl: URI, key: string): Promise<Result<URI>>;
515
516
  start(baseUrl: URI): Promise<Result<URI>>;
@@ -518,7 +519,7 @@ interface Gateway {
518
519
  put(url: URI, body: Uint8Array): Promise<VoidResult>;
519
520
  get(url: URI): Promise<GetResult>;
520
521
  delete(url: URI): Promise<VoidResult>;
521
- subscribe?(url: URI, callback: (meta: Uint8Array) => void): Promise<VoidResult>;
522
+ subscribe?(url: URI, callback: (meta: Uint8Array) => void): Promise<UnsubscribeResult>;
522
523
  }
523
524
 
524
525
  interface GatewayFactoryItem {
@@ -554,7 +555,7 @@ declare class FragmentGateway implements Gateway {
554
555
  close(url: URI): Promise<VoidResult>;
555
556
  put(url: URI, body: Uint8Array): Promise<VoidResult>;
556
557
  get(url: URI): Promise<GetResult>;
557
- subscribe(url: URI, callback: (msg: Uint8Array) => void): Promise<VoidResult>;
558
+ subscribe(url: URI, callback: (msg: Uint8Array) => void): Promise<UnsubscribeResult>;
558
559
  delete(url: URI): Promise<VoidResult>;
559
560
  }
560
561
 
@@ -564,7 +565,6 @@ interface Connectable {
564
565
  readonly ebOpts: BlockstoreRuntime;
565
566
  };
566
567
  readonly name?: string;
567
- readonly sthis: SuperThis;
568
568
  }
569
569
  declare abstract class ConnectionBase implements Connection {
570
570
  loader?: Loadable;
@@ -654,6 +654,7 @@ type index$3_StoreRuntime = StoreRuntime;
654
654
  type index$3_TestGateway = TestGateway;
655
655
  type index$3_TransactionMeta = TransactionMeta;
656
656
  type index$3_TransactionWrapper<M extends TransactionMeta> = TransactionWrapper<M>;
657
+ type index$3_UnsubscribeResult = UnsubscribeResult;
657
658
  type index$3_VoidResult = VoidResult;
658
659
  type index$3_WALState = WALState;
659
660
  type index$3_WALStore = WALStore;
@@ -667,7 +668,7 @@ declare const index$3_testStoreFactory: typeof testStoreFactory;
667
668
  declare const index$3_toCIDBlock: typeof toCIDBlock;
668
669
  declare const index$3_toStoreRuntime: typeof toStoreRuntime;
669
670
  declare namespace index$3 {
670
- export { type index$3_AnyAnyBlock as AnyAnyBlock, type index$3_AnyAnyLink as AnyAnyLink, type index$3_AnyBlock as AnyBlock, type index$3_AnyDecodedBlock as AnyDecodedBlock, type index$3_AnyLink as AnyLink, type index$3_AnyLinkFn as AnyLinkFn, index$3_BaseBlockstore as BaseBlockstore, type index$3_BaseStore as BaseStore, type index$3_BlobLike as BlobLike, type index$3_BlockFetcher as BlockFetcher, type index$3_BlockstoreOpts as BlockstoreOpts, type index$3_BlockstoreRuntime as BlockstoreRuntime, type index$3_BytesWithIv as BytesWithIv, type index$3_CIDBlock as CIDBlock, type index$3_CarClockHead as CarClockHead, type index$3_CarClockLink as CarClockLink, type index$3_CarGroup as CarGroup, type index$3_CarHeader as CarHeader, type index$3_CarLog as CarLog, type index$3_CarMakeable as CarMakeable, index$3_CarTransaction as CarTransaction, type index$3_CodecOpts as CodecOpts, type index$3_CommitOpts as CommitOpts, type index$3_CompactFetcher as CompactFetcher, type index$3_CompactFn as CompactFn, index$3_CompactionFetcher as CompactionFetcher, type index$3_Connectable as Connectable, type index$3_Connection as Connection, index$3_ConnectionBase as ConnectionBase, type index$3_DataSaveOpts as DataSaveOpts, type index$3_DataStore as DataStore, type index$3_DbMeta as DbMeta, type index$3_DbMetaEventBlock as DbMetaEventBlock, type index$3_EncryptedBlock as EncryptedBlock, index$3_EncryptedBlockstore as EncryptedBlockstore, index$3_FragmentGateway as FragmentGateway, type index$3_Gateway as Gateway, type index$3_GatewayFactoryItem as GatewayFactoryItem, type index$3_GatewayOpts as GatewayOpts, type index$3_GetResult as GetResult, type index$3_IvAndBytes as IvAndBytes, type index$3_IvKeyIdData as IvKeyIdData, type index$3_KeyMaterial as KeyMaterial, type index$3_KeyWithFingerExtract as KeyWithFingerExtract, type index$3_KeyWithFingerPrint as KeyWithFingerPrint, type index$3_KeyedCrypto as KeyedCrypto, type index$3_LoadHandler as LoadHandler, type index$3_Loadable as Loadable, index$3_Loader as Loader, type index$3_MetaStore as MetaStore, type index$3_StoreFactory as StoreFactory, type index$3_StoreOpts as StoreOpts, type index$3_StoreRuntime as StoreRuntime, type index$3_TestGateway as TestGateway, type index$3_TransactionMeta as TransactionMeta, type index$3_TransactionWrapper as TransactionWrapper, type index$3_VoidResult as VoidResult, type index$3_WALState as WALState, type index$3_WALStore as WALStore, index$3_addCryptoKeyToGatewayMetaPayload as addCryptoKeyToGatewayMetaPayload, index$3_ensureStart as ensureStart, index$3_getGatewayFromURL as getGatewayFromURL, index$3_parseCarFile as parseCarFile, index$3_registerStoreProtocol as registerStoreProtocol, index$3_setCryptoKeyFromGatewayMetaPayload as setCryptoKeyFromGatewayMetaPayload, index$3_testStoreFactory as testStoreFactory, index$3_toCIDBlock as toCIDBlock, index$3_toStoreRuntime as toStoreRuntime };
671
+ export { type index$3_AnyAnyBlock as AnyAnyBlock, type index$3_AnyAnyLink as AnyAnyLink, type index$3_AnyBlock as AnyBlock, type index$3_AnyDecodedBlock as AnyDecodedBlock, type index$3_AnyLink as AnyLink, type index$3_AnyLinkFn as AnyLinkFn, index$3_BaseBlockstore as BaseBlockstore, type index$3_BaseStore as BaseStore, type index$3_BlobLike as BlobLike, type index$3_BlockFetcher as BlockFetcher, type index$3_BlockstoreOpts as BlockstoreOpts, type index$3_BlockstoreRuntime as BlockstoreRuntime, type index$3_BytesWithIv as BytesWithIv, type index$3_CIDBlock as CIDBlock, type index$3_CarClockHead as CarClockHead, type index$3_CarClockLink as CarClockLink, type index$3_CarGroup as CarGroup, type index$3_CarHeader as CarHeader, type index$3_CarLog as CarLog, type index$3_CarMakeable as CarMakeable, index$3_CarTransaction as CarTransaction, type index$3_CodecOpts as CodecOpts, type index$3_CommitOpts as CommitOpts, type index$3_CompactFetcher as CompactFetcher, type index$3_CompactFn as CompactFn, index$3_CompactionFetcher as CompactionFetcher, type index$3_Connectable as Connectable, type index$3_Connection as Connection, index$3_ConnectionBase as ConnectionBase, type index$3_DataSaveOpts as DataSaveOpts, type index$3_DataStore as DataStore, type index$3_DbMeta as DbMeta, type index$3_DbMetaEventBlock as DbMetaEventBlock, type index$3_EncryptedBlock as EncryptedBlock, index$3_EncryptedBlockstore as EncryptedBlockstore, index$3_FragmentGateway as FragmentGateway, type index$3_Gateway as Gateway, type index$3_GatewayFactoryItem as GatewayFactoryItem, type index$3_GatewayOpts as GatewayOpts, type index$3_GetResult as GetResult, type index$3_IvAndBytes as IvAndBytes, type index$3_IvKeyIdData as IvKeyIdData, type index$3_KeyMaterial as KeyMaterial, type index$3_KeyWithFingerExtract as KeyWithFingerExtract, type index$3_KeyWithFingerPrint as KeyWithFingerPrint, type index$3_KeyedCrypto as KeyedCrypto, type index$3_LoadHandler as LoadHandler, type index$3_Loadable as Loadable, index$3_Loader as Loader, type index$3_MetaStore as MetaStore, type index$3_StoreFactory as StoreFactory, type index$3_StoreOpts as StoreOpts, type index$3_StoreRuntime as StoreRuntime, type index$3_TestGateway as TestGateway, type index$3_TransactionMeta as TransactionMeta, type index$3_TransactionWrapper as TransactionWrapper, type index$3_UnsubscribeResult as UnsubscribeResult, type index$3_VoidResult as VoidResult, type index$3_WALState as WALState, type index$3_WALStore as WALStore, index$3_addCryptoKeyToGatewayMetaPayload as addCryptoKeyToGatewayMetaPayload, index$3_ensureStart as ensureStart, index$3_getGatewayFromURL as getGatewayFromURL, index$3_parseCarFile as parseCarFile, index$3_registerStoreProtocol as registerStoreProtocol, index$3_setCryptoKeyFromGatewayMetaPayload as setCryptoKeyFromGatewayMetaPayload, index$3_testStoreFactory as testStoreFactory, index$3_toCIDBlock as toCIDBlock, index$3_toStoreRuntime as toStoreRuntime };
671
672
  }
672
673
 
673
674
  type Falsy = false | null | undefined;
@@ -719,6 +720,9 @@ interface SuperThis {
719
720
  str: string;
720
721
  bin: Uint8Array;
721
722
  };
723
+ timeOrderedNextId(time?: number): {
724
+ str: string;
725
+ };
722
726
  start(): Promise<void>;
723
727
  clone(override: Partial<SuperThisOpts>): SuperThis;
724
728
  }