@pol-studios/db 1.0.59 → 1.0.61
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/{chunk-K46TGKB2.js → chunk-7PBTPCRN.js} +86 -76
- package/dist/chunk-7PBTPCRN.js.map +1 -0
- package/dist/{chunk-VADZSRHY.js → chunk-FWCHS5NN.js} +2 -2
- package/dist/{chunk-VSY6766U.js → chunk-H4Z73DC4.js} +2 -2
- package/dist/{chunk-7BGDQT5X.js → chunk-PIPB3JMK.js} +1 -7
- package/dist/{chunk-7BGDQT5X.js.map → chunk-PIPB3JMK.js.map} +1 -1
- package/dist/{chunk-WY6MNB6K.js → chunk-ZPFZ2ZRW.js} +3 -12
- package/dist/{chunk-WY6MNB6K.js.map → chunk-ZPFZ2ZRW.js.map} +1 -1
- package/dist/core/index.d.ts +7 -43
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +5 -5
- package/dist/index.native.js +4 -4
- package/dist/index.web.js +3 -10
- package/dist/index.web.js.map +1 -1
- package/dist/powersync-bridge/index.js +1 -1
- package/dist/with-auth/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-K46TGKB2.js.map +0 -1
- /package/dist/{chunk-VADZSRHY.js.map → chunk-FWCHS5NN.js.map} +0 -0
- /package/dist/{chunk-VSY6766U.js.map → chunk-H4Z73DC4.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createSupabaseAdapter,
|
|
4
4
|
getPowerSyncAlias,
|
|
5
5
|
stripSchemaPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FWCHS5NN.js";
|
|
7
7
|
import {
|
|
8
8
|
DataLayerContext,
|
|
9
9
|
DataLayerCoreContext,
|
|
@@ -1418,20 +1418,13 @@ var defaultSyncControl = {
|
|
|
1418
1418
|
setScope: async () => {
|
|
1419
1419
|
console.warn("Scope control not available: PowerSync not initialized");
|
|
1420
1420
|
},
|
|
1421
|
-
pauseAutoRetry: () => {
|
|
1422
|
-
console.warn("Pause auto-retry not available: PowerSync not initialized");
|
|
1423
|
-
},
|
|
1424
|
-
resumeAutoRetry: () => {
|
|
1425
|
-
console.warn("Resume auto-retry not available: PowerSync not initialized");
|
|
1426
|
-
},
|
|
1427
|
-
isAutoRetryPaused: false,
|
|
1428
1421
|
addPendingMutation: () => {
|
|
1429
1422
|
},
|
|
1430
1423
|
removePendingMutation: () => {
|
|
1431
1424
|
}
|
|
1432
1425
|
};
|
|
1433
1426
|
function DataLayerProvider(t0) {
|
|
1434
|
-
const $ = _c(
|
|
1427
|
+
const $ = _c(70);
|
|
1435
1428
|
const {
|
|
1436
1429
|
config,
|
|
1437
1430
|
children,
|
|
@@ -1562,7 +1555,7 @@ function DataLayerProvider(t0) {
|
|
|
1562
1555
|
}
|
|
1563
1556
|
const getPowerSyncTables = t9;
|
|
1564
1557
|
let t10;
|
|
1565
|
-
if ($[24] !== adapters.powerSync || $[25] !== adapters.supabase || $[26] !== adapters.syncTracking || $[27] !== config.tables) {
|
|
1558
|
+
if ($[24] !== adapters.powerSync || $[25] !== adapters.supabase || $[26] !== adapters.syncTracking || $[27] !== config.tables || $[28] !== hasSynced || $[29] !== isOnline) {
|
|
1566
1559
|
t10 = (table_2, t112) => {
|
|
1567
1560
|
t112 === void 0 ? "read" : t112;
|
|
1568
1561
|
const tableWithoutSchema_1 = table_2.includes(".") ? stripSchemaPrefix(table_2) : table_2;
|
|
@@ -1570,18 +1563,33 @@ function DataLayerProvider(t0) {
|
|
|
1570
1563
|
if (strategy_3?.strategy === "supabase") {
|
|
1571
1564
|
return adapters.supabase;
|
|
1572
1565
|
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1566
|
+
if (strategy_3?.strategy === "cached") {
|
|
1567
|
+
return adapters.supabase;
|
|
1568
|
+
}
|
|
1569
|
+
if (strategy_3?.strategy === "powersync") {
|
|
1570
|
+
if (adapters.powerSync) {
|
|
1571
|
+
return adapters.syncTracking ?? adapters.powerSync;
|
|
1572
|
+
}
|
|
1573
|
+
return adapters.supabase;
|
|
1574
|
+
}
|
|
1575
|
+
const isAutoTable = !strategy_3 || strategy_3.strategy === "auto" || strategy_3.strategy === "hybrid";
|
|
1576
|
+
if (isAutoTable) {
|
|
1575
1577
|
const powerSyncTableKeys = Object.keys(config.tables).filter((key_0) => {
|
|
1576
1578
|
const s = config.tables[key_0];
|
|
1577
1579
|
return s.strategy === "powersync" || s.strategy === "hybrid" || s.strategy === "auto";
|
|
1578
1580
|
});
|
|
1579
1581
|
const isConfigured = powerSyncTableKeys.some((key_1) => key_1 === table_2 || key_1 === tableWithoutSchema_1 || key_1.includes(".") && key_1.split(".")[1] === tableWithoutSchema_1);
|
|
1580
|
-
if (isConfigured) {
|
|
1581
|
-
|
|
1582
|
+
if (!isConfigured) {
|
|
1583
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
1584
|
+
console.warn(`[DataLayerProvider] Table "${table_2}" is not configured for PowerSync. Using Supabase fallback.`);
|
|
1585
|
+
}
|
|
1586
|
+
return adapters.supabase;
|
|
1582
1587
|
}
|
|
1583
|
-
if (
|
|
1584
|
-
|
|
1588
|
+
if (isOnline && !hasSynced) {
|
|
1589
|
+
return adapters.supabase;
|
|
1590
|
+
}
|
|
1591
|
+
if (adapters.powerSync) {
|
|
1592
|
+
return adapters.syncTracking ?? adapters.powerSync;
|
|
1585
1593
|
}
|
|
1586
1594
|
}
|
|
1587
1595
|
if (!adapters.supabase) {
|
|
@@ -1593,13 +1601,15 @@ function DataLayerProvider(t0) {
|
|
|
1593
1601
|
$[25] = adapters.supabase;
|
|
1594
1602
|
$[26] = adapters.syncTracking;
|
|
1595
1603
|
$[27] = config.tables;
|
|
1596
|
-
$[28] =
|
|
1604
|
+
$[28] = hasSynced;
|
|
1605
|
+
$[29] = isOnline;
|
|
1606
|
+
$[30] = t10;
|
|
1597
1607
|
} else {
|
|
1598
|
-
t10 = $[
|
|
1608
|
+
t10 = $[30];
|
|
1599
1609
|
}
|
|
1600
1610
|
const getAdapter = t10;
|
|
1601
1611
|
let t11;
|
|
1602
|
-
if ($[
|
|
1612
|
+
if ($[31] !== adapters.powerSync || $[32] !== config.tables || $[33] !== getPowerSyncTables) {
|
|
1603
1613
|
t11 = () => ({
|
|
1604
1614
|
isInitialized: true,
|
|
1605
1615
|
hasPowerSync: adapters.powerSync !== null,
|
|
@@ -1607,15 +1617,15 @@ function DataLayerProvider(t0) {
|
|
|
1607
1617
|
configuredTableCount: Object.keys(config.tables).length,
|
|
1608
1618
|
powerSyncTables: getPowerSyncTables()
|
|
1609
1619
|
});
|
|
1610
|
-
$[
|
|
1611
|
-
$[
|
|
1612
|
-
$[
|
|
1613
|
-
$[
|
|
1620
|
+
$[31] = adapters.powerSync;
|
|
1621
|
+
$[32] = config.tables;
|
|
1622
|
+
$[33] = getPowerSyncTables;
|
|
1623
|
+
$[34] = t11;
|
|
1614
1624
|
} else {
|
|
1615
|
-
t11 = $[
|
|
1625
|
+
t11 = $[34];
|
|
1616
1626
|
}
|
|
1617
1627
|
let t12;
|
|
1618
|
-
if ($[
|
|
1628
|
+
if ($[35] !== config || $[36] !== getAdapter || $[37] !== getPowerSyncTables || $[38] !== getTableAlias || $[39] !== getTableStrategy || $[40] !== t11 || $[41] !== usesPowerSync) {
|
|
1619
1629
|
t12 = {
|
|
1620
1630
|
getAdapter,
|
|
1621
1631
|
getTableStrategy,
|
|
@@ -1626,20 +1636,20 @@ function DataLayerProvider(t0) {
|
|
|
1626
1636
|
config,
|
|
1627
1637
|
isInitialized: true
|
|
1628
1638
|
};
|
|
1629
|
-
$[
|
|
1630
|
-
$[
|
|
1631
|
-
$[
|
|
1632
|
-
$[
|
|
1633
|
-
$[
|
|
1634
|
-
$[
|
|
1635
|
-
$[
|
|
1636
|
-
$[
|
|
1639
|
+
$[35] = config;
|
|
1640
|
+
$[36] = getAdapter;
|
|
1641
|
+
$[37] = getPowerSyncTables;
|
|
1642
|
+
$[38] = getTableAlias;
|
|
1643
|
+
$[39] = getTableStrategy;
|
|
1644
|
+
$[40] = t11;
|
|
1645
|
+
$[41] = usesPowerSync;
|
|
1646
|
+
$[42] = t12;
|
|
1637
1647
|
} else {
|
|
1638
|
-
t12 = $[
|
|
1648
|
+
t12 = $[42];
|
|
1639
1649
|
}
|
|
1640
1650
|
const registry = t12;
|
|
1641
1651
|
let t13;
|
|
1642
|
-
if ($[
|
|
1652
|
+
if ($[43] !== config.schema || $[44] !== getAdapter || $[45] !== powerSyncInstance || $[46] !== queryClient || $[47] !== registry || $[48] !== supabaseClient || $[49] !== syncControl) {
|
|
1643
1653
|
t13 = {
|
|
1644
1654
|
registry,
|
|
1645
1655
|
getAdapter,
|
|
@@ -1649,22 +1659,22 @@ function DataLayerProvider(t0) {
|
|
|
1649
1659
|
schema: config.schema,
|
|
1650
1660
|
syncControl
|
|
1651
1661
|
};
|
|
1652
|
-
$[
|
|
1653
|
-
$[
|
|
1654
|
-
$[
|
|
1655
|
-
$[
|
|
1656
|
-
$[
|
|
1657
|
-
$[
|
|
1658
|
-
$[
|
|
1659
|
-
$[
|
|
1662
|
+
$[43] = config.schema;
|
|
1663
|
+
$[44] = getAdapter;
|
|
1664
|
+
$[45] = powerSyncInstance;
|
|
1665
|
+
$[46] = queryClient;
|
|
1666
|
+
$[47] = registry;
|
|
1667
|
+
$[48] = supabaseClient;
|
|
1668
|
+
$[49] = syncControl;
|
|
1669
|
+
$[50] = t13;
|
|
1660
1670
|
} else {
|
|
1661
|
-
t13 = $[
|
|
1671
|
+
t13 = $[50];
|
|
1662
1672
|
}
|
|
1663
1673
|
const coreContextValue = t13;
|
|
1664
1674
|
const t14 = powerSyncInstance ? "powersync" : "supabase";
|
|
1665
1675
|
const t15 = powerSyncInstance ? "available" /* AVAILABLE */ : "unavailable" /* UNAVAILABLE */;
|
|
1666
1676
|
let t16;
|
|
1667
|
-
if ($[
|
|
1677
|
+
if ($[51] !== hasSynced || $[52] !== isOnline || $[53] !== t14 || $[54] !== t15) {
|
|
1668
1678
|
t16 = {
|
|
1669
1679
|
isInitialized: true,
|
|
1670
1680
|
currentBackend: t14,
|
|
@@ -1674,66 +1684,66 @@ function DataLayerProvider(t0) {
|
|
|
1674
1684
|
error: null,
|
|
1675
1685
|
hasSynced
|
|
1676
1686
|
};
|
|
1677
|
-
$[
|
|
1678
|
-
$[
|
|
1679
|
-
$[
|
|
1680
|
-
$[
|
|
1681
|
-
$[
|
|
1687
|
+
$[51] = hasSynced;
|
|
1688
|
+
$[52] = isOnline;
|
|
1689
|
+
$[53] = t14;
|
|
1690
|
+
$[54] = t15;
|
|
1691
|
+
$[55] = t16;
|
|
1682
1692
|
} else {
|
|
1683
|
-
t16 = $[
|
|
1693
|
+
t16 = $[55];
|
|
1684
1694
|
}
|
|
1685
1695
|
const status = t16;
|
|
1686
1696
|
let t17;
|
|
1687
|
-
if ($[
|
|
1697
|
+
if ($[56] !== status) {
|
|
1688
1698
|
t17 = {
|
|
1689
1699
|
status,
|
|
1690
1700
|
syncStatus: defaultSyncStatus
|
|
1691
1701
|
};
|
|
1692
|
-
$[
|
|
1693
|
-
$[
|
|
1702
|
+
$[56] = status;
|
|
1703
|
+
$[57] = t17;
|
|
1694
1704
|
} else {
|
|
1695
|
-
t17 = $[
|
|
1705
|
+
t17 = $[57];
|
|
1696
1706
|
}
|
|
1697
1707
|
const statusContextValue = t17;
|
|
1698
1708
|
let t18;
|
|
1699
|
-
if ($[
|
|
1709
|
+
if ($[58] !== coreContextValue || $[59] !== statusContextValue) {
|
|
1700
1710
|
t18 = {
|
|
1701
1711
|
...coreContextValue,
|
|
1702
1712
|
...statusContextValue
|
|
1703
1713
|
};
|
|
1704
|
-
$[
|
|
1705
|
-
$[
|
|
1706
|
-
$[
|
|
1714
|
+
$[58] = coreContextValue;
|
|
1715
|
+
$[59] = statusContextValue;
|
|
1716
|
+
$[60] = t18;
|
|
1707
1717
|
} else {
|
|
1708
|
-
t18 = $[
|
|
1718
|
+
t18 = $[60];
|
|
1709
1719
|
}
|
|
1710
1720
|
const contextValue = t18;
|
|
1711
1721
|
let t19;
|
|
1712
|
-
if ($[
|
|
1722
|
+
if ($[61] !== children || $[62] !== statusContextValue) {
|
|
1713
1723
|
t19 = /* @__PURE__ */ jsx(DataLayerStatusContext.Provider, { value: statusContextValue, children });
|
|
1714
|
-
$[
|
|
1715
|
-
$[
|
|
1716
|
-
$[
|
|
1724
|
+
$[61] = children;
|
|
1725
|
+
$[62] = statusContextValue;
|
|
1726
|
+
$[63] = t19;
|
|
1717
1727
|
} else {
|
|
1718
|
-
t19 = $[
|
|
1728
|
+
t19 = $[63];
|
|
1719
1729
|
}
|
|
1720
1730
|
let t20;
|
|
1721
|
-
if ($[
|
|
1731
|
+
if ($[64] !== coreContextValue || $[65] !== t19) {
|
|
1722
1732
|
t20 = /* @__PURE__ */ jsx(DataLayerCoreContext.Provider, { value: coreContextValue, children: t19 });
|
|
1723
|
-
$[
|
|
1724
|
-
$[
|
|
1725
|
-
$[
|
|
1733
|
+
$[64] = coreContextValue;
|
|
1734
|
+
$[65] = t19;
|
|
1735
|
+
$[66] = t20;
|
|
1726
1736
|
} else {
|
|
1727
|
-
t20 = $[
|
|
1737
|
+
t20 = $[66];
|
|
1728
1738
|
}
|
|
1729
1739
|
let t21;
|
|
1730
|
-
if ($[
|
|
1740
|
+
if ($[67] !== contextValue || $[68] !== t20) {
|
|
1731
1741
|
t21 = /* @__PURE__ */ jsx(DataLayerNestingContext.Provider, { value: true, children: /* @__PURE__ */ jsx(DataLayerContext.Provider, { value: contextValue, children: t20 }) });
|
|
1732
|
-
$[
|
|
1733
|
-
$[
|
|
1734
|
-
$[
|
|
1742
|
+
$[67] = contextValue;
|
|
1743
|
+
$[68] = t20;
|
|
1744
|
+
$[69] = t21;
|
|
1735
1745
|
} else {
|
|
1736
|
-
t21 = $[
|
|
1746
|
+
t21 = $[69];
|
|
1737
1747
|
}
|
|
1738
1748
|
return t21;
|
|
1739
1749
|
}
|
|
@@ -5012,4 +5022,4 @@ object-assign/index.js:
|
|
|
5012
5022
|
@license MIT
|
|
5013
5023
|
*)
|
|
5014
5024
|
*/
|
|
5015
|
-
//# sourceMappingURL=chunk-
|
|
5025
|
+
//# sourceMappingURL=chunk-7PBTPCRN.js.map
|