@oxyhq/services 5.16.35 → 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 (228) 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.map +1 -1
  23. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  24. package/lib/commonjs/ui/context/hooks/useLanguageManagement.js.map +1 -1
  25. package/lib/commonjs/ui/hooks/useLanguageManagement.js.map +1 -1
  26. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  27. package/lib/commonjs/ui/index.js +0 -2
  28. package/lib/commonjs/ui/index.js.map +1 -1
  29. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  30. package/lib/commonjs/ui/screens/OxyAuthScreen.js +11 -2
  31. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  32. package/lib/module/core/OxyServices.base.js.map +1 -1
  33. package/lib/module/core/mixins/OxyServices.user.js.map +1 -1
  34. package/lib/module/core/mixins/OxyServices.utility.js.map +1 -1
  35. package/lib/module/crypto/README.md +142 -0
  36. package/lib/module/crypto/core.js +133 -0
  37. package/lib/module/crypto/core.js.map +1 -0
  38. package/lib/module/crypto/index.js +3 -9
  39. package/lib/module/crypto/index.js.map +1 -1
  40. package/lib/module/crypto/keyManager.js +19 -22
  41. package/lib/module/crypto/keyManager.js.map +1 -1
  42. package/lib/module/crypto/signatureService.js +113 -23
  43. package/lib/module/crypto/signatureService.js.map +1 -1
  44. package/lib/module/index.js +0 -2
  45. package/lib/module/index.js.map +1 -1
  46. package/lib/module/models/interfaces.js +10 -11
  47. package/lib/module/models/interfaces.js.map +1 -1
  48. package/lib/module/node/index.js +3 -0
  49. package/lib/module/node/index.js.map +1 -1
  50. package/lib/module/node/signatureService.js +101 -0
  51. package/lib/module/node/signatureService.js.map +1 -0
  52. package/lib/module/ui/context/OxyContext.js.map +1 -1
  53. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  54. package/lib/module/ui/context/hooks/useLanguageManagement.js.map +1 -1
  55. package/lib/module/ui/hooks/useLanguageManagement.js.map +1 -1
  56. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  57. package/lib/module/ui/index.js +0 -1
  58. package/lib/module/ui/index.js.map +1 -1
  59. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  60. package/lib/module/ui/screens/OxyAuthScreen.js +11 -2
  61. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  62. package/lib/typescript/core/OxyServices.base.d.ts.map +1 -1
  63. package/lib/typescript/core/mixins/OxyServices.analytics.d.ts.map +1 -1
  64. package/lib/typescript/core/mixins/OxyServices.assets.d.ts.map +1 -1
  65. package/lib/typescript/core/mixins/OxyServices.auth.d.ts +1 -1
  66. package/lib/typescript/core/mixins/OxyServices.auth.d.ts.map +1 -1
  67. package/lib/typescript/core/mixins/OxyServices.developer.d.ts.map +1 -1
  68. package/lib/typescript/core/mixins/OxyServices.devices.d.ts.map +1 -1
  69. package/lib/typescript/core/mixins/OxyServices.karma.d.ts.map +1 -1
  70. package/lib/typescript/core/mixins/OxyServices.language.d.ts.map +1 -1
  71. package/lib/typescript/core/mixins/OxyServices.location.d.ts.map +1 -1
  72. package/lib/typescript/core/mixins/OxyServices.payment.d.ts.map +1 -1
  73. package/lib/typescript/core/mixins/OxyServices.privacy.d.ts.map +1 -1
  74. package/lib/typescript/core/mixins/OxyServices.security.d.ts.map +1 -1
  75. package/lib/typescript/core/mixins/OxyServices.user.d.ts +1 -2
  76. package/lib/typescript/core/mixins/OxyServices.user.d.ts.map +1 -1
  77. package/lib/typescript/core/mixins/OxyServices.utility.d.ts.map +1 -1
  78. package/lib/typescript/core/mixins/index.d.ts +13 -13
  79. package/lib/typescript/core/mixins/index.d.ts.map +1 -1
  80. package/lib/typescript/core/services/SessionService.d.ts +1 -1
  81. package/lib/typescript/core/services/SessionService.d.ts.map +1 -1
  82. package/lib/typescript/crypto/core.d.ts +56 -0
  83. package/lib/typescript/crypto/core.d.ts.map +1 -0
  84. package/lib/typescript/crypto/index.d.ts +1 -9
  85. package/lib/typescript/crypto/index.d.ts.map +1 -1
  86. package/lib/typescript/crypto/keyManager.d.ts +13 -1
  87. package/lib/typescript/crypto/keyManager.d.ts.map +1 -1
  88. package/lib/typescript/crypto/signatureService.d.ts +15 -9
  89. package/lib/typescript/crypto/signatureService.d.ts.map +1 -1
  90. package/lib/typescript/index.d.ts +1 -2
  91. package/lib/typescript/index.d.ts.map +1 -1
  92. package/lib/typescript/models/interfaces.d.ts +68 -15
  93. package/lib/typescript/models/interfaces.d.ts.map +1 -1
  94. package/lib/typescript/node/index.d.ts +1 -0
  95. package/lib/typescript/node/index.d.ts.map +1 -1
  96. package/lib/typescript/node/signatureService.d.ts +55 -0
  97. package/lib/typescript/node/signatureService.d.ts.map +1 -0
  98. package/lib/typescript/ui/context/OxyContext.d.ts +1 -2
  99. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  100. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +1 -2
  101. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  102. package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts +1 -2
  103. package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts.map +1 -1
  104. package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts +1 -1
  105. package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  106. package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts +1 -1
  107. package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  108. package/lib/typescript/ui/hooks/useLanguageManagement.d.ts +1 -2
  109. package/lib/typescript/ui/hooks/useLanguageManagement.d.ts.map +1 -1
  110. package/lib/typescript/ui/hooks/useSessionManagement.d.ts +1 -2
  111. package/lib/typescript/ui/hooks/useSessionManagement.d.ts.map +1 -1
  112. package/lib/typescript/ui/index.d.ts +1 -1
  113. package/lib/typescript/ui/index.d.ts.map +1 -1
  114. package/lib/typescript/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  115. package/lib/typescript/ui/stores/authStore.d.ts +1 -1
  116. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
  117. package/lib/typescript/ui/utils/avatarUtils.d.ts +1 -1
  118. package/lib/typescript/ui/utils/avatarUtils.d.ts.map +1 -1
  119. package/package.json +6 -1
  120. package/src/core/OxyServices.base.ts +1 -2
  121. package/src/core/mixins/OxyServices.auth.ts +1 -1
  122. package/src/core/mixins/OxyServices.user.ts +1 -2
  123. package/src/core/mixins/OxyServices.utility.ts +1 -2
  124. package/src/core/services/SessionService.ts +1 -1
  125. package/src/crypto/README.md +142 -0
  126. package/src/crypto/__tests__/core.test.ts +203 -0
  127. package/src/crypto/core.ts +142 -0
  128. package/src/crypto/index.ts +3 -10
  129. package/src/crypto/keyManager.ts +25 -21
  130. package/src/crypto/signatureService.ts +137 -36
  131. package/src/index.ts +2 -3
  132. package/src/models/interfaces.ts +73 -21
  133. package/src/node/index.ts +3 -0
  134. package/src/node/signatureService.ts +126 -0
  135. package/src/ui/context/OxyContext.tsx +1 -2
  136. package/src/ui/context/hooks/useAuthOperations.ts +1 -2
  137. package/src/ui/context/hooks/useLanguageManagement.ts +1 -2
  138. package/src/ui/hooks/auth/index.ts +2 -0
  139. package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
  140. package/src/ui/hooks/mutations/useServicesMutations.ts +1 -1
  141. package/src/ui/hooks/queries/useAccountQueries.ts +1 -1
  142. package/src/ui/hooks/useLanguageManagement.ts +1 -2
  143. package/src/ui/hooks/useSessionManagement.ts +1 -2
  144. package/src/ui/index.ts +1 -2
  145. package/src/ui/screens/AccountSettingsScreen.tsx +6 -6
  146. package/src/ui/screens/AccountSwitcherScreen.tsx +1 -1
  147. package/src/ui/screens/OxyAuthScreen.tsx +11 -2
  148. package/src/ui/screens/ProfileScreen.tsx +1 -1
  149. package/src/ui/stores/authStore.ts +1 -1
  150. package/src/ui/types/navigation.ts +1 -1
  151. package/src/ui/utils/avatarUtils.ts +1 -1
  152. package/lib/commonjs/core/services/AuthService.js +0 -156
  153. package/lib/commonjs/core/services/AuthService.js.map +0 -1
  154. package/lib/commonjs/core/services/SessionTransportService.js +0 -64
  155. package/lib/commonjs/core/services/SessionTransportService.js.map +0 -1
  156. package/lib/commonjs/core/services/UserService.js +0 -123
  157. package/lib/commonjs/core/services/UserService.js.map +0 -1
  158. package/lib/commonjs/core/services/index.js +0 -34
  159. package/lib/commonjs/core/services/index.js.map +0 -1
  160. package/lib/commonjs/shared/crypto/messageBuilders.js +0 -79
  161. package/lib/commonjs/shared/crypto/messageBuilders.js.map +0 -1
  162. package/lib/commonjs/shared/crypto/platform.js +0 -118
  163. package/lib/commonjs/shared/crypto/platform.js.map +0 -1
  164. package/lib/commonjs/shared/crypto/signature.js +0 -191
  165. package/lib/commonjs/shared/crypto/signature.js.map +0 -1
  166. package/lib/commonjs/shared/index.js +0 -94
  167. package/lib/commonjs/shared/index.js.map +0 -1
  168. package/lib/commonjs/shared/models/index.js +0 -2
  169. package/lib/commonjs/shared/models/index.js.map +0 -1
  170. package/lib/commonjs/shared/transport/index.js +0 -260
  171. package/lib/commonjs/shared/transport/index.js.map +0 -1
  172. package/lib/commonjs/shared/utils/index.js +0 -82
  173. package/lib/commonjs/shared/utils/index.js.map +0 -1
  174. package/lib/module/core/services/AuthService.js +0 -151
  175. package/lib/module/core/services/AuthService.js.map +0 -1
  176. package/lib/module/core/services/SessionTransportService.js +0 -59
  177. package/lib/module/core/services/SessionTransportService.js.map +0 -1
  178. package/lib/module/core/services/UserService.js +0 -118
  179. package/lib/module/core/services/UserService.js.map +0 -1
  180. package/lib/module/core/services/index.js +0 -16
  181. package/lib/module/core/services/index.js.map +0 -1
  182. package/lib/module/shared/crypto/messageBuilders.js +0 -70
  183. package/lib/module/shared/crypto/messageBuilders.js.map +0 -1
  184. package/lib/module/shared/crypto/platform.js +0 -112
  185. package/lib/module/shared/crypto/platform.js.map +0 -1
  186. package/lib/module/shared/crypto/signature.js +0 -186
  187. package/lib/module/shared/crypto/signature.js.map +0 -1
  188. package/lib/module/shared/index.js +0 -30
  189. package/lib/module/shared/index.js.map +0 -1
  190. package/lib/module/shared/models/index.js +0 -2
  191. package/lib/module/shared/models/index.js.map +0 -1
  192. package/lib/module/shared/transport/index.js +0 -254
  193. package/lib/module/shared/transport/index.js.map +0 -1
  194. package/lib/module/shared/utils/index.js +0 -74
  195. package/lib/module/shared/utils/index.js.map +0 -1
  196. package/lib/typescript/core/services/AuthService.d.ts +0 -50
  197. package/lib/typescript/core/services/AuthService.d.ts.map +0 -1
  198. package/lib/typescript/core/services/SessionTransportService.d.ts +0 -31
  199. package/lib/typescript/core/services/SessionTransportService.d.ts.map +0 -1
  200. package/lib/typescript/core/services/UserService.d.ts +0 -39
  201. package/lib/typescript/core/services/UserService.d.ts.map +0 -1
  202. package/lib/typescript/core/services/index.d.ts +0 -13
  203. package/lib/typescript/core/services/index.d.ts.map +0 -1
  204. package/lib/typescript/shared/crypto/messageBuilders.d.ts +0 -38
  205. package/lib/typescript/shared/crypto/messageBuilders.d.ts.map +0 -1
  206. package/lib/typescript/shared/crypto/platform.d.ts +0 -54
  207. package/lib/typescript/shared/crypto/platform.d.ts.map +0 -1
  208. package/lib/typescript/shared/crypto/signature.d.ts +0 -72
  209. package/lib/typescript/shared/crypto/signature.d.ts.map +0 -1
  210. package/lib/typescript/shared/index.d.ts +0 -20
  211. package/lib/typescript/shared/index.d.ts.map +0 -1
  212. package/lib/typescript/shared/models/index.d.ts +0 -163
  213. package/lib/typescript/shared/models/index.d.ts.map +0 -1
  214. package/lib/typescript/shared/transport/index.d.ts +0 -73
  215. package/lib/typescript/shared/transport/index.d.ts.map +0 -1
  216. package/lib/typescript/shared/utils/index.d.ts +0 -28
  217. package/lib/typescript/shared/utils/index.d.ts.map +0 -1
  218. package/src/core/services/AuthService.ts +0 -153
  219. package/src/core/services/SessionTransportService.ts +0 -69
  220. package/src/core/services/UserService.ts +0 -125
  221. package/src/core/services/index.ts +0 -14
  222. package/src/shared/crypto/messageBuilders.ts +0 -89
  223. package/src/shared/crypto/platform.ts +0 -140
  224. package/src/shared/crypto/signature.ts +0 -235
  225. package/src/shared/index.ts +0 -28
  226. package/src/shared/models/index.ts +0 -173
  227. package/src/shared/transport/index.ts +0 -349
  228. package/src/shared/utils/index.ts +0 -73
