@alipay/ams-checkout 0.0.1788166152-dev.7 → 0.0.1788166152-dev.8
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/ams-checkout.js +3 -3
- package/dist/ams-checkout.min.js +1 -1
- package/dist/ams-checkout.min.js.map +1 -1
- package/esm/config/index.js +1 -1
- package/esm/core/component/element/modernElementController/index.js +2 -2
- package/esm/modern/component/channel.d.ts +21 -0
- package/esm/modern/component/component.inline.style.d.ts +10 -0
- package/esm/modern/component/component.popup.style.d.ts +26 -0
- package/esm/modern/component/popupWindow.style.d.ts +27 -0
- package/esm/modern/config/index.d.ts +23 -0
- package/esm/modern/config/request.d.ts +21 -0
- package/esm/modern/constant/auto-debit.d.ts +12 -0
- package/esm/modern/constant/easysafepay.d.ts +16 -0
- package/esm/modern/constant/element.d.ts +27 -0
- package/esm/modern/constant/index.d.ts +331 -0
- package/esm/modern/core/bus/ability/callback.d.ts +9 -0
- package/esm/modern/core/bus/ability/security.d.ts +10 -0
- package/esm/modern/core/bus/ability/tracker.d.ts +9 -0
- package/esm/modern/core/bus/index.d.ts +125 -0
- package/esm/modern/core/bus/interface.d.ts +36 -0
- package/esm/modern/core/component/address.d.ts +8 -0
- package/esm/modern/core/component/appPreloadProcessing.d.ts +1 -0
- package/esm/modern/core/component/ckp/index.d.ts +29 -0
- package/esm/modern/core/component/element/EventCenter/index.d.ts +41 -0
- package/esm/modern/core/component/element/config.d.ts +10 -0
- package/esm/modern/core/component/element/elementContainerService/containerService.d.ts +34 -0
- package/esm/modern/core/component/element/elementContainerService/index.d.ts +20 -0
- package/esm/modern/core/component/element/elementController/index.d.ts +54 -0
- package/esm/modern/core/component/element/elementProcessor/addressProcessor.d.ts +20 -0
- package/esm/modern/core/component/element/elementProcessor/authProcessor.d.ts +20 -0
- package/esm/modern/core/component/element/elementProcessor/baseElementProcessor.d.ts +42 -0
- package/esm/modern/core/component/element/elementProcessor/convertPaymentMethods.d.ts +22 -0
- package/esm/modern/core/component/element/elementProcessor/paymentProcessor.d.ts +37 -0
- package/esm/modern/core/component/element/index.d.ts +17 -0
- package/esm/modern/core/component/element/mock.d.ts +10 -0
- package/esm/modern/core/component/element/modernElementController/adapter.d.ts +19 -0
- package/esm/modern/core/component/element/modernElementController/index.d.ts +172 -0
- package/esm/modern/core/component/element/type.d.ts +586 -0
- package/esm/modern/core/component/element/util.d.ts +93 -0
- package/esm/modern/core/component/index.d.ts +58 -0
- package/esm/modern/core/instance/index.d.ts +97 -0
- package/esm/modern/core/utils/connectConfig.d.ts +11 -0
- package/esm/modern/foundation/core/index.d.ts +36 -0
- package/esm/modern/foundation/index.d.ts +93 -0
- package/esm/modern/foundation/product-processor/autoDebit/deps.d.ts +14 -0
- package/esm/modern/foundation/product-processor/autoDebit/index.d.ts +48 -0
- package/esm/modern/foundation/product-processor/easysafepay/deps.d.ts +20 -0
- package/esm/modern/foundation/product-processor/easysafepay/index.d.ts +29 -0
- package/esm/modern/foundation/product-processor/element/index.d.ts +7 -0
- package/esm/modern/foundation/service/api-bus/ability/globalData.d.ts +10 -0
- package/esm/modern/foundation/service/api-bus/ability/request.d.ts +10 -0
- package/esm/modern/foundation/service/api-bus/ability/security.d.ts +12 -0
- package/esm/modern/foundation/service/api-bus/ability/tracker.d.ts +9 -0
- package/esm/modern/foundation/service/api-bus/busManager.d.ts +127 -0
- package/esm/modern/foundation/service/api-bus/index.d.ts +20 -0
- package/esm/modern/foundation/service/api-bus/interface.d.ts +48 -0
- package/esm/modern/foundation/service/container/index.d.ts +42 -0
- package/esm/modern/foundation/service/container/popup.d.ts +31 -0
- package/esm/modern/foundation/service/container/utils.d.ts +7 -0
- package/esm/modern/foundation/service/event-center.d.ts +82 -0
- package/esm/modern/foundation/service/global-data/index.d.ts +11 -0
- package/esm/modern/foundation/service/index.d.ts +19 -0
- package/esm/modern/foundation/service/log/index.d.ts +44 -0
- package/esm/modern/foundation/service/log/keys.d.ts +13 -0
- package/esm/modern/foundation/service/log/processor.d.ts +9 -0
- package/esm/modern/foundation/service/log/types.d.ts +33 -0
- package/esm/modern/foundation/service/requester/deps.d.ts +17 -0
- package/esm/modern/foundation/service/requester/requester.d.ts +22 -0
- package/esm/modern/foundation/service/security/index.d.ts +33 -0
- package/esm/modern/foundation/service/security/security.d.ts +54 -0
- package/esm/modern/foundation/utils/gray_scale_utils.d.ts +7 -0
- package/esm/modern/foundation/utils/payment_context_utils.d.ts +13 -0
- package/esm/modern/foundation/utils/payment_product_utils.d.ts +13 -0
- package/esm/modern/foundation/utils/preload_helper.d.ts +24 -0
- package/esm/modern/foundation/utils/redirect_utils.d.ts +11 -0
- package/esm/modern/foundation/utils/system_events.d.ts +4 -0
- package/esm/modern/foundation/utils/web_app_url_utils.d.ts +114 -0
- package/esm/modern/index.js +1 -1
- package/esm/modern/loader/constant.d.ts +36 -0
- package/esm/modern/loader/utils/proxyPerformance.d.ts +20 -0
- package/esm/modern/main.d.ts +54 -0
- package/esm/modern/{index.d.ts → modern/index.d.ts} +1 -1
- package/esm/modern/modern/loadAntomTracker.d.ts +7 -0
- package/esm/modern/modern/preload/antomManifestAdapter.d.ts +11 -0
- package/esm/modern/modern/preload/config.d.ts +10 -0
- package/esm/modern/modern/preload/gatewayPreconnection.d.ts +53 -0
- package/esm/modern/modern/preload/preloadAntomElements.d.ts +9 -0
- package/esm/modern/modern/preload/startAntomPreload.d.ts +2 -0
- package/esm/modern/modern/sdk/applepay-core/ApplePayHostService.d.ts +102 -0
- package/esm/modern/modern/sdk/elements/CVVElement.d.ts +144 -0
- package/esm/modern/modern/sdk/elements/PaymentElement.d.ts +204 -0
- package/esm/modern/modern/sdk/elements/appearanceRules.d.ts +59 -0
- package/esm/modern/modern/sdk/elements/appearanceRulesDefaults.d.ts +2 -0
- package/esm/modern/modern/sdk/eventsMap.d.ts +135 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/PaymentSessionService.d.ts +69 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/definitions.d.ts +5311 -0
- package/esm/modern/modern/sdk/oneapi/iexpfront/preConnection.d.ts +6 -0
- package/esm/modern/modern/sdk/stageName.d.ts +3 -0
- package/esm/modern/modern/sdk/tools/awaitWrap.d.ts +14 -0
- package/esm/modern/modern/sdk/tools/buildPageUrl.d.ts +4 -0
- package/esm/modern/modern/sdk/tools/checkSessionData.d.ts +1 -0
- package/esm/modern/modern/sdk/tools/expressElement/applePay.d.ts +9 -0
- package/esm/modern/modern/sdk/tools/expressElement/applePayHostToken.d.ts +32 -0
- package/esm/modern/modern/sdk/tools/expressElement/types.d.ts +277 -0
- package/esm/modern/modern/sdk/tools/getDevReqConfig.d.ts +2 -0
- package/esm/modern/modern/sdk/tools/getLocaleFromRenderData.d.ts +6 -0
- package/esm/modern/modern/sdk/tools/getMetaData.d.ts +126 -0
- package/esm/modern/modern/sdk/tools/modalMessageMonitor.d.ts +41 -0
- package/esm/modern/modern/sdk/tools/openModal.d.ts +20 -0
- package/esm/modern/modern/sdk/tools/paymentElement/applePayHostToken.d.ts +38 -0
- package/esm/modern/modern/sdk/tools/paymentElement/googlePayHostToken.d.ts +38 -0
- package/esm/modern/modern/sdk/tools/paymentElement/tracker.d.ts +16 -0
- package/esm/modern/modern/sdk/tools/paymentElement/walletHostListeners.d.ts +19 -0
- package/esm/modern/modern/sdk/tools/preloadTracking.d.ts +5 -0
- package/esm/modern/modern/sdk/tools/showToast.d.ts +33 -0
- package/esm/modern/modern/sdk/tools/validatePaymentAmount.d.ts +19 -0
- package/esm/modern/modern/sdk/tracking/elementTracker.d.ts +65 -0
- package/esm/modern/modern/sdk/types.d.ts +310 -0
- package/esm/modern/modern/tools.d.ts +26 -0
- package/esm/modern/plugin/applepay/component.d.ts +50 -0
- package/esm/modern/plugin/applepay/index.d.ts +17 -0
- package/esm/modern/plugin/applepay/interface.d.ts +161 -0
- package/esm/modern/plugin/applepay/service.d.ts +54 -0
- package/esm/modern/plugin/component/cashierApp.d.ts +38 -0
- package/esm/modern/plugin/component/channel.d.ts +73 -0
- package/esm/modern/plugin/component/component.inline.style.d.ts +10 -0
- package/esm/modern/plugin/component/component.popup.style.d.ts +25 -0
- package/esm/modern/plugin/component/index.d.ts +133 -0
- package/esm/modern/plugin/component/popupWindow.style.d.ts +11 -0
- package/esm/modern/plugin/const.d.ts +2 -0
- package/esm/modern/plugin/payment-element/utils.d.ts +2 -0
- package/esm/modern/plugin/paypal/index.d.ts +20 -0
- package/esm/modern/plugin/type.d.ts +34 -0
- package/esm/modern/plugin/utils.d.ts +6 -0
- package/esm/modern/preload/antomManifestAdapter.d.ts +11 -0
- package/esm/modern/preload/antomManifestAdapter.js +117 -0
- package/esm/modern/preload/config.d.ts +10 -0
- package/esm/modern/preload/config.js +37 -0
- package/esm/modern/preload/gatewayPreconnection.d.ts +53 -0
- package/esm/modern/preload/gatewayPreconnection.js +213 -0
- package/esm/modern/preload/preloadAntomElements.d.ts +9 -0
- package/esm/modern/preload/preloadAntomElements.js +95 -0
- package/esm/modern/preload/startAntomPreload.d.ts +2 -0
- package/esm/modern/preload/startAntomPreload.js +9 -0
- package/esm/modern/request/index.d.ts +9 -0
- package/esm/modern/request/utils.d.ts +28 -0
- package/esm/modern/service/index.d.ts +13 -0
- package/esm/modern/tools.js +1 -1
- package/esm/modern/types/index.d.ts +856 -0
- package/esm/modern/util/beforeConfirm.d.ts +14 -0
- package/esm/modern/util/createIframeNode.d.ts +6 -0
- package/esm/modern/util/debug.d.ts +1 -0
- package/esm/modern/util/get.d.ts +25 -0
- package/esm/modern/util/getBackScheme.d.ts +5 -0
- package/esm/modern/util/index.d.ts +61 -0
- package/esm/modern/util/jshield-apdid/apdid-loader.d.ts +89 -0
- package/esm/modern/util/jshield-apdid/index.d.ts +21 -0
- package/esm/modern/util/logger.d.ts +67 -0
- package/esm/modern/util/mock.d.ts +1 -0
- package/esm/modern/util/redirect.d.ts +6 -0
- package/esm/modern/util/security-registry.d.ts +72 -0
- package/esm/modern/util/security.d.ts +55 -0
- package/esm/modern/util/spm-map.d.ts +217 -0
- package/esm/modern/util/storage.d.ts +2 -0
- package/esm/modern/util/timezone.d.ts +1 -0
- package/esm/modern/util/upgrade.d.ts +39 -0
- package/esm/modern/util/versionCompare.d.ts +15 -0
- package/esm/util/logger.js +1 -1
- package/package.json +2 -1
- package/types.d.ts +17 -2
- package/types.untrimmed.d.ts +35 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import ComponentApp from '../../plugin/component';
|
|
2
|
+
import { ComponentSignEnum, EventPayloadContext, IappendIframeNodesParams, IcreateComponent, IoptionsParams, IPaymentSessionMetaData, Iselector, Isubmit, PaymentMethodTypeEnum, SubPaymentMethodTypeEnum, ValidationResult } from '../../types';
|
|
3
|
+
import CoreInstance from '../instance/index';
|
|
4
|
+
export declare const getComponentSign: (params: IPaymentSessionMetaData) => ComponentSignEnum;
|
|
5
|
+
export declare const parseSessionData: (sessionData: string) => [IPaymentSessionMetaData, string];
|
|
6
|
+
export declare const handleParams: (params: IcreateComponent, _this: any) => Promise<{
|
|
7
|
+
iframeNodesParams: IappendIframeNodesParams;
|
|
8
|
+
componentSign: ComponentSignEnum.EASY_PAY_WALLET | ComponentSignEnum.EASY_PAY_APM | ComponentSignEnum.CASHIER_PAYMENT_CARD | ComponentSignEnum.CASHIER_PAYMENT_BANK | ComponentSignEnum.CASHIER_PAYMENT_APM | ComponentSignEnum.AUTO_DEBIT_WALLET | ComponentSignEnum.AUTO_DEBIT_PAY_WALLET | ComponentSignEnum.VAULTING_CARD | ComponentSignEnum.CHECKOUT_PAYMENT | ComponentSignEnum.ELEMENT_PAYMENT | ComponentSignEnum.ELEMENT_ADDRESS | ComponentSignEnum.AUTO_DEBIT_APM;
|
|
9
|
+
}>;
|
|
10
|
+
export type IAMSComponentOptions = IoptionsParams & {
|
|
11
|
+
appVersion: string;
|
|
12
|
+
};
|
|
13
|
+
export declare class AMSComponent extends CoreInstance {
|
|
14
|
+
_componentApp: ComponentApp;
|
|
15
|
+
channelType: ComponentSignEnum[];
|
|
16
|
+
productSceneVersion: string;
|
|
17
|
+
timer: any;
|
|
18
|
+
private _validateResolveMap;
|
|
19
|
+
constructor(options: IAMSComponentOptions);
|
|
20
|
+
private parameterInitAndCheck;
|
|
21
|
+
private pluginAppendIframe;
|
|
22
|
+
private savePreviousChannel;
|
|
23
|
+
/**
|
|
24
|
+
* 初始化 Bus总线的能力
|
|
25
|
+
*/
|
|
26
|
+
private registerBusAbility;
|
|
27
|
+
/**
|
|
28
|
+
* To determine whether the corresponding payment method is available,
|
|
29
|
+
* only the channel described in the document will be called, and it will be returned as available by default
|
|
30
|
+
* @param paymentMethod - described in the document
|
|
31
|
+
* @param subPaymentMethod - described in the document
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
canMakePayments(paymentMethod: PaymentMethodTypeEnum, subPaymentMethod?: SubPaymentMethodTypeEnum): Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* @description Create component application
|
|
37
|
+
* @param params - The data source created by the component, necessary sessionData, optional appearance configuration, and refer to the documentation for other parameters and detailed information.
|
|
38
|
+
*/
|
|
39
|
+
createComponent(params: IcreateComponent): Promise<void>;
|
|
40
|
+
private createComponentProcess;
|
|
41
|
+
preloadComponent(channelType: any, productSceneVersion: any): void;
|
|
42
|
+
private clearPreloadIframe;
|
|
43
|
+
/**
|
|
44
|
+
* @description Create and render components in the specified element area
|
|
45
|
+
* @param params - The data source created by the component, necessary sessionData, optional appearance configurations, and refer to the documentation for other parameters and detailed information.
|
|
46
|
+
* @param selector - Necessary element selector ID
|
|
47
|
+
*/
|
|
48
|
+
mountComponent(params: IcreateComponent, selector: Iselector): Promise<void>;
|
|
49
|
+
private mountComponentProcess;
|
|
50
|
+
/**
|
|
51
|
+
* @description Execute payment submission process
|
|
52
|
+
* @description - When using your own payment button, you can execute the submit payment process by actively calling this function.
|
|
53
|
+
* @param data - Transfer information in the submission interface according to your requirements (optional)
|
|
54
|
+
*/
|
|
55
|
+
submit(data?: Isubmit): Promise<unknown>;
|
|
56
|
+
protected _validateFields(): Promise<ValidationResult>;
|
|
57
|
+
protected _sendMessageToAPP(eventContext: EventPayloadContext): void;
|
|
58
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* 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:
|
|
5
|
+
* 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
|
|
6
|
+
* 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.
|
|
7
|
+
*/
|
|
8
|
+
import { ComponentActionNamesType } from '../../plugin/type';
|
|
9
|
+
import ComponentApp from '../../plugin/component';
|
|
10
|
+
import type { AMSCheckoutOptions, IAppendParams, InitSecurityConfig, IoptionsParams } from '../../types/index';
|
|
11
|
+
import { EventCenter } from '../../util/index';
|
|
12
|
+
import { Logger } from '../../util/logger';
|
|
13
|
+
import { Security } from '../../util/security';
|
|
14
|
+
import type { ISecurity } from '../../util/security-registry';
|
|
15
|
+
export default class AMSSDK {
|
|
16
|
+
options: AMSCheckoutOptions;
|
|
17
|
+
originOptions: IoptionsParams;
|
|
18
|
+
logger: Logger;
|
|
19
|
+
_eventCenter: EventCenter;
|
|
20
|
+
_instanceId: string;
|
|
21
|
+
_storageId: string;
|
|
22
|
+
_appendParams: IAppendParams;
|
|
23
|
+
_componentApp: ComponentApp;
|
|
24
|
+
protected securitySdkMap: Map<string, Security>;
|
|
25
|
+
protected plugins: Map<string, any>;
|
|
26
|
+
constructor(options: IoptionsParams);
|
|
27
|
+
private preInitSecurity;
|
|
28
|
+
/**
|
|
29
|
+
* @description Destroy and process some contents of the plug-in
|
|
30
|
+
*/
|
|
31
|
+
unmount(): void;
|
|
32
|
+
/**
|
|
33
|
+
* @description init security SDK
|
|
34
|
+
* @param product Product Scenarios
|
|
35
|
+
* @param scene Scenario of the product (compatible with old version parameters, about to be deleted)
|
|
36
|
+
*/
|
|
37
|
+
initSecurity({ product, scene, }: InitSecurityConfig & {
|
|
38
|
+
scene?: string;
|
|
39
|
+
}): void;
|
|
40
|
+
/**
|
|
41
|
+
* @description Obtain security SDK through scenario identification (async-aware)
|
|
42
|
+
* Handles three states: ready, loading, not found
|
|
43
|
+
*/
|
|
44
|
+
_getSecuritySDKByProductScene(securityConfig: InitSecurityConfig): ISecurity;
|
|
45
|
+
/**
|
|
46
|
+
* @description Await security SDK by product scene (async)
|
|
47
|
+
* Returns the Security instance even if currently loading
|
|
48
|
+
*/
|
|
49
|
+
_awaitSecuritySDKByProductScene(securityConfig: InitSecurityConfig): Promise<Security | undefined>;
|
|
50
|
+
/**
|
|
51
|
+
* @description New security SDK through scenario identification (async-aware)
|
|
52
|
+
* Uses shared SecuritySdkRegistry and triggers ApdidLoader
|
|
53
|
+
*/
|
|
54
|
+
_newSecuritySDKByScene(securityConfig: InitSecurityConfig, successCallback?: () => void, failCallback?: (errMsg?: string) => void): void;
|
|
55
|
+
/**
|
|
56
|
+
* @description Obtain risk control configuration in local storage
|
|
57
|
+
*/
|
|
58
|
+
private getSecurityConfigStorage;
|
|
59
|
+
/**
|
|
60
|
+
* @description Set the sdk basic configuration
|
|
61
|
+
*/
|
|
62
|
+
private _setOptions;
|
|
63
|
+
/**
|
|
64
|
+
* @description Set environment variables
|
|
65
|
+
*/
|
|
66
|
+
private _setEnv;
|
|
67
|
+
/**
|
|
68
|
+
* @description Set UI and Network Mode
|
|
69
|
+
*/
|
|
70
|
+
private _setMode;
|
|
71
|
+
/**
|
|
72
|
+
* @description Initialize event related tasks
|
|
73
|
+
*/
|
|
74
|
+
private _initEvent;
|
|
75
|
+
/**
|
|
76
|
+
* @description Register plug-in
|
|
77
|
+
*/
|
|
78
|
+
protected _registerPlugin(pluginId: string, plugin: any): void;
|
|
79
|
+
/**
|
|
80
|
+
* @description Get Plug-in
|
|
81
|
+
*/
|
|
82
|
+
protected _getPlugin(pluginId: string): any;
|
|
83
|
+
/**
|
|
84
|
+
* @description Execute to open app or jump link
|
|
85
|
+
*/
|
|
86
|
+
_redirect(data: {
|
|
87
|
+
normalUrl?: string;
|
|
88
|
+
schemeUrl?: string;
|
|
89
|
+
applinkUrl?: string;
|
|
90
|
+
callAppJudgeTime?: number;
|
|
91
|
+
}): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* @description Overlay Subscription
|
|
94
|
+
*/
|
|
95
|
+
protected _overrideSubscription(name: string, func: any, funcKey: string): void;
|
|
96
|
+
protected getBusActionNames(): ComponentActionNamesType;
|
|
97
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines whether to query oneAccount API based on connect mode and merchant flag.
|
|
3
|
+
*
|
|
4
|
+
* In simpler connect mode (when onlyIntegrateCardElementConnectMerchantFlag is 'true'),
|
|
5
|
+
* the oneAccount API call should be skipped to avoid unnecessary network requests.
|
|
6
|
+
*
|
|
7
|
+
* @param isConnect - Whether connect mode is enabled
|
|
8
|
+
* @param extendInfo - JSON string containing merchant configuration flags
|
|
9
|
+
* @returns true if oneAccount API should be queried, false otherwise
|
|
10
|
+
*/
|
|
11
|
+
export declare function shouldQueryOneAccount(isConnect: boolean, extendInfo?: string): boolean;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IoptionsParams, ProductSceneEnum } from '../../types';
|
|
2
|
+
import { BizFlowStartBehavior, IElementStatus, PaymentContext, ProductProcessor, StartBizFlowOptions } from '../index';
|
|
3
|
+
import { ServiceProvider } from '../service';
|
|
4
|
+
/**
|
|
5
|
+
* @author 谦彧 <zhangmian.zm@alipay.com>
|
|
6
|
+
* @date 2024/9/17
|
|
7
|
+
*/
|
|
8
|
+
export declare class AntomSDKCore {
|
|
9
|
+
private bizFlowStartBehavior;
|
|
10
|
+
private initOptions;
|
|
11
|
+
private paymentContext;
|
|
12
|
+
private instanceId;
|
|
13
|
+
private sdkMetaData;
|
|
14
|
+
private productProcessors;
|
|
15
|
+
private enablePopWindowEventCallback;
|
|
16
|
+
private eventLogging;
|
|
17
|
+
private status;
|
|
18
|
+
private logger;
|
|
19
|
+
constructor();
|
|
20
|
+
getStatus(): IElementStatus;
|
|
21
|
+
setStatus(status: any): void;
|
|
22
|
+
updatePaymentSessionData(paymentSession: string): void;
|
|
23
|
+
registerProcessor(productScene: string, paymentMethod: string, processor: ProductProcessor): void;
|
|
24
|
+
init(options: IoptionsParams, productScene: ProductSceneEnum): void;
|
|
25
|
+
private prepare;
|
|
26
|
+
startBizFlow(options: StartBizFlowOptions): Promise<void>;
|
|
27
|
+
getServiceProvider(): ServiceProvider;
|
|
28
|
+
getBizFlowBehavior(): BizFlowStartBehavior;
|
|
29
|
+
getPaymentContext(): PaymentContext;
|
|
30
|
+
destroy(): void;
|
|
31
|
+
private handleBehaviorRender;
|
|
32
|
+
private handleRemain;
|
|
33
|
+
private handleClose;
|
|
34
|
+
private cleanRender;
|
|
35
|
+
getInstanceId(): string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { DisplayTypeEnum, IMerchantAppointParam, IoptionsParams, IPaymentSessionMetaData, PlatformEnum, ProductSceneEnum, TargetEnum } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* @author 谦彧 <zhangmian.zm@alipay.com>
|
|
4
|
+
* @date 2024/9/17
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Represent one transaction, each transaction has its own instance.
|
|
8
|
+
*/
|
|
9
|
+
export interface PaymentContext {
|
|
10
|
+
initOptions: IoptionsParams;
|
|
11
|
+
startBizFlowOptions: StartBizFlowOptions;
|
|
12
|
+
displayInfo: DisplayInfo;
|
|
13
|
+
paymentSession: string;
|
|
14
|
+
paymentSessionId: string;
|
|
15
|
+
paymentSessionObj: IPaymentSessionMetaData;
|
|
16
|
+
sdkMetaData: SDKMetaData;
|
|
17
|
+
}
|
|
18
|
+
export interface StartBizFlowOptions {
|
|
19
|
+
paymentSession: string;
|
|
20
|
+
displayInfo?: Partial<DisplayInfo>;
|
|
21
|
+
submitPayRequestExtra?: any;
|
|
22
|
+
isAppWebview?: boolean;
|
|
23
|
+
isNativeAppWebview?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare class DisplayInfo {
|
|
26
|
+
type: DisplayTypeEnum;
|
|
27
|
+
platform: PlatformEnum;
|
|
28
|
+
isRetention: boolean;
|
|
29
|
+
selector: string;
|
|
30
|
+
appearance?: Record<string, any>;
|
|
31
|
+
appendAliasContainerId?: boolean;
|
|
32
|
+
merchantAppointParam?: IMerchantAppointParam;
|
|
33
|
+
iframeStyle?: Partial<CSSStyleDeclaration>;
|
|
34
|
+
notRedirectAfterComplete?: boolean;
|
|
35
|
+
constructor();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Provide unique logic for specified product, or specified product and its payment method.
|
|
39
|
+
* Such as: EasySafePay, PayPal in Cashier
|
|
40
|
+
*/
|
|
41
|
+
export interface ProductProcessor {
|
|
42
|
+
init(config: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): any;
|
|
43
|
+
startBizFlow(paymentContext: PaymentContext): Promise<BizFlowStartBehavior>;
|
|
44
|
+
}
|
|
45
|
+
export interface BizFlowStartBehavior {
|
|
46
|
+
behaviorType: 'RENDER' | 'REDIRECT' | 'NONE';
|
|
47
|
+
payload: RenderBehaviorPayload | RedirectBehaviorPayload;
|
|
48
|
+
data?: any;
|
|
49
|
+
}
|
|
50
|
+
export interface RenderBehaviorPayload {
|
|
51
|
+
url: string;
|
|
52
|
+
allowClickPopupOutsideClose?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface RedirectBehaviorPayload {
|
|
55
|
+
url?: string;
|
|
56
|
+
schemeUrl?: string;
|
|
57
|
+
applinkUrl?: string;
|
|
58
|
+
browserLinkTarget?: TargetEnum;
|
|
59
|
+
isCallApp?: boolean;
|
|
60
|
+
callAppDetectSuccessDelay?: number;
|
|
61
|
+
openInApp?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Provide some capability, such as MonitorService, EventBusService, SecurityService
|
|
65
|
+
*/
|
|
66
|
+
export interface Service {
|
|
67
|
+
init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): any;
|
|
68
|
+
update(paymentContext: PaymentContext): any;
|
|
69
|
+
destroy(): any;
|
|
70
|
+
}
|
|
71
|
+
export interface SDKMetaData {
|
|
72
|
+
productScene: ProductSceneEnum;
|
|
73
|
+
sdkVersion: string;
|
|
74
|
+
webAppVersion: string;
|
|
75
|
+
greyscaleId?: number;
|
|
76
|
+
}
|
|
77
|
+
export interface EventLogging {
|
|
78
|
+
enableLogging?: boolean;
|
|
79
|
+
eventName?: string;
|
|
80
|
+
eventAlias?: string;
|
|
81
|
+
userPath?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface InitContext {
|
|
84
|
+
initOptions: IoptionsParams;
|
|
85
|
+
sdkMetaData: SDKMetaData;
|
|
86
|
+
}
|
|
87
|
+
export declare enum IElementStatus {
|
|
88
|
+
UNINIT = "UNINIT",
|
|
89
|
+
INITING = "INITING",
|
|
90
|
+
READY = "READY",
|
|
91
|
+
IN_BIZ_FLOW = "IN_BIZ_FLOW",
|
|
92
|
+
DESTROYED = "DESTROYED"
|
|
93
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type { BizFlowStartBehavior, PaymentContext, ProductProcessor, RedirectBehaviorPayload, RenderBehaviorPayload, SDKMetaData, } from '../..';
|
|
2
|
+
export { v2AppMarmotMap } from '../../../config';
|
|
3
|
+
export { COMPONENT_CONTAINER_ID, COMPONENT_SECTION_ID, ERRORMESSAGE, EVENT, LOADTIME_LIMIT } from '../../../constant';
|
|
4
|
+
export { getComponentSign } from '../../../core/component';
|
|
5
|
+
export { ComponentSignEnum, eventCodeEnum, PlatformEnum } from '../../../types';
|
|
6
|
+
export type { CashierSdkActionQueryRequest, IoptionsParams } from '../../../types';
|
|
7
|
+
export { isPC, isTrue, queryParse } from '../../../util';
|
|
8
|
+
export { isLocalMock } from '../../../util/mock';
|
|
9
|
+
export { EventCenter } from '../..//service/event-center';
|
|
10
|
+
export { ServiceProvider } from '../../service';
|
|
11
|
+
export { LogService } from '../../service/log';
|
|
12
|
+
export { RequesterService } from '../../service/requester/requester';
|
|
13
|
+
export { SecurityService } from '../../service/security';
|
|
14
|
+
export { getWebAppV2Url } from '../../utils/web_app_url_utils';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BizFlowStartBehavior, IoptionsParams, PaymentContext, ProductProcessor, SDKMetaData } from './deps';
|
|
2
|
+
export declare class AutoDebitProcessor implements ProductProcessor {
|
|
3
|
+
private paymentContext?;
|
|
4
|
+
private initConfig;
|
|
5
|
+
private logger;
|
|
6
|
+
private eventCenter;
|
|
7
|
+
private securityService;
|
|
8
|
+
private instanceId;
|
|
9
|
+
private componentSign;
|
|
10
|
+
private hostSign;
|
|
11
|
+
private _performanceData;
|
|
12
|
+
private SECURITY_SDK_INIT_TIMEOUT;
|
|
13
|
+
init(config: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
|
|
14
|
+
startBizFlow(paymentContext: PaymentContext): Promise<BizFlowStartBehavior>;
|
|
15
|
+
private acquireApdidToken;
|
|
16
|
+
/**
|
|
17
|
+
* 获取SDK操作查询请求
|
|
18
|
+
* @returns {Promise<CashierSdkActionQueryRequest | { message?: string; success: boolean }>} 返回SDK操作查询请求或错误信息
|
|
19
|
+
*/
|
|
20
|
+
private getSdkActionQuery;
|
|
21
|
+
/**
|
|
22
|
+
* webLaunchPromise方法用于返回一个Promise对象,用于异步加载Web App
|
|
23
|
+
* @returns {Promise} 返回一个Promise对象
|
|
24
|
+
*/
|
|
25
|
+
private webLaunchPromise;
|
|
26
|
+
private sendRequestAndWaitWebLaunch;
|
|
27
|
+
private buildRedirectResult;
|
|
28
|
+
/**
|
|
29
|
+
* 构建 Web App 的 URL
|
|
30
|
+
* @returns {string} Web App 的 URL
|
|
31
|
+
*/
|
|
32
|
+
private buildWebAppUrl;
|
|
33
|
+
/**
|
|
34
|
+
* 初始化安全SDK
|
|
35
|
+
* @returns {Promise}
|
|
36
|
+
*/
|
|
37
|
+
private initSecuritySDK;
|
|
38
|
+
/**
|
|
39
|
+
* 设置容器宽度
|
|
40
|
+
* 如果是 Trustly 支付方式,并且显示平台为桌面端,则设置组件区块和容器的最大宽度为 656px
|
|
41
|
+
*/
|
|
42
|
+
private setAchAutoDebitContainerWidth;
|
|
43
|
+
/**
|
|
44
|
+
* 判断是否为Trustly支付方式
|
|
45
|
+
* @returns {boolean} true 表示是Trustly支付方式
|
|
46
|
+
*/
|
|
47
|
+
private get isTrustly();
|
|
48
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type { SDKMetaData } from "../..";
|
|
2
|
+
export { v4 as uuid } from 'uuid';
|
|
3
|
+
export type { BizFlowStartBehavior, PaymentContext, ProductProcessor, RedirectBehaviorPayload, RenderBehaviorPayload, } from '../..';
|
|
4
|
+
export * as ChannelCustomize from '../../../component/channel';
|
|
5
|
+
export type { IChannelBehavior } from '../../../component/channel';
|
|
6
|
+
export { DisplayTypeEnum, PaymentMethodCategoryTypeEnum, ProductSceneEnum, RiskSdkInfoEnum } from '../../../types';
|
|
7
|
+
export type { CashierSdkActionQueryRequest, CashierSdkActionQueryResult, CashierSdkActionQuerySessionResult, CashierSubmitPayRequest, CashierSubmitPayResult, IoptionsParams, } from '../../../types';
|
|
8
|
+
export { isPC } from '../../../util';
|
|
9
|
+
export { getBackScheme } from '../../utils/redirect_utils';
|
|
10
|
+
export { isLocalMock } from '../../../util/mock';
|
|
11
|
+
export { ServiceProvider } from '../../service';
|
|
12
|
+
export type { ContainerService } from '../../service/container';
|
|
13
|
+
export type { EventCenter } from '../../service/event-center';
|
|
14
|
+
export { LogService } from '../../service/log';
|
|
15
|
+
export type { RequesterService } from '../../service/requester/requester';
|
|
16
|
+
export type { SecurityService } from '../../service/security';
|
|
17
|
+
export { ProductInfoCacheUtil } from '../../utils/payment_product_utils';
|
|
18
|
+
export * as WebAppUrlUtil from '../../utils/web_app_url_utils';
|
|
19
|
+
export { eventCodeEnum } from '../../../types';
|
|
20
|
+
export { EVENT } from '../../../constant';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BizFlowStartBehavior, IoptionsParams, PaymentContext, ProductProcessor, SDKMetaData } from './deps';
|
|
2
|
+
export declare class EasySafePayProcessor implements ProductProcessor {
|
|
3
|
+
private paymentContext?;
|
|
4
|
+
private initConfig;
|
|
5
|
+
private logger;
|
|
6
|
+
private securityService;
|
|
7
|
+
private eventCenter;
|
|
8
|
+
private instanceId;
|
|
9
|
+
private hostSign;
|
|
10
|
+
private allowQueryCall;
|
|
11
|
+
private allowSubmitPayCallAhead;
|
|
12
|
+
private channelBehavior?;
|
|
13
|
+
private SECURITY_SDK_INIT_TIMEOUT;
|
|
14
|
+
private SDK_REQUEST_TIMEOUT;
|
|
15
|
+
private LOAD_APP_RESOURCES_TIMEOUT;
|
|
16
|
+
init(config: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
|
|
17
|
+
startBizFlow(paymentContext: PaymentContext): Promise<BizFlowStartBehavior>;
|
|
18
|
+
private buildWebAppUrl;
|
|
19
|
+
private buildRedirectResult;
|
|
20
|
+
/**
|
|
21
|
+
* 等待Web应用启动,然后发送renderComponent事件
|
|
22
|
+
* start waiting web launch, then send renderComponent event
|
|
23
|
+
* */
|
|
24
|
+
private sendRequestAndWaitWebLaunch;
|
|
25
|
+
private processQuery;
|
|
26
|
+
private processSubmitPay;
|
|
27
|
+
private acquireApdidToken;
|
|
28
|
+
private initSecuritySDK;
|
|
29
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BizFlowStartBehavior, ProductProcessor } from "../..";
|
|
2
|
+
declare class ElementProcessor implements ProductProcessor {
|
|
3
|
+
constructor();
|
|
4
|
+
init(config: any, instanceId: string): any;
|
|
5
|
+
startBizFlow(): Promise<BizFlowStartBehavior>;
|
|
6
|
+
}
|
|
7
|
+
export { ElementProcessor };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BusContext, BusMessage, BusSubscriber } from '../../../../foundation/service/api-bus/busManager';
|
|
2
|
+
export declare class DataBusSubscriber extends BusSubscriber {
|
|
3
|
+
private instanceId;
|
|
4
|
+
constructor(instanceId: string);
|
|
5
|
+
actionNames(): string[];
|
|
6
|
+
protected getGlobalData(context: BusContext, message: BusMessage): void;
|
|
7
|
+
protected setGlobalData(context: BusContext, message: BusMessage): void;
|
|
8
|
+
protected clearGlobalData(context: BusContext, message: BusMessage): void;
|
|
9
|
+
onMessage(context: BusContext, message: BusMessage): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BusContext, BusMessage, BusSubscriber } from "../../../../foundation/service/api-bus/busManager";
|
|
2
|
+
export declare class RequestBusSubscriber extends BusSubscriber {
|
|
3
|
+
private instanceId;
|
|
4
|
+
constructor(instanceId: string);
|
|
5
|
+
actionNames(): string[];
|
|
6
|
+
protected request(context: BusContext, message: BusMessage): Promise<void>;
|
|
7
|
+
protected getEnvInfo(context: BusContext, message: BusMessage): Promise<void>;
|
|
8
|
+
protected getUserAgent(context: BusContext, message: BusMessage): void;
|
|
9
|
+
onMessage(context: BusContext, message: BusMessage): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeviceIdParameter } from "../../../../types";
|
|
2
|
+
import { BusContext, BusMessage, BusSubscriber } from '../busManager';
|
|
3
|
+
export type onDeviceIdCallback = (deviceIdParameter?: DeviceIdParameter, isPolling?: boolean) => Promise<string>;
|
|
4
|
+
export declare class SecurityBusSubscriber extends BusSubscriber {
|
|
5
|
+
private instanceId;
|
|
6
|
+
constructor(instanceId: string);
|
|
7
|
+
actionNames(): string[];
|
|
8
|
+
protected preInitSecurity(context: BusContext, message: BusMessage): Promise<void>;
|
|
9
|
+
protected initSecurity(context: BusContext, message: BusMessage): Promise<void>;
|
|
10
|
+
protected getSecurityDeviceId(context: BusContext, message: BusMessage): Promise<void>;
|
|
11
|
+
onMessage(context: BusContext, message: BusMessage): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BusContext, BusMessage, BusSubscriber } from '../busManager';
|
|
2
|
+
export declare class TrackerBusSubscriber extends BusSubscriber {
|
|
3
|
+
private instanceId;
|
|
4
|
+
private logger;
|
|
5
|
+
constructor(instanceId: string);
|
|
6
|
+
actionNames(): string[];
|
|
7
|
+
protected reportAnalytics(context: BusContext, message: BusMessage): Promise<void>;
|
|
8
|
+
onMessage(context: BusContext, message: BusMessage): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bus 埋点内容定义
|
|
3
|
+
*/
|
|
4
|
+
export declare enum BusLogEventEnum {
|
|
5
|
+
/**
|
|
6
|
+
* 发送消息
|
|
7
|
+
* action:string
|
|
8
|
+
*/
|
|
9
|
+
sdk_event_busPublishMessage = "sdk_event_busPublishMessage",
|
|
10
|
+
/**
|
|
11
|
+
* 发送消息时,返回事件结果(Web)
|
|
12
|
+
* action:string
|
|
13
|
+
*/
|
|
14
|
+
sdk_event_busPublishCallback = "sdk_event_busPublishCallback",
|
|
15
|
+
/**
|
|
16
|
+
* 查询是否订阅
|
|
17
|
+
* action:string
|
|
18
|
+
* sub (processResult): bool
|
|
19
|
+
*/
|
|
20
|
+
sdk_event_busIsSubscribe = "sdk_event_busIsSubscribe",
|
|
21
|
+
/**
|
|
22
|
+
* 订阅协议
|
|
23
|
+
* actions (actionNames): string[] , 用逗号拼接
|
|
24
|
+
*/
|
|
25
|
+
sdk_event_busSubscribe = "sdk_event_busSubscribe",
|
|
26
|
+
/**
|
|
27
|
+
* 退订协议
|
|
28
|
+
* actions (actionNames): string[] , 用逗号拼接
|
|
29
|
+
*/
|
|
30
|
+
sdk_event_busUnsubscribe = "sdk_event_busUnsubscribe",
|
|
31
|
+
/**
|
|
32
|
+
* 清除缓存(Web/Android)
|
|
33
|
+
*/
|
|
34
|
+
sdk_event_busClear = "sdk_event_busClear",
|
|
35
|
+
/**
|
|
36
|
+
* 添加拦截器(Web/Android)
|
|
37
|
+
*/
|
|
38
|
+
sdk_event_busAddInterceptor = "sdk_event_busAddInterceptor",
|
|
39
|
+
/**
|
|
40
|
+
* 发送消息时,对应aciton未订阅
|
|
41
|
+
*/
|
|
42
|
+
sdk_error_busPublishUnsubscribeError = "sdk_error_busPublishUnsubscribeError",
|
|
43
|
+
/**
|
|
44
|
+
* 发送消息时异常
|
|
45
|
+
*/
|
|
46
|
+
sdk_error_busPublishError = "sdk_error_busPublishError",
|
|
47
|
+
/**
|
|
48
|
+
* 发送消息无结果(Web)
|
|
49
|
+
*/
|
|
50
|
+
sdk_error_busPublishNoResult = "sdk_error_busPublishNoResult"
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 扩展协议可序列化的消息定义
|
|
54
|
+
*/
|
|
55
|
+
export declare class BusMessage {
|
|
56
|
+
private action;
|
|
57
|
+
private data;
|
|
58
|
+
private jsonData;
|
|
59
|
+
constructor(action: string, data?: string);
|
|
60
|
+
getAction(): string;
|
|
61
|
+
getData(): string;
|
|
62
|
+
isJSONData(): boolean;
|
|
63
|
+
getJSONObject(): any;
|
|
64
|
+
private parseJSONData;
|
|
65
|
+
result(result?: any): BusMessage;
|
|
66
|
+
}
|
|
67
|
+
export type OnBusCallback = (message: BusMessage) => void;
|
|
68
|
+
/**
|
|
69
|
+
* 扩展总线可选的Context参数,在Web端用于实时回调
|
|
70
|
+
*/
|
|
71
|
+
export declare class BusContext {
|
|
72
|
+
private callback;
|
|
73
|
+
constructor(callback: OnBusCallback);
|
|
74
|
+
onCallBack(message: BusMessage): void;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 扩展能力的能力定义,基于此协议实现扩展能力
|
|
78
|
+
*/
|
|
79
|
+
export declare abstract class BusSubscriber {
|
|
80
|
+
abstract actionNames(): string[];
|
|
81
|
+
abstract onMessage(context: BusContext, message: BusMessage): void;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 拦截器,可增加扩展性
|
|
85
|
+
*/
|
|
86
|
+
export interface BusInterceptor {
|
|
87
|
+
/**
|
|
88
|
+
* 未订阅场景拦截
|
|
89
|
+
* @param actionName
|
|
90
|
+
*/
|
|
91
|
+
onUnsubscribedAction?(actionName: string): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* 分发消息场景处理异常
|
|
94
|
+
* @param message
|
|
95
|
+
*/
|
|
96
|
+
onPublishException?(message: BusMessage, e: any): void;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 事件总线入口,支持的关系为:
|
|
100
|
+
* 发送者 和 接收者的关系: 一对一,大多数场景,支持callback
|
|
101
|
+
* 发送者 和 接收者的关系: 多对一, 设计上多一对,但是同一时间点,只会一个发送者,支持callback
|
|
102
|
+
* 发送者 和 接收者的关系: 一对多,可能有,埋点多重上报?不需要callback,业务场景应该是一个广播场景
|
|
103
|
+
*/
|
|
104
|
+
export declare class BusManager {
|
|
105
|
+
private static interceptors;
|
|
106
|
+
private static subscribersMap;
|
|
107
|
+
private static TAG;
|
|
108
|
+
private static _logSplit;
|
|
109
|
+
private isDebug;
|
|
110
|
+
private instanceId;
|
|
111
|
+
private logger;
|
|
112
|
+
constructor(instanceId?: string);
|
|
113
|
+
debugTrace(enable: boolean): void;
|
|
114
|
+
private traceLog;
|
|
115
|
+
private traceError;
|
|
116
|
+
private static getInstanceActionName;
|
|
117
|
+
clear(): void;
|
|
118
|
+
addInterceptor(interceptor: BusInterceptor): void;
|
|
119
|
+
publishForResult(message: BusMessage, config?: {
|
|
120
|
+
timeoutMs?: number;
|
|
121
|
+
fallback?: any;
|
|
122
|
+
}): Promise<BusMessage>;
|
|
123
|
+
publish(message: BusMessage, callback?: OnBusCallback): void;
|
|
124
|
+
subscribe(subscriber: BusSubscriber): void;
|
|
125
|
+
unsubscribe(subscriber: BusSubscriber): void;
|
|
126
|
+
isSubscribed(actionName: string): boolean;
|
|
127
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Service } from '../../index';
|
|
2
|
+
import { IoptionsParams } from '../../../types';
|
|
3
|
+
import { LogService } from '../log';
|
|
4
|
+
import { BusMessage, BusSubscriber, OnBusCallback } from './busManager';
|
|
5
|
+
/**
|
|
6
|
+
* @author 谦彧 <zhangmian.zm@alipay.com>
|
|
7
|
+
* @date 2024/9/17
|
|
8
|
+
*/
|
|
9
|
+
export declare class ApiBusManagerService implements Service {
|
|
10
|
+
protected logger: LogService;
|
|
11
|
+
protected instanceId: string;
|
|
12
|
+
private busManager;
|
|
13
|
+
init(initOptions: IoptionsParams, instanceId: string): void;
|
|
14
|
+
subscribe(subscriber: BusSubscriber): void;
|
|
15
|
+
unsubscribe(subscriber: BusSubscriber): void;
|
|
16
|
+
isSubscribed(actionName: string): boolean;
|
|
17
|
+
publish(message: BusMessage, callback?: OnBusCallback): void;
|
|
18
|
+
update(): void;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare enum PaymentActionEnum {
|
|
2
|
+
optional_init = "plugin_optional_init"
|
|
3
|
+
}
|
|
4
|
+
export declare enum ApplePayActionEnum {
|
|
5
|
+
canMakePayments = "plugin_CARD_APPLE_PAY_available",
|
|
6
|
+
createComponent = "plugin_CARD_APPLE_PAY_createComponent",
|
|
7
|
+
destroyComponent = "plugin_CARD_APPLE_PAY_destroyComponent"
|
|
8
|
+
}
|
|
9
|
+
export declare enum PaypalActionEnum {
|
|
10
|
+
mountComponent = "plugin_Paypal_mountComponent",
|
|
11
|
+
destroyComponent = "plugin_Paypal_destroyComponent"
|
|
12
|
+
}
|
|
13
|
+
export declare enum SDKCallbackActionEnum {
|
|
14
|
+
onEventCallback = "onEventCallback"
|
|
15
|
+
}
|
|
16
|
+
export declare enum RequestActiontEnum {
|
|
17
|
+
request = "request",
|
|
18
|
+
getEnvInfo = "getEnvInfo",
|
|
19
|
+
getUserAgent = "getUserAgent"
|
|
20
|
+
}
|
|
21
|
+
export declare enum DataActiontEnum {
|
|
22
|
+
getGlobalData = "getGlobalData",
|
|
23
|
+
setGlobalData = "setGlobalData",
|
|
24
|
+
clearGlobalData = "clearGlobalData"
|
|
25
|
+
}
|
|
26
|
+
export declare enum SecuritySDKActionEnum {
|
|
27
|
+
preInitSecurity = "preInitSecurity",
|
|
28
|
+
initSecurity = "initSecurity",
|
|
29
|
+
getSecurityDeviceId = "getSecurityDeviceId"
|
|
30
|
+
}
|
|
31
|
+
export declare enum TrackerActionEnum {
|
|
32
|
+
/**
|
|
33
|
+
* level: string info/error
|
|
34
|
+
* basic: json object
|
|
35
|
+
* extra: json object
|
|
36
|
+
*/
|
|
37
|
+
reportAnalytics = "reportAnalytics"
|
|
38
|
+
}
|
|
39
|
+
export declare enum ComponentActiontEnum {
|
|
40
|
+
onDestory = "onDestory"
|
|
41
|
+
}
|
|
42
|
+
export declare enum RequestActiontEnum {
|
|
43
|
+
onDestory = "httpRequest"
|
|
44
|
+
}
|
|
45
|
+
export declare enum LoadingActiontEnum {
|
|
46
|
+
showLoading = "showLoading",
|
|
47
|
+
dismissLoading = "dismissLoading"
|
|
48
|
+
}
|