@alipay/ams-checkout 0.0.1763711027-dev.0 → 0.0.1763711027-dev.1

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.
Files changed (126) hide show
  1. package/package.json +1 -1
  2. package/LEGAL.md +0 -6
  3. package/LICENSE +0 -6
  4. package/README.md +0 -49
  5. package/esm/component/channel.d.ts +0 -21
  6. package/esm/component/component.inline.style.d.ts +0 -10
  7. package/esm/component/component.popup.style.d.ts +0 -26
  8. package/esm/component/popupWindow.style.d.ts +0 -24
  9. package/esm/config/index.d.ts +0 -16
  10. package/esm/config/request.d.ts +0 -21
  11. package/esm/constant/auto-debit.d.ts +0 -12
  12. package/esm/constant/easysafepay.d.ts +0 -16
  13. package/esm/constant/element.d.ts +0 -26
  14. package/esm/constant/index.d.ts +0 -344
  15. package/esm/core/bus/ability/callback.d.ts +0 -9
  16. package/esm/core/bus/ability/security.d.ts +0 -10
  17. package/esm/core/bus/ability/tracker.d.ts +0 -9
  18. package/esm/core/bus/index.d.ts +0 -125
  19. package/esm/core/bus/interface.d.ts +0 -36
  20. package/esm/core/component/address.d.ts +0 -8
  21. package/esm/core/component/appPreloadProcessing.d.ts +0 -1
  22. package/esm/core/component/ckp/index.d.ts +0 -29
  23. package/esm/core/component/element/EventCenter/index.d.ts +0 -31
  24. package/esm/core/component/element/elementContainerService/containerService.d.ts +0 -34
  25. package/esm/core/component/element/elementContainerService/index.d.ts +0 -20
  26. package/esm/core/component/element/elementController/index.d.ts +0 -48
  27. package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +0 -20
  28. package/esm/core/component/element/elementProcessor/authProcessor.d.ts +0 -20
  29. package/esm/core/component/element/elementProcessor/baseElementProcessor.d.ts +0 -41
  30. package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +0 -22
  31. package/esm/core/component/element/index.d.ts +0 -13
  32. package/esm/core/component/element/mock.d.ts +0 -10
  33. package/esm/core/component/element/type.d.ts +0 -446
  34. package/esm/core/component/element/util.d.ts +0 -85
  35. package/esm/core/component/index.d.ts +0 -58
  36. package/esm/core/drop-in/index.d.ts +0 -22
  37. package/esm/core/instance/index.d.ts +0 -89
  38. package/esm/foundation/core/index.d.ts +0 -36
  39. package/esm/foundation/index.d.ts +0 -97
  40. package/esm/foundation/product-processor/autoDebit/deps.d.ts +0 -14
  41. package/esm/foundation/product-processor/autoDebit/index.d.ts +0 -48
  42. package/esm/foundation/product-processor/easysafepay/deps.d.ts +0 -20
  43. package/esm/foundation/product-processor/easysafepay/index.d.ts +0 -29
  44. package/esm/foundation/product-processor/element/index.d.ts +0 -7
  45. package/esm/foundation/service/api-bus/ability/callback.d.ts +0 -9
  46. package/esm/foundation/service/api-bus/ability/globalData.d.ts +0 -10
  47. package/esm/foundation/service/api-bus/ability/request.d.ts +0 -10
  48. package/esm/foundation/service/api-bus/ability/security.d.ts +0 -12
  49. package/esm/foundation/service/api-bus/ability/tracker.d.ts +0 -9
  50. package/esm/foundation/service/api-bus/busManager.d.ts +0 -127
  51. package/esm/foundation/service/api-bus/index.d.ts +0 -20
  52. package/esm/foundation/service/api-bus/interface.d.ts +0 -48
  53. package/esm/foundation/service/container/index.d.ts +0 -42
  54. package/esm/foundation/service/container/popup.d.ts +0 -31
  55. package/esm/foundation/service/container/utils.d.ts +0 -7
  56. package/esm/foundation/service/event-center.d.ts +0 -82
  57. package/esm/foundation/service/global-data/index.d.ts +0 -11
  58. package/esm/foundation/service/index.d.ts +0 -19
  59. package/esm/foundation/service/log/index.d.ts +0 -43
  60. package/esm/foundation/service/log/keys.d.ts +0 -13
  61. package/esm/foundation/service/log/processor.d.ts +0 -9
  62. package/esm/foundation/service/log/types.d.ts +0 -33
  63. package/esm/foundation/service/requester/deps.d.ts +0 -17
  64. package/esm/foundation/service/requester/requester.d.ts +0 -22
  65. package/esm/foundation/service/security/index.d.ts +0 -28
  66. package/esm/foundation/service/security/security.d.ts +0 -33
  67. package/esm/foundation/utils/gray_scale_utils.d.ts +0 -7
  68. package/esm/foundation/utils/payment_context_utils.d.ts +0 -13
  69. package/esm/foundation/utils/payment_product_utils.d.ts +0 -13
  70. package/esm/foundation/utils/preload_helper.d.ts +0 -21
  71. package/esm/foundation/utils/redirect_utils.d.ts +0 -11
  72. package/esm/foundation/utils/system_events.d.ts +0 -4
  73. package/esm/foundation/utils/web_app_url_utils.d.ts +0 -114
  74. package/esm/index.d.ts +0 -15
  75. package/esm/loader/Proxy.d.ts +0 -5
  76. package/esm/loader/constant.d.ts +0 -36
  77. package/esm/loader/index.d.ts +0 -20
  78. package/esm/loader/utils/common.d.ts +0 -13
  79. package/esm/loader/utils/debugger.d.ts +0 -7
  80. package/esm/loader/utils/loadSDK.d.ts +0 -8
  81. package/esm/loader/utils/logger.d.ts +0 -10
  82. package/esm/loader/utils/proxyPerformance.d.ts +0 -20
  83. package/esm/main.d.ts +0 -45
  84. package/esm/plugin/applepay/component.d.ts +0 -50
  85. package/esm/plugin/applepay/index.d.ts +0 -17
  86. package/esm/plugin/applepay/interface.d.ts +0 -161
  87. package/esm/plugin/applepay/service.d.ts +0 -54
  88. package/esm/plugin/component/cashierApp.d.ts +0 -38
  89. package/esm/plugin/component/channel.d.ts +0 -57
  90. package/esm/plugin/component/component.inline.style.d.ts +0 -10
  91. package/esm/plugin/component/component.popup.style.d.ts +0 -25
  92. package/esm/plugin/component/index.d.ts +0 -133
  93. package/esm/plugin/component/popupWindow.style.d.ts +0 -11
  94. package/esm/plugin/const.d.ts +0 -2
  95. package/esm/plugin/drop-in/index.d.ts +0 -71
  96. package/esm/plugin/payment-element/utils.d.ts +0 -2
  97. package/esm/plugin/paypal/index.d.ts +0 -20
  98. package/esm/plugin/type.d.ts +0 -34
  99. package/esm/plugin/utils.d.ts +0 -6
  100. package/esm/request/index.d.ts +0 -9
  101. package/esm/request/utils.d.ts +0 -28
  102. package/esm/service/index.d.ts +0 -13
  103. package/esm/types/index.d.ts +0 -854
  104. package/esm/util/createIframeNode.d.ts +0 -6
  105. package/esm/util/debug.d.ts +0 -1
  106. package/esm/util/get.d.ts +0 -25
  107. package/esm/util/getBackScheme.d.ts +0 -5
  108. package/esm/util/index.d.ts +0 -61
  109. package/esm/util/integrationType.d.ts +0 -21
  110. package/esm/util/intl-callapp/es/browser.d.ts +0 -21
  111. package/esm/util/intl-callapp/es/evoke.d.ts +0 -13
  112. package/esm/util/intl-callapp/es/generate.d.ts +0 -29
  113. package/esm/util/intl-callapp/es/index.d.ts +0 -43
  114. package/esm/util/intl-callapp/es/main.d.ts +0 -41
  115. package/esm/util/intl-callapp/es/openWallet.d.ts +0 -15
  116. package/esm/util/intl-callapp/es/types.d.ts +0 -46
  117. package/esm/util/intl-callapp/es/utils/config.d.ts +0 -24
  118. package/esm/util/intl-callapp/es/utils/index.d.ts +0 -15
  119. package/esm/util/logger.d.ts +0 -66
  120. package/esm/util/mock.d.ts +0 -1
  121. package/esm/util/redirect.d.ts +0 -6
  122. package/esm/util/security.d.ts +0 -34
  123. package/esm/util/spm-map.d.ts +0 -211
  124. package/esm/util/storage.d.ts +0 -2
  125. package/esm/util/upgrade.d.ts +0 -39
  126. package/esm/util/versionCompare.d.ts +0 -15
