@alipay/ams-checkout 0.0.1763724075-dev.4 → 0.0.1763966842-dev.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/LEGAL.md +6 -0
- package/LICENSE +6 -0
- package/README.md +58 -0
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/component/channel.d.ts +21 -0
- package/esm/component/component.inline.style.d.ts +10 -0
- package/esm/component/component.popup.style.d.ts +26 -0
- package/esm/component/popupWindow.style.d.ts +24 -0
- package/esm/config/index.d.ts +16 -0
- package/esm/config/request.d.ts +21 -0
- package/esm/constant/easysafepay.d.ts +16 -0
- package/esm/constant/index.d.ts +341 -0
- package/esm/constant/index.js +0 -3
- package/esm/core/bus/ability/callback.d.ts +9 -0
- package/esm/core/bus/ability/security.d.ts +10 -0
- package/esm/core/bus/ability/tracker.d.ts +9 -0
- package/esm/core/bus/index.d.ts +125 -0
- package/esm/core/bus/interface.d.ts +36 -0
- package/esm/core/component/address.d.ts +8 -0
- package/esm/core/component/appPreloadProcessing.d.ts +1 -0
- package/esm/core/component/ckp/index.d.ts +29 -0
- package/esm/core/component/element/EventCenter/index.d.ts +31 -0
- package/esm/core/component/element/elementContainerService/containerService.d.ts +34 -0
- package/esm/core/component/element/elementContainerService/index.d.ts +20 -0
- package/esm/core/component/element/elementController/index.d.ts +48 -0
- package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +20 -0
- package/esm/core/component/element/elementProcessor/addressProcessor.js +3 -2
- package/esm/core/component/element/elementProcessor/authProcessor.d.ts +20 -0
- package/esm/core/component/element/elementProcessor/authProcessor.js +3 -2
- package/esm/core/component/element/elementProcessor/baseElementProcessor.d.ts +41 -0
- package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +22 -0
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +28 -30
- package/esm/core/component/element/index.d.ts +13 -0
- package/esm/core/component/element/mock.d.ts +10 -0
- package/esm/core/component/element/type.d.ts +443 -0
- package/esm/core/component/element/util.d.ts +85 -0
- package/esm/core/component/index.d.ts +58 -0
- package/esm/core/drop-in/index.d.ts +22 -0
- package/esm/core/instance/index.d.ts +89 -0
- package/esm/foundation/core/index.d.ts +36 -0
- package/esm/foundation/core/index.js +0 -27
- package/esm/foundation/index.d.ts +97 -0
- package/esm/foundation/product-processor/autoDebit/deps.d.ts +14 -0
- package/esm/foundation/product-processor/autoDebit/index.d.ts +48 -0
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +20 -0
- package/esm/foundation/product-processor/easysafepay/index.d.ts +29 -0
- package/esm/foundation/product-processor/element/index.d.ts +7 -0
- package/esm/foundation/service/api-bus/ability/callback.d.ts +9 -0
- package/esm/foundation/service/api-bus/ability/globalData.d.ts +10 -0
- package/esm/foundation/service/api-bus/ability/request.d.ts +10 -0
- package/esm/foundation/service/api-bus/ability/security.d.ts +12 -0
- package/esm/foundation/service/api-bus/ability/tracker.d.ts +9 -0
- package/esm/foundation/service/api-bus/busManager.d.ts +127 -0
- package/esm/foundation/service/api-bus/index.d.ts +20 -0
- package/esm/foundation/service/api-bus/interface.d.ts +48 -0
- package/esm/foundation/service/container/index.d.ts +41 -0
- package/esm/foundation/service/container/index.js +2 -33
- package/esm/foundation/service/container/popup.d.ts +31 -0
- package/esm/foundation/service/container/utils.d.ts +7 -0
- package/esm/foundation/service/event-center.d.ts +82 -0
- package/esm/foundation/service/global-data/index.d.ts +11 -0
- package/esm/foundation/service/index.d.ts +19 -0
- package/esm/foundation/service/log/index.d.ts +43 -0
- package/esm/foundation/service/log/keys.d.ts +13 -0
- package/esm/foundation/service/log/processor.d.ts +9 -0
- package/esm/foundation/service/log/types.d.ts +33 -0
- package/esm/foundation/service/requester/deps.d.ts +17 -0
- package/esm/foundation/service/requester/requester.d.ts +22 -0
- package/esm/foundation/service/security/index.d.ts +28 -0
- package/esm/foundation/service/security/security.d.ts +33 -0
- package/esm/foundation/utils/gray_scale_utils.d.ts +7 -0
- package/esm/foundation/utils/payment_context_utils.d.ts +13 -0
- package/esm/foundation/utils/payment_product_utils.d.ts +13 -0
- package/esm/foundation/utils/preload_helper.d.ts +21 -0
- package/esm/foundation/utils/redirect_utils.d.ts +11 -0
- package/esm/foundation/utils/system_events.d.ts +4 -0
- package/esm/foundation/utils/web_app_url_utils.d.ts +116 -0
- package/esm/foundation/utils/web_app_url_utils.js +15 -10
- package/esm/index.d.ts +54 -0
- package/esm/index.js +341 -5
- package/esm/plugin/applepay/component.d.ts +50 -0
- package/esm/plugin/applepay/index.d.ts +17 -0
- package/esm/plugin/applepay/interface.d.ts +161 -0
- package/esm/plugin/applepay/service.d.ts +54 -0
- package/esm/plugin/component/cashierApp.d.ts +38 -0
- package/esm/plugin/component/cashierApp.js +4 -7
- package/esm/plugin/component/channel.d.ts +57 -0
- package/esm/plugin/component/component.inline.style.d.ts +10 -0
- package/esm/plugin/component/component.popup.style.d.ts +25 -0
- package/esm/plugin/component/index.d.ts +133 -0
- package/esm/plugin/component/popupWindow.style.d.ts +11 -0
- package/esm/plugin/const.d.ts +2 -0
- package/esm/plugin/drop-in/index.d.ts +71 -0
- package/esm/plugin/payment-element/utils.d.ts +2 -0
- package/esm/plugin/paypal/index.d.ts +20 -0
- package/esm/plugin/type.d.ts +34 -0
- package/esm/plugin/utils.d.ts +6 -0
- package/esm/request/index.d.ts +9 -0
- package/esm/request/utils.d.ts +28 -0
- package/esm/service/index.d.ts +13 -0
- package/esm/types/index.d.ts +854 -0
- package/esm/util/createIframeNode.d.ts +6 -0
- package/esm/util/debug.d.ts +1 -0
- package/esm/util/get.d.ts +25 -0
- package/esm/util/getBackScheme.d.ts +5 -0
- package/esm/util/index.d.ts +61 -0
- package/esm/util/intl-callapp/es/browser.d.ts +21 -0
- package/esm/util/intl-callapp/es/evoke.d.ts +13 -0
- package/esm/util/intl-callapp/es/generate.d.ts +29 -0
- package/esm/util/intl-callapp/es/index.d.ts +43 -0
- package/esm/util/intl-callapp/es/main.d.ts +41 -0
- package/esm/util/intl-callapp/es/openWallet.d.ts +15 -0
- package/esm/util/intl-callapp/es/types.d.ts +46 -0
- package/esm/util/intl-callapp/es/utils/config.d.ts +24 -0
- package/esm/util/intl-callapp/es/utils/index.d.ts +15 -0
- package/esm/util/logger.d.ts +64 -0
- package/esm/util/logger.js +1 -1
- package/esm/util/mock.d.ts +1 -0
- package/esm/util/redirect.d.ts +6 -0
- package/esm/util/security.d.ts +34 -0
- package/esm/util/spm-map.d.ts +211 -0
- package/esm/util/storage.d.ts +2 -0
- package/esm/util/upgrade.d.ts +39 -0
- package/esm/util/versionCompare.d.ts +15 -0
- package/package.json +6 -16
- package/ams-checkout.js +0 -1
- package/esm/constant/auto-debit.js +0 -15
- package/esm/constant/element.js +0 -30
- package/esm/loader/Proxy.js +0 -364
- package/esm/loader/constant.js +0 -36
- package/esm/loader/index.js +0 -23
- package/esm/loader/utils/common.js +0 -63
- package/esm/loader/utils/debugger.js +0 -15
- package/esm/loader/utils/loadSDK.js +0 -92
- package/esm/loader/utils/logger.js +0 -59
- package/esm/loader/utils/proxyPerformance.js +0 -66
- package/esm/main.js +0 -329
- package/esm/util/integrationType.js +0 -48
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Iselector, DisplayTypeEnum } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* @description context中需要包含app节点,用于插入selector中
|
|
4
|
+
*/
|
|
5
|
+
export declare const createIframeNode: (context: any, selector: Iselector, renderDisplayType: DisplayTypeEnum) => Promise<void>;
|
|
6
|
+
export declare const createPreloadIframeNode: (virtualPreloadIframe: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isDebugLog: () => boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the value at `path` of `object`. If the resolved value is
|
|
3
|
+
* `undefined`, the `defaultValue` is returned in its place.
|
|
4
|
+
*
|
|
5
|
+
* @since 3.7.0
|
|
6
|
+
* @category Object
|
|
7
|
+
* @param {Object} object The object to query.
|
|
8
|
+
* @param {Array|string} path The path of the property to get.
|
|
9
|
+
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
10
|
+
* @returns {*} Returns the resolved value.
|
|
11
|
+
* @see has, hasIn, set, unset
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* const object = { 'a': [{ 'b': { 'c': 3 } }] }
|
|
15
|
+
*
|
|
16
|
+
* get(object, 'a[0].b.c')
|
|
17
|
+
* // => 3
|
|
18
|
+
*
|
|
19
|
+
* get(object, ['a', '0', 'b', 'c'])
|
|
20
|
+
* // => 3
|
|
21
|
+
*
|
|
22
|
+
* get(object, 'a.b.c', 'default')
|
|
23
|
+
* // => 'default'
|
|
24
|
+
*/
|
|
25
|
+
export declare function get(object: any, path: string, defaultValue?: any): any;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
|
5
|
+
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
|
6
|
+
*/
|
|
7
|
+
declare const getType: (target: any) => string;
|
|
8
|
+
declare class EventCenter {
|
|
9
|
+
private events;
|
|
10
|
+
private eventsKey;
|
|
11
|
+
constructor();
|
|
12
|
+
on(name: string, func: any, key?: string): void;
|
|
13
|
+
off(name: string, func: any, key?: string): void;
|
|
14
|
+
emit(name: string, ...rest: any): void;
|
|
15
|
+
once(name: string, func: any, key?: string): void;
|
|
16
|
+
isExist(name: string): boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const getViewPort: (key: string) => any;
|
|
19
|
+
declare const getOrigin: () => string;
|
|
20
|
+
declare const serialize: (obj: Record<string, string>) => string;
|
|
21
|
+
declare const isJsonString: (str: string) => boolean;
|
|
22
|
+
declare const isDom: (obj: any) => boolean;
|
|
23
|
+
declare const device: {
|
|
24
|
+
iOS: boolean;
|
|
25
|
+
Android: boolean;
|
|
26
|
+
macOS: boolean;
|
|
27
|
+
WindowsNT: boolean;
|
|
28
|
+
isMobile: boolean;
|
|
29
|
+
isOpenHarmonyMobile: boolean;
|
|
30
|
+
};
|
|
31
|
+
declare const safeJson: (data: any, obj: any) => any;
|
|
32
|
+
declare const isPC: () => boolean;
|
|
33
|
+
declare const queryParse: (url?: string) => Record<string, any>;
|
|
34
|
+
declare const getDesignFontSize: () => number;
|
|
35
|
+
declare const amsSetSize: (event?: any, dom?: any) => void;
|
|
36
|
+
declare const addSetFontSizeEvent: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* @description get or set STORAGE
|
|
39
|
+
*/
|
|
40
|
+
declare const getOrSetStorageId: (key: string, value?: string) => string;
|
|
41
|
+
declare const checkTimeElapsed: () => boolean;
|
|
42
|
+
declare const isFunction: (func: any) => boolean;
|
|
43
|
+
declare function parseBase64ToString(base64: string): string;
|
|
44
|
+
declare function loadSDKScript({ src, attrOptions, timeOut, loadCallback }: {
|
|
45
|
+
src: any;
|
|
46
|
+
attrOptions?: {};
|
|
47
|
+
timeOut?: number;
|
|
48
|
+
loadCallback?: any;
|
|
49
|
+
}, logger: any): Promise<unknown>;
|
|
50
|
+
declare const isEmpty: (value: any) => boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 判断一个值是否为真
|
|
53
|
+
* @param value 要判断的值
|
|
54
|
+
* @returns 如果值为true或者字符串"true"(不区分大小写),则返回true,否则返回false
|
|
55
|
+
*/
|
|
56
|
+
declare const isTrue: (value: unknown) => boolean;
|
|
57
|
+
export declare const omit: <T extends {
|
|
58
|
+
[x: string]: any;
|
|
59
|
+
hasOwnProperty: (arg0: any) => any;
|
|
60
|
+
}>(obj: T, keys: Array<keyof T>) => T;
|
|
61
|
+
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, loadSDKScript, isEmpty, isTrue, };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param versionA
|
|
3
|
+
* @param versionB
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export declare const semverCompare: (
|
|
7
|
+
versionA: string,
|
|
8
|
+
versionB: string,
|
|
9
|
+
) => -1 | 0 | 1;
|
|
10
|
+
|
|
11
|
+
export declare const getIOSVersion: () => number;
|
|
12
|
+
export declare const isAndroid: boolean;
|
|
13
|
+
export declare const isIOS: boolean;
|
|
14
|
+
export declare const isOriginalChrome: boolean;
|
|
15
|
+
export declare const isQQBrowser: boolean;
|
|
16
|
+
export declare const isFirefox: boolean;
|
|
17
|
+
export declare const isBaidu: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @returns boolean
|
|
20
|
+
*/
|
|
21
|
+
export declare const haveSchemeToLinkOrFallback: () => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param url
|
|
3
|
+
*/
|
|
4
|
+
export declare function evokeByLocation(url: string): void;
|
|
5
|
+
/**
|
|
6
|
+
* @param url
|
|
7
|
+
*/
|
|
8
|
+
export declare function evokeByTagA(url: string): void;
|
|
9
|
+
export declare function buildIFrame(): void;
|
|
10
|
+
/**
|
|
11
|
+
* @param url
|
|
12
|
+
*/
|
|
13
|
+
export declare function evokeByIFrame(url: string): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param url
|
|
3
|
+
* @param params
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export declare function generateQS(
|
|
7
|
+
url: string,
|
|
8
|
+
params?: Record<string, any>,
|
|
9
|
+
): string;
|
|
10
|
+
/**
|
|
11
|
+
* @param url
|
|
12
|
+
* @param params
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare function generateLink(
|
|
16
|
+
url: string,
|
|
17
|
+
params?: Record<string, any>,
|
|
18
|
+
): string;
|
|
19
|
+
/**
|
|
20
|
+
* @param url
|
|
21
|
+
* @param packageName
|
|
22
|
+
* @param params
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare function generateIntent(
|
|
26
|
+
url: string,
|
|
27
|
+
packageName?: string,
|
|
28
|
+
fallbackUrl?: string,
|
|
29
|
+
): string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { CallappConfig, CallappOptions, EvokeAppBy } from './types';
|
|
3
|
+
declare class CallApp {
|
|
4
|
+
config: CallappConfig;
|
|
5
|
+
timer: NodeJS.Timeout | null;
|
|
6
|
+
options: CallappOptions;
|
|
7
|
+
evokeAppBy: EvokeAppBy;
|
|
8
|
+
constructor(config?: CallappConfig);
|
|
9
|
+
|
|
10
|
+
private init;
|
|
11
|
+
/**
|
|
12
|
+
* @param options
|
|
13
|
+
*/
|
|
14
|
+
open(options: CallappOptions): void;
|
|
15
|
+
|
|
16
|
+
private handleLink;
|
|
17
|
+
|
|
18
|
+
private handleIntent;
|
|
19
|
+
|
|
20
|
+
private handleScheme;
|
|
21
|
+
|
|
22
|
+
private handleIOSScheme;
|
|
23
|
+
|
|
24
|
+
private handleOriginalChrome;
|
|
25
|
+
/**
|
|
26
|
+
* @param evokeFn
|
|
27
|
+
* @param delay
|
|
28
|
+
* @param fallback
|
|
29
|
+
* @param degradationStrategy
|
|
30
|
+
*/
|
|
31
|
+
private evokeAppDelay;
|
|
32
|
+
private evokeByLocationDelay;
|
|
33
|
+
private evokeByTagADelay;
|
|
34
|
+
private evokeByIFrameDelay;
|
|
35
|
+
/**
|
|
36
|
+
* @param fallback
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
private checkIsOpen;
|
|
40
|
+
|
|
41
|
+
private clearTimer;
|
|
42
|
+
}
|
|
43
|
+
export default CallApp;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { CallappConfig, CallappOptions, EvokeAppBy } from './types';
|
|
3
|
+
declare class CallApp {
|
|
4
|
+
config: CallappConfig;
|
|
5
|
+
timer: NodeJS.Timeout | null;
|
|
6
|
+
options: CallappOptions;
|
|
7
|
+
evokeAppBy: EvokeAppBy;
|
|
8
|
+
constructor(config?: CallappConfig);
|
|
9
|
+
private init;
|
|
10
|
+
/**
|
|
11
|
+
* @param options
|
|
12
|
+
*/
|
|
13
|
+
open(options: CallappOptions): void;
|
|
14
|
+
private handleDegradationStrategy;
|
|
15
|
+
|
|
16
|
+
private evokeLink;
|
|
17
|
+
|
|
18
|
+
private evokeScheme;
|
|
19
|
+
|
|
20
|
+
private handleIntent;
|
|
21
|
+
|
|
22
|
+
private handleOriginalChrome;
|
|
23
|
+
/**
|
|
24
|
+
* @param evokeFn
|
|
25
|
+
* @param delay
|
|
26
|
+
* @param fallback
|
|
27
|
+
* @param degradationStrategy
|
|
28
|
+
*/
|
|
29
|
+
private evokeAppDelay;
|
|
30
|
+
private evokeByLocationDelay;
|
|
31
|
+
private evokeByTagADelay;
|
|
32
|
+
private evokeByIFrameDelay;
|
|
33
|
+
/**
|
|
34
|
+
* @param fallback
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
private checkIsOpen;
|
|
38
|
+
|
|
39
|
+
private clearTimer;
|
|
40
|
+
}
|
|
41
|
+
export default CallApp;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import CallApp from './main';
|
|
2
|
+
import type { OpenWalletConfig, OpenWalletOptions } from './types';
|
|
3
|
+
import type { WalletType } from './utils/config';
|
|
4
|
+
declare class OpenWallet extends CallApp {
|
|
5
|
+
constructor(config?: OpenWalletConfig);
|
|
6
|
+
/**
|
|
7
|
+
* @param options
|
|
8
|
+
*/
|
|
9
|
+
openWallet(options: OpenWalletOptions): void;
|
|
10
|
+
/**
|
|
11
|
+
* @param options
|
|
12
|
+
*/
|
|
13
|
+
openAppStore(walletName: WalletType): void;
|
|
14
|
+
}
|
|
15
|
+
export default OpenWallet;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface EvokeAppBy {
|
|
2
|
+
url: string;
|
|
3
|
+
type: 'Scheme' | 'Link' | 'Intent';
|
|
4
|
+
}
|
|
5
|
+
export type SuccessCb = (evokeAppBy?: EvokeAppBy) => void;
|
|
6
|
+
export interface CallappConfig {
|
|
7
|
+
fallback?: () => void;
|
|
8
|
+
delay?: number;
|
|
9
|
+
fallbackUrl?: string;
|
|
10
|
+
successCb?: SuccessCb;
|
|
11
|
+
resultJudgmentTime?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface CallappOptions
|
|
14
|
+
extends Omit<CallappConfig, 'successCb' | 'resultJudgmentTime'> {
|
|
15
|
+
scheme?: string;
|
|
16
|
+
intent?: {
|
|
17
|
+
package?: string;
|
|
18
|
+
scheme: string;
|
|
19
|
+
fallbackUrl?: string;
|
|
20
|
+
};
|
|
21
|
+
link?: string;
|
|
22
|
+
params?: Record<string, any>;
|
|
23
|
+
}
|
|
24
|
+
export type Hidden =
|
|
25
|
+
| 'hidden'
|
|
26
|
+
| 'webkitHidden'
|
|
27
|
+
| 'msHidden'
|
|
28
|
+
| 'mozHidden'
|
|
29
|
+
| undefined;
|
|
30
|
+
export type VisibilityChange =
|
|
31
|
+
| 'visibilitychange'
|
|
32
|
+
| 'webkitvisibilitychange'
|
|
33
|
+
| 'msvisibilitychange'
|
|
34
|
+
| 'mozvisibilitychange'
|
|
35
|
+
| undefined;
|
|
36
|
+
export interface EvokeAppResultOptions {
|
|
37
|
+
evokeAppBy: EvokeAppBy;
|
|
38
|
+
successCb?: SuccessCb;
|
|
39
|
+
timeout?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface OpenWalletConfig extends CallappConfig {
|
|
42
|
+
walletName: string;
|
|
43
|
+
}
|
|
44
|
+
export interface OpenWalletOptions extends CallappOptions {
|
|
45
|
+
walletName: string;
|
|
46
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare enum WalletType {
|
|
2
|
+
TnGD = 'TNG',
|
|
3
|
+
KKP = 'KAKAOPAY',
|
|
4
|
+
TMN = 'TRUEMONEY',
|
|
5
|
+
DANA = 'DANA',
|
|
6
|
+
GCash = 'GCASH',
|
|
7
|
+
AlipayHK = 'ALIPAY_HK',
|
|
8
|
+
}
|
|
9
|
+
export declare const AndroidWalletPackageName: {
|
|
10
|
+
TNG: string;
|
|
11
|
+
KAKAOPAY: string;
|
|
12
|
+
TRUEMONEY: string;
|
|
13
|
+
DANA: string;
|
|
14
|
+
GCASH: string;
|
|
15
|
+
ALIPAY_HK: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const IOSWalletAppId: {
|
|
18
|
+
TNG: string;
|
|
19
|
+
KAKAOPAY: string;
|
|
20
|
+
TRUEMONEY: string;
|
|
21
|
+
DANA: string;
|
|
22
|
+
GCASH: string;
|
|
23
|
+
ALIPAY_HK: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EvokeAppResultOptions } from '../types';
|
|
2
|
+
export declare function checkCallAppSuccess(
|
|
3
|
+
fallback?: () => void,
|
|
4
|
+
timeout?: number,
|
|
5
|
+
): void;
|
|
6
|
+
/**
|
|
7
|
+
* Listening page
|
|
8
|
+
*/
|
|
9
|
+
export declare function addEventListener(options: EvokeAppResultOptions): void;
|
|
10
|
+
/**
|
|
11
|
+
* Determine whether the URL is an http or application market link
|
|
12
|
+
* @param {[type]} url
|
|
13
|
+
* @return {Boolean} [description]
|
|
14
|
+
*/
|
|
15
|
+
export declare function checkIsHttpUrl(url: string): boolean;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
interface LogPayload {
|
|
2
|
+
title?: string;
|
|
3
|
+
msg?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
time?: number;
|
|
7
|
+
success?: boolean;
|
|
8
|
+
code?: string;
|
|
9
|
+
traceId?: string;
|
|
10
|
+
}
|
|
11
|
+
type Extra = Record<string, any>;
|
|
12
|
+
export interface LogMetaData {
|
|
13
|
+
platform?: string;
|
|
14
|
+
sdkVersion?: string;
|
|
15
|
+
webAppVersion?: string;
|
|
16
|
+
firstLogTime?: number;
|
|
17
|
+
fsDuration?: number;
|
|
18
|
+
instanceId?: string;
|
|
19
|
+
deviceId?: string;
|
|
20
|
+
renderDisplayType?: string;
|
|
21
|
+
merchantId?: string;
|
|
22
|
+
productScene?: string;
|
|
23
|
+
productSceneVersion?: string;
|
|
24
|
+
paymentMethodType?: string;
|
|
25
|
+
paymentMethodCategoryType?: string;
|
|
26
|
+
requestSeq?: string;
|
|
27
|
+
trackId?: string;
|
|
28
|
+
}
|
|
29
|
+
interface Config {
|
|
30
|
+
scriptUrl: string;
|
|
31
|
+
spmConfig: object;
|
|
32
|
+
appId: string;
|
|
33
|
+
server?: string;
|
|
34
|
+
bizType: string;
|
|
35
|
+
batchCount: number;
|
|
36
|
+
productId: string;
|
|
37
|
+
mdata?: LogMetaData;
|
|
38
|
+
version?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare class Logger {
|
|
41
|
+
private logs;
|
|
42
|
+
private config;
|
|
43
|
+
private debug;
|
|
44
|
+
private componentStartTime;
|
|
45
|
+
private isLoaded;
|
|
46
|
+
private static instance;
|
|
47
|
+
private trackId;
|
|
48
|
+
constructor(config: Config, debug: boolean);
|
|
49
|
+
static setInstance(instance: Logger): Logger;
|
|
50
|
+
static getInstance(): Logger;
|
|
51
|
+
setMedta(mdata: LogMetaData): void;
|
|
52
|
+
logError(error: LogPayload, extra?: Extra, enableExtractCompliance?: boolean): Logger;
|
|
53
|
+
logInfo(info: LogPayload, extra?: Extra): Logger;
|
|
54
|
+
reportRPC(rpcData: LogPayload, extra?: Extra): Logger;
|
|
55
|
+
reportLogs(): void;
|
|
56
|
+
loadScript(url: string, callback: () => void): void;
|
|
57
|
+
initTracker(): void;
|
|
58
|
+
send(): void;
|
|
59
|
+
setComponentStartTime(val: number): void;
|
|
60
|
+
setTrackId(trackId: string): void;
|
|
61
|
+
getComponentStartTime(): number;
|
|
62
|
+
}
|
|
63
|
+
export declare const LogConfig: Config;
|
|
64
|
+
export {};
|
package/esm/util/logger.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isLocalMock: () => boolean;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IsecurityConfig, ProductSceneEnum, DeviceIdParameter } from '../types';
|
|
2
|
+
export declare const getSecurityConfigStorageKey: (scene: ProductSceneEnum) => string;
|
|
3
|
+
export declare enum SecurityRegionEnum {
|
|
4
|
+
SG = "SG",
|
|
5
|
+
US = "US",
|
|
6
|
+
DE = "DE"
|
|
7
|
+
}
|
|
8
|
+
export declare const securityHost: {
|
|
9
|
+
SG: string;
|
|
10
|
+
US: string;
|
|
11
|
+
DE: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const sceneMap: {
|
|
14
|
+
CASHIER_PAYMENT: string;
|
|
15
|
+
AUTO_DEBIT: string;
|
|
16
|
+
AUTO_DEBIT_PAY: string;
|
|
17
|
+
VAULTING: string;
|
|
18
|
+
CARD_APPLE_PAY: string;
|
|
19
|
+
EASYPAY: string;
|
|
20
|
+
EASY_PAY: string;
|
|
21
|
+
FLASH_BUY: string;
|
|
22
|
+
ELEMENT_PAYMENT: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const getSecurityHost: (region: string) => string;
|
|
25
|
+
export declare const getSecurityScene: (product: string) => string;
|
|
26
|
+
export declare class Security {
|
|
27
|
+
scene: string;
|
|
28
|
+
h5gateway: string;
|
|
29
|
+
constructor(options: IsecurityConfig);
|
|
30
|
+
initSecurity(successCallback: any, failCallback: any): void;
|
|
31
|
+
private initToken;
|
|
32
|
+
pollingGetApdidToken(config?: DeviceIdParameter): Promise<string>;
|
|
33
|
+
getApdidToken(): Promise<string>;
|
|
34
|
+
}
|