@onairos/react-native 3.6.9 → 3.7.1
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 +423 -423
- package/lib/commonjs/api/index.js +1 -1
- package/lib/commonjs/assets/icons/netflix.png +0 -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/netflix.png +0 -0
- package/lib/commonjs/assets/images/personalityicon.svg +18 -18
- package/lib/commonjs/assets/images/x-close.svg +3 -3
- package/lib/commonjs/components/BodyText.js +1 -1
- package/lib/commonjs/components/BrandMark.js +1 -1
- package/lib/commonjs/components/CodeInput.js +1 -1
- package/lib/commonjs/components/EmailInput.js +1 -1
- package/lib/commonjs/components/GoogleButton.js +1 -1
- package/lib/commonjs/components/HeadingGroup.js +1 -1
- package/lib/commonjs/components/LLMDataInputModal.js +1 -1
- package/lib/commonjs/components/ModalHeader.js +1 -1
- package/lib/commonjs/components/ModalSheet.js +1 -1
- package/lib/commonjs/components/Onairos.js +1 -1
- package/lib/commonjs/components/OnairosButton.js +1 -1
- package/lib/commonjs/components/OnairosSignInButton.js +1 -1
- package/lib/commonjs/components/Overlay.js +1 -1
- package/lib/commonjs/components/PersonaImage.js +1 -1
- package/lib/commonjs/components/PersonaLoadingScreen.js +1 -1
- package/lib/commonjs/components/PersonalizationConsentScreen.js +1 -1
- package/lib/commonjs/components/PinCreationScreen.js +1 -1
- package/lib/commonjs/components/PinInput.js +1 -1
- package/lib/commonjs/components/PlatformConnectorsStep.js +1 -1
- package/lib/commonjs/components/PlatformList.js +1 -1
- package/lib/commonjs/components/PlatformToggle.js +1 -1
- package/lib/commonjs/components/PrimaryButton.js +1 -1
- package/lib/commonjs/components/SignInMatchAnimation.js +1 -1
- package/lib/commonjs/components/SignInStep.js +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +1 -1
- package/lib/commonjs/components/VerificationStep.js +1 -1
- package/lib/commonjs/components/WelcomeScreen.js +1 -1
- package/lib/commonjs/components/icons/Basicproficon.js +1 -1
- package/lib/commonjs/components/icons/Basicprofile.js +1 -1
- package/lib/commonjs/components/icons/Checkbox.js +1 -1
- package/lib/commonjs/components/icons/Checkmark.js +1 -1
- package/lib/commonjs/components/icons/Contentanalysis.js +1 -1
- package/lib/commonjs/components/icons/Contenticon.js +1 -1
- package/lib/commonjs/components/icons/EnochE.js +1 -1
- package/lib/commonjs/components/icons/Personalityicon.js +1 -1
- package/lib/commonjs/components/icons/Personalityprofile.js +1 -1
- package/lib/commonjs/components/icons/Personalitytraits.js +1 -1
- package/lib/commonjs/components/icons/Userpreferences.js +1 -1
- package/lib/commonjs/components/icons/index.js +1 -1
- package/lib/commonjs/components/onboarding/OAuthWebView.js +1 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +1 -1
- package/lib/commonjs/components/onboarding/PinInput.js +1 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js +1 -1
- package/lib/commonjs/config/api.js +1 -1
- package/lib/commonjs/constants/index.js +1 -1
- package/lib/commonjs/context/AuthContext.js +1 -1
- package/lib/commonjs/hooks/useConnectedAccounts.js +1 -1
- package/lib/commonjs/hooks/useConnections.js +1 -1
- package/lib/commonjs/hooks/useCredentials.js +1 -1
- package/lib/commonjs/hooks/useUserConnections.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +421 -421
- package/lib/commonjs/services/apiClient.js +1 -1
- package/lib/commonjs/services/apiKeyService.js +99 -99
- package/lib/commonjs/services/authService.js +72 -72
- package/lib/commonjs/services/biometricPinService.js +1 -1
- package/lib/commonjs/services/chatGPTConversationExtractor.js +1 -1
- package/lib/commonjs/services/chatGPTConversationService.js +1 -1
- package/lib/commonjs/services/claudeConversationExtractor.js +1 -1
- package/lib/commonjs/services/claudeConversationService.js +1 -1
- package/lib/commonjs/services/connectedAccountsService.js +1 -1
- package/lib/commonjs/services/googleAuthService.js +1 -1
- package/lib/commonjs/services/hingeDataExtractor.js +1 -1
- package/lib/commonjs/services/hingeDataService.js +1 -1
- package/lib/commonjs/services/imageCompressionService.js +1 -1
- package/lib/commonjs/services/instagramDataExtractor.js +1 -1
- package/lib/commonjs/services/instagramDataService.js +1 -1
- package/lib/commonjs/services/jwtStorageService.js +1 -1
- package/lib/commonjs/services/linkedinDOMExtractor.js +1 -1
- package/lib/commonjs/services/linkedinProfileService.js +1 -1
- package/lib/commonjs/services/linkedinScrapingService.js +1 -1
- package/lib/commonjs/services/llmDataStorage.js +1 -1
- package/lib/commonjs/services/mobileTrainingService.js +1 -1
- package/lib/commonjs/services/netflixDataExtractor.js +8 -0
- package/lib/commonjs/services/netflixDataService.js +9 -0
- package/lib/commonjs/services/oauthService.js +20 -20
- package/lib/commonjs/services/pinEncryptionService.js +1 -1
- package/lib/commonjs/services/pinStorageUtils.js +1 -1
- package/lib/commonjs/services/platformAuthService.js +1 -1
- package/lib/commonjs/services/sephoraDataExtractor.js +1 -1
- package/lib/commonjs/services/sephoraDataService.js +1 -1
- package/lib/commonjs/services/spotifyDataExtractor.js +8 -0
- package/lib/commonjs/services/spotifyDataService.js +9 -0
- package/lib/commonjs/services/storageService.js +1 -1
- package/lib/commonjs/services/telegramDataExtractor.js +1 -1
- package/lib/commonjs/services/telegramDataService.js +1 -1
- package/lib/commonjs/services/trainingApiHelpers.js +1 -1
- package/lib/commonjs/services/userConnectionsService.js +1 -1
- package/lib/commonjs/services/youtubeMigrationService.js +1 -1
- package/lib/commonjs/theme/index.js +1 -1
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types.js +1 -1
- package/lib/commonjs/utils/Portal.js +1 -1
- package/lib/commonjs/utils/api.js +1 -1
- package/lib/commonjs/utils/assetRegistry.js +3 -1
- package/lib/commonjs/utils/auth.js +1 -1
- package/lib/commonjs/utils/connectorTests.js +1 -1
- package/lib/commonjs/utils/crypto.js +1 -1
- package/lib/commonjs/utils/debugHelper.js +1 -1
- package/lib/commonjs/utils/encryption.js +1 -1
- package/lib/commonjs/utils/eventUtils.js +1 -1
- package/lib/commonjs/utils/haptics.js +1 -1
- package/lib/commonjs/utils/imagePreloader.js +1 -1
- package/lib/commonjs/utils/networkDiagnostics.js +1 -1
- package/lib/commonjs/utils/onairosApi.js +1 -1
- package/lib/commonjs/utils/programmaticFlow.js +1 -1
- package/lib/commonjs/utils/retryHelper.js +1 -1
- package/lib/commonjs/utils/secureStorage.js +1 -1
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -1
- package/lib/commonjs/utils/webviewScripts/claude.js +1 -1
- package/lib/commonjs/utils/webviewScripts/hinge.js +1 -1
- package/lib/commonjs/utils/webviewScripts/index.js +4 -2
- package/lib/commonjs/utils/webviewScripts/instagram.js +1 -1
- package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -1
- package/lib/commonjs/utils/webviewScripts/netflix.js +1 -0
- package/lib/commonjs/utils/webviewScripts/sephora.js +1 -1
- package/lib/commonjs/utils/webviewScripts/spotify.js +1 -0
- package/lib/commonjs/utils/webviewScripts/telegram.js +1 -1
- package/lib/module/api/index.js +1 -1
- package/lib/module/assets/icons/netflix.png +0 -0
- 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/netflix.png +0 -0
- package/lib/module/assets/images/personalityicon.svg +18 -18
- package/lib/module/assets/images/x-close.svg +3 -3
- package/lib/module/components/BodyText.js +1 -1
- package/lib/module/components/BrandMark.js +1 -1
- package/lib/module/components/CodeInput.js +1 -1
- package/lib/module/components/EmailInput.js +1 -1
- package/lib/module/components/GoogleButton.js +1 -1
- package/lib/module/components/HeadingGroup.js +1 -1
- package/lib/module/components/LLMDataInputModal.js +1 -1
- package/lib/module/components/ModalHeader.js +1 -1
- package/lib/module/components/ModalSheet.js +1 -1
- package/lib/module/components/Onairos.js +1 -1
- package/lib/module/components/OnairosButton.js +1 -1
- package/lib/module/components/OnairosSignInButton.js +1 -1
- package/lib/module/components/Overlay.js +1 -1
- package/lib/module/components/PersonaImage.js +1 -1
- package/lib/module/components/PersonaLoadingScreen.js +1 -1
- package/lib/module/components/PersonalizationConsentScreen.js +1 -1
- package/lib/module/components/PinCreationScreen.js +1 -1
- package/lib/module/components/PinInput.js +1 -1
- package/lib/module/components/PlatformConnectorsStep.js +1 -1
- package/lib/module/components/PlatformList.js +1 -1
- package/lib/module/components/PlatformToggle.js +1 -1
- package/lib/module/components/PrimaryButton.js +1 -1
- package/lib/module/components/SignInMatchAnimation.js +1 -1
- package/lib/module/components/SignInStep.js +1 -1
- package/lib/module/components/UniversalOnboarding.js +1 -1
- package/lib/module/components/VerificationStep.js +1 -1
- package/lib/module/components/WelcomeScreen.js +1 -1
- package/lib/module/components/icons/Basicproficon.js +1 -1
- package/lib/module/components/icons/Basicprofile.js +1 -1
- package/lib/module/components/icons/Checkbox.js +1 -1
- package/lib/module/components/icons/Checkmark.js +1 -1
- package/lib/module/components/icons/Contentanalysis.js +1 -1
- package/lib/module/components/icons/Contenticon.js +1 -1
- package/lib/module/components/icons/EnochE.js +1 -1
- package/lib/module/components/icons/Personalityicon.js +1 -1
- package/lib/module/components/icons/Personalityprofile.js +1 -1
- package/lib/module/components/icons/Personalitytraits.js +1 -1
- package/lib/module/components/icons/Userpreferences.js +1 -1
- package/lib/module/components/onboarding/OAuthWebView.js +1 -1
- package/lib/module/components/onboarding/OnboardingHeader.js +1 -1
- package/lib/module/components/onboarding/PinInput.js +1 -1
- package/lib/module/components/onboarding/PlatformConnector.js +1 -1
- package/lib/module/config/api.js +1 -1
- package/lib/module/constants/index.js +1 -1
- package/lib/module/context/AuthContext.js +1 -1
- package/lib/module/hooks/useConnectedAccounts.js +1 -1
- package/lib/module/hooks/useConnections.js +1 -1
- package/lib/module/hooks/useCredentials.js +1 -1
- package/lib/module/hooks/useUserConnections.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/services/SDK_API_KEY_VALIDATION.md +421 -421
- package/lib/module/services/apiClient.js +1 -1
- package/lib/module/services/apiKeyService.js +99 -99
- package/lib/module/services/authService.js +72 -72
- package/lib/module/services/biometricPinService.js +1 -1
- package/lib/module/services/chatGPTConversationExtractor.js +1 -1
- package/lib/module/services/chatGPTConversationService.js +1 -1
- package/lib/module/services/claudeConversationExtractor.js +1 -1
- package/lib/module/services/claudeConversationService.js +1 -1
- package/lib/module/services/connectedAccountsService.js +1 -1
- package/lib/module/services/googleAuthService.js +1 -1
- package/lib/module/services/hingeDataExtractor.js +1 -1
- package/lib/module/services/hingeDataService.js +1 -1
- package/lib/module/services/imageCompressionService.js +1 -1
- package/lib/module/services/instagramDataExtractor.js +1 -1
- package/lib/module/services/instagramDataService.js +1 -1
- package/lib/module/services/jwtStorageService.js +1 -1
- package/lib/module/services/linkedinDOMExtractor.js +1 -1
- package/lib/module/services/linkedinProfileService.js +1 -1
- package/lib/module/services/linkedinScrapingService.js +1 -1
- package/lib/module/services/llmDataStorage.js +1 -1
- package/lib/module/services/mobileTrainingService.js +1 -1
- package/lib/module/services/netflixDataExtractor.js +1 -0
- package/lib/module/services/netflixDataService.js +1 -0
- package/lib/module/services/oauthService.js +20 -20
- package/lib/module/services/pinEncryptionService.js +1 -1
- package/lib/module/services/pinStorageUtils.js +1 -1
- package/lib/module/services/platformAuthService.js +1 -1
- package/lib/module/services/sephoraDataExtractor.js +1 -1
- package/lib/module/services/sephoraDataService.js +1 -1
- package/lib/module/services/spotifyDataExtractor.js +1 -0
- package/lib/module/services/spotifyDataService.js +1 -0
- package/lib/module/services/storageService.js +1 -1
- package/lib/module/services/telegramDataExtractor.js +1 -1
- package/lib/module/services/telegramDataService.js +1 -1
- package/lib/module/services/trainingApiHelpers.js +1 -1
- package/lib/module/services/userConnectionsService.js +1 -1
- package/lib/module/services/youtubeMigrationService.js +1 -1
- package/lib/module/theme/index.js +1 -1
- package/lib/module/types.js +1 -1
- package/lib/module/utils/Portal.js +1 -1
- package/lib/module/utils/api.js +1 -1
- package/lib/module/utils/assetRegistry.js +3 -1
- package/lib/module/utils/auth.js +1 -1
- package/lib/module/utils/connectorTests.js +1 -1
- package/lib/module/utils/crypto.js +1 -1
- package/lib/module/utils/debugHelper.js +1 -1
- package/lib/module/utils/encryption.js +1 -1
- package/lib/module/utils/eventUtils.js +1 -1
- package/lib/module/utils/haptics.js +1 -1
- package/lib/module/utils/networkDiagnostics.js +1 -1
- package/lib/module/utils/onairosApi.js +1 -1
- package/lib/module/utils/programmaticFlow.js +1 -1
- package/lib/module/utils/retryHelper.js +1 -1
- package/lib/module/utils/secureStorage.js +1 -1
- package/lib/module/utils/webviewScripts/chatgpt.js +1 -1
- package/lib/module/utils/webviewScripts/claude.js +1 -1
- package/lib/module/utils/webviewScripts/hinge.js +1 -1
- package/lib/module/utils/webviewScripts/index.js +1 -1
- package/lib/module/utils/webviewScripts/instagram.js +1 -1
- package/lib/module/utils/webviewScripts/linkedin.js +1 -1
- package/lib/module/utils/webviewScripts/netflix.js +1 -0
- package/lib/module/utils/webviewScripts/sephora.js +1 -1
- package/lib/module/utils/webviewScripts/spotify.js +1 -0
- package/lib/module/utils/webviewScripts/telegram.js +1 -1
- package/package.json +172 -172
- package/lib/commonjs/config/PLATFORM_APIS.md +0 -559
- package/lib/commonjs/config/telegramConfig.js +0 -8
- package/lib/commonjs/config/webchangelog/md +0 -607
- package/lib/module/config/PLATFORM_APIS.md +0 -559
- package/lib/module/config/telegramConfig.js +0 -8
- package/lib/module/config/webchangelog/md +0 -607
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0xc426(_0x585fa8,_0xc426c9){_0x585fa8=_0x585fa8-0x0;const _0x56f6cc=_0x585f();let _0x50cc37=_0x56f6cc[_0x585fa8];return _0x50cc37;}import{getJWTForRoute,TokenType,getTokenTypeForRoute,clearJWT,getAllTokens,replaceJWTAfterVerification}from'./jwtStorageService';function _0x585f(){const _0x584063=['BASE_URL','baseUrl','authTriggers','request','Request\x20cancelled','Unknown\x20error','set','log','🔗\x20[API\x20Client]\x20Starting\x20request\x20','\x20to:\x20','Ggewl','🎯\x20[API\x20Client]\x20Route\x20','\x20token','getRequestHeaders','xINYd','requiresAuth','OnairosSDK/1.0.0','headers','body','signal','🔐\x20[API\x20Client]\x20Request\x20','\x20using\x20','\x20status:','status','FJpje','delete','JEgKT','OjaNP','dGFmc','✅\x20[API\x20Client]\x20','\x20token\x20replaced\x20and\x20related\x20requests\x20cancelled','message','qruls','name','AbortError','\x20was\x20cancelled','dLoWg','error','❌\x20[API\x20Client]\x20Request\x20','eexYw','No\x20','.\x20Please\x20authenticate\x20first.','handle401Error','3|5|2|0|4|1|6','HePEg','split','cancelRequestsForTokenType','🚫\x20[API\x20Client]\x20Request\x20','\x20received\x20401\x20for\x20','\x20token\x20on\x20route:\x20','🔄\x20[API\x20Client]\x20Clearing\x20','\x20token\x20due\x20to\x20401\x20error','\x20authentication\x20expired\x20for\x20','.\x20Please\x20re-authenticate.','triggerReAuthForTokenType','📧\x20[API\x20Client]\x20Triggering\x20Enoch\x20email\x20re-verification','PoYIC','🔄\x20[API\x20Client]\x20Triggering\x20auth\x20token\x20refresh','vueKw','yjdMi','🔄\x20[API\x20Client]\x20Triggering\x20re-auth\x20for\x20','triggerEnochReAuth','NORYr','warn','aklkJ','ONAIROS','MUIqo','⚠️\x20[API\x20Client]\x20No\x20Onairos\x20re-auth\x20trigger\x20configured','substring','length','AUTH','triggerAuthTokenRefresh','zsXCD','ENBBy','FvJYS','hYAmL','wPEUs','TWIZg','nnkir','MKSUL','⚠️\x20[API\x20Client]\x20No\x20auth\x20token\x20refresh\x20trigger\x20configured','yTLPy','YYNsI','❌\x20[API\x20Client]\x20Failed\x20to\x20trigger\x20re-auth\x20for\x20','🔧\x20[API\x20Client]\x20Authentication\x20triggers\x20updated','oiiNp','entries','dFXhh','pITDl','Request\x20failed\x20with\x20status\x20','ygMzo','frxct','🔄\x20[API\x20Client]\x20Replacing\x20','debugTokens','🔍\x20[API\x20Client]\x20Debug:\x20Current\x20token\x20status','ckNjX','ivUtF','rxxPB','uFnYY','LwsOd','VJlrH','🔐\x20','...\x20(length:\x20','📭\x20',':\x20null','nUxxv','ySMli','setAuthTriggers','VbCis','get','post','bind','put'];_0x585f=function(){return _0x584063;};return _0x585f();}import{API_CONFIG}from'../config/api';let currentRequestId=0x0;const activeRequests=new Map();class ApiClient{constructor(_0x57d577=API_CONFIG[_0xc426(0x0)],_0x11192e={}){this[_0xc426(0x1)]=_0x57d577,this[_0xc426(0x2)]=_0x11192e;}async[_0xc426(0x3)](_0x8d25fe,_0x8e16b1={}){const _0x6beb30={'Ggewl':function(_0x2be1e9,_0x4f83ad){return _0x2be1e9(_0x4f83ad);},'xINYd':function(_0x5ddd1f,_0x41421d){return _0x5ddd1f!==_0x41421d;},'HzqOt':function(_0x2ac7a5,_0x1698ec,_0x292e00){return _0x2ac7a5(_0x1698ec,_0x292e00);},'FJpje':function(_0x3eb414,_0x3e49d7){return _0x3eb414===_0x3e49d7;},'JEgKT':function(_0xafba79,_0x3266b7){return _0xafba79===_0x3266b7;},'qruls':function(_0x379d80,_0x581463){return _0x379d80 instanceof _0x581463;},'dLoWg':_0xc426(0x4),'eexYw':_0xc426(0x5)},_0x48cb94=++currentRequestId,_0x2fdb49=new AbortController();activeRequests[_0xc426(0x6)](_0x48cb94,_0x2fdb49);try{console[_0xc426(0x7)](_0xc426(0x8)+_0x48cb94+_0xc426(0x9)+_0x8d25fe);const _0x5dab15=_0x6beb30[_0xc426(0xa)](getTokenTypeForRoute,_0x8d25fe);console['log'](_0xc426(0xb)+_0x8d25fe+'\x20requires\x20'+_0x5dab15+_0xc426(0xc));const _0x12c957=await this[_0xc426(0xd)](_0x8d25fe,_0x6beb30[_0xc426(0xe)](_0x8e16b1[_0xc426(0xf)],![])),_0x17032c={'method':_0x8e16b1['method']||'GET','headers':{'Content-Type':'application/json','User-Agent':_0xc426(0x10),..._0x12c957,..._0x8e16b1[_0xc426(0x11)]},'body':_0x8e16b1['body']?JSON['stringify'](_0x8e16b1[_0xc426(0x12)]):undefined,'signal':_0x2fdb49[_0xc426(0x13)]};console[_0xc426(0x7)](_0xc426(0x14)+_0x48cb94+_0xc426(0x15)+_0x5dab15+_0xc426(0xc));const _0x1739ed=await _0x6beb30['HzqOt'](fetch,''+this[_0xc426(0x1)]+_0x8d25fe,_0x17032c);console[_0xc426(0x7)]('📡\x20[API\x20Client]\x20Response\x20'+_0x48cb94+_0xc426(0x16),_0x1739ed[_0xc426(0x17)]);if(_0x6beb30[_0xc426(0x18)](_0x1739ed[_0xc426(0x17)],0x191))return await this['handle401Error'](_0x48cb94,_0x8d25fe,_0x5dab15,_0x8e16b1);const _0x33d809=await _0x1739ed['json']();activeRequests[_0xc426(0x19)](_0x48cb94);if(!_0x1739ed['ok']){if(_0x6beb30[_0xc426(0x1a)](_0xc426(0x1b),_0xc426(0x1c)))_0x4b56e5[_0xc426(0x7)](_0xc426(0x1d)+_0x2065a8+_0xc426(0x1e));else return{'success':![],'error':_0x33d809[_0xc426(0x1f)]||'Request\x20failed\x20with\x20status\x20'+_0x1739ed[_0xc426(0x17)],'status':_0x1739ed[_0xc426(0x17)],'tokenType':_0x5dab15};}return{'success':!![],'data':_0x33d809,'status':_0x1739ed[_0xc426(0x17)],'tokenType':_0x5dab15};}catch(_0x315ae3){activeRequests[_0xc426(0x19)](_0x48cb94);if(_0x6beb30[_0xc426(0x20)](_0x315ae3,Error)&&_0x6beb30[_0xc426(0x1a)](_0x315ae3[_0xc426(0x21)],_0xc426(0x22)))return console[_0xc426(0x7)]('🚫\x20[API\x20Client]\x20Request\x20'+_0x48cb94+_0xc426(0x23)),{'success':![],'error':_0x6beb30[_0xc426(0x24)],'status':0x0};return console[_0xc426(0x25)](_0xc426(0x26)+_0x48cb94+'\x20failed:',_0x315ae3),{'success':![],'error':_0x6beb30[_0xc426(0x20)](_0x315ae3,Error)?_0x315ae3[_0xc426(0x1f)]:_0x6beb30[_0xc426(0x27)],'status':0x0};}}async['getRequestHeaders'](_0x4238c5,_0x1ab79f){const _0x12f24d={'bhsXl':function(_0x36858d,_0x136f52){return _0x36858d(_0x136f52);}};if(!_0x1ab79f)return{};const _0x335735=await _0x12f24d['bhsXl'](getJWTForRoute,_0x4238c5);if(!_0x335735){const _0x7e0e3d=getTokenTypeForRoute(_0x4238c5);throw new Error(_0xc426(0x28)+_0x7e0e3d+'\x20token\x20available\x20for\x20route\x20'+_0x4238c5+_0xc426(0x29));}return{'Authorization':_0x335735};}async[_0xc426(0x2a)](_0x5ae0d8,_0x4cf149,_0x5c68dc,_0x208cd8){const _0x1fd099={'HePEg':_0xc426(0x2b)},_0x9d0562=_0x1fd099[_0xc426(0x2c)][_0xc426(0x2d)]('|');let _0x24f625=0x0;while(!![]){switch(_0x9d0562[_0x24f625++]){case'0':this[_0xc426(0x2e)](_0x5c68dc,_0x5ae0d8);continue;case'1':console['log']('🔑\x20[API\x20Client]\x20'+_0x5c68dc+'\x20token\x20cleared,\x20user\x20needs\x20to\x20re-authenticate');continue;case'2':await clearJWT(_0x5c68dc);continue;case'3':console[_0xc426(0x25)](_0xc426(0x2f)+_0x5ae0d8+_0xc426(0x30)+_0x5c68dc+_0xc426(0x31)+_0x4cf149);continue;case'4':await this['triggerReAuthForTokenType'](_0x5c68dc,_0x4cf149);continue;case'5':console[_0xc426(0x7)](_0xc426(0x32)+_0x5c68dc+_0xc426(0x33));continue;case'6':return{'success':![],'error':_0x5c68dc+_0xc426(0x34)+_0x4cf149+_0xc426(0x35),'status':0x191,'tokenType':_0x5c68dc};}break;}}async[_0xc426(0x36)](_0x4b8cb7,_0x4860af){const _0x31a59b={'lSyPm':function(_0x1ada51,_0x58fbad){return _0x1ada51 instanceof _0x58fbad;},'FvJYS':function(_0x526634,_0xa5ae2c){return _0x526634===_0xa5ae2c;},'AyjwU':_0xc426(0x22),'hYAmL':'Request\x20cancelled','wPEUs':function(_0x2069ad,_0x350767){return _0x2069ad instanceof _0x350767;},'xyQvF':_0xc426(0x5),'NORYr':_0xc426(0x37),'aklkJ':'⚠️\x20[API\x20Client]\x20No\x20Enoch\x20re-auth\x20trigger\x20configured','nnkir':function(_0x77d390,_0x109e37){return _0x77d390===_0x109e37;},'MUIqo':_0xc426(0x38),'ENBBy':'TrCbH','TWIZg':_0xc426(0x39),'MKSUL':_0xc426(0x3a),'yTLPy':function(_0x1c77e8,_0x2a3c6a){return _0x1c77e8!==_0x2a3c6a;},'YYNsI':_0xc426(0x3b)};console[_0xc426(0x7)](_0xc426(0x3c)+_0x4b8cb7+'\x20token\x20(endpoint:\x20'+_0x4860af+')');try{switch(_0x4b8cb7){case TokenType['ENOCH']:this[_0xc426(0x2)][_0xc426(0x3d)]?(console[_0xc426(0x7)](_0x31a59b[_0xc426(0x3e)]),await this[_0xc426(0x2)]['triggerEnochReAuth']()):console[_0xc426(0x3f)](_0x31a59b[_0xc426(0x40)]);break;case TokenType[_0xc426(0x41)]:this[_0xc426(0x2)]['triggerOnairosReAuth']?(console['log']('🔑\x20[API\x20Client]\x20Triggering\x20Onairos\x20re-authentication'),await this[_0xc426(0x2)]['triggerOnairosReAuth']()):_0x31a59b['nnkir'](_0x31a59b['MUIqo'],_0x31a59b[_0xc426(0x42)])?console[_0xc426(0x3f)](_0xc426(0x43)):_0x29946d[_0xc426(0x7)]('🔐\x20'+_0x51770c+':\x20'+_0x317ee4[_0xc426(0x44)](0x0,0x14)+'...\x20(length:\x20'+_0x57b2bd[_0xc426(0x45)]+')');break;case TokenType[_0xc426(0x46)]:if(this[_0xc426(0x2)][_0xc426(0x47)]){if(_0x31a59b['nnkir'](_0xc426(0x48),_0x31a59b[_0xc426(0x49)])){_0x2e6462[_0xc426(0x19)](_0x3ba169);if(_0x31a59b['lSyPm'](_0x35356b,_0x35d0b4)&&_0x31a59b[_0xc426(0x4a)](_0x5706e5[_0xc426(0x21)],_0x31a59b['AyjwU']))return _0x14e437['log'](_0xc426(0x2f)+_0x36e47e+_0xc426(0x23)),{'success':![],'error':_0x31a59b[_0xc426(0x4b)],'status':0x0};return _0x1d7f5e[_0xc426(0x25)](_0xc426(0x26)+_0x4e3c13+'\x20failed:',_0x72ed60),{'success':![],'error':_0x31a59b[_0xc426(0x4c)](_0xbc4d4d,_0x366cb0)?_0xfa8ac8[_0xc426(0x1f)]:_0x31a59b['xyQvF'],'status':0x0};}else console[_0xc426(0x7)](_0x31a59b[_0xc426(0x4d)]),await this['authTriggers'][_0xc426(0x47)]();}else{if(_0x31a59b[_0xc426(0x4e)]('vueKw',_0x31a59b[_0xc426(0x4f)]))console[_0xc426(0x3f)](_0xc426(0x50));else return this[_0xc426(0x3)](_0x5be1eb,{..._0x1036aa,'method':'POST','body':_0x161810});}break;}}catch(_0x31c8a9){if(_0x31a59b[_0xc426(0x51)](_0x31a59b[_0xc426(0x52)],_0x31a59b[_0xc426(0x52)]))return _0xa5ca2b['log'](_0xc426(0x2f)+_0x2882ec+_0xc426(0x23)),{'success':![],'error':_0x31a59b[_0xc426(0x4b)],'status':0x0};else console[_0xc426(0x25)](_0xc426(0x53)+_0x4b8cb7+':',_0x31c8a9);}}[_0xc426(0x2e)](_0x52a60b,_0x24b218){const _0x29e6ed={'frxct':_0xc426(0x54),'dFXhh':function(_0x5ac541,_0x3da09e){return _0x5ac541!==_0x3da09e;},'pITDl':'QiwEk','ygMzo':_0xc426(0x55)};let _0xbd8488=0x0;for(const [_0x34990e,_0x3ea1a2]of activeRequests[_0xc426(0x56)]()){if(_0x29e6ed[_0xc426(0x57)]('JHJYc',_0x29e6ed[_0xc426(0x58)]))_0x34990e!==_0x24b218&&(_0x3ea1a2['abort'](),activeRequests[_0xc426(0x19)](_0x34990e),_0xbd8488++);else return{'success':![],'error':_0x5cf42e[_0xc426(0x1f)]||_0xc426(0x59)+_0x3756a0[_0xc426(0x17)],'status':_0x525c82[_0xc426(0x17)],'tokenType':_0x21ddea};}_0xbd8488>0x0&&(_0xc426(0x55)!==_0x29e6ed[_0xc426(0x5a)]?(this[_0xc426(0x2)]={...this[_0xc426(0x2)],..._0x4b4852},_0x74e7c3['log'](_0x29e6ed[_0xc426(0x5b)])):console['log']('🚫\x20[API\x20Client]\x20Cancelled\x20'+_0xbd8488+'\x20requests\x20due\x20to\x20'+_0x52a60b+'\x20token\x20failure'));}async['replaceTokenForType'](_0x2d43a2,_0x4a4b65){console['log'](_0xc426(0x5c)+_0x2d43a2+'\x20token'),this[_0xc426(0x2e)](_0x2d43a2);const _0x3f8495=await replaceJWTAfterVerification(_0x2d43a2,_0x4a4b65);return _0x3f8495&&console[_0xc426(0x7)](_0xc426(0x1d)+_0x2d43a2+'\x20token\x20replaced\x20and\x20related\x20requests\x20cancelled'),_0x3f8495;}async[_0xc426(0x5d)](){const _0x45ef6b={'ySMli':function(_0x328846,_0x10ab37){return _0x328846!==_0x10ab37;},'qKdVF':_0xc426(0x5e),'LwsOd':function(_0x4a078d,_0x2bb4b1){return _0x4a078d===_0x2bb4b1;},'YwvzX':_0xc426(0x5f),'VJlrH':_0xc426(0x60),'nUxxv':_0xc426(0x61),'KiFGY':_0xc426(0x62)};console['log'](_0x45ef6b['qKdVF']);const _0x4a420c=await getAllTokens();for(const [_0x3ddc1e,_0x546527]of Object['entries'](_0x4a420c)){_0x45ef6b[_0xc426(0x63)](_0x45ef6b['YwvzX'],_0x45ef6b[_0xc426(0x64)])?_0x767dd8?_0x1347a1[_0xc426(0x7)](_0xc426(0x65)+_0x4912ec+':\x20'+_0x4f77e0[_0xc426(0x44)](0x0,0x14)+_0xc426(0x66)+_0x4b7820[_0xc426(0x45)]+')'):_0x42d738[_0xc426(0x7)](_0xc426(0x67)+_0x17471b+_0xc426(0x68)):_0x546527?_0x45ef6b[_0xc426(0x69)]!==_0x45ef6b['KiFGY']?console[_0xc426(0x7)](_0xc426(0x65)+_0x3ddc1e+':\x20'+_0x546527['substring'](0x0,0x14)+_0xc426(0x66)+_0x546527[_0xc426(0x45)]+')'):_0x45ef6b[_0xc426(0x6a)](_0x10c6e3,_0x412e8f)&&(_0x450911['abort'](),_0x2c2a51['delete'](_0x2fbf23),_0xd4eaee++):console['log'](_0xc426(0x67)+_0x3ddc1e+_0xc426(0x68));}return _0x4a420c;}[_0xc426(0x6b)](_0x230b96){const _0xbc8fc4={'VbCis':_0xc426(0x54)};this[_0xc426(0x2)]={...this['authTriggers'],..._0x230b96},console[_0xc426(0x7)](_0xbc8fc4[_0xc426(0x6c)]);}async[_0xc426(0x6d)](_0x18ca57,_0x3befde={}){return this[_0xc426(0x3)](_0x18ca57,{..._0x3befde,'method':'GET'});}async[_0xc426(0x6e)](_0x15e9e8,_0x10baa0,_0x576113={}){return this['request'](_0x15e9e8,{..._0x576113,'method':'POST','body':_0x10baa0});}async['put'](_0x5041bc,_0xfd8d41,_0x39d269={}){return this[_0xc426(0x3)](_0x5041bc,{..._0x39d269,'method':'PUT','body':_0xfd8d41});}async[_0xc426(0x19)](_0x33fab6,_0x3fac9b={}){return this[_0xc426(0x3)](_0x33fab6,{..._0x3fac9b,'method':'DELETE'});}}export const apiClient=new ApiClient();export{ApiClient};export const authenticatedRequest=apiClient[_0xc426(0x3)][_0xc426(0x6f)](apiClient);export const apiGet=apiClient['get'][_0xc426(0x6f)](apiClient);export const apiPost=apiClient['post'][_0xc426(0x6f)](apiClient);export const apiPut=apiClient[_0xc426(0x70)][_0xc426(0x6f)](apiClient);export const apiDelete=apiClient[_0xc426(0x19)][_0xc426(0x6f)](apiClient);export default apiClient;
|
|
1
|
+
import{getJWTForRoute,TokenType,getTokenTypeForRoute,clearJWT,getAllTokens,replaceJWTAfterVerification}from'./jwtStorageService';import{API_CONFIG}from'../config/api';function _0xf2c3(_0x808687,_0xf2c350){_0x808687=_0x808687-0x0;const _0x1cba4c=_0x8086();let _0x1b4ea3=_0x1cba4c[_0x808687];return _0x1b4ea3;}let currentRequestId=0x0;const activeRequests=new Map();class ApiClient{constructor(_0x37573f=API_CONFIG[_0xf2c3(0x0)],_0xe91641={}){this['baseUrl']=_0x37573f,this[_0xf2c3(0x1)]=_0xe91641;}async[_0xf2c3(0x2)](_0x2b1b4b,_0x34c893={}){const _0x4d1d1e={'SvTkd':function(_0x4760f1,_0xdfc2b1){return _0x4760f1===_0xdfc2b1;},'Ssqif':'ZccsR','wrgfL':'BQXrb','PrdaK':function(_0x16fafe,_0x353285){return _0x16fafe(_0x353285);},'gSQli':function(_0x3d4618,_0x4d5930){return _0x3d4618!==_0x4d5930;},'qBtMD':'OnairosSDK/1.0.0','RNVDm':function(_0x11c510,_0x2942c1,_0xfb1f66){return _0x11c510(_0x2942c1,_0xfb1f66);},'Nbccd':'ovWEH','DCFQr':function(_0x99d79e,_0x4a3e6d){return _0x99d79e===_0x4a3e6d;},'zyCxQ':_0xf2c3(0x3),'hOwTw':function(_0xb974c6,_0x309df4){return _0xb974c6 instanceof _0x309df4;},'IwyFt':function(_0x5d57fd,_0x1e66a2){return _0x5d57fd===_0x1e66a2;},'dBimO':'AbortError','uKeUS':_0xf2c3(0x4),'WilQt':_0xf2c3(0x5),'MIeco':'Unknown\x20error'},_0x35ffb3=++currentRequestId,_0x38f478=new AbortController();activeRequests[_0xf2c3(0x6)](_0x35ffb3,_0x38f478);try{if(_0x4d1d1e[_0xf2c3(0x7)](_0x4d1d1e[_0xf2c3(0x8)],_0x4d1d1e[_0xf2c3(0x9)]))_0x87c1f0[_0xf2c3(0xa)](_0xf2c3(0xb)+_0x5a103e+':\x20'+_0x3c1499[_0xf2c3(0xc)](0x0,0x14)+_0xf2c3(0xd)+_0x3ef93d[_0xf2c3(0xe)]+')');else{console[_0xf2c3(0xa)](_0xf2c3(0xf)+_0x35ffb3+'\x20to:\x20'+_0x2b1b4b);const _0x3918ce=_0x4d1d1e[_0xf2c3(0x10)](getTokenTypeForRoute,_0x2b1b4b);console[_0xf2c3(0xa)](_0xf2c3(0x11)+_0x2b1b4b+'\x20requires\x20'+_0x3918ce+_0xf2c3(0x12));const _0x262b01=await this[_0xf2c3(0x13)](_0x2b1b4b,_0x4d1d1e[_0xf2c3(0x14)](_0x34c893[_0xf2c3(0x15)],![])),_0x4a867d={'method':_0x34c893[_0xf2c3(0x16)]||'GET','headers':{'Content-Type':'application/json','User-Agent':_0x4d1d1e[_0xf2c3(0x17)],..._0x262b01,..._0x34c893[_0xf2c3(0x18)]},'body':_0x34c893[_0xf2c3(0x19)]?JSON[_0xf2c3(0x1a)](_0x34c893[_0xf2c3(0x19)]):undefined,'signal':_0x38f478['signal']};console[_0xf2c3(0xa)](_0xf2c3(0x1b)+_0x35ffb3+'\x20using\x20'+_0x3918ce+_0xf2c3(0x12));const _0x22260a=await _0x4d1d1e[_0xf2c3(0x1c)](fetch,''+this[_0xf2c3(0x1d)]+_0x2b1b4b,_0x4a867d);console[_0xf2c3(0xa)](_0xf2c3(0x1e)+_0x35ffb3+'\x20status:',_0x22260a[_0xf2c3(0x1f)]);if(_0x22260a[_0xf2c3(0x1f)]===0x191)return _0x4d1d1e[_0xf2c3(0x14)](_0x4d1d1e[_0xf2c3(0x20)],_0x4d1d1e[_0xf2c3(0x20)])?this[_0xf2c3(0x2)](_0x3a0f01,{..._0x4c582b,'method':'PUT','body':_0x4701a1}):await this[_0xf2c3(0x21)](_0x35ffb3,_0x2b1b4b,_0x3918ce,_0x34c893);const _0x445cbb=await _0x22260a[_0xf2c3(0x22)]();activeRequests['delete'](_0x35ffb3);if(!_0x22260a['ok'])return _0x4d1d1e[_0xf2c3(0x23)](_0x4d1d1e[_0xf2c3(0x24)],_0x4d1d1e[_0xf2c3(0x24)])?{'success':![],'error':_0x445cbb['message']||_0xf2c3(0x25)+_0x22260a[_0xf2c3(0x1f)],'status':_0x22260a['status'],'tokenType':_0x3918ce}:this[_0xf2c3(0x2)](_0xae5884,{..._0x55934c,'method':'POST','body':_0x5a7e82});return{'success':!![],'data':_0x445cbb,'status':_0x22260a['status'],'tokenType':_0x3918ce};}}catch(_0x188059){activeRequests[_0xf2c3(0x26)](_0x35ffb3);if(_0x4d1d1e[_0xf2c3(0x27)](_0x188059,Error)&&_0x4d1d1e['IwyFt'](_0x188059[_0xf2c3(0x28)],_0x4d1d1e['dBimO']))return _0x4d1d1e[_0xf2c3(0x7)](_0x4d1d1e['uKeUS'],_0x4d1d1e['uKeUS'])?(console[_0xf2c3(0xa)](_0xf2c3(0x29)+_0x35ffb3+_0xf2c3(0x2a)),{'success':![],'error':_0x4d1d1e[_0xf2c3(0x2b)],'status':0x0}):{'success':![],'error':_0x323f25[_0xf2c3(0x2c)]||'Request\x20failed\x20with\x20status\x20'+_0x49f2b5[_0xf2c3(0x1f)],'status':_0x1a0951[_0xf2c3(0x1f)],'tokenType':_0x2e3d1d};return console[_0xf2c3(0x2d)](_0xf2c3(0x2e)+_0x35ffb3+_0xf2c3(0x2f),_0x188059),{'success':![],'error':_0x188059 instanceof Error?_0x188059[_0xf2c3(0x2c)]:_0x4d1d1e[_0xf2c3(0x30)],'status':0x0};}}async[_0xf2c3(0x13)](_0x26e5dc,_0x541589){const _0x2929ba={'dGRlQ':function(_0x1b4ca0,_0x3250bb){return _0x1b4ca0!==_0x3250bb;},'UjxSK':_0xf2c3(0x31),'ayMoB':function(_0x3e2beb,_0x53c3d6){return _0x3e2beb(_0x53c3d6);}};if(!_0x541589)return{};const _0x59cb85=await getJWTForRoute(_0x26e5dc);if(!_0x59cb85){if(_0x2929ba[_0xf2c3(0x32)]('yNGrC',_0x2929ba[_0xf2c3(0x33)])){const _0x5b70d2=_0x2929ba[_0xf2c3(0x34)](getTokenTypeForRoute,_0x26e5dc);throw new Error('No\x20'+_0x5b70d2+_0xf2c3(0x35)+_0x26e5dc+_0xf2c3(0x36));}else _0x1abe63['warn'](_0xf2c3(0x37));}return{'Authorization':_0x59cb85};}async[_0xf2c3(0x21)](_0x4bfecd,_0x161973,_0x1289f9,_0x17972b){const _0x5ebec9={'lHDsL':function(_0x392219,_0x1d5b37){return _0x392219(_0x1d5b37);}};return console[_0xf2c3(0x2d)](_0xf2c3(0x29)+_0x4bfecd+_0xf2c3(0x38)+_0x1289f9+_0xf2c3(0x39)+_0x161973),console[_0xf2c3(0xa)](_0xf2c3(0x3a)+_0x1289f9+_0xf2c3(0x3b)),await _0x5ebec9[_0xf2c3(0x3c)](clearJWT,_0x1289f9),this[_0xf2c3(0x3d)](_0x1289f9,_0x4bfecd),await this[_0xf2c3(0x3e)](_0x1289f9,_0x161973),console['log']('🔑\x20[API\x20Client]\x20'+_0x1289f9+_0xf2c3(0x3f)),{'success':![],'error':_0x1289f9+_0xf2c3(0x40)+_0x161973+_0xf2c3(0x41),'status':0x191,'tokenType':_0x1289f9};}async[_0xf2c3(0x3e)](_0x4eabf4,_0xf24f74){const _0x122808={'jtxmV':function(_0x4e3adf,_0x4207ae){return _0x4e3adf!==_0x4207ae;},'NSHvY':function(_0x2bbb97,_0x2833c0){return _0x2bbb97 instanceof _0x2833c0;},'sTHXO':function(_0x5eb352,_0x44f796){return _0x5eb352===_0x44f796;},'qroer':'AbortError','ZeWxw':'Request\x20cancelled','KqEeH':_0xf2c3(0x42),'kQDZm':_0xf2c3(0x43),'zrZSo':_0xf2c3(0x44),'WayHV':function(_0x52f0e8,_0x335601){return _0x52f0e8===_0x335601;},'Jgtzk':_0xf2c3(0x45),'ziPhe':_0xf2c3(0x46),'JnCgo':_0xf2c3(0x47),'MLMYU':_0xf2c3(0x48),'qQsfF':function(_0xf864a,_0xa6dbe5){return _0xf864a===_0xa6dbe5;},'oAQDP':_0xf2c3(0x49),'QdwPD':_0xf2c3(0x4a),'euEmz':'pNbYi','DUhcw':_0xf2c3(0x4b),'dobEi':_0xf2c3(0x37)};console[_0xf2c3(0xa)](_0xf2c3(0x4c)+_0x4eabf4+'\x20token\x20(endpoint:\x20'+_0xf24f74+')');try{if(_0x122808[_0xf2c3(0x4d)](_0xf2c3(0x4e),_0x122808['kQDZm']))_0x122808[_0xf2c3(0x4f)](_0x20081f,_0x57dcc4)&&(_0x4594bd[_0xf2c3(0x50)](),_0x474931[_0xf2c3(0x26)](_0x132c79),_0x151af0++);else switch(_0x4eabf4){case TokenType[_0xf2c3(0x51)]:if(this['authTriggers']['triggerEnochReAuth'])console[_0xf2c3(0xa)](_0x122808[_0xf2c3(0x52)]),await this[_0xf2c3(0x1)][_0xf2c3(0x53)]();else{if(_0x122808[_0xf2c3(0x54)](_0x122808[_0xf2c3(0x55)],_0x122808[_0xf2c3(0x55)]))console[_0xf2c3(0x56)](_0x122808[_0xf2c3(0x57)]);else return this[_0xf2c3(0x2)](_0x7c6935,{..._0x33222f,'method':'GET'});}break;case TokenType[_0xf2c3(0x58)]:if(this[_0xf2c3(0x1)][_0xf2c3(0x59)])_0x122808['JnCgo']===_0x122808['JnCgo']?(console[_0xf2c3(0xa)](_0x122808['MLMYU']),await this['authTriggers'][_0xf2c3(0x59)]()):(this['baseUrl']=_0x5a00cd,this[_0xf2c3(0x1)]=_0x31ae48);else{if(_0x122808[_0xf2c3(0x5a)](_0x122808[_0xf2c3(0x5b)],_0x122808[_0xf2c3(0x5b)]))console['warn'](_0x122808['QdwPD']);else{_0x567378[_0xf2c3(0x26)](_0x1ccc3c);if(_0x122808['NSHvY'](_0x46726d,_0x5bf31a)&&_0x122808[_0xf2c3(0x4d)](_0x34967f[_0xf2c3(0x28)],_0x122808[_0xf2c3(0x5c)]))return _0x1d24fd[_0xf2c3(0xa)](_0xf2c3(0x29)+_0x29ff25+_0xf2c3(0x2a)),{'success':![],'error':_0x122808[_0xf2c3(0x5d)],'status':0x0};return _0xcae6d0[_0xf2c3(0x2d)](_0xf2c3(0x2e)+_0x28cd5d+'\x20failed:',_0x4291d5),{'success':![],'error':_0x122808['NSHvY'](_0x113b1f,_0x126648)?_0x3549c0['message']:_0x122808['KqEeH'],'status':0x0};}}break;case TokenType['AUTH']:if(this[_0xf2c3(0x1)][_0xf2c3(0x5e)]){if(_0x122808[_0xf2c3(0x4f)](_0x122808['euEmz'],_0x122808[_0xf2c3(0x5f)]))console[_0xf2c3(0xa)](_0xf2c3(0x60)),await this[_0xf2c3(0x1)]['triggerAuthTokenRefresh']();else return _0x44d67d[_0xf2c3(0xa)](_0xf2c3(0x29)+_0xff4e19+_0xf2c3(0x2a)),{'success':![],'error':_0x122808[_0xf2c3(0x5d)],'status':0x0};}else console[_0xf2c3(0x56)](_0x122808['dobEi']);break;}}catch(_0x47aa5f){console[_0xf2c3(0x2d)]('❌\x20[API\x20Client]\x20Failed\x20to\x20trigger\x20re-auth\x20for\x20'+_0x4eabf4+':',_0x47aa5f);}}[_0xf2c3(0x3d)](_0x52c7c8,_0xfbc0d1){const _0x2ce76a={'RjfeO':_0xf2c3(0x4a),'wWdAc':function(_0x5ad9e5,_0x51d79a){return _0x5ad9e5===_0x51d79a;},'PsrQb':function(_0x49a159,_0x3babbe){return _0x49a159!==_0x3babbe;},'ezRpv':function(_0x5e61d5,_0xd702ab){return _0x5e61d5>_0xd702ab;}};let _0x462d9d=0x0;for(const [_0x39e70b,_0x3f2957]of activeRequests[_0xf2c3(0x61)]()){_0x2ce76a[_0xf2c3(0x62)](_0xf2c3(0x63),_0xf2c3(0x63))?_0x2ce76a[_0xf2c3(0x64)](_0x39e70b,_0xfbc0d1)&&(_0x3f2957[_0xf2c3(0x50)](),activeRequests[_0xf2c3(0x26)](_0x39e70b),_0x462d9d++):_0x3fa5a7[_0xf2c3(0x56)](_0x2ce76a[_0xf2c3(0x65)]);}_0x2ce76a[_0xf2c3(0x66)](_0x462d9d,0x0)&&console[_0xf2c3(0xa)](_0xf2c3(0x67)+_0x462d9d+_0xf2c3(0x68)+_0x52c7c8+'\x20token\x20failure');}async['replaceTokenForType'](_0x265cb3,_0x572024){const _0x57e7cc={'uMVuD':function(_0x2ca2be,_0x5a931e,_0x3a6885){return _0x2ca2be(_0x5a931e,_0x3a6885);}};console[_0xf2c3(0xa)](_0xf2c3(0x69)+_0x265cb3+_0xf2c3(0x12)),this[_0xf2c3(0x3d)](_0x265cb3);const _0xb6db57=await _0x57e7cc[_0xf2c3(0x6a)](replaceJWTAfterVerification,_0x265cb3,_0x572024);return _0xb6db57&&console[_0xf2c3(0xa)](_0xf2c3(0x6b)+_0x265cb3+_0xf2c3(0x6c)),_0xb6db57;}async[_0xf2c3(0x6d)](){const _0x1be1f4={'PZfOG':_0xf2c3(0x46),'uqSpu':_0xf2c3(0x6e),'MMhTP':function(_0x4713c4){return _0x4713c4();},'kBNfR':function(_0x4bd252,_0x59ff5a){return _0x4bd252!==_0x59ff5a;},'cSIGo':_0xf2c3(0x6f)};console[_0xf2c3(0xa)](_0x1be1f4[_0xf2c3(0x70)]);const _0x26613f=await _0x1be1f4[_0xf2c3(0x71)](getAllTokens);for(const [_0x450d7c,_0x104696]of Object[_0xf2c3(0x61)](_0x26613f)){_0x104696?_0x1be1f4[_0xf2c3(0x72)](_0x1be1f4[_0xf2c3(0x73)],_0xf2c3(0x74))?console[_0xf2c3(0xa)](_0xf2c3(0xb)+_0x450d7c+':\x20'+_0x104696[_0xf2c3(0xc)](0x0,0x14)+'...\x20(length:\x20'+_0x104696[_0xf2c3(0xe)]+')'):_0xeb7a53[_0xf2c3(0x56)](_0x1be1f4[_0xf2c3(0x75)]):console[_0xf2c3(0xa)]('📭\x20'+_0x450d7c+_0xf2c3(0x76));}return _0x26613f;}[_0xf2c3(0x77)](_0x4b8f0c){const _0x438e18={'uajhp':_0xf2c3(0x78)};this[_0xf2c3(0x1)]={...this[_0xf2c3(0x1)],..._0x4b8f0c},console[_0xf2c3(0xa)](_0x438e18[_0xf2c3(0x79)]);}async['get'](_0x4d86c3,_0x1bbf8f={}){return this['request'](_0x4d86c3,{..._0x1bbf8f,'method':'GET'});}async[_0xf2c3(0x7a)](_0x2bdb5e,_0x35210c,_0x17566e={}){return this[_0xf2c3(0x2)](_0x2bdb5e,{..._0x17566e,'method':'POST','body':_0x35210c});}async[_0xf2c3(0x7b)](_0x2a458c,_0x20cfc0,_0xe43aac={}){return this['request'](_0x2a458c,{..._0xe43aac,'method':'PUT','body':_0x20cfc0});}async['delete'](_0x1eb5aa,_0x51b748={}){return this['request'](_0x1eb5aa,{..._0x51b748,'method':'DELETE'});}}export const apiClient=new ApiClient();export{ApiClient};export const authenticatedRequest=apiClient[_0xf2c3(0x2)][_0xf2c3(0x7c)](apiClient);export const apiGet=apiClient[_0xf2c3(0x7d)][_0xf2c3(0x7c)](apiClient);function _0x8086(){const _0x42dc0f=['BASE_URL','authTriggers','request','UdwCl','IXuHw','Request\x20cancelled','set','SvTkd','Ssqif','wrgfL','log','🔐\x20','substring','...\x20(length:\x20','length','🔗\x20[API\x20Client]\x20Starting\x20request\x20','PrdaK','🎯\x20[API\x20Client]\x20Route\x20','\x20token','getRequestHeaders','gSQli','requiresAuth','method','qBtMD','headers','body','stringify','🔐\x20[API\x20Client]\x20Request\x20','RNVDm','baseUrl','📡\x20[API\x20Client]\x20Response\x20','status','Nbccd','handle401Error','json','DCFQr','zyCxQ','Request\x20failed\x20with\x20status\x20','delete','hOwTw','name','🚫\x20[API\x20Client]\x20Request\x20','\x20was\x20cancelled','WilQt','message','error','❌\x20[API\x20Client]\x20Request\x20','\x20failed:','MIeco','enCzD','dGRlQ','UjxSK','ayMoB','\x20token\x20available\x20for\x20route\x20','.\x20Please\x20authenticate\x20first.','⚠️\x20[API\x20Client]\x20No\x20auth\x20token\x20refresh\x20trigger\x20configured','\x20received\x20401\x20for\x20','\x20token\x20on\x20route:\x20','🔄\x20[API\x20Client]\x20Clearing\x20','\x20token\x20due\x20to\x20401\x20error','lHDsL','cancelRequestsForTokenType','triggerReAuthForTokenType','\x20token\x20cleared,\x20user\x20needs\x20to\x20re-authenticate','\x20authentication\x20expired\x20for\x20','.\x20Please\x20re-authenticate.','Unknown\x20error','wARib','📧\x20[API\x20Client]\x20Triggering\x20Enoch\x20email\x20re-verification','elaII','⚠️\x20[API\x20Client]\x20No\x20Enoch\x20re-auth\x20trigger\x20configured','kJLdE','🔑\x20[API\x20Client]\x20Triggering\x20Onairos\x20re-authentication','FLAIT','⚠️\x20[API\x20Client]\x20No\x20Onairos\x20re-auth\x20trigger\x20configured','tAwVI','🔄\x20[API\x20Client]\x20Triggering\x20re-auth\x20for\x20','sTHXO','XVGol','jtxmV','abort','ENOCH','zrZSo','triggerEnochReAuth','WayHV','Jgtzk','warn','ziPhe','ONAIROS','triggerOnairosReAuth','qQsfF','oAQDP','qroer','ZeWxw','triggerAuthTokenRefresh','DUhcw','🔄\x20[API\x20Client]\x20Triggering\x20auth\x20token\x20refresh','entries','wWdAc','TXooD','PsrQb','RjfeO','ezRpv','🚫\x20[API\x20Client]\x20Cancelled\x20','\x20requests\x20due\x20to\x20','🔄\x20[API\x20Client]\x20Replacing\x20','uMVuD','✅\x20[API\x20Client]\x20','\x20token\x20replaced\x20and\x20related\x20requests\x20cancelled','debugTokens','🔍\x20[API\x20Client]\x20Debug:\x20Current\x20token\x20status','WqDyw','uqSpu','MMhTP','kBNfR','cSIGo','CSHvs','PZfOG',':\x20null','setAuthTriggers','🔧\x20[API\x20Client]\x20Authentication\x20triggers\x20updated','uajhp','post','put','bind','get'];_0x8086=function(){return _0x42dc0f;};return _0x8086();}export const apiPost=apiClient[_0xf2c3(0x7a)][_0xf2c3(0x7c)](apiClient);export const apiPut=apiClient[_0xf2c3(0x7b)]['bind'](apiClient);export const apiDelete=apiClient[_0xf2c3(0x26)][_0xf2c3(0x7c)](apiClient);export default apiClient;
|
|
@@ -12,23 +12,23 @@ export let ApiKeyType = /*#__PURE__*/function (ApiKeyType) {
|
|
|
12
12
|
// JWT token storage key
|
|
13
13
|
const JWT_TOKEN_KEY = 'onairos_jwt_token';
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Two-Tier Authentication Service for Onairos React Native SDK
|
|
17
|
-
*
|
|
18
|
-
* This service implements the two-tier authentication system:
|
|
19
|
-
* 1. Developer API Keys: For app-level operations (email verification, app registration)
|
|
20
|
-
* 2. JWT User Tokens: For user-level operations (PIN storage, user profile)
|
|
21
|
-
*
|
|
22
|
-
* How it works:
|
|
23
|
-
* 1. Initialize with developer API key
|
|
24
|
-
* 2. Use API key for email verification requests
|
|
25
|
-
* 3. Store JWT token from email verification response
|
|
26
|
-
* 4. Use JWT token for user-authenticated requests
|
|
27
|
-
* 5. Handle token expiration gracefully
|
|
28
|
-
*
|
|
29
|
-
* Backend Integration:
|
|
30
|
-
* - Developer routes: Authorization: Bearer ${API_KEY}
|
|
31
|
-
* - User routes: Authorization: Bearer ${JWT_TOKEN}
|
|
15
|
+
/**
|
|
16
|
+
* Two-Tier Authentication Service for Onairos React Native SDK
|
|
17
|
+
*
|
|
18
|
+
* This service implements the two-tier authentication system:
|
|
19
|
+
* 1. Developer API Keys: For app-level operations (email verification, app registration)
|
|
20
|
+
* 2. JWT User Tokens: For user-level operations (PIN storage, user profile)
|
|
21
|
+
*
|
|
22
|
+
* How it works:
|
|
23
|
+
* 1. Initialize with developer API key
|
|
24
|
+
* 2. Use API key for email verification requests
|
|
25
|
+
* 3. Store JWT token from email verification response
|
|
26
|
+
* 4. Use JWT token for user-authenticated requests
|
|
27
|
+
* 5. Handle token expiration gracefully
|
|
28
|
+
*
|
|
29
|
+
* Backend Integration:
|
|
30
|
+
* - Developer routes: Authorization: Bearer ${API_KEY}
|
|
31
|
+
* - User routes: Authorization: Bearer ${JWT_TOKEN}
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
// Global configuration state
|
|
@@ -40,9 +40,9 @@ let userToken = null;
|
|
|
40
40
|
// Cache duration (5 minutes)
|
|
41
41
|
const CACHE_DURATION = 5 * 60 * 1000;
|
|
42
42
|
|
|
43
|
-
/**
|
|
44
|
-
* Check network connectivity
|
|
45
|
-
* @returns Promise<boolean> - true if connected, false otherwise
|
|
43
|
+
/**
|
|
44
|
+
* Check network connectivity
|
|
45
|
+
* @returns Promise<boolean> - true if connected, false otherwise
|
|
46
46
|
*/
|
|
47
47
|
const checkNetworkConnectivity = async () => {
|
|
48
48
|
try {
|
|
@@ -63,9 +63,9 @@ const API_ENDPOINTS = {
|
|
|
63
63
|
development: `${API_CONFIG.BASE_URL}` // Fallback to production since dev-API server doesn't exist
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
/**
|
|
67
|
-
* Initialize the SDK with developer API key
|
|
68
|
-
* @param config API configuration including developer API key
|
|
66
|
+
/**
|
|
67
|
+
* Initialize the SDK with developer API key
|
|
68
|
+
* @param config API configuration including developer API key
|
|
69
69
|
*/
|
|
70
70
|
export const initializeApiKey = async config => {
|
|
71
71
|
try {
|
|
@@ -150,10 +150,10 @@ export const initializeApiKey = async config => {
|
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
/**
|
|
154
|
-
* Determine API key type
|
|
155
|
-
* @param apiKey The API key to check
|
|
156
|
-
* @returns The type of API key (only DEVELOPER or INVALID - admin keys not supported in client SDK)
|
|
153
|
+
/**
|
|
154
|
+
* Determine API key type
|
|
155
|
+
* @param apiKey The API key to check
|
|
156
|
+
* @returns The type of API key (only DEVELOPER or INVALID - admin keys not supported in client SDK)
|
|
157
157
|
*/
|
|
158
158
|
export const getApiKeyType = apiKey => {
|
|
159
159
|
// Developer keys must be at least 32 characters and start with specific prefix
|
|
@@ -163,11 +163,11 @@ export const getApiKeyType = apiKey => {
|
|
|
163
163
|
return ApiKeyType.INVALID;
|
|
164
164
|
};
|
|
165
165
|
|
|
166
|
-
/**
|
|
167
|
-
* Validate an API key with the Onairos backend
|
|
168
|
-
* All developer keys must be validated against the backend - no local bypass
|
|
169
|
-
* @param apiKey The API key to validate
|
|
170
|
-
* @returns Validation result with permissions and rate limits
|
|
166
|
+
/**
|
|
167
|
+
* Validate an API key with the Onairos backend
|
|
168
|
+
* All developer keys must be validated against the backend - no local bypass
|
|
169
|
+
* @param apiKey The API key to validate
|
|
170
|
+
* @returns Validation result with permissions and rate limits
|
|
171
171
|
*/
|
|
172
172
|
export const validateApiKey = async apiKey => {
|
|
173
173
|
try {
|
|
@@ -418,34 +418,34 @@ export const validateApiKey = async apiKey => {
|
|
|
418
418
|
}
|
|
419
419
|
};
|
|
420
420
|
|
|
421
|
-
/**
|
|
422
|
-
* Get the current API configuration
|
|
423
|
-
* @returns Current API configuration or null if not initialized
|
|
421
|
+
/**
|
|
422
|
+
* Get the current API configuration
|
|
423
|
+
* @returns Current API configuration or null if not initialized
|
|
424
424
|
*/
|
|
425
425
|
export const getApiConfig = () => {
|
|
426
426
|
return globalConfig;
|
|
427
427
|
};
|
|
428
428
|
|
|
429
|
-
/**
|
|
430
|
-
* Get the current API key
|
|
431
|
-
* @returns Current API key or null if not initialized
|
|
429
|
+
/**
|
|
430
|
+
* Get the current API key
|
|
431
|
+
* @returns Current API key or null if not initialized
|
|
432
432
|
*/
|
|
433
433
|
export const getApiKey = () => {
|
|
434
434
|
var _globalConfig9;
|
|
435
435
|
return ((_globalConfig9 = globalConfig) === null || _globalConfig9 === void 0 ? void 0 : _globalConfig9.apiKey) || null;
|
|
436
436
|
};
|
|
437
437
|
|
|
438
|
-
/**
|
|
439
|
-
* Check if the SDK is properly initialized
|
|
440
|
-
* @returns True if initialized with valid API key
|
|
438
|
+
/**
|
|
439
|
+
* Check if the SDK is properly initialized
|
|
440
|
+
* @returns True if initialized with valid API key
|
|
441
441
|
*/
|
|
442
442
|
export const isApiKeyInitialized = () => {
|
|
443
443
|
return isInitialized && globalConfig !== null;
|
|
444
444
|
};
|
|
445
445
|
|
|
446
|
-
/**
|
|
447
|
-
* Store JWT token securely after email verification
|
|
448
|
-
* @param token JWT token from email verification response
|
|
446
|
+
/**
|
|
447
|
+
* Store JWT token securely after email verification
|
|
448
|
+
* @param token JWT token from email verification response
|
|
449
449
|
*/
|
|
450
450
|
export const storeJWT = async token => {
|
|
451
451
|
try {
|
|
@@ -461,9 +461,9 @@ export const storeJWT = async token => {
|
|
|
461
461
|
}
|
|
462
462
|
};
|
|
463
463
|
|
|
464
|
-
/**
|
|
465
|
-
* Load JWT token from storage
|
|
466
|
-
* @returns JWT token or null if not found
|
|
464
|
+
/**
|
|
465
|
+
* Load JWT token from storage
|
|
466
|
+
* @returns JWT token or null if not found
|
|
467
467
|
*/
|
|
468
468
|
export const loadJWT = async () => {
|
|
469
469
|
try {
|
|
@@ -476,16 +476,16 @@ export const loadJWT = async () => {
|
|
|
476
476
|
}
|
|
477
477
|
};
|
|
478
478
|
|
|
479
|
-
/**
|
|
480
|
-
* Get current JWT token
|
|
481
|
-
* @returns JWT token or null if not available
|
|
479
|
+
/**
|
|
480
|
+
* Get current JWT token
|
|
481
|
+
* @returns JWT token or null if not available
|
|
482
482
|
*/
|
|
483
483
|
export const getJWT = () => {
|
|
484
484
|
return userToken;
|
|
485
485
|
};
|
|
486
486
|
|
|
487
|
-
/**
|
|
488
|
-
* Clear JWT token (on logout or token expiration)
|
|
487
|
+
/**
|
|
488
|
+
* Clear JWT token (on logout or token expiration)
|
|
489
489
|
*/
|
|
490
490
|
export const clearJWT = async () => {
|
|
491
491
|
try {
|
|
@@ -500,10 +500,10 @@ export const clearJWT = async () => {
|
|
|
500
500
|
}
|
|
501
501
|
};
|
|
502
502
|
|
|
503
|
-
/**
|
|
504
|
-
* React Native compatible base64 decoder
|
|
505
|
-
* @param str Base64 encoded string
|
|
506
|
-
* @returns Decoded string
|
|
503
|
+
/**
|
|
504
|
+
* React Native compatible base64 decoder
|
|
505
|
+
* @param str Base64 encoded string
|
|
506
|
+
* @returns Decoded string
|
|
507
507
|
*/
|
|
508
508
|
const base64Decode = str => {
|
|
509
509
|
// Simple base64 decoding for React Native
|
|
@@ -524,10 +524,10 @@ const base64Decode = str => {
|
|
|
524
524
|
return result;
|
|
525
525
|
};
|
|
526
526
|
|
|
527
|
-
/**
|
|
528
|
-
* Decode JWT token payload (React Native compatible)
|
|
529
|
-
* @param token JWT token string
|
|
530
|
-
* @returns Decoded payload or null if invalid
|
|
527
|
+
/**
|
|
528
|
+
* Decode JWT token payload (React Native compatible)
|
|
529
|
+
* @param token JWT token string
|
|
530
|
+
* @returns Decoded payload or null if invalid
|
|
531
531
|
*/
|
|
532
532
|
export const decodeJWTPayload = token => {
|
|
533
533
|
try {
|
|
@@ -554,10 +554,10 @@ export const decodeJWTPayload = token => {
|
|
|
554
554
|
}
|
|
555
555
|
};
|
|
556
556
|
|
|
557
|
-
/**
|
|
558
|
-
* Extract username from JWT token
|
|
559
|
-
* @param token JWT token (optional, uses stored token if not provided)
|
|
560
|
-
* @returns Username or null if not found
|
|
557
|
+
/**
|
|
558
|
+
* Extract username from JWT token
|
|
559
|
+
* @param token JWT token (optional, uses stored token if not provided)
|
|
560
|
+
* @returns Username or null if not found
|
|
561
561
|
*/
|
|
562
562
|
export const extractUsernameFromJWT = token => {
|
|
563
563
|
try {
|
|
@@ -584,10 +584,10 @@ export const extractUsernameFromJWT = token => {
|
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
586
|
|
|
587
|
-
/**
|
|
588
|
-
* Extract user data from JWT token
|
|
589
|
-
* @param token JWT token (optional, uses stored token if not provided)
|
|
590
|
-
* @returns User data object or null if not found
|
|
587
|
+
/**
|
|
588
|
+
* Extract user data from JWT token
|
|
589
|
+
* @param token JWT token (optional, uses stored token if not provided)
|
|
590
|
+
* @returns User data object or null if not found
|
|
591
591
|
*/
|
|
592
592
|
export const extractUserDataFromJWT = token => {
|
|
593
593
|
try {
|
|
@@ -620,17 +620,17 @@ export const extractUserDataFromJWT = token => {
|
|
|
620
620
|
}
|
|
621
621
|
};
|
|
622
622
|
|
|
623
|
-
/**
|
|
624
|
-
* Check if user is authenticated with JWT token
|
|
625
|
-
* @returns True if user has valid JWT token
|
|
623
|
+
/**
|
|
624
|
+
* Check if user is authenticated with JWT token
|
|
625
|
+
* @returns True if user has valid JWT token
|
|
626
626
|
*/
|
|
627
627
|
export const isUserAuthenticated = () => {
|
|
628
628
|
return !!userToken;
|
|
629
629
|
};
|
|
630
630
|
|
|
631
|
-
/**
|
|
632
|
-
* Get authenticated headers for API requests
|
|
633
|
-
* @returns Headers object with Authorization and other required headers
|
|
631
|
+
/**
|
|
632
|
+
* Get authenticated headers for API requests
|
|
633
|
+
* @returns Headers object with Authorization and other required headers
|
|
634
634
|
*/
|
|
635
635
|
export const getAuthHeaders = () => {
|
|
636
636
|
var _globalConfig12;
|
|
@@ -649,9 +649,9 @@ export const getAuthHeaders = () => {
|
|
|
649
649
|
};
|
|
650
650
|
};
|
|
651
651
|
|
|
652
|
-
/**
|
|
653
|
-
* Get authentication headers for developer API requests
|
|
654
|
-
* @returns Headers with developer API key
|
|
652
|
+
/**
|
|
653
|
+
* Get authentication headers for developer API requests
|
|
654
|
+
* @returns Headers with developer API key
|
|
655
655
|
*/
|
|
656
656
|
export const getDeveloperAuthHeaders = () => {
|
|
657
657
|
var _globalConfig13;
|
|
@@ -670,9 +670,9 @@ export const getDeveloperAuthHeaders = () => {
|
|
|
670
670
|
};
|
|
671
671
|
};
|
|
672
672
|
|
|
673
|
-
/**
|
|
674
|
-
* Get authentication headers for user JWT requests
|
|
675
|
-
* @returns Headers with user JWT token
|
|
673
|
+
/**
|
|
674
|
+
* Get authentication headers for user JWT requests
|
|
675
|
+
* @returns Headers with user JWT token
|
|
676
676
|
*/
|
|
677
677
|
export const getUserAuthHeaders = () => {
|
|
678
678
|
var _globalConfig14;
|
|
@@ -688,11 +688,11 @@ export const getUserAuthHeaders = () => {
|
|
|
688
688
|
};
|
|
689
689
|
};
|
|
690
690
|
|
|
691
|
-
/**
|
|
692
|
-
* Make an authenticated API request
|
|
693
|
-
* @param endpoint The API endpoint (relative to base URL)
|
|
694
|
-
* @param options Fetch options
|
|
695
|
-
* @returns Response promise
|
|
691
|
+
/**
|
|
692
|
+
* Make an authenticated API request
|
|
693
|
+
* @param endpoint The API endpoint (relative to base URL)
|
|
694
|
+
* @param options Fetch options
|
|
695
|
+
* @returns Response promise
|
|
696
696
|
*/
|
|
697
697
|
export const makeAuthenticatedRequest = async (endpoint, options = {}) => {
|
|
698
698
|
if (!isApiKeyInitialized()) {
|
|
@@ -749,11 +749,11 @@ export const makeAuthenticatedRequest = async (endpoint, options = {}) => {
|
|
|
749
749
|
}
|
|
750
750
|
};
|
|
751
751
|
|
|
752
|
-
/**
|
|
753
|
-
* Make authenticated request with developer API key
|
|
754
|
-
* @param endpoint The API endpoint
|
|
755
|
-
* @param options Fetch options
|
|
756
|
-
* @returns Response promise
|
|
752
|
+
/**
|
|
753
|
+
* Make authenticated request with developer API key
|
|
754
|
+
* @param endpoint The API endpoint
|
|
755
|
+
* @param options Fetch options
|
|
756
|
+
* @returns Response promise
|
|
757
757
|
*/
|
|
758
758
|
export const makeDeveloperRequest = async (endpoint, options = {}) => {
|
|
759
759
|
if (!isApiKeyInitialized()) {
|
|
@@ -810,11 +810,11 @@ export const makeDeveloperRequest = async (endpoint, options = {}) => {
|
|
|
810
810
|
}
|
|
811
811
|
};
|
|
812
812
|
|
|
813
|
-
/**
|
|
814
|
-
* Make authenticated request with user JWT token
|
|
815
|
-
* @param endpoint The API endpoint
|
|
816
|
-
* @param options Fetch options
|
|
817
|
-
* @returns Response promise
|
|
813
|
+
/**
|
|
814
|
+
* Make authenticated request with user JWT token
|
|
815
|
+
* @param endpoint The API endpoint
|
|
816
|
+
* @param options Fetch options
|
|
817
|
+
* @returns Response promise
|
|
818
818
|
*/
|
|
819
819
|
export const makeUserRequest = async (endpoint, options = {}) => {
|
|
820
820
|
if (!isUserAuthenticated()) {
|
|
@@ -875,8 +875,8 @@ export const makeUserRequest = async (endpoint, options = {}) => {
|
|
|
875
875
|
}
|
|
876
876
|
};
|
|
877
877
|
|
|
878
|
-
/**
|
|
879
|
-
* Clear the API key validation cache
|
|
878
|
+
/**
|
|
879
|
+
* Clear the API key validation cache
|
|
880
880
|
*/
|
|
881
881
|
export const clearValidationCache = () => {
|
|
882
882
|
var _globalConfig15;
|
|
@@ -886,8 +886,8 @@ export const clearValidationCache = () => {
|
|
|
886
886
|
}
|
|
887
887
|
};
|
|
888
888
|
|
|
889
|
-
/**
|
|
890
|
-
* Reset the SDK initialization state
|
|
889
|
+
/**
|
|
890
|
+
* Reset the SDK initialization state
|
|
891
891
|
*/
|
|
892
892
|
export const resetApiKeyService = () => {
|
|
893
893
|
globalConfig = null;
|