@oxyhq/services 5.16.40 → 5.16.42
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/lib/commonjs/adapters/expo/crypto.js +56 -0
- package/lib/commonjs/adapters/expo/crypto.js.map +1 -0
- package/lib/commonjs/adapters/expo/fetch.js +30 -0
- package/lib/commonjs/adapters/expo/fetch.js.map +1 -0
- package/lib/commonjs/adapters/expo/index.js +48 -0
- package/lib/commonjs/adapters/expo/index.js.map +1 -0
- package/lib/commonjs/adapters/expo/storage.js +201 -0
- package/lib/commonjs/adapters/expo/storage.js.map +1 -0
- package/lib/commonjs/adapters/index.js +50 -0
- package/lib/commonjs/adapters/index.js.map +1 -0
- package/lib/commonjs/adapters/node/crypto.js +40 -0
- package/lib/commonjs/adapters/node/crypto.js.map +1 -0
- package/lib/commonjs/adapters/node/fetch.js +62 -0
- package/lib/commonjs/adapters/node/fetch.js.map +1 -0
- package/lib/commonjs/adapters/node/index.js +34 -0
- package/lib/commonjs/adapters/node/index.js.map +1 -0
- package/lib/commonjs/adapters/node/storage.js +163 -0
- package/lib/commonjs/adapters/node/storage.js.map +1 -0
- package/lib/commonjs/core/identity-session/DeviceManager.js +237 -0
- package/lib/commonjs/core/identity-session/DeviceManager.js.map +1 -0
- package/lib/commonjs/core/identity-session/INTEGRATION_GUIDE.md +287 -0
- package/lib/commonjs/core/identity-session/IdentityManager.js +400 -0
- package/lib/commonjs/core/identity-session/IdentityManager.js.map +1 -0
- package/lib/commonjs/core/identity-session/IdentitySessionCore.js +394 -0
- package/lib/commonjs/core/identity-session/IdentitySessionCore.js.map +1 -0
- package/lib/commonjs/core/identity-session/RefreshManager.js +137 -0
- package/lib/commonjs/core/identity-session/RefreshManager.js.map +1 -0
- package/lib/commonjs/core/identity-session/SessionManager.js +427 -0
- package/lib/commonjs/core/identity-session/SessionManager.js.map +1 -0
- package/lib/commonjs/core/identity-session/createIdentitySessionCore.js +24 -0
- package/lib/commonjs/core/identity-session/createIdentitySessionCore.js.map +1 -0
- package/lib/commonjs/core/identity-session/errors.js +176 -0
- package/lib/commonjs/core/identity-session/errors.js.map +1 -0
- package/lib/commonjs/core/identity-session/index.js +80 -0
- package/lib/commonjs/core/identity-session/index.js.map +1 -0
- package/lib/commonjs/core/identity-session/types.js +2 -0
- package/lib/commonjs/core/identity-session/types.js.map +1 -0
- package/lib/commonjs/core/index.js +2 -21
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +58 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/interfaces.js +7 -0
- package/lib/commonjs/models/interfaces.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +434 -820
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +52 -0
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -0
- package/lib/commonjs/ui/hooks/useIdentityTransfer.js +125 -0
- package/lib/commonjs/ui/hooks/useIdentityTransfer.js.map +1 -0
- package/lib/commonjs/ui/hooks/useTransferCodesPersistence.js +81 -0
- package/lib/commonjs/ui/hooks/useTransferCodesPersistence.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +7 -2
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +12 -5
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +2 -2
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +6 -6
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/sessionHelpers.js +7 -1
- package/lib/commonjs/ui/utils/sessionHelpers.js.map +1 -1
- package/lib/commonjs/utils/index.js +0 -7
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/sessionUtils.js +8 -1
- package/lib/commonjs/utils/sessionUtils.js.map +1 -1
- package/lib/module/adapters/expo/crypto.js +51 -0
- package/lib/module/adapters/expo/crypto.js.map +1 -0
- package/lib/module/adapters/expo/fetch.js +26 -0
- package/lib/module/adapters/expo/fetch.js.map +1 -0
- package/lib/module/adapters/expo/index.js +45 -0
- package/lib/module/adapters/expo/index.js.map +1 -0
- package/lib/module/adapters/expo/storage.js +198 -0
- package/lib/module/adapters/expo/storage.js.map +1 -0
- package/lib/module/adapters/index.js +47 -0
- package/lib/module/adapters/index.js.map +1 -0
- package/lib/module/adapters/node/crypto.js +36 -0
- package/lib/module/adapters/node/crypto.js.map +1 -0
- package/lib/module/adapters/node/fetch.js +57 -0
- package/lib/module/adapters/node/fetch.js.map +1 -0
- package/lib/module/adapters/node/index.js +31 -0
- package/lib/module/adapters/node/index.js.map +1 -0
- package/lib/module/adapters/node/storage.js +159 -0
- package/lib/module/adapters/node/storage.js.map +1 -0
- package/lib/module/core/identity-session/DeviceManager.js +232 -0
- package/lib/module/core/identity-session/DeviceManager.js.map +1 -0
- package/lib/module/core/identity-session/INTEGRATION_GUIDE.md +287 -0
- package/lib/module/core/identity-session/IdentityManager.js +395 -0
- package/lib/module/core/identity-session/IdentityManager.js.map +1 -0
- package/lib/module/core/identity-session/IdentitySessionCore.js +390 -0
- package/lib/module/core/identity-session/IdentitySessionCore.js.map +1 -0
- package/lib/module/core/identity-session/RefreshManager.js +132 -0
- package/lib/module/core/identity-session/RefreshManager.js.map +1 -0
- package/lib/module/core/identity-session/SessionManager.js +422 -0
- package/lib/module/core/identity-session/SessionManager.js.map +1 -0
- package/lib/module/core/identity-session/createIdentitySessionCore.js +21 -0
- package/lib/module/core/identity-session/createIdentitySessionCore.js.map +1 -0
- package/lib/module/core/identity-session/errors.js +170 -0
- package/lib/module/core/identity-session/errors.js.map +1 -0
- package/lib/module/core/identity-session/index.js +17 -0
- package/lib/module/core/identity-session/index.js.map +1 -0
- package/lib/module/core/identity-session/types.js +2 -0
- package/lib/module/core/identity-session/types.js.map +1 -0
- package/lib/module/core/index.js +2 -3
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +12 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/interfaces.js +7 -0
- package/lib/module/models/interfaces.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +436 -822
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js +48 -0
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -0
- package/lib/module/ui/hooks/useIdentityTransfer.js +121 -0
- package/lib/module/ui/hooks/useIdentityTransfer.js.map +1 -0
- package/lib/module/ui/hooks/useTransferCodesPersistence.js +77 -0
- package/lib/module/ui/hooks/useTransferCodesPersistence.js.map +1 -0
- package/lib/module/ui/screens/AccountCenterScreen.js +7 -2
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +12 -5
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +2 -2
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +6 -6
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/utils/sessionHelpers.js +7 -1
- package/lib/module/ui/utils/sessionHelpers.js.map +1 -1
- package/lib/module/utils/index.js +2 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/sessionUtils.js +8 -1
- package/lib/module/utils/sessionUtils.js.map +1 -1
- package/lib/typescript/adapters/expo/crypto.d.ts +17 -0
- package/lib/typescript/adapters/expo/crypto.d.ts.map +1 -0
- package/lib/typescript/adapters/expo/fetch.d.ts +16 -0
- package/lib/typescript/adapters/expo/fetch.d.ts.map +1 -0
- package/lib/typescript/adapters/expo/index.d.ts +23 -0
- package/lib/typescript/adapters/expo/index.d.ts.map +1 -0
- package/lib/typescript/adapters/expo/storage.d.ts +23 -0
- package/lib/typescript/adapters/expo/storage.d.ts.map +1 -0
- package/lib/typescript/adapters/index.d.ts +19 -0
- package/lib/typescript/adapters/index.d.ts.map +1 -0
- package/lib/typescript/adapters/node/crypto.d.ts +17 -0
- package/lib/typescript/adapters/node/crypto.d.ts.map +1 -0
- package/lib/typescript/adapters/node/fetch.d.ts +16 -0
- package/lib/typescript/adapters/node/fetch.d.ts.map +1 -0
- package/lib/typescript/adapters/node/index.d.ts +23 -0
- package/lib/typescript/adapters/node/index.d.ts.map +1 -0
- package/lib/typescript/adapters/node/storage.d.ts +23 -0
- package/lib/typescript/adapters/node/storage.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/DeviceManager.d.ts +64 -0
- package/lib/typescript/core/identity-session/DeviceManager.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/IdentityManager.d.ts +88 -0
- package/lib/typescript/core/identity-session/IdentityManager.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/IdentitySessionCore.d.ts +141 -0
- package/lib/typescript/core/identity-session/IdentitySessionCore.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/RefreshManager.d.ts +36 -0
- package/lib/typescript/core/identity-session/RefreshManager.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/SessionManager.d.ts +104 -0
- package/lib/typescript/core/identity-session/SessionManager.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/createIdentitySessionCore.d.ts +11 -0
- package/lib/typescript/core/identity-session/createIdentitySessionCore.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/errors.d.ts +63 -0
- package/lib/typescript/core/identity-session/errors.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/index.d.ts +14 -0
- package/lib/typescript/core/identity-session/index.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/types.d.ts +196 -0
- package/lib/typescript/core/identity-session/types.d.ts.map +1 -0
- package/lib/typescript/core/index.d.ts +1 -3
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/core/mixins/index.d.ts +2 -2
- package/lib/typescript/index.d.ts +3 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +5 -36
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/models/session.d.ts +3 -16
- package/lib/typescript/models/session.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +2 -25
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts +7 -8
- package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/mutations/useServicesMutations.d.ts +1 -1
- package/lib/typescript/ui/hooks/mutations/useServicesMutations.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts +5 -5
- package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useAvatarPicker.d.ts +18 -0
- package/lib/typescript/ui/hooks/useAvatarPicker.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useIdentityTransfer.d.ts +24 -0
- package/lib/typescript/ui/hooks/useIdentityTransfer.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useTransferCodesPersistence.d.ts +6 -0
- package/lib/typescript/ui/hooks/useTransferCodesPersistence.d.ts.map +1 -0
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/utils/sessionHelpers.d.ts +1 -0
- package/lib/typescript/ui/utils/sessionHelpers.d.ts.map +1 -1
- package/lib/typescript/utils/index.d.ts +0 -2
- package/lib/typescript/utils/index.d.ts.map +1 -1
- package/lib/typescript/utils/sessionUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/expo/crypto.ts +55 -0
- package/src/adapters/expo/fetch.ts +28 -0
- package/src/adapters/expo/index.ts +51 -0
- package/src/adapters/expo/storage.ts +228 -0
- package/src/adapters/index.ts +47 -0
- package/src/adapters/node/crypto.ts +39 -0
- package/src/adapters/node/fetch.ts +59 -0
- package/src/adapters/node/index.ts +37 -0
- package/src/adapters/node/storage.ts +170 -0
- package/src/core/identity-session/DeviceManager.ts +273 -0
- package/src/core/identity-session/INTEGRATION_GUIDE.md +287 -0
- package/src/core/identity-session/IdentityManager.ts +474 -0
- package/src/core/identity-session/IdentitySessionCore.ts +464 -0
- package/src/core/identity-session/RefreshManager.ts +189 -0
- package/src/core/identity-session/SessionManager.ts +500 -0
- package/src/core/identity-session/createIdentitySessionCore.ts +19 -0
- package/src/core/identity-session/errors.ts +197 -0
- package/src/core/identity-session/index.ts +15 -0
- package/src/core/identity-session/types.ts +188 -0
- package/src/core/index.ts +3 -4
- package/src/index.ts +28 -3
- package/src/models/interfaces.ts +12 -39
- package/src/models/session.ts +6 -16
- package/src/ui/context/OxyContext.tsx +442 -871
- package/src/ui/hooks/auth/index.ts +1 -0
- package/src/ui/hooks/useAvatarPicker.ts +62 -0
- package/src/ui/hooks/useIdentityTransfer.ts +135 -0
- package/src/ui/hooks/useTransferCodesPersistence.ts +80 -0
- package/src/ui/screens/AccountCenterScreen.tsx +7 -2
- package/src/ui/screens/AccountSettingsScreen.tsx +15 -8
- package/src/ui/screens/AccountSwitcherScreen.tsx +2 -2
- package/src/ui/screens/ProfileScreen.tsx +10 -10
- package/src/ui/utils/sessionHelpers.ts +7 -0
- package/src/utils/index.ts +1 -2
- package/src/utils/sessionUtils.ts +8 -0
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +0 -732
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +0 -1
- package/lib/commonjs/ui/context/hooks/useDeviceManagement.js +0 -73
- package/lib/commonjs/ui/context/hooks/useDeviceManagement.js.map +0 -1
- package/lib/commonjs/ui/hooks/useDeviceManagement.js +0 -73
- package/lib/commonjs/ui/hooks/useDeviceManagement.js.map +0 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +0 -281
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +0 -1
- package/lib/commonjs/utils/deviceManager.js +0 -177
- package/lib/commonjs/utils/deviceManager.js.map +0 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +0 -726
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +0 -1
- package/lib/module/ui/context/hooks/useDeviceManagement.js +0 -68
- package/lib/module/ui/context/hooks/useDeviceManagement.js.map +0 -1
- package/lib/module/ui/hooks/useDeviceManagement.js +0 -68
- package/lib/module/ui/hooks/useDeviceManagement.js.map +0 -1
- package/lib/module/ui/hooks/useSessionManagement.js +0 -276
- package/lib/module/ui/hooks/useSessionManagement.js.map +0 -1
- package/lib/module/utils/deviceManager.js +0 -171
- package/lib/module/utils/deviceManager.js.map +0 -1
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +0 -59
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +0 -1
- package/lib/typescript/ui/context/hooks/useDeviceManagement.d.ts +0 -27
- package/lib/typescript/ui/context/hooks/useDeviceManagement.d.ts.map +0 -1
- package/lib/typescript/ui/hooks/useDeviceManagement.d.ts +0 -27
- package/lib/typescript/ui/hooks/useDeviceManagement.d.ts.map +0 -1
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts +0 -41
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts.map +0 -1
- package/lib/typescript/utils/deviceManager.d.ts +0 -66
- package/lib/typescript/utils/deviceManager.d.ts.map +0 -1
- package/src/ui/context/hooks/useAuthOperations.ts +0 -801
- package/src/ui/context/hooks/useDeviceManagement.ts +0 -108
- package/src/ui/hooks/useDeviceManagement.ts +0 -108
- package/src/ui/hooks/useSessionManagement.ts +0 -401
- package/src/utils/deviceManager.ts +0 -198
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity Session Core
|
|
3
|
+
*
|
|
4
|
+
* Main orchestrator for identity and session management.
|
|
5
|
+
* Provides a unified API for all identity and session operations.
|
|
6
|
+
*/
|
|
7
|
+
import type { PlatformAdapter } from '../../adapters';
|
|
8
|
+
import type { Identity, Session, Device, BackupData, IdentitySessionEvent } from './types';
|
|
9
|
+
import { IdentityManager } from './IdentityManager';
|
|
10
|
+
import { SessionManager } from './SessionManager';
|
|
11
|
+
import { DeviceManager } from './DeviceManager';
|
|
12
|
+
import { RefreshManager } from './RefreshManager';
|
|
13
|
+
/**
|
|
14
|
+
* Identity Session Core Class
|
|
15
|
+
*/
|
|
16
|
+
export declare class IdentitySessionCore {
|
|
17
|
+
private adapter;
|
|
18
|
+
private identityManager;
|
|
19
|
+
private sessionManager;
|
|
20
|
+
private deviceManager;
|
|
21
|
+
private refreshManager;
|
|
22
|
+
private baseURL;
|
|
23
|
+
private eventListeners;
|
|
24
|
+
private initialized;
|
|
25
|
+
constructor(adapter: PlatformAdapter, baseURL?: string);
|
|
26
|
+
/**
|
|
27
|
+
* Set base URL for API requests
|
|
28
|
+
*/
|
|
29
|
+
setBaseURL(baseURL: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Initialize the core (load data from storage)
|
|
32
|
+
*/
|
|
33
|
+
initialize(): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Emit an event to all subscribers
|
|
36
|
+
*/
|
|
37
|
+
private emit;
|
|
38
|
+
/**
|
|
39
|
+
* Get current identity (SOLO NATIVE)
|
|
40
|
+
*/
|
|
41
|
+
getCurrentIdentity(): Promise<Identity | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Create a new identity (SOLO NATIVE)
|
|
44
|
+
*/
|
|
45
|
+
createIdentity(username?: string): Promise<Identity>;
|
|
46
|
+
/**
|
|
47
|
+
* Import identity from backup (SOLO NATIVE)
|
|
48
|
+
*/
|
|
49
|
+
importIdentity(backupData: BackupData, password: string): Promise<Identity>;
|
|
50
|
+
/**
|
|
51
|
+
* Delete identity (SOLO NATIVE)
|
|
52
|
+
*/
|
|
53
|
+
deleteIdentity(skipBackup?: boolean, force?: boolean, userConfirmed?: boolean): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Sign a challenge (SOLO NATIVE)
|
|
56
|
+
*/
|
|
57
|
+
signChallenge(challenge: string): Promise<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Generate a random challenge string
|
|
60
|
+
*/
|
|
61
|
+
generateChallenge(): Promise<string>;
|
|
62
|
+
/**
|
|
63
|
+
* Create a registration signature (SOLO NATIVE)
|
|
64
|
+
*/
|
|
65
|
+
createRegistrationSignature(): Promise<{
|
|
66
|
+
signature: string;
|
|
67
|
+
publicKey: string;
|
|
68
|
+
timestamp: number;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Sign challenge for authentication (SOLO NATIVE)
|
|
72
|
+
* Returns AuthChallenge object with signature, publicKey, and timestamp
|
|
73
|
+
*/
|
|
74
|
+
signChallengeForAuth(challenge: string): Promise<{
|
|
75
|
+
challenge: string;
|
|
76
|
+
signature: string;
|
|
77
|
+
publicKey: string;
|
|
78
|
+
timestamp: number;
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* Check if identity exists
|
|
82
|
+
*/
|
|
83
|
+
hasIdentity(): Promise<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* Get public key
|
|
86
|
+
*/
|
|
87
|
+
getPublicKey(): Promise<string | null>;
|
|
88
|
+
/**
|
|
89
|
+
* Get current session (Native + Web)
|
|
90
|
+
*/
|
|
91
|
+
getSession(): Promise<Session | null>;
|
|
92
|
+
/**
|
|
93
|
+
* Get all sessions (Native + Web)
|
|
94
|
+
*/
|
|
95
|
+
getAllSessions(): Promise<Session[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Get active session ID (Native + Web)
|
|
98
|
+
*/
|
|
99
|
+
getActiveSessionId(): Promise<string | null>;
|
|
100
|
+
/**
|
|
101
|
+
* Create a new session (sign in) (Native + Web)
|
|
102
|
+
*/
|
|
103
|
+
createSession(deviceName?: string): Promise<Session>;
|
|
104
|
+
/**
|
|
105
|
+
* Refresh current session (Native + Web)
|
|
106
|
+
*/
|
|
107
|
+
refreshSession(): Promise<Session>;
|
|
108
|
+
/**
|
|
109
|
+
* Invalidate a session (Native + Web)
|
|
110
|
+
*/
|
|
111
|
+
invalidateSession(sessionId?: string): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Invalidate all sessions (Native + Web)
|
|
114
|
+
*/
|
|
115
|
+
invalidateAllSessions(): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Get current device (Native + Web)
|
|
118
|
+
*/
|
|
119
|
+
getCurrentDevice(): Promise<Device | null>;
|
|
120
|
+
/**
|
|
121
|
+
* Subscribe to identity and session events
|
|
122
|
+
*/
|
|
123
|
+
subscribe(callback: (event: IdentitySessionEvent) => void): () => void;
|
|
124
|
+
/**
|
|
125
|
+
* Get identity manager (for advanced operations)
|
|
126
|
+
*/
|
|
127
|
+
getIdentityManager(): IdentityManager;
|
|
128
|
+
/**
|
|
129
|
+
* Get session manager (for advanced operations)
|
|
130
|
+
*/
|
|
131
|
+
getSessionManager(): SessionManager;
|
|
132
|
+
/**
|
|
133
|
+
* Get device manager (for advanced operations)
|
|
134
|
+
*/
|
|
135
|
+
getDeviceManager(): DeviceManager;
|
|
136
|
+
/**
|
|
137
|
+
* Get refresh manager (for advanced operations)
|
|
138
|
+
*/
|
|
139
|
+
getRefreshManager(): RefreshManager;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=IdentitySessionCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentitySessionCore.d.ts","sourceRoot":"","sources":["../../../../src/core/identity-session/IdentitySessionCore.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAA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AI,aAAa;IAIjC;;OAEG;IACH,iBAAiB,IAAI,cAAc;CAGpC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refresh Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages token refresh operations (Native + Web)
|
|
5
|
+
*/
|
|
6
|
+
import type { PlatformAdapter } from '../../adapters';
|
|
7
|
+
/**
|
|
8
|
+
* Refresh Manager Class
|
|
9
|
+
*/
|
|
10
|
+
export declare class RefreshManager {
|
|
11
|
+
private adapter;
|
|
12
|
+
private baseURL;
|
|
13
|
+
private refreshPromise;
|
|
14
|
+
constructor(adapter: PlatformAdapter, baseURL?: string);
|
|
15
|
+
/**
|
|
16
|
+
* Set base URL for API requests
|
|
17
|
+
*/
|
|
18
|
+
setBaseURL(baseURL: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Check if token is expiring soon (within 60 seconds)
|
|
21
|
+
*/
|
|
22
|
+
isTokenExpiringSoon(accessToken: string | null): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Get userId from access token
|
|
25
|
+
*/
|
|
26
|
+
getUserIdFromToken(accessToken: string | null): string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Refresh access token if expiring soon
|
|
29
|
+
*/
|
|
30
|
+
refreshTokenIfNeeded(getAccessToken: () => string | null, setTokens: (accessToken: string, refreshToken?: string) => void, clearTokens: () => void): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Perform token refresh
|
|
33
|
+
*/
|
|
34
|
+
private _performRefresh;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=RefreshManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshManager.d.ts","sourceRoot":"","sources":["../../../../src/core/identity-session/RefreshManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAetD;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,cAAc,CAA8B;gBAExC,OAAO,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,MAAM;IAKtD;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;IAcxD;;OAEG;IACH,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI;IAW7D;;OAEG;IACG,oBAAoB,CACxB,cAAc,EAAE,MAAM,MAAM,GAAG,IAAI,EACnC,SAAS,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,EAC/D,WAAW,EAAE,MAAM,IAAI,GACtB,OAAO,CAAC,IAAI,CAAC;IA4BhB;;OAEG;YACW,eAAe;CA4E9B"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages user sessions (Native + Web)
|
|
5
|
+
* Handles session creation, storage, refresh, and invalidation.
|
|
6
|
+
*/
|
|
7
|
+
import type { PlatformAdapter } from '../../adapters';
|
|
8
|
+
import type { Session } from './types';
|
|
9
|
+
import { DeviceManager } from './DeviceManager';
|
|
10
|
+
import { RefreshManager } from './RefreshManager';
|
|
11
|
+
/**
|
|
12
|
+
* Session Manager Class
|
|
13
|
+
*/
|
|
14
|
+
export declare class SessionManager {
|
|
15
|
+
private adapter;
|
|
16
|
+
private deviceManager;
|
|
17
|
+
private refreshManager;
|
|
18
|
+
private baseURL;
|
|
19
|
+
private cachedSessions;
|
|
20
|
+
private cachedActiveSessionId;
|
|
21
|
+
private tokenStore;
|
|
22
|
+
constructor(adapter: PlatformAdapter, deviceManager: DeviceManager, refreshManager: RefreshManager, baseURL?: string);
|
|
23
|
+
/**
|
|
24
|
+
* Set base URL for API requests
|
|
25
|
+
*/
|
|
26
|
+
setBaseURL(baseURL: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Invalidate cached sessions
|
|
29
|
+
*/
|
|
30
|
+
invalidateCache(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Load tokens from storage
|
|
33
|
+
*/
|
|
34
|
+
private loadTokens;
|
|
35
|
+
/**
|
|
36
|
+
* Save tokens to storage
|
|
37
|
+
*/
|
|
38
|
+
private saveTokens;
|
|
39
|
+
/**
|
|
40
|
+
* Get access token
|
|
41
|
+
*/
|
|
42
|
+
getAccessToken(): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Get refresh token
|
|
45
|
+
*/
|
|
46
|
+
getRefreshToken(): string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Set tokens
|
|
49
|
+
*/
|
|
50
|
+
setTokens(accessToken: string, refreshToken?: string): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Clear tokens
|
|
53
|
+
*/
|
|
54
|
+
clearTokens(): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Load sessions from storage
|
|
57
|
+
*/
|
|
58
|
+
loadSessions(): Promise<Session[]>;
|
|
59
|
+
/**
|
|
60
|
+
* Save sessions to storage
|
|
61
|
+
*/
|
|
62
|
+
private saveSessions;
|
|
63
|
+
/**
|
|
64
|
+
* Get active session ID
|
|
65
|
+
*/
|
|
66
|
+
getActiveSessionId(): Promise<string | null>;
|
|
67
|
+
/**
|
|
68
|
+
* Set active session ID
|
|
69
|
+
*/
|
|
70
|
+
setActiveSessionId(sessionId: string | null): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Get all sessions
|
|
73
|
+
*/
|
|
74
|
+
getAllSessions(): Promise<Session[]>;
|
|
75
|
+
/**
|
|
76
|
+
* Get current session
|
|
77
|
+
*/
|
|
78
|
+
getSession(): Promise<Session | null>;
|
|
79
|
+
/**
|
|
80
|
+
* Create a new session (sign in)
|
|
81
|
+
*/
|
|
82
|
+
createSession(publicKey: string, signature: string, timestamp: number, deviceName?: string): Promise<Session>;
|
|
83
|
+
/**
|
|
84
|
+
* Refresh current session
|
|
85
|
+
*/
|
|
86
|
+
refreshSession(): Promise<Session>;
|
|
87
|
+
/**
|
|
88
|
+
* Invalidate a session
|
|
89
|
+
*/
|
|
90
|
+
invalidateSession(sessionId?: string): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Clear local session data
|
|
93
|
+
*/
|
|
94
|
+
private clearLocalSession;
|
|
95
|
+
/**
|
|
96
|
+
* Invalidate all sessions
|
|
97
|
+
*/
|
|
98
|
+
invalidateAllSessions(): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Initialize - load tokens and sessions from storage
|
|
101
|
+
*/
|
|
102
|
+
initialize(): Promise<void>;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=SessionManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionManager.d.ts","sourceRoot":"","sources":["../../../../src/core/identity-session/SessionManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAwBlD;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,qBAAqB,CAAuB;IACpD,OAAO,CAAC,UAAU,CAGhB;gBAGA,OAAO,EAAE,eAAe,EACxB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAA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IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAIlC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create Identity Session Core
|
|
3
|
+
*
|
|
4
|
+
* Factory function to create and initialize IdentitySessionCore
|
|
5
|
+
*/
|
|
6
|
+
import { IdentitySessionCore } from './IdentitySessionCore';
|
|
7
|
+
/**
|
|
8
|
+
* Create and initialize IdentitySessionCore
|
|
9
|
+
*/
|
|
10
|
+
export declare function createIdentitySessionCore(baseURL?: string): Promise<IdentitySessionCore>;
|
|
11
|
+
//# sourceMappingURL=createIdentitySessionCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createIdentitySessionCore.d.ts","sourceRoot":"","sources":["../../../../src/core/identity-session/createIdentitySessionCore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,wBAAsB,yBAAyB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAK9F"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity and Session Error Codes
|
|
3
|
+
*
|
|
4
|
+
* Aligned with backend error codes for consistency across the ecosystem
|
|
5
|
+
*/
|
|
6
|
+
export declare const IdentitySessionErrorCodes: {
|
|
7
|
+
readonly UNAUTHORIZED: "UNAUTHORIZED";
|
|
8
|
+
readonly FORBIDDEN: "FORBIDDEN";
|
|
9
|
+
readonly INVALID_TOKEN: "INVALID_TOKEN";
|
|
10
|
+
readonly MISSING_TOKEN: "MISSING_TOKEN";
|
|
11
|
+
readonly TOKEN_EXPIRED: "TOKEN_EXPIRED";
|
|
12
|
+
readonly TOKEN_NOT_YET_VALID: "TOKEN_NOT_YET_VALID";
|
|
13
|
+
readonly INVALID_SIGNATURE: "INVALID_SIGNATURE";
|
|
14
|
+
readonly MALFORMED_TOKEN: "MALFORMED_TOKEN";
|
|
15
|
+
readonly INVALID_SESSION: "INVALID_SESSION";
|
|
16
|
+
readonly IDENTITY_NOT_FOUND: "IDENTITY_NOT_FOUND";
|
|
17
|
+
readonly IDENTITY_ALREADY_EXISTS: "IDENTITY_ALREADY_EXISTS";
|
|
18
|
+
readonly IDENTITY_NOT_AVAILABLE_ON_WEB: "IDENTITY_NOT_AVAILABLE_ON_WEB";
|
|
19
|
+
readonly IDENTITY_NOT_SYNCED: "IDENTITY_NOT_SYNCED";
|
|
20
|
+
readonly INVALID_PUBLIC_KEY: "INVALID_PUBLIC_KEY";
|
|
21
|
+
readonly INVALID_PRIVATE_KEY: "INVALID_PRIVATE_KEY";
|
|
22
|
+
readonly IDENTITY_CREATION_FAILED: "IDENTITY_CREATION_FAILED";
|
|
23
|
+
readonly IDENTITY_IMPORT_FAILED: "IDENTITY_IMPORT_FAILED";
|
|
24
|
+
readonly IDENTITY_DELETE_FAILED: "IDENTITY_DELETE_FAILED";
|
|
25
|
+
readonly BACKUP_DECRYPTION_FAILED: "BACKUP_DECRYPTION_FAILED";
|
|
26
|
+
readonly SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
|
|
27
|
+
readonly SESSION_EXPIRED: "SESSION_EXPIRED";
|
|
28
|
+
readonly SESSION_INVALID: "SESSION_INVALID";
|
|
29
|
+
readonly SESSION_CREATION_FAILED: "SESSION_CREATION_FAILED";
|
|
30
|
+
readonly SESSION_REFRESH_FAILED: "SESSION_REFRESH_FAILED";
|
|
31
|
+
readonly DEVICE_NOT_FOUND: "DEVICE_NOT_FOUND";
|
|
32
|
+
readonly DEVICE_CREATION_FAILED: "DEVICE_CREATION_FAILED";
|
|
33
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
34
|
+
readonly BAD_REQUEST: "BAD_REQUEST";
|
|
35
|
+
readonly MISSING_PARAMETER: "MISSING_PARAMETER";
|
|
36
|
+
readonly INVALID_FORMAT: "INVALID_FORMAT";
|
|
37
|
+
readonly NOT_FOUND: "NOT_FOUND";
|
|
38
|
+
readonly ALREADY_EXISTS: "ALREADY_EXISTS";
|
|
39
|
+
readonly CONFLICT: "CONFLICT";
|
|
40
|
+
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
41
|
+
readonly SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE";
|
|
42
|
+
readonly TIMEOUT: "TIMEOUT";
|
|
43
|
+
readonly NETWORK_ERROR: "NETWORK_ERROR";
|
|
44
|
+
readonly CONNECTION_FAILED: "CONNECTION_FAILED";
|
|
45
|
+
readonly STORAGE_ERROR: "STORAGE_ERROR";
|
|
46
|
+
readonly STORAGE_NOT_AVAILABLE: "STORAGE_NOT_AVAILABLE";
|
|
47
|
+
readonly SECURE_STORAGE_NOT_AVAILABLE: "SECURE_STORAGE_NOT_AVAILABLE";
|
|
48
|
+
readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
|
|
49
|
+
};
|
|
50
|
+
export type IdentitySessionErrorCode = typeof IdentitySessionErrorCodes[keyof typeof IdentitySessionErrorCodes];
|
|
51
|
+
/**
|
|
52
|
+
* IdentitySessionError - Custom error class for identity and session operations
|
|
53
|
+
*/
|
|
54
|
+
export declare class IdentitySessionError extends Error {
|
|
55
|
+
readonly code: IdentitySessionErrorCode;
|
|
56
|
+
readonly statusCode: number;
|
|
57
|
+
constructor(message: string, code?: IdentitySessionErrorCode, statusCode?: number);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create error from code
|
|
61
|
+
*/
|
|
62
|
+
export declare function createIdentitySessionError(code: IdentitySessionErrorCode, message?: string, statusCode?: number): IdentitySessionError;
|
|
63
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/core/identity-session/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8D5B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,OAAO,yBAAyB,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC;AAEhH;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,SAAgB,IAAI,EAAE,wBAAwB,CAAC;IAC/C,SAAgB,UAAU,EAAE,MAAM,CAAC;gBAGjC,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,wBAAkE,EACxE,UAAU,GAAE,MAAY;CAQ3B;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,oBAAoB,CAgGtB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity Session Core
|
|
3
|
+
*
|
|
4
|
+
* Main entry point for identity and session management
|
|
5
|
+
*/
|
|
6
|
+
export { IdentitySessionCore } from './IdentitySessionCore';
|
|
7
|
+
export { IdentityManager } from './IdentityManager';
|
|
8
|
+
export { SessionManager } from './SessionManager';
|
|
9
|
+
export { DeviceManager } from './DeviceManager';
|
|
10
|
+
export { RefreshManager } from './RefreshManager';
|
|
11
|
+
export { createIdentitySessionCore } from './createIdentitySessionCore';
|
|
12
|
+
export * from './types';
|
|
13
|
+
export * from './errors';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/identity-session/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Identity and Session Types
|
|
3
|
+
*
|
|
4
|
+
* These types are aligned with backend models (IUser, ISession) to ensure
|
|
5
|
+
* consistency across the entire ecosystem.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Identity - Aligned with IUser from backend
|
|
9
|
+
* Represents a user's cryptographic identity
|
|
10
|
+
*/
|
|
11
|
+
export interface Identity {
|
|
12
|
+
id: string;
|
|
13
|
+
publicKey: string;
|
|
14
|
+
username?: string;
|
|
15
|
+
email?: string;
|
|
16
|
+
avatar?: string;
|
|
17
|
+
verified?: boolean;
|
|
18
|
+
language?: string;
|
|
19
|
+
privacySettings?: {
|
|
20
|
+
isPrivateAccount?: boolean;
|
|
21
|
+
hideOnlineStatus?: boolean;
|
|
22
|
+
hideLastSeen?: boolean;
|
|
23
|
+
profileVisibility?: boolean;
|
|
24
|
+
loginAlerts?: boolean;
|
|
25
|
+
blockScreenshots?: boolean;
|
|
26
|
+
login?: boolean;
|
|
27
|
+
biometricLogin?: boolean;
|
|
28
|
+
showActivity?: boolean;
|
|
29
|
+
allowTagging?: boolean;
|
|
30
|
+
allowMentions?: boolean;
|
|
31
|
+
hideReadReceipts?: boolean;
|
|
32
|
+
allowDirectMessages?: boolean;
|
|
33
|
+
dataSharing?: boolean;
|
|
34
|
+
locationSharing?: boolean;
|
|
35
|
+
analyticsSharing?: boolean;
|
|
36
|
+
sensitiveContent?: boolean;
|
|
37
|
+
autoFilter?: boolean;
|
|
38
|
+
muteKeywords?: boolean;
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
};
|
|
41
|
+
name?: {
|
|
42
|
+
first?: string;
|
|
43
|
+
last?: string;
|
|
44
|
+
full?: string;
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
};
|
|
47
|
+
bio?: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
locations?: Array<{
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
label?: string;
|
|
53
|
+
type?: 'home' | 'work' | 'school' | 'other';
|
|
54
|
+
address?: {
|
|
55
|
+
street?: string;
|
|
56
|
+
streetNumber?: string;
|
|
57
|
+
streetDetails?: string;
|
|
58
|
+
postalCode?: string;
|
|
59
|
+
city?: string;
|
|
60
|
+
state?: string;
|
|
61
|
+
country?: string;
|
|
62
|
+
formattedAddress?: string;
|
|
63
|
+
};
|
|
64
|
+
coordinates?: {
|
|
65
|
+
lat: number;
|
|
66
|
+
lon: number;
|
|
67
|
+
};
|
|
68
|
+
metadata?: {
|
|
69
|
+
placeId?: string;
|
|
70
|
+
osmId?: string;
|
|
71
|
+
osmType?: string;
|
|
72
|
+
countryCode?: string;
|
|
73
|
+
timezone?: string;
|
|
74
|
+
};
|
|
75
|
+
createdAt?: string;
|
|
76
|
+
updatedAt?: string;
|
|
77
|
+
}>;
|
|
78
|
+
links?: string[];
|
|
79
|
+
linksMetadata?: Array<{
|
|
80
|
+
url: string;
|
|
81
|
+
title: string;
|
|
82
|
+
description: string;
|
|
83
|
+
image?: string;
|
|
84
|
+
}>;
|
|
85
|
+
_count?: {
|
|
86
|
+
followers?: number;
|
|
87
|
+
following?: number;
|
|
88
|
+
};
|
|
89
|
+
accountExpiresAfterInactivityDays?: number | null;
|
|
90
|
+
createdAt?: string;
|
|
91
|
+
updatedAt?: string;
|
|
92
|
+
[key: string]: unknown;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Session - Aligned with ISession from backend
|
|
96
|
+
* Represents an active user session
|
|
97
|
+
*/
|
|
98
|
+
export interface Session {
|
|
99
|
+
sessionId: string;
|
|
100
|
+
userId: string;
|
|
101
|
+
deviceId: string;
|
|
102
|
+
expiresAt: string;
|
|
103
|
+
lastActive: string;
|
|
104
|
+
deviceInfo: DeviceInfo;
|
|
105
|
+
isActive?: boolean;
|
|
106
|
+
accessToken?: string;
|
|
107
|
+
refreshToken?: string;
|
|
108
|
+
isCurrent?: boolean;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* DeviceInfo - Aligned with ISession.deviceInfo
|
|
112
|
+
*/
|
|
113
|
+
export interface DeviceInfo {
|
|
114
|
+
deviceName?: string;
|
|
115
|
+
deviceType: string;
|
|
116
|
+
platform: string;
|
|
117
|
+
browser?: string;
|
|
118
|
+
os?: string;
|
|
119
|
+
lastActive: string;
|
|
120
|
+
ipAddress?: string;
|
|
121
|
+
userAgent?: string;
|
|
122
|
+
location?: string;
|
|
123
|
+
fingerprint?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Device - Represents device information
|
|
127
|
+
*/
|
|
128
|
+
export interface Device {
|
|
129
|
+
deviceId: string;
|
|
130
|
+
deviceName?: string;
|
|
131
|
+
deviceType: string;
|
|
132
|
+
platform: string;
|
|
133
|
+
browser?: string;
|
|
134
|
+
os?: string;
|
|
135
|
+
fingerprint?: string;
|
|
136
|
+
createdAt?: string;
|
|
137
|
+
updatedAt?: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* DeviceSession - Aligned with backend device session model
|
|
141
|
+
*/
|
|
142
|
+
export interface DeviceSession {
|
|
143
|
+
deviceId: string;
|
|
144
|
+
deviceName?: string;
|
|
145
|
+
deviceType: string;
|
|
146
|
+
platform: string;
|
|
147
|
+
browser?: string;
|
|
148
|
+
os?: string;
|
|
149
|
+
lastActive: string;
|
|
150
|
+
fingerprint?: string;
|
|
151
|
+
createdAt?: string;
|
|
152
|
+
updatedAt?: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* BackupData - Encrypted backup data for identity
|
|
156
|
+
*/
|
|
157
|
+
export interface BackupData {
|
|
158
|
+
encrypted: string;
|
|
159
|
+
salt: string;
|
|
160
|
+
iv: string;
|
|
161
|
+
publicKey: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* IdentitySessionEvent - Events emitted by the core
|
|
165
|
+
*/
|
|
166
|
+
export type IdentitySessionEvent = {
|
|
167
|
+
type: 'identity:created';
|
|
168
|
+
identity: Identity;
|
|
169
|
+
} | {
|
|
170
|
+
type: 'identity:imported';
|
|
171
|
+
identity: Identity;
|
|
172
|
+
} | {
|
|
173
|
+
type: 'identity:deleted';
|
|
174
|
+
} | {
|
|
175
|
+
type: 'identity:synced';
|
|
176
|
+
identity: Identity;
|
|
177
|
+
} | {
|
|
178
|
+
type: 'session:created';
|
|
179
|
+
session: Session;
|
|
180
|
+
} | {
|
|
181
|
+
type: 'session:refreshed';
|
|
182
|
+
session: Session;
|
|
183
|
+
} | {
|
|
184
|
+
type: 'session:invalidated';
|
|
185
|
+
sessionId: string;
|
|
186
|
+
} | {
|
|
187
|
+
type: 'session:all-invalidated';
|
|
188
|
+
} | {
|
|
189
|
+
type: 'device:changed';
|
|
190
|
+
device: Device;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Platform type
|
|
194
|
+
*/
|
|
195
|
+
export type Platform = 'native' | 'web' | 'node';
|
|
196
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/identity-session/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe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ationError, OxyAuthenticationTimeoutError } from './OxyServices';
|
|
8
8
|
export { OXY_CLOUD_URL, oxyClient } from './OxyServices';
|
|
9
9
|
export * from '../models/interfaces';
|
|
10
|
-
export
|
|
11
|
-
export { DeviceManager } from '../utils/deviceManager';
|
|
12
|
-
export type { DeviceFingerprint, StoredDeviceInfo } from '../utils/deviceManager';
|
|
10
|
+
export type { Session, DeviceInfo, Device } from '../models/session';
|
|
13
11
|
export { SUPPORTED_LANGUAGES, getLanguageMetadata, getLanguageName, getNativeLanguageName, normalizeLanguageCode } from '../utils/languageUtils';
|
|
14
12
|
export type { LanguageMetadata } from '../utils/languageUtils';
|
|
15
13
|
import { OxyServices } from './OxyServices';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAIzD,cAAc,sBAAsB,CAAC;AACrC,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAKrE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,eAAe,WAAW,CAAC"}
|
|
@@ -761,7 +761,7 @@ export declare function composeOxyServices(): {
|
|
|
761
761
|
user: import("..").User;
|
|
762
762
|
}>;
|
|
763
763
|
requestChallenge(publicKey: string): Promise<import("./OxyServices.auth").ChallengeResponse>;
|
|
764
|
-
verifyChallenge(publicKey: string, challenge: string, signature: string, timestamp: number, deviceName?: string, deviceFingerprint?: string): Promise<import("
|
|
764
|
+
verifyChallenge(publicKey: string, challenge: string, signature: string, timestamp: number, deviceName?: string, deviceFingerprint?: string): Promise<import("../..").SessionLoginResponse>;
|
|
765
765
|
checkPublicKeyRegistered(publicKey: string): Promise<import("./OxyServices.auth").PublicKeyCheckResponse>;
|
|
766
766
|
getUserByPublicKey(publicKey: string): Promise<import("..").User>;
|
|
767
767
|
getUserBySession(sessionId: string): Promise<import("..").User>;
|
|
@@ -800,7 +800,7 @@ export declare function composeOxyServices(): {
|
|
|
800
800
|
token: string;
|
|
801
801
|
user: import("..").User;
|
|
802
802
|
}>;
|
|
803
|
-
signIn(username: string, password: string, deviceName?: string, deviceFingerprint?: any): Promise<import("
|
|
803
|
+
signIn(username: string, password: string, deviceName?: string, deviceFingerprint?: any): Promise<import("../..").SessionLoginResponse | {
|
|
804
804
|
mfaRequired: true;
|
|
805
805
|
mfaToken: string;
|
|
806
806
|
expiresAt: string;
|
|
@@ -9,12 +9,13 @@ import './crypto/polyfill';
|
|
|
9
9
|
export { KeyManager, SignatureService } from './crypto';
|
|
10
10
|
export { OxyServices, OxyAuthenticationError, OxyAuthenticationTimeoutError } from './core';
|
|
11
11
|
export { OXY_CLOUD_URL, oxyClient } from './core';
|
|
12
|
+
export { IdentitySessionCore, IdentityManager, SessionManager, RefreshManager, createIdentitySessionCore, } from './core/identity-session';
|
|
13
|
+
export type { Identity, Session, Device, DeviceInfo, BackupData, IdentitySessionEvent, Platform, } from './core/identity-session/types';
|
|
14
|
+
export { IdentitySessionError, IdentitySessionErrorCodes, createIdentitySessionError, } from './core/identity-session/errors';
|
|
12
15
|
export type { KeyPair, SignedMessage, AuthChallenge } from './crypto';
|
|
13
16
|
export { OxyContextProvider, // Backward compatibility
|
|
14
17
|
useOxy } from './ui/context/OxyContext';
|
|
15
18
|
export { default as OxyProvider } from './ui/components/OxyProvider';
|
|
16
|
-
export { DeviceManager } from './utils/deviceManager';
|
|
17
|
-
export type { DeviceFingerprint, StoredDeviceInfo } from './utils/deviceManager';
|
|
18
19
|
export { SUPPORTED_LANGUAGES, getLanguageMetadata, getLanguageName, getNativeLanguageName, normalizeLanguageCode } from './utils/languageUtils';
|
|
19
20
|
export type { LanguageMetadata } from './utils/languageUtils';
|
|
20
21
|
export type { OxyConfig, User, LoginResponse, Notification, Wallet, Transaction, TransferFundsRequest, PurchaseRequest, WithdrawalRequest, TransactionResponse, KarmaRule, KarmaHistory, KarmaLeaderboardEntry, KarmaAwardRequest, ApiError, PaymentMethod, PaymentRequest, PaymentResponse, AnalyticsData, FollowerDetails, ContentViewer, FileMetadata, FileUploadResponse, FileListResponse, FileUpdateRequest, FileDeleteResponse, DeviceSession, DeviceSessionsResponse, DeviceSessionLogoutResponse, UpdateDeviceNameResponse, BlockedUser, RestrictedUser, FileVisibility, AssetLink, AssetVariant, Asset, AssetInitRequest, AssetInitResponse, AssetCompleteRequest, AssetLinkRequest, AssetUnlinkRequest, AssetUrlResponse, AssetDeleteSummary, AssetUploadProgress, AssetUpdateVisibilityRequest, AssetUpdateVisibilityResponse, AccountStorageCategoryUsage, AccountStorageUsageResponse, SecurityEventType, SecurityEventSeverity, SecurityActivity, SecurityActivityResponse } from './models/interfaces';
|