@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.
- 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/ModalSheet.js +8 -2
- package/lib/commonjs/components/ModalSheet.js.map +1 -1
- package/lib/commonjs/components/OnairosButton.js +290 -0
- package/lib/commonjs/components/OnairosButton.js.map +1 -0
- package/lib/commonjs/components/OnairosSignInButton.js +32 -8
- package/lib/commonjs/components/OnairosSignInButton.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +4 -4
- package/lib/commonjs/components/WelcomeScreen.js +29 -13
- package/lib/commonjs/components/WelcomeScreen.js.map +1 -1
- 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 +13 -6
- 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/ModalSheet.js +7 -2
- package/lib/module/components/ModalSheet.js.map +1 -1
- package/lib/module/components/OnairosButton.js +282 -0
- package/lib/module/components/OnairosButton.js.map +1 -0
- package/lib/module/components/OnairosSignInButton.js +32 -8
- package/lib/module/components/OnairosSignInButton.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +4 -4
- package/lib/module/components/WelcomeScreen.js +25 -10
- package/lib/module/components/WelcomeScreen.js.map +1 -1
- 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 +11 -11
- 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/ModalSheet.d.ts.map +1 -1
- package/lib/typescript/components/OnairosButton.d.ts +37 -0
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -0
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +1 -1
- package/lib/typescript/components/WelcomeScreen.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +3 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +145 -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 +59 -57
- package/src/components/Onairos.tsx +422 -422
- package/src/components/OnairosButton.tsx +339 -0
- package/src/components/OnairosSignInButton.tsx +31 -9
- 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 +490 -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 -0
- package/src/index.ts +99 -96
- 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
|
@@ -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
|
@@ -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":["
|
|
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 = () => {
|