@onairos/react-native 3.1.15 → 3.1.17
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 +404 -0
- package/lib/commonjs/assets/images/Checkbox.svg +3 -3
- package/lib/commonjs/assets/images/EnochE.svg +19 -19
- package/lib/commonjs/assets/images/Personalityprofile.svg +3 -3
- package/lib/commonjs/assets/images/Personalitytraits.svg +3 -3
- package/lib/commonjs/assets/images/Userpreferences.svg +3 -3
- package/lib/commonjs/assets/images/arrow.svg +20 -20
- package/lib/commonjs/assets/images/basicproficon.svg +43 -43
- package/lib/commonjs/assets/images/basicprofile.svg +3 -3
- package/lib/commonjs/assets/images/checkmark.svg +4 -4
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -3
- package/lib/commonjs/assets/images/contenticon.svg +23 -23
- package/lib/commonjs/assets/images/personalityicon.svg +18 -18
- package/lib/commonjs/assets/images/x-close.svg +3 -3
- package/lib/commonjs/components/OnairosSignInButton.js +32 -74
- package/lib/commonjs/components/OnairosSignInButton.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +4 -4
- package/lib/commonjs/config/api.js +2 -2
- package/lib/commonjs/hooks/useConnections.js +6 -6
- package/lib/commonjs/hooks/useUserConnections.js +10 -10
- package/lib/commonjs/index.js +5 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/apiClient.js +35 -35
- package/lib/commonjs/services/apiKeyService.js +99 -99
- package/lib/commonjs/services/authService.js +82 -82
- package/lib/commonjs/services/biometricPinService.js +10 -10
- package/lib/commonjs/services/connectedAccountsService.js +32 -32
- package/lib/commonjs/services/googleAuthService.js +15 -15
- package/lib/commonjs/services/imageCompressionService.js +15 -15
- package/lib/commonjs/services/jwtStorageService.js +59 -59
- package/lib/commonjs/services/mobileTrainingService.js +14 -14
- package/lib/commonjs/services/pinEncryptionService.js +10 -10
- package/lib/commonjs/services/pinStorageUtils.js +15 -15
- package/lib/commonjs/services/platformAuthService.js +47 -47
- package/lib/commonjs/services/storageService.js +31 -31
- package/lib/commonjs/services/trainingApiHelpers.js +33 -33
- package/lib/commonjs/services/userConnectionsService.js +24 -24
- package/lib/commonjs/utils/Portal.js +4 -4
- package/lib/commonjs/utils/api.js +24 -24
- package/lib/commonjs/utils/auth.js +18 -18
- package/lib/commonjs/utils/crypto.js +13 -13
- package/lib/commonjs/utils/encryption.js +12 -12
- package/lib/commonjs/utils/eventUtils.js +52 -52
- package/lib/commonjs/utils/programmaticFlow.js +16 -16
- package/lib/commonjs/utils/retryHelper.js +27 -27
- package/lib/module/assets/images/Checkbox.svg +3 -3
- package/lib/module/assets/images/EnochE.svg +19 -19
- package/lib/module/assets/images/Personalityprofile.svg +3 -3
- package/lib/module/assets/images/Personalitytraits.svg +3 -3
- package/lib/module/assets/images/Userpreferences.svg +3 -3
- package/lib/module/assets/images/arrow.svg +20 -20
- package/lib/module/assets/images/basicproficon.svg +43 -43
- package/lib/module/assets/images/basicprofile.svg +3 -3
- package/lib/module/assets/images/checkmark.svg +4 -4
- package/lib/module/assets/images/contentanalysis.svg +3 -3
- package/lib/module/assets/images/contenticon.svg +23 -23
- package/lib/module/assets/images/personalityicon.svg +18 -18
- package/lib/module/assets/images/x-close.svg +3 -3
- package/lib/module/components/OnairosSignInButton.js +32 -74
- package/lib/module/components/OnairosSignInButton.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +4 -4
- package/lib/module/config/api.js +2 -2
- package/lib/module/hooks/useConnections.js +6 -6
- package/lib/module/hooks/useUserConnections.js +10 -10
- package/lib/module/index.js +5 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/apiClient.js +35 -35
- package/lib/module/services/apiKeyService.js +99 -99
- package/lib/module/services/authService.js +82 -82
- package/lib/module/services/biometricPinService.js +10 -10
- package/lib/module/services/connectedAccountsService.js +32 -32
- package/lib/module/services/googleAuthService.js +15 -15
- package/lib/module/services/imageCompressionService.js +15 -15
- package/lib/module/services/jwtStorageService.js +59 -59
- package/lib/module/services/mobileTrainingService.js +14 -14
- package/lib/module/services/pinEncryptionService.js +10 -10
- package/lib/module/services/pinStorageUtils.js +15 -15
- package/lib/module/services/platformAuthService.js +47 -47
- package/lib/module/services/storageService.js +31 -31
- package/lib/module/services/trainingApiHelpers.js +33 -33
- package/lib/module/services/userConnectionsService.js +24 -24
- package/lib/module/utils/Portal.js +4 -4
- package/lib/module/utils/api.js +24 -24
- package/lib/module/utils/auth.js +18 -18
- package/lib/module/utils/crypto.js +13 -13
- package/lib/module/utils/encryption.js +12 -12
- package/lib/module/utils/eventUtils.js +52 -52
- package/lib/module/utils/programmaticFlow.js +16 -16
- package/lib/module/utils/retryHelper.js +27 -27
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +0 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +163 -163
- package/src/api/index.ts +151 -151
- package/src/assets/images/Checkbox.svg +3 -3
- package/src/assets/images/EnochE.svg +19 -19
- package/src/assets/images/Personalityprofile.svg +3 -3
- package/src/assets/images/Personalitytraits.svg +3 -3
- package/src/assets/images/Userpreferences.svg +3 -3
- package/src/assets/images/arrow.svg +20 -20
- package/src/assets/images/basicproficon.svg +43 -43
- package/src/assets/images/basicprofile.svg +3 -3
- package/src/assets/images/checkmark.svg +4 -4
- package/src/assets/images/contentanalysis.svg +3 -3
- package/src/assets/images/contenticon.svg +23 -23
- package/src/assets/images/personalityicon.svg +18 -18
- package/src/assets/images/x-close.svg +3 -3
- package/src/components/BodyText.tsx +33 -33
- package/src/components/BrandMark.tsx +62 -62
- package/src/components/CodeInput.tsx +32 -32
- package/src/components/DataRequestScreen.tsx +355 -355
- package/src/components/EmailInput.tsx +31 -31
- package/src/components/EmailVerificationModal.tsx +363 -363
- package/src/components/ExistingUserDataConfirmation.tsx +506 -506
- package/src/components/GoogleButton.tsx +55 -55
- package/src/components/HeadingGroup.tsx +49 -49
- package/src/components/ModalHeader.tsx +125 -125
- package/src/components/ModalSheet.tsx +57 -57
- package/src/components/Onairos.tsx +422 -422
- package/src/components/OnairosButton.tsx +339 -339
- package/src/components/OnairosSignInButton.tsx +130 -166
- package/src/components/Overlay.tsx +506 -506
- package/src/components/PersonaImage.tsx +79 -79
- package/src/components/PersonaLoadingScreen.tsx +201 -201
- package/src/components/PersonalizationConsentScreen.tsx +410 -410
- package/src/components/PinCreationScreen.tsx +492 -492
- package/src/components/PinInput.tsx +555 -555
- package/src/components/PlatformConnectorsStep.tsx +891 -891
- package/src/components/PlatformList.tsx +144 -144
- package/src/components/PlatformToggle.tsx +226 -226
- package/src/components/PrimaryButton.tsx +213 -213
- package/src/components/SignInMatchAnimation.tsx +225 -225
- package/src/components/SignInStep.tsx +217 -217
- package/src/components/TrainingModal.tsx +1047 -1047
- package/src/components/UniversalOnboarding.tsx +2887 -2887
- package/src/components/VerificationStep.tsx +198 -198
- package/src/components/WelcomeScreen.tsx +473 -473
- package/src/components/icons/Basicproficon.tsx +30 -30
- package/src/components/icons/Basicprofile.tsx +17 -17
- package/src/components/icons/Checkbox.tsx +17 -17
- package/src/components/icons/Checkmark.tsx +24 -24
- package/src/components/icons/Contentanalysis.tsx +17 -17
- package/src/components/icons/Contenticon.tsx +30 -30
- package/src/components/icons/EnochE.tsx +39 -39
- package/src/components/icons/Personalityicon.tsx +22 -22
- package/src/components/icons/Personalityprofile.tsx +17 -17
- package/src/components/icons/Personalitytraits.tsx +17 -17
- package/src/components/icons/Userpreferences.tsx +17 -17
- package/src/components/icons/index.ts +12 -12
- package/src/components/onboarding/OAuthWebView.tsx +232 -232
- package/src/config/api.ts +25 -25
- package/src/context/AuthContext.tsx +393 -393
- package/src/hooks/useConnectedAccounts.ts +138 -138
- package/src/hooks/useConnections.ts +161 -161
- package/src/hooks/useCredentials.ts +174 -174
- package/src/hooks/useUserConnections.ts +165 -165
- package/src/index.js +14 -14
- package/src/index.ts +94 -95
- package/src/services/apiClient.ts +336 -336
- package/src/services/apiKeyService.ts +919 -919
- package/src/services/authService.ts +1008 -1008
- package/src/services/biometricPinService.ts +192 -192
- package/src/services/connectedAccountsService.ts +289 -289
- package/src/services/googleAuthService.ts +279 -279
- package/src/services/imageCompressionService.ts +302 -302
- package/src/services/jwtStorageService.ts +256 -256
- package/src/services/mobileTrainingService.ts +203 -203
- package/src/services/pinEncryptionService.ts +75 -75
- package/src/services/pinStorageUtils.ts +96 -96
- package/src/services/platformAuthService.ts +1346 -1346
- package/src/services/storageService.ts +451 -451
- package/src/services/trainingApiHelpers.ts +66 -66
- package/src/services/userConnectionsService.ts +556 -556
- package/src/services/youtubeMigrationService.ts +453 -453
- package/src/theme/index.ts +239 -239
- package/src/types/ambient.d.ts +28 -28
- package/src/types/index.ts +265 -265
- package/src/types/node-fix.d.ts +18 -18
- package/src/types/node-override.d.ts +23 -23
- package/src/types/opacity.d.ts +15 -15
- package/src/types/types.d.ts +17 -17
- package/src/utils/Portal.tsx +82 -82
- package/src/utils/api.js +111 -111
- package/src/utils/auth.js +103 -103
- package/src/utils/crypto.js +59 -59
- package/src/utils/encryption.ts +68 -68
- package/src/utils/eventUtils.ts +302 -302
- package/src/utils/haptics.ts +58 -58
- package/src/utils/imagePreloader.ts +2 -2
- package/src/utils/programmaticFlow.ts +112 -112
- package/src/utils/retryHelper.ts +274 -274
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_asyncStorage","_interopRequireDefault","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_asyncStorage","_interopRequireDefault","_WelcomeScreen","_haptics","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","OnairosSignInButton","AppName","buttonWidth","buttonHeight","color","textColor","onResolved","onRejection","autoFocusEmailInput","showWelcomeScreen","setShowWelcomeScreen","useState","userEmail","setUserEmail","handleWelcomeComplete","useCallback","token","email","console","log","isJWTToken","includes","split","length","AsyncStorage","getItem","then","storedEmail","emailToUse","handleWelcomeCancel","createElement","View","style","styles","container","TouchableOpacity","button","width","height","backgroundColor","onPress","triggerHaptic","HapticType","BUTTON_PRESS","activeOpacity","contentRow","Image","source","logo","resizeMode","accessibilityLabel","Text","buttonText","visible","onClose","onComplete","exports","StyleSheet","create","borderRadius","justifyContent","alignItems","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","marginVertical","flexDirection","marginRight","fontSize","fontWeight","textAlign"],"sourceRoot":"../../../src","sources":["components/OnairosSignInButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,cAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAA6D,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAO,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CAAA,gBAAAN,CAAA,IAAAH,CAAA,gBAA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;IACpBD,cAAc,EAAE;EAClB,CAAC;EACDZ,IAAI,EAAE;IACJX,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACV+B,WAAW,EAAE;EACf,CAAC;EACDjB,UAAU,EAAE;IACVkB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,SAAS,EAAE;EACb,CAAC;EACDtC,SAAS,EAAE;IACT;EAAA;AAEJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -585,8 +585,8 @@ const UniversalOnboarding = ({
|
|
|
585
585
|
}
|
|
586
586
|
}, [platformToggles, username]);
|
|
587
587
|
|
|
588
|
-
/**
|
|
589
|
-
* Handles OAuth callback URLs
|
|
588
|
+
/**
|
|
589
|
+
* Handles OAuth callback URLs
|
|
590
590
|
*/
|
|
591
591
|
const handleOAuthCallback = (0, _react.useCallback)(url => {
|
|
592
592
|
try {
|
|
@@ -618,8 +618,8 @@ const UniversalOnboarding = ({
|
|
|
618
618
|
}
|
|
619
619
|
}, [currentPlatform, username]);
|
|
620
620
|
|
|
621
|
-
/**
|
|
622
|
-
* Handles successful OAuth authentication from the OAuthWebView
|
|
621
|
+
/**
|
|
622
|
+
* Handles successful OAuth authentication from the OAuthWebView
|
|
623
623
|
*/
|
|
624
624
|
const handleOAuthSuccess = (0, _react.useCallback)(async code => {
|
|
625
625
|
console.log(`🎉 OAuth success for ${currentPlatform} - backend callback completed`);
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getAuthHeaders = exports.getApiHeaders = exports.API_CONFIG = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* API Configuration for Onairos SDK
|
|
7
|
+
/**
|
|
8
|
+
* API Configuration for Onairos SDK
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
const API_CONFIG = exports.API_CONFIG = {
|
|
@@ -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 {
|
package/lib/commonjs/index.js
CHANGED
|
@@ -57,12 +57,6 @@ Object.defineProperty(exports, "OnairosButton", {
|
|
|
57
57
|
return _OnairosButton.OnairosButton;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
Object.defineProperty(exports, "OnairosSignInButton", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return _OnairosSignInButton.OnairosSignInButton;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
60
|
Object.defineProperty(exports, "PersonaImage", {
|
|
67
61
|
enumerable: true,
|
|
68
62
|
get: function () {
|
|
@@ -179,7 +173,6 @@ Object.defineProperty(exports, "updateGoogleClientIds", {
|
|
|
179
173
|
}
|
|
180
174
|
});
|
|
181
175
|
var _OnairosButton = require("./components/OnairosButton");
|
|
182
|
-
var _OnairosSignInButton = require("./components/OnairosSignInButton");
|
|
183
176
|
var _Onairos = require("./components/Onairos");
|
|
184
177
|
var _UniversalOnboarding = require("./components/UniversalOnboarding");
|
|
185
178
|
var _WelcomeScreen = _interopRequireDefault(require("./components/WelcomeScreen"));
|
|
@@ -201,11 +194,11 @@ var _platformAuthService = require("./services/platformAuthService");
|
|
|
201
194
|
var _googleAuthService = require("./services/googleAuthService");
|
|
202
195
|
var _apiClient = require("./services/apiClient");
|
|
203
196
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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
|
|
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
|
|
209
202
|
*/
|
|
210
203
|
// Essential Types
|
|
211
204
|
// Core Components - Redesigned UI
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_OnairosButton","require","
|
|
1
|
+
{"version":3,"names":["_OnairosButton","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","OnairosButton","On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AACA;AAEA;AACA;AAEA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAMe;EACbG,aAAa,EAAbA,4BAAa;EACbC,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, {
|