@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.
- package/dist/browser/fireproof.cjs +13 -16
- package/dist/browser/fireproof.cjs.map +3 -3
- package/dist/browser/fireproof.esm.js +13 -16
- package/dist/browser/fireproof.esm.js.map +3 -3
- package/dist/browser/fireproof.iife.js +13 -16
- package/dist/browser/fireproof.iife.js.map +3 -3
- package/dist/node/fireproof.cjs +9873 -456
- package/dist/node/fireproof.cjs.map +4 -4
- package/dist/node/fireproof.esm.js +9882 -457
- package/dist/node/fireproof.esm.js.map +4 -4
- package/dist/types/types.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
@@ -11583,7 +11583,7 @@ replaceTraps((oldTraps) => ({
|
|
11583
11583
|
}));
|
11584
11584
|
|
11585
11585
|
// src/version.ts
|
11586
|
-
var PACKAGE_VERSION = "0.14.
|
11586
|
+
var PACKAGE_VERSION = "0.14.2";
|
11587
11587
|
|
11588
11588
|
// src/store.ts
|
11589
11589
|
var match = PACKAGE_VERSION.match(/^([^.]*\.[^.]*)/);
|
@@ -18065,7 +18065,7 @@ var import_err_code7 = __toESM(require_err_code(), 1);
|
|
18065
18065
|
// ../../node_modules/.pnpm/ipfs-unixfs@11.0.2/node_modules/ipfs-unixfs/dist/src/index.js
|
18066
18066
|
var import_err_code5 = __toESM(require_err_code(), 1);
|
18067
18067
|
|
18068
|
-
// ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/utils.js
|
18068
|
+
// ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/utils.js
|
18069
18069
|
var import_reader3 = __toESM(require_reader(), 1);
|
18070
18070
|
var import_reader_buffer = __toESM(require_reader_buffer(), 1);
|
18071
18071
|
var import_minimal2 = __toESM(require_minimal(), 1);
|
@@ -18115,13 +18115,13 @@ function writer() {
|
|
18115
18115
|
return patchWriter(import_writer2.default.create());
|
18116
18116
|
}
|
18117
18117
|
|
18118
|
-
// ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/decode.js
|
18118
|
+
// ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/decode.js
|
18119
18119
|
function decodeMessage(buf3, codec) {
|
18120
18120
|
const r = reader(buf3 instanceof Uint8Array ? buf3 : buf3.subarray());
|
18121
18121
|
return codec.decode(r);
|
18122
18122
|
}
|
18123
18123
|
|
18124
|
-
// ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/encode.js
|
18124
|
+
// ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/encode.js
|
18125
18125
|
function encodeMessage(message2, codec) {
|
18126
18126
|
const w = writer();
|
18127
18127
|
codec.encode(message2, w, {
|
@@ -18130,7 +18130,7 @@ function encodeMessage(message2, codec) {
|
|
18130
18130
|
return w.finish();
|
18131
18131
|
}
|
18132
18132
|
|
18133
|
-
// ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/codec.js
|
18133
|
+
// ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/codec.js
|
18134
18134
|
var CODEC_TYPES;
|
18135
18135
|
(function(CODEC_TYPES2) {
|
18136
18136
|
CODEC_TYPES2[CODEC_TYPES2["VARINT"] = 0] = "VARINT";
|
@@ -18149,7 +18149,7 @@ function createCodec(name8, type2, encode19, decode21) {
|
|
18149
18149
|
};
|
18150
18150
|
}
|
18151
18151
|
|
18152
|
-
// ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/codecs/enum.js
|
18152
|
+
// ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/codecs/enum.js
|
18153
18153
|
function enumeration(v) {
|
18154
18154
|
function findValue(val) {
|
18155
18155
|
if (v[val.toString()] == null) {
|
@@ -18168,7 +18168,7 @@ function enumeration(v) {
|
|
18168
18168
|
return createCodec("enum", CODEC_TYPES.VARINT, encode19, decode21);
|
18169
18169
|
}
|
18170
18170
|
|
18171
|
-
// ../../node_modules/.pnpm/protons-runtime@5.0.2/node_modules/protons-runtime/dist/src/codecs/message.js
|
18171
|
+
// ../../node_modules/.pnpm/protons-runtime@5.0.2_uint8arraylist@2.4.3/node_modules/protons-runtime/dist/src/codecs/message.js
|
18172
18172
|
function message(encode19, decode21) {
|
18173
18173
|
return createCodec("message", CODEC_TYPES.LENGTH_DELIMITED, encode19, decode21);
|
18174
18174
|
}
|
@@ -20786,11 +20786,9 @@ async function processFileset(blocks, files, publicFiles = false) {
|
|
20786
20786
|
const dbBlockstore = blocks.parent;
|
20787
20787
|
const t = new Transaction(dbBlockstore);
|
20788
20788
|
const didPut = [];
|
20789
|
-
let totalSize = 0;
|
20790
20789
|
for (const filename in files) {
|
20791
20790
|
if (File === files[filename].constructor) {
|
20792
20791
|
const file = files[filename];
|
20793
|
-
totalSize += file.size;
|
20794
20792
|
const { cid, blocks: fileBlocks } = await encodeFile2(file);
|
20795
20793
|
didPut.push(filename);
|
20796
20794
|
for (const block of fileBlocks) {
|
@@ -20799,8 +20797,6 @@ async function processFileset(blocks, files, publicFiles = false) {
|
|
20799
20797
|
files[filename] = { cid, type: file.type, size: file.size };
|
20800
20798
|
}
|
20801
20799
|
}
|
20802
|
-
if (totalSize > 1024 * 1024 * 1)
|
20803
|
-
throw new Error("Sync limit for files in a single update is 1MB");
|
20804
20800
|
if (didPut.length) {
|
20805
20801
|
const car = await dbBlockstore.loader?.commit(t, { files }, { public: publicFiles });
|
20806
20802
|
if (car) {
|
@@ -20900,7 +20896,7 @@ async function gatherUpdates(blocks, eventsFetcher, head, since, updates = [], k
|
|
20900
20896
|
} else {
|
20901
20897
|
keys2.add(key);
|
20902
20898
|
const docValue = await getValueFromLink(blocks, value);
|
20903
|
-
updates.push({ key, value: docValue.doc, del: docValue.del });
|
20899
|
+
updates.push({ key, value: docValue.doc, del: docValue.del, clock: link2 });
|
20904
20900
|
limit--;
|
20905
20901
|
if (event.parents) {
|
20906
20902
|
updates = await gatherUpdates(blocks, eventsFetcher, event.parents, since, updates, keys2, didLinks, limit);
|
@@ -21371,9 +21367,9 @@ var CRDT = class {
|
|
21371
21367
|
}
|
21372
21368
|
const got = await this.blocks.transaction(async (tblocks) => {
|
21373
21369
|
const { head } = await applyBulkUpdateToCrdt(tblocks, this.clock.head, updates, options);
|
21374
|
-
updates = updates.map(({ key, value, del: del2 }) => {
|
21370
|
+
updates = updates.map(({ key, value, del: del2, clock }) => {
|
21375
21371
|
readFiles(this.blocks, { doc: value });
|
21376
|
-
return { key, value, del: del2 };
|
21372
|
+
return { key, value, del: del2, clock };
|
21377
21373
|
});
|
21378
21374
|
if (loader?.awaitingCompact) {
|
21379
21375
|
console.log("missing?", head.toString());
|
@@ -21482,9 +21478,10 @@ var Database = class {
|
|
21482
21478
|
}
|
21483
21479
|
async changes(since = [], opts = {}) {
|
21484
21480
|
const { result, head } = await this._crdt.changes(since, opts);
|
21485
|
-
const rows = result.map(({ key, value, del: del2 }) => ({
|
21481
|
+
const rows = result.map(({ key, value, del: del2, clock }) => ({
|
21486
21482
|
key,
|
21487
|
-
value: del2 ? { _id: key, _deleted: true } : { _id: key, ...value }
|
21483
|
+
value: del2 ? { _id: key, _deleted: true } : { _id: key, ...value },
|
21484
|
+
clock
|
21488
21485
|
}));
|
21489
21486
|
return { rows, clock: head };
|
21490
21487
|
}
|