@webority/mobile-core 0.1.0 → 0.2.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.
- package/README.md +32 -0
- package/lib/commonjs/api/clientHeaders.js +1 -0
- package/lib/commonjs/api/minAppVersion.js +1 -0
- package/lib/commonjs/api/publicClient.js +1 -1
- package/lib/commonjs/api/requestDefaults.js +1 -0
- package/lib/commonjs/api/retry.js +1 -1
- package/lib/commonjs/api/tokenRefresh.js +1 -1
- package/lib/commonjs/api/userClient.js +1 -1
- package/lib/commonjs/auth/authStore.js +1 -1
- package/lib/commonjs/auth/index.js +1 -1
- package/lib/commonjs/config/index.js +1 -1
- package/lib/commonjs/errors/extractApiError.js +1 -0
- package/lib/commonjs/errors/index.js +1 -0
- package/lib/commonjs/formatters/currency.js +1 -1
- package/lib/commonjs/formatters/date.js +1 -1
- package/lib/commonjs/formatters/dateMath.js +1 -1
- package/lib/commonjs/formatters/formatConfig.js +1 -0
- package/lib/commonjs/formatters/house.js +1 -0
- package/lib/commonjs/formatters/index.js +1 -1
- package/lib/commonjs/formatters/number.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/initSDK.js +1 -1
- package/lib/commonjs/initUserAuth.js +1 -1
- package/lib/commonjs/logger/index.js +1 -1
- package/lib/commonjs/query/apiBaseQuery.js +1 -0
- package/lib/commonjs/query/createAppApi.js +1 -0
- package/lib/commonjs/query/index.js +1 -0
- package/lib/commonjs/query/listeners.js +1 -0
- package/lib/commonjs/query/paging.js +1 -0
- package/lib/commonjs/query/tags.js +1 -0
- package/lib/commonjs/redux/errorToastMiddleware.js +1 -0
- package/lib/commonjs/redux/index.js +1 -0
- package/lib/commonjs/redux/rootReducer.js +1 -0
- package/lib/commonjs/redux/serializableCheck.js +1 -0
- package/lib/commonjs/versionCheck/buildNumber.js +1 -0
- package/lib/commonjs/versionCheck/index.js +1 -1
- package/lib/module/api/baseUrl.js +1 -1
- package/lib/module/api/clientHeaders.js +1 -0
- package/lib/module/api/curl.js +1 -1
- package/lib/module/api/minAppVersion.js +1 -0
- package/lib/module/api/multipart.js +1 -1
- package/lib/module/api/publicClient.js +1 -1
- package/lib/module/api/requestDefaults.js +1 -0
- package/lib/module/api/responseBodyText.js +1 -1
- package/lib/module/api/retry.js +1 -1
- package/lib/module/api/tokenRefresh.js +1 -1
- package/lib/module/api/userClient.js +1 -1
- package/lib/module/auth/authStore.js +1 -1
- package/lib/module/auth/index.js +1 -1
- package/lib/module/auth/jwt.js +1 -1
- package/lib/module/config/index.js +1 -1
- package/lib/module/deepLink/index.js +1 -1
- package/lib/module/download/adapters/expoFs.js +1 -1
- package/lib/module/download/adapters/shared.js +1 -1
- package/lib/module/download/index.js +1 -1
- package/lib/module/errors/extractApiError.js +1 -0
- package/lib/module/errors/index.js +1 -0
- package/lib/module/formatters/currency.js +1 -1
- package/lib/module/formatters/date.js +1 -1
- package/lib/module/formatters/dateMath.js +1 -1
- package/lib/module/formatters/formatConfig.js +1 -0
- package/lib/module/formatters/house.js +1 -0
- package/lib/module/formatters/index.js +1 -1
- package/lib/module/formatters/initials.js +1 -1
- package/lib/module/formatters/intlCache.js +1 -1
- package/lib/module/formatters/number.js +1 -1
- package/lib/module/formatters/phone.js +1 -1
- package/lib/module/formatters/windowsToIanaTable.js +1 -1
- package/lib/module/geolocation/adapters/expoLocation.js +1 -1
- package/lib/module/geolocation/index.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/initSDK.js +1 -1
- package/lib/module/initUserAuth.js +1 -1
- package/lib/module/logger/crashlytics.js +1 -1
- package/lib/module/logger/index.js +1 -1
- package/lib/module/logger/redact.js +1 -1
- package/lib/module/network/index.js +1 -1
- package/lib/module/network/networkStatus.js +1 -1
- package/lib/module/permissions/calendar.js +1 -1
- package/lib/module/permissions/camera.js +1 -1
- package/lib/module/permissions/contacts.js +1 -1
- package/lib/module/permissions/index.js +1 -1
- package/lib/module/permissions/location.js +1 -1
- package/lib/module/permissions/mediaLibrary.js +1 -1
- package/lib/module/permissions/notifications.js +1 -1
- package/lib/module/permissions/photos.js +1 -1
- package/lib/module/phone/countries.js +1 -1
- package/lib/module/push/index.js +1 -1
- package/lib/module/push/push.js +1 -1
- package/lib/module/push/status.js +1 -1
- package/lib/module/push/task.js +1 -1
- package/lib/module/query/apiBaseQuery.js +1 -0
- package/lib/module/query/createAppApi.js +1 -0
- package/lib/module/query/index.js +1 -0
- package/lib/module/query/listeners.js +1 -0
- package/lib/module/query/paging.js +1 -0
- package/lib/module/query/tags.js +1 -0
- package/lib/module/redux/errorToastMiddleware.js +1 -0
- package/lib/module/redux/index.js +1 -0
- package/lib/module/redux/rootReducer.js +1 -0
- package/lib/module/redux/serializableCheck.js +1 -0
- package/lib/module/secureScreen/index.js +1 -1
- package/lib/module/share/index.js +1 -1
- package/lib/module/smsRetriever/index.js +1 -1
- package/lib/module/specs/NativeSmsRetriever.js +1 -1
- package/lib/module/sqlite/adapters/expo.js +1 -1
- package/lib/module/sqlite/index.js +1 -1
- package/lib/module/storage/index.js +1 -1
- package/lib/module/types/axios.js +1 -1
- package/lib/module/types/globals.d.js +1 -1
- package/lib/module/utils/base64.js +1 -1
- package/lib/module/utils/imageCompression.js +1 -1
- package/lib/module/utils/index.js +1 -1
- package/lib/module/validators/index.js +1 -1
- package/lib/module/versionCheck/buildNumber.js +1 -0
- package/lib/module/versionCheck/index.js +1 -1
- package/lib/typescript/commonjs/api/clientHeaders.d.ts +25 -0
- package/lib/typescript/commonjs/api/minAppVersion.d.ts +24 -0
- package/lib/typescript/commonjs/api/requestDefaults.d.ts +21 -0
- package/lib/typescript/commonjs/api/retry.d.ts +23 -9
- package/lib/typescript/commonjs/api/tokenRefresh.d.ts +14 -2
- package/lib/typescript/commonjs/api/userClient.d.ts +1 -1
- package/lib/typescript/commonjs/auth/authStore.d.ts +76 -0
- package/lib/typescript/commonjs/auth/index.d.ts +2 -2
- package/lib/typescript/commonjs/config/index.d.ts +31 -2
- package/lib/typescript/commonjs/errors/extractApiError.d.ts +69 -0
- package/lib/typescript/commonjs/errors/index.d.ts +3 -0
- package/lib/typescript/commonjs/formatters/currency.d.ts +22 -7
- package/lib/typescript/commonjs/formatters/date.d.ts +13 -13
- package/lib/typescript/commonjs/formatters/dateMath.d.ts +4 -2
- package/lib/typescript/commonjs/formatters/formatConfig.d.ts +48 -0
- package/lib/typescript/commonjs/formatters/house.d.ts +143 -0
- package/lib/typescript/commonjs/formatters/index.d.ts +4 -0
- package/lib/typescript/commonjs/formatters/number.d.ts +15 -5
- package/lib/typescript/commonjs/index.d.ts +21 -8
- package/lib/typescript/commonjs/initSDK.d.ts +18 -6
- package/lib/typescript/commonjs/initUserAuth.d.ts +29 -0
- package/lib/typescript/commonjs/logger/index.d.ts +17 -0
- package/lib/typescript/commonjs/query/apiBaseQuery.d.ts +55 -0
- package/lib/typescript/commonjs/query/createAppApi.d.ts +21 -0
- package/lib/typescript/commonjs/query/index.d.ts +9 -0
- package/lib/typescript/commonjs/query/listeners.d.ts +11 -0
- package/lib/typescript/commonjs/query/paging.d.ts +42 -0
- package/lib/typescript/commonjs/query/tags.d.ts +31 -0
- package/lib/typescript/commonjs/redux/errorToastMiddleware.d.ts +51 -0
- package/lib/typescript/commonjs/redux/index.d.ts +6 -0
- package/lib/typescript/commonjs/redux/rootReducer.d.ts +19 -0
- package/lib/typescript/commonjs/redux/serializableCheck.d.ts +14 -0
- package/lib/typescript/commonjs/versionCheck/buildNumber.d.ts +14 -0
- package/lib/typescript/commonjs/versionCheck/index.d.ts +28 -17
- package/lib/typescript/module/api/clientHeaders.d.ts +25 -0
- package/lib/typescript/module/api/minAppVersion.d.ts +24 -0
- package/lib/typescript/module/api/requestDefaults.d.ts +21 -0
- package/lib/typescript/module/api/retry.d.ts +23 -9
- package/lib/typescript/module/api/tokenRefresh.d.ts +14 -2
- package/lib/typescript/module/api/userClient.d.ts +1 -1
- package/lib/typescript/module/auth/authStore.d.ts +76 -0
- package/lib/typescript/module/auth/index.d.ts +2 -2
- package/lib/typescript/module/config/index.d.ts +31 -2
- package/lib/typescript/module/errors/extractApiError.d.ts +69 -0
- package/lib/typescript/module/errors/index.d.ts +3 -0
- package/lib/typescript/module/formatters/currency.d.ts +22 -7
- package/lib/typescript/module/formatters/date.d.ts +13 -13
- package/lib/typescript/module/formatters/dateMath.d.ts +4 -2
- package/lib/typescript/module/formatters/formatConfig.d.ts +48 -0
- package/lib/typescript/module/formatters/house.d.ts +143 -0
- package/lib/typescript/module/formatters/index.d.ts +4 -0
- package/lib/typescript/module/formatters/number.d.ts +15 -5
- package/lib/typescript/module/index.d.ts +21 -8
- package/lib/typescript/module/initSDK.d.ts +18 -6
- package/lib/typescript/module/initUserAuth.d.ts +29 -0
- package/lib/typescript/module/logger/index.d.ts +17 -0
- package/lib/typescript/module/query/apiBaseQuery.d.ts +55 -0
- package/lib/typescript/module/query/createAppApi.d.ts +21 -0
- package/lib/typescript/module/query/index.d.ts +9 -0
- package/lib/typescript/module/query/listeners.d.ts +11 -0
- package/lib/typescript/module/query/paging.d.ts +42 -0
- package/lib/typescript/module/query/tags.d.ts +31 -0
- package/lib/typescript/module/redux/errorToastMiddleware.d.ts +51 -0
- package/lib/typescript/module/redux/index.d.ts +6 -0
- package/lib/typescript/module/redux/rootReducer.d.ts +19 -0
- package/lib/typescript/module/redux/serializableCheck.d.ts +14 -0
- package/lib/typescript/module/versionCheck/buildNumber.d.ts +14 -0
- package/lib/typescript/module/versionCheck/index.d.ts +28 -17
- package/package.json +30 -2
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Middleware, MiddlewareAPI, UnknownAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { type ApiError } from '../errors/extractApiError.js';
|
|
3
|
+
/**
|
|
4
|
+
* Toasts every rejected thunk and every failed RTK Query call, so no screen has to remember
|
|
5
|
+
* to surface a failure and none words it differently. Identical source in web-core and
|
|
6
|
+
* mobile-core; the toast itself comes in through `showToast`, so there is no UI dependency.
|
|
7
|
+
*
|
|
8
|
+
* Opt out with `silent: true` (decision 42), wherever the caller can put it:
|
|
9
|
+
* - a thunk: `rejectWithValue(extractApiError(e), { silent: true })`, or `{ silent: true }`
|
|
10
|
+
* in the thunk's object argument;
|
|
11
|
+
* - an RTK Query call: `{ silent: true }` in the call's argument object;
|
|
12
|
+
* - an RTK Query endpoint: `extraOptions: { silent: true }`, which the base query copies
|
|
13
|
+
* onto its meta.
|
|
14
|
+
*
|
|
15
|
+
* Never toasted: an aborted thunk or a cancelled request (a screen unmounting), an RTK Query
|
|
16
|
+
* condition skip (the data is already cached), a 401 by default (the auth layer owns a dead
|
|
17
|
+
* session). Identical messages are de-duplicated for `dedupeMs`, because a screen that fires
|
|
18
|
+
* four fetches and loses the network would otherwise stack four copies of one sentence.
|
|
19
|
+
*
|
|
20
|
+
* `onRejected` is the product's say over one rejection, run before the default rules:
|
|
21
|
+
* `'toast'` shows it even where `ignoreCodes` or `ignoreStatuses` would not (a 401 that names a
|
|
22
|
+
* code is a refused sign-in, not a dead session), `'silent'` drops it, and nothing at all leaves
|
|
23
|
+
* the default rules to decide. It runs for silent rejections too, so a side effect (a
|
|
24
|
+
* read-only workspace notice, a profile refetch) fires whichever screen asked; `silent: true`
|
|
25
|
+
* still keeps the default toast off, because the screen said it answers the failure itself.
|
|
26
|
+
*/
|
|
27
|
+
export type ShowErrorToast = (message: string, error: ApiError) => void;
|
|
28
|
+
/** What `onRejected` decides for one rejection: `'toast'`, `'silent'`, or nothing for the default rules. */
|
|
29
|
+
export type RejectionDecision = 'toast' | 'silent' | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The product's hook into every rejection the middleware sees. `api` is the store's
|
|
32
|
+
* `dispatch` and `getState`, for a side effect that reads or updates state.
|
|
33
|
+
*/
|
|
34
|
+
export type OnRejected = (action: UnknownAction, error: ApiError, api: MiddlewareAPI) => RejectionDecision;
|
|
35
|
+
export interface ErrorToastOptions {
|
|
36
|
+
showToast: ShowErrorToast;
|
|
37
|
+
/** Server `code` values a screen answers in its own way (a paywall, a terms gate). */
|
|
38
|
+
ignoreCodes?: readonly string[];
|
|
39
|
+
/** HTTP statuses never toasted. Default `[401]`. */
|
|
40
|
+
ignoreStatuses?: readonly number[];
|
|
41
|
+
/** Window in which an identical message is shown once. Default 4000 ms; 0 disables. */
|
|
42
|
+
dedupeMs?: number;
|
|
43
|
+
/** Decides one rejection before the default rules; see the module comment. */
|
|
44
|
+
onRejected?: OnRejected;
|
|
45
|
+
}
|
|
46
|
+
type Dict = Record<string, unknown>;
|
|
47
|
+
/** Is this a rejected createAsyncThunk or RTK Query action that asked not to be toasted? */
|
|
48
|
+
export declare const isSilentRejection: (meta: Dict) => boolean;
|
|
49
|
+
export declare function errorToastMiddleware(options: ErrorToastOptions): Middleware;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=errorToastMiddleware.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { ErrorToastOptions, OnRejected, RejectionDecision, ShowErrorToast } from './errorToastMiddleware.js';
|
|
2
|
+
export { errorToastMiddleware, isSilentRejection } from './errorToastMiddleware.js';
|
|
3
|
+
export type { RootReducerOptions } from './rootReducer.js';
|
|
4
|
+
export { createRootReducer, resetState } from './rootReducer.js';
|
|
5
|
+
export { SERIALIZABLE_IGNORED_ACTION_PATHS } from './serializableCheck.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ActionFromReducersMapObject, type Reducer, type ReducersMapObject, type StateFromReducersMapObject } from '@reduxjs/toolkit';
|
|
2
|
+
/**
|
|
3
|
+
* Clears every slice, the RTK Query cache included, in one dispatch. Dispatch it on logout
|
|
4
|
+
* (decision 22). Not a tidy-up: a slice left behind paints the previous user's data on the
|
|
5
|
+
* next sign-in before fresh fetches land, which on a shared device is a data leak.
|
|
6
|
+
*/
|
|
7
|
+
export declare const resetState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"app/resetState">;
|
|
8
|
+
export interface RootReducerOptions<K extends string> {
|
|
9
|
+
/** Slices that survive a reset because they belong to the device, not the user (theme, onboarding seen). */
|
|
10
|
+
preserve?: readonly K[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* `combineReducers(reducers)` that answers `resetState` by handing every slice `undefined`,
|
|
14
|
+
* so each returns its initial state. The RTK Query api reducer is in `reducers`, so its
|
|
15
|
+
* cache empties too, and a request still in flight is dropped when it lands because its
|
|
16
|
+
* cache entry no longer exists.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createRootReducer<M extends ReducersMapObject>(reducers: M, options?: RootReducerOptions<Extract<keyof M, string>>): Reducer<StateFromReducersMapObject<M>, ActionFromReducersMapObject<M>>;
|
|
19
|
+
//# sourceMappingURL=rootReducer.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action paths the serializable check skips in every Webority store (decision 22: the check
|
|
3
|
+
* stays on and ignores named paths only). Setting `ignoredActionPaths` replaces Redux
|
|
4
|
+
* Toolkit's default list, so an app spreads this constant and appends its own paths, each
|
|
5
|
+
* with a one-line reason:
|
|
6
|
+
*
|
|
7
|
+
* serializableCheck: { ignoredActionPaths: [...SERIALIZABLE_IGNORED_ACTION_PATHS, 'payload.at'] }
|
|
8
|
+
*
|
|
9
|
+
* `meta.arg`: a thunk's or RTK Query call's own argument, which may hold a File, a Blob or
|
|
10
|
+
* an AbortSignal and is never stored. `meta.baseQueryMeta`: the base query's request and
|
|
11
|
+
* response metadata, never stored. `ApiError` itself is plain data and needs no exemption.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SERIALIZABLE_IGNORED_ACTION_PATHS: readonly string[];
|
|
14
|
+
//# sourceMappingURL=serializableCheck.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-number arithmetic for the server-driven update check, shared word for
|
|
3
|
+
* word by web-core and mobile-core.
|
|
4
|
+
*
|
|
5
|
+
* The API's `X-Min-App-Version` is the lowest internal build number it still
|
|
6
|
+
* supports for the calling client kind, and the app's own build number is an
|
|
7
|
+
* integer too (`VERSION_INTERNAL` on mobile, `appBuild` on web). The comparison
|
|
8
|
+
* is integer against integer, never semver against semver.
|
|
9
|
+
*/
|
|
10
|
+
/** A non-negative integer from a config or native value, or `null` when it is not one. */
|
|
11
|
+
export declare const parseBuildNumber: (value: string | number | null | undefined) => number | null;
|
|
12
|
+
/** True only when a minimum is known and the build is strictly below it. */
|
|
13
|
+
export declare const isBuildBelowMinimum: (build: number, minimum: number | null) => boolean;
|
|
14
|
+
//# sourceMappingURL=buildNumber.d.ts.map
|
|
@@ -2,31 +2,39 @@ import { type Environment } from '../config/index.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Minimal device-info shape we depend on.
|
|
4
4
|
*
|
|
5
|
-
* This is a LAST RESORT, not the primary path.
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
5
|
+
* This is a LAST RESORT, not the primary path. Every Webority app carries its
|
|
6
|
+
* store id and build number in `appsettings.Compiled.json`, so
|
|
7
|
+
* `setConfig({ appId, appBuild })` covers both without a native module, and
|
|
8
|
+
* expo-application covers an app that wires neither. `getBuildNumber` is
|
|
9
|
+
* optional so an injector written before the server-driven check still fits;
|
|
10
|
+
* without it the build number comes from expo-application.
|
|
11
11
|
*/
|
|
12
12
|
interface DeviceInfoLike {
|
|
13
13
|
getBundleId: () => string;
|
|
14
14
|
getVersion: () => string;
|
|
15
|
+
getBuildNumber?: () => string;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* Supply the app identity from a native module instead of config.
|
|
18
|
-
* Prefer `setConfig({ appId,
|
|
19
|
+
* Prefer `setConfig({ appId, appBuild })` — it needs no native dependency.
|
|
19
20
|
* Pass `null` to clear.
|
|
20
21
|
*/
|
|
21
22
|
export declare const setDeviceInfoImplementation: (impl: DeviceInfoLike | null) => void;
|
|
22
23
|
export type Platform = 'ios' | 'android' | string;
|
|
24
|
+
/**
|
|
25
|
+
* A required update always reports `'major'`: the server states a minimum
|
|
26
|
+
* build, not the size of the change, and `'major'` is the value consumers
|
|
27
|
+
* already treat as "must update".
|
|
28
|
+
*/
|
|
23
29
|
export type UpdateType = 'major' | 'minor' | 'patch' | 'prerelease' | null;
|
|
30
|
+
/** @deprecated Store versions are no longer parsed; the minimum is a build number. */
|
|
24
31
|
export interface ParsedVersion {
|
|
25
32
|
major: number;
|
|
26
33
|
minor: number;
|
|
27
34
|
patch: number;
|
|
28
35
|
prerelease: string;
|
|
29
36
|
}
|
|
37
|
+
/** @deprecated The store is no longer read; the minimum comes from `X-Min-App-Version`. */
|
|
30
38
|
export interface VersionData {
|
|
31
39
|
version: string | null;
|
|
32
40
|
released?: string | null;
|
|
@@ -36,6 +44,7 @@ export interface VersionData {
|
|
|
36
44
|
country?: string;
|
|
37
45
|
lastChecked: string;
|
|
38
46
|
}
|
|
47
|
+
/** @deprecated The store is no longer read; the minimum comes from `X-Min-App-Version`. */
|
|
39
48
|
export interface VersionComparison {
|
|
40
49
|
needsUpdate: boolean;
|
|
41
50
|
updateType: UpdateType;
|
|
@@ -52,29 +61,31 @@ export interface UpdateInfo {
|
|
|
52
61
|
}
|
|
53
62
|
export interface VersionCheckType {
|
|
54
63
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
64
|
+
* Whether this build is below the minimum the API last sent in
|
|
65
|
+
* `X-Min-App-Version`. Resolves "no update" until a reply carried one, and
|
|
66
|
+
* rejects only when the app's build number is unknown.
|
|
57
67
|
*/
|
|
58
68
|
isNewVersionAvailable: () => Promise<VersionCheckResult>;
|
|
59
69
|
/**
|
|
60
70
|
* Opens the appropriate store URL to update the app.
|
|
61
|
-
* Uses the provided URL or falls back to direct store
|
|
71
|
+
* Uses the provided URL or falls back to the direct store URL.
|
|
62
72
|
*/
|
|
63
73
|
openUpdateUrl: (url?: string | null) => Promise<boolean>;
|
|
64
|
-
/**
|
|
65
|
-
* Get the fallback store URL.
|
|
66
|
-
* Useful when URL from version check fails.
|
|
67
|
-
*/
|
|
74
|
+
/** The store URL for this app on this platform. */
|
|
68
75
|
getFallbackStoreUrl: () => string;
|
|
69
76
|
}
|
|
70
77
|
export declare const VersionCheck: VersionCheckType;
|
|
71
78
|
/**
|
|
72
|
-
*
|
|
79
|
+
* Whether this build must update, from the minimum the API sends in
|
|
80
|
+
* `X-Min-App-Version`. Re-renders the moment a reply raises the minimum, so a
|
|
81
|
+
* minimum raised mid-session opens the ForceUpdateDialog without a restart.
|
|
73
82
|
*
|
|
74
|
-
* @param isAppReady - Whether the app is ready to
|
|
75
|
-
* @param environment - The app environment (defaults to the one in config)
|
|
83
|
+
* @param isAppReady - Whether the app is ready to show the prompt
|
|
84
|
+
* @param environment - The app environment (defaults to the one in config); the
|
|
85
|
+
* check runs in `'Production'` only
|
|
76
86
|
*/
|
|
77
87
|
export declare const useVersionCheck: (isAppReady: boolean, environment?: Environment) => UpdateInfo;
|
|
78
88
|
export default VersionCheck;
|
|
89
|
+
export { isBuildBelowMinimum, parseBuildNumber } from './buildNumber.js';
|
|
79
90
|
export type { DeviceInfoLike };
|
|
80
91
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/mobile-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Platform layer for Webority React Native apps: HTTP clients, auth/token storage, config, logging, formatters, validators, network status, permissions, storage and version checks. No UI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -201,6 +201,16 @@
|
|
|
201
201
|
"default": "./lib/commonjs/smsRetriever/index.js"
|
|
202
202
|
}
|
|
203
203
|
},
|
|
204
|
+
"./query": {
|
|
205
|
+
"import": {
|
|
206
|
+
"types": "./lib/typescript/module/query/index.d.ts",
|
|
207
|
+
"default": "./lib/module/query/index.js"
|
|
208
|
+
},
|
|
209
|
+
"require": {
|
|
210
|
+
"types": "./lib/typescript/commonjs/query/index.d.ts",
|
|
211
|
+
"default": "./lib/commonjs/query/index.js"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
204
214
|
"./phone/countries": {
|
|
205
215
|
"import": {
|
|
206
216
|
"types": "./lib/typescript/module/phone/countries.d.ts",
|
|
@@ -211,6 +221,16 @@
|
|
|
211
221
|
"default": "./lib/commonjs/phone/countries.js"
|
|
212
222
|
}
|
|
213
223
|
},
|
|
224
|
+
"./redux": {
|
|
225
|
+
"import": {
|
|
226
|
+
"types": "./lib/typescript/module/redux/index.d.ts",
|
|
227
|
+
"default": "./lib/module/redux/index.js"
|
|
228
|
+
},
|
|
229
|
+
"require": {
|
|
230
|
+
"types": "./lib/typescript/commonjs/redux/index.d.ts",
|
|
231
|
+
"default": "./lib/commonjs/redux/index.js"
|
|
232
|
+
}
|
|
233
|
+
},
|
|
214
234
|
"./package.json": "./package.json"
|
|
215
235
|
},
|
|
216
236
|
"main": "./lib/commonjs/index.js",
|
|
@@ -250,6 +270,7 @@
|
|
|
250
270
|
"libphonenumber-js": "^1.12.41"
|
|
251
271
|
},
|
|
252
272
|
"peerDependencies": {
|
|
273
|
+
"@reduxjs/toolkit": "^2.12.0",
|
|
253
274
|
"expo": ">=57.0.0",
|
|
254
275
|
"expo-application": ">=57.0.0",
|
|
255
276
|
"expo-calendar": ">=57.0.0",
|
|
@@ -268,9 +289,13 @@
|
|
|
268
289
|
"expo-sqlite": ">=57.0.0",
|
|
269
290
|
"expo-task-manager": ">=57.0.0",
|
|
270
291
|
"react": "^19.1.0",
|
|
271
|
-
"react-native": ">=0.81.0"
|
|
292
|
+
"react-native": ">=0.81.0",
|
|
293
|
+
"react-redux": "^9.3.0"
|
|
272
294
|
},
|
|
273
295
|
"peerDependenciesMeta": {
|
|
296
|
+
"@reduxjs/toolkit": {
|
|
297
|
+
"optional": true
|
|
298
|
+
},
|
|
274
299
|
"expo-calendar": {
|
|
275
300
|
"optional": true
|
|
276
301
|
},
|
|
@@ -306,6 +331,9 @@
|
|
|
306
331
|
},
|
|
307
332
|
"expo-task-manager": {
|
|
308
333
|
"optional": true
|
|
334
|
+
},
|
|
335
|
+
"react-redux": {
|
|
336
|
+
"optional": true
|
|
309
337
|
}
|
|
310
338
|
},
|
|
311
339
|
"publishConfig": {
|