@@ -1 +0,0 @@
1
- {"version":3,"file":"SessionTransportService.d.ts","sourceRoot":"","sources":["../../../../src/core/services/SessionTransportService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,cAAc,CAAC;AAEtB,qBAAa,uBAAuB;IAClC,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,MAAM,CAAY;gBAEd,MAAM,EAAE,SAAS;IAI7B;;;OAGG;IACG,OAAO,CACX,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,kBAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC;IAchB;;OAEG;IACH,UAAU,IAAI,IAAI;IAOlB;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,gBAAgB,IAAI,MAAM;CAG3B"}
@@ -1,39 +0,0 @@
1
- /**
2
- * User Service
3
- *
4
- * Handles user profile operations (no key handling):
5
- * - Profile fetch/update
6
- * - Profile search
7
- * - User recommendations
8
- */
9
- import type { OxyConfig } from '../../models/interfaces';
10
- import type { User, SearchProfilesResponse } from '../../shared';
11
- export interface PaginationParams {
12
- limit?: number;
13
- offset?: number;
14
- }
15
- export declare class UserService {
16
- private httpService;
17
- constructor(config: OxyConfig);
18
- /**
19
- * Get user profile by ID
20
- */
21
- getUserById(userId: string): Promise<User>;
22
- /**
23
- * Get profile by username
24
- */
25
- getProfileByUsername(username: string): Promise<User>;
26
- /**
27
- * Search user profiles
28
- */
29
- searchProfiles(query: string, pagination?: PaginationParams): Promise<SearchProfilesResponse>;
30
- /**
31
- * Get profile recommendations
32
- */
33
- getProfileRecommendations(): Promise<User[]>;
34
- /**
35
- * Update user profile
36
- */
37
- updateProfile(updates: Partial<User>): Promise<User>;
38
- }
39
- //# sourceMappingURL=UserService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../../../src/core/services/UserService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAkB,MAAM,cAAc,CAAC;AAGjF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,WAAW,CAAc;gBAErB,MAAM,EAAE,SAAS;IAI7B;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAahD;;OAEG;IACG,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAa3D;;OAEG;IACG,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAgCnG;;OAEG;IACG,yBAAyB,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAalD;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAY3D"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Focused Services
3
- *
4
- * Single-responsibility services replacing the mixin pattern:
5
- * - AuthService: Authentication, challenges, registration
6
- * - SessionService: Session management (already exists)
7
- * - UserService: User profile operations
8
- */
9
- export { AuthService } from './AuthService';
10
- export { sessionService } from './SessionService';
11
- export { UserService } from './UserService';
12
- export { tokenService } from './TokenService';
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/services/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,38 +0,0 @@
1
- /**
2
- * Canonical Message Builders
3
- *
4
- * Creates standardized, canonical message formats for signing.
5
- * These formats are used consistently across Accounts, Services SDK, and API.
6
- */
7
- import type { AuthChallengeResponse } from '../models/index';
8
- /**
9
- * Build authentication message for challenge-response
10
- * Format: auth:{publicKey}:{challenge}:{timestamp}
11
- */
12
- export declare function buildAuthMessage(publicKey: string, challenge: string, timestamp: number): string;
13
- /**
14
- * Build registration message
15
- * Format: oxy:register:{publicKey}:{timestamp}
16
- */
17
- export declare function buildRegistrationMessage(publicKey: string, timestamp: number): string;
18
- /**
19
- * Build request signing message
20
- * Format: request:{publicKey}:{timestamp}:{canonicalData}
21
- */
22
- export declare function buildRequestMessage(publicKey: string, timestamp: number, data: Record<string, unknown>): string;
23
- /**
24
- * Create canonical data representation for signing
25
- * Sorts keys and creates a consistent string representation
26
- */
27
- export declare function canonicalizeData(data: Record<string, unknown>): string;
28
- /**
29
- * Build auth challenge response payload
30
- * Helper to construct the signed challenge response
31
- */
32
- export declare function buildAuthChallengeResponse(publicKey: string, challenge: string, signature: string, timestamp: number): AuthChallengeResponse;
33
- /**
34
- * Validate timestamp freshness
35
- * Ensures signed messages are not too old
36
- */
37
- export declare function isTimestampFresh(timestamp: number, maxAgeMs?: number): boolean;
38
- //# sourceMappingURL=messageBuilders.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"messageBuilders.d.ts","sourceRoot":"","sources":["../../../../src/shared/crypto/messageBuilders.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAiB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE5E;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CAER;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CAER;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,CAOR;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAItE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,qBAAqB,CAOvB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAAsB,GAC/B,OAAO,CAGT"}
@@ -1,54 +0,0 @@
1
- /**
2
- * Platform Detection and Adapters
3
- *
4
- * Provides environment detection and platform-specific crypto adapters
5
- * to support Node.js, React Native, and Web environments.
6
- */
7
- /**
8
- * Platform types
9
- */
10
- export type Platform = 'node' | 'react-native' | 'web';
11
- /**
12
- * Platform detection utilities
13
- */
14
- export declare const PlatformDetector: {
15
- /**
16
- * Detect current platform
17
- */
18
- detect(): Platform;
19
- /**
20
- * Check if running in Node.js
21
- */
22
- isNode(): boolean;
23
- /**
24
- * Check if running in React Native
25
- */
26
- isReactNative(): boolean;
27
- /**
28
- * Check if running in Web browser
29
- */
30
- isWeb(): boolean;
31
- };
32
- /**
33
- * Crypto adapter interface
34
- * Platform-specific implementations must implement this interface
35
- */
36
- export interface CryptoAdapter {
37
- /**
38
- * Generate random bytes
39
- */
40
- randomBytes(size: number): Promise<Uint8Array>;
41
- /**
42
- * Compute SHA-256 hash
43
- */
44
- sha256(message: string): Promise<string>;
45
- /**
46
- * Synchronous SHA-256 hash (Node.js only)
47
- */
48
- sha256Sync?(message: string): string;
49
- }
50
- /**
51
- * Get the appropriate crypto adapter for the current platform
52
- */
53
- export declare function getCryptoAdapter(): Promise<CryptoAdapter>;
54
- //# sourceMappingURL=platform.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/shared/crypto/platform.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,cAAc,GAAG,KAAK,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;cACO,QAAQ;IAUlB;;OAEG;cACO,OAAO;IAIjB;;OAEG;qBACc,OAAO;IAIxB;;OAEG;aACM,OAAO;CAGjB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE/C;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzC;;OAEG;IACH,UAAU,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AAED;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,CA+D/D"}
@@ -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;IAC3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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":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,CAAC,GAAG,EAAE,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WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,UAAU,EAAE,cAAc,CAAC;CAC5B"}
@@ -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"}