@webority/mobile-core 0.149.0 → 0.150.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/lib/commonjs/api/baseUrl.js +1 -1
- package/lib/commonjs/api/contractCaller.js +1 -0
- package/lib/commonjs/api/curl.js +1 -1
- package/lib/commonjs/api/minAppVersion.js +1 -1
- package/lib/commonjs/api/requestDefaults.js +1 -1
- 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/api/workspace.js +1 -1
- package/lib/commonjs/auth/authStore.js +1 -1
- package/lib/commonjs/auth/jwt.js +1 -1
- package/lib/commonjs/deepLink/index.js +1 -1
- package/lib/commonjs/download/adapters/expoFs.js +1 -1
- package/lib/commonjs/download/index.js +1 -1
- package/lib/commonjs/errors/extractApiError.js +1 -1
- package/lib/commonjs/errors/index.js +1 -1
- package/lib/commonjs/errors/parseResponse.js +1 -0
- package/lib/commonjs/errors/requestPlatform.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 -1
- package/lib/commonjs/formatters/house.js +1 -1
- package/lib/commonjs/formatters/number.js +1 -1
- package/lib/commonjs/formatters/phone.js +1 -1
- package/lib/commonjs/geolocation/index.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/india/gstStates.js +1 -0
- package/lib/commonjs/india/index.js +1 -1
- package/lib/commonjs/logger/crashlytics.js +1 -1
- package/lib/commonjs/logger/index.js +1 -1
- package/lib/commonjs/logger/redact.js +1 -1
- package/lib/commonjs/network/networkStatus.js +1 -1
- package/lib/commonjs/outbox/outbox.js +1 -1
- package/lib/commonjs/push/broadcasts.js +1 -1
- package/lib/commonjs/push/push.js +1 -1
- package/lib/commonjs/query/apiBaseQuery.js +1 -1
- package/lib/commonjs/query/dataState.js +1 -0
- package/lib/commonjs/query/index.js +1 -1
- package/lib/commonjs/query/persistedQueries.js +1 -1
- package/lib/commonjs/query/tags.js +1 -1
- package/lib/commonjs/query/usePagedList.js +1 -1
- package/lib/commonjs/redux/errorToastMiddleware.js +1 -1
- package/lib/commonjs/redux/rootReducer.js +1 -1
- package/lib/commonjs/redux/sessionMiddleware.js +1 -1
- package/lib/commonjs/review/index.js +1 -1
- package/lib/commonjs/secureScreen/index.js +1 -1
- package/lib/commonjs/sqlite/index.js +1 -1
- package/lib/commonjs/storage/index.js +1 -1
- package/lib/commonjs/types/complete.js +1 -0
- package/lib/commonjs/types/formData.d.js +1 -0
- package/lib/commonjs/updates/updates.js +1 -1
- package/lib/commonjs/utils/base64.js +1 -1
- package/lib/commonjs/utils/guards.js +1 -0
- package/lib/commonjs/utils/imageCompression.js +1 -1
- package/lib/module/api/baseUrl.js +1 -1
- package/lib/module/api/contractCaller.js +1 -0
- package/lib/module/api/curl.js +1 -1
- package/lib/module/api/minAppVersion.js +1 -1
- package/lib/module/api/requestDefaults.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/api/workspace.js +1 -1
- package/lib/module/auth/authStore.js +1 -1
- package/lib/module/auth/jwt.js +1 -1
- package/lib/module/deepLink/index.js +1 -1
- package/lib/module/download/adapters/expoFs.js +1 -1
- package/lib/module/download/index.js +1 -1
- package/lib/module/errors/extractApiError.js +1 -1
- package/lib/module/errors/index.js +1 -1
- package/lib/module/errors/parseResponse.js +1 -0
- package/lib/module/errors/requestPlatform.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 -1
- package/lib/module/formatters/house.js +1 -1
- package/lib/module/formatters/number.js +1 -1
- package/lib/module/formatters/phone.js +1 -1
- package/lib/module/geolocation/index.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/india/gstStates.js +1 -0
- package/lib/module/india/index.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/networkStatus.js +1 -1
- package/lib/module/outbox/outbox.js +1 -1
- package/lib/module/push/broadcasts.js +1 -1
- package/lib/module/push/push.js +1 -1
- package/lib/module/query/apiBaseQuery.js +1 -1
- package/lib/module/query/dataState.js +1 -0
- package/lib/module/query/index.js +1 -1
- package/lib/module/query/persistedQueries.js +1 -1
- package/lib/module/query/tags.js +1 -1
- package/lib/module/query/usePagedList.js +1 -1
- package/lib/module/redux/errorToastMiddleware.js +1 -1
- package/lib/module/redux/rootReducer.js +1 -1
- package/lib/module/redux/sessionMiddleware.js +1 -1
- package/lib/module/review/index.js +1 -1
- package/lib/module/secureScreen/index.js +1 -1
- package/lib/module/sqlite/index.js +1 -1
- package/lib/module/storage/index.js +1 -1
- package/lib/module/types/complete.js +1 -0
- package/lib/module/types/formData.d.js +1 -0
- package/lib/module/updates/updates.js +1 -1
- package/lib/module/utils/base64.js +1 -1
- package/lib/module/utils/guards.js +1 -0
- package/lib/module/utils/imageCompression.js +1 -1
- package/lib/typescript/commonjs/api/clientHeaders.d.ts +1 -1
- package/lib/typescript/commonjs/api/contractCaller.d.ts +7 -0
- package/lib/typescript/commonjs/api/fetchRetry.d.ts +3 -3
- package/lib/typescript/commonjs/api/minAppVersion.d.ts +1 -1
- package/lib/typescript/commonjs/api/retry.d.ts +11 -5
- package/lib/typescript/commonjs/api/tokenRefresh.d.ts +2 -1
- package/lib/typescript/commonjs/api/userClient.d.ts +11 -0
- package/lib/typescript/commonjs/api/workspace.d.ts +3 -3
- package/lib/typescript/commonjs/appLock/index.d.ts +1 -1
- package/lib/typescript/commonjs/attachments/index.d.ts +5 -5
- package/lib/typescript/commonjs/auth/authStore.d.ts +8 -6
- package/lib/typescript/commonjs/auth/jwt.d.ts +11 -8
- package/lib/typescript/commonjs/deepLink/index.d.ts +18 -11
- package/lib/typescript/commonjs/download/adapters/expoFs.d.ts +4 -4
- package/lib/typescript/commonjs/download/index.d.ts +16 -12
- package/lib/typescript/commonjs/errors/extractApiError.d.ts +5 -17
- package/lib/typescript/commonjs/errors/index.d.ts +2 -0
- package/lib/typescript/commonjs/errors/parseResponse.d.ts +20 -0
- package/lib/typescript/commonjs/errors/requestPlatform.d.ts +8 -0
- package/lib/typescript/commonjs/formatters/currency.d.ts +5 -5
- package/lib/typescript/commonjs/formatters/dateMath.d.ts +2 -2
- package/lib/typescript/commonjs/formatters/formatConfig.d.ts +8 -6
- package/lib/typescript/commonjs/formatters/house.d.ts +19 -20
- package/lib/typescript/commonjs/formatters/intlCache.d.ts +1 -3
- package/lib/typescript/commonjs/formatters/phone.d.ts +3 -3
- package/lib/typescript/commonjs/geolocation/adapters/expoLocation.d.ts +11 -11
- package/lib/typescript/commonjs/geolocation/index.d.ts +29 -26
- package/lib/typescript/commonjs/index.d.ts +5 -2
- package/lib/typescript/commonjs/india/gstStates.d.ts +8 -0
- package/lib/typescript/commonjs/india/gstStates.g.d.ts +1 -1
- package/lib/typescript/commonjs/india/index.d.ts +1 -0
- package/lib/typescript/commonjs/initSDK.d.ts +14 -14
- package/lib/typescript/commonjs/initUserAuth.d.ts +9 -8
- package/lib/typescript/commonjs/logger/crashlytics.d.ts +5 -4
- package/lib/typescript/commonjs/logger/index.d.ts +19 -19
- package/lib/typescript/commonjs/logger/redact.d.ts +3 -1
- package/lib/typescript/commonjs/metro/types.d.ts +4 -4
- package/lib/typescript/commonjs/network/networkStatus.d.ts +1 -1
- package/lib/typescript/commonjs/outbox/types.d.ts +6 -6
- package/lib/typescript/commonjs/permissions/index.d.ts +7 -4
- package/lib/typescript/commonjs/pickers/index.d.ts +18 -18
- package/lib/typescript/commonjs/push/push.d.ts +23 -23
- package/lib/typescript/commonjs/query/apiBaseQuery.d.ts +14 -14
- package/lib/typescript/commonjs/query/dataState.d.ts +58 -0
- package/lib/typescript/commonjs/query/index.d.ts +3 -1
- package/lib/typescript/commonjs/query/paging.d.ts +5 -5
- package/lib/typescript/commonjs/query/persistedQueries.d.ts +12 -7
- package/lib/typescript/commonjs/query/usePagedList.d.ts +9 -17
- package/lib/typescript/commonjs/redux/errorToastMiddleware.d.ts +4 -4
- package/lib/typescript/commonjs/redux/rootReducer.d.ts +1 -1
- package/lib/typescript/commonjs/review/index.d.ts +1 -1
- package/lib/typescript/commonjs/secureScreen/index.d.ts +1 -1
- package/lib/typescript/commonjs/share/index.d.ts +2 -2
- package/lib/typescript/commonjs/sqlite/index.d.ts +21 -16
- package/lib/typescript/commonjs/storage/index.d.ts +9 -9
- package/lib/typescript/commonjs/types/axios.d.ts +2 -2
- package/lib/typescript/commonjs/types/complete.d.ts +5 -0
- package/lib/typescript/commonjs/updates/updates.d.ts +20 -20
- package/lib/typescript/commonjs/utils/guards.d.ts +9 -0
- package/lib/typescript/commonjs/utils/imageCompression.d.ts +9 -9
- package/lib/typescript/commonjs/validators/index.d.ts +5 -5
- package/lib/typescript/commonjs/versionCheck/appBuild.d.ts +3 -2
- package/lib/typescript/commonjs/versionCheck/index.d.ts +4 -4
- package/lib/typescript/module/api/clientHeaders.d.ts +1 -1
- package/lib/typescript/module/api/contractCaller.d.ts +7 -0
- package/lib/typescript/module/api/fetchRetry.d.ts +3 -3
- package/lib/typescript/module/api/minAppVersion.d.ts +1 -1
- package/lib/typescript/module/api/retry.d.ts +11 -5
- package/lib/typescript/module/api/tokenRefresh.d.ts +2 -1
- package/lib/typescript/module/api/userClient.d.ts +11 -0
- package/lib/typescript/module/api/workspace.d.ts +3 -3
- package/lib/typescript/module/appLock/index.d.ts +1 -1
- package/lib/typescript/module/attachments/index.d.ts +5 -5
- package/lib/typescript/module/auth/authStore.d.ts +8 -6
- package/lib/typescript/module/auth/jwt.d.ts +11 -8
- package/lib/typescript/module/deepLink/index.d.ts +18 -11
- package/lib/typescript/module/download/adapters/expoFs.d.ts +4 -4
- package/lib/typescript/module/download/index.d.ts +16 -12
- package/lib/typescript/module/errors/extractApiError.d.ts +5 -17
- package/lib/typescript/module/errors/index.d.ts +2 -0
- package/lib/typescript/module/errors/parseResponse.d.ts +20 -0
- package/lib/typescript/module/errors/requestPlatform.d.ts +8 -0
- package/lib/typescript/module/formatters/currency.d.ts +5 -5
- package/lib/typescript/module/formatters/dateMath.d.ts +2 -2
- package/lib/typescript/module/formatters/formatConfig.d.ts +8 -6
- package/lib/typescript/module/formatters/house.d.ts +19 -20
- package/lib/typescript/module/formatters/intlCache.d.ts +1 -3
- package/lib/typescript/module/formatters/phone.d.ts +3 -3
- package/lib/typescript/module/geolocation/adapters/expoLocation.d.ts +11 -11
- package/lib/typescript/module/geolocation/index.d.ts +29 -26
- package/lib/typescript/module/index.d.ts +5 -2
- package/lib/typescript/module/india/gstStates.d.ts +8 -0
- package/lib/typescript/module/india/gstStates.g.d.ts +1 -1
- package/lib/typescript/module/india/index.d.ts +1 -0
- package/lib/typescript/module/initSDK.d.ts +14 -14
- package/lib/typescript/module/initUserAuth.d.ts +9 -8
- package/lib/typescript/module/logger/crashlytics.d.ts +5 -4
- package/lib/typescript/module/logger/index.d.ts +19 -19
- package/lib/typescript/module/logger/redact.d.ts +3 -1
- package/lib/typescript/module/metro/types.d.ts +4 -4
- package/lib/typescript/module/network/networkStatus.d.ts +1 -1
- package/lib/typescript/module/outbox/types.d.ts +6 -6
- package/lib/typescript/module/permissions/index.d.ts +7 -4
- package/lib/typescript/module/pickers/index.d.ts +18 -18
- package/lib/typescript/module/push/push.d.ts +23 -23
- package/lib/typescript/module/query/apiBaseQuery.d.ts +14 -14
- package/lib/typescript/module/query/dataState.d.ts +58 -0
- package/lib/typescript/module/query/index.d.ts +3 -1
- package/lib/typescript/module/query/paging.d.ts +5 -5
- package/lib/typescript/module/query/persistedQueries.d.ts +12 -7
- package/lib/typescript/module/query/usePagedList.d.ts +9 -17
- package/lib/typescript/module/redux/errorToastMiddleware.d.ts +4 -4
- package/lib/typescript/module/redux/rootReducer.d.ts +1 -1
- package/lib/typescript/module/review/index.d.ts +1 -1
- package/lib/typescript/module/secureScreen/index.d.ts +1 -1
- package/lib/typescript/module/share/index.d.ts +2 -2
- package/lib/typescript/module/sqlite/index.d.ts +21 -16
- package/lib/typescript/module/storage/index.d.ts +9 -9
- package/lib/typescript/module/types/axios.d.ts +2 -2
- package/lib/typescript/module/types/complete.d.ts +5 -0
- package/lib/typescript/module/updates/updates.d.ts +20 -20
- package/lib/typescript/module/utils/guards.d.ts +9 -0
- package/lib/typescript/module/utils/imageCompression.d.ts +9 -9
- package/lib/typescript/module/validators/index.d.ts +5 -5
- package/lib/typescript/module/versionCheck/appBuild.d.ts +3 -2
- package/lib/typescript/module/versionCheck/index.d.ts +4 -4
- package/package.json +3 -2
- package/src/specs/NativeSmsRetriever.ts +1 -1
|
@@ -4,7 +4,7 @@ export declare const DEFAULT_REVIEW_COOL_DOWN_DAYS = 90;
|
|
|
4
4
|
export declare const REVIEW_PROMPT_STORAGE_KEY = "@webority/review-prompt";
|
|
5
5
|
export interface ReviewPromptOptions {
|
|
6
6
|
/** Days to wait after a prompt before the next one. Defaults to 90, the minimum. */
|
|
7
|
-
coolDownDays?: number;
|
|
7
|
+
coolDownDays?: number | undefined;
|
|
8
8
|
}
|
|
9
9
|
/** What was stored when the prompt last showed. */
|
|
10
10
|
export interface ReviewPromptRecord {
|
|
@@ -4,7 +4,7 @@ export interface SecureScreenOptions {
|
|
|
4
4
|
* `useIsFocused()`, so a secure screen left underneath a pushed screen stops
|
|
5
5
|
* blocking. Default `true`: block for as long as the component is mounted.
|
|
6
6
|
*/
|
|
7
|
-
focused?: boolean;
|
|
7
|
+
focused?: boolean | undefined;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Blocks capture while the calling screen is focused and releases it on blur
|
|
@@ -16,9 +16,9 @@ export declare class ShareError extends Error {
|
|
|
16
16
|
}
|
|
17
17
|
export interface ShareFileOptions {
|
|
18
18
|
/** Picks the apps Android offers; mapped to a UTI for iOS where one is known. */
|
|
19
|
-
mimeType?: string;
|
|
19
|
+
mimeType?: string | undefined;
|
|
20
20
|
/** The share sheet's title on Android. */
|
|
21
|
-
dialogTitle?: string;
|
|
21
|
+
dialogTitle?: string | undefined;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Hands a local file (the `path` `downloadFile` returns) to the share sheet.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export interface SqliteResultSet {
|
|
10
10
|
rows: Record<string, unknown>[];
|
|
11
11
|
rowsAffected: number;
|
|
12
|
-
insertId?: number;
|
|
12
|
+
insertId?: number | undefined;
|
|
13
13
|
}
|
|
14
14
|
export interface SqliteDatabase {
|
|
15
15
|
execute: (sql: string, params?: readonly unknown[]) => Promise<SqliteResultSet>;
|
|
@@ -17,7 +17,7 @@ export interface SqliteDatabase {
|
|
|
17
17
|
}
|
|
18
18
|
export interface SqliteDriver {
|
|
19
19
|
open: (name: string, options?: {
|
|
20
|
-
location?: string;
|
|
20
|
+
location?: string | undefined;
|
|
21
21
|
}) => Promise<SqliteDatabase>;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -49,7 +49,7 @@ export declare const whereIn: (column: string, values: readonly unknown[]) => {
|
|
|
49
49
|
};
|
|
50
50
|
export interface RawWhere {
|
|
51
51
|
sql: string;
|
|
52
|
-
params?: readonly unknown[];
|
|
52
|
+
params?: readonly unknown[] | undefined;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Either a map of column to value (ANDed, `null` meaning IS NULL) or a raw
|
|
@@ -57,13 +57,13 @@ export interface RawWhere {
|
|
|
57
57
|
*/
|
|
58
58
|
export type Where = Record<string, unknown> | RawWhere;
|
|
59
59
|
export interface FindOptions {
|
|
60
|
-
orderBy?: string;
|
|
61
|
-
limit?: number;
|
|
62
|
-
offset?: number;
|
|
60
|
+
orderBy?: string | undefined;
|
|
61
|
+
limit?: number | undefined;
|
|
62
|
+
offset?: number | undefined;
|
|
63
63
|
}
|
|
64
64
|
export interface Migration {
|
|
65
65
|
version: number;
|
|
66
|
-
name?: string;
|
|
66
|
+
name?: string | undefined;
|
|
67
67
|
up: string | string[] | ((tx: Pick<Db, "execute">) => Promise<void>);
|
|
68
68
|
}
|
|
69
69
|
export interface MigrateOptions {
|
|
@@ -71,21 +71,24 @@ export interface MigrateOptions {
|
|
|
71
71
|
* Skip the downgrade guard. Only set this when the app knows the older code
|
|
72
72
|
* can read the newer schema.
|
|
73
73
|
*/
|
|
74
|
-
allowDowngrade?: boolean;
|
|
74
|
+
allowDowngrade?: boolean | undefined;
|
|
75
75
|
}
|
|
76
76
|
export declare const DEFAULT_PRAGMAS: Readonly<Record<string, string | number>>;
|
|
77
77
|
export interface OpenDatabaseOptions {
|
|
78
|
-
location?: string;
|
|
78
|
+
location?: string | undefined;
|
|
79
79
|
/**
|
|
80
80
|
* Merged over DEFAULT_PRAGMAS and applied on open. Pass `false` to apply none.
|
|
81
81
|
*/
|
|
82
|
-
pragmas?: Record<string, string | number> | false;
|
|
82
|
+
pragmas?: Record<string, string | number> | false | undefined;
|
|
83
83
|
}
|
|
84
|
+
export type SqlRow = Readonly<Record<string, unknown>>;
|
|
84
85
|
export interface Db {
|
|
85
86
|
readonly name: string;
|
|
86
87
|
execute: (sql: string, params?: readonly unknown[]) => Promise<SqliteResultSet>;
|
|
87
|
-
select
|
|
88
|
-
|
|
88
|
+
select(sql: string, params?: readonly unknown[]): Promise<SqlRow[]>;
|
|
89
|
+
select<T>(sql: string, params: readonly unknown[] | undefined, parse: (row: SqlRow) => T): Promise<T[]>;
|
|
90
|
+
selectOne(sql: string, params?: readonly unknown[]): Promise<SqlRow | null>;
|
|
91
|
+
selectOne<T>(sql: string, params: readonly unknown[] | undefined, parse: (row: SqlRow) => T): Promise<T | null>;
|
|
89
92
|
/**
|
|
90
93
|
* Runs `work` alone on the connection: every other call on this database
|
|
91
94
|
* waits until it commits or rolls back. Inside `work` use only `tx`; a call
|
|
@@ -97,15 +100,17 @@ export interface Db {
|
|
|
97
100
|
update: (table: string, values: Record<string, unknown>, where: Where) => Promise<number>;
|
|
98
101
|
remove: (table: string, where: Where) => Promise<number>;
|
|
99
102
|
upsert: (table: string, row: Record<string, unknown>, conflictColumns: string[]) => Promise<void>;
|
|
100
|
-
findAll
|
|
101
|
-
|
|
103
|
+
findAll(table: string, where?: Where, options?: FindOptions): Promise<SqlRow[]>;
|
|
104
|
+
findAll<T>(table: string, where: Where | undefined, options: FindOptions | undefined, parse: (row: SqlRow) => T): Promise<T[]>;
|
|
105
|
+
findOne(table: string, where?: Where): Promise<SqlRow | null>;
|
|
106
|
+
findOne<T>(table: string, where: Where | undefined, parse: (row: SqlRow) => T): Promise<T | null>;
|
|
102
107
|
count: (table: string, where?: Where) => Promise<number>;
|
|
103
108
|
tableExists: (table: string) => Promise<boolean>;
|
|
104
109
|
createTable: (table: string, columns: Record<string, string>, options?: {
|
|
105
|
-
ifNotExists?: boolean;
|
|
110
|
+
ifNotExists?: boolean | undefined;
|
|
106
111
|
}) => Promise<void>;
|
|
107
112
|
dropTable: (table: string, options?: {
|
|
108
|
-
ifExists?: boolean;
|
|
113
|
+
ifExists?: boolean | undefined;
|
|
109
114
|
}) => Promise<void>;
|
|
110
115
|
wipe: () => Promise<void>;
|
|
111
116
|
reset: (migrations: Migration[]) => Promise<number>;
|
|
@@ -19,14 +19,14 @@ interface AsyncStorageLike {
|
|
|
19
19
|
* AsyncStorage 3, so recognising only the v1 names put every consumer on N
|
|
20
20
|
* round-trips per batch with nothing to notice.
|
|
21
21
|
*/
|
|
22
|
-
getMany?: (keys: string[]) => Promise<Record<string, string | null
|
|
23
|
-
setMany?: (entries: Record<string, string>) => Promise<void
|
|
24
|
-
removeMany?: (keys: string[]) => Promise<void
|
|
25
|
-
multiGet?: (keys:
|
|
26
|
-
multiSet?: (kvs:
|
|
27
|
-
multiRemove?: (keys:
|
|
28
|
-
clear?: () => Promise<void
|
|
29
|
-
getAllKeys?: () => Promise<readonly string[]
|
|
22
|
+
getMany?: ((keys: string[]) => Promise<Record<string, string | null>>) | undefined;
|
|
23
|
+
setMany?: ((entries: Record<string, string>) => Promise<void>) | undefined;
|
|
24
|
+
removeMany?: ((keys: string[]) => Promise<void>) | undefined;
|
|
25
|
+
multiGet?: ((keys: string[]) => Promise<readonly [string, string | null][]>) | undefined;
|
|
26
|
+
multiSet?: ((kvs: [string, string][]) => Promise<void>) | undefined;
|
|
27
|
+
multiRemove?: ((keys: string[]) => Promise<void>) | undefined;
|
|
28
|
+
clear?: (() => Promise<void>) | undefined;
|
|
29
|
+
getAllKeys?: (() => Promise<readonly string[]>) | undefined;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Always true now that the backend ships with the library. Kept because callers
|
|
@@ -43,7 +43,7 @@ export interface StorageApi {
|
|
|
43
43
|
getItem: (key: string) => Promise<string | null>;
|
|
44
44
|
setItem: (key: string, value: string) => Promise<boolean>;
|
|
45
45
|
removeItem: (key: string) => Promise<boolean>;
|
|
46
|
-
getJson: <T>(key: string) => Promise<T | null>;
|
|
46
|
+
getJson: <T>(key: string, parse: (value: unknown) => T) => Promise<T | null>;
|
|
47
47
|
setJson: <T>(key: string, value: T) => Promise<boolean>;
|
|
48
48
|
multiGet: (keys: readonly string[]) => Promise<Record<string, string | null>>;
|
|
49
49
|
multiSet: (entries: Record<string, string>) => Promise<boolean>;
|
|
@@ -2,14 +2,14 @@ import "axios";
|
|
|
2
2
|
declare module "axios" {
|
|
3
3
|
interface AxiosRequestConfig {
|
|
4
4
|
/** When true, the library's response-error interceptors do not log this request's failure. */
|
|
5
|
-
skipErrorLog?: boolean;
|
|
5
|
+
skipErrorLog?: boolean | undefined;
|
|
6
6
|
/**
|
|
7
7
|
* The request ends the current session and answers with a new one in the refresh
|
|
8
8
|
* response's shape (a workspace switch, a reissue after a security change). userClient
|
|
9
9
|
* stores those tokens before the response resolves, and a request refused meanwhile for
|
|
10
10
|
* the old session waits for them and is sent again instead of ending the session.
|
|
11
11
|
*/
|
|
12
|
-
replacesSession?: boolean;
|
|
12
|
+
replacesSession?: boolean | undefined;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=axios.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** T with every key present and no value undefined: the shape of a defaults object. `Required<T>` keeps `| undefined` on a `key?: V | undefined` property, so it cannot say this. */
|
|
2
|
+
export type Complete<T> = {
|
|
3
|
+
[K in keyof T]-?: Exclude<T[K], undefined>;
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=complete.d.ts.map
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
export declare const OTA_LAST_LAUNCH_KEY = "@webority/ota/last-launch";
|
|
3
3
|
export declare const DEFAULT_MIN_CHECK_INTERVAL_MS: number;
|
|
4
4
|
interface ManifestLike {
|
|
5
|
-
id?: string;
|
|
5
|
+
id?: string | undefined;
|
|
6
6
|
extra?: {
|
|
7
7
|
webority?: {
|
|
8
|
-
appIdentifier?: string | null;
|
|
9
|
-
} | null;
|
|
10
|
-
} | null;
|
|
8
|
+
appIdentifier?: string | null | undefined;
|
|
9
|
+
} | null | undefined;
|
|
10
|
+
} | null | undefined;
|
|
11
11
|
}
|
|
12
12
|
interface StateContextLike {
|
|
13
|
-
isChecking?: boolean;
|
|
14
|
-
isDownloading?: boolean;
|
|
15
|
-
isUpdatePending?: boolean;
|
|
16
|
-
latestManifest?: ManifestLike;
|
|
17
|
-
downloadedManifest?: ManifestLike;
|
|
18
|
-
checkError?: Error;
|
|
19
|
-
downloadError?: Error;
|
|
13
|
+
isChecking?: boolean | undefined;
|
|
14
|
+
isDownloading?: boolean | undefined;
|
|
15
|
+
isUpdatePending?: boolean | undefined;
|
|
16
|
+
latestManifest?: ManifestLike | undefined;
|
|
17
|
+
downloadedManifest?: ManifestLike | undefined;
|
|
18
|
+
checkError?: Error | undefined;
|
|
19
|
+
downloadError?: Error | undefined;
|
|
20
20
|
}
|
|
21
21
|
/** The slice of expo-updates this module calls, so the optional peer stays untyped at build. */
|
|
22
22
|
export interface UpdatesModuleLike {
|
|
@@ -24,26 +24,26 @@ export interface UpdatesModuleLike {
|
|
|
24
24
|
isEmbeddedLaunch: boolean;
|
|
25
25
|
updateId: string | null;
|
|
26
26
|
runtimeVersion: string | null;
|
|
27
|
-
channel?: string | null;
|
|
28
|
-
isEmergencyLaunch?: boolean;
|
|
29
|
-
emergencyLaunchReason?: string | null;
|
|
27
|
+
channel?: string | null | undefined;
|
|
28
|
+
isEmergencyLaunch?: boolean | undefined;
|
|
29
|
+
emergencyLaunchReason?: string | null | undefined;
|
|
30
30
|
checkAutomatically: string | null;
|
|
31
31
|
manifest: ManifestLike | null | undefined;
|
|
32
32
|
checkForUpdateAsync: () => Promise<{
|
|
33
33
|
isAvailable: boolean;
|
|
34
34
|
isRollBackToEmbedded: boolean;
|
|
35
|
-
manifest?: ManifestLike;
|
|
35
|
+
manifest?: ManifestLike | undefined;
|
|
36
36
|
}>;
|
|
37
37
|
fetchUpdateAsync: () => Promise<{
|
|
38
38
|
isNew: boolean;
|
|
39
39
|
isRollBackToEmbedded: boolean;
|
|
40
40
|
}>;
|
|
41
41
|
reloadAsync: () => Promise<void>;
|
|
42
|
-
addUpdatesStateChangeListener?: (listener: (event: {
|
|
42
|
+
addUpdatesStateChangeListener?: ((listener: (event: {
|
|
43
43
|
context: StateContextLike;
|
|
44
44
|
}) => void) => {
|
|
45
45
|
remove: () => void;
|
|
46
|
-
};
|
|
46
|
+
}) | undefined;
|
|
47
47
|
}
|
|
48
48
|
export interface OtaUpdatesConfig {
|
|
49
49
|
/**
|
|
@@ -55,11 +55,11 @@ export interface OtaUpdatesConfig {
|
|
|
55
55
|
* The app's own identity, compared with the identity stamped into every served update. Defaults
|
|
56
56
|
* to `appId` from `setConfig`, the base package name / bundle id from the compiled settings.
|
|
57
57
|
*/
|
|
58
|
-
appIdentifier?: string;
|
|
58
|
+
appIdentifier?: string | undefined;
|
|
59
59
|
/** Check again each time the app returns to the foreground. Default true. */
|
|
60
|
-
checkOnForeground?: boolean;
|
|
60
|
+
checkOnForeground?: boolean | undefined;
|
|
61
61
|
/** The shortest gap between two checks this module starts, in milliseconds. Default 15 minutes. */
|
|
62
|
-
minCheckIntervalMs?: number;
|
|
62
|
+
minCheckIntervalMs?: number | undefined;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* `unavailable`: OTA is off in this build (a debug build, or expo-updates not installed).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** True when value is one of the listed values; narrows value to the list's member type. */
|
|
2
|
+
export declare function isOneOf<const T>(list: readonly T[], value: unknown): value is T;
|
|
3
|
+
/** True when key is an own key of the object; narrows key to the object's key type. */
|
|
4
|
+
export declare function hasKey<O extends object>(object: O, key: PropertyKey): key is keyof O;
|
|
5
|
+
/** True for a plain object value (not null, not an array). */
|
|
6
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
7
|
+
/** The object's own keys, each checked by hasKey, typed as the object's keys. */
|
|
8
|
+
export declare function keysOf<O extends object>(object: O): (keyof O)[];
|
|
9
|
+
//# sourceMappingURL=guards.d.ts.map
|
|
@@ -34,36 +34,36 @@
|
|
|
34
34
|
export type ImageOutputFormat = "jpg" | "png" | "webp";
|
|
35
35
|
export interface CompressImageOptions {
|
|
36
36
|
/** Bound on the LONGER side in pixels; never enlarges. Defaults to 1500. */
|
|
37
|
-
maxSize?: number;
|
|
37
|
+
maxSize?: number | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* JPEG/WebP quality, 0 to 1. Overrides the size-based quality ladder. PNG
|
|
40
40
|
* is lossless and ignores it.
|
|
41
41
|
*/
|
|
42
|
-
quality?: number;
|
|
42
|
+
quality?: number | undefined;
|
|
43
43
|
/** Output format. Defaults to `'jpg'`. */
|
|
44
|
-
output?: ImageOutputFormat;
|
|
44
|
+
output?: ImageOutputFormat | undefined;
|
|
45
45
|
/**
|
|
46
46
|
* Byte size of the source as the picker reported it. Only a HINT for the
|
|
47
47
|
* quality ladder when the file cannot be measured (an Android `content://`
|
|
48
48
|
* URI); a measurable file is measured, because the picker's number can be
|
|
49
49
|
* stale by the time this runs.
|
|
50
50
|
*/
|
|
51
|
-
fileSize?: number;
|
|
51
|
+
fileSize?: number | undefined;
|
|
52
52
|
/**
|
|
53
53
|
* Byte ceiling for the output (an API's upload limit). Quality is stepped
|
|
54
54
|
* down to `minQuality`, then the size is stepped down, until the output
|
|
55
55
|
* fits. Best effort: the result's `size` says whether it did.
|
|
56
56
|
*/
|
|
57
|
-
maxBytes?: number;
|
|
57
|
+
maxBytes?: number | undefined;
|
|
58
58
|
/** Lowest quality the `maxBytes` ladder may reach. Defaults to 0.4. */
|
|
59
|
-
minQuality?: number;
|
|
59
|
+
minQuality?: number | undefined;
|
|
60
60
|
/**
|
|
61
61
|
* Base name for the output file (any extension is replaced by the output
|
|
62
62
|
* format's). Defaults to the source's own name, or `image`. A picked photo
|
|
63
63
|
* has no useful name of its own; a list of twelve documents all called
|
|
64
64
|
* `image.jpg` is unreadable.
|
|
65
65
|
*/
|
|
66
|
-
name?: string;
|
|
66
|
+
name?: string | undefined;
|
|
67
67
|
}
|
|
68
68
|
export interface CompressedImage {
|
|
69
69
|
/** Local URI of the file to upload. */
|
|
@@ -104,8 +104,8 @@ export interface ImageFileStat {
|
|
|
104
104
|
}
|
|
105
105
|
export interface EncodeOptions {
|
|
106
106
|
/** Target size; one side only, the other follows the aspect ratio. Omit both to keep the size. */
|
|
107
|
-
width?: number;
|
|
108
|
-
height?: number;
|
|
107
|
+
width?: number | undefined;
|
|
108
|
+
height?: number | undefined;
|
|
109
109
|
quality: number;
|
|
110
110
|
format: "jpeg" | "png" | "webp";
|
|
111
111
|
}
|
|
@@ -17,11 +17,11 @@ export declare const isNumeric: (value: unknown) => boolean;
|
|
|
17
17
|
export declare const isInteger: (value: unknown) => boolean;
|
|
18
18
|
export declare const isAlphanumeric: (value: unknown) => boolean;
|
|
19
19
|
export interface PasswordRules {
|
|
20
|
-
minLength?: number;
|
|
21
|
-
requireUppercase?: boolean;
|
|
22
|
-
requireLowercase?: boolean;
|
|
23
|
-
requireNumber?: boolean;
|
|
24
|
-
requireSymbol?: boolean;
|
|
20
|
+
minLength?: number | undefined;
|
|
21
|
+
requireUppercase?: boolean | undefined;
|
|
22
|
+
requireLowercase?: boolean | undefined;
|
|
23
|
+
requireNumber?: boolean | undefined;
|
|
24
|
+
requireSymbol?: boolean | undefined;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Common password complexity check. Defaults to 8+ chars,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Complete } from "../types/complete.js";
|
|
1
2
|
/**
|
|
2
3
|
* Minimal device-info shape we depend on.
|
|
3
4
|
*
|
|
@@ -11,14 +12,14 @@
|
|
|
11
12
|
export interface DeviceInfoLike {
|
|
12
13
|
getBundleId: () => string;
|
|
13
14
|
getVersion: () => string;
|
|
14
|
-
getBuildNumber?: () => string;
|
|
15
|
+
getBuildNumber?: (() => string) | undefined;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* expo-application, read at call time: its values are module CONSTANTS, and
|
|
18
19
|
* capturing them here would snapshot them before the native module has
|
|
19
20
|
* initialised. Config still wins over this.
|
|
20
21
|
*/
|
|
21
|
-
export declare const expoApplicationBackend:
|
|
22
|
+
export declare const expoApplicationBackend: Complete<DeviceInfoLike>;
|
|
22
23
|
export declare const setDeviceInfo: (impl: DeviceInfoLike | null) => void;
|
|
23
24
|
export declare const getDeviceInfo: () => DeviceInfoLike | null;
|
|
24
25
|
/**
|
|
@@ -23,18 +23,18 @@ export interface ParsedVersion {
|
|
|
23
23
|
/** @deprecated The store is no longer read; the minimum comes from `Min-App-Version`. */
|
|
24
24
|
export interface VersionData {
|
|
25
25
|
version: string | null;
|
|
26
|
-
released?: string | null;
|
|
27
|
-
releasedAt?: string;
|
|
26
|
+
released?: string | null | undefined;
|
|
27
|
+
releasedAt?: string | undefined;
|
|
28
28
|
notes: string;
|
|
29
29
|
url: string | null;
|
|
30
|
-
country?: string;
|
|
30
|
+
country?: string | undefined;
|
|
31
31
|
lastChecked: string;
|
|
32
32
|
}
|
|
33
33
|
/** @deprecated The store is no longer read; the minimum comes from `Min-App-Version`. */
|
|
34
34
|
export interface VersionComparison {
|
|
35
35
|
needsUpdate: boolean;
|
|
36
36
|
updateType: UpdateType;
|
|
37
|
-
notice?: string;
|
|
37
|
+
notice?: string | undefined;
|
|
38
38
|
}
|
|
39
39
|
export interface VersionCheckResult {
|
|
40
40
|
isNewVersionAvailable: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/mobile-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.150.0",
|
|
4
4
|
"description": "Platform layer for Webority React Native apps: HTTP clients, auth/token storage, config, logging, formatters, validators, network status, permissions, storage, version checks and over-the-air updates. No UI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -389,6 +389,7 @@
|
|
|
389
389
|
}
|
|
390
390
|
},
|
|
391
391
|
"dependencies": {
|
|
392
|
+
"@webority/api-contract": "0.150.0",
|
|
392
393
|
"axios": "^1.19.0",
|
|
393
394
|
"libphonenumber-js": "^1.12.41"
|
|
394
395
|
},
|
|
@@ -537,7 +538,7 @@
|
|
|
537
538
|
"react-native-builder-bob": "0.43.0",
|
|
538
539
|
"react-redux": "9.3.0",
|
|
539
540
|
"react-test-renderer": "19.3.0",
|
|
540
|
-
"typescript": "
|
|
541
|
+
"typescript": "7.0.2"
|
|
541
542
|
},
|
|
542
543
|
"scripts": {
|
|
543
544
|
"build": "bob build && node ../mobile-dev/scripts/minify-lib.mjs",
|
|
@@ -13,4 +13,4 @@ export interface Spec extends TurboModule {
|
|
|
13
13
|
getAppHash(): Promise<string>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export default TurboModuleRegistry.getEnforcing<Spec>("WeborityMobileCoreSmsRetriever")
|
|
16
|
+
export default TurboModuleRegistry.getEnforcing<Spec>("WeborityMobileCoreSmsRetriever");
|