@onairos/react-native 3.1.16 → 3.1.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 (207) hide show
  1. package/README.md +404 -0
  2. package/lib/commonjs/assets/images/Checkbox.svg +3 -3
  3. package/lib/commonjs/assets/images/EnochE.svg +19 -19
  4. package/lib/commonjs/assets/images/Personalityprofile.svg +3 -3
  5. package/lib/commonjs/assets/images/Personalitytraits.svg +3 -3
  6. package/lib/commonjs/assets/images/Userpreferences.svg +3 -3
  7. package/lib/commonjs/assets/images/arrow.svg +20 -20
  8. package/lib/commonjs/assets/images/basicproficon.svg +43 -43
  9. package/lib/commonjs/assets/images/basicprofile.svg +3 -3
  10. package/lib/commonjs/assets/images/checkmark.svg +4 -4
  11. package/lib/commonjs/assets/images/contentanalysis.svg +3 -3
  12. package/lib/commonjs/assets/images/contenticon.svg +23 -23
  13. package/lib/commonjs/assets/images/personalityicon.svg +18 -18
  14. package/lib/commonjs/assets/images/x-close.svg +3 -3
  15. package/lib/commonjs/components/ModalSheet.js +8 -2
  16. package/lib/commonjs/components/ModalSheet.js.map +1 -1
  17. package/lib/commonjs/components/OnairosButton.js +290 -0
  18. package/lib/commonjs/components/OnairosButton.js.map +1 -0
  19. package/lib/commonjs/components/OnairosSignInButton.js +32 -8
  20. package/lib/commonjs/components/OnairosSignInButton.js.map +1 -1
  21. package/lib/commonjs/components/UniversalOnboarding.js +4 -4
  22. package/lib/commonjs/components/WelcomeScreen.js +29 -13
  23. package/lib/commonjs/components/WelcomeScreen.js.map +1 -1
  24. package/lib/commonjs/config/api.js +2 -2
  25. package/lib/commonjs/hooks/useConnections.js +6 -6
  26. package/lib/commonjs/hooks/useUserConnections.js +10 -10
  27. package/lib/commonjs/index.js +13 -6
  28. package/lib/commonjs/index.js.map +1 -1
  29. package/lib/commonjs/services/apiClient.js +35 -35
  30. package/lib/commonjs/services/apiKeyService.js +99 -99
  31. package/lib/commonjs/services/authService.js +82 -82
  32. package/lib/commonjs/services/biometricPinService.js +10 -10
  33. package/lib/commonjs/services/connectedAccountsService.js +32 -32
  34. package/lib/commonjs/services/googleAuthService.js +15 -15
  35. package/lib/commonjs/services/imageCompressionService.js +15 -15
  36. package/lib/commonjs/services/jwtStorageService.js +59 -59
  37. package/lib/commonjs/services/mobileTrainingService.js +14 -14
  38. package/lib/commonjs/services/pinEncryptionService.js +10 -10
  39. package/lib/commonjs/services/pinStorageUtils.js +15 -15
  40. package/lib/commonjs/services/platformAuthService.js +47 -47
  41. package/lib/commonjs/services/storageService.js +31 -31
  42. package/lib/commonjs/services/trainingApiHelpers.js +33 -33
  43. package/lib/commonjs/services/userConnectionsService.js +24 -24
  44. package/lib/commonjs/utils/Portal.js +4 -4
  45. package/lib/commonjs/utils/api.js +24 -24
  46. package/lib/commonjs/utils/auth.js +18 -18
  47. package/lib/commonjs/utils/crypto.js +13 -13
  48. package/lib/commonjs/utils/encryption.js +12 -12
  49. package/lib/commonjs/utils/eventUtils.js +52 -52
  50. package/lib/commonjs/utils/programmaticFlow.js +16 -16
  51. package/lib/commonjs/utils/retryHelper.js +27 -27
  52. package/lib/module/assets/images/Checkbox.svg +3 -3
  53. package/lib/module/assets/images/EnochE.svg +19 -19
  54. package/lib/module/assets/images/Personalityprofile.svg +3 -3
  55. package/lib/module/assets/images/Personalitytraits.svg +3 -3
  56. package/lib/module/assets/images/Userpreferences.svg +3 -3
  57. package/lib/module/assets/images/arrow.svg +20 -20
  58. package/lib/module/assets/images/basicproficon.svg +43 -43
  59. package/lib/module/assets/images/basicprofile.svg +3 -3
  60. package/lib/module/assets/images/checkmark.svg +4 -4
  61. package/lib/module/assets/images/contentanalysis.svg +3 -3
  62. package/lib/module/assets/images/contenticon.svg +23 -23
  63. package/lib/module/assets/images/personalityicon.svg +18 -18
  64. package/lib/module/assets/images/x-close.svg +3 -3
  65. package/lib/module/components/ModalSheet.js +7 -2
  66. package/lib/module/components/ModalSheet.js.map +1 -1
  67. package/lib/module/components/OnairosButton.js +282 -0
  68. package/lib/module/components/OnairosButton.js.map +1 -0
  69. package/lib/module/components/OnairosSignInButton.js +32 -8
  70. package/lib/module/components/OnairosSignInButton.js.map +1 -1
  71. package/lib/module/components/UniversalOnboarding.js +4 -4
  72. package/lib/module/components/WelcomeScreen.js +25 -10
  73. package/lib/module/components/WelcomeScreen.js.map +1 -1
  74. package/lib/module/config/api.js +2 -2
  75. package/lib/module/hooks/useConnections.js +6 -6
  76. package/lib/module/hooks/useUserConnections.js +10 -10
  77. package/lib/module/index.js +11 -11
  78. package/lib/module/index.js.map +1 -1
  79. package/lib/module/services/apiClient.js +35 -35
  80. package/lib/module/services/apiKeyService.js +99 -99
  81. package/lib/module/services/authService.js +82 -82
  82. package/lib/module/services/biometricPinService.js +10 -10
  83. package/lib/module/services/connectedAccountsService.js +32 -32
  84. package/lib/module/services/googleAuthService.js +15 -15
  85. package/lib/module/services/imageCompressionService.js +15 -15
  86. package/lib/module/services/jwtStorageService.js +59 -59
  87. package/lib/module/services/mobileTrainingService.js +14 -14
  88. package/lib/module/services/pinEncryptionService.js +10 -10
  89. package/lib/module/services/pinStorageUtils.js +15 -15
  90. package/lib/module/services/platformAuthService.js +47 -47
  91. package/lib/module/services/storageService.js +31 -31
  92. package/lib/module/services/trainingApiHelpers.js +33 -33
  93. package/lib/module/services/userConnectionsService.js +24 -24
  94. package/lib/module/utils/Portal.js +4 -4
  95. package/lib/module/utils/api.js +24 -24
  96. package/lib/module/utils/auth.js +18 -18
  97. package/lib/module/utils/crypto.js +13 -13
  98. package/lib/module/utils/encryption.js +12 -12
  99. package/lib/module/utils/eventUtils.js +52 -52
  100. package/lib/module/utils/programmaticFlow.js +16 -16
  101. package/lib/module/utils/retryHelper.js +27 -27
  102. package/lib/typescript/components/ModalSheet.d.ts.map +1 -1
  103. package/lib/typescript/components/OnairosButton.d.ts +37 -0
  104. package/lib/typescript/components/OnairosButton.d.ts.map +1 -0
  105. package/lib/typescript/components/OnairosSignInButton.d.ts.map +1 -1
  106. package/lib/typescript/components/WelcomeScreen.d.ts.map +1 -1
  107. package/lib/typescript/index.d.ts +3 -1
  108. package/lib/typescript/index.d.ts.map +1 -1
  109. package/package.json +145 -163
  110. package/src/api/index.ts +151 -151
  111. package/src/assets/images/Checkbox.svg +3 -3
  112. package/src/assets/images/EnochE.svg +19 -19
  113. package/src/assets/images/Personalityprofile.svg +3 -3
  114. package/src/assets/images/Personalitytraits.svg +3 -3
  115. package/src/assets/images/Userpreferences.svg +3 -3
  116. package/src/assets/images/arrow.svg +20 -20
  117. package/src/assets/images/basicproficon.svg +43 -43
  118. package/src/assets/images/basicprofile.svg +3 -3
  119. package/src/assets/images/checkmark.svg +4 -4
  120. package/src/assets/images/contentanalysis.svg +3 -3
  121. package/src/assets/images/contenticon.svg +23 -23
  122. package/src/assets/images/personalityicon.svg +18 -18
  123. package/src/assets/images/x-close.svg +3 -3
  124. package/src/components/BodyText.tsx +33 -33
  125. package/src/components/BrandMark.tsx +62 -62
  126. package/src/components/CodeInput.tsx +32 -32
  127. package/src/components/DataRequestScreen.tsx +355 -355
  128. package/src/components/EmailInput.tsx +31 -31
  129. package/src/components/EmailVerificationModal.tsx +363 -363
  130. package/src/components/ExistingUserDataConfirmation.tsx +506 -506
  131. package/src/components/GoogleButton.tsx +55 -55
  132. package/src/components/HeadingGroup.tsx +49 -49
  133. package/src/components/ModalHeader.tsx +125 -125
  134. package/src/components/ModalSheet.tsx +59 -57
  135. package/src/components/Onairos.tsx +422 -422
  136. package/src/components/OnairosButton.tsx +339 -0
  137. package/src/components/OnairosSignInButton.tsx +31 -9
  138. package/src/components/Overlay.tsx +506 -506
  139. package/src/components/PersonaImage.tsx +79 -79
  140. package/src/components/PersonaLoadingScreen.tsx +201 -201
  141. package/src/components/PersonalizationConsentScreen.tsx +410 -410
  142. package/src/components/PinCreationScreen.tsx +492 -492
  143. package/src/components/PinInput.tsx +555 -555
  144. package/src/components/PlatformConnectorsStep.tsx +891 -891
  145. package/src/components/PlatformList.tsx +144 -144
  146. package/src/components/PlatformToggle.tsx +226 -226
  147. package/src/components/PrimaryButton.tsx +213 -213
  148. package/src/components/SignInMatchAnimation.tsx +225 -225
  149. package/src/components/SignInStep.tsx +217 -217
  150. package/src/components/TrainingModal.tsx +1047 -1047
  151. package/src/components/UniversalOnboarding.tsx +2887 -2887
  152. package/src/components/VerificationStep.tsx +198 -198
  153. package/src/components/WelcomeScreen.tsx +490 -473
  154. package/src/components/icons/Basicproficon.tsx +30 -30
  155. package/src/components/icons/Basicprofile.tsx +17 -17
  156. package/src/components/icons/Checkbox.tsx +17 -17
  157. package/src/components/icons/Checkmark.tsx +24 -24
  158. package/src/components/icons/Contentanalysis.tsx +17 -17
  159. package/src/components/icons/Contenticon.tsx +30 -30
  160. package/src/components/icons/EnochE.tsx +39 -39
  161. package/src/components/icons/Personalityicon.tsx +22 -22
  162. package/src/components/icons/Personalityprofile.tsx +17 -17
  163. package/src/components/icons/Personalitytraits.tsx +17 -17
  164. package/src/components/icons/Userpreferences.tsx +17 -17
  165. package/src/components/icons/index.ts +12 -12
  166. package/src/components/onboarding/OAuthWebView.tsx +232 -232
  167. package/src/config/api.ts +25 -25
  168. package/src/context/AuthContext.tsx +393 -393
  169. package/src/hooks/useConnectedAccounts.ts +138 -138
  170. package/src/hooks/useConnections.ts +161 -161
  171. package/src/hooks/useCredentials.ts +174 -174
  172. package/src/hooks/useUserConnections.ts +165 -165
  173. package/src/index.js +14 -0
  174. package/src/index.ts +99 -96
  175. package/src/services/apiClient.ts +336 -336
  176. package/src/services/apiKeyService.ts +919 -919
  177. package/src/services/authService.ts +1008 -1008
  178. package/src/services/biometricPinService.ts +192 -192
  179. package/src/services/connectedAccountsService.ts +289 -289
  180. package/src/services/googleAuthService.ts +279 -279
  181. package/src/services/imageCompressionService.ts +302 -302
  182. package/src/services/jwtStorageService.ts +256 -256
  183. package/src/services/mobileTrainingService.ts +203 -203
  184. package/src/services/pinEncryptionService.ts +75 -75
  185. package/src/services/pinStorageUtils.ts +96 -96
  186. package/src/services/platformAuthService.ts +1346 -1346
  187. package/src/services/storageService.ts +451 -451
  188. package/src/services/trainingApiHelpers.ts +66 -66
  189. package/src/services/userConnectionsService.ts +556 -556
  190. package/src/services/youtubeMigrationService.ts +453 -453
  191. package/src/theme/index.ts +239 -239
  192. package/src/types/ambient.d.ts +28 -28
  193. package/src/types/index.ts +265 -265
  194. package/src/types/node-fix.d.ts +18 -18
  195. package/src/types/node-override.d.ts +23 -23
  196. package/src/types/opacity.d.ts +15 -15
  197. package/src/types/types.d.ts +17 -17
  198. package/src/utils/Portal.tsx +82 -82
  199. package/src/utils/api.js +111 -111
  200. package/src/utils/auth.js +103 -103
  201. package/src/utils/crypto.js +59 -59
  202. package/src/utils/encryption.ts +68 -68
  203. package/src/utils/eventUtils.ts +302 -302
  204. package/src/utils/haptics.ts +58 -58
  205. package/src/utils/imagePreloader.ts +2 -2
  206. package/src/utils/programmaticFlow.ts +112 -112
  207. package/src/utils/retryHelper.ts +274 -274
