@oxyhq/services 5.17.7 → 5.17.9

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 (119) hide show
  1. package/lib/commonjs/crypto/index.js +0 -23
  2. package/lib/commonjs/crypto/index.js.map +1 -1
  3. package/lib/commonjs/index.js +0 -15
  4. package/lib/commonjs/index.js.map +1 -1
  5. package/lib/commonjs/ui/components/Icon.js.map +1 -1
  6. package/lib/commonjs/ui/components/IconButton/utils.js.map +1 -1
  7. package/lib/commonjs/ui/components/TextField/Adornment/utils.js.map +1 -1
  8. package/lib/commonjs/ui/components/TextField/helpers.js.map +1 -1
  9. package/lib/commonjs/ui/components/TouchableRipple/utils.js.map +1 -1
  10. package/lib/commonjs/ui/components/Typography/AnimatedText.js.map +1 -1
  11. package/lib/commonjs/ui/context/OxyContext.js +37 -589
  12. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  13. package/lib/commonjs/ui/context/OxyContextBase.js.map +1 -1
  14. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +60 -425
  15. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  16. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +8 -112
  17. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  18. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +2 -27
  19. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
  20. package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +2 -27
  21. package/lib/commonjs/ui/hooks/queries/useServicesQueries.js.map +1 -1
  22. package/lib/commonjs/ui/hooks/useSessionSocket.js +2 -88
  23. package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
  24. package/lib/commonjs/ui/screens/OxyAuthScreen.js +0 -1
  25. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  26. package/lib/commonjs/ui/stores/authStore.js +52 -15
  27. package/lib/commonjs/ui/stores/authStore.js.map +1 -1
  28. package/lib/commonjs/ui/utils/avatarUtils.js +2 -32
  29. package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
  30. package/lib/module/crypto/index.js +4 -6
  31. package/lib/module/crypto/index.js.map +1 -1
  32. package/lib/module/index.js +6 -3
  33. package/lib/module/index.js.map +1 -1
  34. package/lib/module/ui/components/Icon.js.map +1 -1
  35. package/lib/module/ui/components/IconButton/utils.js.map +1 -1
  36. package/lib/module/ui/components/TextField/Adornment/utils.js.map +1 -1
  37. package/lib/module/ui/components/TextField/helpers.js.map +1 -1
  38. package/lib/module/ui/components/TouchableRipple/utils.js.map +1 -1
  39. package/lib/module/ui/components/Typography/AnimatedText.js.map +1 -1
  40. package/lib/module/ui/context/OxyContext.js +35 -588
  41. package/lib/module/ui/context/OxyContext.js.map +1 -1
  42. package/lib/module/ui/context/OxyContextBase.js.map +1 -1
  43. package/lib/module/ui/context/hooks/useAuthOperations.js +60 -424
  44. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  45. package/lib/module/ui/hooks/mutations/useAccountMutations.js +8 -112
  46. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  47. package/lib/module/ui/hooks/queries/useAccountQueries.js +2 -27
  48. package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
  49. package/lib/module/ui/hooks/queries/useServicesQueries.js +2 -27
  50. package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
  51. package/lib/module/ui/hooks/useSessionSocket.js +2 -88
  52. package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
  53. package/lib/module/ui/screens/OxyAuthScreen.js +0 -1
  54. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  55. package/lib/module/ui/stores/authStore.js +52 -15
  56. package/lib/module/ui/stores/authStore.js.map +1 -1
  57. package/lib/module/ui/utils/avatarUtils.js +2 -32
  58. package/lib/module/ui/utils/avatarUtils.js.map +1 -1
  59. package/lib/typescript/crypto/index.d.ts +2 -5
  60. package/lib/typescript/crypto/index.d.ts.map +1 -1
  61. package/lib/typescript/crypto/types.d.ts +6 -2
  62. package/lib/typescript/crypto/types.d.ts.map +1 -1
  63. package/lib/typescript/index.d.ts +4 -2
  64. package/lib/typescript/index.d.ts.map +1 -1
  65. package/lib/typescript/ui/components/IconButton/utils.d.ts +1 -1
  66. package/lib/typescript/ui/components/TextField/Adornment/utils.d.ts +1 -1
  67. package/lib/typescript/ui/components/TextField/Adornment/utils.d.ts.map +1 -1
  68. package/lib/typescript/ui/components/TextField/helpers.d.ts +6 -6
  69. package/lib/typescript/ui/components/types.d.ts +0 -4
  70. package/lib/typescript/ui/components/types.d.ts.map +1 -1
  71. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  72. package/lib/typescript/ui/context/OxyContextBase.d.ts +2 -39
  73. package/lib/typescript/ui/context/OxyContextBase.d.ts.map +1 -1
  74. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +10 -25
  75. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  76. package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  77. package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  78. package/lib/typescript/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
  79. package/lib/typescript/ui/hooks/useSessionSocket.d.ts +1 -14
  80. package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
  81. package/lib/typescript/ui/stores/authStore.d.ts +27 -4
  82. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
  83. package/lib/typescript/ui/utils/avatarUtils.d.ts +0 -2
  84. package/lib/typescript/ui/utils/avatarUtils.d.ts.map +1 -1
  85. package/package.json +2 -2
  86. package/src/crypto/index.ts +3 -11
  87. package/src/crypto/types.ts +6 -2
  88. package/src/index.ts +6 -11
  89. package/src/ui/components/Icon.tsx +1 -1
  90. package/src/ui/components/IconButton/utils.ts +1 -1
  91. package/src/ui/components/TextField/Adornment/utils.ts +2 -2
  92. package/src/ui/components/TextField/helpers.tsx +8 -8
  93. package/src/ui/components/TouchableRipple/utils.ts +2 -2
  94. package/src/ui/components/Typography/AnimatedText.tsx +2 -2
  95. package/src/ui/components/types.tsx +0 -6
  96. package/src/ui/context/OxyContext.tsx +33 -637
  97. package/src/ui/context/OxyContextBase.tsx +5 -23
  98. package/src/ui/context/hooks/useAuthOperations.ts +84 -460
  99. package/src/ui/hooks/mutations/useAccountMutations.ts +12 -110
  100. package/src/ui/hooks/queries/useAccountQueries.ts +3 -27
  101. package/src/ui/hooks/queries/useServicesQueries.ts +3 -27
  102. package/src/ui/hooks/useSessionSocket.ts +2 -106
  103. package/src/ui/screens/OxyAuthScreen.tsx +1 -1
  104. package/src/ui/stores/authStore.ts +57 -18
  105. package/src/ui/utils/avatarUtils.ts +4 -36
  106. package/lib/commonjs/crypto/keyManager.js +0 -511
  107. package/lib/commonjs/crypto/keyManager.js.map +0 -1
  108. package/lib/commonjs/crypto/signatureService.js +0 -269
  109. package/lib/commonjs/crypto/signatureService.js.map +0 -1
  110. package/lib/module/crypto/keyManager.js +0 -508
  111. package/lib/module/crypto/keyManager.js.map +0 -1
  112. package/lib/module/crypto/signatureService.js +0 -266
  113. package/lib/module/crypto/signatureService.js.map +0 -1
  114. package/lib/typescript/crypto/keyManager.d.ts +0 -97
  115. package/lib/typescript/crypto/keyManager.d.ts.map +0 -1
  116. package/lib/typescript/crypto/signatureService.d.ts +0 -77
  117. package/lib/typescript/crypto/signatureService.d.ts.map +0 -1
  118. package/src/crypto/keyManager.ts +0 -545
  119. package/src/crypto/signatureService.ts +0 -301
