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