@webority/mobile-core 0.0.29 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/lib/commonjs/api/baseUrl.js +1 -34
- package/lib/commonjs/api/clientHeaders.js +1 -0
- package/lib/commonjs/api/curl.js +1 -109
- package/lib/commonjs/api/minAppVersion.js +1 -0
- package/lib/commonjs/api/multipart.js +1 -21
- package/lib/commonjs/api/publicClient.js +1 -79
- package/lib/commonjs/api/requestDefaults.js +1 -0
- package/lib/commonjs/api/responseBodyText.js +1 -0
- package/lib/commonjs/api/retry.js +1 -91
- package/lib/commonjs/api/tokenRefresh.js +1 -205
- package/lib/commonjs/api/userClient.js +1 -265
- package/lib/commonjs/auth/authStore.js +1 -265
- package/lib/commonjs/auth/index.js +1 -44
- package/lib/commonjs/auth/jwt.js +1 -112
- package/lib/commonjs/config/index.js +1 -72
- package/lib/commonjs/deepLink/index.js +1 -286
- package/lib/commonjs/download/adapters/expoFs.js +1 -69
- package/lib/commonjs/download/adapters/shared.js +1 -13
- package/lib/commonjs/download/index.js +1 -250
- package/lib/commonjs/errors/extractApiError.js +1 -0
- package/lib/commonjs/errors/index.js +1 -0
- package/lib/commonjs/formatters/currency.js +1 -70
- package/lib/commonjs/formatters/date.js +1 -167
- package/lib/commonjs/formatters/dateMath.js +1 -311
- package/lib/commonjs/formatters/formatConfig.js +1 -0
- package/lib/commonjs/formatters/house.js +1 -0
- package/lib/commonjs/formatters/index.js +1 -246
- package/lib/commonjs/formatters/initials.js +1 -32
- package/lib/commonjs/formatters/intlCache.js +1 -37
- package/lib/commonjs/formatters/number.js +1 -89
- package/lib/commonjs/formatters/phone.js +1 -369
- package/lib/commonjs/formatters/windowsToIanaTable.js +1 -164
- package/lib/commonjs/geolocation/adapters/expoLocation.js +1 -126
- package/lib/commonjs/geolocation/index.js +1 -355
- package/lib/commonjs/index.js +1 -644
- package/lib/commonjs/initSDK.js +1 -66
- package/lib/commonjs/initUserAuth.js +1 -37
- package/lib/commonjs/logger/crashlytics.js +1 -0
- package/lib/commonjs/logger/index.js +1 -301
- package/lib/commonjs/logger/redact.js +1 -50
- package/lib/commonjs/network/index.js +1 -31
- package/lib/commonjs/network/networkStatus.js +1 -171
- package/lib/commonjs/permissions/calendar.js +1 -14
- package/lib/commonjs/permissions/camera.js +1 -14
- package/lib/commonjs/permissions/contacts.js +1 -10
- package/lib/commonjs/permissions/index.js +1 -133
- package/lib/commonjs/permissions/location.js +1 -14
- package/lib/commonjs/permissions/mediaLibrary.js +1 -10
- package/lib/commonjs/permissions/notifications.js +1 -10
- package/lib/commonjs/permissions/photos.js +1 -14
- package/lib/commonjs/phone/countries.js +1 -265
- package/lib/commonjs/push/index.js +1 -61
- package/lib/commonjs/push/push.js +1 -468
- package/lib/commonjs/push/status.js +1 -0
- package/lib/commonjs/push/task.js +1 -43
- package/lib/commonjs/query/apiBaseQuery.js +1 -0
- package/lib/commonjs/query/createAppApi.js +1 -0
- package/lib/commonjs/query/index.js +1 -0
- package/lib/commonjs/query/listeners.js +1 -0
- package/lib/commonjs/query/paging.js +1 -0
- package/lib/commonjs/query/tags.js +1 -0
- package/lib/commonjs/redux/errorToastMiddleware.js +1 -0
- package/lib/commonjs/redux/index.js +1 -0
- package/lib/commonjs/redux/rootReducer.js +1 -0
- package/lib/commonjs/redux/serializableCheck.js +1 -0
- package/lib/commonjs/secureScreen/index.js +1 -0
- package/lib/commonjs/share/index.js +1 -70
- package/lib/commonjs/smsRetriever/index.js +1 -91
- package/lib/commonjs/specs/NativeSmsRetriever.js +1 -15
- package/lib/commonjs/sqlite/adapters/expo.js +1 -53
- package/lib/commonjs/sqlite/index.js +1 -604
- package/lib/commonjs/storage/index.js +1 -214
- package/lib/commonjs/types/axios.js +1 -4
- package/lib/commonjs/types/globals.d.js +1 -6
- package/lib/commonjs/utils/base64.js +1 -24
- package/lib/commonjs/utils/imageCompression.js +1 -389
- package/lib/commonjs/utils/index.js +1 -19
- package/lib/commonjs/validators/index.js +1 -227
- package/lib/commonjs/versionCheck/buildNumber.js +1 -0
- package/lib/commonjs/versionCheck/index.js +1 -419
- package/lib/module/api/baseUrl.js +1 -30
- package/lib/module/api/clientHeaders.js +1 -0
- package/lib/module/api/curl.js +1 -104
- package/lib/module/api/minAppVersion.js +1 -0
- package/lib/module/api/multipart.js +1 -16
- package/lib/module/api/publicClient.js +1 -75
- package/lib/module/api/requestDefaults.js +1 -0
- package/lib/module/api/responseBodyText.js +1 -0
- package/lib/module/api/retry.js +1 -85
- package/lib/module/api/tokenRefresh.js +1 -192
- package/lib/module/api/userClient.js +1 -243
- package/lib/module/auth/authStore.js +1 -257
- package/lib/module/auth/index.js +1 -5
- package/lib/module/auth/jwt.js +1 -106
- package/lib/module/config/index.js +1 -64
- package/lib/module/deepLink/index.js +1 -280
- package/lib/module/download/adapters/expoFs.js +1 -64
- package/lib/module/download/adapters/shared.js +1 -8
- package/lib/module/download/index.js +1 -242
- package/lib/module/errors/extractApiError.js +1 -0
- package/lib/module/errors/index.js +1 -0
- package/lib/module/formatters/currency.js +1 -65
- package/lib/module/formatters/date.js +1 -159
- package/lib/module/formatters/dateMath.js +1 -295
- package/lib/module/formatters/formatConfig.js +1 -0
- package/lib/module/formatters/house.js +1 -0
- package/lib/module/formatters/index.js +1 -9
- package/lib/module/formatters/initials.js +1 -27
- package/lib/module/formatters/intlCache.js +1 -30
- package/lib/module/formatters/number.js +1 -82
- package/lib/module/formatters/phone.js +1 -302
- package/lib/module/formatters/windowsToIanaTable.js +1 -160
- package/lib/module/geolocation/adapters/expoLocation.js +1 -121
- package/lib/module/geolocation/index.js +1 -347
- package/lib/module/index.js +1 -57
- package/lib/module/initSDK.js +1 -61
- package/lib/module/initUserAuth.js +1 -33
- package/lib/module/logger/crashlytics.js +1 -0
- package/lib/module/logger/index.js +1 -295
- package/lib/module/logger/redact.js +1 -44
- package/lib/module/network/index.js +1 -4
- package/lib/module/network/networkStatus.js +1 -161
- package/lib/module/permissions/calendar.js +1 -15
- package/lib/module/permissions/camera.js +1 -15
- package/lib/module/permissions/contacts.js +1 -11
- package/lib/module/permissions/index.js +1 -128
- package/lib/module/permissions/location.js +1 -15
- package/lib/module/permissions/mediaLibrary.js +1 -11
- package/lib/module/permissions/notifications.js +1 -11
- package/lib/module/permissions/photos.js +1 -15
- package/lib/module/phone/countries.js +1 -261
- package/lib/module/push/index.js +1 -4
- package/lib/module/push/push.js +1 -452
- package/lib/module/push/status.js +1 -0
- package/lib/module/push/task.js +1 -38
- package/lib/module/query/apiBaseQuery.js +1 -0
- package/lib/module/query/createAppApi.js +1 -0
- package/lib/module/query/index.js +1 -0
- package/lib/module/query/listeners.js +1 -0
- package/lib/module/query/paging.js +1 -0
- package/lib/module/query/tags.js +1 -0
- package/lib/module/redux/errorToastMiddleware.js +1 -0
- package/lib/module/redux/index.js +1 -0
- package/lib/module/redux/rootReducer.js +1 -0
- package/lib/module/redux/serializableCheck.js +1 -0
- package/lib/module/secureScreen/index.js +1 -0
- package/lib/module/share/index.js +1 -64
- package/lib/module/smsRetriever/index.js +1 -86
- package/lib/module/specs/NativeSmsRetriever.js +1 -13
- package/lib/module/sqlite/adapters/expo.js +1 -48
- package/lib/module/sqlite/index.js +1 -594
- package/lib/module/storage/index.js +1 -208
- package/lib/module/types/axios.js +1 -4
- package/lib/module/types/globals.d.js +1 -10
- package/lib/module/utils/base64.js +1 -19
- package/lib/module/utils/imageCompression.js +1 -383
- package/lib/module/utils/index.js +1 -4
- package/lib/module/validators/index.js +1 -205
- package/lib/module/versionCheck/buildNumber.js +1 -0
- package/lib/module/versionCheck/index.js +1 -413
- package/lib/typescript/commonjs/api/clientHeaders.d.ts +25 -0
- package/lib/typescript/commonjs/api/minAppVersion.d.ts +24 -0
- package/lib/typescript/commonjs/api/requestDefaults.d.ts +21 -0
- package/lib/typescript/commonjs/api/responseBodyText.d.ts +6 -0
- package/lib/typescript/commonjs/api/retry.d.ts +23 -9
- package/lib/typescript/commonjs/api/tokenRefresh.d.ts +14 -2
- package/lib/typescript/commonjs/api/userClient.d.ts +1 -1
- package/lib/typescript/commonjs/auth/authStore.d.ts +76 -0
- package/lib/typescript/commonjs/auth/index.d.ts +2 -2
- package/lib/typescript/commonjs/config/index.d.ts +31 -2
- package/lib/typescript/commonjs/errors/extractApiError.d.ts +69 -0
- package/lib/typescript/commonjs/errors/index.d.ts +3 -0
- package/lib/typescript/commonjs/formatters/currency.d.ts +22 -7
- package/lib/typescript/commonjs/formatters/date.d.ts +13 -13
- package/lib/typescript/commonjs/formatters/dateMath.d.ts +4 -2
- package/lib/typescript/commonjs/formatters/formatConfig.d.ts +48 -0
- package/lib/typescript/commonjs/formatters/house.d.ts +143 -0
- package/lib/typescript/commonjs/formatters/index.d.ts +4 -0
- package/lib/typescript/commonjs/formatters/number.d.ts +15 -5
- package/lib/typescript/commonjs/index.d.ts +26 -8
- package/lib/typescript/commonjs/initSDK.d.ts +18 -6
- package/lib/typescript/commonjs/initUserAuth.d.ts +29 -0
- package/lib/typescript/commonjs/logger/crashlytics.d.ts +31 -0
- package/lib/typescript/commonjs/logger/index.d.ts +17 -0
- package/lib/typescript/commonjs/push/index.d.ts +3 -1
- package/lib/typescript/commonjs/push/push.d.ts +1 -1
- package/lib/typescript/commonjs/push/status.d.ts +9 -0
- package/lib/typescript/commonjs/query/apiBaseQuery.d.ts +55 -0
- package/lib/typescript/commonjs/query/createAppApi.d.ts +21 -0
- package/lib/typescript/commonjs/query/index.d.ts +9 -0
- package/lib/typescript/commonjs/query/listeners.d.ts +11 -0
- package/lib/typescript/commonjs/query/paging.d.ts +42 -0
- package/lib/typescript/commonjs/query/tags.d.ts +31 -0
- package/lib/typescript/commonjs/redux/errorToastMiddleware.d.ts +51 -0
- package/lib/typescript/commonjs/redux/index.d.ts +6 -0
- package/lib/typescript/commonjs/redux/rootReducer.d.ts +19 -0
- package/lib/typescript/commonjs/redux/serializableCheck.d.ts +14 -0
- package/lib/typescript/commonjs/secureScreen/index.d.ts +25 -0
- package/lib/typescript/commonjs/versionCheck/buildNumber.d.ts +14 -0
- package/lib/typescript/commonjs/versionCheck/index.d.ts +28 -17
- package/lib/typescript/module/api/clientHeaders.d.ts +25 -0
- package/lib/typescript/module/api/minAppVersion.d.ts +24 -0
- package/lib/typescript/module/api/requestDefaults.d.ts +21 -0
- package/lib/typescript/module/api/responseBodyText.d.ts +6 -0
- package/lib/typescript/module/api/retry.d.ts +23 -9
- package/lib/typescript/module/api/tokenRefresh.d.ts +14 -2
- package/lib/typescript/module/api/userClient.d.ts +1 -1
- package/lib/typescript/module/auth/authStore.d.ts +76 -0
- package/lib/typescript/module/auth/index.d.ts +2 -2
- package/lib/typescript/module/config/index.d.ts +31 -2
- package/lib/typescript/module/errors/extractApiError.d.ts +69 -0
- package/lib/typescript/module/errors/index.d.ts +3 -0
- package/lib/typescript/module/formatters/currency.d.ts +22 -7
- package/lib/typescript/module/formatters/date.d.ts +13 -13
- package/lib/typescript/module/formatters/dateMath.d.ts +4 -2
- package/lib/typescript/module/formatters/formatConfig.d.ts +48 -0
- package/lib/typescript/module/formatters/house.d.ts +143 -0
- package/lib/typescript/module/formatters/index.d.ts +4 -0
- package/lib/typescript/module/formatters/number.d.ts +15 -5
- package/lib/typescript/module/index.d.ts +26 -8
- package/lib/typescript/module/initSDK.d.ts +18 -6
- package/lib/typescript/module/initUserAuth.d.ts +29 -0
- package/lib/typescript/module/logger/crashlytics.d.ts +31 -0
- package/lib/typescript/module/logger/index.d.ts +17 -0
- package/lib/typescript/module/push/index.d.ts +3 -1
- package/lib/typescript/module/push/push.d.ts +1 -1
- package/lib/typescript/module/push/status.d.ts +9 -0
- package/lib/typescript/module/query/apiBaseQuery.d.ts +55 -0
- package/lib/typescript/module/query/createAppApi.d.ts +21 -0
- package/lib/typescript/module/query/index.d.ts +9 -0
- package/lib/typescript/module/query/listeners.d.ts +11 -0
- package/lib/typescript/module/query/paging.d.ts +42 -0
- package/lib/typescript/module/query/tags.d.ts +31 -0
- package/lib/typescript/module/redux/errorToastMiddleware.d.ts +51 -0
- package/lib/typescript/module/redux/index.d.ts +6 -0
- package/lib/typescript/module/redux/rootReducer.d.ts +19 -0
- package/lib/typescript/module/redux/serializableCheck.d.ts +14 -0
- package/lib/typescript/module/secureScreen/index.d.ts +25 -0
- package/lib/typescript/module/versionCheck/buildNumber.d.ts +14 -0
- package/lib/typescript/module/versionCheck/index.d.ts +28 -17
- package/package.json +52 -5
|
@@ -1,86 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { DeviceEventEmitter, Platform } from 'react-native';
|
|
4
|
-
import { Logger } from "../logger/index.js";
|
|
5
|
-
const OTP_EVENT = 'WeborityMobileCoreSmsRetrieved';
|
|
6
|
-
const ERROR_EVENT = 'WeborityMobileCoreSmsRetrieverError';
|
|
7
|
-
let backend = null;
|
|
8
|
-
|
|
9
|
-
/** Test-only injection point. Pass `null` to reset to the native module. */
|
|
10
|
-
export const setSmsRetrieverImplementation = impl => {
|
|
11
|
-
backend = impl;
|
|
12
|
-
};
|
|
13
|
-
let nativeModule;
|
|
14
|
-
const resolveNativeModule = () => {
|
|
15
|
-
if (nativeModule !== undefined) {
|
|
16
|
-
return nativeModule;
|
|
17
|
-
}
|
|
18
|
-
if (Platform.OS !== 'android') {
|
|
19
|
-
nativeModule = null;
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
try {
|
|
23
|
-
nativeModule = require('../specs/NativeSmsRetriever').default ?? null;
|
|
24
|
-
} catch (error) {
|
|
25
|
-
Logger.warn('[smsRetriever] native module not available', error);
|
|
26
|
-
nativeModule = null;
|
|
27
|
-
}
|
|
28
|
-
return nativeModule ?? null;
|
|
29
|
-
};
|
|
30
|
-
const defaultBackend = {
|
|
31
|
-
getAppHash: async () => {
|
|
32
|
-
const m = resolveNativeModule();
|
|
33
|
-
if (!m) {
|
|
34
|
-
throw new Error('[smsRetriever] getAppHash: native module unavailable (Android only).');
|
|
35
|
-
}
|
|
36
|
-
return m.getAppHash();
|
|
37
|
-
},
|
|
38
|
-
startListening: (onMessage, onError) => {
|
|
39
|
-
const m = resolveNativeModule();
|
|
40
|
-
if (!m) {
|
|
41
|
-
onError?.({
|
|
42
|
-
type: 'SERVICE_UNAVAILABLE',
|
|
43
|
-
message: 'SMS Retriever is Android-only, or the native module is not linked.'
|
|
44
|
-
});
|
|
45
|
-
return {
|
|
46
|
-
remove: () => undefined
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
const messageSub = DeviceEventEmitter.addListener(OTP_EVENT, payload => onMessage(payload.message));
|
|
50
|
-
const errorSub = onError ? DeviceEventEmitter.addListener(ERROR_EVENT, payload => onError(payload)) : null;
|
|
51
|
-
try {
|
|
52
|
-
m.startSMSListener();
|
|
53
|
-
} catch (error) {
|
|
54
|
-
Logger.error('[smsRetriever] startSMSListener failed', error);
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
remove: () => {
|
|
58
|
-
messageSub.remove();
|
|
59
|
-
errorSub?.remove();
|
|
60
|
-
try {
|
|
61
|
-
m.stopSMSListener();
|
|
62
|
-
} catch (error) {
|
|
63
|
-
Logger.error('[smsRetriever] stopSMSListener failed', error);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The Play Services SMS Retriever API — auto-reads an incoming OTP SMS with
|
|
72
|
-
* no SMS permission, matched by an 11-character app-signature hash
|
|
73
|
-
* (`getAppHash`) the backend appends to the message. Android only; every
|
|
74
|
-
* method is safe to call on iOS and resolves/reports unavailable rather than
|
|
75
|
-
* throwing, so a caller doesn't need a platform check at every call site.
|
|
76
|
-
*
|
|
77
|
-
* OTP extraction is left to the caller — `onMessage` receives the raw SMS
|
|
78
|
-
* text, since the expected OTP format (digit count, prefix) is a backend
|
|
79
|
-
* concern, not this module's.
|
|
80
|
-
*/
|
|
81
|
-
export const SmsRetriever = {
|
|
82
|
-
isAvailable: () => resolveNativeModule() !== null,
|
|
83
|
-
getAppHash: () => (backend ?? defaultBackend).getAppHash(),
|
|
84
|
-
startListening: (onMessage, onError) => (backend ?? defaultBackend).startListening(onMessage, onError)
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";import{DeviceEventEmitter,Platform}from"react-native";import{Logger}from"../logger/index.js";const OTP_EVENT="WeborityMobileCoreSmsRetrieved",ERROR_EVENT="WeborityMobileCoreSmsRetrieverError";let nativeModule,backend=null;export const setSmsRetrieverImplementation=e=>{backend=e};const resolveNativeModule=()=>{if(void 0!==nativeModule)return nativeModule;if("android"!==Platform.OS)return nativeModule=null,null;try{nativeModule=require("../specs/NativeSmsRetriever").default??null}catch(e){Logger.warn("[smsRetriever] native module not available",e),nativeModule=null}return nativeModule??null},defaultBackend={getAppHash:async()=>{const e=resolveNativeModule();if(!e)throw new Error("[smsRetriever] getAppHash: native module unavailable (Android only).");return e.getAppHash()},startListening:(e,t)=>{const r=resolveNativeModule();if(!r)return t?.({type:"SERVICE_UNAVAILABLE",message:"SMS Retriever is Android-only, or the native module is not linked."}),{remove:()=>{}};const i=DeviceEventEmitter.addListener(OTP_EVENT,t=>e(t.message)),n=t?DeviceEventEmitter.addListener(ERROR_EVENT,e=>t(e)):null;try{r.startSMSListener()}catch(e){Logger.error("[smsRetriever] startSMSListener failed",e)}return{remove:()=>{i.remove(),n?.remove();try{r.stopSMSListener()}catch(e){Logger.error("[smsRetriever] stopSMSListener failed",e)}}}}};export const SmsRetriever={isAvailable:()=>null!==resolveNativeModule(),getAppHash:()=>(backend??defaultBackend).getAppHash(),startListening:(e,t)=>(backend??defaultBackend).startListening(e,t)};
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Android-only — the Play Services SMS Retriever API has no iOS equivalent.
|
|
7
|
-
* The JS wrapper in `smsRetriever/index.ts` never touches this module on
|
|
8
|
-
* iOS, so `getEnforcing` only ever runs on Android, where autolinking has
|
|
9
|
-
* registered `SmsRetrieverPackage`.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
export default TurboModuleRegistry.getEnforcing('WeborityMobileCoreSmsRetriever');
|
|
13
|
-
//# sourceMappingURL=NativeSmsRetriever.js.map
|
|
1
|
+
"use strict";import{TurboModuleRegistry}from"react-native";export default TurboModuleRegistry.getEnforcing("WeborityMobileCoreSmsRetriever");
|
|
@@ -1,48 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* expo-sqlite. Shape verified against 57.0.2 rather than assumed, and it is the
|
|
5
|
-
* one driver that cannot share an adapter with the others: expo splits reads
|
|
6
|
-
* from writes. `getAllAsync` yields rows but no change count, `runAsync` yields
|
|
7
|
-
* `{ changes, lastInsertRowId }` but no rows, and SqliteResultSet needs all
|
|
8
|
-
* three from one call. `prepareAsync` + `executeAsync` is the only call that
|
|
9
|
-
* returns both, so every statement goes through it rather than being routed by
|
|
10
|
-
* sniffing the SQL for a leading SELECT.
|
|
11
|
-
*
|
|
12
|
-
* The REQUIRE lives in the driver entry point beside this file, never here.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export const adaptExpoSqlite = mod => ({
|
|
16
|
-
// expo takes the directory as a third positional argument rather than an
|
|
17
|
-
// option, so `location` cannot be passed through the options object.
|
|
18
|
-
open: async (name, options) => {
|
|
19
|
-
const db = await mod.openDatabaseAsync(name, undefined, options?.location);
|
|
20
|
-
return {
|
|
21
|
-
execute: async (sql, params) => {
|
|
22
|
-
const statement = await db.prepareAsync(sql);
|
|
23
|
-
try {
|
|
24
|
-
const result = await statement.executeAsync(params ? [...params] : []);
|
|
25
|
-
// Safe on a write: expo returns [] when the statement produced no
|
|
26
|
-
// first row rather than stepping the statement a second time.
|
|
27
|
-
const rows = await result.getAllAsync();
|
|
28
|
-
return {
|
|
29
|
-
rows,
|
|
30
|
-
rowsAffected: result.changes,
|
|
31
|
-
// expo always reports lastInsertRowId, so unlike the other drivers
|
|
32
|
-
// this is never undefined. It is the connection's last insert rowid,
|
|
33
|
-
// which is only meaningful immediately after an INSERT.
|
|
34
|
-
insertId: result.lastInsertRowId
|
|
35
|
-
};
|
|
36
|
-
} finally {
|
|
37
|
-
// A statement left unfinalised holds a native handle for the life of
|
|
38
|
-
// the connection, and the core executes one per call.
|
|
39
|
-
await statement.finalizeAsync();
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
close: async () => {
|
|
43
|
-
await db.closeAsync();
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=expo.js.map
|
|
1
|
+
"use strict";export const adaptExpoSqlite=t=>({open:async(a,e)=>{const s=await t.openDatabaseAsync(a,void 0,e?.location);return{execute:async(t,a)=>{const e=await s.prepareAsync(t);try{const t=await e.executeAsync(a?[...a]:[]);return{rows:await t.getAllAsync(),rowsAffected:t.changes,insertId:t.lastInsertRowId}}finally{await e.finalizeAsync()}},close:async()=>{await s.closeAsync()}}}});
|