@oxyhq/services 5.16.34 → 5.16.36

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.
Files changed (178) hide show
  1. package/README.md +8 -26
  2. package/lib/commonjs/core/OxyServices.base.js.map +1 -1
  3. package/lib/commonjs/core/mixins/OxyServices.user.js.map +1 -1
  4. package/lib/commonjs/core/mixins/OxyServices.utility.js.map +1 -1
  5. package/lib/commonjs/crypto/README.md +142 -0
  6. package/lib/commonjs/crypto/core.js +147 -0
  7. package/lib/commonjs/crypto/core.js.map +1 -0
  8. package/lib/commonjs/crypto/index.js +16 -0
  9. package/lib/commonjs/crypto/index.js.map +1 -1
  10. package/lib/commonjs/crypto/keyManager.js +19 -24
  11. package/lib/commonjs/crypto/keyManager.js.map +1 -1
  12. package/lib/commonjs/crypto/signatureService.js +116 -37
  13. package/lib/commonjs/crypto/signatureService.js.map +1 -1
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/models/interfaces.js +10 -11
  16. package/lib/commonjs/models/interfaces.js.map +1 -1
  17. package/lib/commonjs/node/index.js +10 -1
  18. package/lib/commonjs/node/index.js.map +1 -1
  19. package/lib/commonjs/node/signatureService.js +107 -0
  20. package/lib/commonjs/node/signatureService.js.map +1 -0
  21. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  22. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  23. package/lib/commonjs/ui/context/hooks/useLanguageManagement.js.map +1 -1
  24. package/lib/commonjs/ui/hooks/useLanguageManagement.js.map +1 -1
  25. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  26. package/lib/commonjs/ui/index.js +0 -2
  27. package/lib/commonjs/ui/index.js.map +1 -1
  28. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  29. package/lib/commonjs/ui/screens/OxyAuthScreen.js +13 -9
  30. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  31. package/lib/module/core/OxyServices.base.js.map +1 -1
  32. package/lib/module/core/mixins/OxyServices.user.js.map +1 -1
  33. package/lib/module/core/mixins/OxyServices.utility.js.map +1 -1
  34. package/lib/module/crypto/README.md +142 -0
  35. package/lib/module/crypto/core.js +133 -0
  36. package/lib/module/crypto/core.js.map +1 -0
  37. package/lib/module/crypto/index.js +3 -9
  38. package/lib/module/crypto/index.js.map +1 -1
  39. package/lib/module/crypto/keyManager.js +19 -24
  40. package/lib/module/crypto/keyManager.js.map +1 -1
  41. package/lib/module/crypto/signatureService.js +113 -33
  42. package/lib/module/crypto/signatureService.js.map +1 -1
  43. package/lib/module/index.js +0 -1
  44. package/lib/module/index.js.map +1 -1
  45. package/lib/module/models/interfaces.js +10 -11
  46. package/lib/module/models/interfaces.js.map +1 -1
  47. package/lib/module/node/index.js +3 -0
  48. package/lib/module/node/index.js.map +1 -1
  49. package/lib/module/node/signatureService.js +101 -0
  50. package/lib/module/node/signatureService.js.map +1 -0
  51. package/lib/module/ui/context/OxyContext.js.map +1 -1
  52. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  53. package/lib/module/ui/context/hooks/useLanguageManagement.js.map +1 -1
  54. package/lib/module/ui/hooks/useLanguageManagement.js.map +1 -1
  55. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  56. package/lib/module/ui/index.js +0 -1
  57. package/lib/module/ui/index.js.map +1 -1
  58. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  59. package/lib/module/ui/screens/OxyAuthScreen.js +9 -7
  60. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  61. package/lib/typescript/core/OxyServices.base.d.ts.map +1 -1
  62. package/lib/typescript/core/mixins/OxyServices.analytics.d.ts.map +1 -1
  63. package/lib/typescript/core/mixins/OxyServices.assets.d.ts.map +1 -1
  64. package/lib/typescript/core/mixins/OxyServices.auth.d.ts +1 -1
  65. package/lib/typescript/core/mixins/OxyServices.auth.d.ts.map +1 -1
  66. package/lib/typescript/core/mixins/OxyServices.developer.d.ts.map +1 -1
  67. package/lib/typescript/core/mixins/OxyServices.devices.d.ts.map +1 -1
  68. package/lib/typescript/core/mixins/OxyServices.karma.d.ts.map +1 -1
  69. package/lib/typescript/core/mixins/OxyServices.language.d.ts.map +1 -1
  70. package/lib/typescript/core/mixins/OxyServices.location.d.ts.map +1 -1
  71. package/lib/typescript/core/mixins/OxyServices.payment.d.ts.map +1 -1
  72. package/lib/typescript/core/mixins/OxyServices.privacy.d.ts.map +1 -1
  73. package/lib/typescript/core/mixins/OxyServices.security.d.ts.map +1 -1
  74. package/lib/typescript/core/mixins/OxyServices.user.d.ts +1 -2
  75. package/lib/typescript/core/mixins/OxyServices.user.d.ts.map +1 -1
  76. package/lib/typescript/core/mixins/OxyServices.utility.d.ts.map +1 -1
  77. package/lib/typescript/core/mixins/index.d.ts +13 -13
  78. package/lib/typescript/core/mixins/index.d.ts.map +1 -1
  79. package/lib/typescript/core/services/SessionService.d.ts +1 -1
  80. package/lib/typescript/core/services/SessionService.d.ts.map +1 -1
  81. package/lib/typescript/crypto/core.d.ts +56 -0
  82. package/lib/typescript/crypto/core.d.ts.map +1 -0
  83. package/lib/typescript/crypto/index.d.ts +1 -9
  84. package/lib/typescript/crypto/index.d.ts.map +1 -1
  85. package/lib/typescript/crypto/keyManager.d.ts +13 -1
  86. package/lib/typescript/crypto/keyManager.d.ts.map +1 -1
  87. package/lib/typescript/crypto/signatureService.d.ts +15 -9
  88. package/lib/typescript/crypto/signatureService.d.ts.map +1 -1
  89. package/lib/typescript/index.d.ts +1 -1
  90. package/lib/typescript/index.d.ts.map +1 -1
  91. package/lib/typescript/models/interfaces.d.ts +68 -15
  92. package/lib/typescript/models/interfaces.d.ts.map +1 -1
  93. package/lib/typescript/node/index.d.ts +1 -0
  94. package/lib/typescript/node/index.d.ts.map +1 -1
  95. package/lib/typescript/node/signatureService.d.ts +55 -0
  96. package/lib/typescript/node/signatureService.d.ts.map +1 -0
  97. package/lib/typescript/ui/context/OxyContext.d.ts +1 -2
  98. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  99. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +1 -2
  100. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  101. package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts +1 -2
  102. package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts.map +1 -1
  103. package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts +1 -1
  104. package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  105. package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts +1 -1
  106. package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  107. package/lib/typescript/ui/hooks/useLanguageManagement.d.ts +1 -2
  108. package/lib/typescript/ui/hooks/useLanguageManagement.d.ts.map +1 -1
  109. package/lib/typescript/ui/hooks/useSessionManagement.d.ts +1 -2
  110. package/lib/typescript/ui/hooks/useSessionManagement.d.ts.map +1 -1
  111. package/lib/typescript/ui/index.d.ts +1 -1
  112. package/lib/typescript/ui/index.d.ts.map +1 -1
  113. package/lib/typescript/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  114. package/lib/typescript/ui/stores/authStore.d.ts +1 -1
  115. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
  116. package/lib/typescript/ui/utils/avatarUtils.d.ts +1 -1
  117. package/lib/typescript/ui/utils/avatarUtils.d.ts.map +1 -1
  118. package/package.json +6 -2
  119. package/src/core/OxyServices.base.ts +1 -2
  120. package/src/core/mixins/OxyServices.auth.ts +1 -1
  121. package/src/core/mixins/OxyServices.user.ts +1 -2
  122. package/src/core/mixins/OxyServices.utility.ts +1 -2
  123. package/src/core/services/SessionService.ts +1 -1
  124. package/src/crypto/README.md +142 -0
  125. package/src/crypto/__tests__/core.test.ts +203 -0
  126. package/src/crypto/core.ts +142 -0
  127. package/src/crypto/index.ts +3 -10
  128. package/src/crypto/keyManager.ts +25 -21
  129. package/src/crypto/signatureService.ts +137 -37
  130. package/src/index.ts +2 -1
  131. package/src/models/interfaces.ts +73 -21
  132. package/src/node/index.ts +3 -0
  133. package/src/node/signatureService.ts +126 -0
  134. package/src/ui/context/OxyContext.tsx +1 -2
  135. package/src/ui/context/hooks/useAuthOperations.ts +1 -2
  136. package/src/ui/context/hooks/useLanguageManagement.ts +1 -2
  137. package/src/ui/hooks/auth/index.ts +2 -0
  138. package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
  139. package/src/ui/hooks/mutations/useServicesMutations.ts +1 -1
  140. package/src/ui/hooks/queries/useAccountQueries.ts +1 -1
  141. package/src/ui/hooks/useLanguageManagement.ts +1 -2
  142. package/src/ui/hooks/useSessionManagement.ts +1 -2
  143. package/src/ui/index.ts +1 -2
  144. package/src/ui/screens/AccountSettingsScreen.tsx +6 -6
  145. package/src/ui/screens/AccountSwitcherScreen.tsx +1 -1
  146. package/src/ui/screens/OxyAuthScreen.tsx +9 -5
  147. package/src/ui/screens/ProfileScreen.tsx +1 -1
  148. package/src/ui/stores/authStore.ts +1 -1
  149. package/src/ui/types/navigation.ts +1 -1
  150. package/src/ui/utils/avatarUtils.ts +1 -1
  151. package/lib/commonjs/core/services/AuthService.js +0 -156
  152. package/lib/commonjs/core/services/AuthService.js.map +0 -1
  153. package/lib/commonjs/core/services/SessionTransportService.js +0 -64
  154. package/lib/commonjs/core/services/SessionTransportService.js.map +0 -1
  155. package/lib/commonjs/core/services/UserService.js +0 -123
  156. package/lib/commonjs/core/services/UserService.js.map +0 -1
  157. package/lib/commonjs/core/services/index.js +0 -34
  158. package/lib/commonjs/core/services/index.js.map +0 -1
  159. package/lib/module/core/services/AuthService.js +0 -151
  160. package/lib/module/core/services/AuthService.js.map +0 -1
  161. package/lib/module/core/services/SessionTransportService.js +0 -59
  162. package/lib/module/core/services/SessionTransportService.js.map +0 -1
  163. package/lib/module/core/services/UserService.js +0 -118
  164. package/lib/module/core/services/UserService.js.map +0 -1
  165. package/lib/module/core/services/index.js +0 -16
  166. package/lib/module/core/services/index.js.map +0 -1
  167. package/lib/typescript/core/services/AuthService.d.ts +0 -50
  168. package/lib/typescript/core/services/AuthService.d.ts.map +0 -1
  169. package/lib/typescript/core/services/SessionTransportService.d.ts +0 -31
  170. package/lib/typescript/core/services/SessionTransportService.d.ts.map +0 -1
  171. package/lib/typescript/core/services/UserService.d.ts +0 -39
  172. package/lib/typescript/core/services/UserService.d.ts.map +0 -1
  173. package/lib/typescript/core/services/index.d.ts +0 -13
  174. package/lib/typescript/core/services/index.d.ts.map +0 -1
  175. package/src/core/services/AuthService.ts +0 -153
  176. package/src/core/services/SessionTransportService.ts +0 -69
  177. package/src/core/services/UserService.ts +0 -125
  178. package/src/core/services/index.ts +0 -14
