@fireproof/core 0.20.0-dev-preview-26 → 0.20.0-dev-preview-27

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.d.cts CHANGED
@@ -1361,7 +1361,7 @@ interface WriteQueue<T extends DocUpdate<S>, S extends DocTypes = DocTypes> {
1361
1361
  close(): Promise<void>;
1362
1362
  }
1363
1363
  interface LedgerOpts {
1364
- readonly name?: string;
1364
+ readonly name: string;
1365
1365
  readonly meta?: DbMeta;
1366
1366
  readonly gatewayInterceptor?: SerdeGatewayInterceptor;
1367
1367
  readonly writeQueue: WriteQueueParams;
@@ -1386,7 +1386,7 @@ interface Ledger extends HasCRDT {
1386
1386
 
1387
1387
  declare function keyConfigOpts(sthis: SuperThis, name?: string, opts?: ConfigOpts): string;
1388
1388
  declare function isLedger(db: unknown): db is Ledger;
1389
- declare function LedgerFactory(name: string | undefined, opts?: ConfigOpts): Ledger;
1389
+ declare function LedgerFactory(name: string, opts?: ConfigOpts): Ledger;
1390
1390
  declare class LedgerShell implements Ledger {
1391
1391
  readonly ref: LedgerImpl;
1392
1392
  readonly writeQueue: WriteQueue<DocUpdate<DocTypes>>;
package/index.d.ts CHANGED
@@ -1361,7 +1361,7 @@ interface WriteQueue<T extends DocUpdate<S>, S extends DocTypes = DocTypes> {
1361
1361
  close(): Promise<void>;
1362
1362
  }
1363
1363
  interface LedgerOpts {
1364
- readonly name?: string;
1364
+ readonly name: string;
1365
1365
  readonly meta?: DbMeta;
1366
1366
  readonly gatewayInterceptor?: SerdeGatewayInterceptor;
1367
1367
  readonly writeQueue: WriteQueueParams;
@@ -1386,7 +1386,7 @@ interface Ledger extends HasCRDT {
1386
1386
 
1387
1387
  declare function keyConfigOpts(sthis: SuperThis, name?: string, opts?: ConfigOpts): string;
1388
1388
  declare function isLedger(db: unknown): db is Ledger;
1389
- declare function LedgerFactory(name: string | undefined, opts?: ConfigOpts): Ledger;
1389
+ declare function LedgerFactory(name: string, opts?: ConfigOpts): Ledger;
1390
1390
  declare class LedgerShell implements Ledger {
1391
1391
  readonly ref: LedgerImpl;
1392
1392
  readonly writeQueue: WriteQueue<DocUpdate<DocTypes>>;
package/index.js CHANGED
@@ -589,7 +589,7 @@ var KeyBagProviderFile = class {
589
589
  if (isNotFoundError(e)) {
590
590
  return void 0;
591
591
  }
592
- throw this.logger.Error().Err(e).Str("file", ctx.dirName).Msg("read bag failed").AsError();
592
+ throw this.logger.Error().Err(e).Any("file", ctx).Msg("read bag failed").AsError();
593
593
  }
594
594
  }
595
595
  async set(item) {
@@ -720,7 +720,7 @@ var keysByFingerprint = class _keysByFingerprint {
720
720
  if (found) {
721
721
  return found;
722
722
  }
723
- throw this.keybag.logger.Error().Msg("KeyBag: keysByFingerprint: no default").AsError();
723
+ throw this.keybag.logger.Error().Str("fpr", fingerPrint).Any("fprs", Object.keys(this.keys)).Msg("keysByFingerprint: not found").AsError();
724
724
  }
725
725
  async upsert(materialStrOrUint8, def, keyBagAction = true) {
726
726
  def = !!def;
@@ -837,7 +837,7 @@ var KeyBag = class {
837
837
  const keyName = `@${keyFactory()}@`;
838
838
  const ret = await this.getNamedKey(keyName);
839
839
  if (ret.isErr()) {
840
- return ret;
840
+ return Result2.Err(ret);
841
841
  }
842
842
  const urb = url.build().setParam(PARAM.STORE_KEY, keyName);
843
843
  return Result2.Ok(urb.URI());
@@ -845,7 +845,7 @@ var KeyBag = class {
845
845
  if (storeKey.startsWith("@") && storeKey.endsWith("@")) {
846
846
  const ret = await this.getNamedKey(storeKey);
847
847
  if (ret.isErr()) {
848
- return ret;
848
+ return Result2.Err(ret);
849
849
  }
850
850
  }
851
851
  return Result2.Ok(url);
@@ -1209,6 +1209,7 @@ var MEMORY_VERSION = "v0.19-memory";
1209
1209
 
1210
1210
  // src/runtime/gateways/memory/gateway.ts
1211
1211
  var MemoryGateway = class {
1212
+ // readonly logger: Logger;
1212
1213
  constructor(sthis, memorys) {
1213
1214
  this.memorys = memorys;
1214
1215
  this.sthis = sthis;
@@ -4704,7 +4705,7 @@ var LedgerImpl = class {
4704
4705
  this.crdt.clock.onTock(() => this._no_update_notify());
4705
4706
  }
4706
4707
  get name() {
4707
- return this.opts.storeUrls.data.data.getParam(PARAM.NAME) ?? "default";
4708
+ return this.opts.name;
4708
4709
  }
4709
4710
  addShell(shell) {
4710
4711
  this.shells.add(shell);
@@ -4902,7 +4903,7 @@ __export(file_exports, {
4902
4903
 
4903
4904
  // src/version.ts
4904
4905
  var PACKAGE_VERSION = Object.keys({
4905
- "0.20.0-dev-preview-26": "xxxx"
4906
+ "0.20.0-dev-preview-27": "xxxx"
4906
4907
  })[0];
4907
4908
  export {
4908
4909
  CRDTImpl,