@rpcbase/client 0.338.0 → 0.340.0
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/apiClient/index.d.ts +1 -1
- package/dist/apiClient/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +248 -177
- package/dist/initWithRoutes.d.ts.map +1 -1
- package/dist/notifications.d.ts +54 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/{rts.d.ts → rts/index.d.ts} +4 -4
- package/dist/rts/index.d.ts.map +1 -0
- package/package.json +6 -5
- package/dist/navigationGuard/installGlobalNavigationGuard.test.d.ts +0 -2
- package/dist/navigationGuard/installGlobalNavigationGuard.test.d.ts.map +0 -1
- package/dist/rts/wsClient.sync.test.d.ts +0 -2
- package/dist/rts/wsClient.sync.test.d.ts.map +0 -1
- package/dist/rts.d.ts.map +0 -1
- /package/dist/{rts.js → rts/index.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apiClient/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apiClient/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAGvC,KAAK,UAAU,GAAG;IAChB,GAAG,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;KAC5C,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,EAAE,KAAK;CACzB,CAAC;AAEF,KAAK,eAAe,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzD,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,EACtB,GAAG,CAAC,EAAE,GAAG,KACN,OAAO,CAAC,SAAS,CAAC,CAAC;AAExB,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAC3D,KAAK,YAAY,CAAC,CAAC,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;AAE7C,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;AAEtD,QAAA,IAAI,SAAS,EAAE,SAAS,CAAA;AAExB,eAAO,MAAM,aAAa,GAAU,OAAO,UAAU,kBAyDpD,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { toast } from 'sonner';
|
|
1
2
|
export * from './apiClient';
|
|
2
3
|
export * from './initWithRoutes';
|
|
3
4
|
export * from './types';
|
|
@@ -7,5 +8,5 @@ export * from './hooks';
|
|
|
7
8
|
export * from './ssrErrorState';
|
|
8
9
|
export * from './components/SsrErrorFallback';
|
|
9
10
|
export * from './components/RouteErrorBoundary';
|
|
10
|
-
export
|
|
11
|
+
export * from './notifications';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE9B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { Toaster } from "sonner";
|
|
2
|
+
import { toast } from "sonner";
|
|
1
3
|
import env from "@rpcbase/env";
|
|
2
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
5
|
import { StrictMode, useState, useEffect, useRef, useCallback, useLayoutEffect, useSyncExternalStore } from "react";
|
|
4
6
|
import posthog from "posthog-js";
|
|
5
7
|
import { getNavigationGuards, createRoutesFromElements, createBrowserRouter, RouterProvider, useLocation, useRouteError, isRouteErrorResponse } from "@rpcbase/router";
|
|
6
8
|
import { hydrateRoot } from "react-dom/client";
|
|
7
|
-
import { Toaster } from "sonner";
|
|
8
|
-
import { toast } from "sonner";
|
|
9
9
|
import { PostHogProvider } from "posthog-js/react/dist/esm/index.js";
|
|
10
10
|
let apiClient;
|
|
11
11
|
const initApiClient = async (args) => {
|
|
@@ -408,6 +408,13 @@ const initWithRoutes = async (routesElement, opts) => {
|
|
|
408
408
|
hydrationOptions
|
|
409
409
|
);
|
|
410
410
|
};
|
|
411
|
+
if (!isProduction && !env.SSR) {
|
|
412
|
+
import("react-grab/core").then(({ init }) => {
|
|
413
|
+
init({
|
|
414
|
+
// theme: { hue: 350 }
|
|
415
|
+
});
|
|
416
|
+
});
|
|
417
|
+
}
|
|
411
418
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
412
419
|
function getDefaultExportFromCjs(x) {
|
|
413
420
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -673,8 +680,8 @@ function require_Symbol() {
|
|
|
673
680
|
if (hasRequired_Symbol) return _Symbol;
|
|
674
681
|
hasRequired_Symbol = 1;
|
|
675
682
|
var root = require_root();
|
|
676
|
-
var
|
|
677
|
-
_Symbol =
|
|
683
|
+
var Symbol = root.Symbol;
|
|
684
|
+
_Symbol = Symbol;
|
|
678
685
|
return _Symbol;
|
|
679
686
|
}
|
|
680
687
|
var _arrayMap;
|
|
@@ -697,8 +704,8 @@ var hasRequiredIsArray;
|
|
|
697
704
|
function requireIsArray() {
|
|
698
705
|
if (hasRequiredIsArray) return isArray_1;
|
|
699
706
|
hasRequiredIsArray = 1;
|
|
700
|
-
var
|
|
701
|
-
isArray_1 =
|
|
707
|
+
var isArray = Array.isArray;
|
|
708
|
+
isArray_1 = isArray;
|
|
702
709
|
return isArray_1;
|
|
703
710
|
}
|
|
704
711
|
var _getRawTag;
|
|
@@ -706,11 +713,11 @@ var hasRequired_getRawTag;
|
|
|
706
713
|
function require_getRawTag() {
|
|
707
714
|
if (hasRequired_getRawTag) return _getRawTag;
|
|
708
715
|
hasRequired_getRawTag = 1;
|
|
709
|
-
var
|
|
716
|
+
var Symbol = require_Symbol();
|
|
710
717
|
var objectProto = Object.prototype;
|
|
711
718
|
var hasOwnProperty2 = objectProto.hasOwnProperty;
|
|
712
719
|
var nativeObjectToString = objectProto.toString;
|
|
713
|
-
var symToStringTag =
|
|
720
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
|
|
714
721
|
function getRawTag(value) {
|
|
715
722
|
var isOwn = hasOwnProperty2.call(value, symToStringTag), tag = value[symToStringTag];
|
|
716
723
|
try {
|
|
@@ -749,9 +756,9 @@ var hasRequired_baseGetTag;
|
|
|
749
756
|
function require_baseGetTag() {
|
|
750
757
|
if (hasRequired_baseGetTag) return _baseGetTag;
|
|
751
758
|
hasRequired_baseGetTag = 1;
|
|
752
|
-
var
|
|
759
|
+
var Symbol = require_Symbol(), getRawTag = require_getRawTag(), objectToString = require_objectToString();
|
|
753
760
|
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
754
|
-
var symToStringTag =
|
|
761
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
|
|
755
762
|
function baseGetTag(value) {
|
|
756
763
|
if (value == null) {
|
|
757
764
|
return value === void 0 ? undefinedTag : nullTag;
|
|
@@ -790,13 +797,13 @@ var hasRequired_baseToString;
|
|
|
790
797
|
function require_baseToString() {
|
|
791
798
|
if (hasRequired_baseToString) return _baseToString;
|
|
792
799
|
hasRequired_baseToString = 1;
|
|
793
|
-
var
|
|
794
|
-
var symbolProto =
|
|
800
|
+
var Symbol = require_Symbol(), arrayMap = require_arrayMap(), isArray = requireIsArray(), isSymbol = requireIsSymbol();
|
|
801
|
+
var symbolProto = Symbol ? Symbol.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
795
802
|
function baseToString(value) {
|
|
796
803
|
if (typeof value == "string") {
|
|
797
804
|
return value;
|
|
798
805
|
}
|
|
799
|
-
if (
|
|
806
|
+
if (isArray(value)) {
|
|
800
807
|
return arrayMap(value, baseToString) + "";
|
|
801
808
|
}
|
|
802
809
|
if (isSymbol(value)) {
|
|
@@ -814,10 +821,10 @@ function requireToString() {
|
|
|
814
821
|
if (hasRequiredToString) return toString_1;
|
|
815
822
|
hasRequiredToString = 1;
|
|
816
823
|
var baseToString = require_baseToString();
|
|
817
|
-
function
|
|
824
|
+
function toString2(value) {
|
|
818
825
|
return value == null ? "" : baseToString(value);
|
|
819
826
|
}
|
|
820
|
-
toString_1 =
|
|
827
|
+
toString_1 = toString2;
|
|
821
828
|
return toString_1;
|
|
822
829
|
}
|
|
823
830
|
var deburr_1;
|
|
@@ -825,13 +832,13 @@ var hasRequiredDeburr;
|
|
|
825
832
|
function requireDeburr() {
|
|
826
833
|
if (hasRequiredDeburr) return deburr_1;
|
|
827
834
|
hasRequiredDeburr = 1;
|
|
828
|
-
var deburrLetter = require_deburrLetter(),
|
|
835
|
+
var deburrLetter = require_deburrLetter(), toString2 = requireToString();
|
|
829
836
|
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
830
837
|
var rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
831
838
|
var rsCombo = "[" + rsComboRange + "]";
|
|
832
839
|
var reComboMark = RegExp(rsCombo, "g");
|
|
833
840
|
function deburr(string) {
|
|
834
|
-
string =
|
|
841
|
+
string = toString2(string);
|
|
835
842
|
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
|
|
836
843
|
}
|
|
837
844
|
deburr_1 = deburr;
|
|
@@ -890,9 +897,9 @@ var hasRequiredWords;
|
|
|
890
897
|
function requireWords() {
|
|
891
898
|
if (hasRequiredWords) return words_1;
|
|
892
899
|
hasRequiredWords = 1;
|
|
893
|
-
var asciiWords = require_asciiWords(), hasUnicodeWord = require_hasUnicodeWord(),
|
|
900
|
+
var asciiWords = require_asciiWords(), hasUnicodeWord = require_hasUnicodeWord(), toString2 = requireToString(), unicodeWords = require_unicodeWords();
|
|
894
901
|
function words(string, pattern, guard) {
|
|
895
|
-
string =
|
|
902
|
+
string = toString2(string);
|
|
896
903
|
pattern = guard ? void 0 : pattern;
|
|
897
904
|
if (pattern === void 0) {
|
|
898
905
|
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
|
|
@@ -1317,8 +1324,8 @@ function requireThrottle() {
|
|
|
1317
1324
|
}
|
|
1318
1325
|
var throttleExports = requireThrottle();
|
|
1319
1326
|
const _throttle = /* @__PURE__ */ getDefaultExportFromCjs(throttleExports);
|
|
1320
|
-
|
|
1321
|
-
|
|
1327
|
+
const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
|
|
1328
|
+
const { hasOwnProperty } = Object.prototype;
|
|
1322
1329
|
function combineComparators(comparatorA, comparatorB) {
|
|
1323
1330
|
return function isEqual(a, b, state) {
|
|
1324
1331
|
return comparatorA(a, b, state) && comparatorB(a, b, state);
|
|
@@ -1329,41 +1336,45 @@ function createIsCircular(areItemsEqual) {
|
|
|
1329
1336
|
if (!a || !b || typeof a !== "object" || typeof b !== "object") {
|
|
1330
1337
|
return areItemsEqual(a, b, state);
|
|
1331
1338
|
}
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1339
|
+
const { cache } = state;
|
|
1340
|
+
const cachedA = cache.get(a);
|
|
1341
|
+
const cachedB = cache.get(b);
|
|
1335
1342
|
if (cachedA && cachedB) {
|
|
1336
1343
|
return cachedA === b && cachedB === a;
|
|
1337
1344
|
}
|
|
1338
1345
|
cache.set(a, b);
|
|
1339
1346
|
cache.set(b, a);
|
|
1340
|
-
|
|
1347
|
+
const result = areItemsEqual(a, b, state);
|
|
1341
1348
|
cache.delete(a);
|
|
1342
1349
|
cache.delete(b);
|
|
1343
1350
|
return result;
|
|
1344
1351
|
};
|
|
1345
1352
|
}
|
|
1346
|
-
function getShortTag(value) {
|
|
1347
|
-
return value != null ? value[Symbol.toStringTag] : void 0;
|
|
1348
|
-
}
|
|
1349
1353
|
function getStrictProperties(object) {
|
|
1350
1354
|
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
1351
1355
|
}
|
|
1352
|
-
|
|
1356
|
+
const hasOwn = (
|
|
1353
1357
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1354
|
-
Object.hasOwn || (
|
|
1355
|
-
return hasOwnProperty.call(object, property);
|
|
1356
|
-
})
|
|
1358
|
+
Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property))
|
|
1357
1359
|
);
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
+
const PREACT_VNODE = "__v";
|
|
1361
|
+
const PREACT_OWNER = "__o";
|
|
1362
|
+
const REACT_OWNER = "_owner";
|
|
1363
|
+
const { getOwnPropertyDescriptor, keys } = Object;
|
|
1364
|
+
const sameValueEqual = (
|
|
1365
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1366
|
+
Object.is || function sameValueEqual2(a, b) {
|
|
1367
|
+
return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;
|
|
1368
|
+
}
|
|
1369
|
+
);
|
|
1370
|
+
function strictEqual(a, b) {
|
|
1371
|
+
return a === b;
|
|
1372
|
+
}
|
|
1373
|
+
function areArrayBuffersEqual(a, b) {
|
|
1374
|
+
return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));
|
|
1360
1375
|
}
|
|
1361
|
-
var PREACT_VNODE = "__v";
|
|
1362
|
-
var PREACT_OWNER = "__o";
|
|
1363
|
-
var REACT_OWNER = "_owner";
|
|
1364
|
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, keys = Object.keys;
|
|
1365
1376
|
function areArraysEqual(a, b, state) {
|
|
1366
|
-
|
|
1377
|
+
let index = a.length;
|
|
1367
1378
|
if (b.length !== index) {
|
|
1368
1379
|
return false;
|
|
1369
1380
|
}
|
|
@@ -1374,35 +1385,35 @@ function areArraysEqual(a, b, state) {
|
|
|
1374
1385
|
}
|
|
1375
1386
|
return true;
|
|
1376
1387
|
}
|
|
1388
|
+
function areDataViewsEqual(a, b) {
|
|
1389
|
+
return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength));
|
|
1390
|
+
}
|
|
1377
1391
|
function areDatesEqual(a, b) {
|
|
1378
|
-
return
|
|
1392
|
+
return sameValueEqual(a.getTime(), b.getTime());
|
|
1379
1393
|
}
|
|
1380
1394
|
function areErrorsEqual(a, b) {
|
|
1381
1395
|
return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
|
|
1382
1396
|
}
|
|
1383
|
-
function areFunctionsEqual(a, b) {
|
|
1384
|
-
return a === b;
|
|
1385
|
-
}
|
|
1386
1397
|
function areMapsEqual(a, b, state) {
|
|
1387
|
-
|
|
1398
|
+
const size = a.size;
|
|
1388
1399
|
if (size !== b.size) {
|
|
1389
1400
|
return false;
|
|
1390
1401
|
}
|
|
1391
1402
|
if (!size) {
|
|
1392
1403
|
return true;
|
|
1393
1404
|
}
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1405
|
+
const matchedIndices = new Array(size);
|
|
1406
|
+
const aIterable = a.entries();
|
|
1407
|
+
let aResult;
|
|
1408
|
+
let bResult;
|
|
1409
|
+
let index = 0;
|
|
1399
1410
|
while (aResult = aIterable.next()) {
|
|
1400
1411
|
if (aResult.done) {
|
|
1401
1412
|
break;
|
|
1402
1413
|
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1414
|
+
const bIterable = b.entries();
|
|
1415
|
+
let hasMatch = false;
|
|
1416
|
+
let matchIndex = 0;
|
|
1406
1417
|
while (bResult = bIterable.next()) {
|
|
1407
1418
|
if (bResult.done) {
|
|
1408
1419
|
break;
|
|
@@ -1411,8 +1422,8 @@ function areMapsEqual(a, b, state) {
|
|
|
1411
1422
|
matchIndex++;
|
|
1412
1423
|
continue;
|
|
1413
1424
|
}
|
|
1414
|
-
|
|
1415
|
-
|
|
1425
|
+
const aEntry = aResult.value;
|
|
1426
|
+
const bEntry = bResult.value;
|
|
1416
1427
|
if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
|
|
1417
1428
|
hasMatch = matchedIndices[matchIndex] = true;
|
|
1418
1429
|
break;
|
|
@@ -1426,10 +1437,9 @@ function areMapsEqual(a, b, state) {
|
|
|
1426
1437
|
}
|
|
1427
1438
|
return true;
|
|
1428
1439
|
}
|
|
1429
|
-
var areNumbersEqual = sameValueZeroEqual;
|
|
1430
1440
|
function areObjectsEqual(a, b, state) {
|
|
1431
|
-
|
|
1432
|
-
|
|
1441
|
+
const properties = keys(a);
|
|
1442
|
+
let index = properties.length;
|
|
1433
1443
|
if (keys(b).length !== index) {
|
|
1434
1444
|
return false;
|
|
1435
1445
|
}
|
|
@@ -1441,14 +1451,14 @@ function areObjectsEqual(a, b, state) {
|
|
|
1441
1451
|
return true;
|
|
1442
1452
|
}
|
|
1443
1453
|
function areObjectsEqualStrict(a, b, state) {
|
|
1444
|
-
|
|
1445
|
-
|
|
1454
|
+
const properties = getStrictProperties(a);
|
|
1455
|
+
let index = properties.length;
|
|
1446
1456
|
if (getStrictProperties(b).length !== index) {
|
|
1447
1457
|
return false;
|
|
1448
1458
|
}
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1459
|
+
let property;
|
|
1460
|
+
let descriptorA;
|
|
1461
|
+
let descriptorB;
|
|
1452
1462
|
while (index-- > 0) {
|
|
1453
1463
|
property = properties[index];
|
|
1454
1464
|
if (!isPropertyEqual(a, b, state, property)) {
|
|
@@ -1463,30 +1473,30 @@ function areObjectsEqualStrict(a, b, state) {
|
|
|
1463
1473
|
return true;
|
|
1464
1474
|
}
|
|
1465
1475
|
function arePrimitiveWrappersEqual(a, b) {
|
|
1466
|
-
return
|
|
1476
|
+
return sameValueEqual(a.valueOf(), b.valueOf());
|
|
1467
1477
|
}
|
|
1468
1478
|
function areRegExpsEqual(a, b) {
|
|
1469
1479
|
return a.source === b.source && a.flags === b.flags;
|
|
1470
1480
|
}
|
|
1471
1481
|
function areSetsEqual(a, b, state) {
|
|
1472
|
-
|
|
1482
|
+
const size = a.size;
|
|
1473
1483
|
if (size !== b.size) {
|
|
1474
1484
|
return false;
|
|
1475
1485
|
}
|
|
1476
1486
|
if (!size) {
|
|
1477
1487
|
return true;
|
|
1478
1488
|
}
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1489
|
+
const matchedIndices = new Array(size);
|
|
1490
|
+
const aIterable = a.values();
|
|
1491
|
+
let aResult;
|
|
1492
|
+
let bResult;
|
|
1483
1493
|
while (aResult = aIterable.next()) {
|
|
1484
1494
|
if (aResult.done) {
|
|
1485
1495
|
break;
|
|
1486
1496
|
}
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1497
|
+
const bIterable = b.values();
|
|
1498
|
+
let hasMatch = false;
|
|
1499
|
+
let matchIndex = 0;
|
|
1490
1500
|
while (bResult = bIterable.next()) {
|
|
1491
1501
|
if (bResult.done) {
|
|
1492
1502
|
break;
|
|
@@ -1504,8 +1514,8 @@ function areSetsEqual(a, b, state) {
|
|
|
1504
1514
|
return true;
|
|
1505
1515
|
}
|
|
1506
1516
|
function areTypedArraysEqual(a, b) {
|
|
1507
|
-
|
|
1508
|
-
if (b.
|
|
1517
|
+
let index = a.byteLength;
|
|
1518
|
+
if (b.byteLength !== index || a.byteOffset !== b.byteOffset) {
|
|
1509
1519
|
return false;
|
|
1510
1520
|
}
|
|
1511
1521
|
while (index-- > 0) {
|
|
@@ -1524,23 +1534,10 @@ function isPropertyEqual(a, b, state, property) {
|
|
|
1524
1534
|
}
|
|
1525
1535
|
return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
|
|
1526
1536
|
}
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
var MAP_TAG = "[object Map]";
|
|
1532
|
-
var NUMBER_TAG = "[object Number]";
|
|
1533
|
-
var OBJECT_TAG = "[object Object]";
|
|
1534
|
-
var REG_EXP_TAG = "[object RegExp]";
|
|
1535
|
-
var SET_TAG = "[object Set]";
|
|
1536
|
-
var STRING_TAG = "[object String]";
|
|
1537
|
-
var URL_TAG = "[object URL]";
|
|
1538
|
-
var isArray = Array.isArray;
|
|
1539
|
-
var isTypedArray = typeof ArrayBuffer !== "undefined" && typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView : null;
|
|
1540
|
-
var assign = Object.assign;
|
|
1541
|
-
var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
|
|
1542
|
-
function createEqualityComparator(_a) {
|
|
1543
|
-
var areArraysEqual2 = _a.areArraysEqual, areDatesEqual2 = _a.areDatesEqual, areErrorsEqual2 = _a.areErrorsEqual, areFunctionsEqual2 = _a.areFunctionsEqual, areMapsEqual2 = _a.areMapsEqual, areNumbersEqual2 = _a.areNumbersEqual, areObjectsEqual2 = _a.areObjectsEqual, arePrimitiveWrappersEqual2 = _a.arePrimitiveWrappersEqual, areRegExpsEqual2 = _a.areRegExpsEqual, areSetsEqual2 = _a.areSetsEqual, areTypedArraysEqual2 = _a.areTypedArraysEqual, areUrlsEqual2 = _a.areUrlsEqual, unknownTagComparators = _a.unknownTagComparators;
|
|
1537
|
+
const toString = Object.prototype.toString;
|
|
1538
|
+
function createEqualityComparator(config) {
|
|
1539
|
+
const supportedComparatorMap = createSupportedComparatorMap(config);
|
|
1540
|
+
const { areArraysEqual: areArraysEqual2, areDatesEqual: areDatesEqual2, areFunctionsEqual, areMapsEqual: areMapsEqual2, areNumbersEqual, areObjectsEqual: areObjectsEqual2, areRegExpsEqual: areRegExpsEqual2, areSetsEqual: areSetsEqual2, getUnsupportedCustomComparator } = config;
|
|
1544
1541
|
return function comparator(a, b, state) {
|
|
1545
1542
|
if (a === b) {
|
|
1546
1543
|
return true;
|
|
@@ -1548,32 +1545,29 @@ function createEqualityComparator(_a) {
|
|
|
1548
1545
|
if (a == null || b == null) {
|
|
1549
1546
|
return false;
|
|
1550
1547
|
}
|
|
1551
|
-
|
|
1548
|
+
const type = typeof a;
|
|
1552
1549
|
if (type !== typeof b) {
|
|
1553
1550
|
return false;
|
|
1554
1551
|
}
|
|
1555
1552
|
if (type !== "object") {
|
|
1556
|
-
if (type === "number") {
|
|
1557
|
-
return
|
|
1553
|
+
if (type === "number" || type === "bigint") {
|
|
1554
|
+
return areNumbersEqual(a, b, state);
|
|
1558
1555
|
}
|
|
1559
1556
|
if (type === "function") {
|
|
1560
|
-
return
|
|
1557
|
+
return areFunctionsEqual(a, b, state);
|
|
1561
1558
|
}
|
|
1562
1559
|
return false;
|
|
1563
1560
|
}
|
|
1564
|
-
|
|
1561
|
+
const constructor = a.constructor;
|
|
1565
1562
|
if (constructor !== b.constructor) {
|
|
1566
1563
|
return false;
|
|
1567
1564
|
}
|
|
1568
1565
|
if (constructor === Object) {
|
|
1569
1566
|
return areObjectsEqual2(a, b, state);
|
|
1570
1567
|
}
|
|
1571
|
-
if (
|
|
1568
|
+
if (constructor === Array) {
|
|
1572
1569
|
return areArraysEqual2(a, b, state);
|
|
1573
1570
|
}
|
|
1574
|
-
if (isTypedArray != null && isTypedArray(a)) {
|
|
1575
|
-
return areTypedArraysEqual2(a, b, state);
|
|
1576
|
-
}
|
|
1577
1571
|
if (constructor === Date) {
|
|
1578
1572
|
return areDatesEqual2(a, b, state);
|
|
1579
1573
|
}
|
|
@@ -1586,79 +1580,55 @@ function createEqualityComparator(_a) {
|
|
|
1586
1580
|
if (constructor === Set) {
|
|
1587
1581
|
return areSetsEqual2(a, b, state);
|
|
1588
1582
|
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
return areDatesEqual2(a, b, state);
|
|
1592
|
-
}
|
|
1593
|
-
if (tag === REG_EXP_TAG) {
|
|
1594
|
-
return areRegExpsEqual2(a, b, state);
|
|
1595
|
-
}
|
|
1596
|
-
if (tag === MAP_TAG) {
|
|
1597
|
-
return areMapsEqual2(a, b, state);
|
|
1598
|
-
}
|
|
1599
|
-
if (tag === SET_TAG) {
|
|
1600
|
-
return areSetsEqual2(a, b, state);
|
|
1601
|
-
}
|
|
1602
|
-
if (tag === OBJECT_TAG) {
|
|
1603
|
-
return typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a, b, state);
|
|
1604
|
-
}
|
|
1605
|
-
if (tag === URL_TAG) {
|
|
1606
|
-
return areUrlsEqual2(a, b, state);
|
|
1607
|
-
}
|
|
1608
|
-
if (tag === ERROR_TAG) {
|
|
1609
|
-
return areErrorsEqual2(a, b, state);
|
|
1583
|
+
if (constructor === Promise) {
|
|
1584
|
+
return false;
|
|
1610
1585
|
}
|
|
1611
|
-
if (
|
|
1612
|
-
return
|
|
1586
|
+
if (Array.isArray(a)) {
|
|
1587
|
+
return areArraysEqual2(a, b, state);
|
|
1613
1588
|
}
|
|
1614
|
-
|
|
1615
|
-
|
|
1589
|
+
const tag = toString.call(a);
|
|
1590
|
+
const supportedComparator = supportedComparatorMap[tag];
|
|
1591
|
+
if (supportedComparator) {
|
|
1592
|
+
return supportedComparator(a, b, state);
|
|
1616
1593
|
}
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
var shortTag = getShortTag(a);
|
|
1621
|
-
if (shortTag) {
|
|
1622
|
-
unknownTagComparator = unknownTagComparators[shortTag];
|
|
1623
|
-
}
|
|
1624
|
-
}
|
|
1625
|
-
if (unknownTagComparator) {
|
|
1626
|
-
return unknownTagComparator(a, b, state);
|
|
1627
|
-
}
|
|
1594
|
+
const unsupportedCustomComparator = getUnsupportedCustomComparator && getUnsupportedCustomComparator(a, b, state, tag);
|
|
1595
|
+
if (unsupportedCustomComparator) {
|
|
1596
|
+
return unsupportedCustomComparator(a, b, state);
|
|
1628
1597
|
}
|
|
1629
1598
|
return false;
|
|
1630
1599
|
};
|
|
1631
1600
|
}
|
|
1632
|
-
function createEqualityComparatorConfig(
|
|
1633
|
-
|
|
1634
|
-
|
|
1601
|
+
function createEqualityComparatorConfig({ circular, createCustomConfig, strict }) {
|
|
1602
|
+
let config = {
|
|
1603
|
+
areArrayBuffersEqual,
|
|
1635
1604
|
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
|
|
1605
|
+
areDataViewsEqual,
|
|
1636
1606
|
areDatesEqual,
|
|
1637
1607
|
areErrorsEqual,
|
|
1638
|
-
areFunctionsEqual,
|
|
1608
|
+
areFunctionsEqual: strictEqual,
|
|
1639
1609
|
areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
|
|
1640
|
-
areNumbersEqual,
|
|
1610
|
+
areNumbersEqual: sameValueEqual,
|
|
1641
1611
|
areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
|
|
1642
1612
|
arePrimitiveWrappersEqual,
|
|
1643
1613
|
areRegExpsEqual,
|
|
1644
1614
|
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
|
|
1645
|
-
areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual,
|
|
1615
|
+
areTypedArraysEqual: strict ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict) : areTypedArraysEqual,
|
|
1646
1616
|
areUrlsEqual,
|
|
1647
|
-
|
|
1617
|
+
getUnsupportedCustomComparator: void 0
|
|
1648
1618
|
};
|
|
1649
1619
|
if (createCustomConfig) {
|
|
1650
|
-
config = assign({}, config, createCustomConfig(config));
|
|
1620
|
+
config = Object.assign({}, config, createCustomConfig(config));
|
|
1651
1621
|
}
|
|
1652
1622
|
if (circular) {
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
config = assign({}, config, {
|
|
1658
|
-
areArraysEqual:
|
|
1659
|
-
areMapsEqual:
|
|
1660
|
-
areObjectsEqual:
|
|
1661
|
-
areSetsEqual:
|
|
1623
|
+
const areArraysEqual2 = createIsCircular(config.areArraysEqual);
|
|
1624
|
+
const areMapsEqual2 = createIsCircular(config.areMapsEqual);
|
|
1625
|
+
const areObjectsEqual2 = createIsCircular(config.areObjectsEqual);
|
|
1626
|
+
const areSetsEqual2 = createIsCircular(config.areSetsEqual);
|
|
1627
|
+
config = Object.assign({}, config, {
|
|
1628
|
+
areArraysEqual: areArraysEqual2,
|
|
1629
|
+
areMapsEqual: areMapsEqual2,
|
|
1630
|
+
areObjectsEqual: areObjectsEqual2,
|
|
1631
|
+
areSetsEqual: areSetsEqual2
|
|
1662
1632
|
});
|
|
1663
1633
|
}
|
|
1664
1634
|
return config;
|
|
@@ -1668,11 +1638,10 @@ function createInternalEqualityComparator(compare) {
|
|
|
1668
1638
|
return compare(a, b, state);
|
|
1669
1639
|
};
|
|
1670
1640
|
}
|
|
1671
|
-
function createIsEqual(
|
|
1672
|
-
var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
|
|
1641
|
+
function createIsEqual({ circular, comparator, createState, equals, strict }) {
|
|
1673
1642
|
if (createState) {
|
|
1674
1643
|
return function isEqual(a, b) {
|
|
1675
|
-
|
|
1644
|
+
const { cache = circular ? /* @__PURE__ */ new WeakMap() : void 0, meta } = createState();
|
|
1676
1645
|
return comparator(a, b, {
|
|
1677
1646
|
cache,
|
|
1678
1647
|
equals,
|
|
@@ -1691,7 +1660,7 @@ function createIsEqual(_a) {
|
|
|
1691
1660
|
});
|
|
1692
1661
|
};
|
|
1693
1662
|
}
|
|
1694
|
-
|
|
1663
|
+
const state = {
|
|
1695
1664
|
cache: void 0,
|
|
1696
1665
|
equals,
|
|
1697
1666
|
meta: void 0,
|
|
@@ -1701,7 +1670,50 @@ function createIsEqual(_a) {
|
|
|
1701
1670
|
return comparator(a, b, state);
|
|
1702
1671
|
};
|
|
1703
1672
|
}
|
|
1704
|
-
|
|
1673
|
+
function createSupportedComparatorMap({ areArrayBuffersEqual: areArrayBuffersEqual2, areArraysEqual: areArraysEqual2, areDataViewsEqual: areDataViewsEqual2, areDatesEqual: areDatesEqual2, areErrorsEqual: areErrorsEqual2, areFunctionsEqual, areMapsEqual: areMapsEqual2, areNumbersEqual, areObjectsEqual: areObjectsEqual2, arePrimitiveWrappersEqual: arePrimitiveWrappersEqual2, areRegExpsEqual: areRegExpsEqual2, areSetsEqual: areSetsEqual2, areTypedArraysEqual: areTypedArraysEqual2, areUrlsEqual: areUrlsEqual2 }) {
|
|
1674
|
+
return {
|
|
1675
|
+
"[object Arguments]": areObjectsEqual2,
|
|
1676
|
+
"[object Array]": areArraysEqual2,
|
|
1677
|
+
"[object ArrayBuffer]": areArrayBuffersEqual2,
|
|
1678
|
+
"[object AsyncGeneratorFunction]": areFunctionsEqual,
|
|
1679
|
+
"[object BigInt]": areNumbersEqual,
|
|
1680
|
+
"[object BigInt64Array]": areTypedArraysEqual2,
|
|
1681
|
+
"[object BigUint64Array]": areTypedArraysEqual2,
|
|
1682
|
+
"[object Boolean]": arePrimitiveWrappersEqual2,
|
|
1683
|
+
"[object DataView]": areDataViewsEqual2,
|
|
1684
|
+
"[object Date]": areDatesEqual2,
|
|
1685
|
+
// If an error tag, it should be tested explicitly. Like RegExp, the properties are not
|
|
1686
|
+
// enumerable, and therefore will give false positives if tested like a standard object.
|
|
1687
|
+
"[object Error]": areErrorsEqual2,
|
|
1688
|
+
"[object Float16Array]": areTypedArraysEqual2,
|
|
1689
|
+
"[object Float32Array]": areTypedArraysEqual2,
|
|
1690
|
+
"[object Float64Array]": areTypedArraysEqual2,
|
|
1691
|
+
"[object Function]": areFunctionsEqual,
|
|
1692
|
+
"[object GeneratorFunction]": areFunctionsEqual,
|
|
1693
|
+
"[object Int8Array]": areTypedArraysEqual2,
|
|
1694
|
+
"[object Int16Array]": areTypedArraysEqual2,
|
|
1695
|
+
"[object Int32Array]": areTypedArraysEqual2,
|
|
1696
|
+
"[object Map]": areMapsEqual2,
|
|
1697
|
+
"[object Number]": arePrimitiveWrappersEqual2,
|
|
1698
|
+
"[object Object]": (a, b, state) => (
|
|
1699
|
+
// The exception for value comparison is custom `Promise`-like class instances. These should
|
|
1700
|
+
// be treated the same as standard `Promise` objects, which means strict equality, and if
|
|
1701
|
+
// it reaches this point then that strict equality comparison has already failed.
|
|
1702
|
+
typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a, b, state)
|
|
1703
|
+
),
|
|
1704
|
+
// For RegExp, the properties are not enumerable, and therefore will give false positives if
|
|
1705
|
+
// tested like a standard object.
|
|
1706
|
+
"[object RegExp]": areRegExpsEqual2,
|
|
1707
|
+
"[object Set]": areSetsEqual2,
|
|
1708
|
+
"[object String]": arePrimitiveWrappersEqual2,
|
|
1709
|
+
"[object URL]": areUrlsEqual2,
|
|
1710
|
+
"[object Uint8Array]": areTypedArraysEqual2,
|
|
1711
|
+
"[object Uint8ClampedArray]": areTypedArraysEqual2,
|
|
1712
|
+
"[object Uint16Array]": areTypedArraysEqual2,
|
|
1713
|
+
"[object Uint32Array]": areTypedArraysEqual2
|
|
1714
|
+
};
|
|
1715
|
+
}
|
|
1716
|
+
const deepEqual = createCustomEqual();
|
|
1705
1717
|
createCustomEqual({ strict: true });
|
|
1706
1718
|
createCustomEqual({ circular: true });
|
|
1707
1719
|
createCustomEqual({
|
|
@@ -1709,37 +1721,26 @@ createCustomEqual({
|
|
|
1709
1721
|
strict: true
|
|
1710
1722
|
});
|
|
1711
1723
|
createCustomEqual({
|
|
1712
|
-
createInternalComparator:
|
|
1713
|
-
return sameValueZeroEqual;
|
|
1714
|
-
}
|
|
1724
|
+
createInternalComparator: () => sameValueEqual
|
|
1715
1725
|
});
|
|
1716
1726
|
createCustomEqual({
|
|
1717
1727
|
strict: true,
|
|
1718
|
-
createInternalComparator:
|
|
1719
|
-
return sameValueZeroEqual;
|
|
1720
|
-
}
|
|
1728
|
+
createInternalComparator: () => sameValueEqual
|
|
1721
1729
|
});
|
|
1722
1730
|
createCustomEqual({
|
|
1723
1731
|
circular: true,
|
|
1724
|
-
createInternalComparator:
|
|
1725
|
-
return sameValueZeroEqual;
|
|
1726
|
-
}
|
|
1732
|
+
createInternalComparator: () => sameValueEqual
|
|
1727
1733
|
});
|
|
1728
1734
|
createCustomEqual({
|
|
1729
1735
|
circular: true,
|
|
1730
|
-
createInternalComparator:
|
|
1731
|
-
return sameValueZeroEqual;
|
|
1732
|
-
},
|
|
1736
|
+
createInternalComparator: () => sameValueEqual,
|
|
1733
1737
|
strict: true
|
|
1734
1738
|
});
|
|
1735
|
-
function createCustomEqual(options) {
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
var config = createEqualityComparatorConfig(options);
|
|
1741
|
-
var comparator = createEqualityComparator(config);
|
|
1742
|
-
var equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
|
|
1739
|
+
function createCustomEqual(options = {}) {
|
|
1740
|
+
const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false } = options;
|
|
1741
|
+
const config = createEqualityComparatorConfig(options);
|
|
1742
|
+
const comparator = createEqualityComparator(config);
|
|
1743
|
+
const equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
|
|
1743
1744
|
return createIsEqual({ circular, comparator, createState, equals, strict });
|
|
1744
1745
|
}
|
|
1745
1746
|
const defaultRect = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
@@ -1866,19 +1867,89 @@ const RouteErrorBoundary = ({ renderErrorExtra }) => {
|
|
|
1866
1867
|
}
|
|
1867
1868
|
);
|
|
1868
1869
|
};
|
|
1870
|
+
const listNotifications = async (input = {}) => {
|
|
1871
|
+
const result = await apiClient.post("/api/rb/notifications", input);
|
|
1872
|
+
if (!result?.ok) {
|
|
1873
|
+
throw new Error(result?.error || "Failed to load notifications");
|
|
1874
|
+
}
|
|
1875
|
+
return {
|
|
1876
|
+
notifications: Array.isArray(result.notifications) ? result.notifications : [],
|
|
1877
|
+
unreadCount: Number.isFinite(result.unreadCount) ? Math.max(0, Math.floor(result.unreadCount ?? 0)) : 0,
|
|
1878
|
+
unseenCount: Number.isFinite(result.unseenCount) ? Math.max(0, Math.floor(result.unseenCount ?? 0)) : 0
|
|
1879
|
+
};
|
|
1880
|
+
};
|
|
1881
|
+
const markNotificationRead = async (notificationId) => {
|
|
1882
|
+
const id = notificationId.trim();
|
|
1883
|
+
if (!id) throw new Error("notificationId is required");
|
|
1884
|
+
const result = await apiClient.post(
|
|
1885
|
+
`/api/rb/notifications/${encodeURIComponent(id)}/read`,
|
|
1886
|
+
{}
|
|
1887
|
+
);
|
|
1888
|
+
if (!result?.ok) {
|
|
1889
|
+
throw new Error(result?.error || "Failed to mark notification read");
|
|
1890
|
+
}
|
|
1891
|
+
};
|
|
1892
|
+
const archiveNotification = async (notificationId) => {
|
|
1893
|
+
const id = notificationId.trim();
|
|
1894
|
+
if (!id) throw new Error("notificationId is required");
|
|
1895
|
+
const result = await apiClient.post(
|
|
1896
|
+
`/api/rb/notifications/${encodeURIComponent(id)}/archive`,
|
|
1897
|
+
{}
|
|
1898
|
+
);
|
|
1899
|
+
if (!result?.ok) {
|
|
1900
|
+
throw new Error(result?.error || "Failed to archive notification");
|
|
1901
|
+
}
|
|
1902
|
+
};
|
|
1903
|
+
const markAllNotificationsRead = async () => {
|
|
1904
|
+
const result = await apiClient.post("/api/rb/notifications/mark-all-read", {});
|
|
1905
|
+
if (!result?.ok) {
|
|
1906
|
+
throw new Error(result?.error || "Failed to mark all notifications read");
|
|
1907
|
+
}
|
|
1908
|
+
};
|
|
1909
|
+
const getNotificationSettings = async () => {
|
|
1910
|
+
const result = await apiClient.get("/api/rb/notifications/settings", {});
|
|
1911
|
+
if (!result?.ok) {
|
|
1912
|
+
throw new Error(result?.error || "Failed to load notification settings");
|
|
1913
|
+
}
|
|
1914
|
+
return result.settings ?? { digestFrequency: "weekly", topicPreferences: [] };
|
|
1915
|
+
};
|
|
1916
|
+
const updateNotificationSettings = async (partial) => {
|
|
1917
|
+
const result = await apiClient.put("/api/rb/notifications/settings", partial);
|
|
1918
|
+
if (!result?.ok) {
|
|
1919
|
+
throw new Error(result?.error || "Failed to update notification settings");
|
|
1920
|
+
}
|
|
1921
|
+
return result.settings ?? { digestFrequency: "weekly", topicPreferences: [] };
|
|
1922
|
+
};
|
|
1923
|
+
const runNotificationDigest = async ({ force = false } = {}) => {
|
|
1924
|
+
const result = await apiClient.post(
|
|
1925
|
+
"/api/rb/notifications/digest/run",
|
|
1926
|
+
{ force }
|
|
1927
|
+
);
|
|
1928
|
+
if (!result?.ok) {
|
|
1929
|
+
throw new Error(result?.error || "Failed to run digest");
|
|
1930
|
+
}
|
|
1931
|
+
return { sent: result.sent === true, skippedReason: result.skippedReason };
|
|
1932
|
+
};
|
|
1869
1933
|
export {
|
|
1870
1934
|
RootProvider,
|
|
1871
1935
|
RouteErrorBoundary,
|
|
1872
1936
|
SSR_ERROR_STATE_GLOBAL_KEY,
|
|
1873
1937
|
SsrErrorFallback,
|
|
1874
1938
|
apiClient,
|
|
1939
|
+
archiveNotification,
|
|
1875
1940
|
consumeClientSsrErrorState,
|
|
1876
1941
|
getFeatureFlag,
|
|
1942
|
+
getNotificationSettings,
|
|
1877
1943
|
initApiClient,
|
|
1878
1944
|
initWithRoutes,
|
|
1945
|
+
listNotifications,
|
|
1946
|
+
markAllNotificationsRead,
|
|
1947
|
+
markNotificationRead,
|
|
1879
1948
|
peekClientSsrErrorState,
|
|
1949
|
+
runNotificationDigest,
|
|
1880
1950
|
serializeSsrErrorState,
|
|
1881
1951
|
toast,
|
|
1952
|
+
updateNotificationSettings,
|
|
1882
1953
|
useMediaQuery,
|
|
1883
1954
|
useThrottledMeasure
|
|
1884
1955
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initWithRoutes.d.ts","sourceRoot":"","sources":["../src/initWithRoutes.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAmC,MAAM,OAAO,CAAA;AAElE,OAAO,EAAsB,wBAAwB,EAAiB,MAAM,iBAAiB,CAAA;AAO7F,OAAO,EAGL,oBAAoB,EACrB,MAAM,iBAAiB,CAAA;AAgFxB,KAAK,qBAAqB,GAAG;IAC3B,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAA;CAC9D,CAAA;AAED,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAA;AA0CnE,eAAO,MAAM,cAAc,GACzB,eAAe,aAAa,EAC5B,OAAO,qBAAqB,
|
|
1
|
+
{"version":3,"file":"initWithRoutes.d.ts","sourceRoot":"","sources":["../src/initWithRoutes.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAmC,MAAM,OAAO,CAAA;AAElE,OAAO,EAAsB,wBAAwB,EAAiB,MAAM,iBAAiB,CAAA;AAO7F,OAAO,EAGL,oBAAoB,EACrB,MAAM,iBAAiB,CAAA;AAgFxB,KAAK,qBAAqB,GAAG;IAC3B,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAA;CAC9D,CAAA;AAED,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAA;AA0CnE,eAAO,MAAM,cAAc,GACzB,eAAe,aAAa,EAC5B,OAAO,qBAAqB,kBAqF7B,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type NotificationItem = {
|
|
2
|
+
id: string;
|
|
3
|
+
topic?: string;
|
|
4
|
+
title: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
seenAt?: string;
|
|
9
|
+
readAt?: string;
|
|
10
|
+
archivedAt?: string;
|
|
11
|
+
metadata?: Record<string, unknown>;
|
|
12
|
+
};
|
|
13
|
+
export type NotificationDigestFrequency = "off" | "daily" | "weekly";
|
|
14
|
+
export type NotificationTopicPreference = {
|
|
15
|
+
topic: string;
|
|
16
|
+
inApp: boolean;
|
|
17
|
+
emailDigest: boolean;
|
|
18
|
+
push: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type NotificationSettings = {
|
|
21
|
+
digestFrequency: NotificationDigestFrequency;
|
|
22
|
+
topicPreferences: NotificationTopicPreference[];
|
|
23
|
+
lastDigestSentAt?: string;
|
|
24
|
+
};
|
|
25
|
+
export type ListNotificationsInput = {
|
|
26
|
+
includeArchived?: boolean;
|
|
27
|
+
unreadOnly?: boolean;
|
|
28
|
+
limit?: number;
|
|
29
|
+
markSeen?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export type ListNotificationsResponse = {
|
|
32
|
+
ok: boolean;
|
|
33
|
+
error?: string;
|
|
34
|
+
notifications?: NotificationItem[];
|
|
35
|
+
unreadCount?: number;
|
|
36
|
+
unseenCount?: number;
|
|
37
|
+
};
|
|
38
|
+
export declare const listNotifications: (input?: ListNotificationsInput) => Promise<{
|
|
39
|
+
notifications: NotificationItem[];
|
|
40
|
+
unreadCount: number;
|
|
41
|
+
unseenCount: number;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const markNotificationRead: (notificationId: string) => Promise<void>;
|
|
44
|
+
export declare const archiveNotification: (notificationId: string) => Promise<void>;
|
|
45
|
+
export declare const markAllNotificationsRead: () => Promise<void>;
|
|
46
|
+
export declare const getNotificationSettings: () => Promise<NotificationSettings>;
|
|
47
|
+
export declare const updateNotificationSettings: (partial: Partial<Pick<NotificationSettings, "digestFrequency" | "topicPreferences">>) => Promise<NotificationSettings>;
|
|
48
|
+
export declare const runNotificationDigest: ({ force }?: {
|
|
49
|
+
force?: boolean;
|
|
50
|
+
}) => Promise<{
|
|
51
|
+
sent: boolean;
|
|
52
|
+
skippedReason: string | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEpE,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd,WAAW,EAAE,OAAO,CAAA;IACpB,IAAI,EAAE,OAAO,CAAA;CACd,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,eAAe,EAAE,2BAA2B,CAAA;IAC5C,gBAAgB,EAAE,2BAA2B,EAAE,CAAA;IAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,EAAE,OAAO,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAU,QAAO,sBAA2B;;;;EAUzE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAU,gBAAgB,MAAM,kBAWhE,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAU,gBAAgB,MAAM,kBAW/D,CAAA;AAED,eAAO,MAAM,wBAAwB,qBAKpC,CAAA;AAQD,eAAO,MAAM,uBAAuB,QAAa,OAAO,CAAC,oBAAoB,CAO5E,CAAA;AAED,eAAO,MAAM,0BAA0B,GACrC,SAAS,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,iBAAiB,GAAG,kBAAkB,CAAC,CAAC,KACnF,OAAO,CAAC,oBAAoB,CAM9B,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAU,YAAmB;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO;;;EAStF,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { configureRtsPouchStore, destroyAllCollections, destroyCollection, deleteDocs, getCollection, resetRtsPouchStore, runQuery, updateDocs, type RtsPouchQueryContext, type RtsPouchQueryOptions, type RtsPouchStoreConfig, } from './
|
|
2
|
-
export { addLocalTxn, connect, disconnect, onMessage, reconnect, registerQuery, sendMessage, syncRtsChanges, type RtsConnectOptions, type RtsQueryContext, type RtsQueryOptions, } from './
|
|
3
|
-
export { useQuery, type UseRtsQueryOptions, type UseRtsQueryResult, } from './
|
|
4
|
-
//# sourceMappingURL=
|
|
1
|
+
export { configureRtsPouchStore, destroyAllCollections, destroyCollection, deleteDocs, getCollection, resetRtsPouchStore, runQuery, updateDocs, type RtsPouchQueryContext, type RtsPouchQueryOptions, type RtsPouchStoreConfig, } from './pouchStore';
|
|
2
|
+
export { addLocalTxn, connect, disconnect, onMessage, reconnect, registerQuery, sendMessage, syncRtsChanges, type RtsConnectOptions, type RtsQueryContext, type RtsQueryOptions, } from './wsClient';
|
|
3
|
+
export { useQuery, type UseRtsQueryOptions, type UseRtsQueryResult, } from './useQuery';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,WAAW,EACX,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,YAAY,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpcbase/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.340.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"default": "./dist/index.js"
|
|
15
15
|
},
|
|
16
16
|
"./rts": {
|
|
17
|
-
"types": "./dist/rts.d.ts",
|
|
18
|
-
"import": "./dist/rts.js",
|
|
19
|
-
"default": "./dist/rts.js"
|
|
17
|
+
"types": "./dist/rts/index.d.ts",
|
|
18
|
+
"import": "./dist/rts/index.js",
|
|
19
|
+
"default": "./dist/rts/index.js"
|
|
20
20
|
},
|
|
21
21
|
"./instrument": {
|
|
22
22
|
"types": "./dist/instrument.d.ts",
|
|
@@ -82,13 +82,14 @@
|
|
|
82
82
|
"pouchdb-adapter-indexeddb": "9.0.0",
|
|
83
83
|
"pouchdb-core": "9.0.0",
|
|
84
84
|
"pouchdb-find": "9.0.0",
|
|
85
|
+
"react-grab": "0.0.94",
|
|
85
86
|
"sonner": "2.0.7"
|
|
86
87
|
},
|
|
87
88
|
"peerDependencies": {
|
|
88
89
|
"axios": "^1.13"
|
|
89
90
|
},
|
|
90
91
|
"devDependencies": {
|
|
91
|
-
"fast-equals": "
|
|
92
|
+
"fast-equals": "6.0.0",
|
|
92
93
|
"lodash": "4.17.21"
|
|
93
94
|
}
|
|
94
95
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installGlobalNavigationGuard.test.d.ts","sourceRoot":"","sources":["../../src/navigationGuard/installGlobalNavigationGuard.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wsClient.sync.test.d.ts","sourceRoot":"","sources":["../../src/rts/wsClient.sync.test.ts"],"names":[],"mappings":""}
|
package/dist/rts.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rts.d.ts","sourceRoot":"","sources":["../src/rts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,WAAW,EACX,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAA"}
|
|
File without changes
|