@webority/mobile-core 0.149.0 → 0.152.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 (251) hide show
  1. package/README.md +47 -0
  2. package/lib/commonjs/api/baseUrl.js +1 -1
  3. package/lib/commonjs/api/contractCaller.js +1 -0
  4. package/lib/commonjs/api/curl.js +1 -1
  5. package/lib/commonjs/api/minAppVersion.js +1 -1
  6. package/lib/commonjs/api/requestDefaults.js +1 -1
  7. package/lib/commonjs/api/retry.js +1 -1
  8. package/lib/commonjs/api/tokenRefresh.js +1 -1
  9. package/lib/commonjs/api/userClient.js +1 -1
  10. package/lib/commonjs/api/workspace.js +1 -1
  11. package/lib/commonjs/auth/authStore.js +1 -1
  12. package/lib/commonjs/auth/jwt.js +1 -1
  13. package/lib/commonjs/deepLink/index.js +1 -1
  14. package/lib/commonjs/download/adapters/expoFs.js +1 -1
  15. package/lib/commonjs/download/index.js +1 -1
  16. package/lib/commonjs/errors/extractApiError.js +1 -1
  17. package/lib/commonjs/errors/index.js +1 -1
  18. package/lib/commonjs/errors/parseResponse.js +1 -0
  19. package/lib/commonjs/errors/requestPlatform.js +1 -0
  20. package/lib/commonjs/formatters/currency.js +1 -1
  21. package/lib/commonjs/formatters/date.js +1 -1
  22. package/lib/commonjs/formatters/dateMath.js +1 -1
  23. package/lib/commonjs/formatters/formatConfig.js +1 -1
  24. package/lib/commonjs/formatters/house.js +1 -1
  25. package/lib/commonjs/formatters/number.js +1 -1
  26. package/lib/commonjs/formatters/phone.js +1 -1
  27. package/lib/commonjs/geolocation/index.js +1 -1
  28. package/lib/commonjs/index.js +1 -1
  29. package/lib/commonjs/india/gstStates.js +1 -0
  30. package/lib/commonjs/india/index.js +1 -1
  31. package/lib/commonjs/jest/setup.js +1 -0
  32. package/lib/commonjs/logger/crashlytics.js +1 -1
  33. package/lib/commonjs/logger/index.js +1 -1
  34. package/lib/commonjs/logger/redact.js +1 -1
  35. package/lib/commonjs/network/networkStatus.js +1 -1
  36. package/lib/commonjs/outbox/outbox.js +1 -1
  37. package/lib/commonjs/outbox/types.js +1 -1
  38. package/lib/commonjs/push/broadcasts.js +1 -1
  39. package/lib/commonjs/push/push.js +1 -1
  40. package/lib/commonjs/query/apiBaseQuery.js +1 -1
  41. package/lib/commonjs/query/dataState.js +1 -0
  42. package/lib/commonjs/query/entityVersion.js +1 -0
  43. package/lib/commonjs/query/index.js +1 -1
  44. package/lib/commonjs/query/paging.js +1 -1
  45. package/lib/commonjs/query/persistedQueries.js +1 -1
  46. package/lib/commonjs/query/tags.js +1 -1
  47. package/lib/commonjs/query/usePagedList.js +1 -1
  48. package/lib/commonjs/redux/errorToastMiddleware.js +1 -1
  49. package/lib/commonjs/redux/rootReducer.js +1 -1
  50. package/lib/commonjs/redux/sessionMiddleware.js +1 -1
  51. package/lib/commonjs/review/index.js +1 -1
  52. package/lib/commonjs/secureScreen/index.js +1 -1
  53. package/lib/commonjs/sqlite/index.js +1 -1
  54. package/lib/commonjs/storage/index.js +1 -1
  55. package/lib/commonjs/types/complete.js +1 -0
  56. package/lib/commonjs/types/formData.d.js +1 -0
  57. package/lib/commonjs/updates/updates.js +1 -1
  58. package/lib/commonjs/utils/base64.js +1 -1
  59. package/lib/commonjs/utils/guards.js +1 -0
  60. package/lib/commonjs/utils/imageCompression.js +1 -1
  61. package/lib/module/api/baseUrl.js +1 -1
  62. package/lib/module/api/contractCaller.js +1 -0
  63. package/lib/module/api/curl.js +1 -1
  64. package/lib/module/api/minAppVersion.js +1 -1
  65. package/lib/module/api/requestDefaults.js +1 -1
  66. package/lib/module/api/retry.js +1 -1
  67. package/lib/module/api/tokenRefresh.js +1 -1
  68. package/lib/module/api/userClient.js +1 -1
  69. package/lib/module/api/workspace.js +1 -1
  70. package/lib/module/auth/authStore.js +1 -1
  71. package/lib/module/auth/jwt.js +1 -1
  72. package/lib/module/deepLink/index.js +1 -1
  73. package/lib/module/download/adapters/expoFs.js +1 -1
  74. package/lib/module/download/index.js +1 -1
  75. package/lib/module/errors/extractApiError.js +1 -1
  76. package/lib/module/errors/index.js +1 -1
  77. package/lib/module/errors/parseResponse.js +1 -0
  78. package/lib/module/errors/requestPlatform.js +1 -0
  79. package/lib/module/formatters/currency.js +1 -1
  80. package/lib/module/formatters/date.js +1 -1
  81. package/lib/module/formatters/dateMath.js +1 -1
  82. package/lib/module/formatters/formatConfig.js +1 -1
  83. package/lib/module/formatters/house.js +1 -1
  84. package/lib/module/formatters/number.js +1 -1
  85. package/lib/module/formatters/phone.js +1 -1
  86. package/lib/module/geolocation/index.js +1 -1
  87. package/lib/module/index.js +1 -1
  88. package/lib/module/india/gstStates.js +1 -0
  89. package/lib/module/india/index.js +1 -1
  90. package/lib/module/jest/setup.js +1 -0
  91. package/lib/module/logger/crashlytics.js +1 -1
  92. package/lib/module/logger/index.js +1 -1
  93. package/lib/module/logger/redact.js +1 -1
  94. package/lib/module/network/networkStatus.js +1 -1
  95. package/lib/module/outbox/outbox.js +1 -1
  96. package/lib/module/outbox/types.js +1 -1
  97. package/lib/module/push/broadcasts.js +1 -1
  98. package/lib/module/push/push.js +1 -1
  99. package/lib/module/query/apiBaseQuery.js +1 -1
  100. package/lib/module/query/dataState.js +1 -0
  101. package/lib/module/query/entityVersion.js +1 -0
  102. package/lib/module/query/index.js +1 -1
  103. package/lib/module/query/paging.js +1 -1
  104. package/lib/module/query/persistedQueries.js +1 -1
  105. package/lib/module/query/tags.js +1 -1
  106. package/lib/module/query/usePagedList.js +1 -1
  107. package/lib/module/redux/errorToastMiddleware.js +1 -1
  108. package/lib/module/redux/rootReducer.js +1 -1
  109. package/lib/module/redux/sessionMiddleware.js +1 -1
  110. package/lib/module/review/index.js +1 -1
  111. package/lib/module/secureScreen/index.js +1 -1
  112. package/lib/module/sqlite/index.js +1 -1
  113. package/lib/module/storage/index.js +1 -1
  114. package/lib/module/types/complete.js +1 -0
  115. package/lib/module/types/formData.d.js +1 -0
  116. package/lib/module/updates/updates.js +1 -1
  117. package/lib/module/utils/base64.js +1 -1
  118. package/lib/module/utils/guards.js +1 -0
  119. package/lib/module/utils/imageCompression.js +1 -1
  120. package/lib/typescript/commonjs/api/clientHeaders.d.ts +1 -1
  121. package/lib/typescript/commonjs/api/contractCaller.d.ts +7 -0
  122. package/lib/typescript/commonjs/api/fetchRetry.d.ts +3 -3
  123. package/lib/typescript/commonjs/api/minAppVersion.d.ts +1 -1
  124. package/lib/typescript/commonjs/api/retry.d.ts +11 -5
  125. package/lib/typescript/commonjs/api/tokenRefresh.d.ts +2 -1
  126. package/lib/typescript/commonjs/api/userClient.d.ts +11 -0
  127. package/lib/typescript/commonjs/api/workspace.d.ts +3 -3
  128. package/lib/typescript/commonjs/appLock/index.d.ts +1 -1
  129. package/lib/typescript/commonjs/attachments/index.d.ts +5 -5
  130. package/lib/typescript/commonjs/auth/authStore.d.ts +8 -6
  131. package/lib/typescript/commonjs/auth/jwt.d.ts +11 -8
  132. package/lib/typescript/commonjs/deepLink/index.d.ts +18 -11
  133. package/lib/typescript/commonjs/download/adapters/expoFs.d.ts +4 -4
  134. package/lib/typescript/commonjs/download/index.d.ts +16 -12
  135. package/lib/typescript/commonjs/errors/extractApiError.d.ts +9 -17
  136. package/lib/typescript/commonjs/errors/index.d.ts +2 -0
  137. package/lib/typescript/commonjs/errors/parseResponse.d.ts +20 -0
  138. package/lib/typescript/commonjs/errors/requestPlatform.d.ts +8 -0
  139. package/lib/typescript/commonjs/formatters/currency.d.ts +5 -5
  140. package/lib/typescript/commonjs/formatters/dateMath.d.ts +2 -2
  141. package/lib/typescript/commonjs/formatters/formatConfig.d.ts +8 -6
  142. package/lib/typescript/commonjs/formatters/house.d.ts +19 -20
  143. package/lib/typescript/commonjs/formatters/intlCache.d.ts +1 -3
  144. package/lib/typescript/commonjs/formatters/phone.d.ts +3 -3
  145. package/lib/typescript/commonjs/geolocation/adapters/expoLocation.d.ts +11 -11
  146. package/lib/typescript/commonjs/geolocation/index.d.ts +29 -26
  147. package/lib/typescript/commonjs/index.d.ts +5 -2
  148. package/lib/typescript/commonjs/india/gstStates.d.ts +8 -0
  149. package/lib/typescript/commonjs/india/gstStates.g.d.ts +1 -1
  150. package/lib/typescript/commonjs/india/index.d.ts +1 -0
  151. package/lib/typescript/commonjs/initSDK.d.ts +14 -14
  152. package/lib/typescript/commonjs/initUserAuth.d.ts +9 -8
  153. package/lib/typescript/commonjs/jest/setup.d.ts +9 -0
  154. package/lib/typescript/commonjs/logger/crashlytics.d.ts +5 -4
  155. package/lib/typescript/commonjs/logger/index.d.ts +19 -19
  156. package/lib/typescript/commonjs/logger/redact.d.ts +3 -1
  157. package/lib/typescript/commonjs/metro/types.d.ts +4 -4
  158. package/lib/typescript/commonjs/network/networkStatus.d.ts +1 -1
  159. package/lib/typescript/commonjs/outbox/types.d.ts +6 -17
  160. package/lib/typescript/commonjs/permissions/index.d.ts +7 -4
  161. package/lib/typescript/commonjs/pickers/index.d.ts +18 -18
  162. package/lib/typescript/commonjs/push/push.d.ts +23 -23
  163. package/lib/typescript/commonjs/query/apiBaseQuery.d.ts +23 -14
  164. package/lib/typescript/commonjs/query/dataState.d.ts +76 -0
  165. package/lib/typescript/commonjs/query/entityVersion.d.ts +47 -0
  166. package/lib/typescript/commonjs/query/index.d.ts +5 -1
  167. package/lib/typescript/commonjs/query/paging.d.ts +6 -5
  168. package/lib/typescript/commonjs/query/persistedQueries.d.ts +12 -7
  169. package/lib/typescript/commonjs/query/usePagedList.d.ts +11 -18
  170. package/lib/typescript/commonjs/redux/errorToastMiddleware.d.ts +4 -4
  171. package/lib/typescript/commonjs/redux/rootReducer.d.ts +1 -1
  172. package/lib/typescript/commonjs/review/index.d.ts +1 -1
  173. package/lib/typescript/commonjs/secureScreen/index.d.ts +1 -1
  174. package/lib/typescript/commonjs/share/index.d.ts +2 -2
  175. package/lib/typescript/commonjs/sqlite/index.d.ts +21 -16
  176. package/lib/typescript/commonjs/storage/index.d.ts +9 -9
  177. package/lib/typescript/commonjs/types/axios.d.ts +10 -2
  178. package/lib/typescript/commonjs/types/complete.d.ts +5 -0
  179. package/lib/typescript/commonjs/updates/updates.d.ts +20 -20
  180. package/lib/typescript/commonjs/utils/guards.d.ts +9 -0
  181. package/lib/typescript/commonjs/utils/imageCompression.d.ts +9 -9
  182. package/lib/typescript/commonjs/validators/index.d.ts +5 -5
  183. package/lib/typescript/commonjs/versionCheck/appBuild.d.ts +3 -2
  184. package/lib/typescript/commonjs/versionCheck/index.d.ts +4 -4
  185. package/lib/typescript/module/api/clientHeaders.d.ts +1 -1
  186. package/lib/typescript/module/api/contractCaller.d.ts +7 -0
  187. package/lib/typescript/module/api/fetchRetry.d.ts +3 -3
  188. package/lib/typescript/module/api/minAppVersion.d.ts +1 -1
  189. package/lib/typescript/module/api/retry.d.ts +11 -5
  190. package/lib/typescript/module/api/tokenRefresh.d.ts +2 -1
  191. package/lib/typescript/module/api/userClient.d.ts +11 -0
  192. package/lib/typescript/module/api/workspace.d.ts +3 -3
  193. package/lib/typescript/module/appLock/index.d.ts +1 -1
  194. package/lib/typescript/module/attachments/index.d.ts +5 -5
  195. package/lib/typescript/module/auth/authStore.d.ts +8 -6
  196. package/lib/typescript/module/auth/jwt.d.ts +11 -8
  197. package/lib/typescript/module/deepLink/index.d.ts +18 -11
  198. package/lib/typescript/module/download/adapters/expoFs.d.ts +4 -4
  199. package/lib/typescript/module/download/index.d.ts +16 -12
  200. package/lib/typescript/module/errors/extractApiError.d.ts +9 -17
  201. package/lib/typescript/module/errors/index.d.ts +2 -0
  202. package/lib/typescript/module/errors/parseResponse.d.ts +20 -0
  203. package/lib/typescript/module/errors/requestPlatform.d.ts +8 -0
  204. package/lib/typescript/module/formatters/currency.d.ts +5 -5
  205. package/lib/typescript/module/formatters/dateMath.d.ts +2 -2
  206. package/lib/typescript/module/formatters/formatConfig.d.ts +8 -6
  207. package/lib/typescript/module/formatters/house.d.ts +19 -20
  208. package/lib/typescript/module/formatters/intlCache.d.ts +1 -3
  209. package/lib/typescript/module/formatters/phone.d.ts +3 -3
  210. package/lib/typescript/module/geolocation/adapters/expoLocation.d.ts +11 -11
  211. package/lib/typescript/module/geolocation/index.d.ts +29 -26
  212. package/lib/typescript/module/index.d.ts +5 -2
  213. package/lib/typescript/module/india/gstStates.d.ts +8 -0
  214. package/lib/typescript/module/india/gstStates.g.d.ts +1 -1
  215. package/lib/typescript/module/india/index.d.ts +1 -0
  216. package/lib/typescript/module/initSDK.d.ts +14 -14
  217. package/lib/typescript/module/initUserAuth.d.ts +9 -8
  218. package/lib/typescript/module/jest/setup.d.ts +9 -0
  219. package/lib/typescript/module/logger/crashlytics.d.ts +5 -4
  220. package/lib/typescript/module/logger/index.d.ts +19 -19
  221. package/lib/typescript/module/logger/redact.d.ts +3 -1
  222. package/lib/typescript/module/metro/types.d.ts +4 -4
  223. package/lib/typescript/module/network/networkStatus.d.ts +1 -1
  224. package/lib/typescript/module/outbox/types.d.ts +6 -17
  225. package/lib/typescript/module/permissions/index.d.ts +7 -4
  226. package/lib/typescript/module/pickers/index.d.ts +18 -18
  227. package/lib/typescript/module/push/push.d.ts +23 -23
  228. package/lib/typescript/module/query/apiBaseQuery.d.ts +23 -14
  229. package/lib/typescript/module/query/dataState.d.ts +76 -0
  230. package/lib/typescript/module/query/entityVersion.d.ts +47 -0
  231. package/lib/typescript/module/query/index.d.ts +5 -1
  232. package/lib/typescript/module/query/paging.d.ts +6 -5
  233. package/lib/typescript/module/query/persistedQueries.d.ts +12 -7
  234. package/lib/typescript/module/query/usePagedList.d.ts +11 -18
  235. package/lib/typescript/module/redux/errorToastMiddleware.d.ts +4 -4
  236. package/lib/typescript/module/redux/rootReducer.d.ts +1 -1
  237. package/lib/typescript/module/review/index.d.ts +1 -1
  238. package/lib/typescript/module/secureScreen/index.d.ts +1 -1
  239. package/lib/typescript/module/share/index.d.ts +2 -2
  240. package/lib/typescript/module/sqlite/index.d.ts +21 -16
  241. package/lib/typescript/module/storage/index.d.ts +9 -9
  242. package/lib/typescript/module/types/axios.d.ts +10 -2
  243. package/lib/typescript/module/types/complete.d.ts +5 -0
  244. package/lib/typescript/module/updates/updates.d.ts +20 -20
  245. package/lib/typescript/module/utils/guards.d.ts +9 -0
  246. package/lib/typescript/module/utils/imageCompression.d.ts +9 -9
  247. package/lib/typescript/module/validators/index.d.ts +5 -5
  248. package/lib/typescript/module/versionCheck/appBuild.d.ts +3 -2
  249. package/lib/typescript/module/versionCheck/index.d.ts +4 -4
  250. package/package.json +14 -2
  251. package/src/specs/NativeSmsRetriever.ts +1 -1
