@oxyhq/services 5.16.40 → 5.16.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/adapters/expo/crypto.js +56 -0
- package/lib/commonjs/adapters/expo/crypto.js.map +1 -0
- package/lib/commonjs/adapters/expo/fetch.js +30 -0
- package/lib/commonjs/adapters/expo/fetch.js.map +1 -0
- package/lib/commonjs/adapters/expo/index.js +48 -0
- package/lib/commonjs/adapters/expo/index.js.map +1 -0
- package/lib/commonjs/adapters/expo/storage.js +201 -0
- package/lib/commonjs/adapters/expo/storage.js.map +1 -0
- package/lib/commonjs/adapters/index.js +41 -0
- package/lib/commonjs/adapters/index.js.map +1 -0
- package/lib/commonjs/adapters/node/crypto.js +40 -0
- package/lib/commonjs/adapters/node/crypto.js.map +1 -0
- package/lib/commonjs/adapters/node/fetch.js +62 -0
- package/lib/commonjs/adapters/node/fetch.js.map +1 -0
- package/lib/commonjs/adapters/node/index.js +34 -0
- package/lib/commonjs/adapters/node/index.js.map +1 -0
- package/lib/commonjs/adapters/node/storage.js +163 -0
- package/lib/commonjs/adapters/node/storage.js.map +1 -0
- package/lib/commonjs/core/identity-session/DeviceManager.js +237 -0
- package/lib/commonjs/core/identity-session/DeviceManager.js.map +1 -0
- package/lib/commonjs/core/identity-session/INTEGRATION_GUIDE.md +287 -0
- package/lib/commonjs/core/identity-session/IdentityManager.js +400 -0
- package/lib/commonjs/core/identity-session/IdentityManager.js.map +1 -0
- package/lib/commonjs/core/identity-session/IdentitySessionCore.js +394 -0
- package/lib/commonjs/core/identity-session/IdentitySessionCore.js.map +1 -0
- package/lib/commonjs/core/identity-session/RefreshManager.js +137 -0
- package/lib/commonjs/core/identity-session/RefreshManager.js.map +1 -0
- package/lib/commonjs/core/identity-session/SessionManager.js +427 -0
- package/lib/commonjs/core/identity-session/SessionManager.js.map +1 -0
- package/lib/commonjs/core/identity-session/createIdentitySessionCore.js +24 -0
- package/lib/commonjs/core/identity-session/createIdentitySessionCore.js.map +1 -0
- package/lib/commonjs/core/identity-session/errors.js +176 -0
- package/lib/commonjs/core/identity-session/errors.js.map +1 -0
- package/lib/commonjs/core/identity-session/index.js +80 -0
- package/lib/commonjs/core/identity-session/index.js.map +1 -0
- package/lib/commonjs/core/identity-session/types.js +2 -0
- package/lib/commonjs/core/identity-session/types.js.map +1 -0
- package/lib/commonjs/core/index.js +2 -21
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +58 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/interfaces.js +7 -0
- package/lib/commonjs/models/interfaces.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +434 -820
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +52 -0
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -0
- package/lib/commonjs/ui/hooks/useIdentityTransfer.js +125 -0
- package/lib/commonjs/ui/hooks/useIdentityTransfer.js.map +1 -0
- package/lib/commonjs/ui/hooks/useTransferCodesPersistence.js +81 -0
- package/lib/commonjs/ui/hooks/useTransferCodesPersistence.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +7 -2
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +12 -5
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +2 -2
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +6 -6
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/sessionHelpers.js +7 -1
- package/lib/commonjs/ui/utils/sessionHelpers.js.map +1 -1
- package/lib/commonjs/utils/index.js +0 -7
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/sessionUtils.js +8 -1
- package/lib/commonjs/utils/sessionUtils.js.map +1 -1
- package/lib/module/adapters/expo/crypto.js +51 -0
- package/lib/module/adapters/expo/crypto.js.map +1 -0
- package/lib/module/adapters/expo/fetch.js +26 -0
- package/lib/module/adapters/expo/fetch.js.map +1 -0
- package/lib/module/adapters/expo/index.js +45 -0
- package/lib/module/adapters/expo/index.js.map +1 -0
- package/lib/module/adapters/expo/storage.js +198 -0
- package/lib/module/adapters/expo/storage.js.map +1 -0
- package/lib/module/adapters/index.js +38 -0
- package/lib/module/adapters/index.js.map +1 -0
- package/lib/module/adapters/node/crypto.js +36 -0
- package/lib/module/adapters/node/crypto.js.map +1 -0
- package/lib/module/adapters/node/fetch.js +57 -0
- package/lib/module/adapters/node/fetch.js.map +1 -0
- package/lib/module/adapters/node/index.js +31 -0
- package/lib/module/adapters/node/index.js.map +1 -0
- package/lib/module/adapters/node/storage.js +159 -0
- package/lib/module/adapters/node/storage.js.map +1 -0
- package/lib/module/core/identity-session/DeviceManager.js +232 -0
- package/lib/module/core/identity-session/DeviceManager.js.map +1 -0
- package/lib/module/core/identity-session/INTEGRATION_GUIDE.md +287 -0
- package/lib/module/core/identity-session/IdentityManager.js +395 -0
- package/lib/module/core/identity-session/IdentityManager.js.map +1 -0
- package/lib/module/core/identity-session/IdentitySessionCore.js +390 -0
- package/lib/module/core/identity-session/IdentitySessionCore.js.map +1 -0
- package/lib/module/core/identity-session/RefreshManager.js +132 -0
- package/lib/module/core/identity-session/RefreshManager.js.map +1 -0
- package/lib/module/core/identity-session/SessionManager.js +422 -0
- package/lib/module/core/identity-session/SessionManager.js.map +1 -0
- package/lib/module/core/identity-session/createIdentitySessionCore.js +21 -0
- package/lib/module/core/identity-session/createIdentitySessionCore.js.map +1 -0
- package/lib/module/core/identity-session/errors.js +170 -0
- package/lib/module/core/identity-session/errors.js.map +1 -0
- package/lib/module/core/identity-session/index.js +17 -0
- package/lib/module/core/identity-session/index.js.map +1 -0
- package/lib/module/core/identity-session/types.js +2 -0
- package/lib/module/core/identity-session/types.js.map +1 -0
- package/lib/module/core/index.js +2 -3
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +12 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/interfaces.js +7 -0
- package/lib/module/models/interfaces.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +436 -822
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js +48 -0
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -0
- package/lib/module/ui/hooks/useIdentityTransfer.js +121 -0
- package/lib/module/ui/hooks/useIdentityTransfer.js.map +1 -0
- package/lib/module/ui/hooks/useTransferCodesPersistence.js +77 -0
- package/lib/module/ui/hooks/useTransferCodesPersistence.js.map +1 -0
- package/lib/module/ui/screens/AccountCenterScreen.js +7 -2
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +12 -5
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +2 -2
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +6 -6
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/utils/sessionHelpers.js +7 -1
- package/lib/module/ui/utils/sessionHelpers.js.map +1 -1
- package/lib/module/utils/index.js +2 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/sessionUtils.js +8 -1
- package/lib/module/utils/sessionUtils.js.map +1 -1
- package/lib/typescript/adapters/expo/crypto.d.ts +17 -0
- package/lib/typescript/adapters/expo/crypto.d.ts.map +1 -0
- package/lib/typescript/adapters/expo/fetch.d.ts +16 -0
- package/lib/typescript/adapters/expo/fetch.d.ts.map +1 -0
- package/lib/typescript/adapters/expo/index.d.ts +23 -0
- package/lib/typescript/adapters/expo/index.d.ts.map +1 -0
- package/lib/typescript/adapters/expo/storage.d.ts +23 -0
- package/lib/typescript/adapters/expo/storage.d.ts.map +1 -0
- package/lib/typescript/adapters/index.d.ts +13 -0
- package/lib/typescript/adapters/index.d.ts.map +1 -0
- package/lib/typescript/adapters/node/crypto.d.ts +17 -0
- package/lib/typescript/adapters/node/crypto.d.ts.map +1 -0
- package/lib/typescript/adapters/node/fetch.d.ts +16 -0
- package/lib/typescript/adapters/node/fetch.d.ts.map +1 -0
- package/lib/typescript/adapters/node/index.d.ts +23 -0
- package/lib/typescript/adapters/node/index.d.ts.map +1 -0
- package/lib/typescript/adapters/node/storage.d.ts +23 -0
- package/lib/typescript/adapters/node/storage.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/DeviceManager.d.ts +64 -0
- package/lib/typescript/core/identity-session/DeviceManager.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/IdentityManager.d.ts +88 -0
- package/lib/typescript/core/identity-session/IdentityManager.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/IdentitySessionCore.d.ts +141 -0
- package/lib/typescript/core/identity-session/IdentitySessionCore.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/RefreshManager.d.ts +36 -0
- package/lib/typescript/core/identity-session/RefreshManager.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/SessionManager.d.ts +104 -0
- package/lib/typescript/core/identity-session/SessionManager.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/createIdentitySessionCore.d.ts +11 -0
- package/lib/typescript/core/identity-session/createIdentitySessionCore.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/errors.d.ts +63 -0
- package/lib/typescript/core/identity-session/errors.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/index.d.ts +14 -0
- package/lib/typescript/core/identity-session/index.d.ts.map +1 -0
- package/lib/typescript/core/identity-session/types.d.ts +196 -0
- package/lib/typescript/core/identity-session/types.d.ts.map +1 -0
- package/lib/typescript/core/index.d.ts +1 -3
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/core/mixins/index.d.ts +2 -2
- package/lib/typescript/index.d.ts +3 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +5 -36
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/models/session.d.ts +3 -16
- package/lib/typescript/models/session.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +2 -25
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts +7 -8
- package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/mutations/useServicesMutations.d.ts +1 -1
- package/lib/typescript/ui/hooks/mutations/useServicesMutations.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts +5 -5
- package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useAvatarPicker.d.ts +18 -0
- package/lib/typescript/ui/hooks/useAvatarPicker.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useIdentityTransfer.d.ts +24 -0
- package/lib/typescript/ui/hooks/useIdentityTransfer.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useTransferCodesPersistence.d.ts +6 -0
- package/lib/typescript/ui/hooks/useTransferCodesPersistence.d.ts.map +1 -0
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/utils/sessionHelpers.d.ts +1 -0
- package/lib/typescript/ui/utils/sessionHelpers.d.ts.map +1 -1
- package/lib/typescript/utils/index.d.ts +0 -2
- package/lib/typescript/utils/index.d.ts.map +1 -1
- package/lib/typescript/utils/sessionUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/expo/crypto.ts +55 -0
- package/src/adapters/expo/fetch.ts +28 -0
- package/src/adapters/expo/index.ts +51 -0
- package/src/adapters/expo/storage.ts +228 -0
- package/src/adapters/index.ts +40 -0
- package/src/adapters/node/crypto.ts +39 -0
- package/src/adapters/node/fetch.ts +59 -0
- package/src/adapters/node/index.ts +37 -0
- package/src/adapters/node/storage.ts +170 -0
- package/src/core/identity-session/DeviceManager.ts +273 -0
- package/src/core/identity-session/INTEGRATION_GUIDE.md +287 -0
- package/src/core/identity-session/IdentityManager.ts +474 -0
- package/src/core/identity-session/IdentitySessionCore.ts +464 -0
- package/src/core/identity-session/RefreshManager.ts +189 -0
- package/src/core/identity-session/SessionManager.ts +500 -0
- package/src/core/identity-session/createIdentitySessionCore.ts +19 -0
- package/src/core/identity-session/errors.ts +197 -0
- package/src/core/identity-session/index.ts +15 -0
- package/src/core/identity-session/types.ts +188 -0
- package/src/core/index.ts +3 -4
- package/src/index.ts +28 -3
- package/src/models/interfaces.ts +12 -39
- package/src/models/session.ts +6 -16
- package/src/ui/context/OxyContext.tsx +442 -871
- package/src/ui/hooks/auth/index.ts +1 -0
- package/src/ui/hooks/useAvatarPicker.ts +62 -0
- package/src/ui/hooks/useIdentityTransfer.ts +135 -0
- package/src/ui/hooks/useTransferCodesPersistence.ts +80 -0
- package/src/ui/screens/AccountCenterScreen.tsx +7 -2
- package/src/ui/screens/AccountSettingsScreen.tsx +15 -8
- package/src/ui/screens/AccountSwitcherScreen.tsx +2 -2
- package/src/ui/screens/ProfileScreen.tsx +10 -10
- package/src/ui/utils/sessionHelpers.ts +7 -0
- package/src/utils/index.ts +1 -2
- package/src/utils/sessionUtils.ts +8 -0
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +0 -732
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +0 -1
- package/lib/commonjs/ui/context/hooks/useDeviceManagement.js +0 -73
- package/lib/commonjs/ui/context/hooks/useDeviceManagement.js.map +0 -1
- package/lib/commonjs/ui/hooks/useDeviceManagement.js +0 -73
- package/lib/commonjs/ui/hooks/useDeviceManagement.js.map +0 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +0 -281
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +0 -1
- package/lib/commonjs/utils/deviceManager.js +0 -177
- package/lib/commonjs/utils/deviceManager.js.map +0 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +0 -726
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +0 -1
- package/lib/module/ui/context/hooks/useDeviceManagement.js +0 -68
- package/lib/module/ui/context/hooks/useDeviceManagement.js.map +0 -1
- package/lib/module/ui/hooks/useDeviceManagement.js +0 -68
- package/lib/module/ui/hooks/useDeviceManagement.js.map +0 -1
- package/lib/module/ui/hooks/useSessionManagement.js +0 -276
- package/lib/module/ui/hooks/useSessionManagement.js.map +0 -1
- package/lib/module/utils/deviceManager.js +0 -171
- package/lib/module/utils/deviceManager.js.map +0 -1
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +0 -59
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +0 -1
- package/lib/typescript/ui/context/hooks/useDeviceManagement.d.ts +0 -27
- package/lib/typescript/ui/context/hooks/useDeviceManagement.d.ts.map +0 -1
- package/lib/typescript/ui/hooks/useDeviceManagement.d.ts +0 -27
- package/lib/typescript/ui/hooks/useDeviceManagement.d.ts.map +0 -1
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts +0 -41
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts.map +0 -1
- package/lib/typescript/utils/deviceManager.d.ts +0 -66
- package/lib/typescript/utils/deviceManager.d.ts.map +0 -1
- package/src/ui/context/hooks/useAuthOperations.ts +0 -801
- package/src/ui/context/hooks/useDeviceManagement.ts +0 -108
- package/src/ui/hooks/useDeviceManagement.ts +0 -108
- package/src/ui/hooks/useSessionManagement.ts +0 -401
- package/src/utils/deviceManager.ts +0 -198
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createExpoCryptoAdapter = createExpoCryptoAdapter;
|
|
7
|
+
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); }
|
|
8
|
+
/**
|
|
9
|
+
* Expo 54 Crypto Adapter
|
|
10
|
+
*
|
|
11
|
+
* Uses expo-crypto which works in both React Native and Web
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// Lazy import
|
|
15
|
+
let ExpoCrypto = null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Initialize expo-crypto
|
|
19
|
+
*/
|
|
20
|
+
async function initExpoCrypto() {
|
|
21
|
+
if (!ExpoCrypto) {
|
|
22
|
+
try {
|
|
23
|
+
ExpoCrypto = await Promise.resolve().then(() => _interopRequireWildcard(require('expo-crypto')));
|
|
24
|
+
} catch (error) {
|
|
25
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
26
|
+
throw new Error(`Failed to load expo-crypto: ${errorMessage}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return ExpoCrypto;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Crypto Adapter Interface
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Create Expo Crypto Adapter
|
|
38
|
+
*/
|
|
39
|
+
async function createExpoCryptoAdapter() {
|
|
40
|
+
const crypto = await initExpoCrypto();
|
|
41
|
+
return {
|
|
42
|
+
/**
|
|
43
|
+
* Generate cryptographically secure random bytes
|
|
44
|
+
*/
|
|
45
|
+
async getRandomBytes(length) {
|
|
46
|
+
return crypto.getRandomBytes(length);
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Hash a string using the specified algorithm
|
|
50
|
+
*/
|
|
51
|
+
async digestStringAsync(algorithm, data) {
|
|
52
|
+
return crypto.digestStringAsync(algorithm, data);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=crypto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ExpoCrypto","initExpoCrypto","Promise","resolve","then","_interopRequireWildcard","require","error","errorMessage","Error","message","String","createExpoCryptoAdapter","crypto","getRandomBytes","length","digestStringAsync","algorithm","data"],"sourceRoot":"../../../../src","sources":["adapters/expo/crypto.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAIA,UAA+C,GAAG,IAAI;;AAE1D;AACA;AACA;AACA,eAAeC,cAAcA,CAAA,EAA0C;EACrE,IAAI,CAACD,UAAU,EAAE;IACf,IAAI;MACFA,UAAU,GAAG,MAAAE,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAAC,uBAAA,CAAAC,OAAA,CAAa,aAAa,GAAC;IAC1C,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd,MAAMC,YAAY,GAAGD,KAAK,YAAYE,KAAK,GAAGF,KAAK,CAACG,OAAO,GAAGC,MAAM,CAACJ,KAAK,CAAC;MAC3E,MAAM,IAAIE,KAAK,CAAC,+BAA+BD,YAAY,EAAE,CAAC;IAChE;EACF;EACA,OAAOR,UAAU;AACnB;;AAEA;AACA;AACA;;AAMA;AACA;AACA;AACO,eAAeY,uBAAuBA,CAAA,EAA2B;EACtE,MAAMC,MAAM,GAAG,MAAMZ,cAAc,CAAC,CAAC;EAErC,OAAO;IACL;AACJ;AACA;IACI,MAAMa,cAAcA,CAACC,MAAc,EAAuB;MACxD,OAAOF,MAAM,CAACC,cAAc,CAACC,MAAM,CAAC;IACtC,CAAC;IAED;AACJ;AACA;IACI,MAAMC,iBAAiBA,CAACC,SAA8B,EAAEC,IAAY,EAAmB;MACrF,OAAOL,MAAM,CAACG,iBAAiB,CAACC,SAAS,EAAEC,IAAI,CAAC;IAClD;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createExpoFetchAdapter = createExpoFetchAdapter;
|
|
7
|
+
/**
|
|
8
|
+
* Expo 54 Fetch Adapter
|
|
9
|
+
*
|
|
10
|
+
* Uses native fetch which works in both React Native and Web
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Fetch Adapter Interface
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Create Expo Fetch Adapter
|
|
19
|
+
*/
|
|
20
|
+
async function createExpoFetchAdapter() {
|
|
21
|
+
if (typeof fetch === 'undefined') {
|
|
22
|
+
throw new Error('fetch is not available in this environment');
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
fetch(url, options) {
|
|
26
|
+
return fetch(url, options);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createExpoFetchAdapter","fetch","Error","url","options"],"sourceRoot":"../../../../src","sources":["adapters/expo/fetch.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAKA;AACA;AACA;AACO,eAAeA,sBAAsBA,CAAA,EAA0B;EACpE,IAAI,OAAOC,KAAK,KAAK,WAAW,EAAE;IAChC,MAAM,IAAIC,KAAK,CAAC,4CAA4C,CAAC;EAC/D;EAEA,OAAO;IACLD,KAAKA,CAACE,GAAW,EAAEC,OAAqB,EAAqB;MAC3D,OAAOH,KAAK,CAACE,GAAG,EAAEC,OAAO,CAAC;IAC5B;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createExpoAdapter = createExpoAdapter;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _storage = require("./storage");
|
|
9
|
+
var _crypto = require("./crypto");
|
|
10
|
+
var _fetch = require("./fetch");
|
|
11
|
+
/**
|
|
12
|
+
* Expo 54 Platform Adapter
|
|
13
|
+
*
|
|
14
|
+
* Provides storage, crypto, and fetch adapters for Expo 54 (React Native + Web)
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Platform Adapter Interface
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Create Expo Platform Adapter
|
|
23
|
+
*/
|
|
24
|
+
async function createExpoAdapter() {
|
|
25
|
+
const storage = await (0, _storage.createExpoStorageAdapter)();
|
|
26
|
+
const crypto = await (0, _crypto.createExpoCryptoAdapter)();
|
|
27
|
+
const fetchAdapter = await (0, _fetch.createExpoFetchAdapter)();
|
|
28
|
+
|
|
29
|
+
// Determine platform
|
|
30
|
+
let platform = 'web';
|
|
31
|
+
try {
|
|
32
|
+
if (_reactNative.Platform.OS !== 'web') {
|
|
33
|
+
platform = 'native';
|
|
34
|
+
}
|
|
35
|
+
} catch {
|
|
36
|
+
// Fallback detection
|
|
37
|
+
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
|
|
38
|
+
platform = 'native';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
storage,
|
|
43
|
+
crypto,
|
|
44
|
+
fetch: fetchAdapter,
|
|
45
|
+
platform
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_storage","_crypto","_fetch","createExpoAdapter","storage","createExpoStorageAdapter","crypto","createExpoCryptoAdapter","fetchAdapter","createExpoFetchAdapter","platform","Platform","OS","navigator","product","fetch"],"sourceRoot":"../../../../src","sources":["adapters/expo/index.ts"],"mappings":";;;;;;AAMA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AATA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;;AAQA;AACA;AACA;AACO,eAAeI,iBAAiBA,CAAA,EAA6B;EAClE,MAAMC,OAAO,GAAG,MAAM,IAAAC,iCAAwB,EAAC,CAAC;EAChD,MAAMC,MAAM,GAAG,MAAM,IAAAC,+BAAuB,EAAC,CAAC;EAC9C,MAAMC,YAAY,GAAG,MAAM,IAAAC,6BAAsB,EAAC,CAAC;;EAEnD;EACA,IAAIC,QAAsB,GAAG,KAAK;EAClC,IAAI;IACF,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzBF,QAAQ,GAAG,QAAQ;IACrB;EACF,CAAC,CAAC,MAAM;IACN;IACA,IAAI,OAAOG,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,OAAO,KAAK,aAAa,EAAE;MAC3EJ,QAAQ,GAAG,QAAQ;IACrB;EACF;EAEA,OAAO;IACLN,OAAO;IACPE,MAAM;IACNS,KAAK,EAAEP,YAAY;IACnBE;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createExpoStorageAdapter = createExpoStorageAdapter;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
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); } /**
|
|
9
|
+
* Expo 54 Storage Adapter
|
|
10
|
+
*
|
|
11
|
+
* Handles storage for React Native (expo-secure-store + AsyncStorage) and Web (localStorage)
|
|
12
|
+
*/
|
|
13
|
+
// Lazy imports
|
|
14
|
+
let SecureStore = null;
|
|
15
|
+
let AsyncStorage = null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Initialize expo-secure-store (React Native only)
|
|
19
|
+
*/
|
|
20
|
+
async function initSecureStore() {
|
|
21
|
+
if (!SecureStore) {
|
|
22
|
+
try {
|
|
23
|
+
SecureStore = await Promise.resolve().then(() => _interopRequireWildcard(require('expo-secure-store')));
|
|
24
|
+
} catch (error) {
|
|
25
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
26
|
+
throw new Error(`Failed to load expo-secure-store: ${errorMessage}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return SecureStore;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Initialize AsyncStorage (React Native only)
|
|
34
|
+
*/
|
|
35
|
+
async function initAsyncStorage() {
|
|
36
|
+
if (!AsyncStorage) {
|
|
37
|
+
try {
|
|
38
|
+
const module = await Promise.resolve().then(() => _interopRequireWildcard(require('@react-native-async-storage/async-storage')));
|
|
39
|
+
AsyncStorage = module.default;
|
|
40
|
+
} catch (error) {
|
|
41
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
42
|
+
throw new Error(`Failed to load AsyncStorage: ${errorMessage}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return AsyncStorage;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Check if we're on React Native (not Web)
|
|
50
|
+
*/
|
|
51
|
+
function isReactNative() {
|
|
52
|
+
try {
|
|
53
|
+
return _reactNative.Platform.OS !== 'web';
|
|
54
|
+
} catch {
|
|
55
|
+
return typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Check if we're on Web
|
|
61
|
+
*/
|
|
62
|
+
function isWeb() {
|
|
63
|
+
try {
|
|
64
|
+
return _reactNative.Platform.OS === 'web';
|
|
65
|
+
} catch {
|
|
66
|
+
return typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.product !== 'ReactNative';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Storage Adapter Interface
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Create Expo Storage Adapter
|
|
76
|
+
*/
|
|
77
|
+
async function createExpoStorageAdapter() {
|
|
78
|
+
const isNative = isReactNative();
|
|
79
|
+
const isWebPlatform = isWeb();
|
|
80
|
+
if (isNative) {
|
|
81
|
+
// React Native: Use expo-secure-store + AsyncStorage
|
|
82
|
+
const secureStore = await initSecureStore();
|
|
83
|
+
const asyncStorage = await initAsyncStorage();
|
|
84
|
+
return {
|
|
85
|
+
// Secure storage (expo-secure-store)
|
|
86
|
+
async secureGet(key) {
|
|
87
|
+
try {
|
|
88
|
+
return await secureStore.getItemAsync(key);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.warn('[ExpoStorage] Failed to get secure item:', error);
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
async secureSet(key, value) {
|
|
95
|
+
try {
|
|
96
|
+
await secureStore.setItemAsync(key, value, {
|
|
97
|
+
keychainAccessible: secureStore.WHEN_UNLOCKED_THIS_DEVICE_ONLY
|
|
98
|
+
});
|
|
99
|
+
} catch (error) {
|
|
100
|
+
console.warn('[ExpoStorage] Failed to set secure item:', error);
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
async secureDelete(key) {
|
|
105
|
+
try {
|
|
106
|
+
await secureStore.deleteItemAsync(key);
|
|
107
|
+
} catch (error) {
|
|
108
|
+
console.warn('[ExpoStorage] Failed to delete secure item:', error);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
isSecureStorageAvailable() {
|
|
112
|
+
return true;
|
|
113
|
+
},
|
|
114
|
+
// Regular storage (AsyncStorage)
|
|
115
|
+
async get(key) {
|
|
116
|
+
try {
|
|
117
|
+
return await asyncStorage.getItem(key);
|
|
118
|
+
} catch (error) {
|
|
119
|
+
console.warn('[ExpoStorage] Failed to get item:', error);
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
async set(key, value) {
|
|
124
|
+
try {
|
|
125
|
+
await asyncStorage.setItem(key, value);
|
|
126
|
+
} catch (error) {
|
|
127
|
+
console.warn('[ExpoStorage] Failed to set item:', error);
|
|
128
|
+
throw error;
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
async remove(key) {
|
|
132
|
+
try {
|
|
133
|
+
await asyncStorage.removeItem(key);
|
|
134
|
+
} catch (error) {
|
|
135
|
+
console.warn('[ExpoStorage] Failed to remove item:', error);
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
async clear() {
|
|
139
|
+
try {
|
|
140
|
+
await asyncStorage.clear();
|
|
141
|
+
} catch (error) {
|
|
142
|
+
console.warn('[ExpoStorage] Failed to clear storage:', error);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
} else if (isWebPlatform) {
|
|
147
|
+
// Web: Use localStorage only (no secure storage)
|
|
148
|
+
if (typeof window === 'undefined' || typeof window.localStorage === 'undefined') {
|
|
149
|
+
throw new Error('localStorage is not available in this environment');
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
// Secure storage not available on Web
|
|
153
|
+
async secureGet(_key) {
|
|
154
|
+
return null;
|
|
155
|
+
},
|
|
156
|
+
async secureSet(_key, _value) {
|
|
157
|
+
// No-op on Web
|
|
158
|
+
},
|
|
159
|
+
async secureDelete(_key) {
|
|
160
|
+
// No-op on Web
|
|
161
|
+
},
|
|
162
|
+
isSecureStorageAvailable() {
|
|
163
|
+
return false;
|
|
164
|
+
},
|
|
165
|
+
// Regular storage (localStorage)
|
|
166
|
+
async get(key) {
|
|
167
|
+
try {
|
|
168
|
+
return window.localStorage.getItem(key);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
console.warn('[ExpoStorage] Failed to get item:', error);
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
async set(key, value) {
|
|
175
|
+
try {
|
|
176
|
+
window.localStorage.setItem(key, value);
|
|
177
|
+
} catch (error) {
|
|
178
|
+
console.warn('[ExpoStorage] Failed to set item:', error);
|
|
179
|
+
throw error;
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
async remove(key) {
|
|
183
|
+
try {
|
|
184
|
+
window.localStorage.removeItem(key);
|
|
185
|
+
} catch (error) {
|
|
186
|
+
console.warn('[ExpoStorage] Failed to remove item:', error);
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
async clear() {
|
|
190
|
+
try {
|
|
191
|
+
window.localStorage.clear();
|
|
192
|
+
} catch (error) {
|
|
193
|
+
console.warn('[ExpoStorage] Failed to clear storage:', error);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
} else {
|
|
198
|
+
throw new Error('Unknown platform for Expo storage adapter');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SecureStore","AsyncStorage","initSecureStore","Promise","resolve","then","error","errorMessage","Error","message","String","initAsyncStorage","module","isReactNative","Platform","OS","navigator","product","isWeb","window","createExpoStorageAdapter","isNative","isWebPlatform","secureStore","asyncStorage","secureGet","key","getItemAsync","console","warn","secureSet","value","setItemAsync","keychainAccessible","WHEN_UNLOCKED_THIS_DEVICE_ONLY","secureDelete","deleteItemAsync","isSecureStorageAvailable","getItem","setItem","remove","removeItem","clear","localStorage","_key","_value"],"sourceRoot":"../../../../src","sources":["adapters/expo/storage.ts"],"mappings":";;;;;;AAMA,IAAAA,YAAA,GAAAC,OAAA;AAAwC,SAAAC,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,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,C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C,CAAC,CAAC,OAAOpB,KAAK,EAAE;UACdsB,OAAO,CAACC,IAAI,CAAC,sCAAsC,EAAEvB,KAAK,CAAC;QAC7D;MACF,CAAC;MAED,MAAMoC,KAAKA,CAAA,EAAkB;QAC3B,IAAI;UACFvB,MAAM,CAACwB,YAAY,CAACD,KAAK,CAAC,CAAC;QAC7B,CAAC,CAAC,OAAOpC,KAAK,EAAE;UACdsB,OAAO,CAACC,IAAI,CAAC,wCAAwC,EAAEvB,KAAK,CAAC;QAC/D;MACF;IACF,CAAC;EACH,CAAC,MAAM;IACL,MAAM,IAAIE,KAAK,CAAC,2CAA2C,CAAC;EAC9D;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createPlatformAdapter = createPlatformAdapter;
|
|
7
|
+
var _expo = require("./expo");
|
|
8
|
+
var _node = require("./node");
|
|
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
|
+
* Platform Adapters
|
|
11
|
+
*
|
|
12
|
+
* Factory function to create the appropriate platform adapter
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Detect platform and create appropriate adapter
|
|
16
|
+
*/
|
|
17
|
+
async function createPlatformAdapter() {
|
|
18
|
+
// Check if we're in Node.js
|
|
19
|
+
if (typeof process !== 'undefined' && process.versions != null && process.versions.node != null) {
|
|
20
|
+
// Check if we're in a React Native/Expo environment
|
|
21
|
+
try {
|
|
22
|
+
// Try to detect React Native
|
|
23
|
+
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
|
|
24
|
+
return await (0, _expo.createExpoAdapter)();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Check for Expo in Node (unlikely but possible)
|
|
28
|
+
const Platform = await Promise.resolve().then(() => _interopRequireWildcard(require('react-native'))).then(m => m.Platform).catch(() => null);
|
|
29
|
+
if (Platform) {
|
|
30
|
+
return await (0, _expo.createExpoAdapter)();
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
// Not React Native, use Node adapter
|
|
34
|
+
}
|
|
35
|
+
return await (0, _node.createNodeAdapter)();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Default to Expo adapter (React Native or Web)
|
|
39
|
+
return await (0, _expo.createExpoAdapter)();
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_expo","require","_node","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","createPlatformAdapter","process","versions","node","navigator","product","createExpoAdapter","Platform","Promise","resolve","then","m","catch","createNodeAdapter"],"sourceRoot":"../../../src","sources":["adapters/index.ts"],"mappings":";;;;;;AAMA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAwF,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,EAA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CAAC,CAACK,KAAK,CAAC,MAAM,IAAI,CAAC;MACrF,IAAIL,QAAQ,EAAE;QACZ,OAAO,MAAM,IAAAD,uBAAiB,EAAC,CAAC;MAClC;IACF,CAAC,CAAC,MAAM;MACN;IAAA;IAGF,OAAO,MAAM,IAAAO,uBAAiB,EAAC,CAAC;EAClC;;EAEA;EACA,OAAO,MAAM,IAAAP,uBAAiB,EAAC,CAAC;AAClC","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createNodeCryptoAdapter = createNodeCryptoAdapter;
|
|
7
|
+
var crypto = _interopRequireWildcard(require("crypto"));
|
|
8
|
+
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); }
|
|
9
|
+
/**
|
|
10
|
+
* Node.js Crypto Adapter
|
|
11
|
+
*
|
|
12
|
+
* Uses Node's built-in crypto module
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Crypto Adapter Interface
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create Node Crypto Adapter
|
|
21
|
+
*/
|
|
22
|
+
async function createNodeCryptoAdapter() {
|
|
23
|
+
return {
|
|
24
|
+
/**
|
|
25
|
+
* Generate cryptographically secure random bytes
|
|
26
|
+
*/
|
|
27
|
+
async getRandomBytes(length) {
|
|
28
|
+
return new Uint8Array(crypto.randomBytes(length));
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* Hash a string using the specified algorithm
|
|
32
|
+
*/
|
|
33
|
+
async digestStringAsync(algorithm, data) {
|
|
34
|
+
const hash = crypto.createHash(algorithm.toLowerCase());
|
|
35
|
+
hash.update(data);
|
|
36
|
+
return hash.digest('hex');
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=crypto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["crypto","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","createNodeCryptoAdapter","getRandomBytes","length","Uint8Array","randomBytes","digestStringAsync","algorithm","data","hash","createHash","toLowerCase","update","digest"],"sourceRoot":"../../../../src","sources":["adapters/node/crypto.ts"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAiC,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,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,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AANjC;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;AACO,eAAekB,uBAAuBA,CAAA,EAA2B;EACtE,OAAO;IACL;AACJ;AACA;IACI,MAAMC,cAAcA,CAACC,MAAc,EAAuB;MACxD,OAAO,IAAIC,UAAU,CAACzB,MAAM,CAAC0B,WAAW,CAACF,MAAM,CAAC,CAAC;IACnD,CAAC;IAED;AACJ;AACA;IACI,MAAMG,iBAAiBA,CAACC,SAA8B,EAAEC,IAAY,EAAmB;MACrF,MAAMC,IAAI,GAAG9B,MAAM,CAAC+B,UAAU,CAACH,SAAS,CAACI,WAAW,CAAC,CAAC,CAAC;MACvDF,IAAI,CAACG,MAAM,CAACJ,IAAI,CAAC;MACjB,OAAOC,IAAI,CAACI,MAAM,CAAC,KAAK,CAAC;IAC3B;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createNodeFetchAdapter = createNodeFetchAdapter;
|
|
7
|
+
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); }
|
|
8
|
+
/**
|
|
9
|
+
* Node.js Fetch Adapter
|
|
10
|
+
*
|
|
11
|
+
* Uses node-fetch or native fetch (Node 18+)
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// Lazy import
|
|
15
|
+
let nodeFetch = null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Initialize node-fetch
|
|
19
|
+
*/
|
|
20
|
+
async function initNodeFetch() {
|
|
21
|
+
if (!nodeFetch) {
|
|
22
|
+
try {
|
|
23
|
+
// Try native fetch first (Node 18+)
|
|
24
|
+
if (typeof fetch !== 'undefined') {
|
|
25
|
+
// Use a wrapper to match the interface
|
|
26
|
+
nodeFetch = {
|
|
27
|
+
default: fetch
|
|
28
|
+
};
|
|
29
|
+
return nodeFetch;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Fallback to node-fetch (dynamic import to avoid type errors if not installed)
|
|
33
|
+
// @ts-ignore - node-fetch may not be installed, handled at runtime
|
|
34
|
+
const nodeFetchModule = await Promise.resolve().then(() => _interopRequireWildcard(require('node-fetch')));
|
|
35
|
+
nodeFetch = {
|
|
36
|
+
default: nodeFetchModule.default || nodeFetchModule
|
|
37
|
+
};
|
|
38
|
+
} catch (error) {
|
|
39
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
40
|
+
throw new Error(`Failed to load fetch: ${errorMessage}. Please use Node.js 18+ or install node-fetch`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return nodeFetch;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Fetch Adapter Interface
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Create Node Fetch Adapter
|
|
52
|
+
*/
|
|
53
|
+
async function createNodeFetchAdapter() {
|
|
54
|
+
const fetchModule = await initNodeFetch();
|
|
55
|
+
const fetchFn = fetchModule.default || fetchModule;
|
|
56
|
+
return {
|
|
57
|
+
fetch(url, options) {
|
|
58
|
+
return fetchFn(url, options);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["nodeFetch","initNodeFetch","fetch","default","nodeFetchModule","Promise","resolve","then","_interopRequireWildcard","require","error","errorMessage","Error","message","String","createNodeFetchAdapter","fetchModule","fetchFn","url","options"],"sourceRoot":"../../../../src","sources":["adapters/node/fetch.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAIA,SAA2C,GAAG,IAAI;;AAEtD;AACA;AACA;AACA,eAAeC,aAAaA,CAAA,EAAuC;EACjE,IAAI,CAACD,SAAS,EAAE;IACd,IAAI;MACF;MACA,IAAI,OAAOE,KAAK,KAAK,WAAW,EAAE;QAChC;QACAF,SAAS,GAAG;UACVG,OAAO,EAAED;QACX,CAAC;QACD,OAAOF,SAAS;MAClB;;MAEA;MACA;MACA,MAAMI,eAAe,GAAG,MAAAC,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAAC,uBAAA,CAAAC,OAAA,CAAa,YAAY,GAAC;MAClDT,SAAS,GAAG;QACVG,OAAO,EAAGC,eAAe,CAACD,OAAO,IAAIC;MACvC,CAAC;IACH,CAAC,CAAC,OAAOM,KAAK,EAAE;MACd,MAAMC,YAAY,GAAGD,KAAK,YAAYE,KAAK,GAAGF,KAAK,CAACG,OAAO,GAAGC,MAAM,CAACJ,KAAK,CAAC;MAC3E,MAAM,IAAIE,KAAK,CAAC,yBAAyBD,YAAY,gDAAgD,CAAC;IACxG;EACF;EACA,OAAOX,SAAS;AAClB;;AAEA;AACA;AACA;;AAKA;AACA;AACA;AACO,eAAee,sBAAsBA,CAAA,EAA0B;EACpE,MAAMC,WAAW,GAAG,MAAMf,aAAa,CAAC,CAAC;EACzC,MAAMgB,OAAO,GAAID,WAAW,CAASb,OAAO,IAAIa,WAAW;EAE3D,OAAO;IACLd,KAAKA,CAACgB,GAAW,EAAEC,OAAqB,EAAqB;MAC3D,OAAOF,OAAO,CAACC,GAAG,EAAEC,OAAO,CAAC;IAC9B;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createNodeAdapter = createNodeAdapter;
|
|
7
|
+
var _storage = require("./storage");
|
|
8
|
+
var _crypto = require("./crypto");
|
|
9
|
+
var _fetch = require("./fetch");
|
|
10
|
+
/**
|
|
11
|
+
* Node.js Platform Adapter
|
|
12
|
+
*
|
|
13
|
+
* Provides storage, crypto, and fetch adapters for Node.js
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Platform Adapter Interface
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Create Node Platform Adapter
|
|
22
|
+
*/
|
|
23
|
+
async function createNodeAdapter() {
|
|
24
|
+
const storage = await (0, _storage.createNodeStorageAdapter)();
|
|
25
|
+
const crypto = await (0, _crypto.createNodeCryptoAdapter)();
|
|
26
|
+
const fetchAdapter = await (0, _fetch.createNodeFetchAdapter)();
|
|
27
|
+
return {
|
|
28
|
+
storage,
|
|
29
|
+
crypto,
|
|
30
|
+
fetch: fetchAdapter,
|
|
31
|
+
platform: 'node'
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_storage","require","_crypto","_fetch","createNodeAdapter","storage","createNodeStorageAdapter","crypto","createNodeCryptoAdapter","fetchAdapter","createNodeFetchAdapter","fetch","platform"],"sourceRoot":"../../../../src","sources":["adapters/node/index.ts"],"mappings":";;;;;;AAMA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AARA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;;AAQA;AACA;AACA;AACO,eAAeG,iBAAiBA,CAAA,EAA6B;EAClE,MAAMC,OAAO,GAAG,MAAM,IAAAC,iCAAwB,EAAC,CAAC;EAChD,MAAMC,MAAM,GAAG,MAAM,IAAAC,+BAAuB,EAAC,CAAC;EAC9C,MAAMC,YAAY,GAAG,MAAM,IAAAC,6BAAsB,EAAC,CAAC;EAEnD,OAAO;IACLL,OAAO;IACPE,MAAM;IACNI,KAAK,EAAEF,YAAY;IACnBG,QAAQ,EAAE;EACZ,CAAC;AACH","ignoreList":[]}
|