@@ -220,7 +220,7 @@ const OxyAuthScreen: React.FC<BaseScreenProps> = ({
220
220
 
221
221
  try {
222
222
  // Generate a unique session token for this auth request
223
- const sessionToken = await generateSessionToken();
223
+ const sessionToken = generateSessionToken();
224
224
  const expiresAt = Date.now() + AUTH_SESSION_EXPIRY_MS;
225
225
 
226
226
  // Register the auth session with the server
@@ -242,10 +242,14 @@ const OxyAuthScreen: React.FC<BaseScreenProps> = ({
242
242
  }
243
243
  }, [oxyServices, connectSocket]);
244
244
 
245
- // Generate a random session token using secure random bytes
246
- const generateSessionToken = async (): Promise<string> => {
247
- const { generateSessionToken: sharedGenerate } = await import('@oxyhq/shared');
248
- return sharedGenerate(32); // 32 bytes = 64 hex characters
245
+ // Generate a random session token
246
+ const generateSessionToken = (): string => {
247
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
248
+ let result = '';
249
+ for (let i = 0; i < 32; i++) {
250
+ result += chars.charAt(Math.floor(Math.random() * chars.length));
251
+ }
252
+ return result;
249
253
  };
250
254
 
251
255
  // Clean up on unmount
@@ -10,7 +10,7 @@ import { Ionicons } from '@expo/vector-icons';
10
10
  import { useI18n } from '../hooks/useI18n';
11
11
  import { useOxy } from '../context/OxyContext';
12
12
  import { logger } from '../../utils/loggerUtils';
13
- import type { User } from '@oxyhq/shared';
13
+ import type { User } from '../../models/interfaces';
14
14
  import { extractErrorMessage } from '../utils/errorHandlers';
15
15
 
16
16
  interface ProfileScreenProps extends BaseScreenProps {
@@ -1,5 +1,5 @@
1
1
  import { create } from 'zustand';
2
- import type { User } from '@oxyhq/shared';
2
+ import type { User } from '../../models/interfaces';
3
3
 
4
4
  export interface AuthState {
5
5
  user: User | null;
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode, RefObject } from 'react';
2
2
  import type { QueryClient } from '@tanstack/react-query';
3
3
  import type { RouteName } from '../navigation/routes';
4
- import type { User } from '@oxyhq/shared';
4
+ import type { User } from '../../models/interfaces';
5
5
  import type { ClientSession } from '../../models/session';
6
6
 
7
7
  // Re-export RouteName from routes for convenience
@@ -1,5 +1,5 @@
1
1
  import type { OxyServices } from '../../core';
2
- import type { User } from '@oxyhq/shared';
2
+ import type { User } from '../../models/interfaces';
3
3
  import { useAccountStore } from '../stores/accountStore';
4
4
  import { useAuthStore } from '../stores/authStore';
5
5
  import { QueryClient } from '@tanstack/react-query';
@@ -1,156 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.AuthService = void 0;
7
- var _HttpService = require("../HttpService");
8
- var _signatureService = require("../../crypto/signatureService");
9
- /**
10
- * Auth Service
11
- *
12
- * Handles authentication operations:
13
- * - Challenge retrieval
14
- * - Signing orchestration (delegated to Accounts/KeyManager)
15
- * - Session verification
16
- * - Access token retrieval
17
- * - Registration
18
- */
19
-
20
- class AuthService {
21
- constructor(config) {
22
- this.httpService = new _HttpService.HttpService(config);
23
- }
24
-
25
- /**
26
- * Check if a public key is registered on the server
27
- */
28
- async checkPublicKeyRegistered(publicKey) {
29
- try {
30
- return await this.httpService.request({
31
- method: 'GET',
32
- url: `/api/auth/check-publickey?publicKey=${encodeURIComponent(publicKey)}`,
33
- cache: true,
34
- cacheTTL: 2 * 60 * 1000
35
- });
36
- } catch (error) {
37
- throw error;
38
- }
39
- }
40
-
41
- /**
42
- * Request an authentication challenge
43
- */
44
- async requestChallenge(publicKey) {
45
- try {
46
- return await this.httpService.request({
47
- method: 'POST',
48
- url: '/api/auth/challenge',
49
- data: {
50
- publicKey
51
- },
52
- cache: false
53
- });
54
- } catch (error) {
55
- throw error;
56
- }
57
- }
58
-
59
- /**
60
- * Verify a challenge and authenticate (creates session)
61
- * This orchestrates signing via SignatureService (which uses KeyManager)
62
- */
63
- async verifyChallenge(challenge) {
64
- try {
65
- // Sign the challenge using SignatureService (requires private key)
66
- const signedChallenge = await _signatureService.SignatureService.signChallenge(challenge);
67
-
68
- // Verify challenge and get session
69
- return await this.httpService.request({
70
- method: 'POST',
71
- url: '/api/auth/verify',
72
- data: {
73
- publicKey: signedChallenge.publicKey,
74
- challenge: challenge,
75
- signature: signedChallenge.challenge,
76
- timestamp: signedChallenge.timestamp
77
- },
78
- cache: false
79
- });
80
- } catch (error) {
81
- throw error;
82
- }
83
- }
84
-
85
- /**
86
- * Register a new identity with the server
87
- */
88
- async register(publicKey, signature, timestamp, username, email) {
89
- try {
90
- return await this.httpService.request({
91
- method: 'POST',
92
- url: '/api/auth/register',
93
- data: {
94
- publicKey,
95
- signature,
96
- timestamp,
97
- username,
98
- email
99
- },
100
- cache: false
101
- });
102
- } catch (error) {
103
- throw error;
104
- }
105
- }
106
-
107
- /**
108
- * Register using current identity (signs automatically)
109
- */
110
- async registerCurrentIdentity(username, email) {
111
- try {
112
- const {
113
- signature,
114
- publicKey,
115
- timestamp
116
- } = await _signatureService.SignatureService.createRegistrationSignature();
117
- return this.register(publicKey, signature, timestamp, username, email);
118
- } catch (error) {
119
- throw error;
120
- }
121
- }
122
-
123
- /**
124
- * Get user by public key
125
- */
126
- async getUserByPublicKey(publicKey) {
127
- try {
128
- return await this.httpService.request({
129
- method: 'GET',
130
- url: `/api/auth/user/${encodeURIComponent(publicKey)}`,
131
- cache: true,
132
- cacheTTL: 2 * 60 * 1000
133
- });
134
- } catch (error) {
135
- throw error;
136
- }
137
- }
138
-
139
- /**
140
- * Get user by session ID
141
- */
142
- async getUserBySession(sessionId) {
143
- try {
144
- return await this.httpService.request({
145
- method: 'GET',
146
- url: `/api/auth/user/session/${encodeURIComponent(sessionId)}`,
147
- cache: true,
148
- cacheTTL: 2 * 60 * 1000
149
- });
150
- } catch (error) {
151
- throw error;
152
- }
153
- }
154
- }
155
- exports.AuthService = AuthService;
156
- //# sourceMappingURL=AuthService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_HttpService","require","_signatureService","AuthService","constructor","config","httpService","HttpService","checkPublicKeyRegistered","publicKey","request","method","url","encodeURIComponent","cache","cacheTTL","error","requestChallenge","data","verifyChallenge","challenge","signedChallenge","SignatureService","signChallenge","signature","timestamp","register","username","email","registerCurrentIdentity","createRegistrationSignature","getUserByPublicKey","getUserBySession","sessionId","exports"],"sourceRoot":"../../../../src","sources":["core/services/AuthService.ts"],"mappings":";;;;;;AAaA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYO,MAAME,WAAW,CAAC;EAGvBC,WAAWA,CAACC,MAAiB,EAAE;IAC7B,IAAI,CAACC,WAAW,GAAG,IAAIC,wBAAW,CAACF,MAAM,CAAC;EAC5C;;EAEA;AACF;AACA;EACE,MAAMG,wBAAwBA,CAACC,SAAiB,EAAmC;IACjF,IAAI;MACF,OAAO,MAAM,IAAI,CAACH,WAAW,CAACI,OAAO,CAAyB;QAC5DC,MAAM,EAAE,KAAK;QACbC,GAAG,EAAE,uCAAuCC,kBAAkB,CAACJ,SAAS,CAAC,EAAE;QAC3EK,KAAK,EAAE,IAAI;QACXC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG;MACrB,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;M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,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SessionTransportService = void 0;
7
- var _shared = require("@oxyhq/shared");
8
- /**
9
- * Session Transport Service
10
- *
11
- * Uses shared transport abstraction for WebSocket/SSE/polling
12
- * Provides unified interface for session status updates
13
- */
14
-
15
- class SessionTransportService {
16
- transport = null;
17
- constructor(config) {
18
- this.config = config;
19
- }
20
-
21
- /**
22
- * Connect to session status updates
23
- * Automatically chooses best available transport (WebSocket > SSE > Polling)
24
- */
25
- async connect(sessionToken, callbacks) {
26
- const transportConfig = {
27
- baseURL: this.config.baseURL,
28
- namespace: 'auth-session',
29
- sessionToken,
30
- pollingInterval: 3000,
31
- // 3 seconds
32
- reconnectAttempts: 3,
33
- reconnectDelay: 1000
34
- };
35
- this.transport = await _shared.TransportFactory.create(transportConfig, callbacks);
36
- await this.transport.connect();
37
- }
38
-
39
- /**
40
- * Disconnect from session updates
41
- */
42
- disconnect() {
43
- if (this.transport) {
44
- this.transport.disconnect();
45
- this.transport = null;
46
- }
47
- }
48
-
49
- /**
50
- * Check if currently connected
51
- */
52
- isConnected() {
53
- return this.transport?.isConnected() ?? false;
54
- }
55
-
56
- /**
57
- * Get the transport type being used
58
- */
59
- getTransportType() {
60
- return this.transport?.getType() ?? 'none';
61
- }
62
- }
63
- exports.SessionTransportService = SessionTransportService;
64
- //# sourceMappingURL=SessionTransportService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_shared","require","SessionTransportService","transport","constructor","config","connect","sessionToken","callbacks","transportConfig","baseURL","namespace","pollingInterval","reconnectAttempts","reconnectDelay","TransportFactory","create","disconnect","isConnected","getTransportType","getType","exports"],"sourceRoot":"../../../../src","sources":["core/services/SessionTransportService.ts"],"mappings":";;;;;;AAQA,IAAAA,OAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AACA;;AAUO,MAAMC,uBAAuB,CAAC;EAC3BC,SAAS,GAAQ,IAAI;EAG7BC,WAAWA,CAACC,MAAiB,EAAE;IAC7B,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;;EAEA;AACF;AACA;AACA;EACE,MAAMC,OAAOA,CACXC,YAAoB,EACpBC,SAA6B,EACd;IACf,MAAMC,eAAgC,GAAG;MACvCC,OAAO,EAAE,IAAI,CAACL,MAAM,CAACK,OAAO;MAC5BC,SAAS,EAAE,cAAc;MACzBJ,YAAY;MACZK,eAAe,EAAE,IAAI;MAAE;MACvBC,iBAAiB,EAAE,CAAC;MACpBC,cAAc,EAAE;IAClB,CAAC;IAED,IAAI,CAACX,SAAS,GAAG,MAAMY,wBAAgB,CAACC,MAAM,CAACP,eAAe,EAAED,SAAS,CAAC;IAC1E,MAAM,IAAI,CAACL,SAAS,CAACG,OAAO,CAAC,CAAC;EAChC;;EAEA;AACF;AACA;EACEW,UAAUA,CAAA,EAAS;IACjB,IAAI,IAAI,CAACd,SAAS,EAAE;MAClB,IAAI,CAACA,SAAS,CAACc,UAAU,CAAC,CAAC;MAC3B,IAAI,CAACd,SAAS,GAAG,IAAI;IACvB;EACF;;EAEA;AACF;AACA;EACEe,WAAWA,CAAA,EAAY;IACrB,OAAO,IAAI,CAACf,SAAS,EAAEe,WAAW,CAAC,CAAC,IAAI,KAAK;EAC/C;;EAEA;AACF;AACA;EACEC,gBAAgBA,CAAA,EAAW;IACzB,OAAO,IAAI,CAAChB,SAAS,EAAEiB,OAAO,CAAC,CAAC,IAAI,MAAM;EAC5C;AACF;AAACC,OAAA,CAAAnB,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -1,123 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UserService = void 0;
7
- var _HttpService = require("../HttpService");
8
- /**
9
- * User Service
10
- *
11
- * Handles user profile operations (no key handling):
12
- * - Profile fetch/update
13
- * - Profile search
14
- * - User recommendations
15
- */
16
-
17
- class UserService {
18
- constructor(config) {
19
- this.httpService = new _HttpService.HttpService(config);
20
- }
21
-
22
- /**
23
- * Get user profile by ID
24
- */
25
- async getUserById(userId) {
26
- try {
27
- return await this.httpService.request({
28
- method: 'GET',
29
- url: `/api/profiles/${userId}`,
30
- cache: true,
31
- cacheTTL: 5 * 60 * 1000
32
- });
33
- } catch (error) {
34
- throw error;
35
- }
36
- }
37
-
38
- /**
39
- * Get profile by username
40
- */
41
- async getProfileByUsername(username) {
42
- try {
43
- return await this.httpService.request({
44
- method: 'GET',
45
- url: `/api/profiles/username/${username}`,
46
- cache: true,
47
- cacheTTL: 5 * 60 * 1000
48
- });
49
- } catch (error) {
50
- throw error;
51
- }
52
- }
53
-
54
- /**
55
- * Search user profiles
56
- */
57
- async searchProfiles(query, pagination) {
58
- try {
59
- const params = new URLSearchParams();
60
- params.set('query', query);
61
- if (pagination?.limit) params.set('limit', pagination.limit.toString());
62
- if (pagination?.offset) params.set('offset', pagination.offset.toString());
63
- const response = await this.httpService.request({
64
- method: 'GET',
65
- url: `/api/profiles/search?${params.toString()}`,
66
- cache: true,
67
- cacheTTL: 2 * 60 * 1000
68
- });
69
-
70
- // Handle response format
71
- if (Array.isArray(response)) {
72
- const limit = pagination?.limit ?? response.length;
73
- const paginationInfo = {
74
- total: response.length,
75
- limit,
76
- offset: pagination?.offset ?? 0,
77
- hasMore: limit > 0 && response.length === limit
78
- };
79
- return {
80
- data: response,
81
- pagination: paginationInfo
82
- };
83
- }
84
- return response;
85
- } catch (error) {
86
- throw error;
87
- }
88
- }
89
-
90
- /**
91
- * Get profile recommendations
92
- */
93
- async getProfileRecommendations() {
94
- try {
95
- return await this.httpService.request({
96
- method: 'GET',
97
- url: '/api/profiles/recommendations',
98
- cache: true,
99
- cacheTTL: 5 * 60 * 1000
100
- });
101
- } catch (error) {
102
- throw error;
103
- }
104
- }
105
-
106
- /**
107
- * Update user profile
108
- */
109
- async updateProfile(updates) {
110
- try {
111
- return await this.httpService.request({
112
- method: 'PATCH',
113
- url: '/api/profiles/me',
114
- data: updates,
115
- cache: false
116
- });
117
- } catch (error) {
118
- throw error;
119
- }
120
- }
121
- }
122
- exports.UserService = UserService;
123
- //# sourceMappingURL=UserService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_HttpService","require","UserService","constructor","config","httpService","HttpService","getUserById","userId","request","method","url","cache","cacheTTL","error","getProfileByUsername","username","searchProfiles","query","pagination","params","URLSearchParams","set","limit","toString","offset","response","Array","isArray","length","paginationInfo","total","hasMore","data","getProfileRecommendations","updateProfile","updates","exports"],"sourceRoot":"../../../../src","sources":["core/services/UserService.ts"],"mappings":";;;;;;AAWA,IAAAA,YAAA,GAAAC,OAAA;AAXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWO,MAAMC,WAAW,CAAC;EAGvBC,WAAWA,CAACC,MAAiB,EAAE;IAC7B,IAAI,CAACC,WAAW,GAAG,IAAIC,wBAAW,CAACF,MAAM,CAAC;EAC5C;;EAEA;AACF;AACA;EACE,MAAMG,WAAWA,CAACC,MAAc,EAAiB;IAC/C,IAAI;MACF,OAAO,MAAM,IAAI,CAACH,WAAW,CAACI,OAAO,CAAO;QAC1CC,MAAM,EAAE,KAAK;QACbC,GAAG,EAAE,iBAAiBH,MAAM,EAAE;QAC9BI,KAAK,EAAE,IAAI;QACXC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG;MACrB,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd,MAAMA,KAAK;IACb;EACF;;EAEA;AACF;AACA;EACE,MAAMC,oBAAoBA,CAACC,QAAgB,EAAiB;IAC1D,IAAI;MACF,OAAO,MAAM,IAAI,CAACX,WAAW,CAACI,OAAO,CAAO;QAC1CC,MAAM,EAAE,KAAK;QACbC,GAAG,EAAE,0BAA0BK,QAAQ,EAAE;QACzCJ,KAAK,EAAE,IAAI;QACXC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG;MACrB,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd,MAAMA,KAAK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F;AACA;EACE,MAAMoB,yBAAyBA,CAAA,EAAoB;IACjD,IAAI;MACF,OAAO,MAAM,IAAI,CAAC7B,WAAW,CAACI,OAAO,CAAS;QAC5CC,MAAM,EAAE,KAAK;QACbC,GAAG,EAAE,+BAA+B;QACpCC,KAAK,EAAE,IAAI;QACXC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG;MACrB,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd,MAAMA,KAAK;IACb;EACF;;EAEA;AACF;AACA;EACE,MAAMqB,aAAaA,CAACC,OAAsB,EAAiB;IACzD,IAAI;MACF,OAAO,MAAM,IAAI,CAAC/B,WAAW,CAACI,OAAO,CAAO;QAC1CC,MAAM,EAAE,OAAO;QACfC,GAAG,EAAE,kBAAkB;QACvBsB,IAAI,EAAEG,OAAO;QACbxB,KAAK,EAAE;MACT,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOE,KAAK,EAAE;MACd,MAAMA,KAAK;IACb;EACF;AACF;AAACuB,OAAA,CAAAnC,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "AuthService", {
7
- enumerable: true,
8
- get: function () {
9
- return _AuthService.AuthService;
10
- }
11
- });
12
- Object.defineProperty(exports, "UserService", {
13
- enumerable: true,
14
- get: function () {
15
- return _UserService.UserService;
16
- }
17
- });
18
- Object.defineProperty(exports, "sessionService", {
19
- enumerable: true,
20
- get: function () {
21
- return _SessionService.sessionService;
22
- }
23
- });
24
- Object.defineProperty(exports, "tokenService", {
25
- enumerable: true,
26
- get: function () {
27
- return _TokenService.tokenService;
28
- }
29
- });
30
- var _AuthService = require("./AuthService");
31
- var _SessionService = require("./SessionService");
32
- var _UserService = require("./UserService");
33
- var _TokenService = require("./TokenService");
34
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_AuthService","require","_SessionService","_UserService","_TokenService"],"sourceRoot":"../../../../src","sources":["core/services/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA","ignoreList":[]}
@@ -1,151 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Auth Service
5
- *
6
- * Handles authentication operations:
7
- * - Challenge retrieval
8
- * - Signing orchestration (delegated to Accounts/KeyManager)
9
- * - Session verification
10
- * - Access token retrieval
11
- * - Registration
12
- */
13
-
14
- import { HttpService } from '../HttpService';
15
- import { SignatureService } from '../../crypto/signatureService';
16
- export class AuthService {
17
- constructor(config) {
18
- this.httpService = new HttpService(config);
19
- }
20
-
21
- /**
22
- * Check if a public key is registered on the server
23
- */
24
- async checkPublicKeyRegistered(publicKey) {
25
- try {
26
- return await this.httpService.request({
27
- method: 'GET',
28
- url: `/api/auth/check-publickey?publicKey=${encodeURIComponent(publicKey)}`,
29
- cache: true,
30
- cacheTTL: 2 * 60 * 1000
31
- });
32
- } catch (error) {
33
- throw error;
34
- }
35
- }
36
-
37
- /**
38
- * Request an authentication challenge
39
- */
40
- async requestChallenge(publicKey) {
41
- try {
42
- return await this.httpService.request({
43
- method: 'POST',
44
- url: '/api/auth/challenge',
45
- data: {
46
- publicKey
47
- },
48
- cache: false
49
- });
50
- } catch (error) {
51
- throw error;
52
- }
53
- }
54
-
55
- /**
56
- * Verify a challenge and authenticate (creates session)
57
- * This orchestrates signing via SignatureService (which uses KeyManager)
58
- */
59
- async verifyChallenge(challenge) {
60
- try {
61
- // Sign the challenge using SignatureService (requires private key)
62
- const signedChallenge = await SignatureService.signChallenge(challenge);
63
-
64
- // Verify challenge and get session
65
- return await this.httpService.request({
66
- method: 'POST',
67
- url: '/api/auth/verify',
68
- data: {
69
- publicKey: signedChallenge.publicKey,
70
- challenge: challenge,
71
- signature: signedChallenge.challenge,
72
- timestamp: signedChallenge.timestamp
73
- },
74
- cache: false
75
- });
76
- } catch (error) {
77
- throw error;
78
- }
79
- }
80
-
81
- /**
82
- * Register a new identity with the server
83
- */
84
- async register(publicKey, signature, timestamp, username, email) {
85
- try {
86
- return await this.httpService.request({
87
- method: 'POST',
88
- url: '/api/auth/register',
89
- data: {
90
- publicKey,
91
- signature,
92
- timestamp,
93
- username,
94
- email
95
- },
96
- cache: false
97
- });
98
- } catch (error) {
99
- throw error;
100
- }
101
- }
102
-
103
- /**
104
- * Register using current identity (signs automatically)
105
- */
106
- async registerCurrentIdentity(username, email) {
107
- try {
108
- const {
109
- signature,
110
- publicKey,
111
- timestamp
112
- } = await SignatureService.createRegistrationSignature();
113
- return this.register(publicKey, signature, timestamp, username, email);
114
- } catch (error) {
115
- throw error;
116
- }
117
- }
118
-
119
- /**
120
- * Get user by public key
121
- */
122
- async getUserByPublicKey(publicKey) {
123
- try {
124
- return await this.httpService.request({
125
- method: 'GET',
126
- url: `/api/auth/user/${encodeURIComponent(publicKey)}`,
127
- cache: true,
128
- cacheTTL: 2 * 60 * 1000
129
- });
130
- } catch (error) {
131
- throw error;
132
- }
133
- }
134
-
135
- /**
136
- * Get user by session ID
137
- */
138
- async getUserBySession(sessionId) {
139
- try {
140
- return await this.httpService.request({
141
- method: 'GET',
142
- url: `/api/auth/user/session/${encodeURIComponent(sessionId)}`,
143
- cache: true,
144
- cacheTTL: 2 * 60 * 1000
145
- });
146
- } catch (error) {
147
- throw error;
148
- }
149
- }
150
- }
151
- //# sourceMappingURL=AuthService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["HttpService","SignatureService","AuthService","constructor","config","httpService","checkPublicKeyRegistered","publicKey","request","method","url","encodeURIComponent","cache","cacheTTL","error","requestChallenge","data","verifyChallenge","challenge","signedChallenge","signChallenge","signature","timestamp","register","username","email","registerCurrentIdentity","createRegistrationSignature","getUserByPublicKey","getUserBySession","sessionId"],"sourceRoot":"../../../../src","sources":["core/services/AuthService.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,gBAAgB,QAAQ,+BAA+B;AAOhE,OAAO,MAAMC,WAAW,CAAC;EAGvBC,WAAWA,CAACC,MAAiB,EAAE;IAC7B,IAAI,CAACC,WAAW,GAAG,IAAIL,WAAW,CAACI,MAAM,CAAC;EAC5C;;EAEA;AACF;AACA;EACE,MAAME,wBAAwBA,CAACC,SAAiB,EAAmC;IACjF,IAAI;MACF,OAAO,MAAM,IAAI,CAACF,WAAW,CAACG,OAAO,CAAyB;QAC5DC,MAAM,EAAE,KAAK;QACbC,GAAG,EAAE,uCAAuCC,kBAAkB,CAACJ,SAAS,CAAC,EAAE;QAC3EK,KAAK,EAAE,IAAI;QACXC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG;MACrB,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd,MAAMA,KAAK;IACb;EACF;;EAEA;AACF;AACA;EACE,MAAMC,gBAAgBA,CAACR,SAAiB,EAA6B;IACnE,IAAI;MACF,OAAO,MAAM,IAAI,CAACF,WAAW,CAACG,OAAO,CAAmB;QACtDC,MAAM,EAAE,MAAM;QACdC,GAAG,EAAE,qBAAqB;QAC1BM,IAAI,EAAE;UAAET;QAAU,CAAC;QACnBK,KAAK,EAAE;MACT,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOE,KAAK,EAAE;MACd,MAAMA,KAAK;IACb;EACF;;EAEA;AACF;AACA;AACA;EACE,MAAMG,eAAeA,CAACC,SAAiB,EAA0B;IAC/D,IAAI;MACF;MACA,MAAMC,eAAe,GAAG,MAAMlB,gBAAgB,CAACmB,aAAa,CAACF,SAAS,CAAC;;MAEvE;MACA,OAAO,MAAM,IAAI,CAACb,WAAW,CAACG,OAAO,CAAgB;QACnDC,MAAM,EAAE,MAAM;QACdC,GAA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,EAAE,kBAAkBC,kBAAkB,CAACJ,SAAS,CAAC,EAAE;QACtDK,KAAK,EAAE,IAAI;QACXC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG;MACrB,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd,MAAMA,KAAK;IACb;EACF;;EAEA;AACF;AACA;EACE,MAAMe,gBAAgBA,CAACC,SAAiB,EAAiB;IACvD,IAAI;MACF,OAAO,MAAM,IAAI,CAACzB,WAAW,CAACG,OAAO,CAAO;QAC1CC,MAAM,EAAE,KAAK;QACbC,GAAG,EAAE,0BAA0BC,kBAAkB,CAACmB,SAAS,CAAC,EAAE;QAC9DlB,KAAK,EAAE,IAAI;QACXC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG;MACrB,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd,MAAMA,KAAK;IACb;EACF;AACF","ignoreList":[]}
@@ -1,59 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Session Transport Service
5
- *
6
- * Uses shared transport abstraction for WebSocket/SSE/polling
7
- * Provides unified interface for session status updates
8
- */
9
-
10
- import { TransportFactory } from '@oxyhq/shared';
11
- export class SessionTransportService {
12
- transport = null;
13
- constructor(config) {
14
- this.config = config;
15
- }
16
-
17
- /**
18
- * Connect to session status updates
19
- * Automatically chooses best available transport (WebSocket > SSE > Polling)
20
- */
21
- async connect(sessionToken, callbacks) {
22
- const transportConfig = {
23
- baseURL: this.config.baseURL,
24
- namespace: 'auth-session',
25
- sessionToken,
26
- pollingInterval: 3000,
27
- // 3 seconds
28
- reconnectAttempts: 3,
29
- reconnectDelay: 1000
30
- };
31
- this.transport = await TransportFactory.create(transportConfig, callbacks);
32
- await this.transport.connect();
33
- }
34
-
35
- /**
36
- * Disconnect from session updates
37
- */
38
- disconnect() {
39
- if (this.transport) {
40
- this.transport.disconnect();
41
- this.transport = null;
42
- }
43
- }
44
-
45
- /**
46
- * Check if currently connected
47
- */
48
- isConnected() {
49
- return this.transport?.isConnected() ?? false;
50
- }
51
-
52
- /**
53
- * Get the transport type being used
54
- */
55
- getTransportType() {
56
- return this.transport?.getType() ?? 'none';
57
- }
58
- }
59
- //# sourceMappingURL=SessionTransportService.js.map