@@ -7,7 +7,7 @@ export declare const mimeTypeFromFileName: (fileName: string | null | undefined)
7
7
  export interface AttachmentRequest {
8
8
  url: string;
9
9
  fileName: string;
10
- mimeType?: string | null;
10
+ mimeType?: string | null | undefined;
11
11
  }
12
12
  /**
13
13
  * Fetches a file through the signed-in client into the app's cache, where a viewer or a save reads it. Answers with
@@ -16,7 +16,7 @@ export interface AttachmentRequest {
16
16
  export declare const fetchAttachment: ({ url, fileName, mimeType }: AttachmentRequest) => Promise<DownloadResult>;
17
17
  export interface PreviewAttachment {
18
18
  path: string;
19
- mimeType?: string;
19
+ mimeType?: string | undefined;
20
20
  folder: string;
21
21
  }
22
22
  /**
@@ -26,12 +26,12 @@ export interface PreviewAttachment {
26
26
  */
27
27
  export declare const fetchPreviewAttachment: ({ cacheId, version, url, fileName, mimeType, }: AttachmentRequest & {
28
28
  cacheId: string;
29
- version?: string | null;
29
+ version?: string | null | undefined;
30
30
  }) => Promise<PreviewAttachment | DownloadResult>;
31
31
  export type PreviewKind = "image" | "pdf";
