@alipay/ams-checkout 0.0.1730107332-dev.4 → 0.0.1730107332-dev.41

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 (122) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/component/channel.d.ts +2 -3
  3. package/esm/component/channel.js +55 -29
  4. package/esm/component/component.inline.style.js +1 -1
  5. package/esm/component/component.popup.style.d.ts +1 -3
  6. package/esm/component/component.popup.style.js +1 -3
  7. package/esm/config/index.d.ts +7 -7
  8. package/esm/config/index.js +10 -10
  9. package/esm/constant/index.d.ts +3 -0
  10. package/esm/constant/index.js +3 -0
  11. package/esm/core/bus/ability/callback.d.ts +9 -0
  12. package/esm/core/bus/ability/callback.js +55 -0
  13. package/esm/core/bus/ability/security.d.ts +10 -0
  14. package/esm/core/bus/ability/security.js +104 -0
  15. package/esm/core/bus/ability/tracker.d.ts +9 -0
  16. package/esm/core/bus/ability/tracker.js +77 -0
  17. package/esm/core/bus/index.d.ts +125 -0
  18. package/esm/core/bus/index.js +366 -0
  19. package/esm/core/bus/interface.d.ts +36 -0
  20. package/esm/core/bus/interface.js +40 -0
  21. package/esm/core/component/address.d.ts +8 -0
  22. package/esm/core/component/address.js +72 -0
  23. package/esm/core/component/appPreloadProcessing.d.ts +1 -0
  24. package/esm/core/component/appPreloadProcessing.js +89 -0
  25. package/esm/core/component/ckp/index.d.ts +27 -0
  26. package/esm/core/component/ckp/index.js +167 -0
  27. package/esm/core/component/element/components/address.d.ts +19 -0
  28. package/esm/core/component/element/components/address.js +68 -0
  29. package/esm/core/component/element/components/auth.d.ts +17 -0
  30. package/esm/core/component/element/components/auth.js +60 -0
  31. package/esm/core/component/element/components/payment.d.ts +19 -0
  32. package/esm/core/component/element/components/payment.js +74 -0
  33. package/esm/core/component/element/index.d.ts +47 -0
  34. package/esm/core/component/element/index.js +816 -0
  35. package/esm/core/component/element/mock.d.ts +4 -0
  36. package/esm/core/component/element/mock.js +491 -0
  37. package/esm/core/component/element/type.d.ts +190 -0
  38. package/esm/core/component/element/type.js +35 -0
  39. package/esm/core/component/element/utils.d.ts +13 -0
  40. package/esm/core/component/element/utils.js +6 -0
  41. package/esm/core/component/index.d.ts +51 -0
  42. package/esm/core/component/index.js +531 -0
  43. package/esm/core/drop-in/index.d.ts +22 -0
  44. package/esm/core/drop-in/index.js +104 -0
  45. package/esm/core/instance/index.d.ts +89 -0
  46. package/esm/core/instance/index.js +499 -0
  47. package/esm/foundation/core/index.d.ts +3 -3
  48. package/esm/foundation/core/index.js +10 -8
  49. package/esm/foundation/index.d.ts +6 -5
  50. package/esm/foundation/product-processor/easysafepay/deps.d.ts +6 -6
  51. package/esm/foundation/product-processor/easysafepay/deps.js +4 -4
  52. package/esm/foundation/product-processor/easysafepay/index.d.ts +2 -3
  53. package/esm/foundation/product-processor/easysafepay/index.js +110 -243
  54. package/esm/foundation/service/api-bus/index.d.ts +2 -2
  55. package/esm/foundation/service/container/index.d.ts +4 -2
  56. package/esm/foundation/service/container/index.js +43 -1
  57. package/esm/foundation/service/event-center.d.ts +6 -4
  58. package/esm/foundation/service/event-center.js +47 -17
  59. package/esm/foundation/service/global-data/index.d.ts +2 -2
  60. package/esm/foundation/service/index.d.ts +2 -2
  61. package/esm/foundation/service/log/index.d.ts +2 -2
  62. package/esm/foundation/service/log/index.js +1 -1
  63. package/esm/foundation/service/requester/deps.d.ts +1 -1
  64. package/esm/foundation/service/requester/requester.d.ts +2 -2
  65. package/esm/foundation/service/security/index.d.ts +2 -2
  66. package/esm/foundation/service/security/index.js +5 -20
  67. package/esm/foundation/utils/redirect_utils.d.ts +5 -0
  68. package/esm/foundation/utils/redirect_utils.js +205 -58
  69. package/esm/foundation/utils/system_events.js +0 -5
  70. package/esm/foundation/utils/web_app_url_utils.js +1 -1
  71. package/esm/index.d.ts +31 -2
  72. package/esm/index.js +146 -6
  73. package/esm/plugin/applepay/component.d.ts +50 -0
  74. package/esm/plugin/applepay/component.js +339 -0
  75. package/esm/plugin/applepay/index.d.ts +17 -0
  76. package/esm/plugin/applepay/index.js +117 -0
  77. package/esm/plugin/applepay/interface.d.ts +161 -0
  78. package/esm/plugin/applepay/interface.js +69 -0
  79. package/esm/plugin/applepay/service.d.ts +54 -0
  80. package/esm/plugin/applepay/service.js +289 -0
  81. package/esm/plugin/component/cashierApp.d.ts +36 -0
  82. package/esm/plugin/component/cashierApp.js +244 -0
  83. package/esm/plugin/component/channel.d.ts +21 -0
  84. package/esm/plugin/component/channel.js +89 -0
  85. package/esm/plugin/component/component.inline.style.d.ts +10 -0
  86. package/esm/plugin/component/component.inline.style.js +121 -0
  87. package/esm/plugin/component/component.popup.style.d.ts +16 -0
  88. package/esm/plugin/component/component.popup.style.js +174 -0
  89. package/esm/plugin/component/index.d.ts +127 -0
  90. package/esm/plugin/component/index.js +1896 -0
  91. package/esm/plugin/component/popupWindow.style.d.ts +11 -0
  92. package/esm/plugin/component/popupWindow.style.js +121 -0
  93. package/esm/plugin/const.d.ts +2 -0
  94. package/esm/plugin/const.js +33 -0
  95. package/esm/plugin/drop-in/index.d.ts +71 -0
  96. package/esm/plugin/drop-in/index.js +324 -0
  97. package/esm/plugin/payment-element/utils.d.ts +2 -0
  98. package/esm/plugin/payment-element/utils.js +6 -0
  99. package/esm/plugin/paypal/index.d.ts +20 -0
  100. package/esm/plugin/paypal/index.js +390 -0
  101. package/esm/plugin/type.d.ts +34 -0
  102. package/esm/plugin/type.js +1 -0
  103. package/esm/plugin/utils.d.ts +6 -0
  104. package/esm/plugin/utils.js +21 -0
  105. package/esm/service/element.d.ts +4 -0
  106. package/esm/service/element.js +51 -0
  107. package/esm/service/index.d.ts +1 -0
  108. package/esm/service/index.js +2 -0
  109. package/esm/types/index.d.ts +228 -26
  110. package/esm/types/index.js +54 -5
  111. package/esm/util/createIframeNode.d.ts +6 -0
  112. package/esm/util/createIframeNode.js +48 -0
  113. package/esm/util/getBackScheme.d.ts +2 -2
  114. package/esm/util/getBackScheme.js +2 -2
  115. package/esm/util/index.d.ts +11 -1
  116. package/esm/util/index.js +84 -3
  117. package/esm/util/intl-callapp/es/index.js +0 -1
  118. package/esm/util/security.d.ts +33 -0
  119. package/esm/util/security.js +182 -0
  120. package/package.json +2 -1
  121. package/esm/foundation/types/index.d.ts +0 -4
  122. package/esm/foundation/types/index.js +0 -4
