@oxyhq/services 5.16.35 → 5.16.37

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 (232) 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 -22
  11. package/lib/commonjs/crypto/keyManager.js.map +1 -1
  12. package/lib/commonjs/crypto/signatureService.js +116 -28
  13. package/lib/commonjs/crypto/signatureService.js.map +1 -1
  14. package/lib/commonjs/index.js +0 -12
  15. package/lib/commonjs/index.js.map +1 -1
  16. package/lib/commonjs/models/interfaces.js +10 -11
  17. package/lib/commonjs/models/interfaces.js.map +1 -1
  18. package/lib/commonjs/node/index.js +10 -1
  19. package/lib/commonjs/node/index.js.map +1 -1
  20. package/lib/commonjs/node/signatureService.js +107 -0
  21. package/lib/commonjs/node/signatureService.js.map +1 -0
  22. package/lib/commonjs/ui/context/OxyContext.js +23 -0
  23. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  24. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +29 -2
  25. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  26. package/lib/commonjs/ui/context/hooks/useLanguageManagement.js.map +1 -1
  27. package/lib/commonjs/ui/hooks/useLanguageManagement.js.map +1 -1
  28. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  29. package/lib/commonjs/ui/index.js +0 -2
  30. package/lib/commonjs/ui/index.js.map +1 -1
  31. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  32. package/lib/commonjs/ui/screens/OxyAuthScreen.js +11 -2
  33. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  34. package/lib/module/core/OxyServices.base.js.map +1 -1
  35. package/lib/module/core/mixins/OxyServices.user.js.map +1 -1
  36. package/lib/module/core/mixins/OxyServices.utility.js.map +1 -1
  37. package/lib/module/crypto/README.md +142 -0
  38. package/lib/module/crypto/core.js +133 -0
  39. package/lib/module/crypto/core.js.map +1 -0
  40. package/lib/module/crypto/index.js +3 -9
  41. package/lib/module/crypto/index.js.map +1 -1
  42. package/lib/module/crypto/keyManager.js +19 -22
  43. package/lib/module/crypto/keyManager.js.map +1 -1
  44. package/lib/module/crypto/signatureService.js +113 -23
  45. package/lib/module/crypto/signatureService.js.map +1 -1
  46. package/lib/module/index.js +0 -2
  47. package/lib/module/index.js.map +1 -1
  48. package/lib/module/models/interfaces.js +10 -11
  49. package/lib/module/models/interfaces.js.map +1 -1
  50. package/lib/module/node/index.js +3 -0
  51. package/lib/module/node/index.js.map +1 -1
  52. package/lib/module/node/signatureService.js +101 -0
  53. package/lib/module/node/signatureService.js.map +1 -0
  54. package/lib/module/ui/context/OxyContext.js +23 -0
  55. package/lib/module/ui/context/OxyContext.js.map +1 -1
  56. package/lib/module/ui/context/hooks/useAuthOperations.js +29 -2
  57. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  58. package/lib/module/ui/context/hooks/useLanguageManagement.js.map +1 -1
  59. package/lib/module/ui/hooks/useLanguageManagement.js.map +1 -1
  60. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  61. package/lib/module/ui/index.js +0 -1
  62. package/lib/module/ui/index.js.map +1 -1
  63. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  64. package/lib/module/ui/screens/OxyAuthScreen.js +11 -2
  65. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  66. package/lib/typescript/core/OxyServices.base.d.ts.map +1 -1
  67. package/lib/typescript/core/mixins/OxyServices.analytics.d.ts.map +1 -1
  68. package/lib/typescript/core/mixins/OxyServices.assets.d.ts.map +1 -1
  69. package/lib/typescript/core/mixins/OxyServices.auth.d.ts +1 -1
  70. package/lib/typescript/core/mixins/OxyServices.auth.d.ts.map +1 -1
  71. package/lib/typescript/core/mixins/OxyServices.developer.d.ts.map +1 -1
  72. package/lib/typescript/core/mixins/OxyServices.devices.d.ts.map +1 -1
  73. package/lib/typescript/core/mixins/OxyServices.karma.d.ts.map +1 -1
  74. package/lib/typescript/core/mixins/OxyServices.language.d.ts.map +1 -1
  75. package/lib/typescript/core/mixins/OxyServices.location.d.ts.map +1 -1
  76. package/lib/typescript/core/mixins/OxyServices.payment.d.ts.map +1 -1
  77. package/lib/typescript/core/mixins/OxyServices.privacy.d.ts.map +1 -1
  78. package/lib/typescript/core/mixins/OxyServices.security.d.ts.map +1 -1
  79. package/lib/typescript/core/mixins/OxyServices.user.d.ts +1 -2
  80. package/lib/typescript/core/mixins/OxyServices.user.d.ts.map +1 -1
  81. package/lib/typescript/core/mixins/OxyServices.utility.d.ts.map +1 -1
  82. package/lib/typescript/core/mixins/index.d.ts +13 -13
  83. package/lib/typescript/core/mixins/index.d.ts.map +1 -1
  84. package/lib/typescript/core/services/SessionService.d.ts +1 -1
  85. package/lib/typescript/core/services/SessionService.d.ts.map +1 -1
  86. package/lib/typescript/crypto/core.d.ts +56 -0
  87. package/lib/typescript/crypto/core.d.ts.map +1 -0
  88. package/lib/typescript/crypto/index.d.ts +1 -9
  89. package/lib/typescript/crypto/index.d.ts.map +1 -1
  90. package/lib/typescript/crypto/keyManager.d.ts +13 -1
  91. package/lib/typescript/crypto/keyManager.d.ts.map +1 -1
  92. package/lib/typescript/crypto/signatureService.d.ts +15 -9
  93. package/lib/typescript/crypto/signatureService.d.ts.map +1 -1
  94. package/lib/typescript/index.d.ts +1 -2
  95. package/lib/typescript/index.d.ts.map +1 -1
  96. package/lib/typescript/models/interfaces.d.ts +68 -15
  97. package/lib/typescript/models/interfaces.d.ts.map +1 -1
  98. package/lib/typescript/node/index.d.ts +1 -0
  99. package/lib/typescript/node/index.d.ts.map +1 -1
  100. package/lib/typescript/node/signatureService.d.ts +55 -0
  101. package/lib/typescript/node/signatureService.d.ts.map +1 -0
  102. package/lib/typescript/ui/context/OxyContext.d.ts +1 -2
  103. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  104. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +1 -2
  105. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  106. package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts +1 -2
  107. package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts.map +1 -1
  108. package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts +1 -1
  109. package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  110. package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts +1 -1
  111. package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  112. package/lib/typescript/ui/hooks/useLanguageManagement.d.ts +1 -2
  113. package/lib/typescript/ui/hooks/useLanguageManagement.d.ts.map +1 -1
  114. package/lib/typescript/ui/hooks/useSessionManagement.d.ts +1 -2
  115. package/lib/typescript/ui/hooks/useSessionManagement.d.ts.map +1 -1
  116. package/lib/typescript/ui/index.d.ts +1 -1
  117. package/lib/typescript/ui/index.d.ts.map +1 -1
  118. package/lib/typescript/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  119. package/lib/typescript/ui/stores/authStore.d.ts +1 -1
  120. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
  121. package/lib/typescript/ui/utils/avatarUtils.d.ts +1 -1
  122. package/lib/typescript/ui/utils/avatarUtils.d.ts.map +1 -1
  123. package/package.json +6 -1
  124. package/src/core/OxyServices.base.ts +1 -2
  125. package/src/core/mixins/OxyServices.auth.ts +1 -1
  126. package/src/core/mixins/OxyServices.user.ts +1 -2
  127. package/src/core/mixins/OxyServices.utility.ts +1 -2
  128. package/src/core/services/SessionService.ts +1 -1
  129. package/src/crypto/README.md +142 -0
  130. package/src/crypto/__tests__/core.test.ts +203 -0
  131. package/src/crypto/core.ts +142 -0
  132. package/src/crypto/index.ts +3 -10
  133. package/src/crypto/keyManager.ts +25 -21
  134. package/src/crypto/signatureService.ts +137 -36
  135. package/src/index.ts +2 -3
  136. package/src/models/interfaces.ts +73 -21
  137. package/src/node/index.ts +3 -0
  138. package/src/node/signatureService.ts +126 -0
  139. package/src/ui/context/OxyContext.tsx +26 -2
  140. package/src/ui/context/hooks/useAuthOperations.ts +33 -4
  141. package/src/ui/context/hooks/useLanguageManagement.ts +1 -2
  142. package/src/ui/hooks/auth/index.ts +2 -0
  143. package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
  144. package/src/ui/hooks/mutations/useServicesMutations.ts +1 -1
  145. package/src/ui/hooks/queries/useAccountQueries.ts +1 -1
  146. package/src/ui/hooks/useLanguageManagement.ts +1 -2
  147. package/src/ui/hooks/useSessionManagement.ts +1 -2
  148. package/src/ui/index.ts +1 -2
  149. package/src/ui/screens/AccountSettingsScreen.tsx +6 -6
  150. package/src/ui/screens/AccountSwitcherScreen.tsx +1 -1
  151. package/src/ui/screens/OxyAuthScreen.tsx +11 -2
  152. package/src/ui/screens/ProfileScreen.tsx +1 -1
  153. package/src/ui/stores/authStore.ts +1 -1
  154. package/src/ui/types/navigation.ts +1 -1
  155. package/src/ui/utils/avatarUtils.ts +1 -1
  156. package/lib/commonjs/core/services/AuthService.js +0 -156
  157. package/lib/commonjs/core/services/AuthService.js.map +0 -1
  158. package/lib/commonjs/core/services/SessionTransportService.js +0 -64
  159. package/lib/commonjs/core/services/SessionTransportService.js.map +0 -1
  160. package/lib/commonjs/core/services/UserService.js +0 -123
  161. package/lib/commonjs/core/services/UserService.js.map +0 -1
  162. package/lib/commonjs/core/services/index.js +0 -34
  163. package/lib/commonjs/core/services/index.js.map +0 -1
  164. package/lib/commonjs/shared/crypto/messageBuilders.js +0 -79
  165. package/lib/commonjs/shared/crypto/messageBuilders.js.map +0 -1
  166. package/lib/commonjs/shared/crypto/platform.js +0 -118
  167. package/lib/commonjs/shared/crypto/platform.js.map +0 -1
  168. package/lib/commonjs/shared/crypto/signature.js +0 -191
  169. package/lib/commonjs/shared/crypto/signature.js.map +0 -1
  170. package/lib/commonjs/shared/index.js +0 -94
  171. package/lib/commonjs/shared/index.js.map +0 -1
  172. package/lib/commonjs/shared/models/index.js +0 -2
  173. package/lib/commonjs/shared/models/index.js.map +0 -1
  174. package/lib/commonjs/shared/transport/index.js +0 -260
  175. package/lib/commonjs/shared/transport/index.js.map +0 -1
  176. package/lib/commonjs/shared/utils/index.js +0 -82
  177. package/lib/commonjs/shared/utils/index.js.map +0 -1
  178. package/lib/module/core/services/AuthService.js +0 -151
  179. package/lib/module/core/services/AuthService.js.map +0 -1
  180. package/lib/module/core/services/SessionTransportService.js +0 -59
  181. package/lib/module/core/services/SessionTransportService.js.map +0 -1
  182. package/lib/module/core/services/UserService.js +0 -118
  183. package/lib/module/core/services/UserService.js.map +0 -1
  184. package/lib/module/core/services/index.js +0 -16
  185. package/lib/module/core/services/index.js.map +0 -1
  186. package/lib/module/shared/crypto/messageBuilders.js +0 -70
  187. package/lib/module/shared/crypto/messageBuilders.js.map +0 -1
  188. package/lib/module/shared/crypto/platform.js +0 -112
  189. package/lib/module/shared/crypto/platform.js.map +0 -1
  190. package/lib/module/shared/crypto/signature.js +0 -186
  191. package/lib/module/shared/crypto/signature.js.map +0 -1
  192. package/lib/module/shared/index.js +0 -30
  193. package/lib/module/shared/index.js.map +0 -1
  194. package/lib/module/shared/models/index.js +0 -2
  195. package/lib/module/shared/models/index.js.map +0 -1
  196. package/lib/module/shared/transport/index.js +0 -254
  197. package/lib/module/shared/transport/index.js.map +0 -1
  198. package/lib/module/shared/utils/index.js +0 -74
  199. package/lib/module/shared/utils/index.js.map +0 -1
  200. package/lib/typescript/core/services/AuthService.d.ts +0 -50
  201. package/lib/typescript/core/services/AuthService.d.ts.map +0 -1
  202. package/lib/typescript/core/services/SessionTransportService.d.ts +0 -31
  203. package/lib/typescript/core/services/SessionTransportService.d.ts.map +0 -1
  204. package/lib/typescript/core/services/UserService.d.ts +0 -39
  205. package/lib/typescript/core/services/UserService.d.ts.map +0 -1
  206. package/lib/typescript/core/services/index.d.ts +0 -13
  207. package/lib/typescript/core/services/index.d.ts.map +0 -1
  208. package/lib/typescript/shared/crypto/messageBuilders.d.ts +0 -38
  209. package/lib/typescript/shared/crypto/messageBuilders.d.ts.map +0 -1
  210. package/lib/typescript/shared/crypto/platform.d.ts +0 -54
  211. package/lib/typescript/shared/crypto/platform.d.ts.map +0 -1
  212. package/lib/typescript/shared/crypto/signature.d.ts +0 -72
  213. package/lib/typescript/shared/crypto/signature.d.ts.map +0 -1
  214. package/lib/typescript/shared/index.d.ts +0 -20
  215. package/lib/typescript/shared/index.d.ts.map +0 -1
  216. package/lib/typescript/shared/models/index.d.ts +0 -163
  217. package/lib/typescript/shared/models/index.d.ts.map +0 -1
  218. package/lib/typescript/shared/transport/index.d.ts +0 -73
  219. package/lib/typescript/shared/transport/index.d.ts.map +0 -1
  220. package/lib/typescript/shared/utils/index.d.ts +0 -28
  221. package/lib/typescript/shared/utils/index.d.ts.map +0 -1
  222. package/src/core/services/AuthService.ts +0 -153
  223. package/src/core/services/SessionTransportService.ts +0 -69
  224. package/src/core/services/UserService.ts +0 -125
  225. package/src/core/services/index.ts +0 -14
  226. package/src/shared/crypto/messageBuilders.ts +0 -89
  227. package/src/shared/crypto/platform.ts +0 -140
  228. package/src/shared/crypto/signature.ts +0 -235
  229. package/src/shared/index.ts +0 -28
  230. package/src/shared/models/index.ts +0 -173
  231. package/src/shared/transport/index.ts +0 -349
  232. package/src/shared/utils/index.ts +0 -73