32
32
  /** What the app can show itself, from a content type or a file name: "image", "pdf", or null for anything else. */
33
33
  export declare const previewKind: (file: {
34
- contentType?: string | null;
35
- name?: string | null;
34
+ contentType?: string | null | undefined;
35
+ name?: string | null | undefined;
36
36
  }) => PreviewKind | null;
37
37
  //# sourceMappingURL=index.d.ts.map
@@ -51,7 +51,7 @@ export interface LegacyTokenKeys {
51
51
  accessToken: string;
52
52
  refreshToken: string;
53
53
  /** The old key of the signed-in user's profile snapshot, if the app kept one. */
54
- sessionUser?: string;
54
+ sessionUser?: string | undefined;
55
55
  }
56
56
  /**
57
57
  * The expiry given to a migrated refresh token whose expiry the old store never kept and which
@@ -93,13 +93,13 @@ interface SecureCredentials {
93
93
  }
94
94
  interface KeychainLike {
95
95
  setGenericPassword: (username: string, password: string, options?: {
96
- service?: string;
96
+ service?: string | undefined;
97
97
  }) => Promise<unknown>;
98
98
  getGenericPassword: (options?: {
99
- service?: string;
99
+ service?: string | undefined;
100
100
  }) => Promise<SecureCredentials | false>;
101
101
  resetGenericPassword: (options?: {
102
- service?: string;
102
+ service?: string | undefined;
103
103
  }) => Promise<unknown>;
104
104
  }
105
105
  /**
@@ -113,7 +113,9 @@ export declare const setKeychainImplementation: (impl: KeychainLike | null) => v
113
113
  */
