@fireproof/core 0.14.0 → 0.14.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -11605,7 +11605,7 @@ You can use close({ resize: true }) to resize header`);
11605
11605
  }));
11606
11606
 
11607
11607
  // src/version.ts
11608
- var PACKAGE_VERSION = "0.14.0";
11608
+ var PACKAGE_VERSION = "0.14.2";
11609
11609
 
11610
11610
  // src/store.ts
11611
11611
  var match = PACKAGE_VERSION.match(/^([^.]*\.[^.]*)/);
@@ -18087,7 +18087,7 @@ You can use close({ resize: true }) to resize header`);
18087
18087
  // ../../node_modules/.pnpm/ipfs-unixfs@11.0.2/node_modules/ipfs-unixfs/dist/src/index.js
18088
18088
  var import_err_code5 = __toESM(require_err_code(), 1);
18089
18089
 
18090
- // ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/utils.js
18090
+ // ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/utils.js
18091
18091
  var import_reader3 = __toESM(require_reader(), 1);
18092
18092
  var import_reader_buffer = __toESM(require_reader_buffer(), 1);
18093
18093
  var import_minimal2 = __toESM(require_minimal(), 1);
@@ -18137,13 +18137,13 @@ You can use close({ resize: true }) to resize header`);
18137
18137
  return patchWriter(import_writer2.default.create());
18138
18138
  }
18139
18139
 
18140
- // ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/decode.js
18140
+ // ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/decode.js
18141
18141
  function decodeMessage(buf3, codec) {
18142
18142
  const r = reader(buf3 instanceof Uint8Array ? buf3 : buf3.subarray());
18143
18143
  return codec.decode(r);
18144
18144
  }
18145
18145
 
18146
- // ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/encode.js
18146
+ // ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/encode.js
18147
18147
  function encodeMessage(message2, codec) {
18148
18148
  const w = writer();
18149
18149
  codec.encode(message2, w, {
@@ -18152,7 +18152,7 @@ You can use close({ resize: true }) to resize header`);
18152
18152
  return w.finish();
18153
18153
  }
18154
18154
 
18155
- // ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/codec.js
18155
+ // ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/codec.js
18156
18156
  var CODEC_TYPES;
18157
18157
  (function(CODEC_TYPES2) {
18158
18158
  CODEC_TYPES2[CODEC_TYPES2["VARINT"] = 0] = "VARINT";
@@ -18171,7 +18171,7 @@ You can use close({ resize: true }) to resize header`);
18171
18171
  };
18172
18172
  }
18173
18173
 
18174
- // ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/codecs/enum.js
18174
+ // ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/codecs/enum.js
18175
18175
  function enumeration(v) {
18176
18176
  function findValue(val) {
18177
18177
  if (v[val.toString()] == null) {
@@ -18190,7 +18190,7 @@ You can use close({ resize: true }) to resize header`);
18190
18190
  return createCodec("enum", CODEC_TYPES.VARINT, encode19, decode21);
18191
18191
  }
18192
18192
 
18193
- // ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/codecs/message.js
18193
+ // ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/codecs/message.js
18194
18194
  function message(encode19, decode21) {
18195
18195
  return createCodec("message", CODEC_TYPES.LENGTH_DELIMITED, encode19, decode21);
18196
18196
  }
@@ -20808,11 +20808,9 @@ You can use close({ resize: true }) to resize header`);
20808
20808
  const dbBlockstore = blocks.parent;
20809
20809
  const t = new Transaction(dbBlockstore);
20810
20810
  const didPut = [];
20811
- let totalSize = 0;
20812
20811
  for (const filename in files) {
20813
20812
  if (File === files[filename].constructor) {
20814
20813
  const file = files[filename];
20815
- totalSize += file.size;
20816
20814
  const { cid, blocks: fileBlocks } = await encodeFile2(file);
20817
20815
  didPut.push(filename);
20818
20816
  for (const block of fileBlocks) {
@@ -20821,8 +20819,6 @@ You can use close({ resize: true }) to resize header`);
20821
20819
  files[filename] = { cid, type: file.type, size: file.size };
20822
20820
  }
20823
20821
  }
20824
- if (totalSize > 1024 * 1024 * 1)
20825
- throw new Error("Sync limit for files in a single update is 1MB");
20826
20822
  if (didPut.length) {
20827
20823
  const car = await dbBlockstore.loader?.commit(t, { files }, { public: publicFiles });
20828
20824
  if (car) {
@@ -20922,7 +20918,7 @@ You can use close({ resize: true }) to resize header`);
20922
20918
  } else {
20923
20919
  keys2.add(key);
20924
20920
  const docValue = await getValueFromLink(blocks, value);
20925
- updates.push({ key, value: docValue.doc, del: docValue.del });
20921
+ updates.push({ key, value: docValue.doc, del: docValue.del, clock: link2 });
20926
20922
  limit--;
20927
20923
  if (event.parents) {
20928
20924
  updates = await gatherUpdates(blocks, eventsFetcher, event.parents, since, updates, keys2, didLinks, limit);
@@ -21393,9 +21389,9 @@ You can use close({ resize: true }) to resize header`);
21393
21389
  }
21394
21390
  const got = await this.blocks.transaction(async (tblocks) => {
21395
21391
  const { head } = await applyBulkUpdateToCrdt(tblocks, this.clock.head, updates, options);
21396
- updates = updates.map(({ key, value, del: del2 }) => {
21392
+ updates = updates.map(({ key, value, del: del2, clock }) => {
21397
21393
  readFiles(this.blocks, { doc: value });
21398
- return { key, value, del: del2 };
21394
+ return { key, value, del: del2, clock };
21399
21395
  });
21400
21396
  if (loader?.awaitingCompact) {
21401
21397
  console.log("missing?", head.toString());
@@ -21504,9 +21500,10 @@ You can use close({ resize: true }) to resize header`);
21504
21500
  }
21505
21501
  async changes(since = [], opts = {}) {
21506
21502
  const { result, head } = await this._crdt.changes(since, opts);
21507
- const rows = result.map(({ key, value, del: del2 }) => ({
21503
+ const rows = result.map(({ key, value, del: del2, clock }) => ({
21508
21504
  key,
21509
- value: del2 ? { _id: key, _deleted: true } : { _id: key, ...value }
21505
+ value: del2 ? { _id: key, _deleted: true } : { _id: key, ...value },
21506
+ clock
21510
21507
  }));
21511
21508
  return { rows, clock: head };
21512
21509
  }