@oxyhq/services 5.16.42 → 5.16.43
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/index.js +18 -31
- package/lib/commonjs/adapters/index.js.map +1 -1
- package/lib/module/adapters/index.js +18 -31
- package/lib/module/adapters/index.js.map +1 -1
- package/lib/typescript/adapters/index.d.ts +4 -6
- package/lib/typescript/adapters/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/index.ts +16 -29
|
@@ -8,43 +8,30 @@ var _expo = require("./expo");
|
|
|
8
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
9
|
* Platform Adapters
|
|
10
10
|
*
|
|
11
|
-
* Factory function to create the appropriate platform adapter
|
|
12
|
-
*
|
|
13
|
-
* Uses dynamic imports for Node.js adapter to avoid Metro bundling Node-specific code
|
|
14
|
-
* in React Native environments.
|
|
11
|
+
* Factory function to create the appropriate platform adapter.
|
|
12
|
+
* Supports Expo 54 (frontend) and Node.js (backend).
|
|
15
13
|
*/
|
|
16
14
|
/**
|
|
17
15
|
* Detect platform and create appropriate adapter
|
|
18
16
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* Simple detection: Expo (frontend) or Node.js (backend)
|
|
18
|
+
* Uses dynamic import with constructed path to avoid Metro static analysis
|
|
21
19
|
*/
|
|
22
20
|
async function createPlatformAdapter() {
|
|
23
|
-
// Detect
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} catch {
|
|
38
|
-
// Cannot import react-native, we're in pure Node.js
|
|
39
|
-
// Use dynamic import to avoid Metro processing Node-specific code
|
|
40
|
-
const {
|
|
41
|
-
createNodeAdapter
|
|
42
|
-
} = await Promise.resolve().then(() => _interopRequireWildcard(require('./node/index.js')));
|
|
43
|
-
return await createNodeAdapter();
|
|
44
|
-
}
|
|
21
|
+
// Detect React Native/Expo first (frontend)
|
|
22
|
+
// If we can import react-native, we're in Expo environment
|
|
23
|
+
try {
|
|
24
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require('react-native')));
|
|
25
|
+
// Expo (React Native or Web)
|
|
26
|
+
return await (0, _expo.createExpoAdapter)();
|
|
27
|
+
} catch {
|
|
28
|
+
// Not Expo, must be Node.js (backend)
|
|
29
|
+
// Construct path dynamically to avoid Metro static analysis
|
|
30
|
+
const nodePath = './node' + '/index.js';
|
|
31
|
+
const {
|
|
32
|
+
createNodeAdapter
|
|
33
|
+
} = await (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(nodePath);
|
|
34
|
+
return await createNodeAdapter();
|
|
45
35
|
}
|
|
46
|
-
|
|
47
|
-
// Default: Expo adapter (React Native or Web)
|
|
48
|
-
return await (0, _expo.createExpoAdapter)();
|
|
49
36
|
}
|
|
50
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_expo","require","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","createPlatformAdapter","
|
|
1
|
+
{"version":3,"names":["_expo","require","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","createPlatformAdapter","Promise","resolve","then","createExpoAdapter","nodePath","createNodeAdapter","specifier","s"],"sourceRoot":"../../../src","sources":["adapters/index.ts"],"mappings":";;;;;;AAOA,IAAAA,KAAA,GAAAC,OAAA;AAAwF,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,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,KAPxF;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACO,eAAekB,qBAAqBA,CAAA,EAA6B;EACtE;EACA;EACA,IAAI;IACF,MAAAC,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAAvB,uBAAA,CAAAD,OAAA,CAAa,cAAc,GAAC;IAC5B;IACA,OAAO,MAAM,IAAAyB,uBAAiB,EAAC,CAAC;EAClC,CAAC,CAAC,MAAM;IACN;IACA;IACA,MAAMC,QAAQ,GAAG,QAAQ,GAAG,WAAW;IACvC,MAAM;MAAEC;IAAkB,CAAC,GAAG,OAAAC,SAAA,QAAAN,OAAA,CAAAjB,CAAA,IAAAA,CAAA,IAAAuB,SAAA,KAAAJ,IAAA,CAAAK,CAAA,IAAA5B,uBAAA,CAAAD,OAAA,CAAA6B,CAAA,KAAaH,QAAQ,CAAC;IACpD,OAAO,MAAMC,iBAAiB,CAAC,CAAC;EAClC;AACF","ignoreList":[]}
|
|
@@ -3,45 +3,32 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Platform Adapters
|
|
5
5
|
*
|
|
6
|
-
* Factory function to create the appropriate platform adapter
|
|
7
|
-
*
|
|
8
|
-
* Uses dynamic imports for Node.js adapter to avoid Metro bundling Node-specific code
|
|
9
|
-
* in React Native environments.
|
|
6
|
+
* Factory function to create the appropriate platform adapter.
|
|
7
|
+
* Supports Expo 54 (frontend) and Node.js (backend).
|
|
10
8
|
*/
|
|
11
9
|
|
|
12
10
|
import { createExpoAdapter } from './expo';
|
|
13
11
|
/**
|
|
14
12
|
* Detect platform and create appropriate adapter
|
|
15
13
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* Simple detection: Expo (frontend) or Node.js (backend)
|
|
15
|
+
* Uses dynamic import with constructed path to avoid Metro static analysis
|
|
18
16
|
*/
|
|
19
17
|
export async function createPlatformAdapter() {
|
|
20
|
-
// Detect
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} catch {
|
|
35
|
-
// Cannot import react-native, we're in pure Node.js
|
|
36
|
-
// Use dynamic import to avoid Metro processing Node-specific code
|
|
37
|
-
const {
|
|
38
|
-
createNodeAdapter
|
|
39
|
-
} = await import('./node/index.js');
|
|
40
|
-
return await createNodeAdapter();
|
|
41
|
-
}
|
|
18
|
+
// Detect React Native/Expo first (frontend)
|
|
19
|
+
// If we can import react-native, we're in Expo environment
|
|
20
|
+
try {
|
|
21
|
+
await import('react-native');
|
|
22
|
+
// Expo (React Native or Web)
|
|
23
|
+
return await createExpoAdapter();
|
|
24
|
+
} catch {
|
|
25
|
+
// Not Expo, must be Node.js (backend)
|
|
26
|
+
// Construct path dynamically to avoid Metro static analysis
|
|
27
|
+
const nodePath = './node' + '/index.js';
|
|
28
|
+
const {
|
|
29
|
+
createNodeAdapter
|
|
30
|
+
} = await import(nodePath);
|
|
31
|
+
return await createNodeAdapter();
|
|
42
32
|
}
|
|
43
|
-
|
|
44
|
-
// Default: Expo adapter (React Native or Web)
|
|
45
|
-
return await createExpoAdapter();
|
|
46
33
|
}
|
|
47
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createExpoAdapter","createPlatformAdapter","
|
|
1
|
+
{"version":3,"names":["createExpoAdapter","createPlatformAdapter","nodePath","createNodeAdapter"],"sourceRoot":"../../../src","sources":["adapters/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,iBAAiB,QAAqD,QAAQ;AAKvF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,qBAAqBA,CAAA,EAA6B;EACtE;EACA;EACA,IAAI;IACF,MAAM,MAAM,CAAC,cAAc,CAAC;IAC5B;IACA,OAAO,MAAMD,iBAAiB,CAAC,CAAC;EAClC,CAAC,CAAC,MAAM;IACN;IACA;IACA,MAAME,QAAQ,GAAG,QAAQ,GAAG,WAAW;IACvC,MAAM;MAAEC;IAAkB,CAAC,GAAG,MAAM,MAAM,CAACD,QAAQ,CAAC;IACpD,OAAO,MAAMC,iBAAiB,CAAC,CAAC;EAClC;AACF","ignoreList":[]}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Platform Adapters
|
|
3
3
|
*
|
|
4
|
-
* Factory function to create the appropriate platform adapter
|
|
5
|
-
*
|
|
6
|
-
* Uses dynamic imports for Node.js adapter to avoid Metro bundling Node-specific code
|
|
7
|
-
* in React Native environments.
|
|
4
|
+
* Factory function to create the appropriate platform adapter.
|
|
5
|
+
* Supports Expo 54 (frontend) and Node.js (backend).
|
|
8
6
|
*/
|
|
9
7
|
import { type PlatformAdapter as ExpoPlatformAdapter } from './expo';
|
|
10
8
|
import type { PlatformAdapter as NodePlatformAdapter } from './node';
|
|
@@ -12,8 +10,8 @@ export type PlatformAdapter = ExpoPlatformAdapter | NodePlatformAdapter;
|
|
|
12
10
|
/**
|
|
13
11
|
* Detect platform and create appropriate adapter
|
|
14
12
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* Simple detection: Expo (frontend) or Node.js (backend)
|
|
14
|
+
* Uses dynamic import with constructed path to avoid Metro static analysis
|
|
17
15
|
*/
|
|
18
16
|
export declare function createPlatformAdapter(): Promise<PlatformAdapter>;
|
|
19
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAqB,KAAK,eAAe,IAAI,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAErE,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAExE;;;;;GAKG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,eAAe,CAAC,CActE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "5.16.
|
|
3
|
+
"version": "5.16.43",
|
|
4
4
|
"description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
package/src/adapters/index.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Platform Adapters
|
|
3
3
|
*
|
|
4
|
-
* Factory function to create the appropriate platform adapter
|
|
5
|
-
*
|
|
6
|
-
* Uses dynamic imports for Node.js adapter to avoid Metro bundling Node-specific code
|
|
7
|
-
* in React Native environments.
|
|
4
|
+
* Factory function to create the appropriate platform adapter.
|
|
5
|
+
* Supports Expo 54 (frontend) and Node.js (backend).
|
|
8
6
|
*/
|
|
9
7
|
|
|
10
8
|
import { createExpoAdapter, type PlatformAdapter as ExpoPlatformAdapter } from './expo';
|
|
@@ -15,33 +13,22 @@ export type PlatformAdapter = ExpoPlatformAdapter | NodePlatformAdapter;
|
|
|
15
13
|
/**
|
|
16
14
|
* Detect platform and create appropriate adapter
|
|
17
15
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* Simple detection: Expo (frontend) or Node.js (backend)
|
|
17
|
+
* Uses dynamic import with constructed path to avoid Metro static analysis
|
|
20
18
|
*/
|
|
21
19
|
export async function createPlatformAdapter(): Promise<PlatformAdapter> {
|
|
22
|
-
// Detect
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// If we can import react-native, we're in React Native environment
|
|
35
|
-
return await createExpoAdapter();
|
|
36
|
-
} catch {
|
|
37
|
-
// Cannot import react-native, we're in pure Node.js
|
|
38
|
-
// Use dynamic import to avoid Metro processing Node-specific code
|
|
39
|
-
const { createNodeAdapter } = await import('./node/index.js');
|
|
40
|
-
return await createNodeAdapter();
|
|
41
|
-
}
|
|
20
|
+
// Detect React Native/Expo first (frontend)
|
|
21
|
+
// If we can import react-native, we're in Expo environment
|
|
22
|
+
try {
|
|
23
|
+
await import('react-native');
|
|
24
|
+
// Expo (React Native or Web)
|
|
25
|
+
return await createExpoAdapter();
|
|
26
|
+
} catch {
|
|
27
|
+
// Not Expo, must be Node.js (backend)
|
|
28
|
+
// Construct path dynamically to avoid Metro static analysis
|
|
29
|
+
const nodePath = './node' + '/index.js';
|
|
30
|
+
const { createNodeAdapter } = await import(nodePath);
|
|
31
|
+
return await createNodeAdapter();
|
|
42
32
|
}
|
|
43
|
-
|
|
44
|
-
// Default: Expo adapter (React Native or Web)
|
|
45
|
-
return await createExpoAdapter();
|
|
46
33
|
}
|
|
47
34
|
|