114
114
  export declare const storeToken: (key: string, token: string, expiry: string) => Promise<void>;
115
115
  /**
116
- * Retrieve token and check if expired.
116
+ * Retrieve token and check if expired. Rejects when the store cannot be read
117
+ * (other than an invalidated key, which is cleared and read as no token), and
118
+ * when a legacy session move fails.
117
119
  */
118
120
  export declare const getToken: (key: string) => Promise<StoredToken | null>;
119
121
  /**
@@ -130,7 +132,7 @@ export declare const storeSessionUser: <T>(user: T) => Promise<void>;
130
132
  * The stored user, or null. An unreadable snapshot is removed and reported,
131
133
  * but does not end the session: it is a cache the next profile fetch refills.
132
134
  */
133
- export declare const getSessionUser: <T>() => Promise<T | null>;
135
+ export declare const getSessionUser: <T>(parse: (value: unknown) => T) => Promise<T | null>;
134
136
  export declare const removeSessionUser: () => Promise<void>;
135
137
  /** Set by `initUserAuth({ legacyKeys })`; `null` turns the migration off. */
136
138
  export declare const setLegacyTokenKeys: (keys: LegacyTokenKeys | null) => void;
@@ -3,20 +3,23 @@
3
3
  * `sub`, `exp`, `iat`, `nbf` follow RFC 7519 conventions.
4
4
  */
5
5
  export interface JwtClaims {
6
- sub?: string;
7
- exp?: number;
8
- iat?: number;
9
- nbf?: number;
10
- iss?: string;
11
- aud?: string | string[];
6
+ sub?: string | undefined;
7
+ exp?: number | undefined;
8
+ iat?: number | undefined;
9
+ nbf?: number | undefined;
10
+ iss?: string | undefined;
11
+ aud?: string | string[] | undefined;
12
12
  [key: string]: unknown;
13
13
  }
14
14
  /**
15
15
  * Decode a JWT's payload claims. Does **not** verify the signature.
16
16
  *
17
- * @returns claims object on success, `null` if the token is malformed.
17
+ * Without `parse`, returns the claims. With `parse`, returns what `parse` builds from them; a throw from `parse` propagates.
18
+ *
19
+ * @returns claims (or the value `parse` returns) on success, `null` if the token is malformed or a standard claim has the wrong type.
18
20
  */
19
- export declare const decodeJWT: <T extends JwtClaims = JwtClaims>(token: string) => T | null;
21
+ export declare function decodeJWT(token: string): JwtClaims | null;
22
+ export declare function decodeJWT<T>(token: string, parse: (claims: JwtClaims) => T): T | null;
20
23
  /**
21
24
  * Returns true when the token is expired (or unparseable / missing `exp`).
22
25
  *
@@ -18,31 +18,37 @@ export interface ParsedLink {
18
18
  export interface DeepLinkRoute {
19
19
  /** A path pattern with `:param` segments (`order/:id`), or a RegExp on `path`. */
20
20
  match: string | RegExp;
21
- requiresAuth?: boolean;
21
+ requiresAuth?: boolean | undefined;
22
22
  handler: (link: ParsedLink, params: Record<string, string>) => void;
23
23
  }
24
24
  export interface DeepLinkConfig {
25
25
  routes: DeepLinkRoute[];
26
26
  /** Navigator readiness. Links arriving before this is true are queued. */
27
- isReady?: () => boolean;
28
- isAuthenticated?: () => boolean;
27
+ isReady?: (() => boolean) | undefined;
28
+ isAuthenticated?: (() => boolean) | undefined;
29
29
  /** Called when an auth-gated link is stashed; the app sends the user to login. */
30
- onUnauthenticated?: (link: ParsedLink) => void;
31
- onUnmatched?: (link: ParsedLink) => void;
30
+ onUnauthenticated?: ((link: ParsedLink) => void) | undefined;
31
+ onUnmatched?: ((link: ParsedLink) => void) | undefined;
32
32
  }
