@webority/mobile-core 0.170.0 → 0.171.0

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.adaptExpoFileSystem=void 0;var _guards=require("../../utils/guards.js");const asDirectoryPath=e=>e.replace(/\/+$/,""),isExpoFileSystemModule=e=>{if(!(0,_guards.isRecord)(e)||"function"!=typeof e.File||"function"!=typeof e.Directory)return!1;if("function"!=typeof e.File.prototype?.write)return!1;const{Paths:t}=e;return(0,_guards.isRecord)(t)&&(0,_guards.isRecord)(t.document)&&"string"==typeof t.document.uri&&(0,_guards.isRecord)(t.cache)&&"string"==typeof t.cache.uri},adaptExpoFileSystem=e=>{const t=(0,_guards.isRecord)(e)?e.default??e:e;if(!isExpoFileSystemModule(t))return null;const{File:r,Directory:s,Paths:i}=t,o=asDirectoryPath(i.document.uri);return{dirs:{documents:o,cache:asDirectoryPath(i.cache.uri),downloads:o},write:async(e,t)=>{const s=new r(e);s.create({intermediates:!0,overwrite:!0}),await s.write(t)},exists:e=>Promise.resolve(new r(e).exists),stat:e=>Promise.resolve({size:new r(e).size}),unlink:e=>(new r(e).delete(),Promise.resolve()),mkdir:e=>(new s(e).create({intermediates:!0,idempotent:!0}),Promise.resolve())}};exports.adaptExpoFileSystem=adaptExpoFileSystem;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.adaptExpoFileSystem=void 0;var _guards=require("../../utils/guards.js");const asDirectoryPath=e=>e.replace(/\/+$/,""),hasMembers=e=>"object"==typeof e&&null!==e||"function"==typeof e,isExpoFileSystemModule=e=>{if(!(0,_guards.isRecord)(e)||"function"!=typeof e.File||"function"!=typeof e.Directory)return!1;if("function"!=typeof e.File.prototype?.write)return!1;const{Paths:t}=e;return hasMembers(t)&&hasMembers(t.document)&&"string"==typeof t.document.uri&&hasMembers(t.cache)&&"string"==typeof t.cache.uri},adaptExpoFileSystem=e=>{const t=(0,_guards.isRecord)(e)?e.default??e:e;if(!isExpoFileSystemModule(t))return null;const{File:r,Directory:s,Paths:i}=t,o=asDirectoryPath(i.document.uri);return{dirs:{documents:o,cache:asDirectoryPath(i.cache.uri),downloads:o},write:async(e,t)=>{const s=new r(e);s.create({intermediates:!0,overwrite:!0}),await s.write(t)},exists:e=>Promise.resolve(new r(e).exists),stat:e=>Promise.resolve({size:new r(e).size}),unlink:e=>(new r(e).delete(),Promise.resolve()),mkdir:e=>(new s(e).create({intermediates:!0,idempotent:!0}),Promise.resolve())}};exports.adaptExpoFileSystem=adaptExpoFileSystem;
@@ -1 +1 @@
1
- "use strict";import{isRecord}from"../../utils/guards.js";const asDirectoryPath=e=>e.replace(/\/+$/,""),isExpoFileSystemModule=e=>{if(!isRecord(e)||"function"!=typeof e.File||"function"!=typeof e.Directory)return!1;if("function"!=typeof e.File.prototype?.write)return!1;const{Paths:t}=e;return isRecord(t)&&isRecord(t.document)&&"string"==typeof t.document.uri&&isRecord(t.cache)&&"string"==typeof t.cache.uri};export const adaptExpoFileSystem=e=>{const t=isRecord(e)?e.default??e:e;if(!isExpoFileSystemModule(t))return null;const{File:r,Directory:i,Paths:o}=t,s=asDirectoryPath(o.document.uri);return{dirs:{documents:s,cache:asDirectoryPath(o.cache.uri),downloads:s},write:async(e,t)=>{const i=new r(e);i.create({intermediates:!0,overwrite:!0}),await i.write(t)},exists:e=>Promise.resolve(new r(e).exists),stat:e=>Promise.resolve({size:new r(e).size}),unlink:e=>(new r(e).delete(),Promise.resolve()),mkdir:e=>(new i(e).create({intermediates:!0,idempotent:!0}),Promise.resolve())}};
1
+ "use strict";import{isRecord}from"../../utils/guards.js";const asDirectoryPath=e=>e.replace(/\/+$/,""),hasMembers=e=>"object"==typeof e&&null!==e||"function"==typeof e,isExpoFileSystemModule=e=>{if(!isRecord(e)||"function"!=typeof e.File||"function"!=typeof e.Directory)return!1;if("function"!=typeof e.File.prototype?.write)return!1;const{Paths:t}=e;return hasMembers(t)&&hasMembers(t.document)&&"string"==typeof t.document.uri&&hasMembers(t.cache)&&"string"==typeof t.cache.uri};export const adaptExpoFileSystem=e=>{const t=isRecord(e)?e.default??e:e;if(!isExpoFileSystemModule(t))return null;const{File:r,Directory:s,Paths:i}=t,o=asDirectoryPath(i.document.uri);return{dirs:{documents:o,cache:asDirectoryPath(i.cache.uri),downloads:o},write:async(e,t)=>{const s=new r(e);s.create({intermediates:!0,overwrite:!0}),await s.write(t)},exists:e=>Promise.resolve(new r(e).exists),stat:e=>Promise.resolve({size:new r(e).size}),unlink:e=>(new r(e).delete(),Promise.resolve()),mkdir:e=>(new s(e).create({intermediates:!0,idempotent:!0}),Promise.resolve())}};
@@ -1,6 +1,6 @@
1
1
  import type { FileSystemLike } from "../index";
2
2
  /**
3
- * expo-file-system. Shape verified against 57.0.6, where the legacy function
3
+ * expo-file-system. Shape verified against 57.0.6 and 58.0.13 (`Paths` is a plain object in 57 and a class with static getters in 58); in both, the legacy function
4
4
  * API (`downloadAsync`, `getInfoAsync`) still exists on the main entry point
5
5
  * but every one of those functions THROWS at runtime; they now live behind
6
6
  * `expo-file-system/legacy`. This adapter therefore uses the class API only.
@@ -1,6 +1,6 @@
1
1
  import type { FileSystemLike } from "../index.js";
2
2
  /**
3
- * expo-file-system. Shape verified against 57.0.6, where the legacy function
3
+ * expo-file-system. Shape verified against 57.0.6 and 58.0.13 (`Paths` is a plain object in 57 and a class with static getters in 58); in both, the legacy function
4
4
  * API (`downloadAsync`, `getInfoAsync`) still exists on the main entry point
5
5
  * but every one of those functions THROWS at runtime; they now live behind
6
6
  * `expo-file-system/legacy`. This adapter therefore uses the class API only.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/mobile-core",
3
- "version": "0.170.0",
3
+ "version": "0.171.0",
4
4
  "description": "Platform layer for Webority React Native apps: HTTP clients, auth/token storage, config, logging, formatters, validators, network status, permissions, storage, version checks and over-the-air updates. No UI.",
5
5
  "keywords": [
6
6
  "react-native",
@@ -399,7 +399,7 @@
399
399
  }
400
400
  },
401
401
  "dependencies": {
402
- "@webority/api-contract": "0.170.0",
402
+ "@webority/api-contract": "0.171.0",
403
403
  "axios": "^1.19.0",
404
404
  "libphonenumber-js": "^1.12.41"
405
405
  },