@@ -1,82 +0,0 @@
1
- import { EventPayload, EventPayloadContext, IoptionsParams } from '../../types';
2
- import { SDKMetaData, Service } from '../index';
3
- /**
4
- * @author 江跃 <jiangbin.gjb@antgroup.com>
5
- * @date 2024/9/17
6
- */
7
- export declare class EventCenter implements Service {
8
- private events;
9
- private iframes;
10
- private instanceId;
11
- constructor();
12
- /**
13
- * Initializes the event center
14
- */
15
- init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
16
- /**
17
- * Cleans up event listeners when the event center is destroyed.
18
- */
19
- destroy(): void;
20
- /**
21
- * Placeholder for future update logic.
22
- */
23
- update(): void;
24
- /**
25
- * Sets the iframe container and its domain.
26
- * @param iframe - The HTMLIFrameElement that serves as the container.
27
- * @param domain - The domain of the app.
28
- */
29
- addIFrame(iframe: HTMLIFrameElement): void;
30
- /**
31
- * Cleans iframes when web app close
32
- */
33
- cleanIFrames(): void;
34
- removeIFrame(iframe: HTMLIFrameElement): void;
35
- /**
36
- * Handles messages received from the app.
37
- * @param e - The message event.
38
- */
39
- private handleAppMessage;
40
- private checkEventCompliant;
41
- /**
42
- * Processes the application message and emits the associated event.
43
- * @param data - Parsed EventPayload from the app.
44
- */
45
- private _handleAppMessage;
46
- /**
47
- * Listens to an event by adding a callback function.
48
- * @param name - The name of the event to listen for.
49
- * @param func - The callback function to execute when the event is emitted.
50
- * @param isAppend - Append to event handlers as chain, default value is false
51
- */
52
- listen(name: string, func: IListener, isAppend?: boolean): void;
53
- /**
54
- * Unsubscribes from an event. If a function is provided, only that function is removed.
55
- * @param name - The name of the event to unlisten to.
56
- * @param func - The optional callback function to remove.
57
- */
58
- unlisten(name: string, func?: IListener): void;
59
- /**
60
- * Emits an event, executing all associated callback functions.
61
- * @param name - The name of the event to emit.
62
- * @param data - The event data to pass to the event listeners.
63
- */
64
- emit(name: string, data: any, eventPayload?: EventPayload): void;
65
- /**
66
- * Registers a callback for an event and immediately dispatches the event to the app.
67
- * @param payloadContext - The context containing event information and callback ID.
68
- * @param func - The callback function to execute when the event is emitted.
69
- */
70
- emitAndListen(payloadContext: EventPayloadContext, func: IListener): void;
71
- queryParse(url?: string): Record<string, any>;
72
- /**
73
- * Dispatches the event payload to the app via postMessage.
74
- * @param payloadContext - The context containing event to be dispatched.
75
- */
76
- dispatchToApp(payloadContext: EventPayloadContext): void;
77
- isExist(name: string): boolean;
78
- }
79
- interface IListener {
80
- (data: any, eventPayload?: EventPayload): void;
81
- }
82
- export {};
@@ -1,11 +0,0 @@
1
- import { IoptionsParams } from "../../../types";
2
- import { Service } from "../../index";
3
- export declare class GlobalDataService implements Service {
4
- private globalData;
5
- init(initOptions: IoptionsParams, instanceId: string): void;
6
- destroy(): void;
7
- update(): void;
8
- getGlobalData(dataKey: string): any;
9
- setGlobalData(dataKey: string, data: any): void;
10
- clearGlobalData(): void;
11
- }
@@ -1,19 +0,0 @@
1
- import { IoptionsParams } from '../../types';
2
- import { PaymentContext, SDKMetaData, Service } from '../index';
3
- /**
4
- * @author 谦彧 <zhangmian.zm@alipay.com>
5
- * @date 2024/9/17
6
- */
7
- export type ServiceName = 'Container' | 'EventCenter' | 'Log' | 'ApiBusManager' | 'Requester' | 'Security' | 'GlobalData';
8
- export declare class ServiceProvider {
9
- private static ProvidersMapping;
10
- static getInstance(instanceId: string): ServiceProvider;
11
- private readonly instanceId;
12
- private services;
13
- private extendServices;
14
- private constructor();
15
- init(initOptions: IoptionsParams, sdkMetaData: SDKMetaData): void;
16
- update(paymentContext: PaymentContext): void;
17
- getService<T>(serviceName: ServiceName): T;
18
- registerService(serviceName: string, service: Service): void;
19
- }
@@ -1,43 +0,0 @@
1
- import { PaymentContext, SDKMetaData, Service } from '../../index';
2
- import { IoptionsParams } from '../../../types';
3
- import { LogExtra, LogMetaData, LogPayload } from './types';
4
- /**
5
- * @author 谦彧 <zhangmian.zm@alipay.com>
6
- * @date 2024/9/18
7
- */
8
- interface Config {
9
- scriptUrl: string;
10
- spmConfig: object;
11
- appId: string;
12
- server?: string;
13
- bizType: string;
14
- batchCount: number;
15
- productId: string;
16
- mdata?: LogMetaData;
17
- version?: string;
18
- }
19
- export declare class LogService implements Service {
20
- private instanceId;
21
- private logs;
22
- private config;
23
- private debug;
24
- private componentStartTime;
25
- private isLoaded;
26
- private trackId;
27
- constructor();
28
- init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
29
- update(paymentContext: PaymentContext): void;
30
- destroy(): void;
31
- setMetaData(metaData: LogMetaData): void;
32
- getLogConfig(): Config;
33
- logError(error: LogPayload, extra?: LogExtra, enableExtractCompliance?: boolean): LogService;
34
- logInfo(info: LogPayload, extra?: LogExtra): LogService;
35
- log(type: string, payload: LogPayload, extra?: LogExtra, enableExtractCompliance?: boolean): LogService;
36
- private reportLogs;
37
- private loadScript;
38
- private initTracker;
39
- send(): void;
40
- setComponentStartTime(val: number): void;
41
- getComponentStartTime(): number;
42
- }
43
- export {};
@@ -1,13 +0,0 @@
1
- export declare class LogComplianceExtendKeys {
2
- static complianceExtParams: Record<string, string>;
3
- }
4
- export declare const KEYS: {
5
- EVENT_SDK_ON_ABNORMAL_EVENT_NAME: {
6
- spmId: string;
7
- alias: string;
8
- };
9
- EVENT_SDK_ON_ABNORMAL_EVENT_EXT_INFO: {
10
- spmId: string;
11
- alias: string;
12
- };
13
- };
@@ -1,9 +0,0 @@
1
- import { LogExtra, LogPayload } from './types';
2
- export declare class LogComplianceProcessor {
3
- private static abnormalEventNameSet;
4
- private static nonComplianceEventKeys;
5
- static extractComplianceParams(eventName: string, params: Record<string, any>, errorLogCallback?: (error: LogPayload, extra?: LogExtra) => void): Record<string, string>;
6
- private static reportHasAbnormalEventName;
7
- private static reportHasIllegalExtendInfoKey;
8
- static flushAbnormalInfo(errorLogCallback?: (error: LogPayload, extra?: LogExtra) => void): void;
9
- }
@@ -1,33 +0,0 @@
1
- /**
2
- * @author 谦彧 <zhangmian.zm@alipay.com>
3
- * @date 2024/9/18
4
- */
5
- export interface LogPayload {
6
- title?: string;
7
- msg?: string;
8
- errorMessage?: string;
9
- name?: string;
10
- label?: string;
11
- time?: number;
12
- success?: boolean;
13
- code?: string;
14
- traceId?: string;
15
- }
16
- export type LogExtra = Record<string, any>;
17
- export interface LogMetaData {
18
- platform?: string;
19
- sdkVersion?: string;
20
- webAppVersion?: string;
21
- firstLogTime?: number;
22
- fsDuration?: number;
23
- instanceId?: string;
24
- deviceId?: string;
25
- renderDisplayType?: string;
26
- merchantId?: string;
27
- productScene?: string;
28
- productSceneVersion?: string;
29
- paymentMethodType?: string;
30
- paymentMethodCategoryType?: string;
31
- requestSeq?: string;
32
- trackId?: string;
33
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * 这个文件暂时先用来存放架构升级时不稳定的依赖。
3
- * 以及方便单测时mock外部依赖
4
- */
5
- export type { SDKMetaData } from "../..";
6
- export type { LogPayload, LogExtra } from '../log/types';
7
- export type { LogService } from '../log';
8
- export type { Service, PaymentContext } from '../../index';
9
- export { fomatGetwayError } from '../../../request/utils';
10
- export type { IoptionsParams, IPaymentSessionMetaData } from '../../../types';
11
- export { sdkVersion } from '../../../config/index';
12
- export { appId, hostSignMap, lightSandboxMap, requestHost, sofaId, tntInstId } from '../../../config/request';
13
- export type { RequestConfig } from '../../../types';
14
- export { errorEnum } from '../../../types';
15
- export { get } from '../../../util/get';
16
- export { device, isPC, queryParse, safeJson } from '../../../util';
17
- export type { Logger } from '../../../util/logger';
@@ -1,22 +0,0 @@
1
- import { IoptionsParams, PaymentContext, RequestConfig, SDKMetaData, Service } from './deps';
2
- /**
3
- * @author congle.zzq <congle.zzq@alipay.com>
4
- * @date 2024/9/18
5
- */
6
- export declare class RequesterService implements Service {
7
- private sandboxFlag?;
8
- private instanceId;
9
- init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
10
- /**
11
- *
12
- * @param requestData 请求参数
13
- * @param options 请求配置
14
- * @example request({ name: 'test' }, { operation-type: 'xxx.xxx.xxx' })
15
- */
16
- request<T>(requestData: Record<string, any> | undefined, options: RequestConfig): Promise<T>;
17
- getEnvInfo(options: RequestConfig): any;
18
- private reportRequestTimeCost;
19
- update(paymentSession: PaymentContext): void;
20
- destroy(): void;
21
- private createRequestInstance;
22
- }
@@ -1,28 +0,0 @@
1
- import { DeviceIdParameter, IoptionsParams } from '../../../types';
2
- import { PaymentContext, SDKMetaData, Service } from '../../index';
3
- import { Security } from './security';
4
- export declare class SecurityService implements Service {
5
- private logger;
6
- private productScene;
7
- static securitySdkMap: Map<string, Security>;
8
- init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
9
- update(paymentContext: PaymentContext): void;
10
- destroy(): void;
11
- getDeviceId(deviceIdParameter?: DeviceIdParameter, isPolling?: boolean): Promise<string>;
12
- preInitSecurity(timeout?: number): Promise<void>;
13
- initSecurity(timeout?: number): Promise<void>;
14
- private _initSecurity;
15
- private logDeviceId;
16
- /**
17
- * @description Obtain security SDK through scenario identification
18
- */
19
- private _getSecuritySDKByProductScene;
20
- /**
21
- * @description New security SDK through scenario identification
22
- */
23
- private _newSecuritySDKByScene;
24
- /**
25
- * @description Obtain risk control configuration in local storage
26
- */
27
- private _getSecurityConfigStorage;
28
- }
@@ -1,33 +0,0 @@
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
- VAULTING: string;
17
- CARD_APPLE_PAY: string;
18
- EASYPAY: string;
19
- EASY_PAY: string;
20
- FLASH_BUY: string;
21
- ELEMENT_PAYMENT: string;
22
- };
23
- export declare const getSecurityHost: (region: string) => string;
24
- export declare const getSecurityScene: (product: string) => string;
25
- export declare class Security {
26
- scene: string;
27
- h5gateway: string;
28
- constructor(options: IsecurityConfig);
29
- initSecurity(successCallback: any, failCallback: any): void;
30
- private initToken;
31
- pollingGetApdidToken(config?: DeviceIdParameter): Promise<string>;
32
- getApdidToken(): Promise<string>;
33
- }
@@ -1,7 +0,0 @@
1
- import { WebAppMatchConfig } from './web_app_url_utils';
2
- /**
3
- * @author 谦彧 <zhangmian.zm@alipay.com>
4
- * @date 2024/9/18
5
- */
6
- export declare function getGrayscaleId(): number;
7
- export declare function isGreyscaleMatch(configEntry: WebAppMatchConfig, grayScaleId: number): boolean;
@@ -1,13 +0,0 @@
1
- import { IPaymentSessionMetaData } from '../../types';
2
- import { WebAppMatchConfig } from './web_app_url_utils';
3
- import { SDKMetaData } from '../index';
4
- /**
5
- * @author 谦彧 <zhangmian.zm@alipay.com>
6
- * @date 2024/9/17
7
- */
8
- export declare function convertPaymentSession(sessionData: string): {
9
- id: string;
10
- data: IPaymentSessionMetaData;
11
- };
12
- export declare const getWebAppVersion: (currentSDKMetaData: Pick<SDKMetaData, 'sdkVersion' | 'productScene' | 'greyscaleId'>, mid?: string, config?: WebAppMatchConfig[]) => string;
13
- export declare const saveWebAppVersion: (webAppVersion: string, currentSDKMetaData: Pick<SDKMetaData, 'sdkVersion' | 'productScene'>) => void;
@@ -1,13 +0,0 @@
1
- import { ProductSceneEnum } from "../../types";
2
- export declare class ProductInfoCacheUtil {
3
- static savePreviousProductInfo(productScene: ProductSceneEnum, info: {
4
- productSceneVersion: string;
5
- paymentMethodCategoryType: string;
6
- hostSign: string;
7
- }): void;
8
- static getPreviousProductInfo(productScene: ProductSceneEnum): {
9
- productSceneVersion: string;
10
- paymentMethodCategoryType: string;
11
- hostSign: string;
12
- } | null;
13
- }
@@ -1,21 +0,0 @@
1
- import { PaymentMethodCategoryTypeEnum, ProductSceneEnum } from "../../types";
2
- import { Security } from '../../util/security';
3
- export default class PreloadHelper {
4
- static isWebAppPreloaded: boolean;
5
- static isSecuritySDKPreloaded: boolean;
6
- private static securitySdkMap;
7
- static preloadWebApp(productScene: ProductSceneEnum, paymentMethodCategoryType: PaymentMethodCategoryTypeEnum, environment?: string, useV2?: boolean): void;
8
- static preloadSecuritySDK(product: ProductSceneEnum, securityRegion?: string): void;
9
- static getSecuritySdk(scene: any): Security;
10
- static buildWebAppPreloadUrl(productScene: ProductSceneEnum, paymentMethodCategoryType: PaymentMethodCategoryTypeEnum, environment: string, useV2?: boolean): {
11
- preloadUrl: string;
12
- containerId: string;
13
- };
14
- /**
15
- * @description Obtain risk control configuration in local storage
16
- */
17
- static getSecurityConfigStorage(product: ProductSceneEnum): {
18
- scene: string;
19
- h5gateway: string;
20
- };
21
- }
@@ -1,11 +0,0 @@
1
- import { RedirectBehaviorPayload } from '../index';
2
- import { LogService } from '../service/log';
3
- /**
4
- * @author 谦彧 <zhangmian.zm@alipay.com>
5
- * @date 2024/9/19
6
- */
7
- export declare const redirect: (payload: RedirectBehaviorPayload, instanceId: string) => void;
8
- /**
9
- * 通过配置规则检测 UA 和获得回跳 scheme
10
- */
11
- export declare function getBackScheme(mockUa?: string, logger?: LogService): any;
@@ -1,4 +0,0 @@
1
- import { EventCenter } from '../service/event-center';
2
- export declare const registerSystemEvents: (eventCenter: EventCenter) => void;
3
- export declare const unRegisterSystemEvents: (eventCenter: EventCenter) => void;
4
- export declare const getIframeOrigin: (iframe: HTMLIFrameElement) => string;
@@ -1,114 +0,0 @@
1
- import { ESP_PAGE_NAME } from '../../constant/easysafepay';
2
- import { DisplayTypeEnum, IPaymentSessionMetaData, PaymentMethodCategoryTypeEnum, ProductSceneEnum } from '../../types';
3
- import { SDKMetaData } from '../index';
4
- /**
5
- * Tell the SDK which version of the Web App to load.
6
- * Sent by server inside paymentSession.
7
- */
8
- export interface WebAppMatchConfig {
9
- /**
10
- * SDK support version range, '{minVer}|{maxVer}', such as '1.0.0' or '1.0.0|2.0.0' or '2.0.0'
11
- * If SDK version < maxVer and > minVer, then will use this config entry.
12
- */
13
- v: string;
14
- appVersion: string;
15
- productScene?: string;
16
- platform?: string;
17
- mid?: string;
18
- greyscale?: string;
19
- }
20
- /**
21
- * Tell the SDK which Web App URL to load.
22
- * Sent by server inside paymentSession.
23
- */
24
- export interface WebAppUrlMatchConfig {
25
- minSDKVersion: string;
26
- url: string;
27
- doubleFa: string;
28
- mids?: string[];
29
- }
30
- export interface QueryParams {
31
- displayType: DisplayTypeEnum;
32
- locale: string;
33
- instanceId: string;
34
- analyticsEnabled: boolean;
35
- isPreload?: string;
36
- hostSign?: string;
37
- }
38
- export declare const getWebAppUrlInfo: (params: {
39
- environment: string;
40
- sdkMetaData: SDKMetaData;
41
- productScene: ProductSceneEnum;
42
- productSceneVersion: string;
43
- paymentMethodCategoryType: PaymentMethodCategoryTypeEnum;
44
- isPreload?: boolean;
45
- query: QueryParams;
46
- v2Url?: string;
47
- }) => {
48
- path: string;
49
- locationSearch: string;
50
- };
51
- export declare const getWebAppV2Url: (params: {
52
- environment: string;
53
- sdkMetaData: SDKMetaData;
54
- productScene: ProductSceneEnum;
55
- productSceneVersion: string;
56
- paymentMethodCategoryType: PaymentMethodCategoryTypeEnum;
57
- isPreload?: boolean;
58
- query: QueryParams;
59
- mid?: string;
60
- extendInfo?: string;
61
- }) => string;
62
- export declare const getWebAppUrl: (params: {
63
- environment: string;
64
- sdkMetaData: SDKMetaData;
65
- productScene: ProductSceneEnum;
66
- productSceneVersion: string;
67
- paymentMethodCategoryType: PaymentMethodCategoryTypeEnum;
68
- isPreload?: boolean;
69
- query: QueryParams;
70
- v2Url?: string;
71
- }) => string;
72
- export declare const parseWebAppMatchConfig: (extendInfo: string) => WebAppMatchConfig[];
73
- export declare const parseWebAppUrlMatchConfig: (extendInfo: string) => WebAppUrlMatchConfig[];
74
- /**
75
- * Save the current checkout URL to localStorage for the specified product scene.
76
- *
77
- * @param productScene - The product scene for which the checkout URL should be saved.
78
- */
79
- export declare const saveLocalCheckoutUrl: (productScene: ProductSceneEnum, url: string) => void;
80
- /**
81
- * 获取从外部动态下发的V2AppUrl.
82
- *
83
- * @param config - sessionData解析来的checkoutInfo列表.
84
- */
85
- export declare const getMatchedWebAppV2Url: (productScene: ProductSceneEnum, mid: string, configs: WebAppUrlMatchConfig[], env: string) => string;
86
- /**
87
- * 获取ESP从sessionData.checkoutInfo内动态下发的Url.
88
- */
89
- export declare const matchEasySafePayV2Url: (params: {
90
- configs: WebAppUrlMatchConfig[];
91
- mid: string;
92
- env: string;
93
- pageName: ESP_PAGE_NAME;
94
- }) => string;
95
- /**
96
- * Retrieve the saved checkout URL from localStorage for the specified product scene.
97
- * If no url is found, a default checkout url string is returned.
98
- *
99
- * @param productScene - The product scene for which the checkout URL should be retrieved.
100
- */
101
- export declare const getLocalCheckoutUrl: (productScene: ProductSceneEnum, environment: string) => string;
102
- /**
103
- * Provide default checkout URL for the specified product scene.
104
- * Return URL for 'EASY_PAY' product scene, while for other product scenes, it returns an empty string as they are not currently in use
105
- *
106
- * @param productScene - The product scene for which the default checkout URL should be provided.
107
- */
108
- export declare const defaultCheckoutUrl: (productScene: ProductSceneEnum, environment?: string) => string;
109
- /**
110
- * V2应用EasySafePay 热更新兜底URL构建规则
111
- **/
112
- export declare const getDefaultEasySafePayPageUrl: (pageName: ESP_PAGE_NAME, env: string) => string;
113
- /**通过sessionData获取doubleFa,于createComponent时传递给WEB应用*/
114
- export declare const getDoubleFaUrlFromSession: (paymentSessionObj: IPaymentSessionMetaData, env?: string) => string;
package/esm/index.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * NPM包入口 产品持续接入热更新中
3
- *
4
- * 背景:
5
- * 通过NPM方式集成SDK,各产品需要持续接入热更新, 接入热更新的产品基类仅导出热更新壳
6
- * 通过UMD方式集成SDK, 各产品基类直接导出
7
- *
8
- * 详见: https://yuque.antfin.com/antom-sdk/dg6hge/lbun86wg2h3f7es7
9
- *
10
- * **/
11
- import { AMSCheckout } from './main';
12
- export { AMSEasyPayWrapper as AMSEasyPay, AMSElementWrapper as AMSElement } from './loader/index';
13
- export { AddressElement, AMSAutoDebit, AMSAutoDebitPay, AMSCashierPayment, AMSCheckout, AMSCheckoutPage, AMSVaulting, AntomElement, } from './main';
14
- export * from './types';
15
- export default AMSCheckout;
@@ -1,5 +0,0 @@
1
- import type { AMSCashierPayment, AMSEasyPay, AMSElement } from '../main';
2
- import { EConstructorName } from './constant';
3
- export declare function createBaseProxy<T>(constructorName: EConstructorName.AMSCashierPayment): typeof AMSCashierPayment;
4
- export declare function createBaseProxy<T>(constructorName: EConstructorName.AMSEasyPay): typeof AMSEasyPay;
5
- export declare function createBaseProxy<T>(constructorName: EConstructorName.AMSElement): typeof AMSElement;
@@ -1,36 +0,0 @@
1
- import type { AMSCashierPayment, AMSEasyPay, AMSElement } from '../main';
2
- declare global {
3
- interface Window {
4
- AMSCashierPayment?: typeof AMSCashierPayment;
5
- AMSElement?: typeof AMSElement;
6
- AMSEasyPay?: typeof AMSEasyPay;
7
- }
8
- }
9
- /**
10
- * 产品类型
11
- */
12
- export type ProductType = AMSCashierPayment | AMSEasyPay | AMSElement;
13
- /**
14
- * 产品构造函数
15
- */
16
- export type ProductConstructor = typeof AMSCashierPayment | typeof AMSEasyPay | typeof AMSElement;
17
- /**
18
- * 产品构造函数名称枚举
19
- */
20
- export declare enum EConstructorName {
21
- AMSCashierPayment = "AMSCashierPayment",
22
- AMSEasyPay = "AMSEasyPay",
23
- AMSElement = "AMSElement"
24
- }
25
- export declare const instanceApiMap: Record<EConstructorName, string[]>;
26
- /**
27
- * SDK 集成类型枚举
28
- */
29
- export type AntomWebSDKIntegrationType = 'CDN' | 'NPM';
30
- /**
31
- * SDK 地址
32
- */
33
- export declare const SDK_URL: {
34
- DEV: string;
35
- PROD: string;
36
- };
@@ -1,20 +0,0 @@
1
- /**
2
- * 业务中间层
3
- * 1.用于加载SDK & 实例化真实实例对象
4
- * 2.解耦Proxy层与Wrapper层
5
- * 3.预留给业务定制逻辑
6
- * 4.类型适配
7
- */
8
- import { AMSCashierPayment, AMSEasyPay, AMSElement } from '../main';
9
- interface AMSCashierPaymentWrapper extends AMSCashierPayment {
10
- preload: typeof AMSCashierPayment.preload;
11
- }
12
- interface AMSEasyPayWrapper extends AMSEasyPay {
13
- preload: typeof AMSCashierPayment.preload;
14
- }
15
- interface AMSElementWrapper extends AMSElement {
16
- }
17
- declare const AMSCashierPaymentWrapper: typeof AMSCashierPayment;
18
- declare const AMSEasyPayWrapper: typeof AMSEasyPay;
19
- declare const AMSElementWrapper: typeof AMSElement;
20
- export { AMSCashierPaymentWrapper, AMSEasyPayWrapper, AMSElementWrapper };
@@ -1,13 +0,0 @@
1
- /**
2
- * 检测浏览器是否兼容Proxy对象
3
- */
4
- export declare function supportsProxy(): boolean;
5
- /**
6
- * 检测浏览器是否兼容defineProperty
7
- */
8
- export declare function supportsDefineProperty(): boolean;
9
- /**
10
- * @description 尝试调用window.tracker上报m5性能数据
11
- * @param options 自定义性能埋点 m1-m20, m1-资源加载耗时,m2-首屏数据请求耗时,m3-首屏数据请求完成耗时,m4-首屏渲染完成耗时
12
- */
13
- export declare const reportCustomizedPerformance: (options: any) => void;
@@ -1,7 +0,0 @@
1
- export type DebugProps = {
2
- debugMode?: boolean;
3
- showLogger?: boolean;
4
- sdkUrl?: string;
5
- };
6
- export declare const setDebugContext: (props?: DebugProps) => void;
7
- export declare const getDebugContext: () => DebugProps;
@@ -1,8 +0,0 @@
1
- import { EConstructorName, ProductType } from '../constant';
2
- type SdkLoadResult = {
3
- success: boolean;
4
- loadType?: 'cached' | 'network';
5
- };
6
- export declare function loadSdk(): Promise<SdkLoadResult>;
7
- export declare function newActualInstance<T extends ProductType>(constructorName: EConstructorName, newProps: any): T | null;
8
- export {};
@@ -1,10 +0,0 @@
1
- import { Logger } from '../../util/logger';
2
- export declare class ConsoleLogger {
3
- show: boolean;
4
- constructor(options: any);
5
- log(message: string, ...args: any[]): void;
6
- warn(message: string, ...args: any[]): void;
7
- error(message: string, ...args: any[]): void;
8
- }
9
- export declare const consoleLogger: ConsoleLogger;
10
- export declare const logger: Logger;
@@ -1,20 +0,0 @@
1
- /**
2
- * 在window对象上记录商户初始化SDK的StartTime,加载结束时间
3
- * 后续传递给Web应用,用于进行端到端渲染总耗时计算
4
- * ***/
5
- import { ProductSceneEnum } from "../../types";
6
- import { EConstructorName } from '../constant';
7
- type TimeObject = {
8
- startTime: number;
9
- endTime: number;
10
- };
11
- /*** 扩展 Window 接口,添加 _ANTOM_SDK_PROXY_TIME 属性*/
12
- declare global {
13
- interface Window {
14
- _ANTOM_SDK_PROXY_TIME?: Partial<Record<EConstructorName, TimeObject>>;
15
- }
16
- }
17
- export declare function setProxyStartTime(constructorName: EConstructorName, startTime: number): number;
18
- export declare function setProxyEndTime(constructorName: EConstructorName, endTime: number): number;
19
- export declare const getProxyCostTime: (productScene: ProductSceneEnum) => number;
20
- export {};