@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.
@@ -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
- * Uses dynamic imports for Node.js adapter to ensure Metro doesn't process
20
- * Node-specific code (like 'crypto' module) in React Native bundles.
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 if we're in Node.js environment
24
- const isNode = typeof process !== 'undefined' && process.versions?.node != null;
25
-
26
- // Detect if we're in React Native
27
- const isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
28
-
29
- // If we're in Node.js AND not React Native, consider using Node adapter
30
- if (isNode && !isReactNative) {
31
- // Double-check: try to import react-native to confirm we're not in React Native
32
- // This is a safety check for edge cases where Node.js might be available but we're in RN
33
- try {
34
- await Promise.resolve().then(() => _interopRequireWildcard(require('react-native')));
35
- // If we can import react-native, we're in React Native environment
36
- return await (0, _expo.createExpoAdapter)();
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","isNode","process","versions","node","isReactNative","navigator","product","Promise","resolve","then","createExpoAdapter","createNodeAdapter"],"sourceRoot":"../../../src","sources":["adapters/index.ts"],"mappings":";;;;;;AASA,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,QA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A,MAAM;QAAEC;MAAkB,CAAC,GAAG,MAAAJ,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAA9B,uBAAA,CAAAD,OAAA,CAAa,iBAAiB,GAAC;MAC7D,OAAO,MAAMiC,iBAAiB,CAAC,CAAC;IAClC;EACF;;EAEA;EACA,OAAO,MAAM,IAAAD,uBAAiB,EAAC,CAAC;AAClC","ignoreList":[]}
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
- * Uses dynamic imports for Node.js adapter to ensure Metro doesn't process
17
- * Node-specific code (like 'crypto' module) in React Native bundles.
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 if we're in Node.js environment
21
- const isNode = typeof process !== 'undefined' && process.versions?.node != null;
22
-
23
- // Detect if we're in React Native
24
- const isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
25
-
26
- // If we're in Node.js AND not React Native, consider using Node adapter
27
- if (isNode && !isReactNative) {
28
- // Double-check: try to import react-native to confirm we're not in React Native
29
- // This is a safety check for edge cases where Node.js might be available but we're in RN
30
- try {
31
- await import('react-native');
32
- // If we can import react-native, we're in React Native environment
33
- return await createExpoAdapter();
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","isNode","process","versions","node","isReactNative","navigator","product","createNodeAdapter"],"sourceRoot":"../../../src","sources":["adapters/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,iBAAiB,QAAqD,QAAQ;AAKvF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,qBAAqBA,CAAA,EAA6B;EACtE;EACA,MAAMC,MAAM,GAAG,OAAOC,OAAO,KAAK,WAAW,IAAIA,OAAO,CAACC,QAAQ,EAAEC,IAAI,IAAI,IAAI;;EAE/E;EACA,MAAMC,aAAa,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,OAAO,KAAK,aAAa;;EAE7F;EACA,IAAIN,MAAM,IAAI,CAACI,aAAa,EAAE;IAC5B;IACA;IACA,IAAI;MACF,MAAM,MAAM,CAAC,cAAc,CAAC;MAC5B;MACA,OAAO,MAAMN,iBAAiB,CAAC,CAAC;IAClC,CAAC,CAAC,MAAM;MACN;MACA;MACA,MAAM;QAAES;MAAkB,CAAC,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;MAC7D,OAAO,MAAMA,iBAAiB,CAAC,CAAC;IAClC;EACF;;EAEA;EACA,OAAO,MAAMT,iBAAiB,CAAC,CAAC;AAClC","ignoreList":[]}
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
- * Uses dynamic imports for Node.js adapter to ensure Metro doesn't process
16
- * Node-specific code (like 'crypto' module) in React Native bundles.
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;;;;;;;GAOG;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,CAyBtE"}
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.42",
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",
@@ -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
- * Uses dynamic imports for Node.js adapter to ensure Metro doesn't process
19
- * Node-specific code (like 'crypto' module) in React Native bundles.
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 if we're in Node.js environment
23
- const isNode = typeof process !== 'undefined' && process.versions?.node != null;
24
-
25
- // Detect if we're in React Native
26
- const isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
27
-
28
- // If we're in Node.js AND not React Native, consider using Node adapter
29
- if (isNode && !isReactNative) {
30
- // Double-check: try to import react-native to confirm we're not in React Native
31
- // This is a safety check for edge cases where Node.js might be available but we're in RN
32
- try {
33
- await import('react-native');
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