@btsd/aitu-bridge 0.3.41 → 0.3.42
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/dist/index.d.ts +5 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +1 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/index.ts +24 -0
- package/src/version.ts +1 -1
package/src/index.ts
CHANGED
|
@@ -76,6 +76,11 @@ interface GetUserProfileResponse {
|
|
|
76
76
|
avatarThumb?: string;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
interface CheckBiometryResponse {
|
|
80
|
+
data: boolean;
|
|
81
|
+
error?: string
|
|
82
|
+
}
|
|
83
|
+
|
|
79
84
|
const MAX_HEADER_MENU_ITEMS_COUNT = 3;
|
|
80
85
|
|
|
81
86
|
export enum HeaderMenuIcon {
|
|
@@ -150,6 +155,7 @@ export interface AituBridge {
|
|
|
150
155
|
setCustomBackArrowVisible: (visible: boolean) => Promise<ResponseType>;
|
|
151
156
|
openPayment: (transactionId: string) => Promise<ResponseType>;
|
|
152
157
|
setCustomBackArrowOnClickHandler: (handler: BackArrowClickHandlerType) => void;
|
|
158
|
+
checkBiometry: () => Promise<CheckBiometryResponse>;
|
|
153
159
|
}
|
|
154
160
|
|
|
155
161
|
const invokeMethod = 'invoke';
|
|
@@ -177,6 +183,7 @@ const getCustomBackArrowModeMethod = 'getCustomBackArrowMode';
|
|
|
177
183
|
const setCustomBackArrowVisibleMethod = 'setCustomBackArrowVisible';
|
|
178
184
|
const openPaymentMethod = 'openPayment'
|
|
179
185
|
const setCustomBackArrowOnClickHandlerMethod = 'setCustomBackArrowOnClickHandler';
|
|
186
|
+
const checkBiometryMethod = 'checkBiometry';
|
|
180
187
|
|
|
181
188
|
const android = typeof window !== 'undefined' && (window as any).AndroidBridge;
|
|
182
189
|
const ios = typeof window !== 'undefined' && (window as any).webkit && (window as any).webkit.messageHandlers;
|
|
@@ -621,6 +628,21 @@ const buildBridge = (): AituBridge => {
|
|
|
621
628
|
}
|
|
622
629
|
}
|
|
623
630
|
|
|
631
|
+
const checkBiometry = (reqId) => {
|
|
632
|
+
const isAndroid = android && android[checkBiometryMethod];
|
|
633
|
+
const isIos = ios && ios[checkBiometryMethod];
|
|
634
|
+
|
|
635
|
+
if (isAndroid) {
|
|
636
|
+
android[checkBiometryMethod](reqId);
|
|
637
|
+
} else if (isIos) {
|
|
638
|
+
ios[checkBiometryMethod].postMessage({ reqId });
|
|
639
|
+
} else if (web) {
|
|
640
|
+
web.execute(checkBiometryMethod, reqId);
|
|
641
|
+
} else if (typeof window !== 'undefined') {
|
|
642
|
+
console.log('--checkBiometry-isUnknown');
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
|
|
624
646
|
|
|
625
647
|
const invokePromise = promisifyInvoke(invoke, sub);
|
|
626
648
|
const storagePromise = promisifyStorage(storage, sub);
|
|
@@ -643,6 +665,7 @@ const buildBridge = (): AituBridge => {
|
|
|
643
665
|
const getCustomBackArrowModePromise = promisifyMethod(getCustomBackArrowMode, getCustomBackArrowModeMethod, sub);
|
|
644
666
|
const setCustomBackArrowVisiblePromise = promisifyMethod(setCustomBackArrowVisible, setCustomBackArrowVisibleMethod, sub);
|
|
645
667
|
const openPaymentPromise = promisifyMethod(openPayment, openPaymentMethod, sub);
|
|
668
|
+
const checkBiometryPromise = promisifyMethod(checkBiometry, checkBiometryMethod, sub);
|
|
646
669
|
|
|
647
670
|
return {
|
|
648
671
|
version: String(LIB_VERSION),
|
|
@@ -682,6 +705,7 @@ const buildBridge = (): AituBridge => {
|
|
|
682
705
|
setCustomBackArrowVisible: setCustomBackArrowVisiblePromise,
|
|
683
706
|
openPayment: openPaymentPromise,
|
|
684
707
|
setCustomBackArrowOnClickHandler,
|
|
708
|
+
checkBiometry: checkBiometryPromise,
|
|
685
709
|
}
|
|
686
710
|
}
|
|
687
711
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "0.3.
|
|
1
|
+
export const LIB_VERSION = "0.3.42";
|