@oxyhq/services 5.16.17 → 5.16.18

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.
Files changed (227) hide show
  1. package/lib/commonjs/core/mixins/OxyServices.security.js +42 -0
  2. package/lib/commonjs/core/mixins/OxyServices.security.js.map +1 -1
  3. package/lib/commonjs/models/interfaces.js +2 -0
  4. package/lib/commonjs/models/interfaces.js.map +1 -1
  5. package/lib/commonjs/ui/components/FollowButton.js +19 -1
  6. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  7. package/lib/commonjs/ui/components/GroupedItem.js +1 -27
  8. package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
  9. package/lib/commonjs/ui/components/Section.js +2 -1
  10. package/lib/commonjs/ui/components/Section.js.map +1 -1
  11. package/lib/commonjs/ui/components/SectionTitle.js +1 -2
  12. package/lib/commonjs/ui/components/SectionTitle.js.map +1 -1
  13. package/lib/commonjs/ui/components/fileManagement/FileViewer.js +3 -3
  14. package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
  15. package/lib/commonjs/ui/context/OxyContext.js +44 -6
  16. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  17. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +9 -2
  18. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  19. package/lib/commonjs/ui/context/hooks/useDeviceManagement.js +1 -1
  20. package/lib/commonjs/ui/context/hooks/useLanguageManagement.js +1 -1
  21. package/lib/commonjs/ui/context/hooks/useSessionManagement.js +3 -3
  22. package/lib/commonjs/ui/context/hooks/useStorage.js +2 -2
  23. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +1 -1
  24. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
  25. package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +1 -1
  26. package/lib/commonjs/ui/hooks/useSessionSocket.js +22 -7
  27. package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
  28. package/lib/commonjs/ui/screens/AccountCenterScreen.js +13 -13
  29. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  30. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +17 -17
  31. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  32. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +2 -2
  33. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  34. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +10 -9
  35. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  36. package/lib/commonjs/ui/screens/AppInfoScreen.js +15 -15
  37. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  38. package/lib/commonjs/ui/screens/FeedbackScreen.js +1 -1
  39. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  40. package/lib/commonjs/ui/screens/FileManagementScreen.js +1 -1
  41. package/lib/commonjs/ui/screens/HelpSupportScreen.js +3 -3
  42. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  43. package/lib/commonjs/ui/screens/HistoryViewScreen.js +2 -2
  44. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  45. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -1
  46. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  47. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +4 -4
  48. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  49. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1 -1
  50. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  51. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +1 -2
  52. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  53. package/lib/commonjs/ui/screens/ProfileScreen.js +44 -16
  54. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  55. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
  56. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +3 -1
  57. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  58. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +2 -2
  59. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  60. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +8 -5
  61. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  62. package/lib/commonjs/ui/utils/errorHandlers.js +49 -2
  63. package/lib/commonjs/ui/utils/errorHandlers.js.map +1 -1
  64. package/lib/commonjs/ui/utils/sessionHelpers.js +0 -2
  65. package/lib/commonjs/ui/utils/sessionHelpers.js.map +1 -1
  66. package/lib/commonjs/utils/languageUtils.js +11 -11
  67. package/lib/commonjs/utils/languageUtils.js.map +1 -1
  68. package/lib/module/core/mixins/OxyServices.security.js +42 -0
  69. package/lib/module/core/mixins/OxyServices.security.js.map +1 -1
  70. package/lib/module/models/interfaces.js +2 -0
  71. package/lib/module/models/interfaces.js.map +1 -1
  72. package/lib/module/ui/components/FollowButton.js +19 -1
  73. package/lib/module/ui/components/FollowButton.js.map +1 -1
  74. package/lib/module/ui/components/GroupedItem.js +1 -29
  75. package/lib/module/ui/components/GroupedItem.js.map +1 -1
  76. package/lib/module/ui/components/Section.js +2 -1
  77. package/lib/module/ui/components/Section.js.map +1 -1
  78. package/lib/module/ui/components/SectionTitle.js +1 -2
  79. package/lib/module/ui/components/SectionTitle.js.map +1 -1
  80. package/lib/module/ui/components/fileManagement/FileViewer.js +3 -3
  81. package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
  82. package/lib/module/ui/context/OxyContext.js +45 -7
  83. package/lib/module/ui/context/OxyContext.js.map +1 -1
  84. package/lib/module/ui/context/hooks/useAuthOperations.js +9 -2
  85. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  86. package/lib/module/ui/context/hooks/useDeviceManagement.js +1 -1
  87. package/lib/module/ui/context/hooks/useDeviceManagement.js.map +1 -1
  88. package/lib/module/ui/context/hooks/useLanguageManagement.js +1 -1
  89. package/lib/module/ui/context/hooks/useLanguageManagement.js.map +1 -1
  90. package/lib/module/ui/context/hooks/useSessionManagement.js +3 -3
  91. package/lib/module/ui/context/hooks/useSessionManagement.js.map +1 -1
  92. package/lib/module/ui/context/hooks/useStorage.js +2 -2
  93. package/lib/module/ui/context/hooks/useStorage.js.map +1 -1
  94. package/lib/module/ui/hooks/queries/useAccountQueries.js +1 -1
  95. package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
  96. package/lib/module/ui/hooks/queries/useServicesQueries.js +1 -1
  97. package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
  98. package/lib/module/ui/hooks/useSessionSocket.js +22 -7
  99. package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
  100. package/lib/module/ui/screens/AccountCenterScreen.js +13 -13
  101. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  102. package/lib/module/ui/screens/AccountOverviewScreen.js +17 -17
  103. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  104. package/lib/module/ui/screens/AccountSettingsScreen.js +2 -2
  105. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  106. package/lib/module/ui/screens/AccountSwitcherScreen.js +11 -10
  107. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  108. package/lib/module/ui/screens/AppInfoScreen.js +15 -15
  109. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  110. package/lib/module/ui/screens/FeedbackScreen.js +1 -1
  111. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  112. package/lib/module/ui/screens/FileManagementScreen.js +1 -1
  113. package/lib/module/ui/screens/HelpSupportScreen.js +3 -3
  114. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  115. package/lib/module/ui/screens/HistoryViewScreen.js +2 -2
  116. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  117. package/lib/module/ui/screens/LanguageSelectorScreen.js +4 -2
  118. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  119. package/lib/module/ui/screens/LegalDocumentsScreen.js +4 -4
  120. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  121. package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
  122. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  123. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +1 -2
  124. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  125. package/lib/module/ui/screens/ProfileScreen.js +44 -16
  126. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  127. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  128. package/lib/module/ui/screens/karma/KarmaAboutScreen.js +3 -1
  129. package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  130. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +3 -3
  131. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  132. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +9 -6
  133. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  134. package/lib/module/ui/utils/errorHandlers.js +46 -0
  135. package/lib/module/ui/utils/errorHandlers.js.map +1 -1
  136. package/lib/module/ui/utils/sessionHelpers.js +0 -2
  137. package/lib/module/ui/utils/sessionHelpers.js.map +1 -1
  138. package/lib/module/utils/languageUtils.js +11 -11
  139. package/lib/module/utils/languageUtils.js.map +1 -1
  140. package/lib/typescript/core/mixins/OxyServices.security.d.ts +12 -0
  141. package/lib/typescript/core/mixins/OxyServices.security.d.ts.map +1 -1
  142. package/lib/typescript/core/mixins/index.d.ts +2 -0
  143. package/lib/typescript/core/mixins/index.d.ts.map +1 -1
  144. package/lib/typescript/models/interfaces.d.ts +1 -1
  145. package/lib/typescript/models/interfaces.d.ts.map +1 -1
  146. package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
  147. package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
  148. package/lib/typescript/ui/components/Section.d.ts.map +1 -1
  149. package/lib/typescript/ui/components/SectionTitle.d.ts.map +1 -1
  150. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  151. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +1 -1
  152. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  153. package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts +1 -1
  154. package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts.map +1 -1
  155. package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts +1 -1
  156. package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts.map +1 -1
  157. package/lib/typescript/ui/context/hooks/useStorage.d.ts +1 -1
  158. package/lib/typescript/ui/context/hooks/useStorage.d.ts.map +1 -1
  159. package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
  160. package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
  161. package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  162. package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
  163. package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  164. package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
  165. package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
  166. package/lib/typescript/ui/utils/errorHandlers.d.ts +5 -0
  167. package/lib/typescript/ui/utils/errorHandlers.d.ts.map +1 -1
  168. package/lib/typescript/ui/utils/sessionHelpers.d.ts.map +1 -1
  169. package/package.json +1 -1
  170. package/src/core/mixins/OxyServices.security.ts +44 -0
  171. package/src/models/interfaces.ts +4 -0
  172. package/src/ui/components/FollowButton.tsx +19 -1
  173. package/src/ui/components/GroupedItem.tsx +1 -29
  174. package/src/ui/components/Section.tsx +1 -0
  175. package/src/ui/components/SectionTitle.tsx +0 -1
  176. package/src/ui/components/fileManagement/FileViewer.tsx +3 -3
  177. package/src/ui/context/OxyContext.tsx +30 -9
  178. package/src/ui/context/hooks/useAuthOperations.ts +16 -9
  179. package/src/ui/context/hooks/useDeviceManagement.ts +1 -1
  180. package/src/ui/context/hooks/useLanguageManagement.ts +2 -2
  181. package/src/ui/context/hooks/useSessionManagement.ts +3 -3
  182. package/src/ui/context/hooks/useStorage.ts +2 -2
  183. package/src/ui/hooks/queries/useAccountQueries.ts +1 -1
  184. package/src/ui/hooks/queries/useServicesQueries.ts +1 -1
  185. package/src/ui/hooks/useSessionSocket.ts +8 -7
  186. package/src/ui/screens/AccountCenterScreen.tsx +13 -13
  187. package/src/ui/screens/AccountOverviewScreen.tsx +17 -17
  188. package/src/ui/screens/AccountSettingsScreen.tsx +2 -2
  189. package/src/ui/screens/AccountSwitcherScreen.tsx +8 -8
  190. package/src/ui/screens/AppInfoScreen.tsx +15 -15
  191. package/src/ui/screens/FeedbackScreen.tsx +1 -1
  192. package/src/ui/screens/FileManagementScreen.tsx +1 -1
  193. package/src/ui/screens/HelpSupportScreen.tsx +3 -3
  194. package/src/ui/screens/HistoryViewScreen.tsx +2 -2
  195. package/src/ui/screens/LanguageSelectorScreen.tsx +4 -1
  196. package/src/ui/screens/LegalDocumentsScreen.tsx +4 -4
  197. package/src/ui/screens/PaymentGatewayScreen.tsx +1 -1
  198. package/src/ui/screens/PremiumSubscriptionScreen.tsx +0 -1
  199. package/src/ui/screens/ProfileScreen.tsx +61 -22
  200. package/src/ui/screens/SavesCollectionsScreen.tsx +10 -1
  201. package/src/ui/screens/karma/KarmaAboutScreen.tsx +8 -1
  202. package/src/ui/screens/karma/KarmaCenterScreen.tsx +2 -2
  203. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +9 -6
  204. package/src/ui/utils/errorHandlers.ts +58 -0
  205. package/src/ui/utils/sessionHelpers.ts +0 -2
  206. package/src/utils/languageUtils.ts +11 -11
  207. package/lib/commonjs/ui/context/utils/errorHandlers.js +0 -100
  208. package/lib/commonjs/ui/context/utils/errorHandlers.js.map +0 -1
  209. package/lib/commonjs/ui/context/utils/sessionHelpers.js +0 -103
  210. package/lib/commonjs/ui/context/utils/sessionHelpers.js.map +0 -1
  211. package/lib/commonjs/ui/context/utils/storageHelpers.js +0 -119
  212. package/lib/commonjs/ui/context/utils/storageHelpers.js.map +0 -1
  213. package/lib/module/ui/context/utils/errorHandlers.js +0 -93
  214. package/lib/module/ui/context/utils/errorHandlers.js.map +0 -1
  215. package/lib/module/ui/context/utils/sessionHelpers.js +0 -96
  216. package/lib/module/ui/context/utils/sessionHelpers.js.map +0 -1
  217. package/lib/module/ui/context/utils/storageHelpers.js +0 -111
  218. package/lib/module/ui/context/utils/storageHelpers.js.map +0 -1
  219. package/lib/typescript/ui/context/utils/errorHandlers.d.ts +0 -30
  220. package/lib/typescript/ui/context/utils/errorHandlers.d.ts.map +0 -1
  221. package/lib/typescript/ui/context/utils/sessionHelpers.d.ts +0 -59
  222. package/lib/typescript/ui/context/utils/sessionHelpers.d.ts.map +0 -1
  223. package/lib/typescript/ui/context/utils/storageHelpers.d.ts +0 -31
  224. package/lib/typescript/ui/context/utils/storageHelpers.d.ts.map +0 -1
  225. package/src/ui/context/utils/errorHandlers.ts +0 -146
  226. package/src/ui/context/utils/sessionHelpers.ts +0 -146
  227. package/src/ui/context/utils/storageHelpers.ts +0 -134