33
33
  /**
34
34
  * Parse a deep-link URL. Returns null for anything that is not a usable URL so
35
35
  * a hostile or truncated link can never throw on the native event path.
36
36
  */
37
37
  export declare const parseDeepLink: (url: string) => ParsedLink | null;
38
+ declare const flushPending: () => void;
39
+ declare const configure: (next: DeepLinkConfig) => void;
40
+ declare const handleUrl: (url: string) => void;
41
+ declare const start: () => Promise<void>;
42
+ declare const stop: () => void;
43
+ declare const setReady: (ready: boolean) => void;
38
44
  export declare const DeepLink: {
39
- configure: (next: DeepLinkConfig) => void;
40
- start: () => Promise<void>;
41
- stop: () => void;
42
- handleUrl: (url: string) => void;
43
- setReady: (ready: boolean) => void;
45
+ configure: typeof configure;
46
+ start: typeof start;
47
+ stop: typeof stop;
48
+ handleUrl: typeof handleUrl;
49
+ setReady: typeof setReady;
44
50
  /** Replay the stashed link, once. Call after a successful login. */
45
- replayPending: () => void;
51
+ replayPending: typeof flushPending;
46
52
  getPending: () => ParsedLink | null;
47
53
  };
48
54
  /**
@@ -51,4 +57,5 @@ export declare const DeepLink: {
51
57
  * not tear down and re-subscribe the native listener.
52
58
  */
53
59
  export declare const useDeepLink: (deepLinkConfig: DeepLinkConfig) => void;
60
+ export {};
54
61
  //# sourceMappingURL=index.d.ts.map