@@ -1,72 +0,0 @@
1
- /**
2
- * Signature Verification Service
3
- *
4
- * Unified signature verification used by both backend (API) and SDK.
5
- * Uses platform adapters for crypto operations while keeping message construction shared.
6
- */
7
- /**
8
- * Maximum age for signed messages (5 minutes)
9
- */
10
- export declare const MAX_SIGNATURE_AGE_MS: number;
11
- /**
12
- * Challenge TTL (5 minutes)
13
- */
14
- export declare const CHALLENGE_TTL_MS: number;
15
- /**
16
- * Signature Service
17
- * Provides signature verification that works across all platforms
18
- */
19
- export declare class SignatureService {
20
- /**
21
- * Verify an ECDSA signature
22
- *
23
- * @param message - The original message that was signed
24
- * @param signature - The signature in DER format (hex encoded)
25
- * @param publicKey - The public key (hex encoded, uncompressed)
26
- * @returns true if the signature is valid
27
- */
28
- static verify(message: string, signature: string, publicKey: string): Promise<boolean>;
29
- /**
30
- * Synchronous signature verification (Node.js only)
31
- * Uses Node.js crypto module directly for hashing
32
- */
33
- static verifySync(message: string, signature: string, publicKey: string): boolean;
34
- /**
35
- * Verify an authentication challenge response
36
- *
37
- * @param publicKey - The user's public key
38
- * @param challenge - The original challenge string
39
- * @param signature - The signature of the auth message
40
- * @param timestamp - The timestamp when the signature was created
41
- * @param maxAgeMs - Maximum age of the signature in milliseconds
42
- * @returns true if the challenge response is valid
43
- */
44
- static verifyChallengeResponse(publicKey: string, challenge: string, signature: string, timestamp: number, maxAgeMs?: number): Promise<boolean>;
45
- /**
46
- * Synchronous challenge response verification (Node.js only)
47
- */
48
- static verifyChallengeResponseSync(publicKey: string, challenge: string, signature: string, timestamp: number, maxAgeMs?: number): boolean;
49
- /**
50
- * Verify a registration signature
51
- * Signature format: oxy:register:{publicKey}:{timestamp}
52
- */
53
- static verifyRegistrationSignature(publicKey: string, signature: string, timestamp: number, maxAgeMs?: number): Promise<boolean>;
54
- /**
55
- * Synchronous registration signature verification (Node.js only)
56
- */
57
- static verifyRegistrationSignatureSync(publicKey: string, signature: string, timestamp: number, maxAgeMs?: number): boolean;
58
- /**
59
- * Verify a signed request
60
- * Used for authenticated API operations
61
- */
62
- static verifyRequestSignature(publicKey: string, data: Record<string, unknown>, signature: string, timestamp: number, maxAgeMs?: number): Promise<boolean>;
63
- /**
64
- * Synchronous request signature verification (Node.js only)
65
- */
66
- static verifyRequestSignatureSync(publicKey: string, data: Record<string, unknown>, signature: string, timestamp: number, maxAgeMs?: number): boolean;
67
- /**
68
- * Validate that a string is a valid public key
69
- */
70
- static isValidPublicKey(publicKey: string): boolean;
71
- }
72
- //# sourceMappingURL=signature.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../../../src/shared/crypto/signature.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH;;GAEG;AACH,eAAO,MAAM,oBAAoB,QAAgB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAgB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B;;;;;;;OAOG;WACU,MAAM,CACjB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC;IAWnB;;;OAGG;IACH,MAAM,CAAC,UAAU,CACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO;IAmBV;;;;;;;;;OASG;WACU,uBAAuB,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAAyB,GAClC,OAAO,CAAC,OAAO,CAAC;IAanB;;OAEG;IACH,MAAM,CAAC,2BAA2B,CAChC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAAyB,GAClC,OAAO;IAaV;;;OAGG;WACU,2BAA2B,CACtC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAA6B,GACtC,OAAO,CAAC,OAAO,CAAC;IAanB;;OAEG;IACH,MAAM,CAAC,+BAA+B,CACpC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAA6B,GACtC,OAAO;IAaV;;;OAGG;WACU,sBAAsB,CACjC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAA6B,GACtC,OAAO,CAAC,OAAO,CAAC;IAanB;;OAEG;IACH,MAAM,CAAC,0BAA0B,CAC/B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAA6B,GACtC,OAAO;IAaV;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;CAQpD"}
@@ -1,20 +0,0 @@
1
- /**
2
- * @oxyhq/shared
3
- *
4
- * Shared utilities, models, and crypto primitives for OxyHQ packages.
5
- *
6
- * This package provides:
7
- * - Canonical data models (User, Session, ChallengePayload, etc.)
8
- * - Unified signature verification across platforms
9
- * - Platform-agnostic crypto adapters
10
- * - Shared utility functions
11
- * - Canonical message builders for signing
12
- */
13
- export * from './models/index';
14
- export * from './crypto/signature';
15
- export * from './crypto/messageBuilders';
16
- export * from './crypto/platform';
17
- export { getCryptoAdapter, PlatformDetector } from './crypto/platform';
18
- export * from './utils/index';
19
- export * from './transport/index';
20
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,cAAc,gBAAgB,CAAC;AAG/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGvE,cAAc,eAAe,CAAC;AAG9B,cAAc,mBAAmB,CAAC"}
@@ -1,163 +0,0 @@
1
- /**
2
- * Shared Data Models
3
- *
4
- * Canonical TypeScript interfaces used across Accounts, Services SDK, and API packages.
5
- * These models eliminate type drift and ensure consistency across the monorepo.
6
- */
7
- /**
8
- * User Model
9
- *
10
- * IMPORTANT:
11
- * - id: MongoDB ObjectId (24 hex characters) - PRIMARY IDENTIFIER for all internal operations
12
- * - publicKey: Cryptographic public key (130 hex characters) - LOOKUP KEY for authentication and identity operations
13
- *
14
- * Never use publicKey as an ID. Always use id (ObjectId) for:
15
- * - Database queries
16
- * - Session userId
17
- * - Token userId
18
- * - Socket room names
19
- * - API route parameters (unless explicitly doing publicKey lookup)
20
- */
21
- export interface User {
22
- id: string;
23
- publicKey: string;
24
- username: string;
25
- email?: string;
26
- avatar?: string;
27
- privacySettings?: {
28
- [key: string]: unknown;
29
- };
30
- name?: {
31
- first?: string;
32
- last?: string;
33
- full?: string;
34
- [key: string]: unknown;
35
- };
36
- bio?: string;
37
- karma?: number;
38
- location?: string;
39
- website?: string;
40
- createdAt?: string;
41
- updatedAt?: string;
42
- links?: Array<{
43
- title?: string;
44
- description?: string;
45
- image?: string;
46
- link: string;
47
- }>;
48
- _count?: {
49
- followers?: number;
50
- following?: number;
51
- };
52
- accountExpiresAfterInactivityDays?: number | null;
53
- [key: string]: unknown;
54
- }
55
- /**
56
- * Session Model
57
- * Represents an authenticated session on a device
58
- */
59
- export interface Session {
60
- sessionId: string;
61
- userId: string;
62
- deviceId: string;
63
- deviceInfo?: {
64
- deviceName?: string;
65
- deviceType?: string;
66
- platform?: string;
67
- browser?: string;
68
- os?: string;
69
- ipAddress?: string;
70
- userAgent?: string;
71
- location?: string;
72
- fingerprint?: string;
73
- lastActive?: string | Date;
74
- };
75
- isActive: boolean;
76
- expiresAt: string | Date;
77
- lastActive?: string | Date;
78
- createdAt?: string | Date;
79
- updatedAt?: string | Date;
80
- }
81
- /**
82
- * Challenge Payload
83
- * Used in challenge-response authentication
84
- */
85
- export interface ChallengePayload {
86
- challenge: string;
87
- publicKey: string;
88
- expiresAt: string | Date;
89
- }
90
- /**
91
- * Signed Message
92
- * Represents a message with cryptographic signature
93
- */
94
- export interface SignedMessage {
95
- message: string;
96
- signature: string;
97
- publicKey: string;
98
- timestamp: number;
99
- }
100
- /**
101
- * Auth Challenge Response
102
- * Response to an authentication challenge
103
- */
104
- export interface AuthChallengeResponse {
105
- challenge: string;
106
- publicKey: string;
107
- signature: string;
108
- timestamp: number;
109
- }
110
- /**
111
- * Session Auth Response
112
- * Response from session authorization (SSO flow)
113
- */
114
- export interface SessionAuthResponse {
115
- sessionToken: string;
116
- status: 'pending' | 'authorized' | 'expired' | 'cancelled';
117
- accessToken?: string;
118
- refreshToken?: string;
119
- user?: User;
120
- expiresAt: string | Date;
121
- createdAt?: string | Date;
122
- }
123
- /**
124
- * Registration Request
125
- * Used when registering a new identity
126
- */
127
- export interface RegistrationRequest {
128
- publicKey: string;
129
- signature: string;
130
- timestamp: number;
131
- username?: string;
132
- email?: string;
133
- }
134
- /**
135
- * Login Response
136
- * Response from successful authentication
137
- */
138
- export interface LoginResponse {
139
- accessToken?: string;
140
- refreshToken?: string;
141
- token?: string;
142
- user: User;
143
- message?: string;
144
- }
145
- /**
146
- * Pagination Info
147
- * Standard pagination metadata
148
- */
149
- export interface PaginationInfo {
150
- total: number;
151
- limit: number;
152
- offset: number;
153
- hasMore: boolean;
154
- }
155
- /**
156
- * Search Profiles Response
157
- * Response from profile search with pagination
158
- */
159
- export interface SearchProfilesResponse {
160
- data: User[];
161
- pagination: PaginationInfo;
162
- }
163
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/models/index.ts"],"names":[],"mappings":"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"}
@@ -1,73 +0,0 @@
1
- /**
2
- * Transport Abstraction
3
- *
4
- * Unified transport layer for WebSocket, SSE, and polling.
5
- * Provides automatic fallback and unified configuration.
6
- */
7
- export type TransportType = 'websocket' | 'sse' | 'polling';
8
- export interface TransportConfig {
9
- baseURL: string;
10
- namespace?: string;
11
- sessionToken?: string;
12
- accessToken?: string;
13
- pollingInterval?: number;
14
- reconnectAttempts?: number;
15
- reconnectDelay?: number;
16
- timeout?: number;
17
- }
18
- export interface TransportUpdate {
19
- status: 'authorized' | 'cancelled' | 'expired' | 'pending';
20
- sessionId?: string;
21
- publicKey?: string;
22
- userId?: string;
23
- username?: string;
24
- [key: string]: unknown;
25
- }
26
- export interface TransportCallbacks {
27
- onUpdate?: (update: TransportUpdate) => void;
28
- onConnect?: () => void;
29
- onDisconnect?: () => void;
30
- onError?: (error: Error) => void;
31
- }
32
- /**
33
- * Transport Interface
34
- * All transport implementations must implement this
35
- */
36
- export interface Transport {
37
- /**
38
- * Connect to the transport
39
- */
40
- connect(): Promise<void>;
41
- /**
42
- * Disconnect from the transport
43
- */
44
- disconnect(): void;
45
- /**
46
- * Check if currently connected
47
- */
48
- isConnected(): boolean;
49
- /**
50
- * Get the transport type
51
- */
52
- getType(): TransportType;
53
- }
54
- /**
55
- * Transport Factory
56
- * Creates the appropriate transport based on availability and configuration
57
- */
58
- export declare class TransportFactory {
59
- /**
60
- * Create a transport with automatic fallback
61
- * Tries WebSocket first, then SSE, then polling
62
- */
63
- static create(config: TransportConfig, callbacks: TransportCallbacks): Promise<Transport>;
64
- /**
65
- * Check if WebSocket is available
66
- */
67
- private static isWebSocketAvailable;
68
- /**
69
- * Check if SSE is available
70
- */
71
- private static isSSEAvailable;
72
- }
73
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/transport/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,KAAK,GAAG,SAAS,CAAC;AAE5D,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB;;OAEG;IACH,UAAU,IAAI,IAAI,CAAC;IAEnB;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC;IAEvB;;OAEG;IACH,OAAO,IAAI,aAAa,CAAC;CAC1B;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B;;;OAGG;WACU,MAAM,CACjB,MAAM,EAAE,eAAe,EACvB,SAAS,EAAE,kBAAkB,GAC5B,OAAO,CAAC,SAAS,CAAC;IAuBrB;;OAEG;mBACkB,oBAAoB;IAKzC;;OAEG;mBACkB,cAAc;CAMpC"}
@@ -1,28 +0,0 @@
1
- /**
2
- * Shared Utilities
3
- *
4
- * Common utility functions used across Accounts, Services SDK, and API packages.
5
- */
6
- /**
7
- * Get a shortened display version of a public key
8
- * Format: first 8 chars ... last 8 chars
9
- */
10
- export declare function shortenPublicKey(publicKey: string): string;
11
- /**
12
- * Generate a secure random session token
13
- * Uses crypto.randomBytes (Node) or Web Crypto API (Browser/RN)
14
- */
15
- export declare function generateSessionToken(size?: number): Promise<string>;
16
- /**
17
- * Generate a session token synchronously (Node.js only)
18
- */
19
- export declare function generateSessionTokenSync(size?: number): string;
20
- /**
21
- * Convert bytes to hex string
22
- */
23
- export declare function bytesToHex(bytes: Uint8Array): string;
24
- /**
25
- * Convert hex string to bytes
26
- */
27
- export declare function hexToBytes(hex: string): Uint8Array;
28
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,GAAE,MAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB7E;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,GAAE,MAAW,GAAG,MAAM,CASlE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAMlD"}
@@ -1,153 +0,0 @@
1
- /**
2
- * Auth Service
3
- *
4
- * Handles authentication operations:
5
- * - Challenge retrieval
6
- * - Signing orchestration (delegated to Accounts/KeyManager)
7
- * - Session verification
8
- * - Access token retrieval
9
- * - Registration
10
- */
11
-
12
- import type { OxyConfig } from '../../models/interfaces';
13
- import type { User, LoginResponse, ChallengePayload } from '../../shared';
14
- import { HttpService } from '../HttpService';
15
- import { SignatureService } from '../../crypto/signatureService';
16
-
17
- export interface PublicKeyCheckResponse {
18
- registered: boolean;
19
- message: string;
20
- }
21
-
22
- export class AuthService {
23
- private httpService: HttpService;
24
-
25
- constructor(config: OxyConfig) {
26
- this.httpService = new HttpService(config);
27
- }
28
-
29
- /**
30
- * Check if a public key is registered on the server
31
- */
32
- async checkPublicKeyRegistered(publicKey: string): Promise<PublicKeyCheckResponse> {
33
- try {
34
- return await this.httpService.request<PublicKeyCheckResponse>({
35
- method: 'GET',
36
- url: `/api/auth/check-publickey?publicKey=${encodeURIComponent(publicKey)}`,
37
- cache: true,
38
- cacheTTL: 2 * 60 * 1000,
39
- });
40
- } catch (error) {
41
- throw error;
42
- }
43
- }
44
-
45
- /**
46
- * Request an authentication challenge
47
- */
48
- async requestChallenge(publicKey: string): Promise<ChallengePayload> {
49
- try {
50
- return await this.httpService.request<ChallengePayload>({
51
- method: 'POST',
52
- url: '/api/auth/challenge',
53
- data: { publicKey },
54
- cache: false,
55
- });
56
- } catch (error) {
57
- throw error;
58
- }
59
- }
60
-
61
- /**
62
- * Verify a challenge and authenticate (creates session)
63
- * This orchestrates signing via SignatureService (which uses KeyManager)
64
- */
65
- async verifyChallenge(challenge: string): Promise<LoginResponse> {
66
- try {
67
- // Sign the challenge using SignatureService (requires private key)
68
- const signedChallenge = await SignatureService.signChallenge(challenge);
69
-
70
- // Verify challenge and get session
71
- return await this.httpService.request<LoginResponse>({
72
- method: 'POST',
73
- url: '/api/auth/verify',
74
- data: {
75
- publicKey: signedChallenge.publicKey,
76
- challenge: challenge,
77
- signature: signedChallenge.challenge,
78
- timestamp: signedChallenge.timestamp,
79
- },
80
- cache: false,
81
- });
82
- } catch (error) {
83
- throw error;
84
- }
85
- }
86
-
87
- /**
88
- * Register a new identity with the server
89
- */
90
- async register(publicKey: string, signature: string, timestamp: number, username?: string, email?: string): Promise<User> {
91
- try {
92
- return await this.httpService.request<User>({
93
- method: 'POST',
94
- url: '/api/auth/register',
95
- data: {
96
- publicKey,
97
- signature,
98
- timestamp,
99
- username,
100
- email,
101
- },
102
- cache: false,
103
- });
104
- } catch (error) {
105
- throw error;
106
- }
107
- }
108
-
109
- /**
110
- * Register using current identity (signs automatically)
111
- */
112
- async registerCurrentIdentity(username?: string, email?: string): Promise<User> {
113
- try {
114
- const { signature, publicKey, timestamp } = await SignatureService.createRegistrationSignature();
115
- return this.register(publicKey, signature, timestamp, username, email);
116
- } catch (error) {
117
- throw error;
118
- }
119
- }
120
-
121
- /**
122
- * Get user by public key
123
- */
124
- async getUserByPublicKey(publicKey: string): Promise<User> {
125
- try {
126
- return await this.httpService.request<User>({
127
- method: 'GET',
128
- url: `/api/auth/user/${encodeURIComponent(publicKey)}`,
129
- cache: true,
130
- cacheTTL: 2 * 60 * 1000,
131
- });
132
- } catch (error) {
133
- throw error;
134
- }
135
- }
136
-
137
- /**
138
- * Get user by session ID
139
- */
140
- async getUserBySession(sessionId: string): Promise<User> {
141
- try {
142
- return await this.httpService.request<User>({
143
- method: 'GET',
144
- url: `/api/auth/user/session/${encodeURIComponent(sessionId)}`,
145
- cache: true,
146
- cacheTTL: 2 * 60 * 1000,
147
- });
148
- } catch (error) {
149
- throw error;
150
- }
151
- }
152
- }
153
-
@@ -1,69 +0,0 @@
1
- /**
2
- * Session Transport Service
3
- *
4
- * Uses shared transport abstraction for WebSocket/SSE/polling
5
- * Provides unified interface for session status updates
6
- */
7
-
8
- import type { OxyConfig } from '../../models/interfaces';
9
- import {
10
- TransportFactory,
11
- type TransportConfig,
12
- type TransportCallbacks,
13
- type TransportUpdate,
14
- } from '../../shared';
15
-
16
- export class SessionTransportService {
17
- private transport: any = null;
18
- private config: OxyConfig;
19
-
20
- constructor(config: OxyConfig) {
21
- this.config = config;
22
- }
23
-
24
- /**
25
- * Connect to session status updates
26
- * Automatically chooses best available transport (WebSocket > SSE > Polling)
27
- */
28
- async connect(
29
- sessionToken: string,
30
- callbacks: TransportCallbacks
31
- ): Promise<void> {
32
- const transportConfig: TransportConfig = {
33
- baseURL: this.config.baseURL,
34
- namespace: 'auth-session',
35
- sessionToken,
36
- pollingInterval: 3000, // 3 seconds
37
- reconnectAttempts: 3,
38
- reconnectDelay: 1000,
39
- };
40
-
41
- this.transport = await TransportFactory.create(transportConfig, callbacks);
42
- await this.transport.connect();
43
- }
44
-
45
- /**
46
- * Disconnect from session updates
47
- */
48
- disconnect(): void {
49
- if (this.transport) {
50
- this.transport.disconnect();
51
- this.transport = null;
52
- }
53
- }
54
-
55
- /**
56
- * Check if currently connected
57
- */
58
- isConnected(): boolean {
59
- return this.transport?.isConnected() ?? false;
60
- }
61
-
62
- /**
63
- * Get the transport type being used
64
- */
65
- getTransportType(): string {
66
- return this.transport?.getType() ?? 'none';
67
- }
68
- }
69
-