@webority-technologies/mobile-core 0.0.5 → 0.0.7
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/android/build.gradle +65 -0
- package/android/src/newarch/java/com/webority/mobilecore/smsretriever/AppSignatureHelper.kt +57 -0
- package/android/src/newarch/java/com/webority/mobilecore/smsretriever/SmsRetrieverModule.kt +20 -0
- package/android/src/newarch/java/com/webority/mobilecore/smsretriever/SmsRetrieverModuleImpl.kt +146 -0
- package/android/src/newarch/java/com/webority/mobilecore/smsretriever/SmsRetrieverPackage.kt +33 -0
- package/lib/commonjs/formatters/dateMath.js +19 -1
- package/lib/commonjs/formatters/index.js +6 -0
- package/lib/commonjs/formatters/windowsToIanaTable.js +164 -0
- package/lib/commonjs/geolocation/index.js +1 -1
- package/lib/commonjs/index.js +6 -0
- package/lib/commonjs/permissions/index.js +128 -129
- package/lib/commonjs/smsRetriever/index.js +91 -0
- package/lib/commonjs/specs/NativeSmsRetriever.js +15 -0
- package/lib/commonjs/sqlite/index.js +12 -30
- package/lib/module/formatters/dateMath.js +17 -0
- package/lib/module/formatters/index.js +1 -1
- package/lib/module/formatters/windowsToIanaTable.js +160 -0
- package/lib/module/geolocation/index.js +1 -1
- package/lib/module/index.js +4 -3
- package/lib/module/permissions/index.js +129 -130
- package/lib/module/smsRetriever/index.js +86 -0
- package/lib/module/specs/NativeSmsRetriever.js +13 -0
- package/lib/module/sqlite/index.js +12 -30
- package/lib/typescript/commonjs/formatters/dateMath.d.ts +9 -0
- package/lib/typescript/commonjs/formatters/index.d.ts +1 -1
- package/lib/typescript/commonjs/formatters/windowsToIanaTable.d.ts +18 -0
- package/lib/typescript/commonjs/index.d.ts +4 -3
- package/lib/typescript/commonjs/permissions/index.d.ts +14 -36
- package/lib/typescript/commonjs/smsRetriever/index.d.ts +30 -0
- package/lib/typescript/commonjs/specs/NativeSmsRetriever.d.ts +15 -0
- package/lib/typescript/commonjs/sqlite/index.d.ts +10 -18
- package/lib/typescript/module/formatters/dateMath.d.ts +9 -0
- package/lib/typescript/module/formatters/index.d.ts +1 -1
- package/lib/typescript/module/formatters/windowsToIanaTable.d.ts +18 -0
- package/lib/typescript/module/index.d.ts +4 -3
- package/lib/typescript/module/permissions/index.d.ts +14 -36
- package/lib/typescript/module/smsRetriever/index.d.ts +30 -0
- package/lib/typescript/module/specs/NativeSmsRetriever.d.ts +15 -0
- package/lib/typescript/module/sqlite/index.d.ts +10 -18
- package/package.json +30 -47
- package/lib/commonjs/sqlite/adapters/op.js +0 -43
- package/lib/commonjs/sqlite/adapters/rows.js +0 -33
- package/lib/commonjs/sqlite/adapters/storage.js +0 -50
- package/lib/commonjs/sqlite/adapters/sync.js +0 -45
- package/lib/commonjs/sqlite/nitro.js +0 -17
- package/lib/commonjs/sqlite/op.js +0 -18
- package/lib/commonjs/sqlite/quick.js +0 -14
- package/lib/commonjs/sqlite/storage.js +0 -14
- package/lib/module/sqlite/adapters/op.js +0 -38
- package/lib/module/sqlite/adapters/rows.js +0 -28
- package/lib/module/sqlite/adapters/storage.js +0 -46
- package/lib/module/sqlite/adapters/sync.js +0 -41
- package/lib/module/sqlite/nitro.js +0 -12
- package/lib/module/sqlite/op.js +0 -13
- package/lib/module/sqlite/quick.js +0 -9
- package/lib/module/sqlite/storage.js +0 -9
- package/lib/typescript/commonjs/sqlite/adapters/op.d.ts +0 -27
- package/lib/typescript/commonjs/sqlite/adapters/rows.d.ts +0 -7
- package/lib/typescript/commonjs/sqlite/adapters/storage.d.ts +0 -30
- package/lib/typescript/commonjs/sqlite/adapters/sync.d.ts +0 -31
- package/lib/typescript/commonjs/sqlite/nitro.d.ts +0 -7
- package/lib/typescript/commonjs/sqlite/op.d.ts +0 -8
- package/lib/typescript/commonjs/sqlite/quick.d.ts +0 -4
- package/lib/typescript/commonjs/sqlite/storage.d.ts +0 -4
- package/lib/typescript/module/sqlite/adapters/op.d.ts +0 -27
- package/lib/typescript/module/sqlite/adapters/rows.d.ts +0 -7
- package/lib/typescript/module/sqlite/adapters/storage.d.ts +0 -30
- package/lib/typescript/module/sqlite/adapters/sync.d.ts +0 -31
- package/lib/typescript/module/sqlite/nitro.d.ts +0 -7
- package/lib/typescript/module/sqlite/op.d.ts +0 -8
- package/lib/typescript/module/sqlite/quick.d.ts +0 -4
- package/lib/typescript/module/sqlite/storage.d.ts +0 -4
|
@@ -5,40 +5,25 @@ import { Logger } from "../logger/index.js";
|
|
|
5
5
|
import { adaptExpoSqlite } from "./adapters/expo.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* setSqliteImplementation(opSqliteDriver());
|
|
16
|
-
*
|
|
17
|
-
* Supported entry points: /sqlite/op, /sqlite/nitro, /sqlite/quick,
|
|
18
|
-
* /sqlite/storage. Any object matching SqliteDriver also works.
|
|
8
|
+
* expo-sqlite is the fleet's only sanctioned SQLite driver (react-native.md:
|
|
9
|
+
* "we will always use expo-sqlite, what Expo gives, we don't look elsewhere
|
|
10
|
+
* ever") — this module resolves it automatically, with no app-side wiring.
|
|
11
|
+
* `setSqliteImplementation` still exists, narrowed to tests and the showcase:
|
|
12
|
+
* it injects a denying/failing backend to reach error paths a healthy device
|
|
13
|
+
* never takes, the same pattern every other injectable surface in this
|
|
14
|
+
* library follows. It is not a way to pick an alternate real driver.
|
|
19
15
|
*/
|
|
20
16
|
|
|
21
17
|
/** Only what a test or an app injected; null means use expo-sqlite. */
|
|
22
18
|
let backend = null;
|
|
23
19
|
|
|
24
|
-
/**
|
|
25
|
-
* expo-sqlite, adapted once and memoised.
|
|
26
|
-
*
|
|
27
|
-
* Unlike the other surfaces this one keeps a real reason to inject: an app with
|
|
28
|
-
* an existing database on another driver (op-sqlite, nitro, quick,
|
|
29
|
-
* sqlite-storage) can hand it over, and those entry points stay published for
|
|
30
|
-
* exactly that. expo-sqlite is simply what happens when nobody does.
|
|
31
|
-
*/
|
|
20
|
+
/** expo-sqlite, adapted once and memoised. The only driver this module resolves. */
|
|
32
21
|
let expoDriver;
|
|
33
22
|
|
|
34
23
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* and defines only this interface. Wire a driver once at startup:
|
|
39
|
-
*
|
|
40
|
-
* import { opSqliteDriver } from '@webority-technologies/mobile-core/sqlite/op';
|
|
41
|
-
* setSqliteImplementation(opSqliteDriver());
|
|
24
|
+
* Test/showcase-only injection point — see the module header. Not a way to
|
|
25
|
+
* pick an alternate real driver; `@webority-technologies/mobile-core` always
|
|
26
|
+
* resolves expo-sqlite when nothing is injected. Pass `null` to clear it.
|
|
42
27
|
*/
|
|
43
28
|
export const setSqliteImplementation = impl => {
|
|
44
29
|
backend = impl;
|
|
@@ -56,10 +41,7 @@ export const isSqliteAvailable = () => resolveDriver() !== null;
|
|
|
56
41
|
const requireBackend = op => {
|
|
57
42
|
const b = resolveDriver();
|
|
58
43
|
if (!b) {
|
|
59
|
-
|
|
60
|
-
// installing a driver alone does nothing here, and the previous wording
|
|
61
|
-
// ("Install one of ...") sent people to fix a thing that was not broken.
|
|
62
|
-
const err = new Error(`[@webority-technologies/mobile-core] No SQLite driver injected; cannot ${op}. ` + 'Install a driver and wire it once at startup, e.g. ' + "`import { opSqliteDriver } from '@webority-technologies/mobile-core/sqlite/op'` " + 'then `setSqliteImplementation(opSqliteDriver())`. Drivers: @op-engineering/op-sqlite ' + '(recommended), expo-sqlite, react-native-nitro-sqlite, react-native-quick-sqlite, ' + 'react-native-sqlite-storage.');
|
|
44
|
+
const err = new Error(`[@webority-technologies/mobile-core] No SQLite driver available; cannot ${op}. ` + 'Install expo-sqlite (the only sanctioned driver) in the consuming app.');
|
|
63
45
|
Logger.error(err.message);
|
|
64
46
|
throw err;
|
|
65
47
|
}
|
|
@@ -76,4 +76,13 @@ export declare const formatTime12h: (value: DateInput) => string;
|
|
|
76
76
|
* recognises — the same failure mode as handing dayjs.tz() a bad zone name.
|
|
77
77
|
*/
|
|
78
78
|
export declare const formatTimeInZone: (value: DateInput, ianaTimeZone: string) => string;
|
|
79
|
+
/**
|
|
80
|
+
* Same as {@link formatTimeInZone}, but for a .NET-style Windows timezone ID
|
|
81
|
+
* (e.g. `"India Standard Time"`) rather than an IANA one. .NET's own
|
|
82
|
+
* `TimeZoneInfo` API only knows Windows IDs, so a backend built on it hands
|
|
83
|
+
* these to clients directly — `Intl`, by contrast, only recognises IANA
|
|
84
|
+
* names, so the ID has to be translated before it can be used here. Throws
|
|
85
|
+
* if `windowsTimeZoneId` has no known IANA mapping.
|
|
86
|
+
*/
|
|
87
|
+
export declare const formatTimeInWindowsZone: (value: DateInput, windowsTimeZoneId: string) => string;
|
|
79
88
|
//# sourceMappingURL=dateMath.d.ts.map
|
|
@@ -2,7 +2,7 @@ export type { FormatCurrencyOptions } from './currency';
|
|
|
2
2
|
export { formatCurrency } from './currency';
|
|
3
3
|
export type { DateInput, DateStyle, TimeStyle } from './date';
|
|
4
4
|
export { formatDate, formatDateTime, formatRelativeTime, formatTime } from './date';
|
|
5
|
-
export { addDays, diffMs, formatDateDDMMMYYYY, formatDateISO, formatDatePattern, formatTime12h, formatTimeInZone, isDateAfter, isDateBefore, isSameDay, startOfDay } from './dateMath';
|
|
5
|
+
export { addDays, diffMs, formatDateDDMMMYYYY, formatDateISO, formatDatePattern, formatTime12h, formatTimeInWindowsZone, formatTimeInZone, isDateAfter, isDateBefore, isSameDay, startOfDay } from './dateMath';
|
|
6
6
|
export { getInitials } from './initials';
|
|
7
7
|
export { formatCompactNumber, formatNumber, formatPercent } from './number';
|
|
8
8
|
export type { FormatPhoneOptions, PhoneCountry, PhoneNumber } from './phone';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .NET-style Windows time zone ID → IANA time zone name, one entry per
|
|
3
|
+
* Windows zone, generated from CLDR's `windowsZones.xml` (the same
|
|
4
|
+
* upstream source the retired `windows-iana` npm package derived its own
|
|
5
|
+
* table from). Only the `territory="001"` (world-default) row is kept per
|
|
6
|
+
* Windows zone — `formatTimeInWindowsZone` only ever reads the first IANA
|
|
7
|
+
* candidate, and CLDR's `001` row is exactly that default candidate, so
|
|
8
|
+
* per-country territory variants (`US`, `CA`, `ZZ`, …) carry no information
|
|
9
|
+
* this table's one caller uses.
|
|
10
|
+
*
|
|
11
|
+
* Regenerate with `node packages/core/scripts/generate-windows-to-iana-table.mjs
|
|
12
|
+
* <path-to-windowsZones.xml>` (CLDR: `common/supplemental/windowsZones.xml` in
|
|
13
|
+
* https://github.com/unicode-org/cldr) whenever CLDR adds/renames a zone —
|
|
14
|
+
* this is a committed, static table; nothing fetches CLDR at build or test
|
|
15
|
+
* time.
|
|
16
|
+
*/
|
|
17
|
+
export declare const WINDOWS_TO_IANA: Readonly<Record<string, string>>;
|
|
18
|
+
//# sourceMappingURL=windowsToIanaTable.d.ts.map
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* for anyone importing anything at all. Those live behind their own import
|
|
6
6
|
* paths instead:
|
|
7
7
|
*
|
|
8
|
-
* @webority-technologies/mobile-core/permissions
|
|
8
|
+
* @webority-technologies/mobile-core/permissions per kind, its own Expo module
|
|
9
9
|
* @webority-technologies/mobile-core/compressor react-native-compressor
|
|
10
10
|
* @webority-technologies/mobile-core/geolocation a geolocation provider
|
|
11
|
-
* @webority-technologies/mobile-core/sqlite
|
|
11
|
+
* @webority-technologies/mobile-core/sqlite expo-sqlite
|
|
12
12
|
* @webority-technologies/mobile-core/download a filesystem module
|
|
13
|
+
* @webority-technologies/mobile-core/smsRetriever Android only, own TurboModule
|
|
13
14
|
*
|
|
14
15
|
* react-native-keychain is the exception and is a REQUIRED peer: the HTTP client
|
|
15
16
|
* reads the bearer token, so it is reachable from the main barrel by design.
|
|
@@ -29,7 +30,7 @@ export { getConfig, getConfigValue, resetConfig, setConfig } from './config';
|
|
|
29
30
|
export type { DeepLinkConfig, DeepLinkRoute, ParsedLink } from './deepLink';
|
|
30
31
|
export { DeepLink, parseDeepLink, useDeepLink } from './deepLink';
|
|
31
32
|
export type { DateInput, DateStyle, FormatCurrencyOptions, FormatPhoneOptions, PhoneCountry, PhoneNumber, TimeStyle } from './formatters';
|
|
32
|
-
export { addDays, detectPhoneCountry, diffMs, formatCompactNumber, formatCurrency, formatDate, formatDateDDMMMYYYY, formatDateISO, formatDatePattern, formatDateTime, formatNumber, formatPercent, formatPhone, formatRelativeTime, formatTime, formatTime12h, formatTimeInZone, getInitials, isDateAfter, isDateBefore, isSameDay, isValidPhoneNumber, normalizePhone, parsePhoneNumber, parsePhoneNumberFromString, startOfDay } from './formatters';
|
|
33
|
+
export { addDays, detectPhoneCountry, diffMs, formatCompactNumber, formatCurrency, formatDate, formatDateDDMMMYYYY, formatDateISO, formatDatePattern, formatDateTime, formatNumber, formatPercent, formatPhone, formatRelativeTime, formatTime, formatTime12h, formatTimeInWindowsZone, formatTimeInZone, getInitials, isDateAfter, isDateBefore, isSameDay, isValidPhoneNumber, normalizePhone, parsePhoneNumber, parsePhoneNumberFromString, startOfDay } from './formatters';
|
|
33
34
|
export type { InitConfig } from './initSDK';
|
|
34
35
|
export { initWebority } from './initSDK';
|
|
35
36
|
export type { AuthActions } from './initUserAuth';
|
|
@@ -1,46 +1,25 @@
|
|
|
1
1
|
export type PermissionKind = 'camera' | 'microphone' | 'photos' | 'photosAdd' | 'mediaLibrary' | 'location' | 'locationAlways' | 'contacts' | 'calendar' | 'reminders' | 'notifications' | 'bluetooth' | 'storage';
|
|
2
2
|
export type PermissionStatus = 'unavailable' | 'denied' | 'limited' | 'granted' | 'blocked';
|
|
3
|
-
export interface
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
ANDROID: Record<string, string>;
|
|
7
|
-
};
|
|
8
|
-
RESULTS: {
|
|
9
|
-
UNAVAILABLE: string;
|
|
10
|
-
DENIED: string;
|
|
11
|
-
LIMITED: string;
|
|
12
|
-
GRANTED: string;
|
|
13
|
-
BLOCKED: string;
|
|
14
|
-
};
|
|
15
|
-
check: (permission: string) => Promise<string>;
|
|
16
|
-
request: (permission: string) => Promise<string>;
|
|
17
|
-
openSettings: () => Promise<void>;
|
|
3
|
+
export interface PermissionsBackend {
|
|
4
|
+
check: (kind: PermissionKind) => Promise<PermissionStatus>;
|
|
5
|
+
request: (kind: PermissionKind) => Promise<PermissionStatus>;
|
|
18
6
|
}
|
|
19
7
|
/**
|
|
20
|
-
* Inject a custom permissions
|
|
21
|
-
*
|
|
8
|
+
* Inject a custom permissions backend at runtime. Pass `null` to reset to the
|
|
9
|
+
* default per-kind Expo resolution.
|
|
22
10
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* documented contract. That exact bug shipped once, in the storage seam.
|
|
27
|
-
*
|
|
28
|
-
* THIS MODULE IS THE EXPO-FIRST EXCEPTION, and deliberately keeps the old
|
|
29
|
-
* shape. Expo ships no permissions package: each module carries its own
|
|
30
|
-
* (expo-location's requestForegroundPermissionsAsync, expo-image-picker's, and
|
|
31
|
-
* so on), so there is no single object to adapt and the library must not guess
|
|
32
|
-
* which Expo modules an app installed. react-native-permissions stays, behind
|
|
33
|
-
* this module's own import path so an app that never asks for permissions
|
|
34
|
-
* never names the package to Metro.
|
|
11
|
+
* Two legitimate reasons to call this: tests/the showcase reaching a denied,
|
|
12
|
+
* blocked or unavailable path a healthy device never takes; and an app that
|
|
13
|
+
* genuinely needs `bluetooth` or `storage`, which no Expo module covers.
|
|
35
14
|
*/
|
|
36
|
-
export declare const setPermissionsImplementation: (impl:
|
|
15
|
+
export declare const setPermissionsImplementation: (impl: PermissionsBackend | null) => void;
|
|
37
16
|
/**
|
|
38
17
|
* Cross-platform permissions wrapper. Maps an abstract `PermissionKind`
|
|
39
|
-
* (camera, photos, location, notifications, …) to the
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
18
|
+
* (camera, photos, location, notifications, …) to the Expo module that owns
|
|
19
|
+
* it under the hood — expo-camera, expo-image-picker, expo-location,
|
|
20
|
+
* expo-contacts, expo-calendar, expo-notifications, expo-media-library. Every
|
|
21
|
+
* one is an optional peer, required lazily; an app installs only the modules
|
|
22
|
+
* whose kinds it actually asks for.
|
|
44
23
|
*/
|
|
45
24
|
export declare const Permissions: {
|
|
46
25
|
check: (kind: PermissionKind) => Promise<PermissionStatus>;
|
|
@@ -51,5 +30,4 @@ export declare const Permissions: {
|
|
|
51
30
|
ensure: (kind: PermissionKind) => Promise<PermissionStatus>;
|
|
52
31
|
openSettings: () => Promise<boolean>;
|
|
53
32
|
};
|
|
54
|
-
export type { RNPermissionsModule as PermissionsLike };
|
|
55
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface SmsRetrieverError {
|
|
2
|
+
type: 'TIMEOUT' | 'SERVICE_UNAVAILABLE' | 'UNKNOWN_ERROR';
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
export interface SmsListenerSubscription {
|
|
6
|
+
remove: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface SmsRetrieverBackend {
|
|
9
|
+
getAppHash: () => Promise<string>;
|
|
10
|
+
startListening: (onMessage: (message: string) => void, onError?: (error: SmsRetrieverError) => void) => SmsListenerSubscription;
|
|
11
|
+
}
|
|
12
|
+
/** Test-only injection point. Pass `null` to reset to the native module. */
|
|
13
|
+
export declare const setSmsRetrieverImplementation: (impl: SmsRetrieverBackend | null) => void;
|
|
14
|
+
/**
|
|
15
|
+
* The Play Services SMS Retriever API — auto-reads an incoming OTP SMS with
|
|
16
|
+
* no SMS permission, matched by an 11-character app-signature hash
|
|
17
|
+
* (`getAppHash`) the backend appends to the message. Android only; every
|
|
18
|
+
* method is safe to call on iOS and resolves/reports unavailable rather than
|
|
19
|
+
* throwing, so a caller doesn't need a platform check at every call site.
|
|
20
|
+
*
|
|
21
|
+
* OTP extraction is left to the caller — `onMessage` receives the raw SMS
|
|
22
|
+
* text, since the expected OTP format (digit count, prefix) is a backend
|
|
23
|
+
* concern, not this module's.
|
|
24
|
+
*/
|
|
25
|
+
export declare const SmsRetriever: {
|
|
26
|
+
isAvailable: () => boolean;
|
|
27
|
+
getAppHash: () => Promise<string>;
|
|
28
|
+
startListening: (onMessage: (message: string) => void, onError?: (error: SmsRetrieverError) => void) => SmsListenerSubscription;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Android-only — the Play Services SMS Retriever API has no iOS equivalent.
|
|
4
|
+
* The JS wrapper in `smsRetriever/index.ts` never touches this module on
|
|
5
|
+
* iOS, so `getEnforcing` only ever runs on Android, where autolinking has
|
|
6
|
+
* registered `SmsRetrieverPackage`.
|
|
7
|
+
*/
|
|
8
|
+
export interface Spec extends TurboModule {
|
|
9
|
+
startSMSListener(): void;
|
|
10
|
+
stopSMSListener(): void;
|
|
11
|
+
getAppHash(): Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: Spec;
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=NativeSmsRetriever.d.ts.map
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* setSqliteImplementation(opSqliteDriver());
|
|
10
|
-
*
|
|
11
|
-
* Supported entry points: /sqlite/op, /sqlite/nitro, /sqlite/quick,
|
|
12
|
-
* /sqlite/storage. Any object matching SqliteDriver also works.
|
|
2
|
+
* expo-sqlite is the fleet's only sanctioned SQLite driver (react-native.md:
|
|
3
|
+
* "we will always use expo-sqlite, what Expo gives, we don't look elsewhere
|
|
4
|
+
* ever") — this module resolves it automatically, with no app-side wiring.
|
|
5
|
+
* `setSqliteImplementation` still exists, narrowed to tests and the showcase:
|
|
6
|
+
* it injects a denying/failing backend to reach error paths a healthy device
|
|
7
|
+
* never takes, the same pattern every other injectable surface in this
|
|
8
|
+
* library follows. It is not a way to pick an alternate real driver.
|
|
13
9
|
*/
|
|
14
10
|
export interface SqliteResultSet {
|
|
15
11
|
rows: Record<string, unknown>[];
|
|
@@ -26,13 +22,9 @@ export interface SqliteDriver {
|
|
|
26
22
|
}) => Promise<SqliteDatabase>;
|
|
27
23
|
}
|
|
28
24
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* and defines only this interface. Wire a driver once at startup:
|
|
33
|
-
*
|
|
34
|
-
* import { opSqliteDriver } from '@webority-technologies/mobile-core/sqlite/op';
|
|
35
|
-
* setSqliteImplementation(opSqliteDriver());
|
|
25
|
+
* Test/showcase-only injection point — see the module header. Not a way to
|
|
26
|
+
* pick an alternate real driver; `@webority-technologies/mobile-core` always
|
|
27
|
+
* resolves expo-sqlite when nothing is injected. Pass `null` to clear it.
|
|
36
28
|
*/
|
|
37
29
|
export declare const setSqliteImplementation: (impl: SqliteDriver | null) => void;
|
|
38
30
|
export declare const isSqliteAvailable: () => boolean;
|
|
@@ -76,4 +76,13 @@ export declare const formatTime12h: (value: DateInput) => string;
|
|
|
76
76
|
* recognises — the same failure mode as handing dayjs.tz() a bad zone name.
|
|
77
77
|
*/
|
|
78
78
|
export declare const formatTimeInZone: (value: DateInput, ianaTimeZone: string) => string;
|
|
79
|
+
/**
|
|
80
|
+
* Same as {@link formatTimeInZone}, but for a .NET-style Windows timezone ID
|
|
81
|
+
* (e.g. `"India Standard Time"`) rather than an IANA one. .NET's own
|
|
82
|
+
* `TimeZoneInfo` API only knows Windows IDs, so a backend built on it hands
|
|
83
|
+
* these to clients directly — `Intl`, by contrast, only recognises IANA
|
|
84
|
+
* names, so the ID has to be translated before it can be used here. Throws
|
|
85
|
+
* if `windowsTimeZoneId` has no known IANA mapping.
|
|
86
|
+
*/
|
|
87
|
+
export declare const formatTimeInWindowsZone: (value: DateInput, windowsTimeZoneId: string) => string;
|
|
79
88
|
//# sourceMappingURL=dateMath.d.ts.map
|
|
@@ -2,7 +2,7 @@ export type { FormatCurrencyOptions } from './currency.js';
|
|
|
2
2
|
export { formatCurrency } from './currency.js';
|
|
3
3
|
export type { DateInput, DateStyle, TimeStyle } from './date.js';
|
|
4
4
|
export { formatDate, formatDateTime, formatRelativeTime, formatTime } from './date.js';
|
|
5
|
-
export { addDays, diffMs, formatDateDDMMMYYYY, formatDateISO, formatDatePattern, formatTime12h, formatTimeInZone, isDateAfter, isDateBefore, isSameDay, startOfDay } from './dateMath.js';
|
|
5
|
+
export { addDays, diffMs, formatDateDDMMMYYYY, formatDateISO, formatDatePattern, formatTime12h, formatTimeInWindowsZone, formatTimeInZone, isDateAfter, isDateBefore, isSameDay, startOfDay } from './dateMath.js';
|
|
6
6
|
export { getInitials } from './initials.js';
|
|
7
7
|
export { formatCompactNumber, formatNumber, formatPercent } from './number.js';
|
|
8
8
|
export type { FormatPhoneOptions, PhoneCountry, PhoneNumber } from './phone.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .NET-style Windows time zone ID → IANA time zone name, one entry per
|
|
3
|
+
* Windows zone, generated from CLDR's `windowsZones.xml` (the same
|
|
4
|
+
* upstream source the retired `windows-iana` npm package derived its own
|
|
5
|
+
* table from). Only the `territory="001"` (world-default) row is kept per
|
|
6
|
+
* Windows zone — `formatTimeInWindowsZone` only ever reads the first IANA
|
|
7
|
+
* candidate, and CLDR's `001` row is exactly that default candidate, so
|
|
8
|
+
* per-country territory variants (`US`, `CA`, `ZZ`, …) carry no information
|
|
9
|
+
* this table's one caller uses.
|
|
10
|
+
*
|
|
11
|
+
* Regenerate with `node packages/core/scripts/generate-windows-to-iana-table.mjs
|
|
12
|
+
* <path-to-windowsZones.xml>` (CLDR: `common/supplemental/windowsZones.xml` in
|
|
13
|
+
* https://github.com/unicode-org/cldr) whenever CLDR adds/renames a zone —
|
|
14
|
+
* this is a committed, static table; nothing fetches CLDR at build or test
|
|
15
|
+
* time.
|
|
16
|
+
*/
|
|
17
|
+
export declare const WINDOWS_TO_IANA: Readonly<Record<string, string>>;
|
|
18
|
+
//# sourceMappingURL=windowsToIanaTable.d.ts.map
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* for anyone importing anything at all. Those live behind their own import
|
|
6
6
|
* paths instead:
|
|
7
7
|
*
|
|
8
|
-
* @webority-technologies/mobile-core/permissions
|
|
8
|
+
* @webority-technologies/mobile-core/permissions per kind, its own Expo module
|
|
9
9
|
* @webority-technologies/mobile-core/compressor react-native-compressor
|
|
10
10
|
* @webority-technologies/mobile-core/geolocation a geolocation provider
|
|
11
|
-
* @webority-technologies/mobile-core/sqlite
|
|
11
|
+
* @webority-technologies/mobile-core/sqlite expo-sqlite
|
|
12
12
|
* @webority-technologies/mobile-core/download a filesystem module
|
|
13
|
+
* @webority-technologies/mobile-core/smsRetriever Android only, own TurboModule
|
|
13
14
|
*
|
|
14
15
|
* react-native-keychain is the exception and is a REQUIRED peer: the HTTP client
|
|
15
16
|
* reads the bearer token, so it is reachable from the main barrel by design.
|
|
@@ -29,7 +30,7 @@ export { getConfig, getConfigValue, resetConfig, setConfig } from './config/inde
|
|
|
29
30
|
export type { DeepLinkConfig, DeepLinkRoute, ParsedLink } from './deepLink/index.js';
|
|
30
31
|
export { DeepLink, parseDeepLink, useDeepLink } from './deepLink/index.js';
|
|
31
32
|
export type { DateInput, DateStyle, FormatCurrencyOptions, FormatPhoneOptions, PhoneCountry, PhoneNumber, TimeStyle } from './formatters/index.js';
|
|
32
|
-
export { addDays, detectPhoneCountry, diffMs, formatCompactNumber, formatCurrency, formatDate, formatDateDDMMMYYYY, formatDateISO, formatDatePattern, formatDateTime, formatNumber, formatPercent, formatPhone, formatRelativeTime, formatTime, formatTime12h, formatTimeInZone, getInitials, isDateAfter, isDateBefore, isSameDay, isValidPhoneNumber, normalizePhone, parsePhoneNumber, parsePhoneNumberFromString, startOfDay } from './formatters/index.js';
|
|
33
|
+
export { addDays, detectPhoneCountry, diffMs, formatCompactNumber, formatCurrency, formatDate, formatDateDDMMMYYYY, formatDateISO, formatDatePattern, formatDateTime, formatNumber, formatPercent, formatPhone, formatRelativeTime, formatTime, formatTime12h, formatTimeInWindowsZone, formatTimeInZone, getInitials, isDateAfter, isDateBefore, isSameDay, isValidPhoneNumber, normalizePhone, parsePhoneNumber, parsePhoneNumberFromString, startOfDay } from './formatters/index.js';
|
|
33
34
|
export type { InitConfig } from './initSDK.js';
|
|
34
35
|
export { initWebority } from './initSDK.js';
|
|
35
36
|
export type { AuthActions } from './initUserAuth.js';
|
|
@@ -1,46 +1,25 @@
|
|
|
1
1
|
export type PermissionKind = 'camera' | 'microphone' | 'photos' | 'photosAdd' | 'mediaLibrary' | 'location' | 'locationAlways' | 'contacts' | 'calendar' | 'reminders' | 'notifications' | 'bluetooth' | 'storage';
|
|
2
2
|
export type PermissionStatus = 'unavailable' | 'denied' | 'limited' | 'granted' | 'blocked';
|
|
3
|
-
export interface
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
ANDROID: Record<string, string>;
|
|
7
|
-
};
|
|
8
|
-
RESULTS: {
|
|
9
|
-
UNAVAILABLE: string;
|
|
10
|
-
DENIED: string;
|
|
11
|
-
LIMITED: string;
|
|
12
|
-
GRANTED: string;
|
|
13
|
-
BLOCKED: string;
|
|
14
|
-
};
|
|
15
|
-
check: (permission: string) => Promise<string>;
|
|
16
|
-
request: (permission: string) => Promise<string>;
|
|
17
|
-
openSettings: () => Promise<void>;
|
|
3
|
+
export interface PermissionsBackend {
|
|
4
|
+
check: (kind: PermissionKind) => Promise<PermissionStatus>;
|
|
5
|
+
request: (kind: PermissionKind) => Promise<PermissionStatus>;
|
|
18
6
|
}
|
|
19
7
|
/**
|
|
20
|
-
* Inject a custom permissions
|
|
21
|
-
*
|
|
8
|
+
* Inject a custom permissions backend at runtime. Pass `null` to reset to the
|
|
9
|
+
* default per-kind Expo resolution.
|
|
22
10
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* documented contract. That exact bug shipped once, in the storage seam.
|
|
27
|
-
*
|
|
28
|
-
* THIS MODULE IS THE EXPO-FIRST EXCEPTION, and deliberately keeps the old
|
|
29
|
-
* shape. Expo ships no permissions package: each module carries its own
|
|
30
|
-
* (expo-location's requestForegroundPermissionsAsync, expo-image-picker's, and
|
|
31
|
-
* so on), so there is no single object to adapt and the library must not guess
|
|
32
|
-
* which Expo modules an app installed. react-native-permissions stays, behind
|
|
33
|
-
* this module's own import path so an app that never asks for permissions
|
|
34
|
-
* never names the package to Metro.
|
|
11
|
+
* Two legitimate reasons to call this: tests/the showcase reaching a denied,
|
|
12
|
+
* blocked or unavailable path a healthy device never takes; and an app that
|
|
13
|
+
* genuinely needs `bluetooth` or `storage`, which no Expo module covers.
|
|
35
14
|
*/
|
|
36
|
-
export declare const setPermissionsImplementation: (impl:
|
|
15
|
+
export declare const setPermissionsImplementation: (impl: PermissionsBackend | null) => void;
|
|
37
16
|
/**
|
|
38
17
|
* Cross-platform permissions wrapper. Maps an abstract `PermissionKind`
|
|
39
|
-
* (camera, photos, location, notifications, …) to the
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
18
|
+
* (camera, photos, location, notifications, …) to the Expo module that owns
|
|
19
|
+
* it under the hood — expo-camera, expo-image-picker, expo-location,
|
|
20
|
+
* expo-contacts, expo-calendar, expo-notifications, expo-media-library. Every
|
|
21
|
+
* one is an optional peer, required lazily; an app installs only the modules
|
|
22
|
+
* whose kinds it actually asks for.
|
|
44
23
|
*/
|
|
45
24
|
export declare const Permissions: {
|
|
46
25
|
check: (kind: PermissionKind) => Promise<PermissionStatus>;
|
|
@@ -51,5 +30,4 @@ export declare const Permissions: {
|
|
|
51
30
|
ensure: (kind: PermissionKind) => Promise<PermissionStatus>;
|
|
52
31
|
openSettings: () => Promise<boolean>;
|
|
53
32
|
};
|
|
54
|
-
export type { RNPermissionsModule as PermissionsLike };
|
|
55
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface SmsRetrieverError {
|
|
2
|
+
type: 'TIMEOUT' | 'SERVICE_UNAVAILABLE' | 'UNKNOWN_ERROR';
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
export interface SmsListenerSubscription {
|
|
6
|
+
remove: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface SmsRetrieverBackend {
|
|
9
|
+
getAppHash: () => Promise<string>;
|
|
10
|
+
startListening: (onMessage: (message: string) => void, onError?: (error: SmsRetrieverError) => void) => SmsListenerSubscription;
|
|
11
|
+
}
|
|
12
|
+
/** Test-only injection point. Pass `null` to reset to the native module. */
|
|
13
|
+
export declare const setSmsRetrieverImplementation: (impl: SmsRetrieverBackend | null) => void;
|
|
14
|
+
/**
|
|
15
|
+
* The Play Services SMS Retriever API — auto-reads an incoming OTP SMS with
|
|
16
|
+
* no SMS permission, matched by an 11-character app-signature hash
|
|
17
|
+
* (`getAppHash`) the backend appends to the message. Android only; every
|
|
18
|
+
* method is safe to call on iOS and resolves/reports unavailable rather than
|
|
19
|
+
* throwing, so a caller doesn't need a platform check at every call site.
|
|
20
|
+
*
|
|
21
|
+
* OTP extraction is left to the caller — `onMessage` receives the raw SMS
|
|
22
|
+
* text, since the expected OTP format (digit count, prefix) is a backend
|
|
23
|
+
* concern, not this module's.
|
|
24
|
+
*/
|
|
25
|
+
export declare const SmsRetriever: {
|
|
26
|
+
isAvailable: () => boolean;
|
|
27
|
+
getAppHash: () => Promise<string>;
|
|
28
|
+
startListening: (onMessage: (message: string) => void, onError?: (error: SmsRetrieverError) => void) => SmsListenerSubscription;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Android-only — the Play Services SMS Retriever API has no iOS equivalent.
|
|
4
|
+
* The JS wrapper in `smsRetriever/index.ts` never touches this module on
|
|
5
|
+
* iOS, so `getEnforcing` only ever runs on Android, where autolinking has
|
|
6
|
+
* registered `SmsRetrieverPackage`.
|
|
7
|
+
*/
|
|
8
|
+
export interface Spec extends TurboModule {
|
|
9
|
+
startSMSListener(): void;
|
|
10
|
+
stopSMSListener(): void;
|
|
11
|
+
getAppHash(): Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: Spec;
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=NativeSmsRetriever.d.ts.map
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* setSqliteImplementation(opSqliteDriver());
|
|
10
|
-
*
|
|
11
|
-
* Supported entry points: /sqlite/op, /sqlite/nitro, /sqlite/quick,
|
|
12
|
-
* /sqlite/storage. Any object matching SqliteDriver also works.
|
|
2
|
+
* expo-sqlite is the fleet's only sanctioned SQLite driver (react-native.md:
|
|
3
|
+
* "we will always use expo-sqlite, what Expo gives, we don't look elsewhere
|
|
4
|
+
* ever") — this module resolves it automatically, with no app-side wiring.
|
|
5
|
+
* `setSqliteImplementation` still exists, narrowed to tests and the showcase:
|
|
6
|
+
* it injects a denying/failing backend to reach error paths a healthy device
|
|
7
|
+
* never takes, the same pattern every other injectable surface in this
|
|
8
|
+
* library follows. It is not a way to pick an alternate real driver.
|
|
13
9
|
*/
|
|
14
10
|
export interface SqliteResultSet {
|
|
15
11
|
rows: Record<string, unknown>[];
|
|
@@ -26,13 +22,9 @@ export interface SqliteDriver {
|
|
|
26
22
|
}) => Promise<SqliteDatabase>;
|
|
27
23
|
}
|
|
28
24
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* and defines only this interface. Wire a driver once at startup:
|
|
33
|
-
*
|
|
34
|
-
* import { opSqliteDriver } from '@webority-technologies/mobile-core/sqlite/op';
|
|
35
|
-
* setSqliteImplementation(opSqliteDriver());
|
|
25
|
+
* Test/showcase-only injection point — see the module header. Not a way to
|
|
26
|
+
* pick an alternate real driver; `@webority-technologies/mobile-core` always
|
|
27
|
+
* resolves expo-sqlite when nothing is injected. Pass `null` to clear it.
|
|
36
28
|
*/
|
|
37
29
|
export declare const setSqliteImplementation: (impl: SqliteDriver | null) => void;
|
|
38
30
|
export declare const isSqliteAvailable: () => boolean;
|