@fireproof/core 0.20.0-dev-preview-18 → 0.20.0-dev-preview-20
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/index.cjs +124 -147
- package/index.cjs.map +1 -1
- package/index.d.cts +102 -97
- package/index.d.ts +102 -97
- package/index.js +124 -147
- package/index.js.map +1 -1
- package/{indexdb → indexeddb}/index.cjs +16 -16
- package/indexeddb/index.cjs.map +1 -0
- package/{indexdb → indexeddb}/index.d.cts +4 -4
- package/{indexdb → indexeddb}/index.d.ts +4 -4
- package/{indexdb → indexeddb}/index.js +15 -15
- package/indexeddb/index.js.map +1 -0
- package/indexeddb/metafile-cjs.json +1 -0
- package/indexeddb/metafile-esm.json +1 -0
- package/metafile-cjs.json +1 -1
- package/metafile-esm.json +1 -1
- package/package.json +10 -10
- package/react/index.d.cts +1 -1
- package/react/index.d.ts +1 -1
- package/tests/blockstore/interceptor-gateway.test.ts +17 -17
- package/tests/blockstore/{keyed-crypto-indexdb-file.test.ts → keyed-crypto-indexeddb-file.test.ts} +13 -12
- package/tests/blockstore/keyed-crypto.test.ts +20 -19
- package/tests/blockstore/store.test.ts +19 -11
- package/tests/fireproof/all-gateway.test.ts +67 -60
- package/tests/gateway/{indexdb → indexeddb}/loader-config.test.ts +10 -10
- package/tests/helpers.ts +1 -1
- package/indexdb/index.cjs.map +0 -1
- package/indexdb/index.js.map +0 -1
- package/indexdb/metafile-cjs.json +0 -1
- package/indexdb/metafile-esm.json +0 -1
package/index.d.ts
CHANGED
@@ -227,22 +227,72 @@ interface FPEnvelopeWAL extends FPEnvelope<WALState> {
|
|
227
227
|
declare function Car2FPMsg(fpcar: Uint8Array): Result<FPEnvelopeCar>;
|
228
228
|
declare function File2FPMsg(fpfile: Uint8Array): Result<FPEnvelopeFile>;
|
229
229
|
|
230
|
+
interface SerializedMeta {
|
231
|
+
readonly data: string;
|
232
|
+
readonly parents: string[];
|
233
|
+
readonly cid: string;
|
234
|
+
}
|
235
|
+
declare function dbMetaEvent2Serialized(sthis: SuperThis, dbEvents: Omit<DbMetaEvent, "eventCid">[]): Promise<SerializedMeta[]>;
|
236
|
+
type CAREncodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
237
|
+
type FILEEncodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
238
|
+
type METAEncodeEnvelope = (sthis: SuperThis, payload: SerializedMeta[]) => Promise<Result<Uint8Array>>;
|
239
|
+
type WALEncodeEnvelope = (sthis: SuperThis, payload: SerializedWAL) => Promise<Result<Uint8Array>>;
|
240
|
+
interface FPEncoder {
|
241
|
+
readonly car: CAREncodeEnvelope;
|
242
|
+
readonly file: FILEEncodeEnvelope;
|
243
|
+
readonly meta: METAEncodeEnvelope;
|
244
|
+
readonly wal: WALEncodeEnvelope;
|
245
|
+
}
|
246
|
+
declare function fpSerialize<T>(sthis: SuperThis, env: FPEnvelope<T>, pencoder?: Partial<FPEncoder>): Promise<Result<Uint8Array>>;
|
247
|
+
declare function decode2DbMetaEvents(sthis: SuperThis, rserializedMeta: Result<SerializedMeta[]>): Promise<Result<DbMetaEvent[]>>;
|
248
|
+
type linkOrCid = {
|
249
|
+
"/": string;
|
250
|
+
} | string;
|
251
|
+
interface SerializedWAL {
|
252
|
+
readonly fileOperations?: {
|
253
|
+
cid: linkOrCid;
|
254
|
+
public: boolean;
|
255
|
+
}[];
|
256
|
+
readonly noLoaderOps?: {
|
257
|
+
cars: linkOrCid[];
|
258
|
+
}[];
|
259
|
+
readonly operations?: {
|
260
|
+
cars: linkOrCid[];
|
261
|
+
}[];
|
262
|
+
}
|
263
|
+
type CARDecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
264
|
+
type FILEDecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
265
|
+
type METADecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<SerializedMeta[]>>;
|
266
|
+
type WALDecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<SerializedWAL>>;
|
267
|
+
interface FPDecoder {
|
268
|
+
readonly car: CARDecodeEnvelope;
|
269
|
+
readonly file: FILEDecodeEnvelope;
|
270
|
+
readonly meta: METADecodeEnvelope;
|
271
|
+
readonly wal: WALDecodeEnvelope;
|
272
|
+
}
|
273
|
+
declare function fpDeserialize<S>(sthis: SuperThis, url: URI, intoRaw: PromiseToUInt8, pdecoder?: Partial<FPDecoder>): Promise<Result<FPEnvelope<S>>>;
|
274
|
+
|
230
275
|
interface SerdeGatewayOpts {
|
231
276
|
readonly gateway: SerdeGateway;
|
232
277
|
}
|
233
278
|
type SerdeGetResult<S> = Result<FPEnvelope<S>, NotFoundError | Error>;
|
234
279
|
type VoidResult = Result<void>;
|
235
280
|
type UnsubscribeResult = Result<() => void>;
|
281
|
+
interface SerdeGatewayCtx {
|
282
|
+
readonly loader: Loadable;
|
283
|
+
readonly encoder?: Partial<FPEncoder>;
|
284
|
+
readonly decoder?: Partial<FPDecoder>;
|
285
|
+
}
|
236
286
|
interface SerdeGateway {
|
237
|
-
buildUrl(
|
238
|
-
start(
|
239
|
-
close(
|
240
|
-
put<T>(
|
241
|
-
get<S>(
|
242
|
-
delete(
|
243
|
-
subscribe(
|
244
|
-
getPlain(
|
245
|
-
destroy(
|
287
|
+
buildUrl(ctx: SerdeGatewayCtx, baseUrl: URI, key: string): Promise<Result<URI>>;
|
288
|
+
start(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<Result<URI>>;
|
289
|
+
close(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<VoidResult>;
|
290
|
+
put<T>(ctx: SerdeGatewayCtx, url: URI, body: FPEnvelope<T>): Promise<VoidResult>;
|
291
|
+
get<S>(ctx: SerdeGatewayCtx, url: URI): Promise<SerdeGetResult<S>>;
|
292
|
+
delete(ctx: SerdeGatewayCtx, url: URI): Promise<VoidResult>;
|
293
|
+
subscribe(ctx: SerdeGatewayCtx, url: URI, callback: (meta: FPEnvelopeMeta) => Promise<void>): Promise<UnsubscribeResult>;
|
294
|
+
getPlain(ctx: SerdeGatewayCtx, url: URI, key: string): Promise<Result<Uint8Array>>;
|
295
|
+
destroy(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<VoidResult>;
|
246
296
|
}
|
247
297
|
interface SerdeGatewayReturn<O, T> {
|
248
298
|
readonly op: O;
|
@@ -285,14 +335,14 @@ interface SerdeGatewaySubscribeOp {
|
|
285
335
|
}
|
286
336
|
type SerdeGatewaySubscribeReturn = SerdeGatewayReturn<SerdeGatewaySubscribeOp, UnsubscribeResult>;
|
287
337
|
interface SerdeGatewayInterceptor {
|
288
|
-
buildUrl(
|
289
|
-
start(
|
290
|
-
close(
|
291
|
-
delete(
|
292
|
-
destroy(
|
293
|
-
put<T>(
|
294
|
-
get<S>(
|
295
|
-
subscribe(
|
338
|
+
buildUrl(ctx: SerdeGatewayCtx, baseUrl: URI, key: string): Promise<Result<SerdeGatewayBuildUrlReturn>>;
|
339
|
+
start(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<Result<SerdeGatewayStartReturn>>;
|
340
|
+
close(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<Result<SerdeGatewayCloseReturn>>;
|
341
|
+
delete(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<Result<SerdeGatewayDeleteReturn>>;
|
342
|
+
destroy(ctx: SerdeGatewayCtx, baseUrl: URI): Promise<Result<SerdeGatewayDestroyReturn>>;
|
343
|
+
put<T>(ctx: SerdeGatewayCtx, url: URI, body: FPEnvelope<T>): Promise<Result<SerdeGatewayPutReturn<T>>>;
|
344
|
+
get<S>(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayGetReturn<S>>>;
|
345
|
+
subscribe(ctx: SerdeGatewayCtx, url: URI, callback: (meta: FPEnvelopeMeta) => Promise<void>): Promise<Result<SerdeGatewaySubscribeReturn>>;
|
296
346
|
}
|
297
347
|
|
298
348
|
declare class Context {
|
@@ -427,7 +477,6 @@ interface StoreURIRuntime {
|
|
427
477
|
readonly idx: StoreURIs;
|
428
478
|
}
|
429
479
|
interface StoreFactoryItem {
|
430
|
-
readonly sthis: SuperThis;
|
431
480
|
readonly url: URI;
|
432
481
|
readonly gatewayInterceptor?: SerdeGatewayInterceptor;
|
433
482
|
readonly loader: Loadable;
|
@@ -592,7 +641,7 @@ interface SerdeGatewayInstances {
|
|
592
641
|
interface GatewayReady extends SerdeGatewayInstances {
|
593
642
|
readonly url: URI;
|
594
643
|
}
|
595
|
-
declare function getStartedGateway(
|
644
|
+
declare function getStartedGateway(ctx: SerdeGatewayCtx, url: URI): Promise<Result<GatewayReady>>;
|
596
645
|
declare function ensureStoreEnDeFile(ende?: Partial<StoreEnDeFile>): StoreEnDeFile;
|
597
646
|
declare function toStoreRuntime(sthis: SuperThis, endeOpts?: Partial<StoreEnDeFile>): StoreRuntime;
|
598
647
|
|
@@ -613,28 +662,28 @@ interface Gateway {
|
|
613
662
|
}
|
614
663
|
|
615
664
|
declare class PassThroughGateway implements SerdeGatewayInterceptor {
|
616
|
-
buildUrl(
|
617
|
-
start(
|
618
|
-
close(
|
619
|
-
delete(
|
620
|
-
destroy(
|
621
|
-
put<T>(
|
622
|
-
get<S>(
|
623
|
-
subscribe(
|
665
|
+
buildUrl(ctx: SerdeGatewayCtx, url: URI, key: string): Promise<Result<SerdeGatewayBuildUrlReturn>>;
|
666
|
+
start(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayStartReturn>>;
|
667
|
+
close(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayCloseReturn>>;
|
668
|
+
delete(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayDeleteReturn>>;
|
669
|
+
destroy(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayDestroyReturn>>;
|
670
|
+
put<T>(ctx: SerdeGatewayCtx, url: URI, body: FPEnvelope<T>): Promise<Result<SerdeGatewayPutReturn<T>>>;
|
671
|
+
get<S>(ctx: SerdeGatewayCtx, url: URI): Promise<Result<SerdeGatewayGetReturn<S>>>;
|
672
|
+
subscribe(ctx: SerdeGatewayCtx, url: URI, callback: (meta: FPEnvelopeMeta) => Promise<void>): Promise<Result<SerdeGatewaySubscribeReturn>>;
|
624
673
|
}
|
625
674
|
declare class InterceptorGateway implements SerdeGateway {
|
626
675
|
readonly innerGW: SerdeGateway;
|
627
676
|
readonly interceptor: SerdeGatewayInterceptor;
|
628
677
|
constructor(sthis: SuperThis, innerGW: SerdeGateway, interceptor: SerdeGatewayInterceptor | undefined);
|
629
|
-
buildUrl(
|
630
|
-
destroy(
|
631
|
-
start(
|
632
|
-
close(
|
633
|
-
put<T>(
|
634
|
-
get<S>(
|
635
|
-
subscribe(
|
636
|
-
delete(
|
637
|
-
getPlain(
|
678
|
+
buildUrl(ctx: SerdeGatewayCtx, baseUrl: URI, key: string): Promise<Result<URI>>;
|
679
|
+
destroy(ctx: SerdeGatewayCtx, iurl: URI): Promise<Result<void>>;
|
680
|
+
start(ctx: SerdeGatewayCtx, url: URI): Promise<Result<URI>>;
|
681
|
+
close(ctx: SerdeGatewayCtx, url: URI): Promise<VoidResult>;
|
682
|
+
put<T>(ctx: SerdeGatewayCtx, url: URI, fpEnv: FPEnvelope<T>): Promise<VoidResult>;
|
683
|
+
get<S>(ctx: SerdeGatewayCtx, url: URI): Promise<SerdeGetResult<S>>;
|
684
|
+
subscribe(ctx: SerdeGatewayCtx, url: URI, callback: (msg: FPEnvelopeMeta) => Promise<void>): Promise<UnsubscribeResult>;
|
685
|
+
delete(ctx: SerdeGatewayCtx, url: URI): Promise<VoidResult>;
|
686
|
+
getPlain(ctx: SerdeGatewayCtx, url: URI, key: string): Promise<Result<Uint8Array>>;
|
638
687
|
}
|
639
688
|
|
640
689
|
declare function createDbMetaEvent(sthis: SuperThis, dbMeta: DbMeta, parents: CarClockHead): Promise<DbMetaEvent>;
|
@@ -805,6 +854,7 @@ type index$5_SerdeGatewayBuildUrlOp = SerdeGatewayBuildUrlOp;
|
|
805
854
|
type index$5_SerdeGatewayBuildUrlReturn = SerdeGatewayBuildUrlReturn;
|
806
855
|
type index$5_SerdeGatewayCloseOp = SerdeGatewayCloseOp;
|
807
856
|
type index$5_SerdeGatewayCloseReturn = SerdeGatewayCloseReturn;
|
857
|
+
type index$5_SerdeGatewayCtx = SerdeGatewayCtx;
|
808
858
|
type index$5_SerdeGatewayDeleteOp = SerdeGatewayDeleteOp;
|
809
859
|
type index$5_SerdeGatewayDeleteReturn = SerdeGatewayDeleteReturn;
|
810
860
|
type index$5_SerdeGatewayDestroyOp = SerdeGatewayDestroyOp;
|
@@ -849,7 +899,7 @@ declare const index$5_registerStoreProtocol: typeof registerStoreProtocol;
|
|
849
899
|
declare const index$5_toCIDBlock: typeof toCIDBlock;
|
850
900
|
declare const index$5_toStoreRuntime: typeof toStoreRuntime;
|
851
901
|
declare namespace index$5 {
|
852
|
-
export { type index$5_AnyAnyBlock as AnyAnyBlock, type index$5_AnyAnyLink as AnyAnyLink, type index$5_AnyBlock as AnyBlock, type index$5_AnyDecodedBlock as AnyDecodedBlock, type index$5_AnyLink as AnyLink, type index$5_AnyLinkFn as AnyLinkFn, index$5_BaseBlockstoreImpl as BaseBlockstoreImpl, type index$5_BaseStore as BaseStore, type index$5_BlobLike as BlobLike, type index$5_BlockFetcher as BlockFetcher, type index$5_BlockstoreOpts as BlockstoreOpts, type index$5_BlockstoreParams as BlockstoreParams, type index$5_BlockstoreRuntime as BlockstoreRuntime, type index$5_BytesWithIv as BytesWithIv, type index$5_CIDBlock as CIDBlock, index$5_Car2FPMsg as Car2FPMsg, type index$5_CarClockHead as CarClockHead, type index$5_CarClockLink as CarClockLink, type index$5_CarGroup as CarGroup, type index$5_CarHeader as CarHeader, type index$5_CarLog as CarLog, type index$5_CarMakeable as CarMakeable, index$5_CarTransactionImpl as CarTransactionImpl, type index$5_CarTransactionOpts as CarTransactionOpts, type index$5_CodecOpts as CodecOpts, type index$5_CommitOpts as CommitOpts, type index$5_CompactFetcher as CompactFetcher, type index$5_CompactFn as CompactFn, index$5_CompactionFetcher as CompactionFetcher, type index$5_Connection as Connection, index$5_ConnectionBase as ConnectionBase, type index$5_DataSaveOpts as DataSaveOpts, type index$5_DataStore as DataStore, type index$5_DbMeta as DbMeta, type index$5_DbMetaBinary as DbMetaBinary, type index$5_DbMetaEvent as DbMetaEvent, type index$5_DbMetaEventBlock as DbMetaEventBlock, index$5_DbMetaEventEqual as DbMetaEventEqual, index$5_DbMetaEventsEqual as DbMetaEventsEqual, type index$5_EncryptedBlock as EncryptedBlock, index$5_EncryptedBlockstore as EncryptedBlockstore, type index$5_FPEnvelope as FPEnvelope, type index$5_FPEnvelopeCar as FPEnvelopeCar, type index$5_FPEnvelopeFile as FPEnvelopeFile, type index$5_FPEnvelopeMeta as FPEnvelopeMeta, index$5_FPEnvelopeType as FPEnvelopeType, type index$5_FPEnvelopeWAL as FPEnvelopeWAL, type index$5_FPWALCarsOps as FPWALCarsOps, index$5_File2FPMsg as File2FPMsg, type index$5_Gateway as Gateway, type index$5_GatewayOpts as GatewayOpts, type index$5_GetResult as GetResult, index$5_InterceptorGateway as InterceptorGateway, type index$5_IvAndBytes as IvAndBytes, type index$5_IvKeyIdData as IvKeyIdData, type index$5_KeyMaterial as KeyMaterial, type index$5_KeyWithFingerExtract as KeyWithFingerExtract, type index$5_KeyWithFingerPrint as KeyWithFingerPrint, type index$5_KeyedCrypto as KeyedCrypto, type index$5_LoadHandler as LoadHandler, type index$5_Loadable as Loadable, index$5_Loader as Loader, type index$5_MetaStore as MetaStore, index$5_PassThroughGateway as PassThroughGateway, type index$5_RefBlockstore as RefBlockstore, type index$5_RefLoadable as RefLoadable, type index$5_SerdeGateway as SerdeGateway, type index$5_SerdeGatewayBuildUrlOp as SerdeGatewayBuildUrlOp, type index$5_SerdeGatewayBuildUrlReturn as SerdeGatewayBuildUrlReturn, type index$5_SerdeGatewayCloseOp as SerdeGatewayCloseOp, type index$5_SerdeGatewayCloseReturn as SerdeGatewayCloseReturn, type index$5_SerdeGatewayDeleteOp as SerdeGatewayDeleteOp, type index$5_SerdeGatewayDeleteReturn as SerdeGatewayDeleteReturn, type index$5_SerdeGatewayDestroyOp as SerdeGatewayDestroyOp, type index$5_SerdeGatewayDestroyReturn as SerdeGatewayDestroyReturn, type index$5_SerdeGatewayFactoryItem as SerdeGatewayFactoryItem, type index$5_SerdeGatewayGetOp as SerdeGatewayGetOp, type index$5_SerdeGatewayGetReturn as SerdeGatewayGetReturn, type index$5_SerdeGatewayInterceptor as SerdeGatewayInterceptor, type index$5_SerdeGatewayOpts as SerdeGatewayOpts, type index$5_SerdeGatewayPutOp as SerdeGatewayPutOp, type index$5_SerdeGatewayPutReturn as SerdeGatewayPutReturn, type index$5_SerdeGatewayReturn as SerdeGatewayReturn, type index$5_SerdeGatewayStartOp as SerdeGatewayStartOp, type index$5_SerdeGatewayStartReturn as SerdeGatewayStartReturn, type index$5_SerdeGatewaySubscribeOp as SerdeGatewaySubscribeOp, type index$5_SerdeGatewaySubscribeReturn as SerdeGatewaySubscribeReturn, type index$5_SerdeGetResult as SerdeGetResult, type index$5_SerdeOrGatewayFactoryItem as SerdeOrGatewayFactoryItem, type index$5_StoreEnDeFile as StoreEnDeFile, type index$5_StoreFactory as StoreFactory, type index$5_StoreFactoryItem as StoreFactoryItem, type index$5_StoreRuntime as StoreRuntime, type index$5_StoreRuntimeUrls as StoreRuntimeUrls, type index$5_StoreURIRuntime as StoreURIRuntime, type index$5_StoreURIs as StoreURIs, type index$5_StoreUrls as StoreUrls, type index$5_StoreUrlsOpts as StoreUrlsOpts, type index$5_TransactionMeta as TransactionMeta, type index$5_TransactionWrapper as TransactionWrapper, type index$5_UnsubscribeResult as UnsubscribeResult, type index$5_VoidResult as VoidResult, type index$5_WALState as WALState, type index$5_WALStore as WALStore, index$5_createDbMetaEvent as createDbMetaEvent, index$5_defaultGatewayFactoryItem as defaultGatewayFactoryItem, index$5_ensureStoreEnDeFile as ensureStoreEnDeFile, index$5_getDefaultURI as getDefaultURI, index$5_getGatewayFactoryItem as getGatewayFactoryItem, index$5_getStartedGateway as getStartedGateway, index$5_parseCarFile as parseCarFile, index$5_registerStoreProtocol as registerStoreProtocol, index$5_toCIDBlock as toCIDBlock, index$5_toStoreRuntime as toStoreRuntime };
|
902
|
+
export { type index$5_AnyAnyBlock as AnyAnyBlock, type index$5_AnyAnyLink as AnyAnyLink, type index$5_AnyBlock as AnyBlock, type index$5_AnyDecodedBlock as AnyDecodedBlock, type index$5_AnyLink as AnyLink, type index$5_AnyLinkFn as AnyLinkFn, index$5_BaseBlockstoreImpl as BaseBlockstoreImpl, type index$5_BaseStore as BaseStore, type index$5_BlobLike as BlobLike, type index$5_BlockFetcher as BlockFetcher, type index$5_BlockstoreOpts as BlockstoreOpts, type index$5_BlockstoreParams as BlockstoreParams, type index$5_BlockstoreRuntime as BlockstoreRuntime, type index$5_BytesWithIv as BytesWithIv, type index$5_CIDBlock as CIDBlock, index$5_Car2FPMsg as Car2FPMsg, type index$5_CarClockHead as CarClockHead, type index$5_CarClockLink as CarClockLink, type index$5_CarGroup as CarGroup, type index$5_CarHeader as CarHeader, type index$5_CarLog as CarLog, type index$5_CarMakeable as CarMakeable, index$5_CarTransactionImpl as CarTransactionImpl, type index$5_CarTransactionOpts as CarTransactionOpts, type index$5_CodecOpts as CodecOpts, type index$5_CommitOpts as CommitOpts, type index$5_CompactFetcher as CompactFetcher, type index$5_CompactFn as CompactFn, index$5_CompactionFetcher as CompactionFetcher, type index$5_Connection as Connection, index$5_ConnectionBase as ConnectionBase, type index$5_DataSaveOpts as DataSaveOpts, type index$5_DataStore as DataStore, type index$5_DbMeta as DbMeta, type index$5_DbMetaBinary as DbMetaBinary, type index$5_DbMetaEvent as DbMetaEvent, type index$5_DbMetaEventBlock as DbMetaEventBlock, index$5_DbMetaEventEqual as DbMetaEventEqual, index$5_DbMetaEventsEqual as DbMetaEventsEqual, type index$5_EncryptedBlock as EncryptedBlock, index$5_EncryptedBlockstore as EncryptedBlockstore, type index$5_FPEnvelope as FPEnvelope, type index$5_FPEnvelopeCar as FPEnvelopeCar, type index$5_FPEnvelopeFile as FPEnvelopeFile, type index$5_FPEnvelopeMeta as FPEnvelopeMeta, index$5_FPEnvelopeType as FPEnvelopeType, type index$5_FPEnvelopeWAL as FPEnvelopeWAL, type index$5_FPWALCarsOps as FPWALCarsOps, index$5_File2FPMsg as File2FPMsg, type index$5_Gateway as Gateway, type index$5_GatewayOpts as GatewayOpts, type index$5_GetResult as GetResult, index$5_InterceptorGateway as InterceptorGateway, type index$5_IvAndBytes as IvAndBytes, type index$5_IvKeyIdData as IvKeyIdData, type index$5_KeyMaterial as KeyMaterial, type index$5_KeyWithFingerExtract as KeyWithFingerExtract, type index$5_KeyWithFingerPrint as KeyWithFingerPrint, type index$5_KeyedCrypto as KeyedCrypto, type index$5_LoadHandler as LoadHandler, type index$5_Loadable as Loadable, index$5_Loader as Loader, type index$5_MetaStore as MetaStore, index$5_PassThroughGateway as PassThroughGateway, type index$5_RefBlockstore as RefBlockstore, type index$5_RefLoadable as RefLoadable, type index$5_SerdeGateway as SerdeGateway, type index$5_SerdeGatewayBuildUrlOp as SerdeGatewayBuildUrlOp, type index$5_SerdeGatewayBuildUrlReturn as SerdeGatewayBuildUrlReturn, type index$5_SerdeGatewayCloseOp as SerdeGatewayCloseOp, type index$5_SerdeGatewayCloseReturn as SerdeGatewayCloseReturn, type index$5_SerdeGatewayCtx as SerdeGatewayCtx, type index$5_SerdeGatewayDeleteOp as SerdeGatewayDeleteOp, type index$5_SerdeGatewayDeleteReturn as SerdeGatewayDeleteReturn, type index$5_SerdeGatewayDestroyOp as SerdeGatewayDestroyOp, type index$5_SerdeGatewayDestroyReturn as SerdeGatewayDestroyReturn, type index$5_SerdeGatewayFactoryItem as SerdeGatewayFactoryItem, type index$5_SerdeGatewayGetOp as SerdeGatewayGetOp, type index$5_SerdeGatewayGetReturn as SerdeGatewayGetReturn, type index$5_SerdeGatewayInterceptor as SerdeGatewayInterceptor, type index$5_SerdeGatewayOpts as SerdeGatewayOpts, type index$5_SerdeGatewayPutOp as SerdeGatewayPutOp, type index$5_SerdeGatewayPutReturn as SerdeGatewayPutReturn, type index$5_SerdeGatewayReturn as SerdeGatewayReturn, type index$5_SerdeGatewayStartOp as SerdeGatewayStartOp, type index$5_SerdeGatewayStartReturn as SerdeGatewayStartReturn, type index$5_SerdeGatewaySubscribeOp as SerdeGatewaySubscribeOp, type index$5_SerdeGatewaySubscribeReturn as SerdeGatewaySubscribeReturn, type index$5_SerdeGetResult as SerdeGetResult, type index$5_SerdeOrGatewayFactoryItem as SerdeOrGatewayFactoryItem, type index$5_StoreEnDeFile as StoreEnDeFile, type index$5_StoreFactory as StoreFactory, type index$5_StoreFactoryItem as StoreFactoryItem, type index$5_StoreRuntime as StoreRuntime, type index$5_StoreRuntimeUrls as StoreRuntimeUrls, type index$5_StoreURIRuntime as StoreURIRuntime, type index$5_StoreURIs as StoreURIs, type index$5_StoreUrls as StoreUrls, type index$5_StoreUrlsOpts as StoreUrlsOpts, type index$5_TransactionMeta as TransactionMeta, type index$5_TransactionWrapper as TransactionWrapper, type index$5_UnsubscribeResult as UnsubscribeResult, type index$5_VoidResult as VoidResult, type index$5_WALState as WALState, type index$5_WALStore as WALStore, index$5_createDbMetaEvent as createDbMetaEvent, index$5_defaultGatewayFactoryItem as defaultGatewayFactoryItem, index$5_ensureStoreEnDeFile as ensureStoreEnDeFile, index$5_getDefaultURI as getDefaultURI, index$5_getGatewayFactoryItem as getGatewayFactoryItem, index$5_getStartedGateway as getStartedGateway, index$5_parseCarFile as parseCarFile, index$5_registerStoreProtocol as registerStoreProtocol, index$5_toCIDBlock as toCIDBlock, index$5_toStoreRuntime as toStoreRuntime };
|
853
903
|
}
|
854
904
|
|
855
905
|
interface WriteQueueParams {
|
@@ -1471,51 +1521,6 @@ declare namespace index$3 {
|
|
1471
1521
|
export { index$3_block as block, codecInterface as codec };
|
1472
1522
|
}
|
1473
1523
|
|
1474
|
-
interface SerializedMeta {
|
1475
|
-
readonly data: string;
|
1476
|
-
readonly parents: string[];
|
1477
|
-
readonly cid: string;
|
1478
|
-
}
|
1479
|
-
declare function dbMetaEvent2Serialized(sthis: SuperThis, dbEvents: Omit<DbMetaEvent, "eventCid">[]): Promise<SerializedMeta[]>;
|
1480
|
-
type CAREncodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1481
|
-
type FILEEncodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1482
|
-
type METAEncodeEnvelope = (sthis: SuperThis, payload: SerializedMeta[]) => Promise<Result<Uint8Array>>;
|
1483
|
-
type WALEncodeEnvelope = (sthis: SuperThis, payload: SerializedWAL) => Promise<Result<Uint8Array>>;
|
1484
|
-
interface Encoder {
|
1485
|
-
readonly car: CAREncodeEnvelope;
|
1486
|
-
readonly file: FILEEncodeEnvelope;
|
1487
|
-
readonly meta: METAEncodeEnvelope;
|
1488
|
-
readonly wal: WALEncodeEnvelope;
|
1489
|
-
}
|
1490
|
-
declare function fpSerialize<T>(sthis: SuperThis, env: FPEnvelope<T>, pencoder?: Partial<Encoder>): Promise<Result<Uint8Array>>;
|
1491
|
-
declare function decode2DbMetaEvents(sthis: SuperThis, rserializedMeta: Result<SerializedMeta[]>): Promise<Result<DbMetaEvent[]>>;
|
1492
|
-
type linkOrCid = {
|
1493
|
-
"/": string;
|
1494
|
-
} | string;
|
1495
|
-
interface SerializedWAL {
|
1496
|
-
readonly fileOperations?: {
|
1497
|
-
cid: linkOrCid;
|
1498
|
-
public: boolean;
|
1499
|
-
}[];
|
1500
|
-
readonly noLoaderOps?: {
|
1501
|
-
cars: linkOrCid[];
|
1502
|
-
}[];
|
1503
|
-
readonly operations?: {
|
1504
|
-
cars: linkOrCid[];
|
1505
|
-
}[];
|
1506
|
-
}
|
1507
|
-
type CARDecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1508
|
-
type FILEDecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1509
|
-
type METADecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<SerializedMeta[]>>;
|
1510
|
-
type WALDecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<SerializedWAL>>;
|
1511
|
-
interface Decoder {
|
1512
|
-
readonly car: CARDecodeEnvelope;
|
1513
|
-
readonly file: FILEDecodeEnvelope;
|
1514
|
-
readonly meta: METADecodeEnvelope;
|
1515
|
-
readonly wal: WALDecodeEnvelope;
|
1516
|
-
}
|
1517
|
-
declare function fpDeserialize<S>(sthis: SuperThis, url: URI, intoRaw: PromiseToUInt8, pdecoder?: Partial<Decoder>): Promise<Result<FPEnvelope<S>>>;
|
1518
|
-
|
1519
1524
|
interface KeyBagCtx {
|
1520
1525
|
readonly dirName: string;
|
1521
1526
|
readonly sysFS: SysFileSystem;
|
@@ -1563,26 +1568,26 @@ declare namespace gateway {
|
|
1563
1568
|
declare class DefSerdeGateway implements SerdeGateway {
|
1564
1569
|
readonly gw: Gateway;
|
1565
1570
|
constructor(gw: Gateway);
|
1566
|
-
start(sthis:
|
1567
|
-
buildUrl(sthis:
|
1568
|
-
close(sthis:
|
1571
|
+
start({ loader: { sthis } }: SerdeGatewayCtx, baseURL: URI): Promise<Result<URI>>;
|
1572
|
+
buildUrl({ loader: { sthis } }: SerdeGatewayCtx, baseUrl: URI, key: string): Promise<Result<URI>>;
|
1573
|
+
close({ loader: { sthis } }: SerdeGatewayCtx, uri: URI): Promise<Result<void>>;
|
1569
1574
|
private subscribeFn;
|
1570
|
-
put<T>(sthis:
|
1571
|
-
get<S>(sthis:
|
1572
|
-
subscribe(sthis:
|
1573
|
-
delete(sthis:
|
1574
|
-
destroy(sthis:
|
1575
|
-
getPlain(sthis:
|
1575
|
+
put<T>({ loader: { sthis }, encoder }: SerdeGatewayCtx, url: URI, env: FPEnvelope<T>): Promise<Result<void>>;
|
1576
|
+
get<S>({ loader: { sthis }, decoder }: SerdeGatewayCtx, url: URI): Promise<SerdeGetResult<S>>;
|
1577
|
+
subscribe({ loader: { sthis }, decoder }: SerdeGatewayCtx, url: URI, callback: (meta: FPEnvelopeMeta) => Promise<void>): Promise<Result<() => void>>;
|
1578
|
+
delete({ loader: { sthis } }: SerdeGatewayCtx, url: URI): Promise<Result<void>>;
|
1579
|
+
destroy({ loader: { sthis } }: SerdeGatewayCtx, baseURL: URI): Promise<Result<void>>;
|
1580
|
+
getPlain({ loader: { sthis } }: SerdeGatewayCtx, iurl: URI, key: string): Promise<Result<Uint8Array<ArrayBufferLike>, Error>>;
|
1576
1581
|
}
|
1577
1582
|
|
1578
1583
|
type index$1_CARDecodeEnvelope = CARDecodeEnvelope;
|
1579
1584
|
type index$1_CAREncodeEnvelope = CAREncodeEnvelope;
|
1580
|
-
type index$1_Decoder = Decoder;
|
1581
1585
|
type index$1_DefSerdeGateway = DefSerdeGateway;
|
1582
1586
|
declare const index$1_DefSerdeGateway: typeof DefSerdeGateway;
|
1583
|
-
type index$1_Encoder = Encoder;
|
1584
1587
|
type index$1_FILEDecodeEnvelope = FILEDecodeEnvelope;
|
1585
1588
|
type index$1_FILEEncodeEnvelope = FILEEncodeEnvelope;
|
1589
|
+
type index$1_FPDecoder = FPDecoder;
|
1590
|
+
type index$1_FPEncoder = FPEncoder;
|
1586
1591
|
type index$1_METADecodeEnvelope = METADecodeEnvelope;
|
1587
1592
|
type index$1_METAEncodeEnvelope = METAEncodeEnvelope;
|
1588
1593
|
type index$1_SerializedMeta = SerializedMeta;
|
@@ -1594,15 +1599,15 @@ declare const index$1_decode2DbMetaEvents: typeof decode2DbMetaEvents;
|
|
1594
1599
|
declare const index$1_fpDeserialize: typeof fpDeserialize;
|
1595
1600
|
declare const index$1_fpSerialize: typeof fpSerialize;
|
1596
1601
|
declare namespace index$1 {
|
1597
|
-
export { type index$1_CARDecodeEnvelope as CARDecodeEnvelope, type index$1_CAREncodeEnvelope as CAREncodeEnvelope,
|
1602
|
+
export { type index$1_CARDecodeEnvelope as CARDecodeEnvelope, type index$1_CAREncodeEnvelope as CAREncodeEnvelope, index$1_DefSerdeGateway as DefSerdeGateway, type index$1_FILEDecodeEnvelope as FILEDecodeEnvelope, type index$1_FILEEncodeEnvelope as FILEEncodeEnvelope, type index$1_FPDecoder as FPDecoder, type index$1_FPEncoder as FPEncoder, type index$1_METADecodeEnvelope as METADecodeEnvelope, type index$1_METAEncodeEnvelope as METAEncodeEnvelope, type index$1_SerializedMeta as SerializedMeta, type index$1_SerializedWAL as SerializedWAL, type index$1_WALDecodeEnvelope as WALDecodeEnvelope, type index$1_WALEncodeEnvelope as WALEncodeEnvelope, index$1_dbMetaEvent2Serialized as dbMetaEvent2Serialized, index$1_decode2DbMetaEvents as decode2DbMetaEvents, index$2 as file, index$1_fpDeserialize as fpDeserialize, index$1_fpSerialize as fpSerialize, gateway as memory };
|
1598
1603
|
}
|
1599
1604
|
|
1600
1605
|
declare const FILESTORE_VERSION = "v0.19-file";
|
1601
1606
|
|
1602
|
-
declare const
|
1607
|
+
declare const INDEXEDDB_VERSION = "v0.19-indexeddb";
|
1603
1608
|
|
1604
1609
|
declare const index_FILESTORE_VERSION: typeof FILESTORE_VERSION;
|
1605
|
-
declare const
|
1610
|
+
declare const index_INDEXEDDB_VERSION: typeof INDEXEDDB_VERSION;
|
1606
1611
|
type index_KeyBackProviderFactory = KeyBackProviderFactory;
|
1607
1612
|
type index_KeyBag = KeyBag;
|
1608
1613
|
declare const index_KeyBag: typeof KeyBag;
|
@@ -1621,7 +1626,7 @@ declare const index_getPath: typeof getPath;
|
|
1621
1626
|
declare const index_registerKeyBagProviderFactory: typeof registerKeyBagProviderFactory;
|
1622
1627
|
declare const index_runtimeFn: typeof runtimeFn;
|
1623
1628
|
declare namespace index {
|
1624
|
-
export { index_FILESTORE_VERSION as FILESTORE_VERSION,
|
1629
|
+
export { index_FILESTORE_VERSION as FILESTORE_VERSION, index_INDEXEDDB_VERSION as INDEXEDDB_VERSION, type index_KeyBackProviderFactory as KeyBackProviderFactory, index_KeyBag as KeyBag, type index_KeyBagFile as KeyBagFile, type index_KeyBagOpts as KeyBagOpts, type index_KeyBagProvider as KeyBagProvider, type index_KeyBagProviderFactoryItem as KeyBagProviderFactoryItem, type index_KeyBagRuntime as KeyBagRuntime, type index_KeyItem as KeyItem, index_defaultKeyBagOpts as defaultKeyBagOpts, index_defaultKeyBagUrl as defaultKeyBagUrl, index_files as files, index_getFileName as getFileName, index_getKeyBag as getKeyBag, index_getPath as getPath, index$1 as gw, keyBag as kb, keyedCrypto as kc, index$3 as mf, index_registerKeyBagProviderFactory as registerKeyBagProviderFactory, index_runtimeFn as runtimeFn };
|
1625
1630
|
}
|
1626
1631
|
|
1627
1632
|
declare const PACKAGE_VERSION: string;
|