@webority/mobile-core 0.176.0 → 0.177.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.
Files changed (76) hide show
  1. package/README.md +1 -1
  2. package/lib/commonjs/api/idempotencyKey.js +1 -1
  3. package/lib/commonjs/api/requestDefaults.js +1 -1
  4. package/lib/commonjs/api/tokenRefresh.js +1 -1
  5. package/lib/commonjs/api/userClient.js +1 -1
  6. package/lib/commonjs/auth/authStore.js +1 -1
  7. package/lib/commonjs/auth/index.js +1 -1
  8. package/lib/commonjs/errors/extractApiError.js +1 -1
  9. package/lib/commonjs/formatters/currency.js +1 -1
  10. package/lib/commonjs/formatters/date.js +1 -1
  11. package/lib/commonjs/formatters/dateMath.js +1 -1
  12. package/lib/commonjs/formatters/house.js +1 -1
  13. package/lib/commonjs/formatters/index.js +1 -1
  14. package/lib/commonjs/formatters/number.js +1 -1
  15. package/lib/commonjs/index.js +1 -1
  16. package/lib/commonjs/india/gstStates.js +1 -1
  17. package/lib/commonjs/initUserAuth.js +1 -1
  18. package/lib/commonjs/storage/index.js +1 -1
  19. package/lib/commonjs/versionCheck/index.js +1 -1
  20. package/lib/module/api/idempotencyKey.js +1 -1
  21. package/lib/module/api/requestDefaults.js +1 -1
  22. package/lib/module/api/tokenRefresh.js +1 -1
  23. package/lib/module/api/userClient.js +1 -1
  24. package/lib/module/auth/authStore.js +1 -1
  25. package/lib/module/auth/index.js +1 -1
  26. package/lib/module/errors/extractApiError.js +1 -1
  27. package/lib/module/formatters/currency.js +1 -1
  28. package/lib/module/formatters/date.js +1 -1
  29. package/lib/module/formatters/dateMath.js +1 -1
  30. package/lib/module/formatters/house.js +1 -1
  31. package/lib/module/formatters/index.js +1 -1
  32. package/lib/module/formatters/number.js +1 -1
  33. package/lib/module/index.js +1 -1
  34. package/lib/module/india/gstStates.js +1 -1
  35. package/lib/module/initUserAuth.js +1 -1
  36. package/lib/module/storage/index.js +1 -1
  37. package/lib/module/versionCheck/index.js +1 -1
  38. package/lib/typescript/commonjs/api/requestDefaults.d.ts +6 -4
  39. package/lib/typescript/commonjs/auth/authStore.d.ts +1 -23
  40. package/lib/typescript/commonjs/auth/index.d.ts +2 -2
  41. package/lib/typescript/commonjs/errors/extractApiError.d.ts +1 -1
  42. package/lib/typescript/commonjs/formatters/date.d.ts +2 -2
  43. package/lib/typescript/commonjs/formatters/dateMath.d.ts +2 -19
  44. package/lib/typescript/commonjs/formatters/house.d.ts +2 -4
  45. package/lib/typescript/commonjs/formatters/index.d.ts +1 -1
  46. package/lib/typescript/commonjs/formatters/number.d.ts +1 -1
  47. package/lib/typescript/commonjs/formatters/phone.d.ts +3 -1
  48. package/lib/typescript/commonjs/index.d.ts +6 -6
  49. package/lib/typescript/commonjs/india/gstStates.d.ts +1 -1
  50. package/lib/typescript/commonjs/initSDK.d.ts +4 -5
  51. package/lib/typescript/commonjs/initUserAuth.d.ts +0 -7
  52. package/lib/typescript/commonjs/network/networkStatus.d.ts +3 -3
  53. package/lib/typescript/commonjs/share/index.d.ts +3 -1
  54. package/lib/typescript/commonjs/storage/index.d.ts +5 -27
  55. package/lib/typescript/commonjs/utils/imageCompression.d.ts +3 -1
  56. package/lib/typescript/commonjs/versionCheck/index.d.ts +0 -30
  57. package/lib/typescript/module/api/requestDefaults.d.ts +6 -4
  58. package/lib/typescript/module/auth/authStore.d.ts +1 -23
  59. package/lib/typescript/module/auth/index.d.ts +2 -2
  60. package/lib/typescript/module/errors/extractApiError.d.ts +1 -1
  61. package/lib/typescript/module/formatters/date.d.ts +2 -2
  62. package/lib/typescript/module/formatters/dateMath.d.ts +2 -19
  63. package/lib/typescript/module/formatters/house.d.ts +2 -4
  64. package/lib/typescript/module/formatters/index.d.ts +1 -1
  65. package/lib/typescript/module/formatters/number.d.ts +1 -1
  66. package/lib/typescript/module/formatters/phone.d.ts +3 -1
  67. package/lib/typescript/module/index.d.ts +6 -6
  68. package/lib/typescript/module/india/gstStates.d.ts +1 -1
  69. package/lib/typescript/module/initSDK.d.ts +4 -5
  70. package/lib/typescript/module/initUserAuth.d.ts +0 -7
  71. package/lib/typescript/module/network/networkStatus.d.ts +3 -3
  72. package/lib/typescript/module/share/index.d.ts +3 -1
  73. package/lib/typescript/module/storage/index.d.ts +5 -27
  74. package/lib/typescript/module/utils/imageCompression.d.ts +3 -1
  75. package/lib/typescript/module/versionCheck/index.d.ts +0 -30
  76. package/package.json +2 -2
