@webority/mobile-core 0.149.0 → 0.152.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- 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/jest/setup.js +1 -0
- 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/outbox/types.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/entityVersion.js +1 -0
- package/lib/commonjs/query/index.js +1 -1
- package/lib/commonjs/query/paging.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/jest/setup.js +1 -0
- 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/outbox/types.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/entityVersion.js +1 -0
- package/lib/module/query/index.js +1 -1
- package/lib/module/query/paging.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 +9 -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/jest/setup.d.ts +9 -0
- 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 -17
- 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 +23 -14
- package/lib/typescript/commonjs/query/dataState.d.ts +76 -0
- package/lib/typescript/commonjs/query/entityVersion.d.ts +47 -0
- package/lib/typescript/commonjs/query/index.d.ts +5 -1
- package/lib/typescript/commonjs/query/paging.d.ts +6 -5
- package/lib/typescript/commonjs/query/persistedQueries.d.ts +12 -7
- package/lib/typescript/commonjs/query/usePagedList.d.ts +11 -18
- 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 +10 -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 +9 -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/jest/setup.d.ts +9 -0
- 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 -17
- 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 +23 -14
- package/lib/typescript/module/query/dataState.d.ts +76 -0
- package/lib/typescript/module/query/entityVersion.d.ts +47 -0
- package/lib/typescript/module/query/index.d.ts +5 -1
- package/lib/typescript/module/query/paging.d.ts +6 -5
- package/lib/typescript/module/query/persistedQueries.d.ts +12 -7
- package/lib/typescript/module/query/usePagedList.d.ts +11 -18
- 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 +10 -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 +14 -2
- package/src/specs/NativeSmsRetriever.ts +1 -1
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Normalizes any failure a thunk, a service or the RTK Query base query can see into one
|
|
3
|
-
* `ApiError`. Identical source in @webority/web-core and @webority/mobile-core.
|
|
4
|
-
*
|
|
5
|
-
* The body read is the RFC 9457 problem `{ type, title, status, detail, code, traceId, errors }`,
|
|
6
|
-
* where `errors` is a ModelState dictionary (`{ Field: ["msg"] }`) or a list of `{ field, message }`.
|
|
7
|
-
*
|
|
8
|
-
* Message precedence (react.md): first field error, form error, `detail`, `title`, a plain-text
|
|
9
|
-
* body, then `Request failed (<status>)`. A 401 or 403 whose body is the standard refusal (api.md)
|
|
10
|
-
* gets the library's sentence for it, ahead of those. A 5xx shows `detail` only when it carries a
|
|
11
|
-
* code other than `internal_error`. The server's text goes on `diagnostic` for the logger, never the screen.
|
|
12
|
-
* The trace id falls back to the request's own `traceparent`, so a lost request keeps a reference.
|
|
13
|
-
*/
|
|
14
1
|
export interface ApiError {
|
|
15
2
|
/** Stable snake_case branch key from the server (`not_found`, `validation_failed`). Branch on it, never render it. */
|
|
16
3
|
code: string | null;
|
|
@@ -26,12 +13,16 @@ export interface ApiError {
|
|
|
26
13
|
traceId: string | null;
|
|
27
14
|
/** What the server or runtime actually said. For the logger, never for the screen. */
|
|
28
15
|
diagnostic: string | null;
|
|
16
|
+
/** The request address the failed call was sent to. For the logger and the caller, never the screen. */
|
|
17
|
+
requestUrl?: string | undefined;
|
|
18
|
+
/** The Account-Id the failed call was sent with. For the logger and the caller, never the screen. */
|
|
19
|
+
accountId?: string | undefined;
|
|
29
20
|
}
|
|
30
21
|
export declare const SERVER_FAILURE_MESSAGE = "Something went wrong on our side. Please try again in a moment.";
|
|
31
22
|
export declare const OFFLINE_MESSAGE = "You appear to be offline. Check your connection and try again.";
|
|
23
|
+
export declare const UNREACHABLE_MESSAGE = "We couldn't reach the server. Check your connection and try again.";
|
|
32
24
|
export declare const TIMEOUT_MESSAGE = "That took too long to respond. Check your connection and try again.";
|
|
33
25
|
export declare const UNEXPECTED_MESSAGE = "Something went wrong. Please try again.";
|
|
34
|
-
export declare const UNREACHABLE_MESSAGE = "We couldn't reach the server. Check your connection and try again.";
|
|
35
26
|
/** `code` for a request the caller cancelled (axios `CanceledError`). Never toasted. */
|
|
36
27
|
export declare const REQUEST_CANCELED_CODE = "request_canceled";
|
|
37
28
|
/** `code` for a response that failed schema validation at the service boundary. */
|
|
@@ -54,9 +45,10 @@ export declare const isNoResponse: (error: unknown) => boolean;
|
|
|
54
45
|
/**
|
|
55
46
|
* The sentence a screen shows for a failure: the server's own curated message when it sent one,
|
|
56
47
|
* otherwise the screen's `fallback` ("We couldn't save the project."), otherwise the library's
|
|
57
|
-
* generic sentence. A lost answer always reads as
|
|
58
|
-
* connection" is more accurate than any screen's fallback
|
|
59
|
-
* cancelled request and a body with no usable sentence count as "the server
|
|
48
|
+
* generic sentence. A lost answer always reads as its connection message, because "check your
|
|
49
|
+
* connection" is more accurate than any screen's fallback, and so does a 5xx with a curated body.
|
|
50
|
+
* A 5xx without one, a cancelled request and a body with no usable sentence count as "the server
|
|
51
|
+
* said nothing usable".
|
|
60
52
|
*
|
|
61
53
|
* `fallback: null` is the "say nothing" mode, for a screen that shows only what the server
|
|
62
54
|
* curated (a live panel that keeps its last result): it returns null when the server said
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export type { ApiError } from "./extractApiError";
|
|
2
2
|
export { apiErrorMessage, CONTRACT_ERROR_CODE, extractApiError, isApiError, isNoResponse, NETWORK_CODE, OFFLINE_CODE, OFFLINE_MESSAGE, REQUEST_CANCELED_CODE, SERVER_FAILURE_MESSAGE, TIMEOUT_CODE, TIMEOUT_MESSAGE, toFieldPath, UNEXPECTED_MESSAGE, UNREACHABLE_MESSAGE, } from "./extractApiError";
|
|
3
|
+
export type { ResponseSchema } from "./parseResponse";
|
|
4
|
+
export { parseResponse } from "./parseResponse";
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** The part of a zod schema (v3 or v4) the check reads, so the package needs no zod dependency. */
|
|
2
|
+
export interface ResponseSchema<T> {
|
|
3
|
+
safeParse(data: unknown): {
|
|
4
|
+
success: true;
|
|
5
|
+
data: T;
|
|
6
|
+
} | {
|
|
7
|
+
success: false;
|
|
8
|
+
error: {
|
|
9
|
+
issues: unknown;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Checks an API response against its schema at the service boundary and returns the parsed value. A response that
|
|
15
|
+
* breaks its contract fails here, logged with the schema's issues under `label`, instead of as an undefined deep in a
|
|
16
|
+
* screen. The thrown error carries `isContractError`, which extractApiError turns into code `contract_error` with a
|
|
17
|
+
* message fit for the screen.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseResponse<T>(schema: ResponseSchema<T>, data: unknown, label: string): T;
|
|
20
|
+
//# sourceMappingURL=parseResponse.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The mobile platform's answer to "did the device refuse the request for lack of a connection?".
|
|
3
|
+
* extractApiError.ts reads a request that got no answer as offline only when this says so; web-core
|
|
4
|
+
* has its own copy. The check is by name, not `instanceof`, because a RequestOfflineError that
|
|
5
|
+
* went through createAsyncThunk arrives as a plain object that keeps only its name.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isOfflineFailure(error: unknown): boolean;
|
|
8
|
+
//# sourceMappingURL=requestPlatform.d.ts.map
|
|
@@ -6,18 +6,18 @@ export interface FormatCurrencyOptions extends Omit<Intl.NumberFormatOptions, "s
|
|
|
6
6
|
/** ISO 4217 currency code. Required: a missing or empty one throws a TypeError. */
|
|
7
7
|
currency: string;
|
|
8
8
|
/** BCP-47 locale tag. Defaults to the configured locale, else `'en-IN'` (Indian numbering system). */
|
|
9
|
-
locale?: string;
|
|
9
|
+
locale?: string | undefined;
|
|
10
10
|
/** Minimum fraction digits. Defaults to 0 for whole amounts, else the currency's own (2 for INR, 0 for JPY). */
|
|
11
|
-
minimumFractionDigits?: number;
|
|
11
|
+
minimumFractionDigits?: number | undefined;
|
|
12
12
|
/** Maximum fraction digits. Defaults to the currency's own. */
|
|
13
|
-
maximumFractionDigits?: number;
|
|
13
|
+
maximumFractionDigits?: number | undefined;
|
|
14
14
|
/** Strip the currency symbol — useful when the symbol is rendered separately. */
|
|
15
|
-
stripSymbol?: boolean;
|
|
15
|
+
stripSymbol?: boolean | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* What a missing amount prints. Defaults to the configured placeholder once the app has
|
|
18
18
|
* configured a locale or an `empty` (`configureFormatters`), else `''`.
|
|
19
19
|
*/
|
|
20
|
-
empty?: string;
|
|
20
|
+
empty?: string | undefined;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Format an amount as currency. Pass an ISO 4217 code on every call: a missing or empty one
|
|
@@ -41,7 +41,7 @@ export declare const addDays: (value: DateInput | null | undefined, count: numbe
|
|
|
41
41
|
* cosmetic.
|
|
42
42
|
*/
|
|
43
43
|
export declare const formatDatePattern: (value: DateInput, pattern: string, options?: {
|
|
44
|
-
utc?: boolean;
|
|
44
|
+
utc?: boolean | undefined;
|
|
45
45
|
}) => string;
|
|
46
46
|
/**
|
|
47
47
|
* `DD MMM, YYYY` — zero-padded day, short month, comma, year (e.g.
|
|
@@ -58,7 +58,7 @@ export declare const formatDatePattern: (value: DateInput, pattern: string, opti
|
|
|
58
58
|
* option; pass it only to match a call site that was genuinely UTC-explicit.
|
|
59
59
|
*/
|
|
60
60
|
export declare const formatDateDDMMMYYYY: (value: DateInput, options?: {
|
|
61
|
-
utc?: boolean;
|
|
61
|
+
utc?: boolean | undefined;
|
|
62
62
|
}) => string;
|
|
63
63
|
/** `YYYY-MM-DD`, in the device's local timezone. */
|
|
64
64
|
export declare const formatDateISO: (value: DateInput) => string;
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
*/
|
|
23
23
|
/** `'IST'`: every instant in India Standard Time. `'viewer'`: the device or browser zone, labelled. */
|
|
24
24
|
export type ZoneMode = "IST" | "viewer";
|
|
25
|
+
/** A zone mode, `'UTC'`, or any IANA zone name such as `'America/New_York'`. */
|
|
26
|
+
export type ZoneOption = ZoneMode | "UTC" | (string & {});
|
|
25
27
|
/** How the integer part of a number is grouped. */
|
|
26
28
|
export type NumberGrouping = "indian" | "international" | "none";
|
|
27
29
|
/**
|
|
@@ -42,8 +44,8 @@ export interface NumberSeparators {
|
|
|
42
44
|
group: string;
|
|
43
45
|
}
|
|
44
46
|
export interface FormatterConfig {
|
|
45
|
-
/** Default zone for every date and time formatter. */
|
|
46
|
-
zone:
|
|
47
|
+
/** Default zone for every date and time formatter: a zone mode, `'UTC'`, or an IANA zone name. */
|
|
48
|
+
zone: ZoneOption;
|
|
47
49
|
/**
|
|
48
50
|
* BCP-47 locale. Left at its default (en-IN), it only picks the house digit
|
|
49
51
|
* grouping. Configured (`configureFormatters({ locale })`), it switches every
|
|
@@ -54,16 +56,16 @@ export interface FormatterConfig {
|
|
|
54
56
|
/** What every formatter returns for a missing or unreadable value. */
|
|
55
57
|
empty: string;
|
|
56
58
|
/** The person's number style. Unset, the separators are the house text's or the configured locale's. */
|
|
57
|
-
numberStyle?: NumberStyle;
|
|
59
|
+
numberStyle?: NumberStyle | undefined;
|
|
58
60
|
/** The person's date order. Unset, dates read DD-MMM-YYYY. */
|
|
59
|
-
dateOrder?: DateOrder;
|
|
61
|
+
dateOrder?: DateOrder | undefined;
|
|
60
62
|
}
|
|
61
63
|
/**
|
|
62
64
|
* Set the zone mode, locale, empty placeholder, number style or date order for the whole app.
|
|
63
65
|
* Call it at startup, and again when the person changes their number style or date order; a key
|
|
64
66
|
* left out (or undefined) keeps its current value. Passing nothing restores the defaults (IST,
|
|
65
|
-
* en-IN, "-", house text, no number style or date order). An unknown number style or date
|
|
66
|
-
* throws a RangeError, so a bad stored preference fails where it is applied.
|
|
67
|
+
* en-IN, "-", house text, no number style or date order). An unknown zone, number style or date
|
|
68
|
+
* order throws a RangeError, so a bad stored preference fails where it is applied.
|
|
67
69
|
*/
|
|
68
70
|
export declare const configureFormatters: (config?: Partial<FormatterConfig>) => void;
|
|
69
71
|
/** The settings in force, as a copy. */
|
|
@@ -33,16 +33,15 @@
|
|
|
33
33
|
* configured `dateOrder` other than DD-MMM-YYYY writes the date as digits from the wall clock,
|
|
34
34
|
* in every locale: "08/04/2026", "04/08/2026", "2026-04-08".
|
|
35
35
|
*/
|
|
36
|
-
import { type NumberGrouping, type
|
|
36
|
+
import { type NumberGrouping, type ZoneOption } from "./formatConfig";
|
|
37
|
+
export type { ZoneOption } from "./formatConfig";
|
|
37
38
|
/** A date the house formatters accept; null, undefined and "" read as missing. */
|
|
38
39
|
export type DateValue = Date | string | number | null | undefined;
|
|
39
|
-
/** A zone mode, `'UTC'`, or any IANA zone name such as `'America/New_York'`. */
|
|
40
|
-
export type ZoneOption = ZoneMode | "UTC" | (string & {});
|
|
41
40
|
export interface FormatDateOptions {
|
|
42
41
|
/** Overrides the configured zone mode for this call. */
|
|
43
|
-
zone?: ZoneOption;
|
|
42
|
+
zone?: ZoneOption | undefined;
|
|
44
43
|
/** Overrides the configured empty placeholder for this call. */
|
|
45
|
-
empty?: string;
|
|
44
|
+
empty?: string | undefined;
|
|
46
45
|
}
|
|
47
46
|
export interface FormatTimeOptions extends FormatDateOptions {
|
|
48
47
|
/**
|
|
@@ -50,26 +49,26 @@ export interface FormatTimeOptions extends FormatDateOptions {
|
|
|
50
49
|
* configured locale's own clock once a locale is configured (12 for en-IN and en-US,
|
|
51
50
|
* 24 for en-GB, de-DE and most of Europe).
|
|
52
51
|
*/
|
|
53
|
-
hourCycle?: 12 | 24;
|
|
52
|
+
hourCycle?: 12 | 24 | undefined;
|
|
54
53
|
/**
|
|
55
54
|
* Append the zone label ("IST", "UTC", "GMT-4"; Intl's short zone name for a
|
|
56
55
|
* configured locale). Defaults to on for every zone except IST, so the viewer
|
|
57
56
|
* mode always says which clock it shows.
|
|
58
57
|
*/
|
|
59
|
-
zoneLabel?: boolean;
|
|
58
|
+
zoneLabel?: boolean | undefined;
|
|
60
59
|
}
|
|
61
60
|
export type FormatDateTimeOptions = FormatTimeOptions;
|
|
62
61
|
export interface FormatRelativeOptions {
|
|
63
62
|
/** The instant to measure from. Defaults to now. */
|
|
64
|
-
now?: Date | string | number;
|
|
65
|
-
empty?: string;
|
|
63
|
+
now?: Date | string | number | undefined;
|
|
64
|
+
empty?: string | undefined;
|
|
66
65
|
/**
|
|
67
66
|
* Intl's own phrasing ("yesterday", "in 2 days", "now") instead of the house phrase
|
|
68
67
|
* ("1 day ago"). Always on once a locale is configured. Intl phrases count in rounded
|
|
69
68
|
* years, months, days, hours, minutes and seconds, with no week unit, so 36 hours ahead reads
|
|
70
69
|
* "in 2 days". An engine without Intl.RelativeTimeFormat (older Hermes) prints the house phrase.
|
|
71
70
|
*/
|
|
72
|
-
intl?: boolean;
|
|
71
|
+
intl?: boolean | undefined;
|
|
73
72
|
}
|
|
74
73
|
/**
|
|
75
74
|
* The house keys, plus any `Intl.NumberFormatOptions`. With house keys only, the text is
|
|
@@ -83,29 +82,29 @@ export interface FormatNumberOptions extends Intl.NumberFormatOptions {
|
|
|
83
82
|
* `'international'` prints the house text even with a configured locale; `'none'` drops
|
|
84
83
|
* the separators either way.
|
|
85
84
|
*/
|
|
86
|
-
grouping?: NumberGrouping;
|
|
85
|
+
grouping?: NumberGrouping | undefined;
|
|
87
86
|
/** Defaults to 0. */
|
|
88
|
-
minimumFractionDigits?: number;
|
|
87
|
+
minimumFractionDigits?: number | undefined;
|
|
89
88
|
/** Defaults to 3 for formatNumber and 0 for formatPercent. */
|
|
90
|
-
maximumFractionDigits?: number;
|
|
89
|
+
maximumFractionDigits?: number | undefined;
|
|
91
90
|
/** Overrides the configured locale for this call. */
|
|
92
|
-
locale?: string;
|
|
93
|
-
empty?: string;
|
|
91
|
+
locale?: string | undefined;
|
|
92
|
+
empty?: string | undefined;
|
|
94
93
|
}
|
|
95
94
|
export interface FormatPercentOptions extends FormatNumberOptions {
|
|
96
95
|
/** `'ratio'` (the default) reads 0.42 as 42%; `'percent'` reads 42 as 42%. */
|
|
97
|
-
scale?: "ratio" | "percent";
|
|
96
|
+
scale?: "ratio" | "percent" | undefined;
|
|
98
97
|
}
|
|
99
98
|
export interface FormatMinorOptions {
|
|
100
99
|
/** ISO 4217 code. Required: a missing or empty one throws a TypeError. */
|
|
101
100
|
currency: string;
|
|
102
101
|
/** Defaults to Indian grouping for INR and international grouping for every other currency. */
|
|
103
|
-
grouping?: NumberGrouping;
|
|
102
|
+
grouping?: NumberGrouping | undefined;
|
|
104
103
|
/** Print a whole amount without its zero decimals: "₹1,500" instead of "₹1,500.00". */
|
|
105
|
-
dropZeroDecimals?: boolean;
|
|
104
|
+
dropZeroDecimals?: boolean | undefined;
|
|
106
105
|
/** `false` prints the digits alone, for a field that draws the symbol itself. */
|
|
107
|
-
symbol?: boolean;
|
|
108
|
-
empty?: string;
|
|
106
|
+
symbol?: boolean | undefined;
|
|
107
|
+
empty?: string | undefined;
|
|
109
108
|
}
|
|
110
109
|
/**
|
|
111
110
|
* "08-Apr-2026", or the configured date order. A bare calendar date ("2026-04-08")
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export declare const numberFormat: (locale: string, options?: Intl.NumberFormatOptions) => Intl.NumberFormat;
|
|
2
2
|
export declare const dateTimeFormat: (locale: string, options: Intl.DateTimeFormatOptions) => Intl.DateTimeFormat;
|
|
3
|
-
export declare const relativeTimeFormat: (RelativeTimeFormat:
|
|
4
|
-
numeric?: "always" | "auto";
|
|
5
|
-
}) => Intl.RelativeTimeFormat, locale: string) => Intl.RelativeTimeFormat;
|
|
3
|
+
export declare const relativeTimeFormat: (RelativeTimeFormat: typeof Intl.RelativeTimeFormat, locale: string) => Intl.RelativeTimeFormat;
|
|
6
4
|
//# sourceMappingURL=intlCache.d.ts.map
|
|
@@ -10,9 +10,9 @@ export { AsYouType, getCountries, getCountryCallingCode, isSupportedCountry, isV
|
|
|
10
10
|
*/
|
|
11
11
|
export type PhoneCountry = CountryCode;
|
|
12
12
|
export interface FormatPhoneOptions {
|
|
13
|
-
defaultCountryCode?: string;
|
|
14
|
-
country?: PhoneCountry;
|
|
15
|
-
includeCountryCode?: boolean;
|
|
13
|
+
defaultCountryCode?: string | undefined;
|
|
14
|
+
country?: PhoneCountry | undefined;
|
|
15
|
+
includeCountryCode?: boolean | undefined;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Strip everything except digits and a leading `+` (preserved if present).
|
|
@@ -6,14 +6,14 @@ import type { GeolocationLike } from "../index";
|
|
|
6
6
|
*/
|
|
7
7
|
export interface ExpoLocationObject {
|
|
8
8
|
coords?: {
|
|
9
|
-
latitude?: number;
|
|
10
|
-
longitude?: number;
|
|
11
|
-
altitude?: number | null;
|
|
12
|
-
accuracy?: number | null;
|
|
13
|
-
heading?: number | null;
|
|
14
|
-
speed?: number | null;
|
|
15
|
-
} | null;
|
|
16
|
-
timestamp?: number;
|
|
9
|
+
latitude?: number | undefined;
|
|
10
|
+
longitude?: number | undefined;
|
|
11
|
+
altitude?: number | null | undefined;
|
|
12
|
+
accuracy?: number | null | undefined;
|
|
13
|
+
heading?: number | null | undefined;
|
|
14
|
+
speed?: number | null | undefined;
|
|
15
|
+
} | null | undefined;
|
|
16
|
+
timestamp?: number | undefined;
|
|
17
17
|
}
|
|
18
18
|
export interface ExpoLocationSubscription {
|
|
19
19
|
remove: () => void;
|
|
@@ -21,10 +21,10 @@ export interface ExpoLocationSubscription {
|
|
|
21
21
|
export interface ExpoLocationLike {
|
|
22
22
|
getCurrentPositionAsync: (options?: Record<string, unknown>) => Promise<ExpoLocationObject>;
|
|
23
23
|
watchPositionAsync: (options: Record<string, unknown>, callback: (location: ExpoLocationObject) => void) => Promise<ExpoLocationSubscription>;
|
|
24
|
-
getForegroundPermissionsAsync?: () => Promise<{
|
|
24
|
+
getForegroundPermissionsAsync?: (() => Promise<{
|
|
25
25
|
granted: boolean;
|
|
26
|
-
}
|
|
27
|
-
hasServicesEnabledAsync?: () => Promise<boolean
|
|
26
|
+
}>) | undefined;
|
|
27
|
+
hasServicesEnabledAsync?: (() => Promise<boolean>) | undefined;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Adapts expo-location to the library's geolocation seam.
|
|
@@ -18,46 +18,46 @@ export declare class GeolocationError extends Error {
|
|
|
18
18
|
}
|
|
19
19
|
export interface GeoOptions {
|
|
20
20
|
/** `fine` maps to the platform's high-accuracy (GPS) provider. Default `fine`. */
|
|
21
|
-
accuracy?: "fine" | "coarse";
|
|
22
|
-
timeoutMs?: number;
|
|
23
|
-
maximumAgeMs?: number;
|
|
21
|
+
accuracy?: "fine" | "coarse" | undefined;
|
|
22
|
+
timeoutMs?: number | undefined;
|
|
23
|
+
maximumAgeMs?: number | undefined;
|
|
24
24
|
/** Extra attempts after the first, used only for `timeout` / `position-unavailable`. */
|
|
25
|
-
retries?: number;
|
|
25
|
+
retries?: number | undefined;
|
|
26
26
|
/** A fix with a worse (larger) accuracy radius counts as `position-unavailable`. */
|
|
27
|
-
minimumAccuracyM?: number;
|
|
27
|
+
minimumAccuracyM?: number | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* Pause between retries. Android's fused provider is frequently not ready on
|
|
30
30
|
* the first request after the permission grant or after location is switched
|
|
31
31
|
* on, and retrying immediately just re-collects the same failure.
|
|
32
32
|
*/
|
|
33
|
-
retryDelayMs?: number;
|
|
33
|
+
retryDelayMs?: number | undefined;
|
|
34
34
|
}
|
|
35
35
|
export interface GeoWatchOptions extends GeoOptions {
|
|
36
36
|
/** Metres the device must move before the listener fires again. */
|
|
37
|
-
distanceFilterM?: number;
|
|
38
|
-
onError?: (error: GeolocationError) => void;
|
|
37
|
+
distanceFilterM?: number | undefined;
|
|
38
|
+
onError?: ((error: GeolocationError) => void) | undefined;
|
|
39
39
|
}
|
|
40
40
|
interface NativeGeoCoords {
|
|
41
|
-
latitude?: number | null;
|
|
42
|
-
longitude?: number | null;
|
|
43
|
-
accuracy?: number | null;
|
|
44
|
-
altitude?: number | null;
|
|
45
|
-
heading?: number | null;
|
|
46
|
-
speed?: number | null;
|
|
41
|
+
latitude?: number | null | undefined;
|
|
42
|
+
longitude?: number | null | undefined;
|
|
43
|
+
accuracy?: number | null | undefined;
|
|
44
|
+
altitude?: number | null | undefined;
|
|
45
|
+
heading?: number | null | undefined;
|
|
46
|
+
speed?: number | null | undefined;
|
|
47
47
|
}
|
|
48
48
|
interface NativeGeoPosition {
|
|
49
|
-
coords?: NativeGeoCoords | null;
|
|
50
|
-
timestamp?: number | null;
|
|
49
|
+
coords?: NativeGeoCoords | null | undefined;
|
|
50
|
+
timestamp?: number | null | undefined;
|
|
51
51
|
}
|
|
52
52
|
interface NativeGeoError {
|
|
53
|
-
code?: number;
|
|
54
|
-
message?: string;
|
|
53
|
+
code?: number | undefined;
|
|
54
|
+
message?: string | undefined;
|
|
55
55
|
}
|
|
56
56
|
interface NativeGeoOptions {
|
|
57
|
-
enableHighAccuracy?: boolean;
|
|
58
|
-
timeout?: number;
|
|
59
|
-
maximumAge?: number;
|
|
60
|
-
distanceFilter?: number;
|
|
57
|
+
enableHighAccuracy?: boolean | undefined;
|
|
58
|
+
timeout?: number | undefined;
|
|
59
|
+
maximumAge?: number | undefined;
|
|
60
|
+
distanceFilter?: number | undefined;
|
|
61
61
|
}
|
|
62
62
|
/** Minimal shape of the native geolocation module we depend on. */
|
|
63
63
|
export interface GeolocationLike {
|
|
@@ -72,10 +72,13 @@ export interface GeolocationLike {
|
|
|
72
72
|
* restore it.
|
|
73
73
|
*/
|
|
74
74
|
export declare const setGeolocationImplementation: (impl: GeolocationLike | null) => void;
|
|
75
|
+
declare const getCurrentPosition: (options?: GeoOptions) => Promise<GeoPosition>;
|
|
76
|
+
declare const watchPosition: (listener: (position: GeoPosition) => void, options?: GeoWatchOptions) => (() => void);
|
|
77
|
+
declare const isAvailable: () => boolean;
|
|
75
78
|
export declare const Geolocation: {
|
|
76
|
-
getCurrentPosition:
|
|
77
|
-
watchPosition:
|
|
78
|
-
isAvailable:
|
|
79
|
+
getCurrentPosition: typeof getCurrentPosition;
|
|
80
|
+
watchPosition: typeof watchPosition;
|
|
81
|
+
isAvailable: typeof isAvailable;
|
|
79
82
|
};
|
|
80
83
|
export interface UseCurrentPositionResult {
|
|
81
84
|
position: GeoPosition | null;
|
|
@@ -84,7 +87,7 @@ export interface UseCurrentPositionResult {
|
|
|
84
87
|
refresh: () => void;
|
|
85
88
|
}
|
|
86
89
|
export declare const useCurrentPosition: (options?: GeoOptions & {
|
|
87
|
-
enabled?: boolean;
|
|
90
|
+
enabled?: boolean | undefined;
|
|
88
91
|
}) => UseCurrentPositionResult;
|
|
89
92
|
export {};
|
|
90
93
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -36,8 +36,11 @@
|
|
|
36
36
|
* client reads the bearer token. It needs no optional peer: the backend is
|
|
37
37
|
* expo-secure-store, and `expo` is required anyway.
|
|
38
38
|
*/
|
|
39
|
+
export type { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios";
|
|
39
40
|
export type { AccountIdProvider, ClientKind } from "./api/clientHeaders";
|
|
40
41
|
export { ACCOUNT_ID_HEADER, CLIENT_BUILD_HEADER, CLIENT_KIND, CLIENT_KIND_HEADER, getClientBuild, } from "./api/clientHeaders";
|
|
42
|
+
export type { ContractCaller } from "./api/contractCaller";
|
|
43
|
+
export { createContractCaller } from "./api/contractCaller";
|
|
41
44
|
export { buildCurl, logCurl } from "./api/curl";
|
|
42
45
|
export type { FetchRetryPolicy } from "./api/fetchRetry";
|
|
43
46
|
export { fetchWithRetry } from "./api/fetchRetry";
|
|
@@ -61,8 +64,8 @@ export { getConfig, getConfigValue, resetConfig, setConfig } from "./config";
|
|
|
61
64
|
export { ENVIRONMENT_APP_ID_SUFFIX, installedAppId } from "./config/appIdentity";
|
|
62
65
|
export type { DeepLinkConfig, DeepLinkRoute, ParsedLink } from "./deepLink";
|
|
63
66
|
export { DeepLink, parseDeepLink, useDeepLink } from "./deepLink";
|
|
64
|
-
export type { ApiError } from "./errors";
|
|
65
|
-
export { apiErrorMessage, CONTRACT_ERROR_CODE, extractApiError, isApiError, isNoResponse, NETWORK_CODE, OFFLINE_CODE, OFFLINE_MESSAGE, REQUEST_CANCELED_CODE, SERVER_FAILURE_MESSAGE, TIMEOUT_CODE, TIMEOUT_MESSAGE, toFieldPath, UNEXPECTED_MESSAGE, UNREACHABLE_MESSAGE, } from "./errors";
|
|
67
|
+
export type { ApiError, ResponseSchema } from "./errors";
|
|
68
|
+
export { apiErrorMessage, CONTRACT_ERROR_CODE, extractApiError, isApiError, isNoResponse, NETWORK_CODE, OFFLINE_CODE, OFFLINE_MESSAGE, parseResponse, REQUEST_CANCELED_CODE, SERVER_FAILURE_MESSAGE, TIMEOUT_CODE, TIMEOUT_MESSAGE, toFieldPath, UNEXPECTED_MESSAGE, UNREACHABLE_MESSAGE, } from "./errors";
|
|
66
69
|
export type { DateInput, DateOrder, DateStyle, DateValue, FormatCurrencyOptions, FormatDateOptions, FormatDateTimeOptions, FormatMinorOptions, FormatNumberOptions, FormatPercentOptions, FormatPhoneOptions, FormatRelativeOptions, FormatTimeOptions, FormatterConfig, NumberGrouping, NumberStyle, PhoneCountry, PhoneCountryEntry, PhoneNumber, PhoneNumberType, PhoneParts, PhoneValidationKind, TimeStyle, ZoneMode, ZoneOption, } from "./formatters";
|
|
67
70
|
export { AsYouType, addDays, clampNationalNumber, configureFormatters, countryFlagEmoji, detectPhoneCountry, diffMs, formatCompactNumber, formatCurrency, formatDate, formatDateDDMMMYYYY, formatDateISO, formatDatePattern, formatDateTime, formatMinor, formatNumber, formatPercent, formatPhone, formatPhoneAsTyped, formatRelative, formatRelativeTime, formatTime, formatTime12h, formatTimeInWindowsZone, formatTimeInZone, getCountries, getCountryCallingCode, getFormatterConfig, getInitials, getPhoneCountries, groupingForLocale, isDateAfter, isDateBefore, isSameDay, isSupportedCountry, isValidNationalNumber, isValidPhoneNumber, maxNationalNumberLength, normalizePhone, parsePhoneNumber, parsePhoneNumberFromString, splitPhoneNumber, startOfDay, validatePhoneNumberLength, } from "./formatters";
|
|
68
71
|
export type { InitConfig } from "./initSDK";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type GstState } from "./gstStates.g";
|
|
2
|
+
/** The current state a valid GSTIN belongs to: a retired code resolves to its replacement, or null when the GSTIN is not valid. */
|
|
3
|
+
export declare const currentStateForGstin: (value: unknown) => GstState | null;
|
|
4
|
+
/** The state a stored place of supply names, in the printed form "Karnataka (29)" or a bare name, or null. */
|
|
5
|
+
export declare const gstStateFromPlaceOfSupply: (value: unknown) => GstState | null;
|
|
6
|
+
/** How the place of supply prints on a tax document, such as "Karnataka (29)". */
|
|
7
|
+
export declare const placeOfSupplyLabel: (state: GstState) => string;
|
|
8
|
+
//# sourceMappingURL=gstStates.d.ts.map
|
|
@@ -3,6 +3,7 @@ export type { FinancialYear } from "./financialYear";
|
|
|
3
3
|
export { currentFinancialYear, financialYearLabel, financialYearOf, parseFinancialYear, recentFinancialYears } from "./financialYear";
|
|
4
4
|
export type { GstinProblem } from "./gstin";
|
|
5
5
|
export { gstinHolderPan, gstinProblem, gstinState, gstinStateCode, isGstin, normalizeGstin, sanitizeGstinInput } from "./gstin";
|
|
6
|
+
export { currentStateForGstin, gstStateFromPlaceOfSupply, placeOfSupplyLabel } from "./gstStates";
|
|
6
7
|
export type { GstState, GstStateStatus } from "./gstStates.g";
|
|
7
8
|
export { isIfsc, normalizeIfsc } from "./ifsc";
|
|
8
9
|
export { formatIndianMobile, isIndianMobile, normalizeIndianMobile } from "./indianMobile";
|
|
@@ -16,16 +16,16 @@ export interface InitConfig {
|
|
|
16
16
|
*/
|
|
17
17
|
remoteLogger: RemoteLogger | null;
|
|
18
18
|
/** Enable/disable logging. Defaults to `true`. */
|
|
19
|
-
loggingEnabled?: boolean;
|
|
19
|
+
loggingEnabled?: boolean | undefined;
|
|
20
20
|
/** Log level. Defaults to `'info'` in development and `'warn'` in a release build. */
|
|
21
|
-
logLevel?: LogLevel;
|
|
21
|
+
logLevel?: LogLevel | undefined;
|
|
22
22
|
/** The environment the bundle was compiled for (`ENVIRONMENT`). Required: the installed-app check adds its id suffix. */
|
|
23
23
|
environment: Environment;
|
|
24
24
|
/**
|
|
25
25
|
* ISO 3166-1 alpha-2 country code (lowercase) used in the App Store / Play
|
|
26
26
|
* Store link of the update prompt. Defaults to `'in'`.
|
|
27
27
|
*/
|
|
28
|
-
country?: string;
|
|
28
|
+
country?: string | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* The app's store identifier, `APP_ID` from appsettings.json, with no environment suffix.
|
|
31
31
|
* initWebority refuses to start when `installedAppId(appId, environment)` differs from the installed app's id.
|
|
@@ -37,21 +37,21 @@ export interface InitConfig {
|
|
|
37
37
|
* is why they come from config rather than across the native bridge. The
|
|
38
38
|
* version check compares `appBuild` with the API's `Min-App-Version`.
|
|
39
39
|
*/
|
|
40
|
-
appVersion?: string;
|
|
41
|
-
appBuild?: number;
|
|
40
|
+
appVersion?: string | undefined;
|
|
41
|
+
appBuild?: number | undefined;
|
|
42
42
|
/** The numeric Apple App Store id; the iOS update button needs it. */
|
|
43
|
-
appStoreId?: string;
|
|
43
|
+
appStoreId?: string | undefined;
|
|
44
44
|
/** The build's short git sha (`COMMIT` in appsettings); sent as `Client-Build: <appVersion>+<commit>`. */
|
|
45
|
-
commit?: string;
|
|
45
|
+
commit?: string | undefined;
|
|
46
46
|
/**
|
|
47
47
|
* Log a redacted curl line per request. Off by default; it is a debugging
|
|
48
48
|
* aid, not something to leave on.
|
|
49
49
|
*/
|
|
50
|
-
logCurl?: boolean;
|
|
50
|
+
logCurl?: boolean | undefined;
|
|
51
51
|
/** Request timeout in milliseconds. Defaults to 30000; a request's own `timeout` wins. */
|
|
52
|
-
timeoutMs?: number;
|
|
52
|
+
timeoutMs?: number | undefined;
|
|
53
53
|
/** Retries under the retry rule. Defaults to 3; 0 turns retrying off. */
|
|
54
|
-
retries?: number;
|
|
54
|
+
retries?: number | undefined;
|
|
55
55
|
/**
|
|
56
56
|
* The native modules that fill the seams the library does not import.
|
|
57
57
|
*
|
|
@@ -64,10 +64,10 @@ export interface InitConfig {
|
|
|
64
64
|
* from its own import path. See docs/expo.md.
|
|
65
65
|
*/
|
|
66
66
|
backends?: {
|
|
67
|
-
storage?: Parameters<typeof setStorageImplementation>[0];
|
|
68
|
-
keychain?: KeychainLike | null;
|
|
69
|
-
network?: NetInfoLike | null;
|
|
70
|
-
};
|
|
67
|
+
storage?: Parameters<typeof setStorageImplementation>[0] | undefined;
|
|
68
|
+
keychain?: KeychainLike | null | undefined;
|
|
69
|
+
network?: NetInfoLike | null | undefined;
|
|
70
|
+
} | undefined;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* Initialize Webority packages with your project configuration.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AccountIdProvider, type InstallationIdProvider } from "./api/clientHeaders";
|
|
2
|
+
import type { RefreshableStore } from "./api/tokenRefresh";
|
|
2
3
|
import { type LegacyTokenKeys } from "./auth/authStore";
|
|
3
4
|
/** The tokens a refresh response carries, with their expiry timestamps. */
|
|
4
5
|
export interface TokenRefreshResult {
|
|
@@ -15,21 +16,21 @@ export interface TokenRefreshConfig {
|
|
|
15
16
|
/** The refresh endpoint, relative to the configured baseUrl, e.g. `/Account/RefreshToken`. */
|
|
16
17
|
path: string;
|
|
17
18
|
/** The request body; may return a promise. Defaults to `{ accessToken, refreshToken }`. */
|
|
18
|
-
body?: (tokens: {
|
|
19
|
+
body?: ((tokens: {
|
|
19
20
|
accessToken: string | null;
|
|
20
21
|
refreshToken: string;
|
|
21
|
-
}) => unknown;
|
|
22
|
+
}) => unknown) | undefined;
|
|
22
23
|
/**
|
|
23
24
|
* Extra headers for the refresh call, read on every refresh; may return a promise. For a
|
|
24
25
|
* value the API must see as a header, such as `X-Installation-Id` for a rate limiter that
|
|
25
26
|
* cannot read the body.
|
|
26
27
|
*/
|
|
27
|
-
headers?: () => Record<string, string> | Promise<Record<string, string
|
|
28
|
+
headers?: (() => Record<string, string> | Promise<Record<string, string>>) | undefined;
|
|
28
29
|
/**
|
|
29
30
|
* Reads the new tokens from the response body. Defaults to the Webority API's
|
|
30
31
|
* `{ accessToken, accessTokenExpiration, refreshToken, refreshTokenExpiration }`.
|
|
31
32
|
*/
|
|
32
|
-
readTokens?: (data: unknown) => TokenRefreshResult;
|
|
33
|
+
readTokens?: ((data: unknown) => TokenRefreshResult) | undefined;
|
|
33
34
|
}
|
|
34
35
|
export interface UserAuthOptions {
|
|
35
36
|
/** Action creator dispatched when the session is over. */
|
|
@@ -42,7 +43,7 @@ export interface UserAuthOptions {
|
|
|
42
43
|
* making it; a request that sets the header itself keeps its own value.
|
|
43
44
|
* Omit it in a product whose API takes the account from the token alone.
|
|
44
45
|
*/
|
|
45
|
-
accountId?: AccountIdProvider;
|
|
46
|
+
accountId?: AccountIdProvider | undefined;
|
|
46
47
|
/**
|
|
47
48
|
* The device's installation id, sent as `Installation-Id` on every publicClient and
|
|
48
49
|
* userClient request. Resolved once, on the first request, and kept in memory. Pass the
|
|
@@ -50,13 +51,13 @@ export interface UserAuthOptions {
|
|
|
50
51
|
* clients never import it, so they load without the optional expo-crypto peer. Omit it
|
|
51
52
|
* and no header goes out.
|
|
52
53
|
*/
|
|
53
|
-
installationId?: InstallationIdProvider;
|
|
54
|
+
installationId?: InstallationIdProvider | undefined;
|
|
54
55
|
/**
|
|
55
56
|
* The secure-store keys the app kept its session under before this library. The first token
|
|
56
57
|
* read that finds the library's keys empty moves a session found there and deletes the old
|
|
57
58
|
* keys, so the release that adopts the library signs nobody out.
|
|
58
59
|
*/
|
|
59
|
-
legacyKeys?: LegacyTokenKeys;
|
|
60
|
+
legacyKeys?: LegacyTokenKeys | undefined;
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
62
63
|
* Wire the user client to the app: the Redux store it dispatches `logout` to,
|
|
@@ -69,5 +70,5 @@ export interface UserAuthOptions {
|
|
|
69
70
|
* @example
|
|
70
71
|
* initUserAuth(store, { logout, refresh: { path: '/Account/RefreshToken' }, installationId: getOrCreateInstallationId });
|
|
71
72
|
*/
|
|
72
|
-
export declare const initUserAuth:
|
|
73
|
+
export declare const initUserAuth: (store: RefreshableStore, options: UserAuthOptions) => void;
|
|
73
74
|
//# sourceMappingURL=initUserAuth.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type RemoteLogger } from "./index";
|
|
2
2
|
/**
|
|
3
3
|
* The part of `@react-native-firebase/crashlytics`'s modular API the adapter
|
|
4
4
|
* calls. Typed here, never imported, so the library carries no Firebase
|
|
@@ -23,9 +23,10 @@ export interface CrashlyticsModule<Instance = unknown> {
|
|
|
23
23
|
*
|
|
24
24
|
* Breadcrumbs and log lines become Crashlytics log lines, errors become
|
|
25
25
|
* non-fatals with their context logged just before, and the user id and
|
|
26
|
-
* attributes are set as given.
|
|
27
|
-
*
|
|
28
|
-
* a build without its Firebase config files has no
|
|
26
|
+
* attributes are set as given. A synchronous failure is swallowed and an async
|
|
27
|
+
* one is recorded through `Logger`: the adapter runs inside `Logger.error`, so a
|
|
28
|
+
* throw would recurse, and a build without its Firebase config files has no
|
|
29
|
+
* Firebase app to report to.
|
|
29
30
|
*/
|
|
30
31
|
export declare const crashlyticsRemoteLogger: <Instance>(crashlytics: CrashlyticsModule<Instance>) => RemoteLogger;
|
|
31
32
|
//# sourceMappingURL=crashlytics.d.ts.map
|