@fireproof/core 0.20.0-dev-preview-17 → 0.20.0-dev-preview-18
Sign up to get free protection for your applications and to get access to all the features.
- package/index.cjs +6 -4
- package/index.cjs.map +1 -1
- package/index.d.cts +6 -2
- package/index.d.ts +6 -2
- package/index.js +6 -4
- 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/keyed-crypto-indexdb-file.test.ts +1 -1
- package/tests/blockstore/keyed-crypto.test.ts +1 -1
package/index.d.cts
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>;
|
@@ -1476,6 +1476,7 @@ interface SerializedMeta {
|
|
1476
1476
|
readonly parents: string[];
|
1477
1477
|
readonly cid: string;
|
1478
1478
|
}
|
1479
|
+
declare function dbMetaEvent2Serialized(sthis: SuperThis, dbEvents: Omit<DbMetaEvent, "eventCid">[]): Promise<SerializedMeta[]>;
|
1479
1480
|
type CAREncodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1480
1481
|
type FILEEncodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1481
1482
|
type METAEncodeEnvelope = (sthis: SuperThis, payload: SerializedMeta[]) => Promise<Result<Uint8Array>>;
|
@@ -1487,6 +1488,7 @@ interface Encoder {
|
|
1487
1488
|
readonly wal: WALEncodeEnvelope;
|
1488
1489
|
}
|
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[]>>;
|
1490
1492
|
type linkOrCid = {
|
1491
1493
|
"/": string;
|
1492
1494
|
} | string;
|
@@ -1587,10 +1589,12 @@ type index$1_SerializedMeta = SerializedMeta;
|
|
1587
1589
|
type index$1_SerializedWAL = SerializedWAL;
|
1588
1590
|
type index$1_WALDecodeEnvelope = WALDecodeEnvelope;
|
1589
1591
|
type index$1_WALEncodeEnvelope = WALEncodeEnvelope;
|
1592
|
+
declare const index$1_dbMetaEvent2Serialized: typeof dbMetaEvent2Serialized;
|
1593
|
+
declare const index$1_decode2DbMetaEvents: typeof decode2DbMetaEvents;
|
1590
1594
|
declare const index$1_fpDeserialize: typeof fpDeserialize;
|
1591
1595
|
declare const index$1_fpSerialize: typeof fpSerialize;
|
1592
1596
|
declare namespace index$1 {
|
1593
|
-
export { type index$1_CARDecodeEnvelope as CARDecodeEnvelope, type index$1_CAREncodeEnvelope as CAREncodeEnvelope, type index$1_Decoder as Decoder, index$1_DefSerdeGateway as DefSerdeGateway, type index$1_Encoder as Encoder, type index$1_FILEDecodeEnvelope as FILEDecodeEnvelope, type index$1_FILEEncodeEnvelope as FILEEncodeEnvelope, 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$2 as file, index$1_fpDeserialize as fpDeserialize, index$1_fpSerialize as fpSerialize, gateway as memory };
|
1597
|
+
export { type index$1_CARDecodeEnvelope as CARDecodeEnvelope, type index$1_CAREncodeEnvelope as CAREncodeEnvelope, type index$1_Decoder as Decoder, index$1_DefSerdeGateway as DefSerdeGateway, type index$1_Encoder as Encoder, type index$1_FILEDecodeEnvelope as FILEDecodeEnvelope, type index$1_FILEEncodeEnvelope as FILEEncodeEnvelope, 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
1598
|
}
|
1595
1599
|
|
1596
1600
|
declare const FILESTORE_VERSION = "v0.19-file";
|
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>;
|
@@ -1476,6 +1476,7 @@ interface SerializedMeta {
|
|
1476
1476
|
readonly parents: string[];
|
1477
1477
|
readonly cid: string;
|
1478
1478
|
}
|
1479
|
+
declare function dbMetaEvent2Serialized(sthis: SuperThis, dbEvents: Omit<DbMetaEvent, "eventCid">[]): Promise<SerializedMeta[]>;
|
1479
1480
|
type CAREncodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1480
1481
|
type FILEEncodeEnvelope = (sthis: SuperThis, payload: Uint8Array) => Promise<Result<Uint8Array>>;
|
1481
1482
|
type METAEncodeEnvelope = (sthis: SuperThis, payload: SerializedMeta[]) => Promise<Result<Uint8Array>>;
|
@@ -1487,6 +1488,7 @@ interface Encoder {
|
|
1487
1488
|
readonly wal: WALEncodeEnvelope;
|
1488
1489
|
}
|
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[]>>;
|
1490
1492
|
type linkOrCid = {
|
1491
1493
|
"/": string;
|
1492
1494
|
} | string;
|
@@ -1587,10 +1589,12 @@ type index$1_SerializedMeta = SerializedMeta;
|
|
1587
1589
|
type index$1_SerializedWAL = SerializedWAL;
|
1588
1590
|
type index$1_WALDecodeEnvelope = WALDecodeEnvelope;
|
1589
1591
|
type index$1_WALEncodeEnvelope = WALEncodeEnvelope;
|
1592
|
+
declare const index$1_dbMetaEvent2Serialized: typeof dbMetaEvent2Serialized;
|
1593
|
+
declare const index$1_decode2DbMetaEvents: typeof decode2DbMetaEvents;
|
1590
1594
|
declare const index$1_fpDeserialize: typeof fpDeserialize;
|
1591
1595
|
declare const index$1_fpSerialize: typeof fpSerialize;
|
1592
1596
|
declare namespace index$1 {
|
1593
|
-
export { type index$1_CARDecodeEnvelope as CARDecodeEnvelope, type index$1_CAREncodeEnvelope as CAREncodeEnvelope, type index$1_Decoder as Decoder, index$1_DefSerdeGateway as DefSerdeGateway, type index$1_Encoder as Encoder, type index$1_FILEDecodeEnvelope as FILEDecodeEnvelope, type index$1_FILEEncodeEnvelope as FILEEncodeEnvelope, 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$2 as file, index$1_fpDeserialize as fpDeserialize, index$1_fpSerialize as fpSerialize, gateway as memory };
|
1597
|
+
export { type index$1_CARDecodeEnvelope as CARDecodeEnvelope, type index$1_CAREncodeEnvelope as CAREncodeEnvelope, type index$1_Decoder as Decoder, index$1_DefSerdeGateway as DefSerdeGateway, type index$1_Encoder as Encoder, type index$1_FILEDecodeEnvelope as FILEDecodeEnvelope, type index$1_FILEEncodeEnvelope as FILEEncodeEnvelope, 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
1598
|
}
|
1595
1599
|
|
1596
1600
|
declare const FILESTORE_VERSION = "v0.19-file";
|
package/index.js
CHANGED
@@ -685,7 +685,7 @@ var KeyBag = class {
|
|
685
685
|
name,
|
686
686
|
key
|
687
687
|
};
|
688
|
-
const bag = await this.rt.
|
688
|
+
const bag = await this.rt.getBagProvider();
|
689
689
|
this.logger.Debug().Str("name", name).Msg("setNamedKey");
|
690
690
|
await bag.set(name, item);
|
691
691
|
return await this.toKeyWithFingerPrint(item.key);
|
@@ -710,7 +710,7 @@ var KeyBag = class {
|
|
710
710
|
async getNamedKey(name, failIfNotFound = false) {
|
711
711
|
const id = this.rt.sthis.nextId(4).str;
|
712
712
|
return this._seq.add(async () => {
|
713
|
-
const bag = await this.rt.
|
713
|
+
const bag = await this.rt.getBagProvider();
|
714
714
|
const named = await bag.get(name);
|
715
715
|
if (named) {
|
716
716
|
const fpr = await this.toKeyWithFingerPrint(named.key);
|
@@ -813,7 +813,7 @@ function defaultKeyBagOpts(sthis, kbo) {
|
|
813
813
|
sthis,
|
814
814
|
logger,
|
815
815
|
keyLength: kbo.keyLength || 16,
|
816
|
-
|
816
|
+
getBagProvider: () => kitem.factory(url, sthis),
|
817
817
|
id: () => {
|
818
818
|
return url.toString();
|
819
819
|
}
|
@@ -4665,6 +4665,8 @@ import { runtimeFn as runtimeFn4 } from "@adviser/cement";
|
|
4665
4665
|
var gateways_exports = {};
|
4666
4666
|
__export(gateways_exports, {
|
4667
4667
|
DefSerdeGateway: () => DefSerdeGateway,
|
4668
|
+
dbMetaEvent2Serialized: () => dbMetaEvent2Serialized,
|
4669
|
+
decode2DbMetaEvents: () => decode2DbMetaEvents,
|
4668
4670
|
file: () => file_exports,
|
4669
4671
|
fpDeserialize: () => fpDeserialize,
|
4670
4672
|
fpSerialize: () => fpSerialize,
|
@@ -4680,7 +4682,7 @@ __export(file_exports, {
|
|
4680
4682
|
|
4681
4683
|
// src/version.ts
|
4682
4684
|
var PACKAGE_VERSION = Object.keys({
|
4683
|
-
"0.20.0-dev-preview-
|
4685
|
+
"0.20.0-dev-preview-18": "xxxx"
|
4684
4686
|
})[0];
|
4685
4687
|
export {
|
4686
4688
|
CRDTImpl,
|