@instantdb/core 0.22.72 → 0.22.73-experimental.fix-use-dates.19693183377.1
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/dist/commonjs/Reactor.d.ts.map +1 -1
- package/dist/commonjs/SyncTable.d.ts +10 -10
- package/dist/commonjs/SyncTable.d.ts.map +1 -1
- package/dist/commonjs/SyncTable.js.map +1 -1
- package/dist/commonjs/index.d.ts +10 -8
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +8 -6
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/queryTypes.d.ts +4 -4
- package/dist/commonjs/queryTypes.d.ts.map +1 -1
- package/dist/commonjs/queryTypes.js.map +1 -1
- package/dist/commonjs/schemaTypes.d.ts +2 -2
- package/dist/commonjs/schemaTypes.d.ts.map +1 -1
- package/dist/commonjs/schemaTypes.js.map +1 -1
- package/dist/esm/Reactor.d.ts.map +1 -1
- package/dist/esm/SyncTable.d.ts +10 -10
- package/dist/esm/SyncTable.d.ts.map +1 -1
- package/dist/esm/SyncTable.js.map +1 -1
- package/dist/esm/index.d.ts +10 -8
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +8 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/queryTypes.d.ts +4 -4
- package/dist/esm/queryTypes.d.ts.map +1 -1
- package/dist/esm/queryTypes.js.map +1 -1
- package/dist/esm/schemaTypes.d.ts +2 -2
- package/dist/esm/schemaTypes.d.ts.map +1 -1
- package/dist/esm/schemaTypes.js.map +1 -1
- package/dist/standalone/index.js +79 -76
- package/dist/standalone/index.umd.cjs +2 -2
- package/package.json +2 -2
- package/src/SyncTable.ts +10 -10
- package/src/index.ts +23 -21
- package/src/queryTypes.ts +4 -4
- package/src/schemaTypes.ts +2 -2
package/dist/standalone/index.js
CHANGED
|
@@ -114,7 +114,7 @@ function Q(t, e) {
|
|
|
114
114
|
function pe(t, e, n) {
|
|
115
115
|
Z(t) === 2 ? t.set(e, n) : t[e] = n;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function xe(t, e) {
|
|
118
118
|
const n = S(t);
|
|
119
119
|
return (n ? U(n) : t)[e];
|
|
120
120
|
}
|
|
@@ -678,7 +678,7 @@ const ir = Reflect.ownKeys(Ae), an = /* @__PURE__ */ new WeakSet(), cn = {
|
|
|
678
678
|
const c = a[e];
|
|
679
679
|
if (t.options.strict && ve(c, t.options), t.finalized || !K(c, t.options))
|
|
680
680
|
return c;
|
|
681
|
-
if (c ===
|
|
681
|
+
if (c === xe(t.original, e)) {
|
|
682
682
|
if (j(t), t.copy[e] = ft({
|
|
683
683
|
original: t.original[e],
|
|
684
684
|
parentDraft: t,
|
|
@@ -703,7 +703,7 @@ const ir = Reflect.ownKeys(Ae), an = /* @__PURE__ */ new WeakSet(), cn = {
|
|
|
703
703
|
const i = St(U(t), e);
|
|
704
704
|
if (i != null && i.set)
|
|
705
705
|
return i.set.call(t.proxy, n), !0;
|
|
706
|
-
const o =
|
|
706
|
+
const o = xe(U(t), e), a = S(o);
|
|
707
707
|
return a && W(a.original, n) ? (t.copy[e] = n, t.assignedMap = (r = t.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (W(n, o) && (n !== void 0 || ue(t.original, e)) || (j(t), z(t), ue(t.original, e) && W(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, lt(t, e, n, de)), !0);
|
|
708
708
|
},
|
|
709
709
|
has(t, e) {
|
|
@@ -732,7 +732,7 @@ const ir = Reflect.ownKeys(Ae), an = /* @__PURE__ */ new WeakSet(), cn = {
|
|
|
732
732
|
},
|
|
733
733
|
deleteProperty(t, e) {
|
|
734
734
|
var n;
|
|
735
|
-
return t.type === 1 ? cn.set.call(this, t, e, void 0, t.proxy) : (
|
|
735
|
+
return t.type === 1 ? cn.set.call(this, t, e, void 0, t.proxy) : (xe(t.original, e) !== void 0 || e in t.original ? (j(t), z(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
|
|
736
736
|
}
|
|
737
737
|
};
|
|
738
738
|
function ft(t) {
|
|
@@ -1398,7 +1398,7 @@ function yn(t) {
|
|
|
1398
1398
|
return {
|
|
1399
1399
|
__type: t.__type,
|
|
1400
1400
|
attrs: t.attrs,
|
|
1401
|
-
triples:
|
|
1401
|
+
triples: x(t.eav, 3),
|
|
1402
1402
|
cardinalityInference: t.cardinalityInference,
|
|
1403
1403
|
linkIndex: t.linkIndex,
|
|
1404
1404
|
useDateObjects: t.useDateObjects
|
|
@@ -1430,7 +1430,7 @@ function ye(t, e) {
|
|
|
1430
1430
|
const [o, a] = e[0], c = t.aev.get(o);
|
|
1431
1431
|
if (!c)
|
|
1432
1432
|
return null;
|
|
1433
|
-
n = (s =
|
|
1433
|
+
n = (s = x(c, 2).find((l) => l[2] === a)) == null ? void 0 : s[0];
|
|
1434
1434
|
} else
|
|
1435
1435
|
n = e[0];
|
|
1436
1436
|
if (!n)
|
|
@@ -1440,7 +1440,7 @@ function ye(t, e) {
|
|
|
1440
1440
|
const [o, a] = r, c = t.aev.get(o);
|
|
1441
1441
|
if (!c)
|
|
1442
1442
|
return null;
|
|
1443
|
-
const l = (i =
|
|
1443
|
+
const l = (i = x(c, 2).find((_) => _[2] === a)) == null ? void 0 : i[0];
|
|
1444
1444
|
if (!l)
|
|
1445
1445
|
return null;
|
|
1446
1446
|
const [f, d, h, ...p] = e;
|
|
@@ -1506,7 +1506,7 @@ function Ge(t, e) {
|
|
|
1506
1506
|
if (o) {
|
|
1507
1507
|
for (const l of o.keys()) {
|
|
1508
1508
|
const f = t.attrs[l];
|
|
1509
|
-
f && f["on-delete-reverse"] === "cascade" &&
|
|
1509
|
+
f && f["on-delete-reverse"] === "cascade" && x(o.get(l), 1).forEach(
|
|
1510
1510
|
([d, h, p]) => {
|
|
1511
1511
|
var _;
|
|
1512
1512
|
return Ge(t, [p, (_ = f["reverse-identity"]) == null ? void 0 : _[1]]);
|
|
@@ -1519,7 +1519,7 @@ function Ge(t, e) {
|
|
|
1519
1519
|
}
|
|
1520
1520
|
o.size === 0 && N(t.eav, [i]);
|
|
1521
1521
|
}
|
|
1522
|
-
const a = t.vae.get(i) &&
|
|
1522
|
+
const a = t.vae.get(i) && x(t.vae.get(i), 2);
|
|
1523
1523
|
a && a.forEach((l) => {
|
|
1524
1524
|
var _, y, b;
|
|
1525
1525
|
const [f, d, h] = l, p = t.attrs[d];
|
|
@@ -1540,7 +1540,7 @@ function Pr(t, [e]) {
|
|
|
1540
1540
|
t.attrs[e.id] = e, yt(t);
|
|
1541
1541
|
}
|
|
1542
1542
|
function mn(t) {
|
|
1543
|
-
return
|
|
1543
|
+
return x(t.eav, 3);
|
|
1544
1544
|
}
|
|
1545
1545
|
function jr(t, [e]) {
|
|
1546
1546
|
if (!t.attrs[e]) return;
|
|
@@ -1583,7 +1583,7 @@ function Dr(t, e) {
|
|
|
1583
1583
|
throw new Error(`unhandled transaction action: ${n}`);
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function x(t, e, n = []) {
|
|
1587
1587
|
if (!t || e === 0)
|
|
1588
1588
|
return n;
|
|
1589
1589
|
if (e === 1) {
|
|
@@ -1592,7 +1592,7 @@ function R(t, e, n = []) {
|
|
|
1592
1592
|
return n;
|
|
1593
1593
|
}
|
|
1594
1594
|
for (const r of t.values())
|
|
1595
|
-
|
|
1595
|
+
x(r, e - 1, n);
|
|
1596
1596
|
return n;
|
|
1597
1597
|
}
|
|
1598
1598
|
function be(t, e, n) {
|
|
@@ -1620,7 +1620,7 @@ function be(t, e, n) {
|
|
|
1620
1620
|
return r;
|
|
1621
1621
|
}
|
|
1622
1622
|
if (n != null && n.$comparator)
|
|
1623
|
-
return
|
|
1623
|
+
return x(e, 1).filter(n.$op);
|
|
1624
1624
|
const s = n.in || n.$in || [n];
|
|
1625
1625
|
for (const a of s) {
|
|
1626
1626
|
const c = e.get(a);
|
|
@@ -1628,20 +1628,20 @@ function be(t, e, n) {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
return r;
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1631
|
+
function xr(t, e, n) {
|
|
1632
1632
|
let r = "";
|
|
1633
1633
|
return t !== void 0 && (r += "e"), e !== void 0 && (r += "a"), n !== void 0 && (r += "v"), r;
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function Rr(t, [e, n, r]) {
|
|
1636
1636
|
var i, o;
|
|
1637
|
-
switch (
|
|
1637
|
+
switch (xr(e, n, r)) {
|
|
1638
1638
|
case "e": {
|
|
1639
1639
|
const a = t.eav.get(e);
|
|
1640
|
-
return
|
|
1640
|
+
return x(a, 2);
|
|
1641
1641
|
}
|
|
1642
1642
|
case "ea": {
|
|
1643
1643
|
const a = (i = t.eav.get(e)) == null ? void 0 : i.get(n);
|
|
1644
|
-
return
|
|
1644
|
+
return x(a, 1);
|
|
1645
1645
|
}
|
|
1646
1646
|
case "eav": {
|
|
1647
1647
|
const a = (o = t.eav.get(e)) == null ? void 0 : o.get(n);
|
|
@@ -1658,7 +1658,7 @@ function xr(t, [e, n, r]) {
|
|
|
1658
1658
|
}
|
|
1659
1659
|
case "a": {
|
|
1660
1660
|
const a = t.aev.get(n);
|
|
1661
|
-
return
|
|
1661
|
+
return x(a, 2);
|
|
1662
1662
|
}
|
|
1663
1663
|
case "av": {
|
|
1664
1664
|
const a = t.aev.get(n);
|
|
@@ -1677,14 +1677,14 @@ function xr(t, [e, n, r]) {
|
|
|
1677
1677
|
return a;
|
|
1678
1678
|
}
|
|
1679
1679
|
default:
|
|
1680
|
-
return
|
|
1680
|
+
return x(t.eav, 3);
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
1683
|
function Ur(t, e, n) {
|
|
1684
1684
|
var s;
|
|
1685
1685
|
const r = {};
|
|
1686
1686
|
for (const [i, o] of e.entries()) {
|
|
1687
|
-
const a = (s = t.eav.get(n)) == null ? void 0 : s.get(o.id), c =
|
|
1687
|
+
const a = (s = t.eav.get(n)) == null ? void 0 : s.get(o.id), c = x(a, 1);
|
|
1688
1688
|
for (const u of c)
|
|
1689
1689
|
r[i] = u[2];
|
|
1690
1690
|
}
|
|
@@ -1797,7 +1797,7 @@ function Hr(t, { find: e, where: n }) {
|
|
|
1797
1797
|
return Be(t, n).map((s) => bt(s, e));
|
|
1798
1798
|
}
|
|
1799
1799
|
function Jr(t, e, n) {
|
|
1800
|
-
return
|
|
1800
|
+
return Rr(t, bt(n, e));
|
|
1801
1801
|
}
|
|
1802
1802
|
const Yr = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
1803
1803
|
function te(t) {
|
|
@@ -1809,15 +1809,15 @@ for (let t = 0; t < 256; ++t)
|
|
|
1809
1809
|
function Zr(t, e = 0) {
|
|
1810
1810
|
return (E[t[e + 0]] + E[t[e + 1]] + E[t[e + 2]] + E[t[e + 3]] + "-" + E[t[e + 4]] + E[t[e + 5]] + "-" + E[t[e + 6]] + E[t[e + 7]] + "-" + E[t[e + 8]] + E[t[e + 9]] + "-" + E[t[e + 10]] + E[t[e + 11]] + E[t[e + 12]] + E[t[e + 13]] + E[t[e + 14]] + E[t[e + 15]]).toLowerCase();
|
|
1811
1811
|
}
|
|
1812
|
-
let
|
|
1812
|
+
let Re;
|
|
1813
1813
|
const Xr = new Uint8Array(16);
|
|
1814
1814
|
function es() {
|
|
1815
|
-
if (!
|
|
1815
|
+
if (!Re) {
|
|
1816
1816
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
1817
1817
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1818
|
-
|
|
1818
|
+
Re = crypto.getRandomValues.bind(crypto);
|
|
1819
1819
|
}
|
|
1820
|
-
return
|
|
1820
|
+
return Re(Xr);
|
|
1821
1821
|
}
|
|
1822
1822
|
const ts = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), It = { randomUUID: ts };
|
|
1823
1823
|
function ns(t, e, n) {
|
|
@@ -2073,7 +2073,7 @@ function ws(t) {
|
|
|
2073
2073
|
e.push(t.slice(0, n));
|
|
2074
2074
|
return e;
|
|
2075
2075
|
}
|
|
2076
|
-
function
|
|
2076
|
+
function xt(t, e, n, r, s) {
|
|
2077
2077
|
return ws(s).map(
|
|
2078
2078
|
(i) => He(t, e, n, r, i, { $isNull: !0 })
|
|
2079
2079
|
);
|
|
@@ -2088,7 +2088,7 @@ function kn(t, e, n, r, s) {
|
|
|
2088
2088
|
return [];
|
|
2089
2089
|
const a = i.split(".");
|
|
2090
2090
|
if (o != null && o.hasOwnProperty("$ne") && (o = { ...o, $not: o.$ne }, delete o.$ne), o != null && o.hasOwnProperty("$not")) {
|
|
2091
|
-
const c = He(t, e, n, r, a, o), u =
|
|
2091
|
+
const c = He(t, e, n, r, a, o), u = xt(
|
|
2092
2092
|
t,
|
|
2093
2093
|
e,
|
|
2094
2094
|
n,
|
|
@@ -2107,7 +2107,7 @@ function kn(t, e, n, r, s) {
|
|
|
2107
2107
|
return o != null && o.hasOwnProperty("$isNull") && o.$isNull === !0 && a.length > 1 ? [
|
|
2108
2108
|
{
|
|
2109
2109
|
or: {
|
|
2110
|
-
patterns:
|
|
2110
|
+
patterns: xt(
|
|
2111
2111
|
t,
|
|
2112
2112
|
e,
|
|
2113
2113
|
n,
|
|
@@ -2312,7 +2312,7 @@ function Mn({ store: t, pageInfo: e, aggregate: n }, r) {
|
|
|
2312
2312
|
}, {}) };
|
|
2313
2313
|
return e && (i.pageInfo = Ds(e)), n && (i.aggregate = n), i;
|
|
2314
2314
|
}
|
|
2315
|
-
function
|
|
2315
|
+
function xs() {
|
|
2316
2316
|
const e = {
|
|
2317
2317
|
__etype: 1,
|
|
2318
2318
|
__ops: 1,
|
|
@@ -2326,7 +2326,7 @@ function Rs() {
|
|
|
2326
2326
|
};
|
|
2327
2327
|
return new Set(Object.keys(e));
|
|
2328
2328
|
}
|
|
2329
|
-
const
|
|
2329
|
+
const Rs = xs();
|
|
2330
2330
|
function Ye(t, e, n) {
|
|
2331
2331
|
const r = {
|
|
2332
2332
|
__etype: t,
|
|
@@ -2336,7 +2336,7 @@ function Ye(t, e, n) {
|
|
|
2336
2336
|
get: (s, i) => {
|
|
2337
2337
|
if (i === "__ops") return n;
|
|
2338
2338
|
if (i === "__etype") return t;
|
|
2339
|
-
if (
|
|
2339
|
+
if (Rs.has(i))
|
|
2340
2340
|
return (o, a) => Ye(t, e, [
|
|
2341
2341
|
...n,
|
|
2342
2342
|
a ? [i, t, e, o, a] : [i, t, e, o]
|
|
@@ -2378,7 +2378,7 @@ function Pn() {
|
|
|
2378
2378
|
}
|
|
2379
2379
|
);
|
|
2380
2380
|
}
|
|
2381
|
-
const
|
|
2381
|
+
const xo = Pn();
|
|
2382
2382
|
function Ls(t) {
|
|
2383
2383
|
return t.__ops;
|
|
2384
2384
|
}
|
|
@@ -2447,7 +2447,7 @@ function Ks(t, e, n) {
|
|
|
2447
2447
|
function et(t) {
|
|
2448
2448
|
return typeof t == "string" && !Ce(t) ? null : typeof t == "string" && Ce(t) ? In(t) : Ns(t);
|
|
2449
2449
|
}
|
|
2450
|
-
function
|
|
2450
|
+
function R(t, e, n) {
|
|
2451
2451
|
const r = et(n);
|
|
2452
2452
|
if (r === null)
|
|
2453
2453
|
return n;
|
|
@@ -2457,7 +2457,7 @@ function x(t, e, n) {
|
|
|
2457
2457
|
return [o.id, i];
|
|
2458
2458
|
}
|
|
2459
2459
|
function jn(t, e, n, r) {
|
|
2460
|
-
const s =
|
|
2460
|
+
const s = R(t, e, n);
|
|
2461
2461
|
return Array.isArray(s) ? [[
|
|
2462
2462
|
"add-triple",
|
|
2463
2463
|
s,
|
|
@@ -2470,14 +2470,14 @@ function qs({ attrs: t }, [e, n, r]) {
|
|
|
2470
2470
|
const a = Array.isArray(o) ? o : [o], c = C(t, e, i), u = J(t, e, i);
|
|
2471
2471
|
return a.map((l) => c ? [
|
|
2472
2472
|
"add-triple",
|
|
2473
|
-
|
|
2473
|
+
R(t, e, n),
|
|
2474
2474
|
c.id,
|
|
2475
|
-
|
|
2475
|
+
R(t, c["reverse-identity"][1], l)
|
|
2476
2476
|
] : [
|
|
2477
2477
|
"add-triple",
|
|
2478
|
-
|
|
2478
|
+
R(t, u["forward-identity"][1], l),
|
|
2479
2479
|
u.id,
|
|
2480
|
-
|
|
2480
|
+
R(t, e, n)
|
|
2481
2481
|
]);
|
|
2482
2482
|
});
|
|
2483
2483
|
return jn(t, e, n, s);
|
|
@@ -2487,14 +2487,14 @@ function zs({ attrs: t }, [e, n, r]) {
|
|
|
2487
2487
|
const a = Array.isArray(o) ? o : [o], c = C(t, e, i), u = J(t, e, i);
|
|
2488
2488
|
return a.map((l) => c ? [
|
|
2489
2489
|
"retract-triple",
|
|
2490
|
-
|
|
2490
|
+
R(t, e, n),
|
|
2491
2491
|
c.id,
|
|
2492
|
-
|
|
2492
|
+
R(t, c["reverse-identity"][1], l)
|
|
2493
2493
|
] : [
|
|
2494
2494
|
"retract-triple",
|
|
2495
|
-
|
|
2495
|
+
R(t, u["forward-identity"][1], l),
|
|
2496
2496
|
u.id,
|
|
2497
|
-
|
|
2497
|
+
R(t, e, n)
|
|
2498
2498
|
]);
|
|
2499
2499
|
});
|
|
2500
2500
|
return jn(t, e, n, s);
|
|
@@ -2505,7 +2505,7 @@ function Vs(t, e, n) {
|
|
|
2505
2505
|
for (const i of t || []) {
|
|
2506
2506
|
const o = i == null ? void 0 : i.aev.get(r);
|
|
2507
2507
|
if (o) {
|
|
2508
|
-
for (const [a, c, u] of
|
|
2508
|
+
for (const [a, c, u] of x(o, 2))
|
|
2509
2509
|
if (u === s)
|
|
2510
2510
|
return !0;
|
|
2511
2511
|
}
|
|
@@ -2525,14 +2525,14 @@ function $n({ stores: t, attrs: e }, [n, r, s, i]) {
|
|
|
2525
2525
|
return (i == null ? void 0 : i.upsert) === !1 ? { mode: "update" } : (i == null ? void 0 : i.upsert) === !0 ? null : Vs(t, n, r) ? { mode: "update" } : null;
|
|
2526
2526
|
}
|
|
2527
2527
|
function Ws(t, e) {
|
|
2528
|
-
const { attrs: n } = t, [r, s, i, o] = e, a = dt(i), c =
|
|
2528
|
+
const { attrs: n } = t, [r, s, i, o] = e, a = dt(i), c = R(n, r, s);
|
|
2529
2529
|
return [["id", c]].concat(Object.entries(a)).map(([l, f]) => {
|
|
2530
2530
|
const d = C(n, r, l);
|
|
2531
2531
|
return d["checked-data-type"] === "date" && t.useDateObjects && (f = Me(f)), ["add-triple", c, d.id, f, { mode: "create" }];
|
|
2532
2532
|
});
|
|
2533
2533
|
}
|
|
2534
2534
|
function Qs(t, e) {
|
|
2535
|
-
const { attrs: n } = t, [r, s, i, o] = e, a = dt(i), c =
|
|
2535
|
+
const { attrs: n } = t, [r, s, i, o] = e, a = dt(i), c = R(n, r, s), u = $n(t, [r, c, i, o]);
|
|
2536
2536
|
return [["id", c]].concat(Object.entries(a)).map(([f, d]) => {
|
|
2537
2537
|
const h = C(n, r, f);
|
|
2538
2538
|
return h["checked-data-type"] === "date" && t.useDateObjects && (d = Me(d)), [
|
|
@@ -2545,10 +2545,10 @@ function Qs(t, e) {
|
|
|
2545
2545
|
});
|
|
2546
2546
|
}
|
|
2547
2547
|
function Gs({ attrs: t }, [e, n]) {
|
|
2548
|
-
return [["delete-entity",
|
|
2548
|
+
return [["delete-entity", R(t, e, n), e]];
|
|
2549
2549
|
}
|
|
2550
2550
|
function Bs(t, e) {
|
|
2551
|
-
const { attrs: n } = t, [r, s, i, o] = e, a = dt(i), c =
|
|
2551
|
+
const { attrs: n } = t, [r, s, i, o] = e, a = dt(i), c = R(n, r, s), u = $n(t, [r, c, i, o]), l = Object.entries(a).map(([d, h]) => {
|
|
2552
2552
|
const p = C(n, r, d);
|
|
2553
2553
|
return [
|
|
2554
2554
|
"deep-merge-triple",
|
|
@@ -2567,7 +2567,7 @@ function Bs(t, e) {
|
|
|
2567
2567
|
]].concat(l);
|
|
2568
2568
|
}
|
|
2569
2569
|
function Hs({ attrs: t }, [e, n, r]) {
|
|
2570
|
-
return [["rule-params",
|
|
2570
|
+
return [["rule-params", R(t, e, n), e, r]];
|
|
2571
2571
|
}
|
|
2572
2572
|
function Js(t) {
|
|
2573
2573
|
const [e, n, r, s, i] = t;
|
|
@@ -2652,7 +2652,7 @@ function ti(t, e, n) {
|
|
|
2652
2652
|
"on-delete-reverse": i.onDelete
|
|
2653
2653
|
};
|
|
2654
2654
|
}
|
|
2655
|
-
function
|
|
2655
|
+
function Rt(t, e, n, r) {
|
|
2656
2656
|
const s = t ? ti(t, e, n) : null, i = k(), o = [k(), e, n], a = [k(), n, e];
|
|
2657
2657
|
return {
|
|
2658
2658
|
id: i,
|
|
@@ -2706,7 +2706,7 @@ function ci({ attrs: t, schema: e }, n) {
|
|
|
2706
2706
|
}
|
|
2707
2707
|
function c(f, d) {
|
|
2708
2708
|
const h = C(s, f, d), p = J(s, f, d);
|
|
2709
|
-
a(h), a(p), !h && !p && o(
|
|
2709
|
+
a(h), a(p), !h && !p && o(Rt(e, f, d, oi));
|
|
2710
2710
|
}
|
|
2711
2711
|
for (const f of n)
|
|
2712
2712
|
for (const { etype: d, lookupPair: h, linkLabel: p } of ai(f)) {
|
|
@@ -2747,7 +2747,7 @@ function ci({ attrs: t, schema: e }, n) {
|
|
|
2747
2747
|
)
|
|
2748
2748
|
)), ri.has(d)) {
|
|
2749
2749
|
const T = J(s, h, b);
|
|
2750
|
-
!g && !T && o(
|
|
2750
|
+
!g && !T && o(Rt(e, h, b)), a(T);
|
|
2751
2751
|
}
|
|
2752
2752
|
}
|
|
2753
2753
|
}
|
|
@@ -3197,7 +3197,7 @@ class Dn extends li {
|
|
|
3197
3197
|
});
|
|
3198
3198
|
}
|
|
3199
3199
|
}
|
|
3200
|
-
class
|
|
3200
|
+
class xn {
|
|
3201
3201
|
static async getIsOnline() {
|
|
3202
3202
|
return navigator.onLine;
|
|
3203
3203
|
}
|
|
@@ -3435,8 +3435,8 @@ async function Ei({
|
|
|
3435
3435
|
);
|
|
3436
3436
|
return s;
|
|
3437
3437
|
}
|
|
3438
|
-
let _t = !1,
|
|
3439
|
-
typeof window < "u" && typeof window.localStorage < "u" && (_t = !!window.localStorage.getItem("devBackend"),
|
|
3438
|
+
let _t = !1, Rn = !1, Un = !1;
|
|
3439
|
+
typeof window < "u" && typeof window.localStorage < "u" && (_t = !!window.localStorage.getItem("devBackend"), Rn = !!window.localStorage.getItem("__instantLogging"), Un = !!window.localStorage.getItem("__devtoolLocalDash"));
|
|
3440
3440
|
function Kt(t, e) {
|
|
3441
3441
|
if (!e) return t;
|
|
3442
3442
|
const n = {};
|
|
@@ -3510,7 +3510,7 @@ function Vt(t) {
|
|
|
3510
3510
|
}, e;
|
|
3511
3511
|
}, {});
|
|
3512
3512
|
}
|
|
3513
|
-
const Fn = "v0.22.
|
|
3513
|
+
const Fn = "v0.22.73-experimental.fix-use-dates.19693183377.1";
|
|
3514
3514
|
function Ii(t, e) {
|
|
3515
3515
|
return {
|
|
3516
3516
|
info: t ? (...n) => console.info(...n, e()) : () => {
|
|
@@ -3968,7 +3968,7 @@ class F extends Error {
|
|
|
3968
3968
|
super(e), this.name = "TransactionValidationError";
|
|
3969
3969
|
}
|
|
3970
3970
|
}
|
|
3971
|
-
const zn = (t) => t.length > 0 ? t.join(", ") : "none",
|
|
3971
|
+
const zn = (t) => t.length > 0 ? t.join(", ") : "none", xi = (t, e) => new F(
|
|
3972
3972
|
`Entity '${t}' does not exist in schema. Available entities: ${zn(e)}`
|
|
3973
3973
|
), Ue = {
|
|
3974
3974
|
string: (t) => typeof t == "string",
|
|
@@ -3976,13 +3976,13 @@ const zn = (t) => t.length > 0 ? t.join(", ") : "none", Ri = (t, e) => new F(
|
|
|
3976
3976
|
boolean: (t) => typeof t == "boolean",
|
|
3977
3977
|
date: (t) => t instanceof Date || typeof t == "string" || typeof t == "number",
|
|
3978
3978
|
json: () => !0
|
|
3979
|
-
},
|
|
3979
|
+
}, Ri = (t, e) => {
|
|
3980
3980
|
var n;
|
|
3981
3981
|
return t == null ? !0 : ((n = Ue[e.valueType]) == null ? void 0 : n.call(Ue, t)) ?? !1;
|
|
3982
3982
|
}, Vn = (t, e) => {
|
|
3983
3983
|
const n = e.entities[t];
|
|
3984
3984
|
if (!n)
|
|
3985
|
-
throw
|
|
3985
|
+
throw xi(t, Object.keys(e.entities));
|
|
3986
3986
|
return n;
|
|
3987
3987
|
}, Le = (t, e, n) => {
|
|
3988
3988
|
const r = Vn(t, n);
|
|
@@ -3993,7 +3993,7 @@ const zn = (t) => t.length > 0 ? t.join(", ") : "none", Ri = (t, e) => new F(
|
|
|
3993
3993
|
for (const [s, i] of Object.entries(e)) {
|
|
3994
3994
|
if (s === "id") continue;
|
|
3995
3995
|
const o = r.attrs[s];
|
|
3996
|
-
if (o && !
|
|
3996
|
+
if (o && !Ri(i, o))
|
|
3997
3997
|
throw new F(
|
|
3998
3998
|
`Invalid value for attribute '${s}' in entity '${t}'. Expected ${o.valueType}, but received: ${typeof i}`
|
|
3999
3999
|
);
|
|
@@ -4671,7 +4671,7 @@ function Xt(t) {
|
|
|
4671
4671
|
});
|
|
4672
4672
|
}
|
|
4673
4673
|
class oo {
|
|
4674
|
-
constructor(e, n = Dn, r =
|
|
4674
|
+
constructor(e, n = Dn, r = xn, s, i) {
|
|
4675
4675
|
w(this, "attrs");
|
|
4676
4676
|
w(this, "_isOnline", !0);
|
|
4677
4677
|
w(this, "_isShutdown", !1);
|
|
@@ -4900,7 +4900,7 @@ class oo {
|
|
|
4900
4900
|
), this._scheduleReconnect();
|
|
4901
4901
|
});
|
|
4902
4902
|
if (this._EventSource = i, this.config = { ...Zi, ...e }, this.queryCacheLimit = this.config.queryCacheLimit ?? 10, this._pendingTxCleanupTimeout = this.config.pendingTxCleanupTimeout ?? Ji, this._pendingMutationCleanupThreshold = this.config.pendingMutationCleanupThreshold ?? Yi, this._log = Ii(
|
|
4903
|
-
e.verbose || _t ||
|
|
4903
|
+
e.verbose || _t || Rn,
|
|
4904
4904
|
() => this._reactorStats()
|
|
4905
4905
|
), this.versions = { ...s || {}, "@instantdb/core": Fn }, this.config.schema && (this._linkIndex = Vt(this.config.schema)), !!eo()) {
|
|
4906
4906
|
if (!e.appId)
|
|
@@ -6141,7 +6141,7 @@ function bo({
|
|
|
6141
6141
|
s
|
|
6142
6142
|
);
|
|
6143
6143
|
}
|
|
6144
|
-
const
|
|
6144
|
+
const Ro = {
|
|
6145
6145
|
// constructs
|
|
6146
6146
|
graph: ao,
|
|
6147
6147
|
schema: bo,
|
|
@@ -6474,23 +6474,26 @@ function Io(t, e) {
|
|
|
6474
6474
|
return tn(t._reactor.config.schema) !== tn(e);
|
|
6475
6475
|
}
|
|
6476
6476
|
function Po(t, e, n, r, s) {
|
|
6477
|
-
const i =
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6477
|
+
const i = {
|
|
6478
|
+
...t,
|
|
6479
|
+
useDateObjects: t.useDateObjects ?? !1
|
|
6480
|
+
}, o = st[rt(i)];
|
|
6481
|
+
if (o)
|
|
6482
|
+
return Io(o, i.schema) && o._reactor.updateSchema(i.schema), o;
|
|
6483
|
+
const a = new oo(
|
|
6481
6484
|
{
|
|
6482
6485
|
...vo,
|
|
6483
|
-
...
|
|
6484
|
-
cardinalityInference: !!
|
|
6486
|
+
...i,
|
|
6487
|
+
cardinalityInference: !!i.schema
|
|
6485
6488
|
},
|
|
6486
6489
|
e || Dn,
|
|
6487
|
-
n ||
|
|
6490
|
+
n || xn,
|
|
6488
6491
|
{ ...r || {}, "@instantdb/core": Fn },
|
|
6489
6492
|
s
|
|
6490
|
-
),
|
|
6491
|
-
|
|
6493
|
+
), c = new Mo(
|
|
6494
|
+
a
|
|
6492
6495
|
);
|
|
6493
|
-
return st[rt(
|
|
6496
|
+
return st[rt(i)] = c, jo(i.appId, i.devtool), c;
|
|
6494
6497
|
}
|
|
6495
6498
|
function jo(t, e) {
|
|
6496
6499
|
if (typeof window > "u" || typeof window.location > "u" || typeof document > "u" || typeof e == "boolean" && !e)
|
|
@@ -6514,16 +6517,16 @@ export {
|
|
|
6514
6517
|
li as StorageInterface,
|
|
6515
6518
|
Gi as SyncTableCallbackEventType,
|
|
6516
6519
|
F as TransactionValidationError,
|
|
6517
|
-
|
|
6520
|
+
xn as WindowNetworkListener,
|
|
6518
6521
|
Uo as coerceQuery,
|
|
6519
6522
|
Me as coerceToDate,
|
|
6520
6523
|
Ls as getOps,
|
|
6521
|
-
|
|
6524
|
+
Ro as i,
|
|
6522
6525
|
k as id,
|
|
6523
6526
|
Po as init,
|
|
6524
6527
|
Lo as init_experimental,
|
|
6525
6528
|
Do as lookup,
|
|
6526
|
-
|
|
6529
|
+
xo as tx,
|
|
6527
6530
|
Pn as txInit,
|
|
6528
6531
|
Qt as validateQuery,
|
|
6529
6532
|
Fi as validateTransactions,
|