@fireproof/core 0.20.0-dev-preview-17 → 0.20.0-dev-preview-19
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 +107 -128
- package/index.cjs.map +1 -1
- package/index.d.cts +102 -93
- package/index.d.ts +102 -93
- package/index.js +107 -128
- package/index.js.map +1 -1
- package/metafile-cjs.json +1 -1
- package/metafile-esm.json +1 -1
- package/package.json +1 -1
- package/tests/blockstore/interceptor-gateway.test.ts +17 -17
- package/tests/blockstore/keyed-crypto-indexdb-file.test.ts +7 -6
- package/tests/blockstore/keyed-crypto.test.ts +14 -13
- package/tests/blockstore/store.test.ts +19 -11
- package/tests/fireproof/all-gateway.test.ts +67 -60
package/index.d.ts
CHANGED
@@ -133,7 +133,7 @@ interface KeyBagRuntime {
|
|
133
133
|
readonly logger: Logger;
|
134
134
|
readonly sthis: SuperThis;
|
135
135
|
readonly keyLength: number;
|
136
|
-
|
136
|
+
getBagProvider(): Promise<KeyBagProvider>;
|
137
137
|
id(): string;
|
138
138
|
}
|
139
139
|
type KeyBackProviderFactory = (url: URI, sthis: SuperThis) => Promise<KeyBagProvider>;
|
@@ -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,49 +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
|
-
type CAREncodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1480
|
-
type FILEEncodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1481
|
-
type METAEncodeEnvelope = (sthis: SuperThis, payload: SerializedMeta[]) => Promise<Result<Uint8Array>>;
|
1482
|
-
type WALEncodeEnvelope = (sthis: SuperThis, payload: SerializedWAL) => Promise<Result<Uint8Array>>;
|
1483
|
-
interface Encoder {
|
1484
|
-
readonly car: CAREncodeEnvelope;
|
1485
|
-
readonly file: FILEEncodeEnvelope;
|
1486
|
-
readonly meta: METAEncodeEnvelope;
|
1487
|
-
readonly wal: WALEncodeEnvelope;
|
1488
|
-
}
|
1489
|
-
declare function fpSerialize<T>(sthis: SuperThis, env: FPEnvelope<T>, pencoder?: Partial<Encoder>): Promise<Result<Uint8Array>>;
|
1490
|
-
type linkOrCid = {
|
1491
|
-
"/": string;
|
1492
|
-
} | string;
|
1493
|
-
interface SerializedWAL {
|
1494
|
-
readonly fileOperations?: {
|
1495
|
-
cid: linkOrCid;
|
1496
|
-
public: boolean;
|
1497
|
-
}[];
|
1498
|
-
readonly noLoaderOps?: {
|
1499
|
-
cars: linkOrCid[];
|
1500
|
-
}[];
|
1501
|
-
readonly operations?: {
|
1502
|
-
cars: linkOrCid[];
|
1503
|
-
}[];
|
1504
|
-
}
|
1505
|
-
type CARDecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1506
|
-
type FILEDecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1507
|
-
type METADecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<SerializedMeta[]>>;
|
1508
|
-
type WALDecodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<SerializedWAL>>;
|
1509
|
-
interface Decoder {
|
1510
|
-
readonly car: CARDecodeEnvelope;
|
1511
|
-
readonly file: FILEDecodeEnvelope;
|
1512
|
-
readonly meta: METADecodeEnvelope;
|
1513
|
-
readonly wal: WALDecodeEnvelope;
|
1514
|
-
}
|
1515
|
-
declare function fpDeserialize<S>(sthis: SuperThis, url: URI, intoRaw: PromiseToUInt8, pdecoder?: Partial<Decoder>): Promise<Result<FPEnvelope<S>>>;
|
1516
|
-
|
1517
1524
|
interface KeyBagCtx {
|
1518
1525
|
readonly dirName: string;
|
1519
1526
|
readonly sysFS: SysFileSystem;
|
@@ -1561,36 +1568,38 @@ declare namespace gateway {
|
|
1561
1568
|
declare class DefSerdeGateway implements SerdeGateway {
|
1562
1569
|
readonly gw: Gateway;
|
1563
1570
|
constructor(gw: Gateway);
|
1564
|
-
start(sthis:
|
1565
|
-
buildUrl(sthis:
|
1566
|
-
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>>;
|
1567
1574
|
private subscribeFn;
|
1568
|
-
put<T>(sthis:
|
1569
|
-
get<S>(sthis:
|
1570
|
-
subscribe(sthis:
|
1571
|
-
delete(sthis:
|
1572
|
-
destroy(sthis:
|
1573
|
-
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>>;
|
1574
1581
|
}
|
1575
1582
|
|
1576
1583
|
type index$1_CARDecodeEnvelope = CARDecodeEnvelope;
|
1577
1584
|
type index$1_CAREncodeEnvelope = CAREncodeEnvelope;
|
1578
|
-
type index$1_Decoder = Decoder;
|
1579
1585
|
type index$1_DefSerdeGateway = DefSerdeGateway;
|
1580
1586
|
declare const index$1_DefSerdeGateway: typeof DefSerdeGateway;
|
1581
|
-
type index$1_Encoder = Encoder;
|
1582
1587
|
type index$1_FILEDecodeEnvelope = FILEDecodeEnvelope;
|
1583
1588
|
type index$1_FILEEncodeEnvelope = FILEEncodeEnvelope;
|
1589
|
+
type index$1_FPDecoder = FPDecoder;
|
1590
|
+
type index$1_FPEncoder = FPEncoder;
|
1584
1591
|
type index$1_METADecodeEnvelope = METADecodeEnvelope;
|
1585
1592
|
type index$1_METAEncodeEnvelope = METAEncodeEnvelope;
|
1586
1593
|
type index$1_SerializedMeta = SerializedMeta;
|
1587
1594
|
type index$1_SerializedWAL = SerializedWAL;
|
1588
1595
|
type index$1_WALDecodeEnvelope = WALDecodeEnvelope;
|
1589
1596
|
type index$1_WALEncodeEnvelope = WALEncodeEnvelope;
|
1597
|
+
declare const index$1_dbMetaEvent2Serialized: typeof dbMetaEvent2Serialized;
|
1598
|
+
declare const index$1_decode2DbMetaEvents: typeof decode2DbMetaEvents;
|
1590
1599
|
declare const index$1_fpDeserialize: typeof fpDeserialize;
|
1591
1600
|
declare const index$1_fpSerialize: typeof fpSerialize;
|
1592
1601
|
declare namespace index$1 {
|
1593
|
-
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 };
|
1594
1603
|
}
|
1595
1604
|
|
1596
1605
|
declare const FILESTORE_VERSION = "v0.19-file";
|