@webority/mobile-core 0.0.29 → 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/baseUrl.js +1 -34
- package/lib/commonjs/api/clientHeaders.js +1 -0
- package/lib/commonjs/api/curl.js +1 -109
- package/lib/commonjs/api/minAppVersion.js +1 -0
- package/lib/commonjs/api/multipart.js +1 -21
- package/lib/commonjs/api/publicClient.js +1 -79
- package/lib/commonjs/api/requestDefaults.js +1 -0
- package/lib/commonjs/api/responseBodyText.js +1 -0
- package/lib/commonjs/api/retry.js +1 -91
- package/lib/commonjs/api/tokenRefresh.js +1 -205
- package/lib/commonjs/api/userClient.js +1 -265
- package/lib/commonjs/auth/authStore.js +1 -265
- package/lib/commonjs/auth/index.js +1 -44
- package/lib/commonjs/auth/jwt.js +1 -112
- package/lib/commonjs/config/index.js +1 -72
- package/lib/commonjs/deepLink/index.js +1 -286
- package/lib/commonjs/download/adapters/expoFs.js +1 -69
- package/lib/commonjs/download/adapters/shared.js +1 -13
- package/lib/commonjs/download/index.js +1 -250
- package/lib/commonjs/errors/extractApiError.js +1 -0
- package/lib/commonjs/errors/index.js +1 -0
- package/lib/commonjs/formatters/currency.js +1 -70
- package/lib/commonjs/formatters/date.js +1 -167
- package/lib/commonjs/formatters/dateMath.js +1 -311
- package/lib/commonjs/formatters/formatConfig.js +1 -0
- package/lib/commonjs/formatters/house.js +1 -0
- package/lib/commonjs/formatters/index.js +1 -246
- package/lib/commonjs/formatters/initials.js +1 -32
- package/lib/commonjs/formatters/intlCache.js +1 -37
- package/lib/commonjs/formatters/number.js +1 -89
- package/lib/commonjs/formatters/phone.js +1 -369
- package/lib/commonjs/formatters/windowsToIanaTable.js +1 -164
- package/lib/commonjs/geolocation/adapters/expoLocation.js +1 -126
- package/lib/commonjs/geolocation/index.js +1 -355
- package/lib/commonjs/index.js +1 -644
- package/lib/commonjs/initSDK.js +1 -66
- package/lib/commonjs/initUserAuth.js +1 -37
- package/lib/commonjs/logger/crashlytics.js +1 -0
- package/lib/commonjs/logger/index.js +1 -301
- package/lib/commonjs/logger/redact.js +1 -50
- package/lib/commonjs/network/index.js +1 -31
- package/lib/commonjs/network/networkStatus.js +1 -171
- package/lib/commonjs/permissions/calendar.js +1 -14
- package/lib/commonjs/permissions/camera.js +1 -14
- package/lib/commonjs/permissions/contacts.js +1 -10
- package/lib/commonjs/permissions/index.js +1 -133
- package/lib/commonjs/permissions/location.js +1 -14
- package/lib/commonjs/permissions/mediaLibrary.js +1 -10
- package/lib/commonjs/permissions/notifications.js +1 -10
- package/lib/commonjs/permissions/photos.js +1 -14
- package/lib/commonjs/phone/countries.js +1 -265
- package/lib/commonjs/push/index.js +1 -61
- package/lib/commonjs/push/push.js +1 -468
- package/lib/commonjs/push/status.js +1 -0
- package/lib/commonjs/push/task.js +1 -43
- 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/secureScreen/index.js +1 -0
- package/lib/commonjs/share/index.js +1 -70
- package/lib/commonjs/smsRetriever/index.js +1 -91
- package/lib/commonjs/specs/NativeSmsRetriever.js +1 -15
- package/lib/commonjs/sqlite/adapters/expo.js +1 -53
- package/lib/commonjs/sqlite/index.js +1 -604
- package/lib/commonjs/storage/index.js +1 -214
- package/lib/commonjs/types/axios.js +1 -4
- package/lib/commonjs/types/globals.d.js +1 -6
- package/lib/commonjs/utils/base64.js +1 -24
- package/lib/commonjs/utils/imageCompression.js +1 -389
- package/lib/commonjs/utils/index.js +1 -19
- package/lib/commonjs/validators/index.js +1 -227
- package/lib/commonjs/versionCheck/buildNumber.js +1 -0
- package/lib/commonjs/versionCheck/index.js +1 -419
- package/lib/module/api/baseUrl.js +1 -30
- package/lib/module/api/clientHeaders.js +1 -0
- package/lib/module/api/curl.js +1 -104
- package/lib/module/api/minAppVersion.js +1 -0
- package/lib/module/api/multipart.js +1 -16
- package/lib/module/api/publicClient.js +1 -75
- package/lib/module/api/requestDefaults.js +1 -0
- package/lib/module/api/responseBodyText.js +1 -0
- package/lib/module/api/retry.js +1 -85
- package/lib/module/api/tokenRefresh.js +1 -192
- package/lib/module/api/userClient.js +1 -243
- package/lib/module/auth/authStore.js +1 -257
- package/lib/module/auth/index.js +1 -5
- package/lib/module/auth/jwt.js +1 -106
- package/lib/module/config/index.js +1 -64
- package/lib/module/deepLink/index.js +1 -280
- package/lib/module/download/adapters/expoFs.js +1 -64
- package/lib/module/download/adapters/shared.js +1 -8
- package/lib/module/download/index.js +1 -242
- package/lib/module/errors/extractApiError.js +1 -0
- package/lib/module/errors/index.js +1 -0
- package/lib/module/formatters/currency.js +1 -65
- package/lib/module/formatters/date.js +1 -159
- package/lib/module/formatters/dateMath.js +1 -295
- package/lib/module/formatters/formatConfig.js +1 -0
- package/lib/module/formatters/house.js +1 -0
- package/lib/module/formatters/index.js +1 -9
- package/lib/module/formatters/initials.js +1 -27
- package/lib/module/formatters/intlCache.js +1 -30
- package/lib/module/formatters/number.js +1 -82
- package/lib/module/formatters/phone.js +1 -302
- package/lib/module/formatters/windowsToIanaTable.js +1 -160
- package/lib/module/geolocation/adapters/expoLocation.js +1 -121
- package/lib/module/geolocation/index.js +1 -347
- package/lib/module/index.js +1 -57
- package/lib/module/initSDK.js +1 -61
- package/lib/module/initUserAuth.js +1 -33
- package/lib/module/logger/crashlytics.js +1 -0
- package/lib/module/logger/index.js +1 -295
- package/lib/module/logger/redact.js +1 -44
- package/lib/module/network/index.js +1 -4
- package/lib/module/network/networkStatus.js +1 -161
- package/lib/module/permissions/calendar.js +1 -15
- package/lib/module/permissions/camera.js +1 -15
- package/lib/module/permissions/contacts.js +1 -11
- package/lib/module/permissions/index.js +1 -128
- package/lib/module/permissions/location.js +1 -15
- package/lib/module/permissions/mediaLibrary.js +1 -11
- package/lib/module/permissions/notifications.js +1 -11
- package/lib/module/permissions/photos.js +1 -15
- package/lib/module/phone/countries.js +1 -261
- package/lib/module/push/index.js +1 -4
- package/lib/module/push/push.js +1 -452
- package/lib/module/push/status.js +1 -0
- package/lib/module/push/task.js +1 -38
- 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 -0
- package/lib/module/share/index.js +1 -64
- package/lib/module/smsRetriever/index.js +1 -86
- package/lib/module/specs/NativeSmsRetriever.js +1 -13
- package/lib/module/sqlite/adapters/expo.js +1 -48
- package/lib/module/sqlite/index.js +1 -594
- package/lib/module/storage/index.js +1 -208
- package/lib/module/types/axios.js +1 -4
- package/lib/module/types/globals.d.js +1 -10
- package/lib/module/utils/base64.js +1 -19
- package/lib/module/utils/imageCompression.js +1 -383
- package/lib/module/utils/index.js +1 -4
- package/lib/module/validators/index.js +1 -205
- package/lib/module/versionCheck/buildNumber.js +1 -0
- package/lib/module/versionCheck/index.js +1 -413
- 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/responseBodyText.d.ts +6 -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 +26 -8
- package/lib/typescript/commonjs/initSDK.d.ts +18 -6
- package/lib/typescript/commonjs/initUserAuth.d.ts +29 -0
- package/lib/typescript/commonjs/logger/crashlytics.d.ts +31 -0
- package/lib/typescript/commonjs/logger/index.d.ts +17 -0
- package/lib/typescript/commonjs/push/index.d.ts +3 -1
- package/lib/typescript/commonjs/push/push.d.ts +1 -1
- package/lib/typescript/commonjs/push/status.d.ts +9 -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/secureScreen/index.d.ts +25 -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/responseBodyText.d.ts +6 -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 +26 -8
- package/lib/typescript/module/initSDK.d.ts +18 -6
- package/lib/typescript/module/initUserAuth.d.ts +29 -0
- package/lib/typescript/module/logger/crashlytics.d.ts +31 -0
- package/lib/typescript/module/logger/index.d.ts +17 -0
- package/lib/typescript/module/push/index.d.ts +3 -1
- package/lib/typescript/module/push/push.d.ts +1 -1
- package/lib/typescript/module/push/status.d.ts +9 -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/secureScreen/index.d.ts +25 -0
- package/lib/typescript/module/versionCheck/buildNumber.d.ts +14 -0
- package/lib/typescript/module/versionCheck/index.d.ts +28 -17
- package/package.json +52 -5
|
@@ -6,6 +6,7 @@ type LogFn = (message: string, ...optionalParams: unknown[]) => void;
|
|
|
6
6
|
* library depend on any of them.
|
|
7
7
|
*
|
|
8
8
|
* Every method is optional; the library calls only what the adapter implements.
|
|
9
|
+
* `log` receives `info`, `warn` and `error` lines; `debug` never leaves the console.
|
|
9
10
|
*/
|
|
10
11
|
export interface RemoteLogger {
|
|
11
12
|
/** Append a breadcrumb (small, non-error event) for crash context. */
|
|
@@ -57,7 +58,21 @@ export interface LoggerOptions {
|
|
|
57
58
|
}
|
|
58
59
|
/** Configure dedupe window/threshold and screen history size. Merges with current options. */
|
|
59
60
|
export declare const configureLogger: (options: LoggerOptions) => void;
|
|
61
|
+
/** What `Logger.requestFailed` is told about the call beside the error itself. */
|
|
62
|
+
export interface RequestFailedContext {
|
|
63
|
+
/** What the call was, in words: `'Load projects'`. Names the log line; defaults to the method and path. */
|
|
64
|
+
label?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Statuses this call answers as part of its work (a 409 the screen explains, a 404 that
|
|
67
|
+
* means "none yet"): logged as a warning, never recorded as an error.
|
|
68
|
+
*/
|
|
69
|
+
expectedStatuses?: readonly number[];
|
|
70
|
+
/** Anything else worth carrying to the remote sink. Never a token or a request body. */
|
|
71
|
+
[key: string]: unknown;
|
|
72
|
+
}
|
|
60
73
|
export interface LoggerType {
|
|
74
|
+
/** Console only, never forwarded to the remote sink. */
|
|
75
|
+
debug: LogFn;
|
|
61
76
|
info: LogFn;
|
|
62
77
|
warn: LogFn;
|
|
63
78
|
error: LogFn;
|
|
@@ -65,6 +80,8 @@ export interface LoggerType {
|
|
|
65
80
|
breadcrumb: (message: string, data?: Record<string, unknown>) => void;
|
|
66
81
|
/** Record a non-fatal error with optional context. */
|
|
67
82
|
recordError: (error: unknown, context?: Record<string, unknown>) => void;
|
|
83
|
+
/** Log a failed service call: cancel as info, an expected status as a warning, anything else as a recorded error. */
|
|
84
|
+
requestFailed: (error: unknown, context?: RequestFailedContext) => void;
|
|
68
85
|
/** Bind a user identity for subsequent crash reports. */
|
|
69
86
|
setUser: (id: string | null, attrs?: Record<string, unknown>) => void;
|
|
70
87
|
/** Attach a custom attribute (release, build, env, role, etc.). */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export type { PushAction, PushActionHandler, PushAndroidChannel, PushCategory, PushCategoryAction, PushConfig, PushDevice, PushLocalNotification, PushModules, PushNotificationsLike, PushPlatform, PushState
|
|
1
|
+
export type { PushAction, PushActionHandler, PushAndroidChannel, PushCategory, PushCategoryAction, PushConfig, PushDevice, PushLocalNotification, PushModules, PushNotificationsLike, PushPlatform, PushState } from './push.js';
|
|
2
2
|
export { disablePush, enablePush, initPush, notifyLocal, onAction, setBadgeCount, setCategories, setPushImplementation, usePush } from './push.js';
|
|
3
|
+
export type { PushStatus } from './status.js';
|
|
4
|
+
export { PUSH_STATUS } from './status.js';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PushStatus } from './status.js';
|
|
1
2
|
export type PushPlatform = 'Fcm' | 'Apns';
|
|
2
3
|
export interface PushDevice {
|
|
3
4
|
installationId: string;
|
|
@@ -62,7 +63,6 @@ export interface PushLocalNotification {
|
|
|
62
63
|
body: string;
|
|
63
64
|
data?: Record<string, string>;
|
|
64
65
|
}
|
|
65
|
-
export type PushStatus = 'unknown' | 'granted' | 'denied' | 'unavailable';
|
|
66
66
|
export interface PushState {
|
|
67
67
|
status: PushStatus;
|
|
68
68
|
/** True once this process has registered the device, false after `disablePush`. */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The push permission values, as runtime constants an app can compare against. */
|
|
2
|
+
export declare const PUSH_STATUS: {
|
|
3
|
+
readonly unknown: "unknown";
|
|
4
|
+
readonly granted: "granted";
|
|
5
|
+
readonly denied: "denied";
|
|
6
|
+
readonly unavailable: "unavailable";
|
|
7
|
+
};
|
|
8
|
+
export type PushStatus = (typeof PUSH_STATUS)[keyof typeof PUSH_STATUS];
|
|
9
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { BaseQueryFn } from '@reduxjs/toolkit/query';
|
|
2
|
+
import { type AxiosInstance, type Method, type ResponseType } from 'axios';
|
|
3
|
+
import { type ApiError } from '../errors/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* What an endpoint's `query` returns. A bare string is a GET of that URL.
|
|
6
|
+
*
|
|
7
|
+
* `silent` opts this call out of the error toast (decision 42); an endpoint can
|
|
8
|
+
* instead set it once for every call with `extraOptions: { silent: true }`.
|
|
9
|
+
* `public` sends the call through the anonymous client (sign-in, sign-up, a
|
|
10
|
+
* public lookup), so one `createApi` serves both clients.
|
|
11
|
+
*/
|
|
12
|
+
export interface ApiRequest {
|
|
13
|
+
url: string;
|
|
14
|
+
method?: Method;
|
|
15
|
+
/** The request body. FormData is sent as multipart by the client. */
|
|
16
|
+
data?: unknown;
|
|
17
|
+
/** Query string values; build list queries with `buildListQuery`. */
|
|
18
|
+
params?: Record<string, unknown>;
|
|
19
|
+
headers?: Record<string, string>;
|
|
20
|
+
/** Only JSON-safe types belong in the store; a blob download stays a service call. */
|
|
21
|
+
responseType?: Extract<ResponseType, 'json' | 'text'>;
|
|
22
|
+
timeout?: number;
|
|
23
|
+
silent?: boolean;
|
|
24
|
+
public?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export type ApiQueryArgs = string | ApiRequest;
|
|
27
|
+
/** Per-endpoint options, set as the endpoint's `extraOptions`. */
|
|
28
|
+
export interface ApiExtraOptions {
|
|
29
|
+
silent?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returned as the base query's `meta`, which RTK Query copies onto the
|
|
33
|
+
* fulfilled and rejected actions as `action.meta.baseQueryMeta`. The toast
|
|
34
|
+
* middleware reads `silent` there. Plain values only, so the store stays
|
|
35
|
+
* serializable.
|
|
36
|
+
*/
|
|
37
|
+
export interface ApiBaseQueryMeta {
|
|
38
|
+
silent: boolean;
|
|
39
|
+
/** The HTTP status, or 0 when no response arrived. */
|
|
40
|
+
status: number;
|
|
41
|
+
}
|
|
42
|
+
export interface ApiBaseQueryOptions {
|
|
43
|
+
/** The signed-in client every call uses by default (`userClient`). */
|
|
44
|
+
client: AxiosInstance;
|
|
45
|
+
/** The anonymous client for calls marked `public: true` (`publicClient`). */
|
|
46
|
+
publicClient?: AxiosInstance;
|
|
47
|
+
}
|
|
48
|
+
export type ApiBaseQuery = BaseQueryFn<ApiQueryArgs, unknown, ApiError, ApiExtraOptions, ApiBaseQueryMeta>;
|
|
49
|
+
/**
|
|
50
|
+
* The fleet RTK Query base query: every call goes through our axios clients,
|
|
51
|
+
* so refresh, retry, the offline check and logging stay in one place, and a
|
|
52
|
+
* failure comes back as the same `ApiError` a thunk rejects with.
|
|
53
|
+
*/
|
|
54
|
+
export declare const createApiBaseQuery: ({ client, publicClient }: ApiBaseQueryOptions) => ApiBaseQuery;
|
|
55
|
+
//# sourceMappingURL=apiBaseQuery.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createApi } from '@reduxjs/toolkit/query/react';
|
|
2
|
+
/**
|
|
3
|
+
* The fleet `createApi` defaults. Unused data is kept a minute, and active
|
|
4
|
+
* queries refetch when the connection returns and when the user comes back to
|
|
5
|
+
* the app. Both flags only act once the app calls `setupApiListeners` on its
|
|
6
|
+
* store: window focus and online events on the web, `AppState` and the
|
|
7
|
+
* network status on a device.
|
|
8
|
+
*/
|
|
9
|
+
export declare const APP_API_DEFAULTS: {
|
|
10
|
+
readonly keepUnusedDataFor: 60;
|
|
11
|
+
readonly refetchOnReconnect: true;
|
|
12
|
+
readonly refetchOnFocus: true;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* `createApi` with the fleet defaults; anything the app passes wins. One per
|
|
16
|
+
* app, in `services/api/apiSlice`, with `baseQuery: createApiBaseQuery(...)`
|
|
17
|
+
* and the app's `tagTypes`. Imported from the React entry so endpoints get
|
|
18
|
+
* their hooks; that entry needs `react-redux`, which every app has.
|
|
19
|
+
*/
|
|
20
|
+
export declare const createAppApi: typeof createApi;
|
|
21
|
+
//# sourceMappingURL=createAppApi.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { ApiBaseQuery, ApiBaseQueryMeta, ApiBaseQueryOptions, ApiExtraOptions, ApiQueryArgs, ApiRequest } from './apiBaseQuery.js';
|
|
2
|
+
export { createApiBaseQuery } from './apiBaseQuery.js';
|
|
3
|
+
export { APP_API_DEFAULTS, createAppApi } from './createAppApi.js';
|
|
4
|
+
export { setupApiListeners } from './listeners.js';
|
|
5
|
+
export type { ListFilterValue, ListQuery, PagedDataObject, PagedListRequest, SortOrder } from './paging.js';
|
|
6
|
+
export { buildListQuery, getNextPageParam, getPreviousPageParam, hasNextPage, hasPreviousPage } from './paging.js';
|
|
7
|
+
export type { ApiTag, TagId } from './tags.js';
|
|
8
|
+
export { itemTag, LIST_TAG_ID, listTag, providesList, providesPagedList } from './tags.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';
|
|
2
|
+
/**
|
|
3
|
+
* Wires `refetchOnFocus` and `refetchOnReconnect` to the device. RTK's default
|
|
4
|
+
* handlers listen to `window` focus and online events, which never fire in
|
|
5
|
+
* React Native, so the app returning to the foreground counts as focus and
|
|
6
|
+
* mobile-core's network status drives online and offline (the same status the
|
|
7
|
+
* user client checks before every request). Call once after the store is
|
|
8
|
+
* created; it returns the unsubscribe.
|
|
9
|
+
*/
|
|
10
|
+
export declare const setupApiListeners: (dispatch: ThunkDispatch<unknown, unknown, UnknownAction>) => (() => void);
|
|
11
|
+
//# sourceMappingURL=listeners.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fleet list contract, matching Webority.Delivery: the request is
|
|
3
|
+
* `PagedListRequest` (`page` 1-based, `pageSize`, `sortBy`, `sortOrder`) plus the
|
|
4
|
+
* endpoint's filters, and the response is `PagedDataObject<T>`. The server
|
|
5
|
+
* defaults a missing page to 1 and a missing size to 20, and cuts a size over
|
|
6
|
+
* 100 to 100.
|
|
7
|
+
*/
|
|
8
|
+
export interface PagedDataObject<T> {
|
|
9
|
+
items: T[];
|
|
10
|
+
page: number;
|
|
11
|
+
pageSize: number;
|
|
12
|
+
totalCount: number;
|
|
13
|
+
totalPages: number;
|
|
14
|
+
}
|
|
15
|
+
export type SortOrder = 'asc' | 'desc';
|
|
16
|
+
export interface PagedListRequest {
|
|
17
|
+
page?: number;
|
|
18
|
+
pageSize?: number;
|
|
19
|
+
sortBy?: string;
|
|
20
|
+
sortOrder?: SortOrder;
|
|
21
|
+
}
|
|
22
|
+
export type ListFilterValue = string | number | boolean | null | undefined;
|
|
23
|
+
export interface ListQuery extends PagedListRequest {
|
|
24
|
+
filters?: Record<string, ListFilterValue>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The `params` for a list endpoint. Filters sit beside the paging keys, as the
|
|
28
|
+
* API's request type derives from `PagedListRequest`. Unset values and empty
|
|
29
|
+
* strings are dropped, so a cleared filter never sends `?status=`. A filter
|
|
30
|
+
* named like a paging key is refused rather than silently overriding it.
|
|
31
|
+
*/
|
|
32
|
+
export declare const buildListQuery: ({ page, pageSize, sortBy, sortOrder, filters }: ListQuery) => Record<string, string | number | boolean>;
|
|
33
|
+
export declare const hasNextPage: (page: PagedDataObject<unknown>) => boolean;
|
|
34
|
+
export declare const hasPreviousPage: (page: PagedDataObject<unknown>) => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* `getNextPageParam` for an RTK Query infinite query over a paged endpoint
|
|
37
|
+
* (pull-to-load lists): the next page number, or `undefined` on the last page.
|
|
38
|
+
*/
|
|
39
|
+
export declare const getNextPageParam: (lastPage: PagedDataObject<unknown>) => number | undefined;
|
|
40
|
+
/** `getPreviousPageParam` for the same infinite query. */
|
|
41
|
+
export declare const getPreviousPageParam: (firstPage: PagedDataObject<unknown>) => number | undefined;
|
|
42
|
+
//# sourceMappingURL=paging.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PagedDataObject } from './paging.js';
|
|
2
|
+
/**
|
|
3
|
+
* The fleet tag convention. A list read provides `{ type, id: 'LIST' }` plus one
|
|
4
|
+
* tag per row; a create invalidates `LIST`, an update or delete invalidates the
|
|
5
|
+
* row's tag (and `LIST` when it changes membership or order). Row ids are the
|
|
6
|
+
* public ids the API returns (D-039), never an internal key.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LIST_TAG_ID = "LIST";
|
|
9
|
+
export type TagId = string | number;
|
|
10
|
+
export interface ApiTag<TagType extends string> {
|
|
11
|
+
type: TagType;
|
|
12
|
+
id: TagId;
|
|
13
|
+
}
|
|
14
|
+
type IdSelector<T> = (item: T) => TagId;
|
|
15
|
+
export declare const listTag: <TagType extends string>(type: TagType) => ApiTag<TagType>;
|
|
16
|
+
export declare const itemTag: <TagType extends string>(type: TagType, id: TagId) => ApiTag<TagType>;
|
|
17
|
+
/** Tags for a list response. A failed read still provides `LIST`, so the next write refetches it. */
|
|
18
|
+
export declare function providesList<TagType extends string, T extends {
|
|
19
|
+
publicId: string;
|
|
20
|
+
}>(type: TagType, items: readonly T[] | undefined): ApiTag<TagType>[];
|
|
21
|
+
export declare function providesList<TagType extends string, T>(type: TagType, items: readonly T[] | undefined, selectId: IdSelector<T>): ApiTag<TagType>[];
|
|
22
|
+
/**
|
|
23
|
+
* `providesTags` for an endpoint returning `PagedDataObject<T>`:
|
|
24
|
+
* `providesTags: providesPagedList('Project')`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function providesPagedList<TagType extends string, T extends {
|
|
27
|
+
publicId: string;
|
|
28
|
+
}>(type: TagType): (result: PagedDataObject<T> | undefined) => ApiTag<TagType>[];
|
|
29
|
+
export declare function providesPagedList<TagType extends string, T>(type: TagType, selectId: IdSelector<T>): (result: PagedDataObject<T> | undefined) => ApiTag<TagType>[];
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=tags.d.ts.map
|
|
@@ -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,25 @@
|
|
|
1
|
+
export interface SecureScreenOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Whether the screen is the one on show. Pass React Navigation's
|
|
4
|
+
* `useIsFocused()`, so a secure screen left underneath a pushed screen stops
|
|
5
|
+
* blocking. Default `true`: block for as long as the component is mounted.
|
|
6
|
+
*/
|
|
7
|
+
focused?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Blocks capture while the calling screen is focused and releases it on blur
|
|
11
|
+
* or unmount. Each call holds its own claim, so two secure screens on the stack
|
|
12
|
+
* never release each other's protection.
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { useIsFocused } from '@react-navigation/native';
|
|
16
|
+
* import { useSecureScreen } from '@webority/mobile-core/secureScreen';
|
|
17
|
+
*
|
|
18
|
+
* const SignInScreen = () => {
|
|
19
|
+
* useSecureScreen({ focused: useIsFocused() });
|
|
20
|
+
* // ...
|
|
21
|
+
* };
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const useSecureScreen: (options?: SecureScreenOptions) => void;
|
|
25
|
+
//# sourceMappingURL=index.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.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",
|
|
@@ -161,6 +161,16 @@
|
|
|
161
161
|
"default": "./lib/commonjs/share/index.js"
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
|
+
"./secureScreen": {
|
|
165
|
+
"import": {
|
|
166
|
+
"types": "./lib/typescript/module/secureScreen/index.d.ts",
|
|
167
|
+
"default": "./lib/module/secureScreen/index.js"
|
|
168
|
+
},
|
|
169
|
+
"require": {
|
|
170
|
+
"types": "./lib/typescript/commonjs/secureScreen/index.d.ts",
|
|
171
|
+
"default": "./lib/commonjs/secureScreen/index.js"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
164
174
|
"./push": {
|
|
165
175
|
"import": {
|
|
166
176
|
"types": "./lib/typescript/module/push/index.d.ts",
|
|
@@ -191,6 +201,16 @@
|
|
|
191
201
|
"default": "./lib/commonjs/smsRetriever/index.js"
|
|
192
202
|
}
|
|
193
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
|
+
},
|
|
194
214
|
"./phone/countries": {
|
|
195
215
|
"import": {
|
|
196
216
|
"types": "./lib/typescript/module/phone/countries.d.ts",
|
|
@@ -201,6 +221,16 @@
|
|
|
201
221
|
"default": "./lib/commonjs/phone/countries.js"
|
|
202
222
|
}
|
|
203
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
|
+
},
|
|
204
234
|
"./package.json": "./package.json"
|
|
205
235
|
},
|
|
206
236
|
"main": "./lib/commonjs/index.js",
|
|
@@ -211,6 +241,9 @@
|
|
|
211
241
|
"lib",
|
|
212
242
|
"src/specs",
|
|
213
243
|
"android",
|
|
244
|
+
"!android/build",
|
|
245
|
+
"!android/.gradle",
|
|
246
|
+
"!android/.cxx",
|
|
214
247
|
"!**/__tests__",
|
|
215
248
|
"!**/*.test.*",
|
|
216
249
|
"!**/*.spec.*",
|
|
@@ -225,7 +258,7 @@
|
|
|
225
258
|
}
|
|
226
259
|
},
|
|
227
260
|
"scripts": {
|
|
228
|
-
"build": "bob build",
|
|
261
|
+
"build": "bob build && node ../../scripts/minify-lib.mjs",
|
|
229
262
|
"clean": "rimraf lib",
|
|
230
263
|
"lint": "biome lint ./src",
|
|
231
264
|
"lint:fix": "biome lint --write ./src",
|
|
@@ -237,6 +270,7 @@
|
|
|
237
270
|
"libphonenumber-js": "^1.12.41"
|
|
238
271
|
},
|
|
239
272
|
"peerDependencies": {
|
|
273
|
+
"@reduxjs/toolkit": "^2.12.0",
|
|
240
274
|
"expo": ">=57.0.0",
|
|
241
275
|
"expo-application": ">=57.0.0",
|
|
242
276
|
"expo-calendar": ">=57.0.0",
|
|
@@ -249,14 +283,19 @@
|
|
|
249
283
|
"expo-media-library": ">=57.0.0",
|
|
250
284
|
"expo-network": ">=57.0.0",
|
|
251
285
|
"expo-notifications": ">=57.0.0",
|
|
286
|
+
"expo-screen-capture": ">=57.0.0",
|
|
252
287
|
"expo-secure-store": ">=57.0.0",
|
|
253
288
|
"expo-sharing": ">=57.0.0",
|
|
254
289
|
"expo-sqlite": ">=57.0.0",
|
|
255
290
|
"expo-task-manager": ">=57.0.0",
|
|
256
291
|
"react": "^19.1.0",
|
|
257
|
-
"react-native": ">=0.81.0"
|
|
292
|
+
"react-native": ">=0.81.0",
|
|
293
|
+
"react-redux": "^9.3.0"
|
|
258
294
|
},
|
|
259
295
|
"peerDependenciesMeta": {
|
|
296
|
+
"@reduxjs/toolkit": {
|
|
297
|
+
"optional": true
|
|
298
|
+
},
|
|
260
299
|
"expo-calendar": {
|
|
261
300
|
"optional": true
|
|
262
301
|
},
|
|
@@ -284,11 +323,17 @@
|
|
|
284
323
|
"expo-notifications": {
|
|
285
324
|
"optional": true
|
|
286
325
|
},
|
|
326
|
+
"expo-screen-capture": {
|
|
327
|
+
"optional": true
|
|
328
|
+
},
|
|
287
329
|
"expo-sharing": {
|
|
288
330
|
"optional": true
|
|
289
331
|
},
|
|
290
332
|
"expo-task-manager": {
|
|
291
333
|
"optional": true
|
|
334
|
+
},
|
|
335
|
+
"react-redux": {
|
|
336
|
+
"optional": true
|
|
292
337
|
}
|
|
293
338
|
},
|
|
294
339
|
"publishConfig": {
|
|
@@ -302,13 +347,15 @@
|
|
|
302
347
|
[
|
|
303
348
|
"commonjs",
|
|
304
349
|
{
|
|
305
|
-
"esm": true
|
|
350
|
+
"esm": true,
|
|
351
|
+
"sourceMaps": false
|
|
306
352
|
}
|
|
307
353
|
],
|
|
308
354
|
[
|
|
309
355
|
"module",
|
|
310
356
|
{
|
|
311
|
-
"esm": true
|
|
357
|
+
"esm": true,
|
|
358
|
+
"sourceMaps": false
|
|
312
359
|
}
|
|
313
360
|
],
|
|
314
361
|
[
|