@@ -13,8 +13,8 @@ const useConnections = () => {
13
13
  const [connections, setConnections] = (0, _react.useState)({});
14
14
  const [isConnecting, setIsConnecting] = (0, _react.useState)(false);
15
15
 
16
- /**
17
- * Connect a platform using OAuth or native SDK
16
+ /**
17
+ * Connect a platform using OAuth or native SDK
18
18
  */
19
19
  const connectPlatform = (0, _react.useCallback)(async (platform, username) => {
20
20
  try {
@@ -83,8 +83,8 @@ const useConnections = () => {
83
83
  }
84
84
  }, []);
85
85
 
86
- /**
87
- * Disconnect a platform
86
+ /**
87
+ * Disconnect a platform
88
88
  */
89
89
  const disconnectPlatform = (0, _react.useCallback)(async (platform, username) => {
90
90
  try {
@@ -135,8 +135,8 @@ const useConnections = () => {
135
135
  }
136
136
  }, []);
137
137
 
138
- /**
139
- * Get current connection status
138
+ /**
139
+ * Get current connection status
140
140
  */
141
141
  const getConnectionStatus = (0, _react.useCallback)(async () => {
142
142
  // In a real app, you might fetch this from storage or API
@@ -14,8 +14,8 @@ const useUserConnections = () => {
14
14
  const [isLoading, setIsLoading] = (0, _react.useState)(true);
15
15
  const [error, setError] = (0, _react.useState)(null);
16
16
 
17
- /**
18
- * Load connections from API with authentication validation
17
+ /**
18
+ * Load connections from API with authentication validation
19
19
  */
20
20
  const loadConnections = (0, _react.useCallback)(async () => {
21
21
  try {
@@ -67,8 +67,8 @@ const useUserConnections = () => {
67
67
  }
68
68
  }, []);
69
69
 
70
- /**
71
- * Refresh connections with authentication validation
70
+ /**
71
+ * Refresh connections with authentication validation
72
72
  */
73
73
  const refreshConnections = (0, _react.useCallback)(async () => {
74
74
  console.log('🔄 [CONNECTIONS HOOK] Refreshing connections...');
@@ -76,8 +76,8 @@ const useUserConnections = () => {
76
76
  console.log('✅ [CONNECTIONS HOOK] Connections refresh completed');
77
77
  }, [loadConnections]);
78
78
 
79
- /**
80
- * Get connections by username with authentication validation
79
+ /**
80
+ * Get connections by username with authentication validation
81
81
  */
82
82
  const getConnectionsByUsername = (0, _react.useCallback)(async username => {
83
83
  try {
@@ -96,8 +96,8 @@ const useUserConnections = () => {
96
96
  }
97
97
  }, []);
98
98
 
99
- /**
100
- * Get connections by user ID with authentication validation
99
+ /**
100
+ * Get connections by user ID with authentication validation
101
101
  */
102
102
  const getConnectionsByUserId = (0, _react.useCallback)(async userId => {
103
103
  try {
@@ -116,8 +116,8 @@ const useUserConnections = () => {
116
116
  }
117
117
  }, []);
118
118
 
119
- /**
120
- * Upload profile picture
119
+ /**
120
+ * Upload profile picture
121
121
  */
122
122
  const uploadUserProfilePicture = (0, _react.useCallback)(async (imageData, fileType = 'jpg') => {
123
123
  try {
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "Onairos", {
51
51
  return _Onairos.Onairos;
52
52
  }
53
53
  });
54
+ Object.defineProperty(exports, "OnairosButton", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _OnairosButton.OnairosButton;
58
+ }
59
+ });
54
60
  Object.defineProperty(exports, "OnairosSignInButton", {
55
61
  enumerable: true,
56
62
  get: function () {
@@ -172,6 +178,7 @@ Object.defineProperty(exports, "updateGoogleClientIds", {
172
178
  return _googleAuthService.updateGoogleClientIds;
173
179
  }
174
180
  });
181
+ var _OnairosButton = require("./components/OnairosButton");
175
182
  var _OnairosSignInButton = require("./components/OnairosSignInButton");
176
183
  var _Onairos = require("./components/Onairos");
177
184
  var _UniversalOnboarding = require("./components/UniversalOnboarding");
@@ -194,14 +201,13 @@ var _platformAuthService = require("./services/platformAuthService");
194
201
  var _googleAuthService = require("./services/googleAuthService");
195
202
  var _apiClient = require("./services/apiClient");
196
203
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
197
- /**
198
- * Onairos React Native SDK v4.0.0
199
- * A React Native implementation for Onairos personalized data integration
200
- *
201
- * PUBLIC API - Complete redesigned UI and enhanced functionality
204
+ /**
205
+ * Onairos React Native SDK v4.0.0
206
+ * A React Native implementation for Onairos personalized data integration
207
+ *
208
+ * PUBLIC API - Complete redesigned UI and enhanced functionality
202
209
  */
203
210
  // Essential Types
204
- // Export OnairosSignInButtonProps from component
205
211
  // Core Components - Redesigned UI
206
212
  // New UI Components - Complete Welcome Flow
207
213
  // Enhanced Hooks - Temporarily commented out for build
@@ -221,6 +227,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
221
227
  // export { AuthProvider } from './context/AuthContext';
222
228
  // Default export for convenience
223
229
  var _default = exports.default = {
230
+ OnairosButton: _OnairosButton.OnairosButton,
224
231
  OnairosSignInButton: _OnairosSignInButton.OnairosSignInButton,
225
232
  Onairos: _Onairos.Onairos,
226
233
  UniversalOnboarding: _UniversalOnboarding.UniversalOnboarding,
@@ -1 +1 @@
1
- {"version":3,"names":["_OnairosSignInButton","require","_Onairos","_UniversalOnboarding","_WelcomeScreen","_interopRequireDefault","_PrimaryButton","_ModalSheet","_ModalHeader","_BrandMark","_HeadingGroup","_BodyText","_SignInStep","_VerificationStep","_PlatformConnectorsStep","_PersonalizationConsentScreen","_PinCreationScreen","_PersonaImage","_apiKeyService","_authService","_platformAuthService","_googleAuthService","_apiClient","e","__esModule","default","_default","exports","OnairosSignInButton","Onairos","UniversalOnboarding","WelcomeScreen"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAZ,OAAA;AACA,IAAAa,uBAAA,GAAAT,sBAAA,CAAAJ,OAAA;AACA,IAAAc,6BAAA,GAAAd,OAAA;AACA,IAAAe,kBAAA,GAAAf,OAAA;AASA,IAAAgB,aAAA,GAAAZ,sBAAA,CAAAJ,OAAA;AAKA,IAAAiB,cAAA,GAAAjB,OAAA;AASA,IAAAkB,YAAA,GAAAlB,OAAA;AAIA,IAAAmB,oBAAA,GAAAnB,OAAA;AAOA,IAAAoB,kBAAA,GAAApB,OAAA;AAKA,IAAAqB,UAAA,GAAArB,OAAA;AAAiD,SAAAI,uBAAAkB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA7EjD;AACA;AACA;AACA;AACA;AACA;AAEA;AAWA;AAGA;AAKA;AAcA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AASA;AAgBA;AAGA;AACA;AAEA;AACA;AAEA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAMe;EACbG,mBAAmB,EAAnBA,wCAAmB;EACnBC,OAAO,EAAPA,gBAAO;EACPC,mBAAmB,EAAnBA,wCAAmB;EACnBC,aAAa,EAAbA;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_OnairosButton","require","_OnairosSignInButton","_Onairos","_UniversalOnboarding","_WelcomeScreen","_interopRequireDefault","_PrimaryButton","_ModalSheet","_ModalHeader","_BrandMark","_HeadingGroup","_BodyText","_SignInStep","_VerificationStep","_PlatformConnectorsStep","_PersonalizationConsentScreen","_PinCreationScreen","_PersonaImage","_apiKeyService","_authService","_platformAuthService","_googleAuthService","_apiClient","e","__esModule","default","_default","exports","OnairosButton","OnairosSignInButton","Onairos","UniversalOnboarding","WelcomeScreen"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AAGA,IAAAI,cAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,iBAAA,GAAAb,OAAA;AACA,IAAAc,uBAAA,GAAAT,sBAAA,CAAAL,OAAA;AACA,IAAAe,6BAAA,GAAAf,OAAA;AACA,IAAAgB,kBAAA,GAAAhB,OAAA;AASA,IAAAiB,aAAA,GAAAZ,sBAAA,CAAAL,OAAA;AAKA,IAAAkB,cAAA,GAAAlB,OAAA;AASA,IAAAmB,YAAA,GAAAnB,OAAA;AAIA,IAAAoB,oBAAA,GAAApB,OAAA;AAOA,IAAAqB,kBAAA,GAAArB,OAAA;AAKA,IAAAsB,UAAA,GAAAtB,OAAA;AAAiD,SAAAK,uBAAAkB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA9EjD;AACA;AACA;AACA;AACA;AACA;AAEA;AAcA;AAMA;AAcA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AASA;AAgBA;AAGA;AACA;AAEA;AACA;AAEA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAOe;EACbG,aAAa,EAAbA,4BAAa;EACbC,mBAAmB,EAAnBA,wCAAmB;EACnBC,OAAO,EAAPA,gBAAO;EACPC,mBAAmB,EAAnBA,wCAAmB;EACnBC,aAAa,EAAbA;AACF,CAAC","ignoreList":[]}
@@ -7,28 +7,28 @@ exports.default = exports.authenticatedRequest = exports.apiPut = exports.apiPos
7
7
  var _jwtStorageService = require("./jwtStorageService");
8
8
  var _api = require("../config/api");
9
9
  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); }
10
- /**
11
- * Centralized API Client with Route-Based JWT Token Management
12
- * CORRECTED APPROACH: Uses different JWT tokens for different route families
13
- *
14
- * TOKEN ROUTING:
15
- * - Enoch JWT: /enoch/*, /api/auth/*, /mobile-training/enoch
16
- * - Onairos JWT: /youtube/*, /gmail/*, social connections
17
- * - Auth Token: Context-specific auth flows
10
+ /**
11
+ * Centralized API Client with Route-Based JWT Token Management
12
+ * CORRECTED APPROACH: Uses different JWT tokens for different route families
13
+ *
14
+ * TOKEN ROUTING:
15
+ * - Enoch JWT: /enoch/*, /api/auth/*, /mobile-training/enoch
16
+ * - Onairos JWT: /youtube/*, /gmail/*, social connections
17
+ * - Auth Token: Context-specific auth flows
18
18
  */
19
19
 
20
- /**
21
- * Global request counter for tracking in-flight requests
20
+ /**
21
+ * Global request counter for tracking in-flight requests
22
22
  */
23
23
  let currentRequestId = 0;
24
24
  const activeRequests = new Map();
25
25
 
26
- /**
27
- * Route-specific authentication triggers
26
+ /**
27
+ * Route-specific authentication triggers
28
28
  */
29
29
 
30
- /**
31
- * Create API client with route-based token management
30
+ /**
31
+ * Create API client with route-based token management
32
32
  */
33
33
  class ApiClient {
34
34
  constructor(baseUrl = _api.API_CONFIG.BASE_URL, authTriggers = {}) {
@@ -36,9 +36,9 @@ class ApiClient {
36
36
  this.authTriggers = authTriggers;
37
37
  }
38
38
 
39
- /**
40
- * Make authenticated API request with route-based token selection
41
- * CRITICAL: Uses the correct token type based on route
39
+ /**
40
+ * Make authenticated API request with route-based token selection
41
+ * CRITICAL: Uses the correct token type based on route
42
42
  */
43
43
  async request(endpoint, options = {}) {
44
44
  const requestId = ++currentRequestId;
@@ -107,9 +107,9 @@ class ApiClient {
107
107
  }
108
108
  }
109
109
 
110
- /**
111
- * Get request headers with route-appropriate token
112
- * CRITICAL: Selects correct token based on route
110
+ /**
111
+ * Get request headers with route-appropriate token
112
+ * CRITICAL: Selects correct token based on route
113
113
  */
114
114
  async getRequestHeaders(endpoint, requiresAuth) {
115
115
  if (!requiresAuth) {
@@ -127,9 +127,9 @@ class ApiClient {
127
127
  };
128
128
  }
129
129
 
130
- /**
131
- * Handle 401 errors with route-specific re-authentication
132
- * CRITICAL FIX: Different auth flows for different token types
130
+ /**
131
+ * Handle 401 errors with route-specific re-authentication
132
+ * CRITICAL FIX: Different auth flows for different token types
133
133
  */
134
134
  async handle401Error(requestId, endpoint, tokenType, options) {
135
135
  console.error(`🚫 [API Client] Request ${requestId} received 401 for ${tokenType} token on route: ${endpoint}`);
@@ -152,8 +152,8 @@ class ApiClient {
152
152
  };
153
153
  }
154
154
 
155
- /**
156
- * Trigger appropriate re-authentication based on token type
155
+ /**
156
+ * Trigger appropriate re-authentication based on token type
157
157
  */
158
158
  async triggerReAuthForTokenType(tokenType, endpoint) {
159
159
  console.log(`🔄 [API Client] Triggering re-auth for ${tokenType} token (endpoint: ${endpoint})`);
@@ -189,8 +189,8 @@ class ApiClient {
189
189
  }
190
190
  }
191
191
 
192
- /**
193
- * Cancel requests using a specific token type
192
+ /**
193
+ * Cancel requests using a specific token type
194
194
  */
195
195
  cancelRequestsForTokenType(tokenType, excludeRequestId) {
196
196
  let cancelledCount = 0;
@@ -209,8 +209,8 @@ class ApiClient {
209
209
  }
210
210
  }
211
211
 
212
- /**
213
- * Replace token for specific type and cancel related requests
212
+ /**
213
+ * Replace token for specific type and cancel related requests
214
214
  */
215
215
  async replaceTokenForType(tokenType, newToken) {
216
216
  console.log(`🔄 [API Client] Replacing ${tokenType} token`);
@@ -229,8 +229,8 @@ class ApiClient {
229
229
  return replaced;
230
230
  }
231
231
 
232
- /**
233
- * Debug: Get all current tokens
232
+ /**
233
+ * Debug: Get all current tokens
234
234
  */
235
235
  async debugTokens() {
236
236
  console.log('🔍 [API Client] Debug: Current token status');
@@ -245,8 +245,8 @@ class ApiClient {
245
245
  return tokens;
246
246
  }
247
247
 
248
- /**
249
- * Set authentication triggers
248
+ /**
249
+ * Set authentication triggers
250
250
  */
251
251
  setAuthTriggers(triggers) {
252
252
  this.authTriggers = {
@@ -256,8 +256,8 @@ class ApiClient {
256
256
  console.log('🔧 [API Client] Authentication triggers updated');
257
257
  }
258
258
 
259
- /**
260
- * Convenience methods for common HTTP verbs
259
+ /**
260
+ * Convenience methods for common HTTP verbs
261
261
  */
262
262
  async get(endpoint, options = {}) {
263
263
  return this.request(endpoint, {
@@ -18,23 +18,23 @@ let ApiKeyType = exports.ApiKeyType = /*#__PURE__*/function (ApiKeyType) {
18
18
  }({}); // JWT token storage key
19
19
  const JWT_TOKEN_KEY = 'onairos_jwt_token';
20
20
 
21
- /**
22
- * Two-Tier Authentication Service for Onairos React Native SDK
23
- *
24
- * This service implements the two-tier authentication system:
25
- * 1. Developer API Keys: For app-level operations (email verification, app registration)
26
- * 2. JWT User Tokens: For user-level operations (PIN storage, user profile)
27
- *
28
- * How it works:
29
- * 1. Initialize with developer API key
30
- * 2. Use API key for email verification requests
31
- * 3. Store JWT token from email verification response
32
- * 4. Use JWT token for user-authenticated requests
33
- * 5. Handle token expiration gracefully
34
- *
35
- * Backend Integration:
36
- * - Developer routes: Authorization: Bearer ${API_KEY}
37
- * - User routes: Authorization: Bearer ${JWT_TOKEN}
21
+ /**
22
+ * Two-Tier Authentication Service for Onairos React Native SDK
23
+ *
24
+ * This service implements the two-tier authentication system:
25
+ * 1. Developer API Keys: For app-level operations (email verification, app registration)
26
+ * 2. JWT User Tokens: For user-level operations (PIN storage, user profile)
27
+ *
28
+ * How it works:
29
+ * 1. Initialize with developer API key
30
+ * 2. Use API key for email verification requests
31
+ * 3. Store JWT token from email verification response
32
+ * 4. Use JWT token for user-authenticated requests
33
+ * 5. Handle token expiration gracefully
34
+ *
35
+ * Backend Integration:
36
+ * - Developer routes: Authorization: Bearer ${API_KEY}
37
+ * - User routes: Authorization: Bearer ${JWT_TOKEN}
38
38
  */
39
39
 
40
40
  // Global configuration state
@@ -53,9 +53,9 @@ const API_ENDPOINTS = {
53
53
  development: 'https://dev-api.onairos.uk'
54
54
  };
55
55
 
56
- /**
57
- * Initialize the SDK with developer API key
58
- * @param config API configuration including developer API key
56
+ /**
57
+ * Initialize the SDK with developer API key
58
+ * @param config API configuration including developer API key
59
59
  */
60
60
  const initializeApiKey = async config => {
61
61
  try {
@@ -128,10 +128,10 @@ const initializeApiKey = async config => {
128
128
  }
129
129
  };
130
130
 
131
- /**
132
- * Determine API key type
133
- * @param apiKey The API key to check
134
- * @returns The type of API key
131
+ /**
132
+ * Determine API key type
133
+ * @param apiKey The API key to check
134
+ * @returns The type of API key
135
135
  */
136
136
  exports.initializeApiKey = initializeApiKey;
137
137
  const getApiKeyType = apiKey => {
@@ -146,20 +146,20 @@ const getApiKeyType = apiKey => {
146
146
  return ApiKeyType.INVALID;
147
147
  };
148
148
 
149
- /**
150
- * Check if API key is admin key
151
- * @param apiKey The API key to check
152
- * @returns True if admin key
149
+ /**
150
+ * Check if API key is admin key
151
+ * @param apiKey The API key to check
152
+ * @returns True if admin key
153
153
  */
154
154
  exports.getApiKeyType = getApiKeyType;
155
155
  const isAdminKey = apiKey => {
156
156
  return apiKey === ADMIN_API_KEY;
157
157
  };
158
158
 
159
- /**
160
- * Validate an API key with the Onairos backend
161
- * @param apiKey The API key to validate
162
- * @returns Validation result with permissions and rate limits
159
+ /**
160
+ * Validate an API key with the Onairos backend
161
+ * @param apiKey The API key to validate
162
+ * @returns Validation result with permissions and rate limits
163
163
  */
164
164
  exports.isAdminKey = isAdminKey;
165
165
  const validateApiKey = async apiKey => {
@@ -396,18 +396,18 @@ const validateApiKey = async apiKey => {
396
396
  }
397
397
  };
398
398
 
399
- /**
400
- * Get the current API configuration
401
- * @returns Current API configuration or null if not initialized
399
+ /**
400
+ * Get the current API configuration
401
+ * @returns Current API configuration or null if not initialized
402
402
  */
403
403
  exports.validateApiKey = validateApiKey;
404
404
  const getApiConfig = () => {
405
405
  return globalConfig;
406
406
  };
407
407
 
408
- /**
409
- * Get the current API key
410
- * @returns Current API key or null if not initialized
408
+ /**
409
+ * Get the current API key
410
+ * @returns Current API key or null if not initialized
411
411
  */
412
412
  exports.getApiConfig = getApiConfig;
413
413
  const getApiKey = () => {
@@ -415,18 +415,18 @@ const getApiKey = () => {
415
415
  return ((_globalConfig9 = globalConfig) === null || _globalConfig9 === void 0 ? void 0 : _globalConfig9.apiKey) || null;
416
416
  };
417
417
 
418
- /**
419
- * Check if the SDK is properly initialized
420
- * @returns True if initialized with valid API key
418
+ /**
419
+ * Check if the SDK is properly initialized
420
+ * @returns True if initialized with valid API key
421
421
  */
422
422
  exports.getApiKey = getApiKey;
423
423
  const isApiKeyInitialized = () => {
424
424
  return isInitialized && globalConfig !== null;
425
425
  };
426
426
 
427
- /**
428
- * Store JWT token securely after email verification
429
- * @param token JWT token from email verification response
427
+ /**
428
+ * Store JWT token securely after email verification
429
+ * @param token JWT token from email verification response
430
430
  */
431
431
  exports.isApiKeyInitialized = isApiKeyInitialized;
432
432
  const storeJWT = async token => {
@@ -443,9 +443,9 @@ const storeJWT = async token => {
443
443
  }
444
444
  };
445
445
 
446
- /**
447
- * Load JWT token from storage
448
- * @returns JWT token or null if not found
446
+ /**
447
+ * Load JWT token from storage
448
+ * @returns JWT token or null if not found
449
449
  */
450
450
  exports.storeJWT = storeJWT;
451
451
  const loadJWT = async () => {
@@ -459,17 +459,17 @@ const loadJWT = async () => {
459
459
  }
460
460
  };
461
461
 
462
- /**
463
- * Get current JWT token
464
- * @returns JWT token or null if not available
462
+ /**
463
+ * Get current JWT token
464
+ * @returns JWT token or null if not available
465
465
  */
466
466
  exports.loadJWT = loadJWT;
467
467
  const getJWT = () => {
468
468
  return userToken;
469
469
  };
470
470
 
471
- /**
472
- * Clear JWT token (on logout or token expiration)
471
+ /**
472
+ * Clear JWT token (on logout or token expiration)
473
473
  */
474
474
  exports.getJWT = getJWT;
475
475
  const clearJWT = async () => {
@@ -485,10 +485,10 @@ const clearJWT = async () => {
485
485
  }
486
486
  };
487
487
 
488
- /**
489
- * React Native compatible base64 decoder
490
- * @param str Base64 encoded string
491
- * @returns Decoded string
488
+ /**
489
+ * React Native compatible base64 decoder
490
+ * @param str Base64 encoded string
491
+ * @returns Decoded string
492
492
  */
493
493
  exports.clearJWT = clearJWT;
494
494
  const base64Decode = str => {
@@ -510,10 +510,10 @@ const base64Decode = str => {
510
510
  return result;
511
511
  };
512
512
 
513
- /**
514
- * Decode JWT token payload (React Native compatible)
515
- * @param token JWT token string
516
- * @returns Decoded payload or null if invalid
513
+ /**
514
+ * Decode JWT token payload (React Native compatible)
515
+ * @param token JWT token string
516
+ * @returns Decoded payload or null if invalid
517
517
  */
518
518
  const decodeJWTPayload = token => {
519
519
  try {
@@ -540,10 +540,10 @@ const decodeJWTPayload = token => {
540
540
  }
541
541
  };
542
542
 
543
- /**
544
- * Extract username from JWT token
545
- * @param token JWT token (optional, uses stored token if not provided)
546
- * @returns Username or null if not found
543
+ /**
544
+ * Extract username from JWT token
545
+ * @param token JWT token (optional, uses stored token if not provided)
546
+ * @returns Username or null if not found
547
547
  */
548
548
  exports.decodeJWTPayload = decodeJWTPayload;
549
549
  const extractUsernameFromJWT = token => {
@@ -571,10 +571,10 @@ const extractUsernameFromJWT = token => {
571
571
  }
572
572
  };
573
573
 
574
- /**
575
- * Extract user data from JWT token
576
- * @param token JWT token (optional, uses stored token if not provided)
577
- * @returns User data object or null if not found
574
+ /**
575
+ * Extract user data from JWT token
576
+ * @param token JWT token (optional, uses stored token if not provided)
577
+ * @returns User data object or null if not found
578
578
  */
579
579
  exports.extractUsernameFromJWT = extractUsernameFromJWT;
580
580
  const extractUserDataFromJWT = token => {
@@ -608,18 +608,18 @@ const extractUserDataFromJWT = token => {
608
608
  }
609
609
  };
610
610
 
611
- /**
612
- * Check if user is authenticated with JWT token
613
- * @returns True if user has valid JWT token
611
+ /**
612
+ * Check if user is authenticated with JWT token
613
+ * @returns True if user has valid JWT token
614
614
  */
615
615
  exports.extractUserDataFromJWT = extractUserDataFromJWT;
616
616
  const isUserAuthenticated = () => {
617
617
  return !!userToken;
618
618
  };
619
619
 
620
- /**
621
- * Get authenticated headers for API requests
622
- * @returns Headers object with Authorization and other required headers
620
+ /**
621
+ * Get authenticated headers for API requests
622
+ * @returns Headers object with Authorization and other required headers
623
623
  */
624
624
  exports.isUserAuthenticated = isUserAuthenticated;
625
625
  const getAuthHeaders = () => {
@@ -639,9 +639,9 @@ const getAuthHeaders = () => {
639
639
  };
640
640
  };
641
641
 
642
- /**
643
- * Get authentication headers for developer API requests
644
- * @returns Headers with developer API key
642
+ /**
643
+ * Get authentication headers for developer API requests
644
+ * @returns Headers with developer API key
645
645
  */
646
646
  exports.getAuthHeaders = getAuthHeaders;
647
647
  const getDeveloperAuthHeaders = () => {
@@ -661,9 +661,9 @@ const getDeveloperAuthHeaders = () => {
661
661
  };
662
662
  };
663
663
 
664
- /**
665
- * Get authentication headers for user JWT requests
666
- * @returns Headers with user JWT token
664
+ /**
665
+ * Get authentication headers for user JWT requests
666
+ * @returns Headers with user JWT token
667
667
  */
668
668
  exports.getDeveloperAuthHeaders = getDeveloperAuthHeaders;
669
669
  const getUserAuthHeaders = () => {
@@ -680,11 +680,11 @@ const getUserAuthHeaders = () => {
680
680
  };
681
681
  };
682
682
 
683
- /**
684
- * Make an authenticated API request
685
- * @param endpoint The API endpoint (relative to base URL)
686
- * @param options Fetch options
687
- * @returns Response promise
683
+ /**
684
+ * Make an authenticated API request
685
+ * @param endpoint The API endpoint (relative to base URL)
686
+ * @param options Fetch options
687
+ * @returns Response promise
688
688
  */
689
689
  exports.getUserAuthHeaders = getUserAuthHeaders;
690
690
  const makeAuthenticatedRequest = async (endpoint, options = {}) => {
@@ -742,11 +742,11 @@ const makeAuthenticatedRequest = async (endpoint, options = {}) => {
742
742
  }
743
743
  };
744
744
 
745
- /**
746
- * Make authenticated request with developer API key
747
- * @param endpoint The API endpoint
748
- * @param options Fetch options
749
- * @returns Response promise
745
+ /**
746
+ * Make authenticated request with developer API key
747
+ * @param endpoint The API endpoint
748
+ * @param options Fetch options
749
+ * @returns Response promise
750
750
  */
751
751
  exports.makeAuthenticatedRequest = makeAuthenticatedRequest;
752
752
  const makeDeveloperRequest = async (endpoint, options = {}) => {
@@ -804,11 +804,11 @@ const makeDeveloperRequest = async (endpoint, options = {}) => {
804
804
  }
805
805
  };
806
806
 
807
- /**
808
- * Make authenticated request with user JWT token
809
- * @param endpoint The API endpoint
810
- * @param options Fetch options
811
- * @returns Response promise
807
+ /**
808
+ * Make authenticated request with user JWT token
809
+ * @param endpoint The API endpoint
810
+ * @param options Fetch options
811
+ * @returns Response promise
812
812
  */
813
813
  exports.makeDeveloperRequest = makeDeveloperRequest;
814
814
  const makeUserRequest = async (endpoint, options = {}) => {
@@ -870,8 +870,8 @@ const makeUserRequest = async (endpoint, options = {}) => {
870
870
  }
871
871
  };
872
872
 
873
- /**
874
- * Clear the API key validation cache
873
+ /**
874
+ * Clear the API key validation cache
875
875
  */
876
876
  exports.makeUserRequest = makeUserRequest;
877
877
  const clearValidationCache = () => {
@@ -882,8 +882,8 @@ const clearValidationCache = () => {
882
882
  }
883
883
  };
884
884
 
885
- /**
886
- * Reset the SDK initialization state
885
+ /**
886
+ * Reset the SDK initialization state
887
887
  */
888
888
  exports.clearValidationCache = clearValidationCache;
889
889
  const resetApiKeyService = () => {