@@ -6,34 +6,12 @@ interface AsyncStorageLike {
6
6
  getItem: (key: string) => Promise<string | null>;
7
7
  setItem: (key: string, value: string) => Promise<void>;
8
8
  removeItem: (key: string) => Promise<void>;
9
- /**
10
- * The batch API exists under TWO names, and both are live in apps today.
11
- *
12
- * `@react-native-async-storage/async-storage` 3 renamed the v1 trio and
13
- * changed their shapes: `getMany` returns a Record where `multiGet` returned
14
- * pairs, and `setMany` takes a Record where `multiSet` took pairs. The v1
15
- * names are still what `expo-sqlite/kv-store` and AsyncStorage 2 expose.
16
- *
17
- * Declaring only one set is not a compile error and not a runtime error; it
18
- * silently falls through to the per-key loop below. Apps pin
19
- * AsyncStorage 3, so recognising only the v1 names put every consumer on N
20
- * round-trips per batch with nothing to notice.
21
- */
22
- getMany?: ((keys: string[]) => Promise<Record<string, string | null>>) | undefined;
23
- setMany?: ((entries: Record<string, string>) => Promise<void>) | undefined;
24
- removeMany?: ((keys: string[]) => Promise<void>) | undefined;
25
- multiGet?: ((keys: string[]) => Promise<readonly [string, string | null][]>) | undefined;
26
- multiSet?: ((kvs: [string, string][]) => Promise<void>) | undefined;
27
- multiRemove?: ((keys: string[]) => Promise<void>) | undefined;
28
- clear?: (() => Promise<void>) | undefined;
29
- getAllKeys?: (() => Promise<readonly string[]>) | undefined;
9
+ multiGet: (keys: string[]) => Promise<readonly [string, string | null][]>;
10
+ multiSet: (kvs: [string, string][]) => Promise<void>;
11
+ multiRemove: (keys: string[]) => Promise<void>;
12
+ clear: () => Promise<void>;
13
+ getAllKeys: () => Promise<readonly string[]>;
30
14
  }
31
- /**
32
- * Always true now that the backend ships with the library. Kept because callers
33
- * whose use of storage is an OPTIMISATION branch on it, and removing it would
34
- * be a breaking change for no gain.
35
- */
36
- export declare const isStorageAvailable: () => boolean;
37
15
  /**
38
16
  * Replace the storage backend. Intended for TESTS and for the showcase; an app
39
17
  * gets expo-sqlite/kv-store without wiring anything. Pass `null` to restore it.
@@ -96,7 +96,9 @@ export interface CompressedImage {
96
96
  /** The photo was missing, empty or undecodable, or could not be prepared for upload. */
97
97
  export declare class ImageUnreadableError extends Error {
98
98
  readonly uri: string;
99
- constructor(reason: string, options: ErrorOptions & {
99
+ constructor(reason: string, options: {
100
+ cause?: unknown;
101
+ } & {
100
102
  uri: string;
101
103
  });
102
104
  }
@@ -1,11 +1,5 @@
1
1
  import { type Environment } from "../config/index.js";
2
2
  import { type DeviceInfoLike } from "./appBuild.js";
3
- /**
4
- * Supply the app identity from a native module instead of config.
5
- * Prefer `setConfig({ appId, appBuild })`. It needs no native dependency.
6
- * Pass `null` to clear.
7
- */
8
- export declare const setDeviceInfoImplementation: (impl: DeviceInfoLike | null) => void;
9
3
  export type Platform = "ios" | "android" | string;
10
4
  /**
11
5
  * A required update always reports `'major'`: the server states a minimum
@@ -13,29 +7,6 @@ export type Platform = "ios" | "android" | string;
13
7
  * already treat as "must update".
14
8
  */
15
9
  export type UpdateType = "major" | "minor" | "patch" | "prerelease" | null;
16
- /** @deprecated Store versions are no longer parsed; the minimum is a build number. */
17
- export interface ParsedVersion {
18
- major: number;
19
- minor: number;
20
- patch: number;
21
- prerelease: string;
22
- }
23
- /** @deprecated The store is no longer read; the minimum comes from `Min-App-Version`. */
24
- export interface VersionData {
25
- version: string | null;
26
- released?: string | null | undefined;
27
- releasedAt?: string | undefined;
28
- notes: string;
29
- url: string | null;
30
- country?: string | undefined;
31
- lastChecked: string;
32
- }
33
- /** @deprecated The store is no longer read; the minimum comes from `Min-App-Version`. */
34
- export interface VersionComparison {
35
- needsUpdate: boolean;
36
- updateType: UpdateType;
37
- notice?: string | undefined;
38
- }
39
10
  export interface VersionCheckResult {
40
11
  isNewVersionAvailable: boolean;
41
12
  updateType: UpdateType;
@@ -71,7 +42,6 @@ export declare const VersionCheck: VersionCheckType;
71
42
  * check runs in `'Production'` only
72
43
  */
73
44
  export declare const useVersionCheck: (isAppReady: boolean, environment?: Environment) => UpdateInfo;
74
- export default VersionCheck;
75
45
  export { readAppBuild } from "./appBuild.js";
76
46
  export { isBuildBelowMinimum, parseBuildNumber } from "./buildNumber.js";
77
47
  export type { DeviceInfoLike };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/mobile-core",
3
- "version": "0.176.0",
3
+ "version": "0.177.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.176.0",
402
+ "@webority/api-contract": "0.177.0",
403
403
  "axios": "^1.19.0",
404
404
  "libphonenumber-js": "^1.12.41"
405
405
  },