@@ -0,0 +1,35 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ export var ThemeType = /*#__PURE__*/function (ThemeType) {
6
+ ThemeType["NostalgicGray"] = "nostalgicGray";
7
+ ThemeType["Default"] = "default";
8
+ ThemeType["Night"] = "night";
9
+ ThemeType["CherryBlossomPink"] = "cherryBlossomPink";
10
+ ThemeType["GamingPurple"] = "gamingPurple";
11
+ ThemeType["AgateGreen"] = "agateGreen";
12
+ return ThemeType;
13
+ }({});
14
+ export var addressTheme = _defineProperty(_defineProperty({}, ThemeType.Default, 'LIGHT'), ThemeType.Night, 'NIGHT');
15
+ export var EventCallbackCode = /*#__PURE__*/function (EventCallbackCode) {
16
+ EventCallbackCode["Failed"] = "Failed";
17
+ EventCallbackCode["Completed"] = "Completed";
18
+ return EventCallbackCode;
19
+ }({});
20
+ export var ELEMENT_ENVIRONMENT = /*#__PURE__*/function (ELEMENT_ENVIRONMENT) {
21
+ ELEMENT_ENVIRONMENT["DEV"] = "DEV";
22
+ ELEMENT_ENVIRONMENT["TEST"] = "TEST";
23
+ ELEMENT_ENVIRONMENT["SIT"] = "SIT";
24
+ ELEMENT_ENVIRONMENT["PRE"] = "PRE";
25
+ ELEMENT_ENVIRONMENT["PROD"] = "PROD";
26
+ return ELEMENT_ENVIRONMENT;
27
+ }({});
28
+ // export type IMountOptions = AddressMountOptions | LinkAuthMountOptions | PaymentMountOptions;
29
+
30
+ export var AddressEventCallbackName = /*#__PURE__*/function (AddressEventCallbackName) {
31
+ AddressEventCallbackName["SHIPPING_CHANGE"] = "SHIPPING_CHANGE";
32
+ return AddressEventCallbackName;
33
+ }({});
34
+
35
+ // export type IMountResult = AddressMountResult | LinkAuthMountResult | PaymentMountResult;
@@ -0,0 +1,13 @@
1
+ export interface ISessionDataExtendInfo {
2
+ displayLayout: 'LEFT_ORDER_AND_RIGHT_PAYMENT' | 'LEFT_PAYMENT_AND_RIGHT_ORDER';
3
+ displayAntomLogo: string;
4
+ themeType: 'LIGHT' | 'NIGHT' | 'CUSTOMIZE';
5
+ OPEN_MULTI_PAYMENT_ABILITY: boolean;
6
+ [key: string]: any;
7
+ }
8
+ export interface LinkData {
9
+ linkId: string;
10
+ region: string;
11
+ displaySetting?: ISessionDataExtendInfo;
12
+ }
13
+ export declare const displayIframe: (selector: string) => void;
@@ -0,0 +1,6 @@
1
+ export var displayIframe = function displayIframe(selector) {
2
+ var dom = document.querySelector(selector);
3
+ dom.style.opacity = '1';
4
+ dom.style.overflow = 'visible';
5
+ dom.style.height = '110px';
6
+ };
@@ -0,0 +1,51 @@
1
+ import ComponentApp from '../../plugin/component';
2
+ import { ComponentSignEnum, IcreateComponent, IoptionsParams, IPaymentSessionMetaData, Iselector, Isubmit, PaymentMethodTypeEnum, SubPaymentMethodTypeEnum } 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 type IAMSComponentOptions = IoptionsParams & {
7
+ appVersion: string;
8
+ };
9
+ export declare class AMSComponent extends CoreInstance {
10
+ _componentApp: ComponentApp;
11
+ channelType: ComponentSignEnum[];
12
+ productSceneVersion: string;
13
+ timer: any;
14
+ constructor(options: IAMSComponentOptions);
15
+ private parameterInitAndCheck;
16
+ private pluginAppendIframe;
17
+ private savePreviousChannel;
18
+ /**
19
+ * 初始化 Bus总线的能力
20
+ */
21
+ private registerBusAbility;
22
+ /**
23
+ * To determine whether the corresponding payment method is available,
24
+ * only the channel described in the document will be called, and it will be returned as available by default
25
+ * @param paymentMethod - described in the document
26
+ * @param subPaymentMethod - described in the document
27
+ * @returns
28
+ */
29
+ canMakePayments(paymentMethod: PaymentMethodTypeEnum, subPaymentMethod?: SubPaymentMethodTypeEnum): Promise<boolean>;
30
+ /**
31
+ * @description Create component application
32
+ * @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.
33
+ */
34
+ createComponent(params: IcreateComponent): Promise<void>;
35
+ private createComponentProcess;
36
+ preloadComponent(channelType: any, productSceneVersion: any): void;
37
+ private clearPreloadIframe;
38
+ /**
39
+ * @description Create and render components in the specified element area
40
+ * @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.
41
+ * @param selector - Necessary element selector ID
42
+ */
43
+ mountComponent(params: IcreateComponent, selector: Iselector): Promise<void>;
44
+ private mountComponentProcess;
45
+ /**
46
+ * @description Execute payment submission process
47
+ * @description - When using your own payment button, you can execute the submit payment process by actively calling this function.
48
+ * @param data - Transfer information in the submission interface according to your requirements (optional)
49
+ */
50
+ submit(data?: Isubmit): Promise<unknown>;
51
+ }