@@ -12,8 +12,8 @@ interface ExpoFileLike {
12
12
  readonly exists: boolean;
13
13
  readonly size: number;
14
14
  create: (options?: {
15
- intermediates?: boolean;
16
- overwrite?: boolean;
15
+ intermediates?: boolean | undefined;
16
+ overwrite?: boolean | undefined;
17
17
  }) => void;
18
18
  write: (content: Uint8Array) => Promise<void>;
19
19
  delete: () => void;
@@ -21,8 +21,8 @@ interface ExpoFileLike {
21
21
  interface ExpoDirectoryLike {
22
22
  readonly uri: string;
23
23
  create: (options?: {
24
- intermediates?: boolean;
25
- idempotent?: boolean;
24
+ intermediates?: boolean | undefined;
25
+ idempotent?: boolean | undefined;
26
26
  }) => void;
27
27
  }
28
28
  export interface ExpoFileSystemModuleLike {
@@ -18,6 +18,10 @@ export interface FileSystemLike {
18
18
  unlink: (path: string) => Promise<void>;
19
19
  mkdir: (path: string) => Promise<void>;
20
20
  }
21
+ /**
22
+ * Built by downloadFile and handed to the client, never written by an app: its optional keys are absent rather
23
+ * than undefined, so an axios instance (whose config refuses an explicit undefined) satisfies DownloadHttpClient.
24
+ */
21
25
  export interface DownloadHttpRequestConfig {
22
26
  headers?: Record<string, string>;
23
27
  responseType: "arraybuffer";
@@ -25,7 +29,7 @@ export interface DownloadHttpRequestConfig {
25
29
  signal?: AbortSignal;
26
30
  onDownloadProgress?: (event: {
27
31
  loaded: number;
28
- total?: number;
32
+ total?: number | undefined;
29
33
  }) => void;
30
34
  }
31
35
  /**
@@ -36,8 +40,8 @@ export interface DownloadHttpRequestConfig {
36
40
  * mobile-support's client is, so no axios type leaks into the declarations.
37
41
  */
38
42
  export interface DownloadHttpClient {
39
- get<T = unknown>(url: string, config?: DownloadHttpRequestConfig): Promise<{
40
- data: T;
43
+ get(url: string, config?: DownloadHttpRequestConfig): Promise<{
44
+ data: unknown;
41
45
  }>;
42
46
  }
43
47
  export type DownloadDestination = "documents" | "cache" | "downloads";
@@ -45,25 +49,25 @@ export interface DownloadOptions {
45
49
  /** Sends the request: `userClient` for a signed-in download, `publicClient` for an open one. */
46
50
  client: DownloadHttpClient;
47
51
  url: string;
48
- fileName?: string;
49
- destination?: DownloadDestination;
52
+ fileName?: string | undefined;
53
+ destination?: DownloadDestination | undefined;
50
54
  /** Sent with the request, beside whatever the client adds itself. */
51
- headers?: Record<string, string>;
52
- mimeType?: string;
53
- onProgress?: (received: number, total: number, fraction: number) => void;
54
- overwrite?: boolean;
55
- signal?: AbortSignal;
55
+ headers?: Record<string, string> | undefined;
56
+ mimeType?: string | undefined;
57
+ onProgress?: ((received: number, total: number, fraction: number) => void) | undefined;
58
+ overwrite?: boolean | undefined;
59
+ signal?: AbortSignal | undefined;
56
60
  }
57
61
  export interface DownloadResult {
58
62
  path: string;
59
63
  bytes: number;
60
- mimeType?: string;
64
+ mimeType?: string | undefined;
61
65
  fromCache: boolean;
62
66
  }
63
67
  export type DownloadErrorCode = "unsupported" | "permission-denied" | "network" | "http-error" | "write-failed" | "aborted" | "empty-file";
64
68
  export declare class DownloadError extends Error {
65
69
  readonly code: DownloadErrorCode;
66
- readonly status?: number;
70
+ readonly status?: number | undefined;
67
71
  constructor(code: DownloadErrorCode, message: string, status?: number);
68
72
  }
69
73
  /**
@@ -1,16 +1,3 @@
1
- /**
2
- * Normalizes any failure a thunk, a service or the RTK Query base query can see into one
3
- * `ApiError`. Identical source in @webority/web-core and @webority/mobile-core.
4
- *
5
- * The body read is the RFC 9457 problem `{ type, title, status, detail, code, traceId, errors }`,
6
- * where `errors` is a ModelState dictionary (`{ Field: ["msg"] }`) or a list of `{ field, message }`.
7
- *
8
- * Message precedence (react.md): first field error, form error, `detail`, `title`, a plain-text
9
- * body, then `Request failed (<status>)`. A 401 or 403 whose body is the standard refusal (api.md)
10
- * gets the library's sentence for it, ahead of those. A 5xx shows `detail` only when it carries a
11
- * code other than `internal_error`. The server's text goes on `diagnostic` for the logger, never the screen.
12
- * The trace id falls back to the request's own `traceparent`, so a lost request keeps a reference.
13
- */
14
1
  export interface ApiError {
15
2
  /** Stable snake_case branch key from the server (`not_found`, `validation_failed`). Branch on it, never render it. */
16
3
  code: string | null;
@@ -26,12 +13,16 @@ export interface ApiError {
26
13
  traceId: string | null;
27
14
  /** What the server or runtime actually said. For the logger, never for the screen. */
28
15
  diagnostic: string | null;
16
+ /** The request address the failed call was sent to. For the logger and the caller, never the screen. */
17
+ requestUrl?: string | undefined;
18
+ /** The Account-Id the failed call was sent with. For the logger and the caller, never the screen. */
19
+ accountId?: string | undefined;
29
20
  }
30
21
  export declare const SERVER_FAILURE_MESSAGE = "Something went wrong on our side. Please try again in a moment.";
31
22
  export declare const OFFLINE_MESSAGE = "You appear to be offline. Check your connection and try again.";
23
+ export declare const UNREACHABLE_MESSAGE = "We couldn't reach the server. Check your connection and try again.";
32
24
  export declare const TIMEOUT_MESSAGE = "That took too long to respond. Check your connection and try again.";
33
25
  export declare const UNEXPECTED_MESSAGE = "Something went wrong. Please try again.";
34
- export declare const UNREACHABLE_MESSAGE = "We couldn't reach the server. Check your connection and try again.";
35
26
  /** `code` for a request the caller cancelled (axios `CanceledError`). Never toasted. */
36
27
  export declare const REQUEST_CANCELED_CODE = "request_canceled";
37
28
  /** `code` for a response that failed schema validation at the service boundary. */
@@ -54,9 +45,10 @@ export declare const isNoResponse: (error: unknown) => boolean;
54
45
  /**
55
46
  * The sentence a screen shows for a failure: the server's own curated message when it sent one,
56
47
  * otherwise the screen's `fallback` ("We couldn't save the project."), otherwise the library's
57
- * generic sentence. A lost answer always reads as the connection message, because "check your
58
- * connection" is more accurate than any screen's fallback. A 5xx without a curated sentence, a
59
- * cancelled request and a body with no usable sentence count as "the server said nothing usable".
48
+ * generic sentence. A lost answer always reads as its connection message, because "check your
49
+ * connection" is more accurate than any screen's fallback, and so does a 5xx with a curated body.
50
+ * A 5xx without one, a cancelled request and a body with no usable sentence count as "the server
51
+ * said nothing usable".
60
52
  *
61
53
  * `fallback: null` is the "say nothing" mode, for a screen that shows only what the server
62
54
  * curated (a live panel that keeps its last result): it returns null when the server said
@@ -1,3 +1,5 @@
1
1
  export type { ApiError } from "./extractApiError.js";
2
2
  export { apiErrorMessage, CONTRACT_ERROR_CODE, extractApiError, isApiError, isNoResponse, NETWORK_CODE, OFFLINE_CODE, OFFLINE_MESSAGE, REQUEST_CANCELED_CODE, SERVER_FAILURE_MESSAGE, TIMEOUT_CODE, TIMEOUT_MESSAGE, toFieldPath, UNEXPECTED_MESSAGE, UNREACHABLE_MESSAGE, } from "./extractApiError.js";
3
+ export type { ResponseSchema } from "./parseResponse.js";
4
+ export { parseResponse } from "./parseResponse.js";
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,20 @@
1
+ /** The part of a zod schema (v3 or v4) the check reads, so the package needs no zod dependency. */
2
+ export interface ResponseSchema<T> {
3
+ safeParse(data: unknown): {
4
+ success: true;
5
+ data: T;
6
+ } | {
7
+ success: false;
8
+ error: {
9
+ issues: unknown;
10
+ };
11
+ };
12
+ }
13
+ /**
14
+ * Checks an API response against its schema at the service boundary and returns the parsed value. A response that
15
+ * breaks its contract fails here, logged with the schema's issues under `label`, instead of as an undefined deep in a
16
+ * screen. The thrown error carries `isContractError`, which extractApiError turns into code `contract_error` with a
17
+ * message fit for the screen.
18
+ */
19
+ export declare function parseResponse<T>(schema: ResponseSchema<T>, data: unknown, label: string): T;
20
+ //# sourceMappingURL=parseResponse.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The mobile platform's answer to "did the device refuse the request for lack of a connection?".
3
+ * extractApiError.ts reads a request that got no answer as offline only when this says so; web-core
4
+ * has its own copy. The check is by name, not `instanceof`, because a RequestOfflineError that
5
+ * went through createAsyncThunk arrives as a plain object that keeps only its name.
6
+ */
7
+ export declare function isOfflineFailure(error: unknown): boolean;
8
+ //# sourceMappingURL=requestPlatform.d.ts.map
@@ -6,18 +6,18 @@ export interface FormatCurrencyOptions extends Omit<Intl.NumberFormatOptions, "s
6
6
  /** ISO 4217 currency code. Required: a missing or empty one throws a TypeError. */
7
7
  currency: string;
8
8
  /** BCP-47 locale tag. Defaults to the configured locale, else `'en-IN'` (Indian numbering system). */
9
- locale?: string;
9
+ locale?: string | undefined;
10
10
  /** Minimum fraction digits. Defaults to 0 for whole amounts, else the currency's own (2 for INR, 0 for JPY). */
11
- minimumFractionDigits?: number;
11
+ minimumFractionDigits?: number | undefined;
12
12
  /** Maximum fraction digits. Defaults to the currency's own. */
13
- maximumFractionDigits?: number;
13
+ maximumFractionDigits?: number | undefined;
14
14
  /** Strip the currency symbol — useful when the symbol is rendered separately. */
15
- stripSymbol?: boolean;
15
+ stripSymbol?: boolean | undefined;
16
16
  /**
17
17
  * What a missing amount prints. Defaults to the configured placeholder once the app has
18
18
  * configured a locale or an `empty` (`configureFormatters`), else `''`.
19
19
  */
20
- empty?: string;
20
+ empty?: string | undefined;
21
21
  }
22
22
  /**
23
23
  * Format an amount as currency. Pass an ISO 4217 code on every call: a missing or empty one
@@ -41,7 +41,7 @@ export declare const addDays: (value: DateInput | null | undefined, count: numbe
41
41
  * cosmetic.
42
42
  */
43
43
  export declare const formatDatePattern: (value: DateInput, pattern: string, options?: {
44
- utc?: boolean;
44
+ utc?: boolean | undefined;
45
45
  }) => string;
46
46
  /**
47
47
  * `DD MMM, YYYY` — zero-padded day, short month, comma, year (e.g.
@@ -58,7 +58,7 @@ export declare const formatDatePattern: (value: DateInput, pattern: string, opti
58
58
  * option; pass it only to match a call site that was genuinely UTC-explicit.
59
59
  */
60
60
  export declare const formatDateDDMMMYYYY: (value: DateInput, options?: {
61
- utc?: boolean;
61
+ utc?: boolean | undefined;
62
62
  }) => string;
63
63
  /** `YYYY-MM-DD`, in the device's local timezone. */
64
64
  export declare const formatDateISO: (value: DateInput) => string;
@@ -22,6 +22,8 @@
22
22
  */
23
23
  /** `'IST'`: every instant in India Standard Time. `'viewer'`: the device or browser zone, labelled. */
24
24
  export type ZoneMode = "IST" | "viewer";
25
+ /** A zone mode, `'UTC'`, or any IANA zone name such as `'America/New_York'`. */
26
+ export type ZoneOption = ZoneMode | "UTC" | (string & {});
25
27
  /** How the integer part of a number is grouped. */
26
28
  export type NumberGrouping = "indian" | "international" | "none";
27
29
  /**
@@ -42,8 +44,8 @@ export interface NumberSeparators {
42
44
  group: string;
43
45
  }
44
46
  export interface FormatterConfig {
45
- /** Default zone for every date and time formatter. */
46
- zone: ZoneMode;
47
+ /** Default zone for every date and time formatter: a zone mode, `'UTC'`, or an IANA zone name. */
48
+ zone: ZoneOption;
47
49
  /**
48
50
  * BCP-47 locale. Left at its default (en-IN), it only picks the house digit
49
51
  * grouping. Configured (`configureFormatters({ locale })`), it switches every
@@ -54,16 +56,16 @@ export interface FormatterConfig {
54
56
  /** What every formatter returns for a missing or unreadable value. */
55
57
  empty: string;
56
58
  /** The person's number style. Unset, the separators are the house text's or the configured locale's. */
57
- numberStyle?: NumberStyle;
59
+ numberStyle?: NumberStyle | undefined;
58
60
  /** The person's date order. Unset, dates read DD-MMM-YYYY. */
59
- dateOrder?: DateOrder;
61
+ dateOrder?: DateOrder | undefined;
60
62
  }
61
63
  /**
62
64
  * Set the zone mode, locale, empty placeholder, number style or date order for the whole app.
63
65
  * Call it at startup, and again when the person changes their number style or date order; a key
64
66
  * left out (or undefined) keeps its current value. Passing nothing restores the defaults (IST,
65
- * en-IN, "-", house text, no number style or date order). An unknown number style or date order
66
- * throws a RangeError, so a bad stored preference fails where it is applied.
67
+ * en-IN, "-", house text, no number style or date order). An unknown zone, number style or date
68
+ * order throws a RangeError, so a bad stored preference fails where it is applied.
67
69
  */
68
70
  export declare const configureFormatters: (config?: Partial<FormatterConfig>) => void;
69
71
  /** The settings in force, as a copy. */
@@ -33,16 +33,15 @@
33
33
  * configured `dateOrder` other than DD-MMM-YYYY writes the date as digits from the wall clock,
34
34
  * in every locale: "08/04/2026", "04/08/2026", "2026-04-08".
35
35
  */
36
- import { type NumberGrouping, type ZoneMode } from "./formatConfig.js";
36
+ import { type NumberGrouping, type ZoneOption } from "./formatConfig.js";
37
+ export type { ZoneOption } from "./formatConfig.js";
37
38
  /** A date the house formatters accept; null, undefined and "" read as missing. */
38
39
  export type DateValue = Date | string | number | null | undefined;
39
- /** A zone mode, `'UTC'`, or any IANA zone name such as `'America/New_York'`. */
40
- export type ZoneOption = ZoneMode | "UTC" | (string & {});
41
40
  export interface FormatDateOptions {
42
41
  /** Overrides the configured zone mode for this call. */
43
- zone?: ZoneOption;
42
+ zone?: ZoneOption | undefined;
44
43
  /** Overrides the configured empty placeholder for this call. */
45
- empty?: string;
44
+ empty?: string | undefined;
46
45
  }
47
46
  export interface FormatTimeOptions extends FormatDateOptions {
48
47
  /**
@@ -50,26 +49,26 @@ export interface FormatTimeOptions extends FormatDateOptions {
50
49
  * configured locale's own clock once a locale is configured (12 for en-IN and en-US,
51
50
  * 24 for en-GB, de-DE and most of Europe).
52
51
  */
53
- hourCycle?: 12 | 24;
52
+ hourCycle?: 12 | 24 | undefined;
54
53
  /**
55
54
  * Append the zone label ("IST", "UTC", "GMT-4"; Intl's short zone name for a
56
55
  * configured locale). Defaults to on for every zone except IST, so the viewer
57
56
  * mode always says which clock it shows.
58
57
  */
59
- zoneLabel?: boolean;
58
+ zoneLabel?: boolean | undefined;
60
59
  }
61
60
  export type FormatDateTimeOptions = FormatTimeOptions;
62
61
  export interface FormatRelativeOptions {
63
62
  /** The instant to measure from. Defaults to now. */
64
- now?: Date | string | number;
65
- empty?: string;
63
+ now?: Date | string | number | undefined;
64
+ empty?: string | undefined;
66
65
  /**
67
66
  * Intl's own phrasing ("yesterday", "in 2 days", "now") instead of the house phrase
68
67
  * ("1 day ago"). Always on once a locale is configured. Intl phrases count in rounded
69
68
  * years, months, days, hours, minutes and seconds, with no week unit, so 36 hours ahead reads
70
69
  * "in 2 days". An engine without Intl.RelativeTimeFormat (older Hermes) prints the house phrase.
71
70
  */
72
- intl?: boolean;
71
+ intl?: boolean | undefined;
73
72
  }
74
73
  /**
75
74
  * The house keys, plus any `Intl.NumberFormatOptions`. With house keys only, the text is
@@ -83,29 +82,29 @@ export interface FormatNumberOptions extends Intl.NumberFormatOptions {
83
82
  * `'international'` prints the house text even with a configured locale; `'none'` drops
84
83
  * the separators either way.
85
84
  */
86
- grouping?: NumberGrouping;
85
+ grouping?: NumberGrouping | undefined;
87
86
  /** Defaults to 0. */
88
- minimumFractionDigits?: number;
87
+ minimumFractionDigits?: number | undefined;
89
88
  /** Defaults to 3 for formatNumber and 0 for formatPercent. */
90
- maximumFractionDigits?: number;
89
+ maximumFractionDigits?: number | undefined;
91
90
  /** Overrides the configured locale for this call. */
92
- locale?: string;
93
- empty?: string;
91
+ locale?: string | undefined;
92
+ empty?: string | undefined;
94
93
  }
95
94
  export interface FormatPercentOptions extends FormatNumberOptions {
96
95
  /** `'ratio'` (the default) reads 0.42 as 42%; `'percent'` reads 42 as 42%. */
97
- scale?: "ratio" | "percent";
96
+ scale?: "ratio" | "percent" | undefined;
98
97
  }
99
98
  export interface FormatMinorOptions {
100
99
  /** ISO 4217 code. Required: a missing or empty one throws a TypeError. */
101
100
  currency: string;
102
101
  /** Defaults to Indian grouping for INR and international grouping for every other currency. */
103
- grouping?: NumberGrouping;
102
+ grouping?: NumberGrouping | undefined;
104
103
  /** Print a whole amount without its zero decimals: "₹1,500" instead of "₹1,500.00". */
105
- dropZeroDecimals?: boolean;
104
+ dropZeroDecimals?: boolean | undefined;
106
105
  /** `false` prints the digits alone, for a field that draws the symbol itself. */
107
- symbol?: boolean;
108
- empty?: string;
106
+ symbol?: boolean | undefined;
107
+ empty?: string | undefined;
109
108
  }
110
109
  /**
111
110
  * "08-Apr-2026", or the configured date order. A bare calendar date ("2026-04-08")
@@ -1,6 +1,4 @@
1
1
  export declare const numberFormat: (locale: string, options?: Intl.NumberFormatOptions) => Intl.NumberFormat;
2
2
  export declare const dateTimeFormat: (locale: string, options: Intl.DateTimeFormatOptions) => Intl.DateTimeFormat;
3
- export declare const relativeTimeFormat: (RelativeTimeFormat: new (locale: string, options?: {
4
- numeric?: "always" | "auto";
5
- }) => Intl.RelativeTimeFormat, locale: string) => Intl.RelativeTimeFormat;
3
+ export declare const relativeTimeFormat: (RelativeTimeFormat: typeof Intl.RelativeTimeFormat, locale: string) => Intl.RelativeTimeFormat;
6
4
  //# sourceMappingURL=intlCache.d.ts.map
@@ -10,9 +10,9 @@ export { AsYouType, getCountries, getCountryCallingCode, isSupportedCountry, isV
10
10
  */
11
11
  export type PhoneCountry = CountryCode;
12
12
  export interface FormatPhoneOptions {
13
- defaultCountryCode?: string;
14
- country?: PhoneCountry;
15
- includeCountryCode?: boolean;
13
+ defaultCountryCode?: string | undefined;
14
+ country?: PhoneCountry | undefined;
15
+ includeCountryCode?: boolean | undefined;
16
16
  }
17
17
  /**
18
18
  * Strip everything except digits and a leading `+` (preserved if present).
@@ -6,14 +6,14 @@ import type { GeolocationLike } from "../index.js";
6
6
  */
7
7
  export interface ExpoLocationObject {
8
8
  coords?: {
9
- latitude?: number;
10
- longitude?: number;
11
- altitude?: number | null;
12
- accuracy?: number | null;
13
- heading?: number | null;
14
- speed?: number | null;
15
- } | null;
16
- timestamp?: number;
9
+ latitude?: number | undefined;
10
+ longitude?: number | undefined;
11
+ altitude?: number | null | undefined;
12
+ accuracy?: number | null | undefined;
13
+ heading?: number | null | undefined;
14
+ speed?: number | null | undefined;
15
+ } | null | undefined;
16
+ timestamp?: number | undefined;
17
17
  }
18
18
  export interface ExpoLocationSubscription {
19
19
  remove: () => void;
@@ -21,10 +21,10 @@ export interface ExpoLocationSubscription {
21
21
  export interface ExpoLocationLike {
22
22
  getCurrentPositionAsync: (options?: Record<string, unknown>) => Promise<ExpoLocationObject>;
23
23
  watchPositionAsync: (options: Record<string, unknown>, callback: (location: ExpoLocationObject) => void) => Promise<ExpoLocationSubscription>;
24
- getForegroundPermissionsAsync?: () => Promise<{
24
+ getForegroundPermissionsAsync?: (() => Promise<{
25
25
  granted: boolean;
26
- }>;
27
- hasServicesEnabledAsync?: () => Promise<boolean>;
26
+ }>) | undefined;
27
+ hasServicesEnabledAsync?: (() => Promise<boolean>) | undefined;
28
28
  }
29
29
  /**
30
30
  * Adapts expo-location to the library's geolocation seam.