@@ -1,269 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.SignatureService = void 0;
7
- var _elliptic = require("elliptic");
8
- var _keyManager = require("./keyManager");
9
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } /**
10
- * Signature Service - ECDSA Digital Signatures
11
- *
12
- * Handles signing and verification of messages using ECDSA secp256k1.
13
- * Used for authenticating requests and proving identity ownership.
14
- */
15
- // Lazy import for expo-crypto
16
- let ExpoCrypto = null;
17
- const ec = new _elliptic.ec('secp256k1');
18
-
19
- /**
20
- * Check if we're in a React Native environment
21
- */
22
- function isReactNative() {
23
- return typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
24
- }
25
-
26
- /**
27
- * Check if we're in a Node.js environment
28
- */
29
- function isNodeJS() {
30
- return typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
31
- }
32
-
33
- /**
34
- * Initialize expo-crypto module
35
- */
36
- async function initExpoCrypto() {
37
- if (!ExpoCrypto) {
38
- ExpoCrypto = await Promise.resolve().then(() => _interopRequireWildcard(require('expo-crypto')));
39
- }
40
- return ExpoCrypto;
41
- }
42
-
43
- /**
44
- * Compute SHA-256 hash of a string
45
- */
46
- async function sha256(message) {
47
- // In React Native, always use expo-crypto
48
- if (isReactNative() || !isNodeJS()) {
49
- const Crypto = await initExpoCrypto();
50
- return Crypto.digestStringAsync(Crypto.CryptoDigestAlgorithm.SHA256, message);
51
- }
52
-
53
- // In Node.js, use Node's crypto module
54
- // Use Function constructor to prevent Metro bundler from statically analyzing this require
55
- // This ensures the require is only evaluated in Node.js runtime, not during Metro bundling
56
- try {
57
- // eslint-disable-next-line @typescript-eslint/no-implied-eval
58
- const getCrypto = new Function('return require("crypto")');
59
- const crypto = getCrypto();
60
- return crypto.createHash('sha256').update(message).digest('hex');
61
- } catch (error) {
62
- // Fallback to expo-crypto if Node crypto fails
63
- const Crypto = await initExpoCrypto();
64
- return Crypto.digestStringAsync(Crypto.CryptoDigestAlgorithm.SHA256, message);
65
- }
66
- }
67
- class SignatureService {
68
- /**
69
- * Generate a random challenge string (for offline use)
70
- * Uses expo-crypto in React Native, crypto.randomBytes in Node.js
71
- */
72
- static async generateChallenge() {
73
- if (isReactNative() || !isNodeJS()) {
74
- // Use expo-crypto for React Native (expo-random is deprecated)
75
- const Crypto = await initExpoCrypto();
76
- const randomBytes = await Crypto.getRandomBytesAsync(32);
77
- return Array.from(randomBytes).map(b => b.toString(16).padStart(2, '0')).join('');
78
- }
79
-
80
- // Node.js fallback
81
- try {
82
- // eslint-disable-next-line @typescript-eslint/no-implied-eval
83
- const getCrypto = new Function('return require("crypto")');
84
- const crypto = getCrypto();
85
- return crypto.randomBytes(32).toString('hex');
86
- } catch (error) {
87
- // Fallback to expo-crypto if Node crypto fails
88
- const Crypto = await initExpoCrypto();
89
- const randomBytes = await Crypto.getRandomBytesAsync(32);
90
- return Array.from(randomBytes).map(b => b.toString(16).padStart(2, '0')).join('');
91
- }
92
- }
93
-
94
- /**
95
- * Hash a message using SHA-256
96
- */
97
- static async hashMessage(message) {
98
- return sha256(message);
99
- }
100
-
101
- /**
102
- * Sign a message using the stored private key
103
- * Returns the signature in DER format (hex encoded)
104
- */
105
- static async sign(message) {
106
- const keyPair = await _keyManager.KeyManager.getKeyPairObject();
107
- if (!keyPair) {
108
- throw new Error('No identity found. Please create or import an identity first.');
109
- }
110
- const messageHash = await sha256(message);
111
- const signature = keyPair.sign(messageHash);
112
- return signature.toDER('hex');
113
- }
114
-
115
- /**
116
- * Sign a message with an explicit private key (without storing)
117
- * Useful for one-time operations or testing
118
- */
119
- static async signWithKey(message, privateKey) {
120
- const keyPair = ec.keyFromPrivate(privateKey);
121
- const messageHash = await sha256(message);
122
- const signature = keyPair.sign(messageHash);
123
- return signature.toDER('hex');
124
- }
125
-
126
- /**
127
- * Verify a signature against a message and public key
128
- */
129
- static async verify(message, signature, publicKey) {
130
- try {
131
- const key = ec.keyFromPublic(publicKey, 'hex');
132
- const messageHash = await sha256(message);
133
- return key.verify(messageHash, signature);
134
- } catch {
135
- return false;
136
- }
137
- }
138
-
139
- /**
140
- * Synchronous verification (for Node.js backend)
141
- * Uses crypto module directly for hashing
142
- * Note: This method should only be used in Node.js environments
143
- */
144
- static verifySync(message, signature, publicKey) {
145
- try {
146
- if (!isNodeJS()) {
147
- // In React Native, use async verify instead
148
- throw new Error('verifySync should only be used in Node.js. Use verify() in React Native.');
149
- }
150
- // Use Function constructor to prevent Metro bundler from statically analyzing this require
151
- // eslint-disable-next-line @typescript-eslint/no-implied-eval
152
- const getCrypto = new Function('return require("crypto")');
153
- const crypto = getCrypto();
154
- const key = ec.keyFromPublic(publicKey, 'hex');
155
- const messageHash = crypto.createHash('sha256').update(message).digest('hex');
156
- return key.verify(messageHash, signature);
157
- } catch {
158
- return false;
159
- }
160
- }
161
-
162
- /**
163
- * Create a signed message object with metadata
164
- */
165
- static async createSignedMessage(message) {
166
- const publicKey = await _keyManager.KeyManager.getPublicKey();
167
- if (!publicKey) {
168
- throw new Error('No identity found. Please create or import an identity first.');
169
- }
170
- const timestamp = Date.now();
171
- const messageWithTimestamp = `${message}:${timestamp}`;
172
- const signature = await SignatureService.sign(messageWithTimestamp);
173
- return {
174
- message,
175
- signature,
176
- publicKey,
177
- timestamp
178
- };
179
- }
180
-
181
- /**
182
- * Verify a signed message object
183
- * Checks both signature validity and timestamp freshness
184
- */
185
- static async verifySignedMessage(signedMessage, maxAgeMs = 5 * 60 * 1000 // 5 minutes default
186
- ) {
187
- const {
188
- message,
189
- signature,
190
- publicKey,
191
- timestamp
192
- } = signedMessage;
193
-
194
- // Check timestamp freshness
195
- const now = Date.now();
196
- if (now - timestamp > maxAgeMs) {
197
- return false;
198
- }
199
-
200
- // Verify signature
201
- const messageWithTimestamp = `${message}:${timestamp}`;
202
- return SignatureService.verify(messageWithTimestamp, signature, publicKey);
203
- }
204
-
205
- /**
206
- * Create a signed authentication challenge response
207
- * Used for challenge-response authentication
208
- */
209
- static async signChallenge(challenge) {
210
- const publicKey = await _keyManager.KeyManager.getPublicKey();
211
- if (!publicKey) {
212
- throw new Error('No identity found. Please create or import an identity first.');
213
- }
214
- const timestamp = Date.now();
215
- const message = `auth:${publicKey}:${challenge}:${timestamp}`;
216
- const signature = await SignatureService.sign(message);
217
- return {
218
- challenge: signature,
219
- publicKey,
220
- timestamp
221
- };
222
- }
223
-
224
- /**
225
- * Verify a challenge response
226
- */
227
- static async verifyChallengeResponse(originalChallenge, response, maxAgeMs = 5 * 60 * 1000) {
228
- const {
229
- challenge: signature,
230
- publicKey,
231
- timestamp
232
- } = response;
233
-
234
- // Check timestamp freshness
235
- const now = Date.now();
236
- if (now - timestamp > maxAgeMs) {
237
- return false;
238
- }
239
- const message = `auth:${publicKey}:${originalChallenge}:${timestamp}`;
240
- return SignatureService.verify(message, signature, publicKey);
241
- }
242
-
243
- /**
244
- * Sign arbitrary data for API requests
245
- * Creates a canonical string representation and signs it
246
- */
247
- static async signRequestData(data) {
248
- const publicKey = await _keyManager.KeyManager.getPublicKey();
249
- if (!publicKey) {
250
- throw new Error('No identity found. Please create or import an identity first.');
251
- }
252
- const timestamp = Date.now();
253
-
254
- // Create canonical string representation
255
- const sortedKeys = Object.keys(data).sort();
256
- const canonicalParts = sortedKeys.map(key => `${key}:${JSON.stringify(data[key])}`);
257
- const canonicalString = canonicalParts.join('|');
258
- const message = `request:${publicKey}:${timestamp}:${canonicalString}`;
259
- const signature = await SignatureService.sign(message);
260
- return {
261
- signature,
262
- publicKey,
263
- timestamp
264
- };
265
- }
266
- }
267
- exports.SignatureService = SignatureService;
268
- var _default = exports.default = SignatureService;
269
- //# sourceMappingURL=signatureService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_elliptic","require","_keyManager","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ExpoCrypto","ec","EC","isReactNative","navigator","product","isNodeJS","process","versions","node","initExpoCrypto","Promise","resolve","then","sha256","message","Crypto","digestStringAsync","CryptoDigestAlgorithm","SHA256","getCrypto","Function","crypto","createHash","update","digest","error","SignatureService","generateChallenge","randomBytes","getRandomBytesAsync","Array","from","map","b","toString","padStart","join","hashMessage","sign","keyPair","KeyManager","getKeyPairObject","Error","messageHash","signature","toDER","signWithKey","privateKey","keyFromPrivate","verify","publicKey","key","keyFromPublic","verifySync","createSignedMessage","getPublicKey","timestamp","Date","now","messageWithTimestamp","verifySignedMessage","signedMessage","maxAgeMs","signChallenge","challenge","verifyChallengeResponse","originalChallenge","response","signRequestData","data","sortedKeys","keys","sort","canonicalParts","JSON","stringify","canonicalString","exports","_default"],"sourceRoot":"../../../src","sources":["crypto/signatureService.ts"],"mappings":";;;;;;AAOA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAA0C,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,C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