@oxyhq/core 1.0.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/README.md +50 -0
- package/dist/cjs/AuthManager.js +361 -0
- package/dist/cjs/CrossDomainAuth.js +258 -0
- package/dist/cjs/HttpService.js +618 -0
- package/dist/cjs/OxyServices.base.js +263 -0
- package/dist/cjs/OxyServices.errors.js +22 -0
- package/dist/cjs/OxyServices.js +63 -0
- package/dist/cjs/constants/version.js +16 -0
- package/dist/cjs/crypto/index.js +20 -0
- package/dist/cjs/crypto/keyManager.js +887 -0
- package/dist/cjs/crypto/polyfill.js +64 -0
- package/dist/cjs/crypto/recoveryPhrase.js +169 -0
- package/dist/cjs/crypto/signatureService.js +296 -0
- package/dist/cjs/i18n/index.js +73 -0
- package/dist/cjs/i18n/locales/ar-SA.json +120 -0
- package/dist/cjs/i18n/locales/ca-ES.json +120 -0
- package/dist/cjs/i18n/locales/de-DE.json +120 -0
- package/dist/cjs/i18n/locales/en-US.json +956 -0
- package/dist/cjs/i18n/locales/es-ES.json +944 -0
- package/dist/cjs/i18n/locales/fr-FR.json +120 -0
- package/dist/cjs/i18n/locales/it-IT.json +120 -0
- package/dist/cjs/i18n/locales/ja-JP.json +119 -0
- package/dist/cjs/i18n/locales/ko-KR.json +120 -0
- package/dist/cjs/i18n/locales/locales/ar-SA.json +120 -0
- package/dist/cjs/i18n/locales/locales/ca-ES.json +120 -0
- package/dist/cjs/i18n/locales/locales/de-DE.json +120 -0
- package/dist/cjs/i18n/locales/locales/en-US.json +956 -0
- package/dist/cjs/i18n/locales/locales/es-ES.json +944 -0
- package/dist/cjs/i18n/locales/locales/fr-FR.json +120 -0
- package/dist/cjs/i18n/locales/locales/it-IT.json +120 -0
- package/dist/cjs/i18n/locales/locales/ja-JP.json +119 -0
- package/dist/cjs/i18n/locales/locales/ko-KR.json +120 -0
- package/dist/cjs/i18n/locales/locales/pt-PT.json +120 -0
- package/dist/cjs/i18n/locales/locales/zh-CN.json +120 -0
- package/dist/cjs/i18n/locales/pt-PT.json +120 -0
- package/dist/cjs/i18n/locales/zh-CN.json +120 -0
- package/dist/cjs/index.js +153 -0
- package/dist/cjs/mixins/OxyServices.analytics.js +49 -0
- package/dist/cjs/mixins/OxyServices.assets.js +380 -0
- package/dist/cjs/mixins/OxyServices.auth.js +259 -0
- package/dist/cjs/mixins/OxyServices.developer.js +97 -0
- package/dist/cjs/mixins/OxyServices.devices.js +116 -0
- package/dist/cjs/mixins/OxyServices.features.js +309 -0
- package/dist/cjs/mixins/OxyServices.fedcm.js +435 -0
- package/dist/cjs/mixins/OxyServices.karma.js +108 -0
- package/dist/cjs/mixins/OxyServices.language.js +154 -0
- package/dist/cjs/mixins/OxyServices.location.js +43 -0
- package/dist/cjs/mixins/OxyServices.payment.js +158 -0
- package/dist/cjs/mixins/OxyServices.popup.js +371 -0
- package/dist/cjs/mixins/OxyServices.privacy.js +162 -0
- package/dist/cjs/mixins/OxyServices.redirect.js +345 -0
- package/dist/cjs/mixins/OxyServices.security.js +81 -0
- package/dist/cjs/mixins/OxyServices.user.js +355 -0
- package/dist/cjs/mixins/OxyServices.utility.js +156 -0
- package/dist/cjs/mixins/index.js +79 -0
- package/dist/cjs/mixins/mixinHelpers.js +53 -0
- package/dist/cjs/models/interfaces.js +20 -0
- package/dist/cjs/models/session.js +2 -0
- package/dist/cjs/shared/index.js +70 -0
- package/dist/cjs/shared/utils/colorUtils.js +153 -0
- package/dist/cjs/shared/utils/debugUtils.js +73 -0
- package/dist/cjs/shared/utils/errorUtils.js +183 -0
- package/dist/cjs/shared/utils/index.js +49 -0
- package/dist/cjs/shared/utils/networkUtils.js +183 -0
- package/dist/cjs/shared/utils/themeUtils.js +106 -0
- package/dist/cjs/utils/apiUtils.js +61 -0
- package/dist/cjs/utils/asyncUtils.js +194 -0
- package/dist/cjs/utils/cache.js +226 -0
- package/dist/cjs/utils/deviceManager.js +205 -0
- package/dist/cjs/utils/errorUtils.js +154 -0
- package/dist/cjs/utils/index.js +26 -0
- package/dist/cjs/utils/languageUtils.js +165 -0
- package/dist/cjs/utils/loggerUtils.js +126 -0
- package/dist/cjs/utils/platform.js +144 -0
- package/dist/cjs/utils/requestUtils.js +209 -0
- package/dist/cjs/utils/sessionUtils.js +181 -0
- package/dist/cjs/utils/validationUtils.js +173 -0
- package/dist/esm/AuthManager.js +356 -0
- package/dist/esm/CrossDomainAuth.js +253 -0
- package/dist/esm/HttpService.js +614 -0
- package/dist/esm/OxyServices.base.js +259 -0
- package/dist/esm/OxyServices.errors.js +17 -0
- package/dist/esm/OxyServices.js +59 -0
- package/dist/esm/constants/version.js +13 -0
- package/dist/esm/crypto/index.js +13 -0
- package/dist/esm/crypto/keyManager.js +850 -0
- package/dist/esm/crypto/polyfill.js +61 -0
- package/dist/esm/crypto/recoveryPhrase.js +132 -0
- package/dist/esm/crypto/signatureService.js +259 -0
- package/dist/esm/i18n/index.js +69 -0
- package/dist/esm/i18n/locales/ar-SA.json +120 -0
- package/dist/esm/i18n/locales/ca-ES.json +120 -0
- package/dist/esm/i18n/locales/de-DE.json +120 -0
- package/dist/esm/i18n/locales/en-US.json +956 -0
- package/dist/esm/i18n/locales/es-ES.json +944 -0
- package/dist/esm/i18n/locales/fr-FR.json +120 -0
- package/dist/esm/i18n/locales/it-IT.json +120 -0
- package/dist/esm/i18n/locales/ja-JP.json +119 -0
- package/dist/esm/i18n/locales/ko-KR.json +120 -0
- package/dist/esm/i18n/locales/locales/ar-SA.json +120 -0
- package/dist/esm/i18n/locales/locales/ca-ES.json +120 -0
- package/dist/esm/i18n/locales/locales/de-DE.json +120 -0
- package/dist/esm/i18n/locales/locales/en-US.json +956 -0
- package/dist/esm/i18n/locales/locales/es-ES.json +944 -0
- package/dist/esm/i18n/locales/locales/fr-FR.json +120 -0
- package/dist/esm/i18n/locales/locales/it-IT.json +120 -0
- package/dist/esm/i18n/locales/locales/ja-JP.json +119 -0
- package/dist/esm/i18n/locales/locales/ko-KR.json +120 -0
- package/dist/esm/i18n/locales/locales/pt-PT.json +120 -0
- package/dist/esm/i18n/locales/locales/zh-CN.json +120 -0
- package/dist/esm/i18n/locales/pt-PT.json +120 -0
- package/dist/esm/i18n/locales/zh-CN.json +120 -0
- package/dist/esm/index.js +55 -0
- package/dist/esm/mixins/OxyServices.analytics.js +46 -0
- package/dist/esm/mixins/OxyServices.assets.js +377 -0
- package/dist/esm/mixins/OxyServices.auth.js +256 -0
- package/dist/esm/mixins/OxyServices.developer.js +94 -0
- package/dist/esm/mixins/OxyServices.devices.js +113 -0
- package/dist/esm/mixins/OxyServices.features.js +306 -0
- package/dist/esm/mixins/OxyServices.fedcm.js +433 -0
- package/dist/esm/mixins/OxyServices.karma.js +105 -0
- package/dist/esm/mixins/OxyServices.language.js +118 -0
- package/dist/esm/mixins/OxyServices.location.js +40 -0
- package/dist/esm/mixins/OxyServices.payment.js +155 -0
- package/dist/esm/mixins/OxyServices.popup.js +369 -0
- package/dist/esm/mixins/OxyServices.privacy.js +159 -0
- package/dist/esm/mixins/OxyServices.redirect.js +343 -0
- package/dist/esm/mixins/OxyServices.security.js +78 -0
- package/dist/esm/mixins/OxyServices.user.js +352 -0
- package/dist/esm/mixins/OxyServices.utility.js +153 -0
- package/dist/esm/mixins/index.js +76 -0
- package/dist/esm/mixins/mixinHelpers.js +48 -0
- package/dist/esm/models/interfaces.js +17 -0
- package/dist/esm/models/session.js +1 -0
- package/dist/esm/shared/index.js +31 -0
- package/dist/esm/shared/utils/colorUtils.js +143 -0
- package/dist/esm/shared/utils/debugUtils.js +65 -0
- package/dist/esm/shared/utils/errorUtils.js +170 -0
- package/dist/esm/shared/utils/index.js +15 -0
- package/dist/esm/shared/utils/networkUtils.js +173 -0
- package/dist/esm/shared/utils/themeUtils.js +98 -0
- package/dist/esm/utils/apiUtils.js +55 -0
- package/dist/esm/utils/asyncUtils.js +179 -0
- package/dist/esm/utils/cache.js +218 -0
- package/dist/esm/utils/deviceManager.js +168 -0
- package/dist/esm/utils/errorUtils.js +146 -0
- package/dist/esm/utils/index.js +7 -0
- package/dist/esm/utils/languageUtils.js +158 -0
- package/dist/esm/utils/loggerUtils.js +115 -0
- package/dist/esm/utils/platform.js +102 -0
- package/dist/esm/utils/requestUtils.js +203 -0
- package/dist/esm/utils/sessionUtils.js +171 -0
- package/dist/esm/utils/validationUtils.js +153 -0
- package/dist/types/AuthManager.d.ts +143 -0
- package/dist/types/CrossDomainAuth.d.ts +160 -0
- package/dist/types/HttpService.d.ts +163 -0
- package/dist/types/OxyServices.base.d.ts +126 -0
- package/dist/types/OxyServices.d.ts +81 -0
- package/dist/types/OxyServices.errors.d.ts +11 -0
- package/dist/types/constants/version.d.ts +13 -0
- package/dist/types/crypto/index.d.ts +11 -0
- package/dist/types/crypto/keyManager.d.ts +189 -0
- package/dist/types/crypto/polyfill.d.ts +11 -0
- package/dist/types/crypto/recoveryPhrase.d.ts +58 -0
- package/dist/types/crypto/signatureService.d.ts +86 -0
- package/dist/types/i18n/index.d.ts +3 -0
- package/dist/types/index.d.ts +50 -0
- package/dist/types/mixins/OxyServices.analytics.d.ts +66 -0
- package/dist/types/mixins/OxyServices.assets.d.ts +135 -0
- package/dist/types/mixins/OxyServices.auth.d.ts +186 -0
- package/dist/types/mixins/OxyServices.developer.d.ts +99 -0
- package/dist/types/mixins/OxyServices.devices.d.ts +96 -0
- package/dist/types/mixins/OxyServices.features.d.ts +228 -0
- package/dist/types/mixins/OxyServices.fedcm.d.ts +200 -0
- package/dist/types/mixins/OxyServices.karma.d.ts +85 -0
- package/dist/types/mixins/OxyServices.language.d.ts +81 -0
- package/dist/types/mixins/OxyServices.location.d.ts +64 -0
- package/dist/types/mixins/OxyServices.payment.d.ts +111 -0
- package/dist/types/mixins/OxyServices.popup.d.ts +205 -0
- package/dist/types/mixins/OxyServices.privacy.d.ts +122 -0
- package/dist/types/mixins/OxyServices.redirect.d.ts +245 -0
- package/dist/types/mixins/OxyServices.security.d.ts +78 -0
- package/dist/types/mixins/OxyServices.user.d.ts +182 -0
- package/dist/types/mixins/OxyServices.utility.d.ts +93 -0
- package/dist/types/mixins/index.d.ts +30 -0
- package/dist/types/mixins/mixinHelpers.d.ts +31 -0
- package/dist/types/models/interfaces.d.ts +415 -0
- package/dist/types/models/session.d.ts +27 -0
- package/dist/types/shared/index.d.ts +28 -0
- package/dist/types/shared/utils/colorUtils.d.ts +104 -0
- package/dist/types/shared/utils/debugUtils.d.ts +48 -0
- package/dist/types/shared/utils/errorUtils.d.ts +97 -0
- package/dist/types/shared/utils/index.d.ts +13 -0
- package/dist/types/shared/utils/networkUtils.d.ts +139 -0
- package/dist/types/shared/utils/themeUtils.d.ts +90 -0
- package/dist/types/utils/apiUtils.d.ts +53 -0
- package/dist/types/utils/asyncUtils.d.ts +58 -0
- package/dist/types/utils/cache.d.ts +127 -0
- package/dist/types/utils/deviceManager.d.ts +65 -0
- package/dist/types/utils/errorUtils.d.ts +46 -0
- package/dist/types/utils/index.d.ts +6 -0
- package/dist/types/utils/languageUtils.d.ts +37 -0
- package/dist/types/utils/loggerUtils.d.ts +48 -0
- package/dist/types/utils/platform.d.ts +40 -0
- package/dist/types/utils/requestUtils.d.ts +123 -0
- package/dist/types/utils/sessionUtils.d.ts +54 -0
- package/dist/types/utils/validationUtils.d.ts +85 -0
- package/package.json +84 -0
- package/src/AuthManager.ts +436 -0
- package/src/CrossDomainAuth.ts +307 -0
- package/src/HttpService.ts +752 -0
- package/src/OxyServices.base.ts +334 -0
- package/src/OxyServices.errors.ts +26 -0
- package/src/OxyServices.ts +129 -0
- package/src/constants/version.ts +15 -0
- package/src/crypto/index.ts +25 -0
- package/src/crypto/keyManager.ts +962 -0
- package/src/crypto/polyfill.ts +70 -0
- package/src/crypto/recoveryPhrase.ts +166 -0
- package/src/crypto/signatureService.ts +323 -0
- package/src/i18n/index.ts +75 -0
- package/src/i18n/locales/ar-SA.json +120 -0
- package/src/i18n/locales/ca-ES.json +120 -0
- package/src/i18n/locales/de-DE.json +120 -0
- package/src/i18n/locales/en-US.json +956 -0
- package/src/i18n/locales/es-ES.json +944 -0
- package/src/i18n/locales/fr-FR.json +120 -0
- package/src/i18n/locales/it-IT.json +120 -0
- package/src/i18n/locales/ja-JP.json +119 -0
- package/src/i18n/locales/ko-KR.json +120 -0
- package/src/i18n/locales/pt-PT.json +120 -0
- package/src/i18n/locales/zh-CN.json +120 -0
- package/src/index.ts +153 -0
- package/src/mixins/OxyServices.analytics.ts +53 -0
- package/src/mixins/OxyServices.assets.ts +412 -0
- package/src/mixins/OxyServices.auth.ts +358 -0
- package/src/mixins/OxyServices.developer.ts +114 -0
- package/src/mixins/OxyServices.devices.ts +119 -0
- package/src/mixins/OxyServices.features.ts +428 -0
- package/src/mixins/OxyServices.fedcm.ts +494 -0
- package/src/mixins/OxyServices.karma.ts +111 -0
- package/src/mixins/OxyServices.language.ts +127 -0
- package/src/mixins/OxyServices.location.ts +46 -0
- package/src/mixins/OxyServices.payment.ts +163 -0
- package/src/mixins/OxyServices.popup.ts +443 -0
- package/src/mixins/OxyServices.privacy.ts +182 -0
- package/src/mixins/OxyServices.redirect.ts +397 -0
- package/src/mixins/OxyServices.security.ts +103 -0
- package/src/mixins/OxyServices.user.ts +392 -0
- package/src/mixins/OxyServices.utility.ts +191 -0
- package/src/mixins/index.ts +91 -0
- package/src/mixins/mixinHelpers.ts +69 -0
- package/src/models/interfaces.ts +511 -0
- package/src/models/session.ts +30 -0
- package/src/shared/index.ts +82 -0
- package/src/shared/utils/colorUtils.ts +155 -0
- package/src/shared/utils/debugUtils.ts +73 -0
- package/src/shared/utils/errorUtils.ts +181 -0
- package/src/shared/utils/index.ts +59 -0
- package/src/shared/utils/networkUtils.ts +248 -0
- package/src/shared/utils/themeUtils.ts +115 -0
- package/src/types/bip39.d.ts +32 -0
- package/src/types/buffer.d.ts +97 -0
- package/src/types/color.d.ts +20 -0
- package/src/types/elliptic.d.ts +62 -0
- package/src/utils/apiUtils.ts +88 -0
- package/src/utils/asyncUtils.ts +252 -0
- package/src/utils/cache.ts +264 -0
- package/src/utils/deviceManager.ts +198 -0
- package/src/utils/errorUtils.ts +216 -0
- package/src/utils/index.ts +21 -0
- package/src/utils/languageUtils.ts +174 -0
- package/src/utils/loggerUtils.ts +153 -0
- package/src/utils/platform.ts +117 -0
- package/src/utils/requestUtils.ts +237 -0
- package/src/utils/sessionUtils.ts +206 -0
- package/src/utils/validationUtils.ts +174 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Centralized cache utility with TTL support
|
|
4
|
+
*
|
|
5
|
+
* This is a production-ready cache implementation used across the codebase
|
|
6
|
+
* for consistent caching behavior and performance optimization.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.TTLCache = void 0;
|
|
10
|
+
exports.createCache = createCache;
|
|
11
|
+
exports.registerCacheForCleanup = registerCacheForCleanup;
|
|
12
|
+
exports.unregisterCacheFromCleanup = unregisterCacheFromCleanup;
|
|
13
|
+
exports.stopAllCleanupIntervals = stopAllCleanupIntervals;
|
|
14
|
+
/**
|
|
15
|
+
* TTL-based cache implementation
|
|
16
|
+
*
|
|
17
|
+
* Features:
|
|
18
|
+
* - Automatic expiration based on TTL
|
|
19
|
+
* - Manual cleanup of expired entries
|
|
20
|
+
* - Statistics tracking (hits, misses, hit rate)
|
|
21
|
+
* - Type-safe generic interface
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const cache = new TTLCache<string>(5 * 60 * 1000); // 5 minutes
|
|
26
|
+
*
|
|
27
|
+
* // Set with default TTL
|
|
28
|
+
* cache.set('key', 'value');
|
|
29
|
+
*
|
|
30
|
+
* // Set with custom TTL
|
|
31
|
+
* cache.set('key', 'value', 10 * 60 * 1000); // 10 minutes
|
|
32
|
+
*
|
|
33
|
+
* // Get value
|
|
34
|
+
* const value = cache.get('key');
|
|
35
|
+
*
|
|
36
|
+
* // Get statistics
|
|
37
|
+
* const stats = cache.getStats();
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
class TTLCache {
|
|
41
|
+
/**
|
|
42
|
+
* Create a new TTL cache
|
|
43
|
+
* @param defaultTTL Default TTL in milliseconds (default: 5 minutes)
|
|
44
|
+
*/
|
|
45
|
+
constructor(defaultTTL = 5 * 60 * 1000) {
|
|
46
|
+
this.cache = new Map();
|
|
47
|
+
this.hits = 0;
|
|
48
|
+
this.misses = 0;
|
|
49
|
+
this.defaultTTL = defaultTTL;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get a value from cache
|
|
53
|
+
* @param key Cache key
|
|
54
|
+
* @returns Cached value or null if not found or expired
|
|
55
|
+
*/
|
|
56
|
+
get(key) {
|
|
57
|
+
const entry = this.cache.get(key);
|
|
58
|
+
if (!entry) {
|
|
59
|
+
this.misses++;
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const now = Date.now();
|
|
63
|
+
if (now > entry.expiresAt) {
|
|
64
|
+
this.cache.delete(key);
|
|
65
|
+
this.misses++;
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
this.hits++;
|
|
69
|
+
return entry.data;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Set a value in cache
|
|
73
|
+
* @param key Cache key
|
|
74
|
+
* @param data Data to cache
|
|
75
|
+
* @param ttl Optional TTL override (uses default if not provided)
|
|
76
|
+
*/
|
|
77
|
+
set(key, data, ttl) {
|
|
78
|
+
const now = Date.now();
|
|
79
|
+
const expiresAt = now + (ttl || this.defaultTTL);
|
|
80
|
+
this.cache.set(key, { data, timestamp: now, expiresAt });
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Delete a specific cache entry
|
|
84
|
+
* @param key Cache key
|
|
85
|
+
* @returns true if entry was deleted, false if not found
|
|
86
|
+
*/
|
|
87
|
+
delete(key) {
|
|
88
|
+
return this.cache.delete(key);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Clear all cache entries
|
|
92
|
+
*/
|
|
93
|
+
clear() {
|
|
94
|
+
this.cache.clear();
|
|
95
|
+
this.hits = 0;
|
|
96
|
+
this.misses = 0;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Check if a key exists and is not expired
|
|
100
|
+
* @param key Cache key
|
|
101
|
+
* @returns true if key exists and is valid
|
|
102
|
+
*/
|
|
103
|
+
has(key) {
|
|
104
|
+
const entry = this.cache.get(key);
|
|
105
|
+
if (!entry)
|
|
106
|
+
return false;
|
|
107
|
+
if (Date.now() > entry.expiresAt) {
|
|
108
|
+
this.cache.delete(key);
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Get all valid cache keys
|
|
115
|
+
* @returns Array of valid cache keys
|
|
116
|
+
*/
|
|
117
|
+
keys() {
|
|
118
|
+
const now = Date.now();
|
|
119
|
+
const validKeys = [];
|
|
120
|
+
for (const [key, entry] of this.cache.entries()) {
|
|
121
|
+
if (now <= entry.expiresAt) {
|
|
122
|
+
validKeys.push(key);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
this.cache.delete(key);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return validKeys;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Clean up expired entries
|
|
132
|
+
* @returns Number of entries removed
|
|
133
|
+
*/
|
|
134
|
+
cleanup() {
|
|
135
|
+
const now = Date.now();
|
|
136
|
+
let removed = 0;
|
|
137
|
+
for (const [key, entry] of this.cache.entries()) {
|
|
138
|
+
if (now > entry.expiresAt) {
|
|
139
|
+
this.cache.delete(key);
|
|
140
|
+
removed++;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return removed;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get cache size (number of entries)
|
|
147
|
+
*/
|
|
148
|
+
size() {
|
|
149
|
+
return this.cache.size;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get cache statistics
|
|
153
|
+
*/
|
|
154
|
+
getStats() {
|
|
155
|
+
const total = this.hits + this.misses;
|
|
156
|
+
return {
|
|
157
|
+
size: this.cache.size,
|
|
158
|
+
hits: this.hits,
|
|
159
|
+
misses: this.misses,
|
|
160
|
+
hitRate: total > 0 ? this.hits / total : 0,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Reset statistics (keeps cache entries)
|
|
165
|
+
*/
|
|
166
|
+
resetStats() {
|
|
167
|
+
this.hits = 0;
|
|
168
|
+
this.misses = 0;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
exports.TTLCache = TTLCache;
|
|
172
|
+
/**
|
|
173
|
+
* Create a TTL cache instance (convenience function)
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```typescript
|
|
177
|
+
* const cache = createCache<string>(5 * 60 * 1000);
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
function createCache(ttl = 5 * 60 * 1000) {
|
|
181
|
+
return new TTLCache(ttl);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Global cache cleanup interval (runs every minute)
|
|
185
|
+
* This helps prevent memory leaks from expired cache entries
|
|
186
|
+
*/
|
|
187
|
+
let cleanupInterval = null;
|
|
188
|
+
const activeCaches = new Set();
|
|
189
|
+
/**
|
|
190
|
+
* Register a cache for automatic cleanup
|
|
191
|
+
* @param cache Cache instance to register
|
|
192
|
+
*/
|
|
193
|
+
function registerCacheForCleanup(cache) {
|
|
194
|
+
activeCaches.add(cache);
|
|
195
|
+
// Start cleanup interval if not already running
|
|
196
|
+
if (!cleanupInterval) {
|
|
197
|
+
cleanupInterval = setInterval(() => {
|
|
198
|
+
for (const cache of activeCaches) {
|
|
199
|
+
cache.cleanup();
|
|
200
|
+
}
|
|
201
|
+
}, 60000); // Every minute
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Unregister a cache from automatic cleanup
|
|
206
|
+
* @param cache Cache instance to unregister
|
|
207
|
+
*/
|
|
208
|
+
function unregisterCacheFromCleanup(cache) {
|
|
209
|
+
activeCaches.delete(cache);
|
|
210
|
+
// Stop cleanup interval if no caches are registered
|
|
211
|
+
if (activeCaches.size === 0 && cleanupInterval) {
|
|
212
|
+
clearInterval(cleanupInterval);
|
|
213
|
+
cleanupInterval = null;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Stop all cleanup intervals (useful for testing)
|
|
218
|
+
* This will clear the interval and unregister all caches
|
|
219
|
+
*/
|
|
220
|
+
function stopAllCleanupIntervals() {
|
|
221
|
+
if (cleanupInterval) {
|
|
222
|
+
clearInterval(cleanupInterval);
|
|
223
|
+
cleanupInterval = null;
|
|
224
|
+
}
|
|
225
|
+
activeCaches.clear();
|
|
226
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DeviceManager = void 0;
|
|
37
|
+
/**
|
|
38
|
+
* Client-side device management utility
|
|
39
|
+
* Handles persistent device identification across app sessions
|
|
40
|
+
*/
|
|
41
|
+
class DeviceManager {
|
|
42
|
+
/**
|
|
43
|
+
* Check if we're in React Native environment
|
|
44
|
+
*/
|
|
45
|
+
static isReactNative() {
|
|
46
|
+
return typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get appropriate storage for the platform
|
|
50
|
+
*/
|
|
51
|
+
static async getStorage() {
|
|
52
|
+
if (this.isReactNative()) {
|
|
53
|
+
try {
|
|
54
|
+
const asyncStorageModule = await Promise.resolve().then(() => __importStar(require('@react-native-async-storage/async-storage')));
|
|
55
|
+
const storage = asyncStorageModule.default;
|
|
56
|
+
return {
|
|
57
|
+
getItem: storage.getItem.bind(storage),
|
|
58
|
+
setItem: storage.setItem.bind(storage),
|
|
59
|
+
removeItem: storage.removeItem.bind(storage),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
console.error('AsyncStorage not available in React Native:', error);
|
|
64
|
+
throw new Error('AsyncStorage is required in React Native environment');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
// Use localStorage for web
|
|
69
|
+
return {
|
|
70
|
+
getItem: async (key) => localStorage.getItem(key),
|
|
71
|
+
setItem: async (key, value) => localStorage.setItem(key, value),
|
|
72
|
+
removeItem: async (key) => localStorage.removeItem(key)
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get or create device fingerprint for current device
|
|
78
|
+
*/
|
|
79
|
+
static getDeviceFingerprint() {
|
|
80
|
+
const fingerprint = {
|
|
81
|
+
userAgent: typeof navigator !== 'undefined' ? navigator.userAgent : 'unknown',
|
|
82
|
+
platform: typeof navigator !== 'undefined' ? navigator.platform : 'unknown',
|
|
83
|
+
language: typeof navigator !== 'undefined' ? navigator.language : undefined,
|
|
84
|
+
timezone: typeof Intl !== 'undefined' ? Intl.DateTimeFormat().resolvedOptions().timeZone : undefined,
|
|
85
|
+
};
|
|
86
|
+
// Add screen info if available
|
|
87
|
+
if (typeof screen !== 'undefined') {
|
|
88
|
+
fingerprint.screen = {
|
|
89
|
+
width: screen.width,
|
|
90
|
+
height: screen.height,
|
|
91
|
+
colorDepth: screen.colorDepth
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return fingerprint;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get stored device info or create new one
|
|
98
|
+
*/
|
|
99
|
+
static async getDeviceInfo() {
|
|
100
|
+
try {
|
|
101
|
+
const storage = await this.getStorage();
|
|
102
|
+
const stored = await storage.getItem(this.DEVICE_KEY);
|
|
103
|
+
if (stored) {
|
|
104
|
+
const deviceInfo = JSON.parse(stored);
|
|
105
|
+
// Update last used timestamp
|
|
106
|
+
deviceInfo.lastUsed = new Date().toISOString();
|
|
107
|
+
await this.saveDeviceInfo(deviceInfo);
|
|
108
|
+
return deviceInfo;
|
|
109
|
+
}
|
|
110
|
+
// Create new device info
|
|
111
|
+
return await this.createNewDeviceInfo();
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
console.error('Error getting device info:', error);
|
|
115
|
+
return await this.createNewDeviceInfo();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Create new device info and store it
|
|
120
|
+
*/
|
|
121
|
+
static async createNewDeviceInfo() {
|
|
122
|
+
const deviceInfo = {
|
|
123
|
+
deviceId: this.generateDeviceId(),
|
|
124
|
+
fingerprint: JSON.stringify(this.getDeviceFingerprint()),
|
|
125
|
+
createdAt: new Date().toISOString(),
|
|
126
|
+
lastUsed: new Date().toISOString()
|
|
127
|
+
};
|
|
128
|
+
await this.saveDeviceInfo(deviceInfo);
|
|
129
|
+
return deviceInfo;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Save device info to storage
|
|
133
|
+
*/
|
|
134
|
+
static async saveDeviceInfo(deviceInfo) {
|
|
135
|
+
try {
|
|
136
|
+
const storage = await this.getStorage();
|
|
137
|
+
await storage.setItem(this.DEVICE_KEY, JSON.stringify(deviceInfo));
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
console.error('Error saving device info:', error);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Update device name
|
|
145
|
+
*/
|
|
146
|
+
static async updateDeviceName(deviceName) {
|
|
147
|
+
try {
|
|
148
|
+
const deviceInfo = await this.getDeviceInfo();
|
|
149
|
+
deviceInfo.deviceName = deviceName;
|
|
150
|
+
await this.saveDeviceInfo(deviceInfo);
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
console.error('Error updating device name:', error);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Clear stored device info (useful for testing or reset)
|
|
158
|
+
*/
|
|
159
|
+
static async clearDeviceInfo() {
|
|
160
|
+
try {
|
|
161
|
+
const storage = await this.getStorage();
|
|
162
|
+
await storage.removeItem(this.DEVICE_KEY);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
console.error('Error clearing device info:', error);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Generate a unique device ID
|
|
170
|
+
*/
|
|
171
|
+
static generateDeviceId() {
|
|
172
|
+
// Use crypto.getRandomValues if available, otherwise fallback to Math.random
|
|
173
|
+
if (typeof crypto !== 'undefined' && crypto.getRandomValues) {
|
|
174
|
+
const array = new Uint8Array(32);
|
|
175
|
+
crypto.getRandomValues(array);
|
|
176
|
+
return Array.from(array, byte => byte.toString(16).padStart(2, '0')).join('');
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
// Fallback for environments without crypto.getRandomValues
|
|
180
|
+
return 'device_' + Date.now().toString(36) + Math.random().toString(36).substr(2);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Get a user-friendly device name based on platform
|
|
185
|
+
*/
|
|
186
|
+
static getDefaultDeviceName() {
|
|
187
|
+
const fingerprint = this.getDeviceFingerprint();
|
|
188
|
+
const platform = (fingerprint.platform || '').toLowerCase();
|
|
189
|
+
if (platform.includes('win'))
|
|
190
|
+
return 'Windows Computer';
|
|
191
|
+
if (platform.includes('mac'))
|
|
192
|
+
return 'Mac Computer';
|
|
193
|
+
if (platform.includes('linux'))
|
|
194
|
+
return 'Linux Computer';
|
|
195
|
+
if (platform.includes('iphone'))
|
|
196
|
+
return 'iPhone';
|
|
197
|
+
if (platform.includes('ipad'))
|
|
198
|
+
return 'iPad';
|
|
199
|
+
if (platform.includes('android'))
|
|
200
|
+
return 'Android Device';
|
|
201
|
+
return 'Unknown Device';
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
exports.DeviceManager = DeviceManager;
|
|
205
|
+
DeviceManager.DEVICE_KEY = 'oxy_device_info';
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorCodes = void 0;
|
|
4
|
+
exports.createApiError = createApiError;
|
|
5
|
+
exports.handleHttpError = handleHttpError;
|
|
6
|
+
exports.getErrorCodeFromStatus = getErrorCodeFromStatus;
|
|
7
|
+
exports.validateRequiredFields = validateRequiredFields;
|
|
8
|
+
exports.logError = logError;
|
|
9
|
+
const loggerUtils_1 = require("./loggerUtils");
|
|
10
|
+
/**
|
|
11
|
+
* Error handling utilities for consistent error processing
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Common error codes
|
|
15
|
+
*/
|
|
16
|
+
exports.ErrorCodes = {
|
|
17
|
+
// Authentication errors
|
|
18
|
+
UNAUTHORIZED: 'UNAUTHORIZED',
|
|
19
|
+
FORBIDDEN: 'FORBIDDEN',
|
|
20
|
+
INVALID_TOKEN: 'INVALID_TOKEN',
|
|
21
|
+
MISSING_TOKEN: 'MISSING_TOKEN',
|
|
22
|
+
// Validation errors
|
|
23
|
+
VALIDATION_ERROR: 'VALIDATION_ERROR',
|
|
24
|
+
BAD_REQUEST: 'BAD_REQUEST',
|
|
25
|
+
MISSING_PARAMETER: 'MISSING_PARAMETER',
|
|
26
|
+
INVALID_FORMAT: 'INVALID_FORMAT',
|
|
27
|
+
// Resource errors
|
|
28
|
+
NOT_FOUND: 'NOT_FOUND',
|
|
29
|
+
ALREADY_EXISTS: 'ALREADY_EXISTS',
|
|
30
|
+
CONFLICT: 'CONFLICT',
|
|
31
|
+
// Server errors
|
|
32
|
+
INTERNAL_ERROR: 'INTERNAL_ERROR',
|
|
33
|
+
SERVICE_UNAVAILABLE: 'SERVICE_UNAVAILABLE',
|
|
34
|
+
TIMEOUT: 'TIMEOUT',
|
|
35
|
+
// Network errors
|
|
36
|
+
NETWORK_ERROR: 'NETWORK_ERROR',
|
|
37
|
+
CONNECTION_FAILED: 'CONNECTION_FAILED'
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Create a standardized API error
|
|
41
|
+
*/
|
|
42
|
+
function createApiError(message, code = exports.ErrorCodes.INTERNAL_ERROR, status = 500, details) {
|
|
43
|
+
return {
|
|
44
|
+
message,
|
|
45
|
+
code,
|
|
46
|
+
status,
|
|
47
|
+
details
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Handle common HTTP errors and convert to ApiError
|
|
52
|
+
*/
|
|
53
|
+
function handleHttpError(error) {
|
|
54
|
+
// If it's already an ApiError, ensure it has a non-empty message
|
|
55
|
+
if (error && typeof error === 'object' && 'code' in error && 'status' in error) {
|
|
56
|
+
const apiError = error;
|
|
57
|
+
// Ensure message is not empty
|
|
58
|
+
if (!apiError.message || !apiError.message.trim()) {
|
|
59
|
+
return {
|
|
60
|
+
...apiError,
|
|
61
|
+
message: apiError.message || 'An error occurred',
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return apiError;
|
|
65
|
+
}
|
|
66
|
+
// Handle AbortError (timeout or cancelled requests)
|
|
67
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
68
|
+
return createApiError('Request timeout or cancelled', exports.ErrorCodes.TIMEOUT, 0);
|
|
69
|
+
}
|
|
70
|
+
// Handle TypeError (network failures, CORS, etc.)
|
|
71
|
+
if (error instanceof TypeError) {
|
|
72
|
+
// Check if it's a network-related TypeError
|
|
73
|
+
if (error.message.includes('fetch') || error.message.includes('network') || error.message.includes('Failed to fetch')) {
|
|
74
|
+
return createApiError('Network error - failed to connect to server', exports.ErrorCodes.NETWORK_ERROR, 0);
|
|
75
|
+
}
|
|
76
|
+
return createApiError(error.message || 'Network error occurred', exports.ErrorCodes.NETWORK_ERROR, 0);
|
|
77
|
+
}
|
|
78
|
+
// Handle fetch Response errors - check if it has response property with status
|
|
79
|
+
if (error && typeof error === 'object' && 'response' in error) {
|
|
80
|
+
const fetchError = error;
|
|
81
|
+
const status = fetchError.response?.status || fetchError.status;
|
|
82
|
+
if (status) {
|
|
83
|
+
return createApiError(fetchError.message || `HTTP ${status} error`, getErrorCodeFromStatus(status), status);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// Handle standard errors
|
|
87
|
+
if (error instanceof Error) {
|
|
88
|
+
// Check for common error patterns
|
|
89
|
+
if (error.message.includes('timeout') || error.message.includes('aborted')) {
|
|
90
|
+
return createApiError('Request timeout', exports.ErrorCodes.TIMEOUT, 0);
|
|
91
|
+
}
|
|
92
|
+
if (error.message.includes('network') || error.message.includes('fetch')) {
|
|
93
|
+
return createApiError(error.message || 'Network error occurred', exports.ErrorCodes.NETWORK_ERROR, 0);
|
|
94
|
+
}
|
|
95
|
+
return createApiError(error.message || 'Unknown error occurred', exports.ErrorCodes.INTERNAL_ERROR, 500);
|
|
96
|
+
}
|
|
97
|
+
// Handle other errors - ensure we always return a non-empty message
|
|
98
|
+
const errorString = error ? String(error) : '';
|
|
99
|
+
const message = errorString.trim() || 'Unknown error occurred';
|
|
100
|
+
return createApiError(message, exports.ErrorCodes.INTERNAL_ERROR, 500);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Get error code from HTTP status
|
|
104
|
+
* Exported for use in other modules
|
|
105
|
+
*/
|
|
106
|
+
function getErrorCodeFromStatus(status) {
|
|
107
|
+
switch (status) {
|
|
108
|
+
case 400:
|
|
109
|
+
return exports.ErrorCodes.BAD_REQUEST;
|
|
110
|
+
case 401:
|
|
111
|
+
return exports.ErrorCodes.UNAUTHORIZED;
|
|
112
|
+
case 403:
|
|
113
|
+
return exports.ErrorCodes.FORBIDDEN;
|
|
114
|
+
case 404:
|
|
115
|
+
return exports.ErrorCodes.NOT_FOUND;
|
|
116
|
+
case 409:
|
|
117
|
+
return exports.ErrorCodes.CONFLICT;
|
|
118
|
+
case 422:
|
|
119
|
+
return exports.ErrorCodes.VALIDATION_ERROR;
|
|
120
|
+
case 500:
|
|
121
|
+
return exports.ErrorCodes.INTERNAL_ERROR;
|
|
122
|
+
case 503:
|
|
123
|
+
return exports.ErrorCodes.SERVICE_UNAVAILABLE;
|
|
124
|
+
default:
|
|
125
|
+
return exports.ErrorCodes.INTERNAL_ERROR;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Validate required fields and throw error if missing
|
|
130
|
+
*/
|
|
131
|
+
function validateRequiredFields(data, fields) {
|
|
132
|
+
const missing = fields.filter(field => !data[field]);
|
|
133
|
+
if (missing.length > 0) {
|
|
134
|
+
throw createApiError(`Missing required fields: ${missing.join(', ')}`, exports.ErrorCodes.MISSING_PARAMETER, 400);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Safe error logging with context
|
|
139
|
+
*/
|
|
140
|
+
function logError(error, context) {
|
|
141
|
+
if (error instanceof Error) {
|
|
142
|
+
loggerUtils_1.logger.error(error.message, {
|
|
143
|
+
component: context || 'errorUtils',
|
|
144
|
+
method: 'logError',
|
|
145
|
+
stack: error.stack,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
loggerUtils_1.logger.error(String(error), {
|
|
150
|
+
component: context || 'errorUtils',
|
|
151
|
+
method: 'logError',
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sessionsArraysEqual = exports.sessionsEqual = exports.mergeSessions = exports.normalizeAndSortSessions = exports.deduplicateSessionsByUserId = exports.deduplicateSessions = exports.sortSessions = exports.normalizeSession = exports.unregisterCacheFromCleanup = exports.registerCacheForCleanup = exports.createCache = exports.TTLCache = exports.SimpleLogger = exports.RequestQueue = exports.RequestDeduplicator = exports.DeviceManager = void 0;
|
|
4
|
+
var deviceManager_1 = require("./deviceManager");
|
|
5
|
+
Object.defineProperty(exports, "DeviceManager", { enumerable: true, get: function () { return deviceManager_1.DeviceManager; } });
|
|
6
|
+
// Request utilities
|
|
7
|
+
var requestUtils_1 = require("./requestUtils");
|
|
8
|
+
Object.defineProperty(exports, "RequestDeduplicator", { enumerable: true, get: function () { return requestUtils_1.RequestDeduplicator; } });
|
|
9
|
+
Object.defineProperty(exports, "RequestQueue", { enumerable: true, get: function () { return requestUtils_1.RequestQueue; } });
|
|
10
|
+
Object.defineProperty(exports, "SimpleLogger", { enumerable: true, get: function () { return requestUtils_1.SimpleLogger; } });
|
|
11
|
+
// Cache utilities
|
|
12
|
+
var cache_1 = require("./cache");
|
|
13
|
+
Object.defineProperty(exports, "TTLCache", { enumerable: true, get: function () { return cache_1.TTLCache; } });
|
|
14
|
+
Object.defineProperty(exports, "createCache", { enumerable: true, get: function () { return cache_1.createCache; } });
|
|
15
|
+
Object.defineProperty(exports, "registerCacheForCleanup", { enumerable: true, get: function () { return cache_1.registerCacheForCleanup; } });
|
|
16
|
+
Object.defineProperty(exports, "unregisterCacheFromCleanup", { enumerable: true, get: function () { return cache_1.unregisterCacheFromCleanup; } });
|
|
17
|
+
// Session utilities
|
|
18
|
+
var sessionUtils_1 = require("./sessionUtils");
|
|
19
|
+
Object.defineProperty(exports, "normalizeSession", { enumerable: true, get: function () { return sessionUtils_1.normalizeSession; } });
|
|
20
|
+
Object.defineProperty(exports, "sortSessions", { enumerable: true, get: function () { return sessionUtils_1.sortSessions; } });
|
|
21
|
+
Object.defineProperty(exports, "deduplicateSessions", { enumerable: true, get: function () { return sessionUtils_1.deduplicateSessions; } });
|
|
22
|
+
Object.defineProperty(exports, "deduplicateSessionsByUserId", { enumerable: true, get: function () { return sessionUtils_1.deduplicateSessionsByUserId; } });
|
|
23
|
+
Object.defineProperty(exports, "normalizeAndSortSessions", { enumerable: true, get: function () { return sessionUtils_1.normalizeAndSortSessions; } });
|
|
24
|
+
Object.defineProperty(exports, "mergeSessions", { enumerable: true, get: function () { return sessionUtils_1.mergeSessions; } });
|
|
25
|
+
Object.defineProperty(exports, "sessionsEqual", { enumerable: true, get: function () { return sessionUtils_1.sessionsEqual; } });
|
|
26
|
+
Object.defineProperty(exports, "sessionsArraysEqual", { enumerable: true, get: function () { return sessionUtils_1.sessionsArraysEqual; } });
|