@onairosofficial/onairos-capacitor 0.1.0 → 0.1.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/LICENSE +194 -10
- package/README.md +182 -25
- package/dist/onairos.capacitor.esm.js +1 -0
- package/dist/onairos.capacitor.esm.turbopack.js +1 -0
- package/onairos.d.ts +656 -0
- package/package.json +186 -38
- package/src/OnairosReconnectButton.jsx +272 -0
- package/src/RSA.jsx +57 -0
- package/src/assets/NewLogo.png +0 -0
- package/src/assets/OnairosNewLogo.png +0 -0
- package/src/assets/chatgpt-icon.png +0 -0
- package/src/assets/fire-horse.png +0 -0
- package/src/assets/fire-horse.transparent.png +0 -0
- package/src/assets/latest-firehorse.png +0 -0
- package/src/assets/perplexity.png +0 -0
- package/src/assets/persona.png +0 -0
- package/src/assets/persona1.png +0 -0
- package/src/assets/persona2.png +0 -0
- package/src/assets/persona3.png +0 -0
- package/src/assets/persona4.png +0 -0
- package/src/assets/persona5.png +0 -0
- package/src/capacitorConnectorCatalog.js +38 -0
- package/src/capacitorOAuthConfig.js +52 -0
- package/src/chatgptHostedImport/index.js +303 -0
- package/src/components/AuthButtons.jsx +48 -0
- package/src/components/ConnectChatGPTModal.jsx +666 -0
- package/src/components/ConnectClaudeModal.jsx +610 -0
- package/src/components/ConnectGeminiModal.jsx +639 -0
- package/src/components/ConnectGrokModal.jsx +701 -0
- package/src/components/ConnectPerplexityModal.jsx +726 -0
- package/src/components/DataExplainerScreen.jsx +349 -0
- package/src/components/DataRequest.js +885 -0
- package/src/components/DataRequest.jsx +1055 -0
- package/src/components/EmailAuth.js +1871 -0
- package/src/components/EmailAuth.jsx +2062 -0
- package/src/components/ExtensionInstallPrompt.jsx +142 -0
- package/src/components/GoogleButton.js +133 -0
- package/src/components/LLMConnectorManager.jsx +201 -0
- package/src/components/LoadingPage.jsx +19 -0
- package/src/components/LoadingScreen.jsx +81 -0
- package/src/components/LunarBirthdate.jsx +96 -0
- package/src/components/LunarLoadingPage.jsx +251 -0
- package/src/components/Notification.jsx +21 -0
- package/src/components/OnairosAppButton.jsx +85 -0
- package/src/components/OnairosSSO.jsx +645 -0
- package/src/components/OnairosTrigger.jsx +61 -0
- package/src/components/PerplexityLogo.jsx +43 -0
- package/src/components/PinSetup.js +200 -0
- package/src/components/PinSetup.jsx +228 -0
- package/src/components/SDK_PIN_INTEGRATION_REQUIRED_CHANGES.md +526 -0
- package/src/components/SdkErrorBoundary.jsx +36 -0
- package/src/components/SecuritySetup.js +81 -0
- package/src/components/SessionUserBar.jsx +83 -0
- package/src/components/SignUp.js +123 -0
- package/src/components/TestTelegramButton.js +53 -0
- package/src/components/TrainingComponent.jsx +200 -0
- package/src/components/TrainingScreen.jsx +897 -0
- package/src/components/UniversalOnboarding.js +306 -0
- package/src/components/UniversalOnboarding.jsx +4837 -0
- package/src/components/ValentineLoadingPage.jsx +502 -0
- package/src/components/ValentineModeSelector.jsx +162 -0
- package/src/components/WelcomeScreen.jsx +435 -0
- package/src/components/WrappedLoadingPage.jsx +205 -0
- package/src/components/connectors/ChatGPTConnector.js +348 -0
- package/src/components/connectors/ChatGPTConnector.jsx +348 -0
- package/src/components/connectors/ClaudeConnector.js +44 -0
- package/src/components/connectors/ClaudeConnector.jsx +44 -0
- package/src/components/connectors/GeminiConnector.js +170 -0
- package/src/components/connectors/GeminiConnector.jsx +170 -0
- package/src/components/connectors/GmailConnector.js +148 -0
- package/src/components/connectors/GmailConnector.jsx +148 -0
- package/src/components/connectors/GrokConnector.js +16 -0
- package/src/components/connectors/GrokConnector.jsx +16 -0
- package/src/components/connectors/HingeConnector.js +419 -0
- package/src/components/connectors/HingeConnector.jsx +419 -0
- package/src/components/connectors/InstagramDataConnector.js +726 -0
- package/src/components/connectors/InstagramDataConnector.jsx +726 -0
- package/src/components/connectors/LinkedInConnector.js +4 -0
- package/src/components/connectors/LinkedInConnector.jsx +296 -0
- package/src/components/connectors/PerplexityConnector.jsx +16 -0
- package/src/components/connectors/PinterestConnector.js +208 -0
- package/src/components/connectors/PinterestConnector.jsx +208 -0
- package/src/components/connectors/README.md +292 -0
- package/src/components/connectors/RedditConnector.js +229 -0
- package/src/components/connectors/RedditConnector.jsx +229 -0
- package/src/components/connectors/SephoraConnector.js +482 -0
- package/src/components/connectors/SephoraConnector.jsx +482 -0
- package/src/components/connectors/TikTokConnector.jsx +430 -0
- package/src/components/connectors/YoutubeConnector.js +361 -0
- package/src/components/connectors/YoutubeConnector.jsx +361 -0
- package/src/components/connectors/index.js +50 -0
- package/src/components/icons.jsx +46 -0
- package/src/components/icons.tsx +21 -0
- package/src/components/ui/PageLayout.jsx +1255 -0
- package/src/components/ui/PrimaryButton.jsx +162 -0
- package/src/components/ui/button.jsx +49 -0
- package/src/components/ui/card.jsx +61 -0
- package/src/components/ui/checkbox.jsx +33 -0
- package/src/components/ui/label.jsx +29 -0
- package/src/components/utils/UpdateConnections.js +45 -0
- package/src/components/utils/oauthHelper.js +97 -0
- package/src/config/api-config.js +138 -0
- package/src/deepLink.jsx +38 -0
- package/src/getPin.js +26 -0
- package/src/icons/Avatar.png +0 -0
- package/src/icons/Sentiment.png +0 -0
- package/src/icons/Trait.png +0 -0
- package/src/iframe/DataRequestPage.jsx +285 -0
- package/src/iframe/OnairosButtonIntegration.md +148 -0
- package/src/iframe/components/Box.jsx +56 -0
- package/src/iframe/components/IndividualConnection.jsx +88 -0
- package/src/iframe/dataRequestHandler.js +714 -0
- package/src/iframe/data_request_iframe.html +27 -0
- package/src/iframe/data_request_page.js +47 -0
- package/src/iframe/icons/Avatar.png +1 -0
- package/src/iframe/icons/Avatar2.png +1 -0
- package/src/iframe/icons/Sentiment.png +1 -0
- package/src/iframe/icons/Trait.png +1 -0
- package/src/iframe/icons/onairos_logo.png +0 -0
- package/src/iframe/utils/api.js +57 -0
- package/src/index.js +274 -0
- package/src/laravel/OnairosVue.vue +410 -0
- package/src/laravel/blade-helpers.js +320 -0
- package/src/laravel/vite-plugin.js +179 -0
- package/src/mobile/MobileDataRequestPage.jsx +233 -0
- package/src/mobile/components/MobileBox.jsx +71 -0
- package/src/mobile/components/MobileIndividualConnection.jsx +51 -0
- package/src/mobile/shims/browser-apis.js +78 -0
- package/src/mobile/shims/lucide-shim.js +85 -0
- package/src/newUI/EMAIL_VERIFICATION_API_SCHEMA.md +268 -0
- package/src/newUI/PlatformConnectorsStep.tsx +435 -0
- package/src/newUI/PrimaryButton.tsx +213 -0
- package/src/newUI/SignInStep.tsx +194 -0
- package/src/newUI/VerificationStep.tsx +133 -0
- package/src/newUI/WelcomeScreen.tsx +311 -0
- package/src/newUI/services/connectedAccountsService.js +129 -0
- package/src/onairos.capacitor.jsx +16 -0
- package/src/onairos.core.jsx +133 -0
- package/src/onairos.jsx +14 -0
- package/src/onairos.native.jsx +15 -0
- package/src/onairosButton.jsx +9000 -0
- package/src/overlay/CheckBox.jsx +114 -0
- package/src/overlay/IndividualConnection copy.js +86 -0
- package/src/overlay/IndividualConnection.js +191 -0
- package/src/overlay/IndividualConnectionNew.jsx +157 -0
- package/src/overlay/box.js +84 -0
- package/src/overlay/overlay.js +437 -0
- package/src/styles/onairos-scoped-preflight.css +97 -0
- package/src/styles/sdkCssRegistry.js +20 -0
- package/src/styles/styleLoaderInsertShadow.js +69 -0
- package/src/styles/tailwind.capacitor.css +395 -0
- package/src/styles/tailwind.css +395 -0
- package/src/theme/colors.js +40 -0
- package/src/utils/apiKeyValidation.js +341 -0
- package/src/utils/apiResponseLogger.js +316 -0
- package/src/utils/authHeaders.js +275 -0
- package/src/utils/biometrics.js +26 -0
- package/src/utils/bookmarkletUtils.js +28 -0
- package/src/utils/capacitorDetection.js +278 -0
- package/src/utils/capacitorLLMHelper.js +352 -0
- package/src/utils/capacitorPlugins.js +366 -0
- package/src/utils/crossDomainSSO.js +587 -0
- package/src/utils/deepLinking.js +27 -0
- package/src/utils/devLogger.js +46 -0
- package/src/utils/extensionDetection.js +418 -0
- package/src/utils/extractMemory.js +277 -0
- package/src/utils/framerBrandingOverrides.js +40 -0
- package/src/utils/googleWebClientId.js +55 -0
- package/src/utils/overlayHandler.js +224 -0
- package/src/utils/platformDisconnect.js +309 -0
- package/src/utils/pollTrainingStatus.js +200 -0
- package/src/utils/rawMemoriesAccess.js +211 -0
- package/src/utils/resolveBackendAppId.js +47 -0
- package/src/utils/responseFormatter.js +140 -0
- package/src/utils/sdkDebugStorage.js +113 -0
- package/src/utils/sdkInitialization.js +645 -0
- package/src/utils/sessionManager.js +1258 -0
- package/src/utils/startBackgroundTraining.js +100 -0
- package/src/utils/userDataFormatter.js +222 -0
- package/index.d.ts +0 -1
- package/index.js +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Onairos Terminal</title>
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
12
|
+
background-color: transparent;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#root {
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 90vh;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
21
|
+
</head>
|
|
22
|
+
<body>
|
|
23
|
+
<div id="root"></div>
|
|
24
|
+
<!-- The DataRequestPage component will be rendered here -->
|
|
25
|
+
<script src="data_request_page.js"></script>
|
|
26
|
+
</body>
|
|
27
|
+
</html>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
|
+
import DataRequestPage from './DataRequestPage.jsx';
|
|
4
|
+
|
|
5
|
+
// Global variables to store data from parent window
|
|
6
|
+
let proofMode = false;
|
|
7
|
+
let domain = '';
|
|
8
|
+
let userSub = null;
|
|
9
|
+
let encryptedUserPin = null;
|
|
10
|
+
|
|
11
|
+
// Handle messages from the parent window
|
|
12
|
+
window.addEventListener('message', (event) => {
|
|
13
|
+
// Verify the sender origin if needed
|
|
14
|
+
// if (event.origin !== 'expected-origin') return;
|
|
15
|
+
|
|
16
|
+
if (event.data && event.data.source === 'onairosButton') {
|
|
17
|
+
proofMode = event.data.proofMode || false;
|
|
18
|
+
domain = event.data.domain || '';
|
|
19
|
+
userSub = event.data.userSub || null;
|
|
20
|
+
encryptedUserPin = event.data.encryptedUserPin || null;
|
|
21
|
+
|
|
22
|
+
// Re-render with the new data
|
|
23
|
+
renderApp();
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// Notify the parent window that the iframe is ready
|
|
28
|
+
window.parent.postMessage({
|
|
29
|
+
source: 'onairosIframe',
|
|
30
|
+
action: 'iframeReady'
|
|
31
|
+
}, '*');
|
|
32
|
+
|
|
33
|
+
// Function to render the React app
|
|
34
|
+
function renderApp() {
|
|
35
|
+
const root = ReactDOM.createRoot(document.getElementById('root'));
|
|
36
|
+
root.render(
|
|
37
|
+
<DataRequestPage
|
|
38
|
+
proofMode={proofMode}
|
|
39
|
+
domain={domain}
|
|
40
|
+
userSub={userSub}
|
|
41
|
+
encryptedUserPin={encryptedUserPin}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Initial render
|
|
47
|
+
renderApp();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
Binary file
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API utility functions for the Onairos Data Request system
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { getApiBaseUrl } from '../../config/api-config.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Get API access for data requests
|
|
9
|
+
* @param {Object} options - The request options
|
|
10
|
+
* @param {boolean} options.proofMode - Whether proof mode is enabled
|
|
11
|
+
* @param {string} options.Web3Type - The web3 authentication type
|
|
12
|
+
* @param {Array} options.Confirmations - Array of confirmations
|
|
13
|
+
* @param {string} options.EncryptedUserPin - The encrypted user PIN
|
|
14
|
+
* @param {string} options.Domain - The requesting domain
|
|
15
|
+
* @param {string} options.UserSub - The user subject identifier
|
|
16
|
+
*/
|
|
17
|
+
export async function getAPIAccess({ proofMode, Web3Type, Confirmations, EncryptedUserPin, Domain, UserSub }) {
|
|
18
|
+
try {
|
|
19
|
+
const response = await fetch(`${getApiBaseUrl()}/getAPIAccess`, {
|
|
20
|
+
method: 'POST',
|
|
21
|
+
headers: {
|
|
22
|
+
'Content-Type': 'application/json',
|
|
23
|
+
},
|
|
24
|
+
body: JSON.stringify({
|
|
25
|
+
proofMode,
|
|
26
|
+
web3Type: Web3Type,
|
|
27
|
+
confirmations: Confirmations,
|
|
28
|
+
encryptedUserPin: EncryptedUserPin,
|
|
29
|
+
domain: Domain,
|
|
30
|
+
userSub: UserSub
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
if (!response.ok) {
|
|
35
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const data = await response.json();
|
|
39
|
+
return data;
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error('Error getting API access:', error);
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Reject a data request
|
|
48
|
+
* This is a placeholder for the actual implementation
|
|
49
|
+
*/
|
|
50
|
+
export async function rejectDataRequest() {
|
|
51
|
+
// Simulate network request
|
|
52
|
+
return new Promise(resolve => {
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
resolve({ success: true });
|
|
55
|
+
}, 500);
|
|
56
|
+
});
|
|
57
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
// src/index.js
|
|
2
|
+
|
|
3
|
+
// Import Tailwind CSS first
|
|
4
|
+
import './styles/tailwind.css';
|
|
5
|
+
|
|
6
|
+
import { Onairos, OnairosButton } from "./onairos.jsx";
|
|
7
|
+
import { OnairosReconnectButton } from "./OnairosReconnectButton.jsx";
|
|
8
|
+
import UniversalOnboarding from "./components/UniversalOnboarding.jsx";
|
|
9
|
+
import { OnairosTrigger } from "./components/OnairosTrigger.jsx";
|
|
10
|
+
|
|
11
|
+
// Export the original Onairos component and OnairosButton
|
|
12
|
+
export { Onairos, OnairosButton };
|
|
13
|
+
|
|
14
|
+
// v7.1.0 — Render-props sugar for hosts that want to supply their own button.
|
|
15
|
+
// <OnairosTrigger config={{ ...onairosProps }}>
|
|
16
|
+
// {({ open, isLoading, isReady }) => <YourButton onClick={open} />}
|
|
17
|
+
// </OnairosTrigger>
|
|
18
|
+
export { OnairosTrigger };
|
|
19
|
+
|
|
20
|
+
// Export UniversalOnboarding for custom flows
|
|
21
|
+
export { UniversalOnboarding };
|
|
22
|
+
|
|
23
|
+
// Export the Reconnect Button for managing data sources
|
|
24
|
+
export { OnairosReconnectButton };
|
|
25
|
+
|
|
26
|
+
// ============================================
|
|
27
|
+
// SDK Initialization (matches @onairos/react-native)
|
|
28
|
+
// ============================================
|
|
29
|
+
export {
|
|
30
|
+
initializeApiKey,
|
|
31
|
+
isSDKInitialized,
|
|
32
|
+
getSDKState,
|
|
33
|
+
getApiKey,
|
|
34
|
+
setToken as setSdkToken,
|
|
35
|
+
getToken as getSdkToken,
|
|
36
|
+
setOnTokenExpired,
|
|
37
|
+
makeAuthenticatedRequest,
|
|
38
|
+
getSDKConfig,
|
|
39
|
+
resetSDK
|
|
40
|
+
} from './utils/sdkInitialization.js';
|
|
41
|
+
|
|
42
|
+
// ============================================
|
|
43
|
+
// Authentication utilities (matches @onairos/react-native)
|
|
44
|
+
// ============================================
|
|
45
|
+
export {
|
|
46
|
+
isUserAuthenticated as isAuthenticated,
|
|
47
|
+
clearUserToken,
|
|
48
|
+
clearToken,
|
|
49
|
+
getUserToken,
|
|
50
|
+
setUserToken,
|
|
51
|
+
setToken,
|
|
52
|
+
getRequiredUserAuthHeaders,
|
|
53
|
+
isJwtRequiredEndpoint,
|
|
54
|
+
handleUnauthorizedResponse
|
|
55
|
+
} from './utils/authHeaders.js';
|
|
56
|
+
|
|
57
|
+
// Clear all auth tokens (alias for destroySession)
|
|
58
|
+
export { destroySession as clearAllAuthTokens } from './utils/sessionManager.js';
|
|
59
|
+
|
|
60
|
+
// Training status polling (React Native parity; see docs/CROSS_SDK_PARITY.md)
|
|
61
|
+
export { pollTrainingStatus, normalizeTrainingFromResolution } from './utils/pollTrainingStatus.js';
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
normalizeAuthorizedData,
|
|
65
|
+
isRawMemoriesAuthorized,
|
|
66
|
+
parseRawMemoriesPolicy,
|
|
67
|
+
resolveRawMemoriesOfferedForUi,
|
|
68
|
+
fetchRawMemoriesPolicyForUiOptional,
|
|
69
|
+
shouldSendIncludeLlmData,
|
|
70
|
+
shouldFetchLlmHistory,
|
|
71
|
+
stripRawMemoriesFromApproved,
|
|
72
|
+
readTraitIntentFromHandoff,
|
|
73
|
+
filterPlatformsForRawExport,
|
|
74
|
+
developerRequestedRawMemoriesExport,
|
|
75
|
+
RAW_MEMORY_CONNECTOR_KEYS,
|
|
76
|
+
} from './utils/rawMemoriesAccess.js';
|
|
77
|
+
|
|
78
|
+
export { resolveBackendAppId, decodeJwtPayloadSafe } from './utils/resolveBackendAppId.js';
|
|
79
|
+
|
|
80
|
+
// ============================================
|
|
81
|
+
// ChatGPT Hosted Temporary Browser Import
|
|
82
|
+
// ============================================
|
|
83
|
+
// One-time, user-directed historical import via a disposable server-side
|
|
84
|
+
// browser. Additive path alongside the existing ChatGPT connector.
|
|
85
|
+
export {
|
|
86
|
+
connectHostedImport,
|
|
87
|
+
connectChatGPTHostedImport,
|
|
88
|
+
connectClaudeHostedImport,
|
|
89
|
+
connectGeminiHostedImport,
|
|
90
|
+
connectGrokHostedImport,
|
|
91
|
+
connectInstagramHostedImport,
|
|
92
|
+
} from './chatgptHostedImport/index.js';
|
|
93
|
+
|
|
94
|
+
// ============================================
|
|
95
|
+
// Google OAuth Configuration
|
|
96
|
+
// ============================================
|
|
97
|
+
/**
|
|
98
|
+
* Google OAuth Client IDs for different platforms.
|
|
99
|
+
*
|
|
100
|
+
* IMPORTANT FOR CAPACITOR APPS:
|
|
101
|
+
* - Web client ID: Used by @react-oauth/google for web browsers
|
|
102
|
+
* - iOS client ID: Used by native Google Sign-In plugin for iOS apps
|
|
103
|
+
* - Android client ID: Used by native Google Sign-In plugin for Android apps
|
|
104
|
+
*
|
|
105
|
+
* Capacitor apps MUST provide their own Google OAuth credentials because:
|
|
106
|
+
* 1. Google does not allow `capacitor://` scheme in redirect URIs
|
|
107
|
+
* 2. Google blocks OAuth in embedded WebViews (disallowed_useragent)
|
|
108
|
+
* 3. Native apps require platform-specific client IDs (iOS bundle ID, Android package + SHA-1)
|
|
109
|
+
*
|
|
110
|
+
* To create your credentials:
|
|
111
|
+
* 1. Go to Google Cloud Console (https://console.cloud.google.com)
|
|
112
|
+
* 2. Create OAuth 2.0 credentials for each platform:
|
|
113
|
+
* - Web application (for web browsers)
|
|
114
|
+
* - iOS (with your bundle identifier)
|
|
115
|
+
* - Android (with your package name and SHA-1 fingerprint)
|
|
116
|
+
* 3. Pass them to updateGoogleClientIds() during app initialization
|
|
117
|
+
*/
|
|
118
|
+
let _googleClientIds = {
|
|
119
|
+
webClientId: null,
|
|
120
|
+
iosClientId: null,
|
|
121
|
+
androidClientId: null,
|
|
122
|
+
serverClientId: null // For backend token verification
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export const updateGoogleClientIds = (clientIds) => {
|
|
126
|
+
if (clientIds.webClientId) {
|
|
127
|
+
_googleClientIds.webClientId = clientIds.webClientId;
|
|
128
|
+
if (typeof window !== 'undefined') {
|
|
129
|
+
window.onairosGoogleClientId = clientIds.webClientId;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (clientIds.iosClientId) {
|
|
133
|
+
_googleClientIds.iosClientId = clientIds.iosClientId;
|
|
134
|
+
if (typeof window !== 'undefined') {
|
|
135
|
+
// Used by Capacitor-native Google auth plugins (e.g. @capgo/capacitor-social-login).
|
|
136
|
+
window.onairosGoogleIosClientId = clientIds.iosClientId;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (clientIds.androidClientId) {
|
|
140
|
+
_googleClientIds.androidClientId = clientIds.androidClientId;
|
|
141
|
+
if (typeof window !== 'undefined') {
|
|
142
|
+
window.onairosGoogleAndroidClientId = clientIds.androidClientId;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (clientIds.serverClientId) {
|
|
146
|
+
_googleClientIds.serverClientId = clientIds.serverClientId;
|
|
147
|
+
if (typeof window !== 'undefined') {
|
|
148
|
+
window.onairosGoogleServerClientId = clientIds.serverClientId;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return _googleClientIds;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const getGoogleClientIds = () => _googleClientIds;
|
|
155
|
+
|
|
156
|
+
// ============================================
|
|
157
|
+
// YouTube OAuth Configuration
|
|
158
|
+
// ============================================
|
|
159
|
+
let _youtubeClientId = null;
|
|
160
|
+
|
|
161
|
+
export const updateYoutubeClientId = (clientId) => {
|
|
162
|
+
if (clientId) {
|
|
163
|
+
_youtubeClientId = clientId;
|
|
164
|
+
if (typeof window !== 'undefined') {
|
|
165
|
+
window.onairosYoutubeClientId = clientId;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return _youtubeClientId;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export const getYoutubeClientId = () => _youtubeClientId;
|
|
172
|
+
|
|
173
|
+
// Export Capacitor/Mobile detection utilities
|
|
174
|
+
export {
|
|
175
|
+
isCapacitor,
|
|
176
|
+
isReactNative,
|
|
177
|
+
isMobileApp,
|
|
178
|
+
isIOS,
|
|
179
|
+
isAndroid,
|
|
180
|
+
getPlatformInfo,
|
|
181
|
+
isMobileBrowser,
|
|
182
|
+
getEnvironmentType,
|
|
183
|
+
supportsBrowserExtensions,
|
|
184
|
+
logPlatformInfo,
|
|
185
|
+
// Mobile browser storage detection
|
|
186
|
+
detectInAppBrowser,
|
|
187
|
+
isIOSSafari,
|
|
188
|
+
isLocalStorageAvailable,
|
|
189
|
+
areCookiesEnabled,
|
|
190
|
+
getMobileStorageInfo
|
|
191
|
+
} from './utils/capacitorDetection.js';
|
|
192
|
+
|
|
193
|
+
// Export Capacitor LLM data collection functions (native method - no extension needed)
|
|
194
|
+
export {
|
|
195
|
+
storeCapacitorLLMData,
|
|
196
|
+
storeBatchLLMData,
|
|
197
|
+
getLLMHistory,
|
|
198
|
+
getLLMStats,
|
|
199
|
+
formatConversationData
|
|
200
|
+
} from './utils/capacitorLLMHelper.js';
|
|
201
|
+
|
|
202
|
+
// Export Capacitor Native Google Sign-In utilities
|
|
203
|
+
// For Capacitor apps that need native Google authentication
|
|
204
|
+
export {
|
|
205
|
+
getCapacitorGoogleAuth,
|
|
206
|
+
isNativeGoogleAuthAvailable,
|
|
207
|
+
performNativeGoogleSignIn,
|
|
208
|
+
performNativeGoogleSignOut
|
|
209
|
+
} from './utils/capacitorPlugins.js';
|
|
210
|
+
|
|
211
|
+
// Export browser extension utilities (for web browsers only)
|
|
212
|
+
export {
|
|
213
|
+
storeLLMConversationData,
|
|
214
|
+
detectOnairosExtension,
|
|
215
|
+
sendUserInfoToExtension,
|
|
216
|
+
getUserInfoFromStorage
|
|
217
|
+
} from './utils/extensionDetection.js';
|
|
218
|
+
|
|
219
|
+
// Export platform disconnect utilities
|
|
220
|
+
export {
|
|
221
|
+
disconnectPlatform,
|
|
222
|
+
disconnectMultiplePlatforms,
|
|
223
|
+
updateLocalStorageAfterDisconnect,
|
|
224
|
+
hasAuthToken,
|
|
225
|
+
getSupportedPlatforms,
|
|
226
|
+
isPlatformSupported
|
|
227
|
+
} from './utils/platformDisconnect.js';
|
|
228
|
+
|
|
229
|
+
// Export session management utilities
|
|
230
|
+
export {
|
|
231
|
+
checkValidSession,
|
|
232
|
+
createSession,
|
|
233
|
+
destroySession,
|
|
234
|
+
isSessionValid,
|
|
235
|
+
getSessionExpiry,
|
|
236
|
+
setSessionExpiry,
|
|
237
|
+
extendSession,
|
|
238
|
+
validateToken,
|
|
239
|
+
getStoredToken,
|
|
240
|
+
refreshSessionOnActivity,
|
|
241
|
+
getSessionDurations,
|
|
242
|
+
getSessionInfo,
|
|
243
|
+
getMobileStorageStatus,
|
|
244
|
+
attemptSessionRecovery,
|
|
245
|
+
resetStorageCapabilitiesCache,
|
|
246
|
+
// Cross-domain cookie support for SSO
|
|
247
|
+
setCrossDomainCookie,
|
|
248
|
+
deleteCrossDomainCookie
|
|
249
|
+
} from './utils/sessionManager.js';
|
|
250
|
+
|
|
251
|
+
// ============================================
|
|
252
|
+
// Cross-Domain SSO for Onairos Apps
|
|
253
|
+
// (love.onairos.uk, lunar.onairos.uk, unwrap.onairos.uk)
|
|
254
|
+
// ============================================
|
|
255
|
+
export {
|
|
256
|
+
// SSO detection
|
|
257
|
+
isOnairosApp,
|
|
258
|
+
getOnairosAppType,
|
|
259
|
+
// SSO session management
|
|
260
|
+
checkSSOSession,
|
|
261
|
+
verifySSOSession,
|
|
262
|
+
performAutoSSO,
|
|
263
|
+
createSSOSession,
|
|
264
|
+
destroySSOSession,
|
|
265
|
+
getSSOStatus
|
|
266
|
+
} from './utils/crossDomainSSO.js';
|
|
267
|
+
|
|
268
|
+
// SSO UI Components
|
|
269
|
+
export {
|
|
270
|
+
SSOLoadingIndicator,
|
|
271
|
+
SSOFullScreenLoader,
|
|
272
|
+
SSOStatusBadge,
|
|
273
|
+
useOnairosSSO
|
|
274
|
+
} from './components/OnairosSSO.jsx';
|