@@ -1,103 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.validateSessionBatch = exports.mapSessionsToClient = exports.fetchSessionsWithFallback = void 0;
7
- /**
8
- * Normalize backend session payloads into `ClientSession` objects.
9
- *
10
- * @param sessions - Raw session array returned from the API
11
- * @param fallbackDeviceId - Device identifier to use when missing from payload
12
- * @param fallbackUserId - User identifier to use when missing from payload
13
- */
14
- const mapSessionsToClient = (sessions, fallbackDeviceId, fallbackUserId) => {
15
- const now = new Date();
16
- return sessions.map(session => ({
17
- sessionId: session.sessionId,
18
- deviceId: session.deviceId || fallbackDeviceId || '',
19
- expiresAt: session.expiresAt || new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000).toISOString(),
20
- lastActive: session.lastActive || now.toISOString(),
21
- userId: session.user?.id || session.userId || (session.user?._id ? session.user._id.toString() : undefined) || fallbackUserId || '',
22
- isCurrent: Boolean(session.isCurrent)
23
- }));
24
- };
25
-
26
- /**
27
- * Fetch device sessions with fallback to the legacy session endpoint when needed.
28
- *
29
- * @param oxyServices - Oxy service instance
30
- * @param sessionId - Session identifier to fetch
31
- * @param options - Optional fallback options
32
- */
33
- exports.mapSessionsToClient = mapSessionsToClient;
34
- const fetchSessionsWithFallback = async (oxyServices, sessionId, {
35
- fallbackDeviceId,
36
- fallbackUserId,
37
- logger
38
- } = {}) => {
39
- try {
40
- const deviceSessions = await oxyServices.getDeviceSessions(sessionId);
41
- return mapSessionsToClient(deviceSessions, fallbackDeviceId, fallbackUserId);
42
- } catch (error) {
43
- if (__DEV__ && logger) {
44
- logger('Failed to get device sessions, falling back to user sessions', error);
45
- } else if (__DEV__) {
46
- console.warn('Failed to get device sessions, falling back to user sessions:', error);
47
- }
48
- const userSessions = await oxyServices.getSessionsBySessionId(sessionId);
49
- return mapSessionsToClient(userSessions, fallbackDeviceId, fallbackUserId);
50
- }
51
- };
52
-
53
- /**
54
- * Validate multiple sessions concurrently with configurable concurrency.
55
- *
56
- * @param oxyServices - Oxy service instance
57
- * @param sessionIds - Session identifiers to validate
58
- * @param options - Validation options
59
- */
60
- exports.fetchSessionsWithFallback = fetchSessionsWithFallback;
61
- const validateSessionBatch = async (oxyServices, sessionIds, {
62
- useHeaderValidation = true,
63
- maxConcurrency = 5
64
- } = {}) => {
65
- if (!sessionIds.length) {
66
- return [];
67
- }
68
- const uniqueSessionIds = Array.from(new Set(sessionIds));
69
- const safeConcurrency = Math.max(1, Math.min(maxConcurrency, uniqueSessionIds.length));
70
- const results = [];
71
- let index = 0;
72
- const worker = async () => {
73
- while (index < uniqueSessionIds.length) {
74
- const currentIndex = index;
75
- index += 1;
76
- const sessionId = uniqueSessionIds[currentIndex];
77
- try {
78
- const validation = await oxyServices.validateSession(sessionId, {
79
- useHeaderValidation
80
- });
81
- const valid = Boolean(validation?.valid);
82
- results.push({
83
- sessionId,
84
- valid,
85
- user: validation?.user,
86
- raw: validation
87
- });
88
- } catch (error) {
89
- results.push({
90
- sessionId,
91
- valid: false,
92
- error
93
- });
94
- }
95
- }
96
- };
97
- await Promise.all(Array.from({
98
- length: safeConcurrency
99
- }, worker));
100
- return results;
101
- };
102
- exports.validateSessionBatch = validateSessionBatch;
103
- //# sourceMappingURL=sessionHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["mapSessionsToClient","sessions","fallbackDeviceId","fallbackUserId","now","Date","map","session","sessionId","deviceId","expiresAt","getTime","toISOString","lastActive","userId","user","id","_id","toString","undefined","isCurrent","Boolean","exports","fetchSessionsWithFallback","oxyServices","logger","deviceSessions","getDeviceSessions","error","__DEV__","console","warn","userSessions","getSessionsBySessionId","validateSessionBatch","sessionIds","useHeaderValidation","maxConcurrency","length","uniqueSessionIds","Array","from","Set","safeConcurrency","Math","max","min","results","index","worker","currentIndex","validation","validateSession","valid","push","raw","Promise","all"],"sourceRoot":"../../../../../src","sources":["ui/context/utils/sessionHelpers.ts"],"mappings":";;;;;;AAiCA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,mBAAmB,GAAGA,CACjCC,QAAyB,EACzBC,gBAAyB,EACzBC,cAAuB,KACH;EACpB,MAAMC,GAAG,GAAG,IAAIC,IAAI,CAAC,CAAC;EAEtB,OAAOJ,QAAQ,CAACK,GAAG,CAAEC,OAAO,KAAM;IAChCC,SAAS,EAAED,OAAO,CAACC,SAAS;IAC5BC,QAAQ,EAAEF,OAAO,CAACE,QAAQ,IAAIP,gBAAgB,IAAI,EAA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,CAAC,CAAC,OAAOvB,KAAK,EAAE;QACdmB,OAAO,CAACO,IAAI,CAAC;UACX9C,SAAS;UACT6C,KAAK,EAAE,KAAK;UACZzB;QACF,CAAC,CAAC;MACJ;IACF;EACF,CAAC;EAED,MAAM4B,OAAO,CAACC,GAAG,CAACjB,KAAK,CAACC,IAAI,CAAC;IAAEH,MAAM,EAAEK;EAAgB,CAAC,EAAEM,MAAM,CAAC,CAAC;EAElE,OAAOF,OAAO;AAChB,CAAC;AAACzB,OAAA,CAAAY,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -1,119 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isReactNative = exports.getStorageKeys = exports.createPlatformStorage = exports.STORAGE_KEY_PREFIX = void 0;
7
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
8
- /**
9
- * Create an in-memory storage implementation used as a safe fallback.
10
- */
11
- const MEMORY_STORAGE = () => {
12
- const store = new Map();
13
- return {
14
- async getItem(key) {
15
- return store.has(key) ? store.get(key) : null;
16
- },
17
- async setItem(key, value) {
18
- store.set(key, value);
19
- },
20
- async removeItem(key) {
21
- store.delete(key);
22
- },
23
- async clear() {
24
- store.clear();
25
- }
26
- };
27
- };
28
-
29
- /**
30
- * Create a web storage implementation backed by `localStorage`.
31
- * Falls back to in-memory storage when unavailable.
32
- */
33
- const createWebStorage = () => {
34
- if (typeof window === 'undefined' || typeof window.localStorage === 'undefined') {
35
- return MEMORY_STORAGE();
36
- }
37
- return {
38
- async getItem(key) {
39
- try {
40
- return window.localStorage.getItem(key);
41
- } catch {
42
- return null;
43
- }
44
- },
45
- async setItem(key, value) {
46
- try {
47
- window.localStorage.setItem(key, value);
48
- } catch {
49
- // Ignore quota or access issues for now.
50
- }
51
- },
52
- async removeItem(key) {
53
- try {
54
- window.localStorage.removeItem(key);
55
- } catch {
56
- // Ignore failures.
57
- }
58
- },
59
- async clear() {
60
- try {
61
- window.localStorage.clear();
62
- } catch {
63
- // Ignore failures.
64
- }
65
- }
66
- };
67
- };
68
- let asyncStorageInstance = null;
69
-
70
- /**
71
- * Lazily import React Native AsyncStorage implementation.
72
- */
73
- const createNativeStorage = async () => {
74
- if (asyncStorageInstance) {
75
- return asyncStorageInstance;
76
- }
77
- try {
78
- const asyncStorageModule = await Promise.resolve().then(() => _interopRequireWildcard(require('@react-native-async-storage/async-storage')));
79
- asyncStorageInstance = asyncStorageModule.default;
80
- return asyncStorageInstance;
81
- } catch (error) {
82
- if (__DEV__) {
83
- console.error('Failed to import AsyncStorage:', error);
84
- }
85
- throw new Error('AsyncStorage is required in React Native environment');
86
- }
87
- };
88
-
89
- /**
90
- * Detect whether the current runtime is React Native.
91
- */
92
- const isReactNative = () => typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
93
-
94
- /**
95
- * Create a platform-appropriate storage implementation.
96
- * Defaults to in-memory storage when no platform storage is available.
97
- */
98
- exports.isReactNative = isReactNative;
99
- const createPlatformStorage = async () => {
100
- if (isReactNative()) {
101
- return createNativeStorage();
102
- }
103
- return createWebStorage();
104
- };
105
- exports.createPlatformStorage = createPlatformStorage;
106
- const STORAGE_KEY_PREFIX = exports.STORAGE_KEY_PREFIX = 'oxy_session';
107
-
108
- /**
109
- * Produce strongly typed storage key names for the supplied prefix.
110
- *
111
- * @param prefix - Storage key prefix
112
- */
113
- const getStorageKeys = (prefix = STORAGE_KEY_PREFIX) => ({
114
- activeSessionId: `${prefix}_active_session_id`,
115
- sessionIds: `${prefix}_session_ids`,
116
- language: `${prefix}_language`
117
- });
118
- exports.getStorageKeys = getStorageKeys;
119
- //# sourceMappingURL=storageHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["MEMORY_STORAGE","store","Map","getItem","key","has","get","setItem","value","set","removeItem","delete","clear","createWebStorage","window","localStorage","asyncStorageInstance","createNativeStorage","asyncStorageModule","Promise","resolve","then","_interopRequireWildcard","require","default","error","__DEV__","console","Error","isReactNative","navigator","product","exports","createPlatformStorage","STORAGE_KEY_PREFIX","getStorageKeys","prefix","activeSessionId","sessionIds","language"],"sourceRoot":"../../../../../src","sources":["ui/context/utils/storageHelpers.ts"],"mappings":";;;;;;;AAiBA;AACA;AACA;AACA,MAAMA,cAAc,GAAGA,CAAA,KAAwB;EAC7C,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAAiB,CAAC;EAEvC,OAAO;IACL,MAAMC,OAAOA,CAACC,GAAW,EAAE;MACzB,OAAOH,KAAK,CAACI,GAAG,CAACD,GAAG,CAAC,GAAGH,KAAK,CAACK,GAAG,CAACF,GAAG,CAAC,GAAI,IAAI;IAChD,CAAC;IACD,MAAMG,OAAOA,CAACH,GAAW,EAAEI,KAAa,EAAE;MACxCP,KAAK,CAACQ,GAAG,CAACL,GAAG,EAAEI,KAAK,CAAC;IACvB,CAAC;IACD,MAAME,UAAUA,CAACN,GAAW,EAAE;MAC5BH,KAAK,CAACU,MAAM,CAACP,GAAG,CAAC;IACnB,CAAC;IACD,MAAMQ,KAAKA,CAAA,EAAG;MACZX,KAAK,CAACW,KAAK,CAAC,CAAC;IACf;EACF,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAA,KAAwB;EAC/C,IAAI,OAAOC,MAAM,KAAK,WAAW,IAAI,OAAOA,MAAM,CAACC,YAAY,KAAK,WAAW,EAAE;IAC/E,OAAOf,cAAc,CAAC,CAAC;EACzB;EAEA,OAAO;IACL,MAA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AOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,OAAO,KAAK,aAAa;;AAEzE;AACA;AACA;AACA;AAHAC,OAAA,CAAAH,aAAA,GAAAA,aAAA;AAIO,MAAMI,qBAAqB,GAAG,MAAAA,CAAA,KAAuC;EAC1E,IAAIJ,aAAa,CAAC,CAAC,EAAE;IACnB,OAAOZ,mBAAmB,CAAC,CAAC;EAC9B;EAEA,OAAOJ,gBAAgB,CAAC,CAAC;AAC3B,CAAC;AAACmB,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAEK,MAAMC,kBAAkB,GAAAF,OAAA,CAAAE,kBAAA,GAAG,aAAa;;AAE/C;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,GAAGA,CAACC,MAAc,GAAGF,kBAAkB,MAA0B;EAC1FG,eAAe,EAAE,GAAGD,MAAM,oBAAoB;EAC9CE,UAAU,EAAE,GAAGF,MAAM,cAAc;EACnCG,QAAQ,EAAE,GAAGH,MAAM;AACrB,CAAC,CAAC;AAACJ,OAAA,CAAAG,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -1,93 +0,0 @@
1
- "use strict";
2
-
3
- const DEFAULT_INVALID_SESSION_MESSAGES = ['Invalid or expired session', 'Session is invalid', 'Session not found', 'Session expired'];
4
- const isObject = value => typeof value === 'object' && value !== null;
5
- const getResponseStatus = error => {
6
- if (!isObject(error)) return undefined;
7
- const response = error.response;
8
- return response?.status;
9
- };
10
-
11
- /**
12
- * Determine whether the error represents an invalid session condition.
13
- * This centralizes 401 detection across different fetch clients.
14
- */
15
- export const isInvalidSessionError = error => {
16
- const status = getResponseStatus(error);
17
- if (status === 401) {
18
- return true;
19
- }
20
- if (!isObject(error)) {
21
- return false;
22
- }
23
-
24
- // Check error.status directly (HttpService sets this)
25
- if (error.status === 401) {
26
- return true;
27
- }
28
- const normalizedMessage = extractErrorMessage(error)?.toLowerCase();
29
- if (!normalizedMessage) {
30
- return false;
31
- }
32
-
33
- // Check for HTTP 401 in message (HttpService creates errors with "HTTP 401:" format)
34
- if (normalizedMessage.includes('http 401') || normalizedMessage.includes('401')) {
35
- return true;
36
- }
37
- return DEFAULT_INVALID_SESSION_MESSAGES.some(msg => normalizedMessage.includes(msg.toLowerCase()));
38
- };
39
-
40
- /**
41
- * Extract a consistent error message from unknown error shapes.
42
- *
43
- * @param error - The unknown error payload
44
- * @param fallbackMessage - Message to return when no concrete message is available
45
- */
46
- export const extractErrorMessage = (error, fallbackMessage = 'Unexpected error') => {
47
- if (typeof error === 'string' && error.trim().length > 0) {
48
- return error;
49
- }
50
- if (!isObject(error)) {
51
- return fallbackMessage;
52
- }
53
- const withMessage = error;
54
- if (withMessage.message && withMessage.message.trim().length > 0) {
55
- return withMessage.message;
56
- }
57
- const withResponse = error;
58
- const responseMessage = withResponse.response?.data?.message ?? withResponse.response?.data?.error;
59
- if (typeof responseMessage === 'string' && responseMessage.trim().length > 0) {
60
- return responseMessage;
61
- }
62
- return fallbackMessage;
63
- };
64
-
65
- /**
66
- * Centralized error handler for auth-related operations.
67
- *
68
- * @param error - Unknown error object
69
- * @param options - Error handling configuration
70
- * @returns Resolved error message
71
- */
72
- export const handleAuthError = (error, {
73
- defaultMessage,
74
- code,
75
- status,
76
- onError,
77
- setAuthError,
78
- logger
79
- }) => {
80
- const resolvedStatus = status ?? getResponseStatus(error) ?? (isInvalidSessionError(error) ? 401 : 500);
81
- const message = extractErrorMessage(error, defaultMessage);
82
- if (logger) {
83
- logger(message, error);
84
- }
85
- setAuthError?.(message);
86
- onError?.({
87
- message,
88
- code,
89
- status: resolvedStatus
90
- });
91
- return message;
92
- };
93
- //# sourceMappingURL=errorHandlers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["DEFAULT_INVALID_SESSION_MESSAGES","isObject","value","getResponseStatus","error","undefined","response","status","isInvalidSessionError","normalizedMessage","extractErrorMessage","toLowerCase","includes","some","msg","fallbackMessage","trim","length","withMessage","message","withResponse","responseMessage","data","handleAuthError","defaultMessage","code","onError","setAuthError","logger","resolvedStatus"],"sourceRoot":"../../../../../src","sources":["ui/context/utils/errorHandlers.ts"],"mappings":";;AAyBA,MAAMA,gCAAgC,GAAG,CACvC,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,CAClB;AAED,MAAMC,QAAQ,GAAIC,KAAc,IAC9B,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI;AAE7C,MAAMC,iBAAiB,GAAIC,KAAc,IAAyB;EAChE,IAAI,CAACH,QAAQ,CAACG,KAAK,CAAC,EAAE,OAAOC,SAAS;EACtC,MAAMC,QAAQ,GAAIF,KAAK,CAAuBE,QAAQ;EACtD,OAAOA,QAAQ,EAAEC,MAAM;AACzB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAIJ,KAAc,IAAc;EAChE,MAAMG,MAAM,GAAGJ,iBAAiB,CAACC,KAAK,CAAC;EACvC,IAAIG,MAAM,KAAK,GAAG,EAAE;IAClB,OAAO,IAAI;EACb;EAEA,IAAI,CAACN,QAAQ,CAACG,KAAK,CAAC,EAAE;IACpB,OAAO,KAAK;EACd;;EAEA;EACA,IAAKA,KAAK,CAASG,MAAM,KAAK,GAAG,EAAE;IACjC,OAAO,IAAI;EACb;EAEA,MAAME,iBAAiB,GAAGC,mBAAmB,CAACN,KAAK,CAAC,EAAEO,WAAW,CAAC,CAAC;EACnE,IAAI,CAACF,iBAAiB,EAAE;IACtB,OAAO,KAAK;EACd;;EAEA;EACA,IAAIA,iBAAiB,CAACG,QAAQ,CAAC,UAAU,CAAC,IAAIH,iBAAiB,CAACG,QAAQ,CAAC,KAAK,CAAC,EAAE;IAC/E,OAAO,IAAI;EACb;EAEA,OAAOZ,gCAAgC,CAACa,IAAI,CAAEC,GAAG,IAC/CL,iBAAiB,CAACG,QAAQ,CAACE,GAAG,CAACH,WAAW,CAAC,CAAC,CAC9C,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;A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AAC;EACxB;EAEAuB,YAAY,GAAGR,OAAO,CAAC;EAEvBO,OAAO,GAAG;IACRP,OAAO;IACPM,IAAI;IACJlB,MAAM,EAAEsB;EACV,CAAC,CAAC;EAEF,OAAOV,OAAO;AAChB,CAAC","ignoreList":[]}
@@ -1,96 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Normalize backend session payloads into `ClientSession` objects.
5
- *
6
- * @param sessions - Raw session array returned from the API
7
- * @param fallbackDeviceId - Device identifier to use when missing from payload
8
- * @param fallbackUserId - User identifier to use when missing from payload
9
- */
10
- export const mapSessionsToClient = (sessions, fallbackDeviceId, fallbackUserId) => {
11
- const now = new Date();
12
- return sessions.map(session => ({
13
- sessionId: session.sessionId,
14
- deviceId: session.deviceId || fallbackDeviceId || '',
15
- expiresAt: session.expiresAt || new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000).toISOString(),
16
- lastActive: session.lastActive || now.toISOString(),
17
- userId: session.user?.id || session.userId || (session.user?._id ? session.user._id.toString() : undefined) || fallbackUserId || '',
18
- isCurrent: Boolean(session.isCurrent)
19
- }));
20
- };
21
-
22
- /**
23
- * Fetch device sessions with fallback to the legacy session endpoint when needed.
24
- *
25
- * @param oxyServices - Oxy service instance
26
- * @param sessionId - Session identifier to fetch
27
- * @param options - Optional fallback options
28
- */
29
- export const fetchSessionsWithFallback = async (oxyServices, sessionId, {
30
- fallbackDeviceId,
31
- fallbackUserId,
32
- logger
33
- } = {}) => {
34
- try {
35
- const deviceSessions = await oxyServices.getDeviceSessions(sessionId);
36
- return mapSessionsToClient(deviceSessions, fallbackDeviceId, fallbackUserId);
37
- } catch (error) {
38
- if (__DEV__ && logger) {
39
- logger('Failed to get device sessions, falling back to user sessions', error);
40
- } else if (__DEV__) {
41
- console.warn('Failed to get device sessions, falling back to user sessions:', error);
42
- }
43
- const userSessions = await oxyServices.getSessionsBySessionId(sessionId);
44
- return mapSessionsToClient(userSessions, fallbackDeviceId, fallbackUserId);
45
- }
46
- };
47
-
48
- /**
49
- * Validate multiple sessions concurrently with configurable concurrency.
50
- *
51
- * @param oxyServices - Oxy service instance
52
- * @param sessionIds - Session identifiers to validate
53
- * @param options - Validation options
54
- */
55
- export const validateSessionBatch = async (oxyServices, sessionIds, {
56
- useHeaderValidation = true,
57
- maxConcurrency = 5
58
- } = {}) => {
59
- if (!sessionIds.length) {
60
- return [];
61
- }
62
- const uniqueSessionIds = Array.from(new Set(sessionIds));
63
- const safeConcurrency = Math.max(1, Math.min(maxConcurrency, uniqueSessionIds.length));
64
- const results = [];
65
- let index = 0;
66
- const worker = async () => {
67
- while (index < uniqueSessionIds.length) {
68
- const currentIndex = index;
69
- index += 1;
70
- const sessionId = uniqueSessionIds[currentIndex];
71
- try {
72
- const validation = await oxyServices.validateSession(sessionId, {
73
- useHeaderValidation
74
- });
75
- const valid = Boolean(validation?.valid);
76
- results.push({
77
- sessionId,
78
- valid,
79
- user: validation?.user,
80
- raw: validation
81
- });
82
- } catch (error) {
83
- results.push({
84
- sessionId,
85
- valid: false,
86
- error
87
- });
88
- }
89
- }
90
- };
91
- await Promise.all(Array.from({
92
- length: safeConcurrency
93
- }, worker));
94
- return results;
95
- };
96
- //# sourceMappingURL=sessionHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["mapSessionsToClient","sessions","fallbackDeviceId","fallbackUserId","now","Date","map","session","sessionId","deviceId","expiresAt","getTime","toISOString","lastActive","userId","user","id","_id","toString","undefined","isCurrent","Boolean","fetchSessionsWithFallback","oxyServices","logger","deviceSessions","getDeviceSessions","error","__DEV__","console","warn","userSessions","getSessionsBySessionId","validateSessionBatch","sessionIds","useHeaderValidation","maxConcurrency","length","uniqueSessionIds","Array","from","Set","safeConcurrency","Math","max","min","results","index","worker","currentIndex","validation","validateSession","valid","push","raw","Promise","all"],"sourceRoot":"../../../../../src","sources":["ui/context/utils/sessionHelpers.ts"],"mappings":";;AAiCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,mBAAmB,GA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AG/B,OAAO,CAAC6B,UAAU,EAAEE,KAAK,CAAC;QAExCN,OAAO,CAACO,IAAI,CAAC;UACX7C,SAAS;UACT4C,KAAK;UACLrC,IAAI,EAAEmC,UAAU,EAAEnC,IAAI;UACtBuC,GAAG,EAAEJ;QACP,CAAC,CAAC;MACJ,CAAC,CAAC,OAAOvB,KAAK,EAAE;QACdmB,OAAO,CAACO,IAAI,CAAC;UACX7C,SAAS;UACT4C,KAAK,EAAE,KAAK;UACZzB;QACF,CAAC,CAAC;MACJ;IACF;EACF,CAAC;EAED,MAAM4B,OAAO,CAACC,GAAG,CAACjB,KAAK,CAACC,IAAI,CAAC;IAAEH,MAAM,EAAEK;EAAgB,CAAC,EAAEM,MAAM,CAAC,CAAC;EAElE,OAAOF,OAAO;AAChB,CAAC","ignoreList":[]}
@@ -1,111 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Create an in-memory storage implementation used as a safe fallback.
5
- */
6
- const MEMORY_STORAGE = () => {
7
- const store = new Map();
8
- return {
9
- async getItem(key) {
10
- return store.has(key) ? store.get(key) : null;
11
- },
12
- async setItem(key, value) {
13
- store.set(key, value);
14
- },
15
- async removeItem(key) {
16
- store.delete(key);
17
- },
18
- async clear() {
19
- store.clear();
20
- }
21
- };
22
- };
23
-
24
- /**
25
- * Create a web storage implementation backed by `localStorage`.
26
- * Falls back to in-memory storage when unavailable.
27
- */
28
- const createWebStorage = () => {
29
- if (typeof window === 'undefined' || typeof window.localStorage === 'undefined') {
30
- return MEMORY_STORAGE();
31
- }
32
- return {
33
- async getItem(key) {
34
- try {
35
- return window.localStorage.getItem(key);
36
- } catch {
37
- return null;
38
- }
39
- },
40
- async setItem(key, value) {
41
- try {
42
- window.localStorage.setItem(key, value);
43
- } catch {
44
- // Ignore quota or access issues for now.
45
- }
46
- },
47
- async removeItem(key) {
48
- try {
49
- window.localStorage.removeItem(key);
50
- } catch {
51
- // Ignore failures.
52
- }
53
- },
54
- async clear() {
55
- try {
56
- window.localStorage.clear();
57
- } catch {
58
- // Ignore failures.
59
- }
60
- }
61
- };
62
- };
63
- let asyncStorageInstance = null;
64
-
65
- /**
66
- * Lazily import React Native AsyncStorage implementation.
67
- */
68
- const createNativeStorage = async () => {
69
- if (asyncStorageInstance) {
70
- return asyncStorageInstance;
71
- }
72
- try {
73
- const asyncStorageModule = await import('@react-native-async-storage/async-storage');
74
- asyncStorageInstance = asyncStorageModule.default;
75
- return asyncStorageInstance;
76
- } catch (error) {
77
- if (__DEV__) {
78
- console.error('Failed to import AsyncStorage:', error);
79
- }
80
- throw new Error('AsyncStorage is required in React Native environment');
81
- }
82
- };
83
-
84
- /**
85
- * Detect whether the current runtime is React Native.
86
- */
87
- export const isReactNative = () => typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
88
-
89
- /**
90
- * Create a platform-appropriate storage implementation.
91
- * Defaults to in-memory storage when no platform storage is available.
92
- */
93
- export const createPlatformStorage = async () => {
94
- if (isReactNative()) {
95
- return createNativeStorage();
96
- }
97
- return createWebStorage();
98
- };
99
- export const STORAGE_KEY_PREFIX = 'oxy_session';
100
-
101
- /**
102
- * Produce strongly typed storage key names for the supplied prefix.
103
- *
104
- * @param prefix - Storage key prefix
105
- */
106
- export const getStorageKeys = (prefix = STORAGE_KEY_PREFIX) => ({
107
- activeSessionId: `${prefix}_active_session_id`,
108
- sessionIds: `${prefix}_session_ids`,
109
- language: `${prefix}_language`
110
- });
111
- //# sourceMappingURL=storageHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["MEMORY_STORAGE","store","Map","getItem","key","has","get","setItem","value","set","removeItem","delete","clear","createWebStorage","window","localStorage","asyncStorageInstance","createNativeStorage","asyncStorageModule","default","error","__DEV__","console","Error","isReactNative","navigator","product","createPlatformStorage","STORAGE_KEY_PREFIX","getStorageKeys","prefix","activeSessionId","sessionIds","language"],"sourceRoot":"../../../../../src","sources":["ui/context/utils/storageHelpers.ts"],"mappings":";;AAiBA;AACA;AACA;AACA,MAAMA,cAAc,GAAGA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ignoreList":[]}
@@ -1,30 +0,0 @@
1
- import type { ApiError } from '../../../models/interfaces';
2
- export interface HandleAuthErrorOptions {
3
- defaultMessage: string;
4
- code: string;
5
- status?: number;
6
- onError?: (error: ApiError) => void;
7
- setAuthError?: (message: string) => void;
8
- logger?: (message: string, error?: unknown) => void;
9
- }
10
- /**
11
- * Determine whether the error represents an invalid session condition.
12
- * This centralizes 401 detection across different fetch clients.
13
- */
14
- export declare const isInvalidSessionError: (error: unknown) => boolean;
15
- /**
16
- * Extract a consistent error message from unknown error shapes.
17
- *
18
- * @param error - The unknown error payload
19
- * @param fallbackMessage - Message to return when no concrete message is available
20
- */
21
- export declare const extractErrorMessage: (error: unknown, fallbackMessage?: string) => string;
22
- /**
23
- * Centralized error handler for auth-related operations.
24
- *
25
- * @param error - Unknown error object
26
- * @param options - Error handling configuration
27
- * @returns Resolved error message
28
- */
29
- export declare const handleAuthError: (error: unknown, { defaultMessage, code, status, onError, setAuthError, logger, }: HandleAuthErrorOptions) => string;
30
- //# sourceMappingURL=errorHandlers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errorHandlers.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/utils/errorHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAgB3D,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAkBD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,OA4BtD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,OAAO,EACd,wBAAoC,KACnC,MAuBF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,OAAO,EACd,kEAOG,sBAAsB,KACxB,MAiBF,CAAC"}
@@ -1,59 +0,0 @@
1
- import type { OxyServices } from '../../../core';
2
- import type { ClientSession } from '../../../models/session';
3
- interface DeviceSession {
4
- sessionId: string;
5
- deviceId?: string;
6
- deviceName?: string;
7
- expiresAt?: string;
8
- lastActive?: string;
9
- user?: {
10
- id?: string;
11
- _id?: {
12
- toString(): string;
13
- };
14
- };
15
- userId?: string;
16
- isCurrent?: boolean;
17
- }
18
- export interface FetchSessionsWithFallbackOptions {
19
- fallbackDeviceId?: string;
20
- fallbackUserId?: string;
21
- logger?: (message: string, error?: unknown) => void;
22
- }
23
- export interface ValidateSessionBatchOptions {
24
- useHeaderValidation?: boolean;
25
- maxConcurrency?: number;
26
- }
27
- export interface SessionValidationResult {
28
- sessionId: string;
29
- valid: boolean;
30
- user?: unknown;
31
- raw?: unknown;
32
- error?: unknown;
33
- }
34
- /**
35
- * Normalize backend session payloads into `ClientSession` objects.
36
- *
37
- * @param sessions - Raw session array returned from the API
38
- * @param fallbackDeviceId - Device identifier to use when missing from payload
39
- * @param fallbackUserId - User identifier to use when missing from payload
40
- */
41
- export declare const mapSessionsToClient: (sessions: DeviceSession[], fallbackDeviceId?: string, fallbackUserId?: string) => ClientSession[];
42
- /**
43
- * Fetch device sessions with fallback to the legacy session endpoint when needed.
44
- *
45
- * @param oxyServices - Oxy service instance
46
- * @param sessionId - Session identifier to fetch
47
- * @param options - Optional fallback options
48
- */
49
- export declare const fetchSessionsWithFallback: (oxyServices: Pick<OxyServices, "getDeviceSessions" | "getSessionsBySessionId">, sessionId: string, { fallbackDeviceId, fallbackUserId, logger, }?: FetchSessionsWithFallbackOptions) => Promise<ClientSession[]>;
50
- /**
51
- * Validate multiple sessions concurrently with configurable concurrency.
52
- *
53
- * @param oxyServices - Oxy service instance
54
- * @param sessionIds - Session identifiers to validate
55
- * @param options - Validation options
56
- */
57
- export declare const validateSessionBatch: (oxyServices: Pick<OxyServices, "validateSession">, sessionIds: string[], { useHeaderValidation, maxConcurrency }?: ValidateSessionBatchOptions) => Promise<SessionValidationResult[]>;
58
- export {};
59
- //# sourceMappingURL=sessionHelpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sessionHelpers.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/utils/sessionHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,UAAU,aAAa;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE;YAAE,QAAQ,IAAI,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gCAAgC;IAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,2BAA2B;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED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