@katlux/providers 0.1.1-alpha.101 → 0.1.1-alpha.103
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/index.cjs +381 -298
- package/dist/index.d.cts +49 -8
- package/dist/index.d.mts +49 -8
- package/dist/index.d.ts +49 -8
- package/dist/index.mjs +380 -298
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -18,7 +18,8 @@ var EDataFilterOperator = /* @__PURE__ */ ((EDataFilterOperator2) => {
|
|
|
18
18
|
})(EDataFilterOperator || {});
|
|
19
19
|
var ECacheStrategy = /* @__PURE__ */ ((ECacheStrategy2) => {
|
|
20
20
|
ECacheStrategy2["Application"] = "Application";
|
|
21
|
-
ECacheStrategy2["
|
|
21
|
+
ECacheStrategy2["ServerSession"] = "ServerSession";
|
|
22
|
+
ECacheStrategy2["BrowserSession"] = "BrowserSession";
|
|
22
23
|
ECacheStrategy2["Memory"] = "Memory";
|
|
23
24
|
ECacheStrategy2["LocalStorage"] = "LocalStorage";
|
|
24
25
|
ECacheStrategy2["IndexedDB"] = "IndexedDB";
|
|
@@ -308,14 +309,16 @@ class ADataProvider {
|
|
|
308
309
|
} catch {
|
|
309
310
|
}
|
|
310
311
|
}
|
|
312
|
+
const filterDebounceTime = typeof options?.filterDebounce === "number" ? options.filterDebounce : 300;
|
|
313
|
+
const sortDebounceTime = typeof options?.sortDebounce === "number" ? options.sortDebounce : 200;
|
|
311
314
|
this._debouncedFilterLoad = useDebounce(() => {
|
|
312
315
|
this._currentPage = 1;
|
|
313
316
|
this.loadPageData();
|
|
314
|
-
},
|
|
317
|
+
}, filterDebounceTime);
|
|
315
318
|
this._debouncedSortLoad = useDebounce(() => {
|
|
316
319
|
this._currentPage = 1;
|
|
317
320
|
this.loadPageData();
|
|
318
|
-
},
|
|
321
|
+
}, sortDebounceTime);
|
|
319
322
|
this.setFilter = this.setFilter.bind(this);
|
|
320
323
|
this.setSortList = this.setSortList.bind(this);
|
|
321
324
|
this.setCurrentPage = this.setCurrentPage.bind(this);
|
|
@@ -406,14 +409,21 @@ class ADataProvider {
|
|
|
406
409
|
selectAll: this.selectAll
|
|
407
410
|
};
|
|
408
411
|
}
|
|
409
|
-
setFilter(filter) {
|
|
412
|
+
setFilter(filter, immediate = false) {
|
|
410
413
|
this._filter = filter;
|
|
411
|
-
this.
|
|
414
|
+
this._currentPage = 1;
|
|
415
|
+
if (immediate) {
|
|
416
|
+
this._debouncedFilterLoad?.cancel?.();
|
|
417
|
+
this.loadPageData();
|
|
418
|
+
} else {
|
|
419
|
+
this._debouncedFilterLoad();
|
|
420
|
+
}
|
|
412
421
|
}
|
|
413
422
|
setSortList(sortList, immediate = false) {
|
|
414
423
|
this._sortList = sortList;
|
|
415
424
|
this._currentPage = 1;
|
|
416
425
|
if (immediate) {
|
|
426
|
+
this._debouncedSortLoad?.cancel?.();
|
|
417
427
|
this.loadPageData();
|
|
418
428
|
} else {
|
|
419
429
|
this._debouncedSortLoad();
|
|
@@ -493,22 +503,38 @@ const compareValues = (rowValue, filterValue) => {
|
|
|
493
503
|
return String(rowValue).localeCompare(String(filterValue));
|
|
494
504
|
};
|
|
495
505
|
const compareAnd = (row, nested) => {
|
|
496
|
-
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
|
|
506
|
+
if (!nested) return true;
|
|
507
|
+
const subFilters = Array.isArray(nested) ? nested : typeof nested === "object" ? Object.values(nested) : [];
|
|
508
|
+
const len = subFilters.length;
|
|
509
|
+
for (let i = 0; i < len; i++) {
|
|
510
|
+
const f = subFilters[i];
|
|
511
|
+
if (f && typeof f === "object" && "operator" in f && "field" in f) {
|
|
512
|
+
const active = f.active !== false;
|
|
513
|
+
if (active && !evaluateFilter(f, row)) {
|
|
514
|
+
return false;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
return true;
|
|
503
519
|
};
|
|
504
520
|
const compareOr = (row, nested) => {
|
|
505
|
-
|
|
506
|
-
const
|
|
507
|
-
const
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
521
|
+
if (!nested) return true;
|
|
522
|
+
const subFilters = Array.isArray(nested) ? nested : typeof nested === "object" ? Object.values(nested) : [];
|
|
523
|
+
const len = subFilters.length;
|
|
524
|
+
let hasActive = false;
|
|
525
|
+
for (let i = 0; i < len; i++) {
|
|
526
|
+
const f = subFilters[i];
|
|
527
|
+
if (f && typeof f === "object" && "operator" in f && "field" in f) {
|
|
528
|
+
const active = f.active !== false;
|
|
529
|
+
if (active) {
|
|
530
|
+
hasActive = true;
|
|
531
|
+
if (evaluateFilter(f, row)) {
|
|
532
|
+
return true;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
return !hasActive;
|
|
512
538
|
};
|
|
513
539
|
const applyOperator = (operator, rowValue, filterValue) => {
|
|
514
540
|
switch (operator) {
|
|
@@ -541,20 +567,26 @@ const applyOperator = (operator, rowValue, filterValue) => {
|
|
|
541
567
|
}
|
|
542
568
|
};
|
|
543
569
|
const evaluateFilter = (filter, row) => {
|
|
544
|
-
if (!filter || !filter.operator) return true;
|
|
545
|
-
|
|
546
|
-
|
|
570
|
+
if (!filter || !filter.operator || filter.active === false) return true;
|
|
571
|
+
const op = filter.operator;
|
|
572
|
+
if (op === EDataFilterOperator.And || op === EDataFilterOperator.Or || op === EDataFilterOperator.Nand || op === EDataFilterOperator.Nor) {
|
|
573
|
+
return applyOperator(op, row, filter.field);
|
|
547
574
|
}
|
|
548
575
|
if (filter.field && typeof filter.field === "object" && "operator" in filter.field && "field" in filter.field) {
|
|
549
|
-
return
|
|
576
|
+
return evaluateFilter(filter.field, row);
|
|
550
577
|
}
|
|
551
578
|
const field = filter.field;
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
579
|
+
if (!field || typeof field !== "object") return true;
|
|
580
|
+
for (const key in field) {
|
|
581
|
+
if (Object.prototype.hasOwnProperty.call(field, key)) {
|
|
582
|
+
const filterValue = field[key];
|
|
583
|
+
const rowValue = row ? row[key] : void 0;
|
|
584
|
+
if (!applyOperator(op, rowValue, filterValue)) {
|
|
585
|
+
return false;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
return true;
|
|
558
590
|
};
|
|
559
591
|
const filterTreeData = (nodes, filter, options) => {
|
|
560
592
|
const { idKey, parentKey } = options;
|
|
@@ -622,7 +654,13 @@ const filterData = (data, filter, options) => {
|
|
|
622
654
|
);
|
|
623
655
|
return { results: visibleNodes, expandedNodes };
|
|
624
656
|
}
|
|
625
|
-
const
|
|
657
|
+
const len = data.length;
|
|
658
|
+
const results = [];
|
|
659
|
+
for (let i = 0; i < len; i++) {
|
|
660
|
+
if (evaluateFilter(filter, data[i])) {
|
|
661
|
+
results.push(data[i]);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
626
664
|
return { results };
|
|
627
665
|
};
|
|
628
666
|
const useFilterLogic = () => {
|
|
@@ -690,16 +728,50 @@ const useSortLogic = () => {
|
|
|
690
728
|
};
|
|
691
729
|
|
|
692
730
|
class CFlatClientDataProvider extends ADataProvider {
|
|
693
|
-
|
|
731
|
+
_allData = [];
|
|
694
732
|
filteredData = [];
|
|
733
|
+
// Reference map array holding active sorted & filtered row references
|
|
734
|
+
_rowMap = [];
|
|
735
|
+
_filterDirty = true;
|
|
736
|
+
_sortDirty = true;
|
|
695
737
|
constructor(options) {
|
|
696
738
|
super(options);
|
|
697
739
|
}
|
|
740
|
+
get allData() {
|
|
741
|
+
return this._allData;
|
|
742
|
+
}
|
|
743
|
+
set allData(data) {
|
|
744
|
+
this._allData = Array.isArray(data) ? data : [];
|
|
745
|
+
this._filterDirty = true;
|
|
746
|
+
this._sortDirty = true;
|
|
747
|
+
}
|
|
748
|
+
get rowMap() {
|
|
749
|
+
return this._rowMap;
|
|
750
|
+
}
|
|
698
751
|
setData(data) {
|
|
699
752
|
this.allData = Array.isArray(data) ? data : [];
|
|
700
753
|
this.loadPageData();
|
|
701
754
|
}
|
|
755
|
+
setFilter(filter, immediate = false) {
|
|
756
|
+
this._filterDirty = true;
|
|
757
|
+
this._sortDirty = true;
|
|
758
|
+
super.setFilter(filter, immediate);
|
|
759
|
+
}
|
|
760
|
+
setSortList(sortList, immediate = false) {
|
|
761
|
+
this._sortDirty = true;
|
|
762
|
+
super.setSortList(sortList, immediate);
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Explicitly rebuilds the reference map array if row properties inside allData were mutated in-place.
|
|
766
|
+
*/
|
|
767
|
+
updateMap() {
|
|
768
|
+
this._filterDirty = true;
|
|
769
|
+
this._sortDirty = true;
|
|
770
|
+
this.loadPageData();
|
|
771
|
+
}
|
|
702
772
|
async refreshData(options) {
|
|
773
|
+
this._filterDirty = true;
|
|
774
|
+
this._sortDirty = true;
|
|
703
775
|
await this.loadPageData();
|
|
704
776
|
}
|
|
705
777
|
async refresh(hardRefresh = false) {
|
|
@@ -710,22 +782,31 @@ class CFlatClientDataProvider extends ADataProvider {
|
|
|
710
782
|
this.loading = true;
|
|
711
783
|
this.error = null;
|
|
712
784
|
try {
|
|
713
|
-
if (
|
|
714
|
-
this.
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
785
|
+
if (this._filterDirty) {
|
|
786
|
+
if (!this.filter || !this.filter.active) {
|
|
787
|
+
this.filteredData = this.allData;
|
|
788
|
+
} else {
|
|
789
|
+
const { results } = filterData(this.allData, this.filter);
|
|
790
|
+
this.filteredData = results;
|
|
791
|
+
}
|
|
792
|
+
this.rowCount = this.filteredData.length;
|
|
793
|
+
this._filterDirty = false;
|
|
794
|
+
this._sortDirty = true;
|
|
718
795
|
}
|
|
719
|
-
this.
|
|
720
|
-
|
|
721
|
-
|
|
796
|
+
if (this._sortDirty) {
|
|
797
|
+
if (this.sortList.length > 0) {
|
|
798
|
+
this._rowMap = sortData(this.sortList, this.filteredData);
|
|
799
|
+
} else {
|
|
800
|
+
this._rowMap = this.filteredData;
|
|
801
|
+
}
|
|
802
|
+
this._sortDirty = false;
|
|
722
803
|
}
|
|
723
804
|
if (this.pageSize <= 0) {
|
|
724
|
-
this.pageData = this.
|
|
805
|
+
this.pageData = this._rowMap;
|
|
725
806
|
} else {
|
|
726
807
|
const startIndex = (this.currentPage - 1) * this.pageSize;
|
|
727
808
|
const endIndex = startIndex + this.pageSize;
|
|
728
|
-
this.pageData = this.
|
|
809
|
+
this.pageData = this._rowMap.slice(startIndex, endIndex);
|
|
729
810
|
}
|
|
730
811
|
} catch (err) {
|
|
731
812
|
this.error = err;
|
|
@@ -743,7 +824,8 @@ class CacheProviderFactory {
|
|
|
743
824
|
static customDrivers = /* @__PURE__ */ new Map();
|
|
744
825
|
static defaultLoaders = {
|
|
745
826
|
[ECacheStrategy.Application]: () => Promise.resolve().then(function () { return CApplicationCache$1; }).then((m) => m.CApplicationCache),
|
|
746
|
-
[ECacheStrategy.
|
|
827
|
+
[ECacheStrategy.ServerSession]: () => Promise.resolve().then(function () { return CServerSessionCache$1; }).then((m) => m.CServerSessionCache),
|
|
828
|
+
[ECacheStrategy.BrowserSession]: () => Promise.resolve().then(function () { return CBrowserSessionCache$1; }).then((m) => m.CBrowserSessionCache),
|
|
747
829
|
[ECacheStrategy.Memory]: () => Promise.resolve().then(function () { return CMemoryCache$1; }).then((m) => m.CMemoryCache),
|
|
748
830
|
[ECacheStrategy.LocalStorage]: () => Promise.resolve().then(function () { return CLocalStorageCache$1; }).then((m) => m.CLocalStorageCache),
|
|
749
831
|
[ECacheStrategy.IndexedDB]: () => Promise.resolve().then(function () { return CIndexedDBCache$1; }).then((m) => m.CIndexedDBCache),
|
|
@@ -2361,7 +2443,7 @@ class CAPIFlatClientDataProvider extends CFlatClientDataProvider {
|
|
|
2361
2443
|
} else {
|
|
2362
2444
|
this.allData[index] = { ...this.allData[index], ...item };
|
|
2363
2445
|
}
|
|
2364
|
-
this.
|
|
2446
|
+
this.updateMap();
|
|
2365
2447
|
}
|
|
2366
2448
|
if (this.requestProvider.cacheProvider) {
|
|
2367
2449
|
await this.requestProvider.cacheProvider.removeByPrefix(this.apiUrl);
|
|
@@ -2634,10 +2716,16 @@ class CTreeClientDataProvider extends CFlatClientDataProvider {
|
|
|
2634
2716
|
_staticNodesCache = null;
|
|
2635
2717
|
_nodeMapCache = null;
|
|
2636
2718
|
_sortedNodeIdsCache = null;
|
|
2719
|
+
_filteredNodesCache = null;
|
|
2637
2720
|
invalidateStaticCache() {
|
|
2638
2721
|
this._staticNodesCache = null;
|
|
2639
2722
|
this._nodeMapCache = null;
|
|
2640
2723
|
this._sortedNodeIdsCache = null;
|
|
2724
|
+
this._filteredNodesCache = null;
|
|
2725
|
+
}
|
|
2726
|
+
setFilter(filter, immediate = false) {
|
|
2727
|
+
this._filteredNodesCache = null;
|
|
2728
|
+
super.setFilter(filter, immediate);
|
|
2641
2729
|
}
|
|
2642
2730
|
get _staticNodes() {
|
|
2643
2731
|
if (!this._staticNodesCache) {
|
|
@@ -2850,29 +2938,32 @@ class CTreeClientDataProvider extends CFlatClientDataProvider {
|
|
|
2850
2938
|
const nodeMap = this._nodeMap;
|
|
2851
2939
|
const sortedIds = this._sortedNodeIds;
|
|
2852
2940
|
if (this.filter && this.filter.active) {
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2941
|
+
if (!this._filteredNodesCache) {
|
|
2942
|
+
const matchingNodes = this._staticNodes.filter((node) => evaluateFilter(this.filter, node.data));
|
|
2943
|
+
const matchingIds = new Set(matchingNodes.map((node) => node.id));
|
|
2944
|
+
const visibleIds = /* @__PURE__ */ new Set();
|
|
2945
|
+
matchingIds.forEach((id) => {
|
|
2946
|
+
let current = nodeMap.get(id);
|
|
2947
|
+
while (current) {
|
|
2948
|
+
visibleIds.add(current.id);
|
|
2949
|
+
current = current.parentId != null ? nodeMap.get(current.parentId) : void 0;
|
|
2950
|
+
}
|
|
2951
|
+
});
|
|
2952
|
+
const filterExpanded = new Set(this.expandedNodes);
|
|
2953
|
+
visibleIds.forEach((id) => {
|
|
2954
|
+
if (nodeMap.get(id)?.hasChildren) {
|
|
2955
|
+
filterExpanded.add(id);
|
|
2956
|
+
}
|
|
2957
|
+
});
|
|
2958
|
+
this._filteredNodesCache = sortedIds.filter((id) => visibleIds.has(id)).map((id) => {
|
|
2959
|
+
const node = nodeMap.get(id);
|
|
2960
|
+
return {
|
|
2961
|
+
...node,
|
|
2962
|
+
isExpanded: filterExpanded.has(id)
|
|
2963
|
+
};
|
|
2964
|
+
});
|
|
2965
|
+
}
|
|
2966
|
+
const filteredNodes = this._filteredNodesCache;
|
|
2876
2967
|
this.filteredData = filteredNodes;
|
|
2877
2968
|
const paginated = this.paginateNodes(filteredNodes);
|
|
2878
2969
|
this.pageData = paginated.map((node) => ({
|
|
@@ -3720,16 +3811,16 @@ const CCookieCache$1 = {
|
|
|
3720
3811
|
CCookieCache: CCookieCache
|
|
3721
3812
|
};
|
|
3722
3813
|
|
|
3723
|
-
class
|
|
3814
|
+
class CServerSessionCache extends ACacheProvider {
|
|
3724
3815
|
static instance = null;
|
|
3725
3816
|
static getInstance() {
|
|
3726
3817
|
if (!this.instance) {
|
|
3727
|
-
this.instance = new
|
|
3818
|
+
this.instance = new CServerSessionCache();
|
|
3728
3819
|
}
|
|
3729
3820
|
return this.instance;
|
|
3730
3821
|
}
|
|
3731
3822
|
static get storage() {
|
|
3732
|
-
const globalKey = Symbol.for("
|
|
3823
|
+
const globalKey = Symbol.for("Katlux_CServerSessionCache_Storage");
|
|
3733
3824
|
const _global = globalThis;
|
|
3734
3825
|
if (!_global[globalKey]) {
|
|
3735
3826
|
_global[globalKey] = /* @__PURE__ */ new Map();
|
|
@@ -3748,7 +3839,7 @@ class CSessionCache extends ACacheProvider {
|
|
|
3748
3839
|
const now = Date.now();
|
|
3749
3840
|
const prefix = "cache:";
|
|
3750
3841
|
const sessionsToDelete = [];
|
|
3751
|
-
for (const [sessionId, sessionData] of
|
|
3842
|
+
for (const [sessionId, sessionData] of CServerSessionCache.storage.entries()) {
|
|
3752
3843
|
const keysToDelete = [];
|
|
3753
3844
|
for (const [key, entry] of sessionData.entries()) {
|
|
3754
3845
|
if (key.startsWith(prefix) && now - entry.timestamp > entry.lifetime) {
|
|
@@ -3763,19 +3854,18 @@ class CSessionCache extends ACacheProvider {
|
|
|
3763
3854
|
}
|
|
3764
3855
|
}
|
|
3765
3856
|
for (const sessionId of sessionsToDelete) {
|
|
3766
|
-
|
|
3857
|
+
CServerSessionCache.storage.delete(sessionId);
|
|
3767
3858
|
}
|
|
3768
|
-
while (
|
|
3769
|
-
const oldestSessionKey =
|
|
3859
|
+
while (CServerSessionCache.storage.size >= CServerSessionCache.MAX_SERVER_SESSIONS && CServerSessionCache.storage.size > 0) {
|
|
3860
|
+
const oldestSessionKey = CServerSessionCache.storage.keys().next().value;
|
|
3770
3861
|
if (oldestSessionKey) {
|
|
3771
|
-
|
|
3862
|
+
CServerSessionCache.storage.delete(oldestSessionKey);
|
|
3772
3863
|
} else {
|
|
3773
3864
|
break;
|
|
3774
3865
|
}
|
|
3775
3866
|
}
|
|
3776
3867
|
}
|
|
3777
3868
|
sessionIdCache = null;
|
|
3778
|
-
sessionId = null;
|
|
3779
3869
|
SESSION_ID_KEY = "_session_id";
|
|
3780
3870
|
constructor() {
|
|
3781
3871
|
super();
|
|
@@ -3803,57 +3893,34 @@ class CSessionCache extends ACacheProvider {
|
|
|
3803
3893
|
});
|
|
3804
3894
|
}
|
|
3805
3895
|
/**
|
|
3806
|
-
* Get or create sessionId
|
|
3896
|
+
* Get or create sessionId — server-only path.
|
|
3897
|
+
* Returns '__no_session__' sentinel when no isolatable H3 event context is available.
|
|
3807
3898
|
*/
|
|
3808
3899
|
async getSessionId(context) {
|
|
3809
3900
|
const event = context?.event ?? context?.ssrContext?.event ?? (context?.node ? context : null);
|
|
3810
|
-
|
|
3811
|
-
if (isServer && !event) {
|
|
3901
|
+
if (!event) {
|
|
3812
3902
|
return "__no_session__";
|
|
3813
3903
|
}
|
|
3814
3904
|
const contextSessionId = event?.context?.sessionId;
|
|
3815
3905
|
if (contextSessionId) {
|
|
3816
3906
|
return contextSessionId;
|
|
3817
3907
|
}
|
|
3818
|
-
if (!isServer && this.sessionId) {
|
|
3819
|
-
return this.sessionId;
|
|
3820
|
-
}
|
|
3821
3908
|
let existingId = null;
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
if (match) existingId = decodeURIComponent(match[1]);
|
|
3827
|
-
} else if (!isServer && typeof document !== "undefined") {
|
|
3828
|
-
const match = document.cookie.match(/(?:^|; )_session_id=([^;]*)/);
|
|
3829
|
-
if (match) existingId = decodeURIComponent(match[1]);
|
|
3830
|
-
}
|
|
3909
|
+
const req = event.node?.req || event.req;
|
|
3910
|
+
const cookieHeader = req?.headers?.cookie || "";
|
|
3911
|
+
const match = cookieHeader.match(/(?:^|; )_session_id=([^;]*)/);
|
|
3912
|
+
if (match) existingId = decodeURIComponent(match[1]);
|
|
3831
3913
|
if (!existingId && this.sessionIdCache) {
|
|
3832
3914
|
existingId = await this.sessionIdCache.get(this.SESSION_ID_KEY, context);
|
|
3833
3915
|
}
|
|
3834
3916
|
if (existingId) {
|
|
3835
|
-
if (
|
|
3836
|
-
|
|
3837
|
-
if (!event.context) event.context = {};
|
|
3838
|
-
event.context.sessionId = existingId;
|
|
3839
|
-
}
|
|
3840
|
-
} else {
|
|
3841
|
-
this.sessionId = existingId;
|
|
3842
|
-
}
|
|
3917
|
+
if (!event.context) event.context = {};
|
|
3918
|
+
event.context.sessionId = existingId;
|
|
3843
3919
|
return existingId;
|
|
3844
3920
|
}
|
|
3845
3921
|
const newId = this.generateSessionId();
|
|
3846
|
-
if (
|
|
3847
|
-
|
|
3848
|
-
if (!event.context) event.context = {};
|
|
3849
|
-
event.context.sessionId = newId;
|
|
3850
|
-
}
|
|
3851
|
-
} else {
|
|
3852
|
-
this.sessionId = newId;
|
|
3853
|
-
if (typeof document !== "undefined") {
|
|
3854
|
-
document.cookie = `_session_id=${encodeURIComponent(newId)}; path=/; max-age=31536000; SameSite=Lax`;
|
|
3855
|
-
}
|
|
3856
|
-
}
|
|
3922
|
+
if (!event.context) event.context = {};
|
|
3923
|
+
event.context.sessionId = newId;
|
|
3857
3924
|
if (this.sessionIdCache) {
|
|
3858
3925
|
await this.sessionIdCache.set(this.SESSION_ID_KEY, newId, 365 * 24 * 60 * 60 * 1e3, context);
|
|
3859
3926
|
}
|
|
@@ -3861,71 +3928,30 @@ class CSessionCache extends ACacheProvider {
|
|
|
3861
3928
|
}
|
|
3862
3929
|
async getKeyList(context) {
|
|
3863
3930
|
const prefix = "cache:";
|
|
3864
|
-
const
|
|
3865
|
-
const
|
|
3866
|
-
if (
|
|
3867
|
-
|
|
3868
|
-
const sessionData = CSessionCache.storage.get(sessionId);
|
|
3869
|
-
if (!sessionData) {
|
|
3870
|
-
return [];
|
|
3871
|
-
}
|
|
3872
|
-
return Array.from(sessionData.keys()).filter((key) => key.startsWith(prefix)).map((key) => key.substring(prefix.length));
|
|
3873
|
-
}
|
|
3874
|
-
if (typeof window !== "undefined" && typeof sessionStorage !== "undefined") {
|
|
3875
|
-
return Object.keys(sessionStorage).filter((key) => key.startsWith(prefix)).map((key) => key.substring(prefix.length));
|
|
3931
|
+
const sessionId = await this.getSessionId(context);
|
|
3932
|
+
const sessionData = CServerSessionCache.storage.get(sessionId);
|
|
3933
|
+
if (!sessionData) {
|
|
3934
|
+
return [];
|
|
3876
3935
|
}
|
|
3877
|
-
return
|
|
3936
|
+
return Array.from(sessionData.keys()).filter((key) => key.startsWith(prefix)).map((key) => key.substring(prefix.length));
|
|
3878
3937
|
}
|
|
3879
3938
|
async get(key, context) {
|
|
3880
3939
|
const prefixedKey = "cache:" + key;
|
|
3881
|
-
const
|
|
3882
|
-
const
|
|
3883
|
-
if (
|
|
3884
|
-
|
|
3885
|
-
const sessionData = CSessionCache.storage.get(sessionId);
|
|
3886
|
-
if (!sessionData) {
|
|
3887
|
-
return null;
|
|
3888
|
-
}
|
|
3889
|
-
const entry = sessionData.get(prefixedKey);
|
|
3890
|
-
if (!entry) {
|
|
3891
|
-
return null;
|
|
3892
|
-
}
|
|
3893
|
-
if (Date.now() - entry.timestamp <= entry.lifetime) {
|
|
3894
|
-
return entry.data;
|
|
3895
|
-
} else {
|
|
3896
|
-
sessionData.delete(prefixedKey);
|
|
3897
|
-
return null;
|
|
3898
|
-
}
|
|
3940
|
+
const sessionId = await this.getSessionId(context);
|
|
3941
|
+
const sessionData = CServerSessionCache.storage.get(sessionId);
|
|
3942
|
+
if (!sessionData) {
|
|
3943
|
+
return null;
|
|
3899
3944
|
}
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
sessionStorage.removeItem(prefixedKey);
|
|
3909
|
-
}
|
|
3910
|
-
}
|
|
3911
|
-
} catch (e) {
|
|
3912
|
-
console.warn("[Katlux Cache] CSessionCache parse error for key: " + key, e);
|
|
3913
|
-
}
|
|
3914
|
-
try {
|
|
3915
|
-
const payloadData = getSSRPayload(context);
|
|
3916
|
-
if (payloadData && payloadData[prefixedKey]) {
|
|
3917
|
-
const entry = payloadData[prefixedKey];
|
|
3918
|
-
if (Date.now() - entry.timestamp <= entry.lifetime) {
|
|
3919
|
-
window.sessionStorage.setItem(prefixedKey, JSON.stringify(entry));
|
|
3920
|
-
return entry.data;
|
|
3921
|
-
}
|
|
3922
|
-
}
|
|
3923
|
-
} catch (e) {
|
|
3924
|
-
console.warn("[Katlux Cache] CSessionCache SSR payload fallback error for key: " + key, e);
|
|
3925
|
-
}
|
|
3945
|
+
const entry = sessionData.get(prefixedKey);
|
|
3946
|
+
if (!entry) {
|
|
3947
|
+
return null;
|
|
3948
|
+
}
|
|
3949
|
+
if (Date.now() - entry.timestamp <= entry.lifetime) {
|
|
3950
|
+
return entry.data;
|
|
3951
|
+
} else {
|
|
3952
|
+
sessionData.delete(prefixedKey);
|
|
3926
3953
|
return null;
|
|
3927
3954
|
}
|
|
3928
|
-
return null;
|
|
3929
3955
|
}
|
|
3930
3956
|
async set(key, data, lifetime, context) {
|
|
3931
3957
|
const prefixedKey = "cache:" + key;
|
|
@@ -3934,181 +3960,237 @@ class CSessionCache extends ACacheProvider {
|
|
|
3934
3960
|
timestamp: Date.now(),
|
|
3935
3961
|
lifetime
|
|
3936
3962
|
};
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
if (sessionId === "__no_session__") return;
|
|
3943
|
-
if (CSessionCache.storage.size >= CSessionCache.MAX_SERVER_SESSIONS) {
|
|
3944
|
-
CSessionCache.purgeExpiredServerSessions();
|
|
3945
|
-
}
|
|
3946
|
-
let sessionData = CSessionCache.storage.get(sessionId);
|
|
3947
|
-
if (!sessionData) {
|
|
3948
|
-
sessionData = /* @__PURE__ */ new Map();
|
|
3949
|
-
CSessionCache.storage.set(sessionId, sessionData);
|
|
3950
|
-
}
|
|
3951
|
-
sessionData.set(prefixedKey, entry);
|
|
3952
|
-
} catch (e) {
|
|
3953
|
-
console.warn("[Katlux Cache] CSessionCache server session storage error for key: " + key, e);
|
|
3963
|
+
try {
|
|
3964
|
+
const sessionId = await this.getSessionId(context);
|
|
3965
|
+
if (sessionId === "__no_session__") return;
|
|
3966
|
+
if (CServerSessionCache.storage.size >= CServerSessionCache.MAX_SERVER_SESSIONS) {
|
|
3967
|
+
CServerSessionCache.purgeExpiredServerSessions();
|
|
3954
3968
|
}
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
sessionStorage.setItem(prefixedKey, JSON.stringify(entry));
|
|
3960
|
-
} catch (e) {
|
|
3961
|
-
console.warn("[Katlux Cache] CSessionCache sessionStorage setItem error (possible quota exceeded) for key: " + key, e);
|
|
3969
|
+
let sessionData = CServerSessionCache.storage.get(sessionId);
|
|
3970
|
+
if (!sessionData) {
|
|
3971
|
+
sessionData = /* @__PURE__ */ new Map();
|
|
3972
|
+
CServerSessionCache.storage.set(sessionId, sessionData);
|
|
3962
3973
|
}
|
|
3974
|
+
sessionData.set(prefixedKey, entry);
|
|
3975
|
+
} catch (e) {
|
|
3976
|
+
console.warn("[Katlux Cache] CServerSessionCache server session storage error for key: " + key, e);
|
|
3963
3977
|
}
|
|
3964
3978
|
}
|
|
3965
3979
|
async remove(key, context) {
|
|
3966
3980
|
const prefixedKey = "cache:" + key;
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
const payload = context.payload?.data || context.ssrContext?.payload?.data;
|
|
3978
|
-
if (payload && payload[prefixedKey]) {
|
|
3979
|
-
delete payload[prefixedKey];
|
|
3980
|
-
}
|
|
3981
|
+
try {
|
|
3982
|
+
const sessionId = await this.getSessionId(context);
|
|
3983
|
+
const sessionData = CServerSessionCache.storage.get(sessionId);
|
|
3984
|
+
if (sessionData) {
|
|
3985
|
+
sessionData.delete(prefixedKey);
|
|
3986
|
+
}
|
|
3987
|
+
if (context) {
|
|
3988
|
+
const payload = context.payload?.data || context.ssrContext?.payload?.data;
|
|
3989
|
+
if (payload && payload[prefixedKey]) {
|
|
3990
|
+
delete payload[prefixedKey];
|
|
3981
3991
|
}
|
|
3982
|
-
} catch (e) {
|
|
3983
|
-
console.warn("[Katlux Cache] CSessionCache remove error on server for key: " + key, e);
|
|
3984
3992
|
}
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
if (typeof window !== "undefined" && typeof sessionStorage !== "undefined") {
|
|
3988
|
-
sessionStorage.removeItem(prefixedKey);
|
|
3993
|
+
} catch (e) {
|
|
3994
|
+
console.warn("[Katlux Cache] CServerSessionCache remove error for key: " + key, e);
|
|
3989
3995
|
}
|
|
3990
3996
|
}
|
|
3991
3997
|
async removeByPrefix(prefix, context) {
|
|
3992
3998
|
const fullPrefix = "cache:" + prefix;
|
|
3993
|
-
|
|
3994
|
-
const
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
+
try {
|
|
4000
|
+
const sessionId = await this.getSessionId(context);
|
|
4001
|
+
const sessionData = CServerSessionCache.storage.get(sessionId);
|
|
4002
|
+
if (sessionData) {
|
|
4003
|
+
const keysToDelete = [];
|
|
4004
|
+
for (const key of sessionData.keys()) {
|
|
4005
|
+
if (key.startsWith(fullPrefix)) {
|
|
4006
|
+
keysToDelete.push(key);
|
|
4007
|
+
}
|
|
4008
|
+
}
|
|
4009
|
+
for (const key of keysToDelete) {
|
|
4010
|
+
sessionData.delete(key);
|
|
3999
4011
|
}
|
|
4000
4012
|
}
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
if (typeof window === "undefined") {
|
|
4006
|
-
try {
|
|
4007
|
-
const sessionId = await this.getSessionId(context);
|
|
4008
|
-
const sessionData = CSessionCache.storage.get(sessionId);
|
|
4009
|
-
if (sessionData) {
|
|
4010
|
-
const keysToDelete = [];
|
|
4011
|
-
for (const key of sessionData.keys()) {
|
|
4013
|
+
if (context) {
|
|
4014
|
+
const payload = context.payload?.data || context.ssrContext?.payload?.data;
|
|
4015
|
+
if (payload) {
|
|
4016
|
+
for (const key in payload) {
|
|
4012
4017
|
if (key.startsWith(fullPrefix)) {
|
|
4013
|
-
|
|
4014
|
-
}
|
|
4015
|
-
}
|
|
4016
|
-
for (const key of keysToDelete) {
|
|
4017
|
-
sessionData.delete(key);
|
|
4018
|
-
}
|
|
4019
|
-
}
|
|
4020
|
-
if (context) {
|
|
4021
|
-
const payload = context.payload?.data || context.ssrContext?.payload?.data;
|
|
4022
|
-
if (payload) {
|
|
4023
|
-
for (const key in payload) {
|
|
4024
|
-
if (key.startsWith(fullPrefix)) {
|
|
4025
|
-
delete payload[key];
|
|
4026
|
-
}
|
|
4018
|
+
delete payload[key];
|
|
4027
4019
|
}
|
|
4028
4020
|
}
|
|
4029
4021
|
}
|
|
4030
|
-
} catch (e) {
|
|
4031
|
-
console.warn("[Katlux Cache] CSessionCache removeByPrefix error on server for prefix: " + prefix, e);
|
|
4032
4022
|
}
|
|
4023
|
+
} catch (e) {
|
|
4024
|
+
console.warn("[Katlux Cache] CServerSessionCache removeByPrefix error for prefix: " + prefix, e);
|
|
4033
4025
|
}
|
|
4034
4026
|
}
|
|
4035
4027
|
async getRemainingTime(key, context) {
|
|
4036
4028
|
const prefixedKey = "cache:" + key;
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
} catch (e) {
|
|
4044
|
-
console.warn("[Katlux Cache] CSessionCache getRemainingTime parse error for key: " + key, e);
|
|
4045
|
-
return null;
|
|
4046
|
-
}
|
|
4047
|
-
}
|
|
4048
|
-
if (typeof window === "undefined") {
|
|
4049
|
-
const sessionId = await this.getSessionId(context);
|
|
4050
|
-
const sessionData = CSessionCache.storage.get(sessionId);
|
|
4051
|
-
if (!sessionData) return null;
|
|
4052
|
-
const entry = sessionData.get(prefixedKey);
|
|
4053
|
-
if (!entry) return null;
|
|
4054
|
-
return Math.max(0, entry.timestamp + entry.lifetime - Date.now());
|
|
4055
|
-
}
|
|
4056
|
-
return null;
|
|
4029
|
+
const sessionId = await this.getSessionId(context);
|
|
4030
|
+
const sessionData = CServerSessionCache.storage.get(sessionId);
|
|
4031
|
+
if (!sessionData) return null;
|
|
4032
|
+
const entry = sessionData.get(prefixedKey);
|
|
4033
|
+
if (!entry) return null;
|
|
4034
|
+
return Math.max(0, entry.timestamp + entry.lifetime - Date.now());
|
|
4057
4035
|
}
|
|
4058
4036
|
async cleanupExpired() {
|
|
4059
4037
|
const prefix = "cache:";
|
|
4060
4038
|
const now = Date.now();
|
|
4061
|
-
|
|
4039
|
+
const sessionsToDelete = [];
|
|
4040
|
+
for (const [sessionId, sessionData] of CServerSessionCache.storage.entries()) {
|
|
4062
4041
|
const keysToDelete = [];
|
|
4063
|
-
for (
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
if (stored) {
|
|
4068
|
-
try {
|
|
4069
|
-
const entry = JSON.parse(stored);
|
|
4070
|
-
if (now - entry.timestamp > entry.lifetime) {
|
|
4071
|
-
keysToDelete.push(key);
|
|
4072
|
-
}
|
|
4073
|
-
} catch (e) {
|
|
4074
|
-
console.warn("[Katlux Cache] CSessionCache cleanupExpired parse error for key: " + key, e);
|
|
4075
|
-
keysToDelete.push(key);
|
|
4076
|
-
}
|
|
4042
|
+
for (const [key, entry] of sessionData.entries()) {
|
|
4043
|
+
if (key.startsWith(prefix)) {
|
|
4044
|
+
if (now - entry.timestamp > entry.lifetime) {
|
|
4045
|
+
keysToDelete.push(key);
|
|
4077
4046
|
}
|
|
4078
4047
|
}
|
|
4079
4048
|
}
|
|
4080
4049
|
for (const key of keysToDelete) {
|
|
4081
|
-
|
|
4050
|
+
sessionData.delete(key);
|
|
4051
|
+
}
|
|
4052
|
+
if (sessionData.size === 0) {
|
|
4053
|
+
sessionsToDelete.push(sessionId);
|
|
4082
4054
|
}
|
|
4083
4055
|
}
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4056
|
+
for (const sessionId of sessionsToDelete) {
|
|
4057
|
+
CServerSessionCache.storage.delete(sessionId);
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
}
|
|
4061
|
+
|
|
4062
|
+
const CServerSessionCache$1 = {
|
|
4063
|
+
__proto__: null,
|
|
4064
|
+
CServerSessionCache: CServerSessionCache
|
|
4065
|
+
};
|
|
4066
|
+
|
|
4067
|
+
class CBrowserSessionCache extends ACacheProvider {
|
|
4068
|
+
static instance = null;
|
|
4069
|
+
static getInstance() {
|
|
4070
|
+
if (!this.instance) {
|
|
4071
|
+
this.instance = new CBrowserSessionCache();
|
|
4072
|
+
}
|
|
4073
|
+
return this.instance;
|
|
4074
|
+
}
|
|
4075
|
+
PREFIX = "bscache:";
|
|
4076
|
+
async getKeyList(_context) {
|
|
4077
|
+
if (typeof window === "undefined") return [];
|
|
4078
|
+
return Object.keys(sessionStorage).filter((key) => key.startsWith(this.PREFIX)).map((key) => key.substring(this.PREFIX.length));
|
|
4079
|
+
}
|
|
4080
|
+
async get(key, context) {
|
|
4081
|
+
if (typeof window === "undefined") return null;
|
|
4082
|
+
const prefixedKey = this.PREFIX + key;
|
|
4083
|
+
try {
|
|
4084
|
+
const stored = sessionStorage.getItem(prefixedKey);
|
|
4085
|
+
if (stored) {
|
|
4086
|
+
const entry = JSON.parse(stored);
|
|
4087
|
+
if (Date.now() - entry.timestamp <= entry.lifetime) {
|
|
4088
|
+
return entry.data;
|
|
4089
|
+
} else {
|
|
4090
|
+
sessionStorage.removeItem(prefixedKey);
|
|
4091
|
+
}
|
|
4092
|
+
}
|
|
4093
|
+
} catch (e) {
|
|
4094
|
+
console.warn("[Katlux Cache] CBrowserSessionCache parse error for key: " + key, e);
|
|
4095
|
+
}
|
|
4096
|
+
try {
|
|
4097
|
+
const payloadData = getSSRPayload(context);
|
|
4098
|
+
if (payloadData && payloadData[prefixedKey]) {
|
|
4099
|
+
const entry = payloadData[prefixedKey];
|
|
4100
|
+
if (Date.now() - entry.timestamp <= entry.lifetime) {
|
|
4101
|
+
window.sessionStorage.setItem(prefixedKey, JSON.stringify(entry));
|
|
4102
|
+
return entry.data;
|
|
4103
|
+
}
|
|
4104
|
+
}
|
|
4105
|
+
} catch (e) {
|
|
4106
|
+
console.warn("[Katlux Cache] CBrowserSessionCache SSR payload hydration error for key: " + key, e);
|
|
4107
|
+
}
|
|
4108
|
+
return null;
|
|
4109
|
+
}
|
|
4110
|
+
async set(key, data, lifetime, context) {
|
|
4111
|
+
const prefixedKey = this.PREFIX + key;
|
|
4112
|
+
const entry = {
|
|
4113
|
+
data,
|
|
4114
|
+
timestamp: Date.now(),
|
|
4115
|
+
lifetime
|
|
4116
|
+
};
|
|
4117
|
+
if (typeof window === "undefined") {
|
|
4118
|
+
try {
|
|
4119
|
+
const payload = context?.payload?.data ?? context?.ssrContext?.payload?.data;
|
|
4120
|
+
if (payload) {
|
|
4121
|
+
payload[prefixedKey] = entry;
|
|
4122
|
+
}
|
|
4123
|
+
} catch (e) {
|
|
4124
|
+
console.warn("[Katlux Cache] CBrowserSessionCache SSR payload write error for key: " + key, e);
|
|
4125
|
+
}
|
|
4126
|
+
return;
|
|
4127
|
+
}
|
|
4128
|
+
try {
|
|
4129
|
+
sessionStorage.setItem(prefixedKey, JSON.stringify(entry));
|
|
4130
|
+
} catch (e) {
|
|
4131
|
+
console.warn("[Katlux Cache] CBrowserSessionCache sessionStorage setItem error (possible quota exceeded) for key: " + key, e);
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
async remove(key, _context) {
|
|
4135
|
+
if (typeof window === "undefined") return;
|
|
4136
|
+
sessionStorage.removeItem(this.PREFIX + key);
|
|
4137
|
+
}
|
|
4138
|
+
async removeByPrefix(prefix, _context) {
|
|
4139
|
+
if (typeof window === "undefined") return;
|
|
4140
|
+
const fullPrefix = this.PREFIX + prefix;
|
|
4141
|
+
const keysToDelete = [];
|
|
4142
|
+
for (let i = 0; i < sessionStorage.length; i++) {
|
|
4143
|
+
const key = sessionStorage.key(i);
|
|
4144
|
+
if (key && key.startsWith(fullPrefix)) {
|
|
4145
|
+
keysToDelete.push(key);
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
for (const key of keysToDelete) {
|
|
4149
|
+
sessionStorage.removeItem(key);
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4152
|
+
async getRemainingTime(key, _context) {
|
|
4153
|
+
if (typeof window === "undefined") return null;
|
|
4154
|
+
const stored = sessionStorage.getItem(this.PREFIX + key);
|
|
4155
|
+
if (!stored) return null;
|
|
4156
|
+
try {
|
|
4157
|
+
const entry = JSON.parse(stored);
|
|
4158
|
+
return Math.max(0, entry.timestamp + entry.lifetime - Date.now());
|
|
4159
|
+
} catch (e) {
|
|
4160
|
+
console.warn("[Katlux Cache] CBrowserSessionCache getRemainingTime parse error for key: " + key, e);
|
|
4161
|
+
return null;
|
|
4162
|
+
}
|
|
4163
|
+
}
|
|
4164
|
+
async cleanupExpired(_context) {
|
|
4165
|
+
if (typeof window === "undefined") return;
|
|
4166
|
+
const now = Date.now();
|
|
4167
|
+
const keysToDelete = [];
|
|
4168
|
+
for (let i = 0; i < sessionStorage.length; i++) {
|
|
4169
|
+
const key = sessionStorage.key(i);
|
|
4170
|
+
if (key && key.startsWith(this.PREFIX)) {
|
|
4171
|
+
const stored = sessionStorage.getItem(key);
|
|
4172
|
+
if (stored) {
|
|
4173
|
+
try {
|
|
4174
|
+
const entry = JSON.parse(stored);
|
|
4090
4175
|
if (now - entry.timestamp > entry.lifetime) {
|
|
4091
4176
|
keysToDelete.push(key);
|
|
4092
4177
|
}
|
|
4178
|
+
} catch (e) {
|
|
4179
|
+
console.warn("[Katlux Cache] CBrowserSessionCache cleanupExpired parse error for key: " + key, e);
|
|
4180
|
+
keysToDelete.push(key);
|
|
4093
4181
|
}
|
|
4094
4182
|
}
|
|
4095
|
-
for (const key of keysToDelete) {
|
|
4096
|
-
sessionData.delete(key);
|
|
4097
|
-
}
|
|
4098
|
-
if (sessionData.size === 0) {
|
|
4099
|
-
sessionsToDelete.push(sessionId);
|
|
4100
|
-
}
|
|
4101
|
-
}
|
|
4102
|
-
for (const sessionId of sessionsToDelete) {
|
|
4103
|
-
CSessionCache.storage.delete(sessionId);
|
|
4104
4183
|
}
|
|
4105
4184
|
}
|
|
4185
|
+
for (const key of keysToDelete) {
|
|
4186
|
+
sessionStorage.removeItem(key);
|
|
4187
|
+
}
|
|
4106
4188
|
}
|
|
4107
4189
|
}
|
|
4108
4190
|
|
|
4109
|
-
const
|
|
4191
|
+
const CBrowserSessionCache$1 = {
|
|
4110
4192
|
__proto__: null,
|
|
4111
|
-
|
|
4193
|
+
CBrowserSessionCache: CBrowserSessionCache
|
|
4112
4194
|
};
|
|
4113
4195
|
|
|
4114
4196
|
class CLocalStorageCache extends ACacheProvider {
|
|
@@ -4550,4 +4632,4 @@ const CIndexedDBCache$1 = {
|
|
|
4550
4632
|
CIndexedDBCache: CIndexedDBCache
|
|
4551
4633
|
};
|
|
4552
4634
|
|
|
4553
|
-
export { AAPIDataProvider, ADataProvider, CAPIFlatClientDataProvider, CAPIFlatServerDataProvider, CAPITreeClientDataProvider, CAPITreeServerDataProvider, CApplicationCache, CCookieCache, CFlatClientDataProvider, CFlatServerDataProvider, CIndexedDBCache, CLocalStorageCache, CMemoryCache,
|
|
4635
|
+
export { AAPIDataProvider, ADataProvider, CAPIFlatClientDataProvider, CAPIFlatServerDataProvider, CAPITreeClientDataProvider, CAPITreeServerDataProvider, CApplicationCache, CBrowserSessionCache, CCookieCache, CFlatClientDataProvider, CFlatServerDataProvider, CIndexedDBCache, CLocalStorageCache, CMemoryCache, CServerSessionCache, CTreeClientDataProvider, CTreeServerDataProvider, CacheProviderFactory, DefaultHydrationAdapter, ECacheStrategy, EDataFilterOperator, EQueueStorage, KatluxIndexedDB, QueueStorageFactory, RequestProvider, RequestProviderRegistry, RequestQueue, SENSITIVE_HEADER_KEYS, applyOperator, clearSSRData, compareAnd, compareEqual, compareIn, compareOr, compareValues, debounce, evaluateFilter, fetchWithSSR, filterData, filterTreeData, getAppRoute, getAppRouter, getHydrationAdapter, getPlatformApp, getSSRData, getSSRPayload, onPlatformReady, setHydrationAdapter, sortData, useDebounce, useFilterLogic, useSortLogic };
|