@alipay/ams-checkout 1.23.0 → 1.25.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.
Files changed (128) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/component/channel.d.ts +19 -0
  3. package/esm/component/channel.js +87 -0
  4. package/esm/component/component.inline.style.d.ts +10 -0
  5. package/esm/component/component.inline.style.js +121 -0
  6. package/esm/component/component.popup.style.d.ts +23 -0
  7. package/esm/component/component.popup.style.js +190 -0
  8. package/esm/component/popupWindow.style.d.ts +11 -0
  9. package/esm/component/popupWindow.style.js +121 -0
  10. package/esm/config/index.d.ts +7 -7
  11. package/esm/config/index.js +10 -10
  12. package/esm/constant/index.d.ts +9 -5
  13. package/esm/constant/index.js +12 -78
  14. package/esm/core/component/ckp/index.js +6 -5
  15. package/esm/core/component/element/components/address.d.ts +19 -0
  16. package/esm/core/component/element/components/address.js +68 -0
  17. package/esm/core/component/element/components/auth.d.ts +17 -0
  18. package/esm/core/component/element/components/auth.js +60 -0
  19. package/esm/core/component/element/components/payment.d.ts +19 -0
  20. package/esm/core/component/element/components/payment.js +74 -0
  21. package/esm/core/component/element/index.d.ts +47 -0
  22. package/esm/core/component/element/index.js +816 -0
  23. package/esm/core/component/element/mock.d.ts +4 -0
  24. package/esm/core/component/element/mock.js +491 -0
  25. package/esm/core/component/element/type.d.ts +190 -0
  26. package/esm/core/component/element/type.js +35 -0
  27. package/esm/core/component/element/utils.d.ts +13 -0
  28. package/esm/core/component/element/utils.js +6 -0
  29. package/esm/core/component/index.d.ts +4 -4
  30. package/esm/core/component/index.js +14 -14
  31. package/esm/core/drop-in/index.js +2 -2
  32. package/esm/core/instance/index.js +9 -9
  33. package/esm/foundation/core/index.d.ts +26 -0
  34. package/esm/foundation/core/index.js +366 -0
  35. package/esm/foundation/index.d.ts +75 -0
  36. package/esm/foundation/index.js +42 -0
  37. package/esm/foundation/product-processor/easysafepay/deps.d.ts +18 -0
  38. package/esm/foundation/product-processor/easysafepay/deps.js +12 -0
  39. package/esm/foundation/product-processor/easysafepay/index.d.ts +26 -0
  40. package/esm/foundation/product-processor/easysafepay/index.js +463 -0
  41. package/esm/foundation/service/api-bus/ability/callback.d.ts +9 -0
  42. package/esm/foundation/service/api-bus/ability/callback.js +55 -0
  43. package/esm/foundation/service/api-bus/ability/globalData.d.ts +10 -0
  44. package/esm/foundation/service/api-bus/ability/globalData.js +89 -0
  45. package/esm/foundation/service/api-bus/ability/request.d.ts +10 -0
  46. package/esm/foundation/service/api-bus/ability/request.js +151 -0
  47. package/esm/foundation/service/api-bus/ability/security.d.ts +12 -0
  48. package/esm/foundation/service/api-bus/ability/security.js +161 -0
  49. package/esm/foundation/service/api-bus/ability/tracker.d.ts +9 -0
  50. package/esm/foundation/service/api-bus/ability/tracker.js +80 -0
  51. package/esm/foundation/service/api-bus/busManager.d.ts +127 -0
  52. package/esm/foundation/service/api-bus/busManager.js +398 -0
  53. package/esm/foundation/service/api-bus/index.d.ts +20 -0
  54. package/esm/foundation/service/api-bus/index.js +88 -0
  55. package/esm/foundation/service/api-bus/interface.d.ts +48 -0
  56. package/esm/foundation/service/api-bus/interface.js +54 -0
  57. package/esm/foundation/service/container/index.d.ts +30 -0
  58. package/esm/foundation/service/container/index.js +298 -0
  59. package/esm/foundation/service/container/popup.d.ts +17 -0
  60. package/esm/foundation/service/container/popup.js +103 -0
  61. package/esm/foundation/service/container/utils.d.ts +7 -0
  62. package/esm/foundation/service/container/utils.js +48 -0
  63. package/esm/foundation/service/event-center.d.ts +76 -0
  64. package/esm/foundation/service/event-center.js +243 -0
  65. package/esm/foundation/service/global-data/index.d.ts +11 -0
  66. package/esm/foundation/service/global-data/index.js +68 -0
  67. package/esm/foundation/service/index.d.ts +19 -0
  68. package/esm/foundation/service/index.js +82 -0
  69. package/esm/foundation/service/log/index.d.ts +43 -0
  70. package/esm/foundation/service/log/index.js +235 -0
  71. package/esm/foundation/service/log/types.d.ts +32 -0
  72. package/esm/foundation/service/log/types.js +1 -0
  73. package/esm/foundation/service/requester/deps.d.ts +17 -0
  74. package/esm/foundation/service/requester/deps.js +11 -0
  75. package/esm/foundation/service/requester/requester.d.ts +22 -0
  76. package/esm/foundation/service/requester/requester.js +214 -0
  77. package/esm/foundation/service/security/index.d.ts +28 -0
  78. package/esm/foundation/service/security/index.js +286 -0
  79. package/esm/foundation/service/security/security.d.ts +33 -0
  80. package/esm/foundation/service/security/security.js +182 -0
  81. package/esm/foundation/utils/gray_scale_utils.d.ts +7 -0
  82. package/esm/foundation/utils/gray_scale_utils.js +40 -0
  83. package/esm/foundation/utils/payment_context_utils.d.ts +13 -0
  84. package/esm/foundation/utils/payment_context_utils.js +57 -0
  85. package/esm/foundation/utils/payment_product_utils.d.ts +13 -0
  86. package/esm/foundation/utils/payment_product_utils.js +38 -0
  87. package/esm/foundation/utils/redirect_utils.d.ts +11 -0
  88. package/esm/foundation/utils/redirect_utils.js +263 -0
  89. package/esm/foundation/utils/system_events.d.ts +4 -0
  90. package/esm/foundation/utils/system_events.js +66 -0
  91. package/esm/foundation/utils/web_app_url_utils.d.ts +46 -0
  92. package/esm/foundation/utils/web_app_url_utils.js +112 -0
  93. package/esm/index.d.ts +12 -6
  94. package/esm/index.js +75 -64
  95. package/esm/plugin/applepay/component.js +3 -3
  96. package/esm/plugin/applepay/service.d.ts +2 -2
  97. package/esm/plugin/applepay/service.js +2 -2
  98. package/esm/plugin/component/cashierApp.d.ts +7 -5
  99. package/esm/plugin/component/cashierApp.js +15 -8
  100. package/esm/plugin/component/channel.d.ts +4 -4
  101. package/esm/plugin/component/component.inline.style.d.ts +4 -4
  102. package/esm/plugin/component/component.inline.style.js +10 -8
  103. package/esm/plugin/component/component.popup.style.d.ts +6 -6
  104. package/esm/plugin/component/component.popup.style.js +6 -6
  105. package/esm/plugin/component/index.d.ts +8 -7
  106. package/esm/plugin/component/index.js +160 -103
  107. package/esm/plugin/const.js +5 -5
  108. package/esm/plugin/drop-in/index.d.ts +5 -5
  109. package/esm/plugin/drop-in/index.js +7 -7
  110. package/esm/plugin/type.d.ts +3 -3
  111. package/esm/service/element.d.ts +4 -0
  112. package/esm/service/element.js +51 -0
  113. package/esm/service/index.d.ts +1 -0
  114. package/esm/service/index.js +2 -0
  115. package/esm/types/index.d.ts +247 -39
  116. package/esm/types/index.js +109 -59
  117. package/esm/util/createIframeNode.d.ts +2 -2
  118. package/esm/util/createIframeNode.js +3 -3
  119. package/esm/util/getBackScheme.js +95 -3
  120. package/esm/util/security.d.ts +2 -2
  121. package/esm/util/security.js +2 -2
  122. package/package.json +2 -1
  123. package/esm/util/ua/index.d.ts +0 -2
  124. package/esm/util/ua/index.js +0 -2
  125. package/esm/util/ua/isAndroid.d.ts +0 -4
  126. package/esm/util/ua/isAndroid.js +0 -7
  127. package/esm/util/ua/isIOS.d.ts +0 -4
  128. package/esm/util/ua/isIOS.js +0 -7
@@ -6,56 +6,57 @@
6
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
7
  */
8
8
  /* eslint-disable @typescript-eslint/no-explicit-any */
9
+ export * from "../core/component/element/type";
9
10
 
10
11
  /**
11
12
  * SDK options
12
13
  */
13
14
 
14
- export var renderDisplayTypeEnum = /*#__PURE__*/function (renderDisplayTypeEnum) {
15
- renderDisplayTypeEnum["popup"] = "popup";
16
- renderDisplayTypeEnum["inline"] = "inline";
17
- return renderDisplayTypeEnum;
15
+ export var DisplayTypeEnum = /*#__PURE__*/function (DisplayTypeEnum) {
16
+ DisplayTypeEnum["popup"] = "popup";
17
+ DisplayTypeEnum["inline"] = "inline";
18
+ return DisplayTypeEnum;
18
19
  }({});
19
20
  export var ComponentSignEnumV2 = /*#__PURE__*/function (ComponentSignEnumV2) {
20
21
  ComponentSignEnumV2["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
21
22
  ComponentSignEnumV2["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
22
23
  return ComponentSignEnumV2;
23
24
  }({});
24
- export var componentSignEnum = /*#__PURE__*/function (componentSignEnum) {
25
- componentSignEnum["EASY_PAY_WALLET"] = "EASY_PAY_WALLET";
26
- componentSignEnum["EASY_PAY_APM"] = "EASY_PAY_APM";
27
- componentSignEnum["CASHIER_PAYMENT_CARD"] = "CASHIER_PAYMENT_CARD";
28
- componentSignEnum["CASHIER_PAYMENT_BANK"] = "CASHIER_PAYMENT_BANK";
29
- componentSignEnum["CASHIER_PAYMENT_APM"] = "CASHIER_PAYMENT_APM";
30
- componentSignEnum["AUTO_DEBIT_WALLET"] = "AUTO_DEBIT_WALLET";
31
- componentSignEnum["AUTO_DEBIT_PAY_WALLET"] = "AUTO_DEBIT_PAY_WALLET";
32
- componentSignEnum["NONE"] = "NONE";
33
- componentSignEnum["VAULTING_CARD"] = "VAULTING_CARD";
34
- componentSignEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
35
- componentSignEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
36
- componentSignEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
37
- return componentSignEnum;
38
- }({});
39
- export var productSceneEnum = /*#__PURE__*/function (productSceneEnum) {
40
- productSceneEnum["EASY_PAY"] = "EASY_PAY";
41
- productSceneEnum["CASHIER_PAYMENT"] = "CASHIER_PAYMENT";
42
- productSceneEnum["AUTO_DEBIT"] = "AUTO_DEBIT";
43
- productSceneEnum["AUTO_DEBIT_PAY"] = "AUTO_DEBIT_PAY";
44
- productSceneEnum["VAULTING"] = "VAULTING";
45
- productSceneEnum["FLASH_BUY"] = "FLASH_BUY";
46
- productSceneEnum["CARD_APPLE_PAY"] = "CARD_APPLE_PAY";
47
- productSceneEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT";
48
- productSceneEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS";
49
- productSceneEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
50
- return productSceneEnum;
51
- }({});
52
- export var paymentMethodCategoryTypeEnum = /*#__PURE__*/function (paymentMethodCategoryTypeEnum) {
53
- paymentMethodCategoryTypeEnum["CARD"] = "CARD";
54
- paymentMethodCategoryTypeEnum["WALLET"] = "WALLET";
55
- paymentMethodCategoryTypeEnum["BANK"] = "BANK";
56
- paymentMethodCategoryTypeEnum["APM"] = "APM";
57
- paymentMethodCategoryTypeEnum["ALL"] = "ALL";
58
- return paymentMethodCategoryTypeEnum;
25
+ export var ComponentSignEnum = /*#__PURE__*/function (ComponentSignEnum) {
26
+ ComponentSignEnum["EASY_PAY_WALLET"] = "EASY_PAY_WALLET";
27
+ ComponentSignEnum["EASY_PAY_APM"] = "EASY_PAY_APM";
28
+ ComponentSignEnum["CASHIER_PAYMENT_CARD"] = "CASHIER_PAYMENT_CARD";
29
+ ComponentSignEnum["CASHIER_PAYMENT_BANK"] = "CASHIER_PAYMENT_BANK";
30
+ ComponentSignEnum["CASHIER_PAYMENT_APM"] = "CASHIER_PAYMENT_APM";
31
+ ComponentSignEnum["AUTO_DEBIT_WALLET"] = "AUTO_DEBIT_WALLET";
32
+ ComponentSignEnum["AUTO_DEBIT_PAY_WALLET"] = "AUTO_DEBIT_PAY_WALLET";
33
+ ComponentSignEnum["NONE"] = "NONE";
34
+ ComponentSignEnum["VAULTING_CARD"] = "VAULTING_CARD";
35
+ ComponentSignEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
36
+ ComponentSignEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
37
+ ComponentSignEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
38
+ return ComponentSignEnum;
39
+ }({});
40
+ export var ProductSceneEnum = /*#__PURE__*/function (ProductSceneEnum) {
41
+ ProductSceneEnum["EASY_PAY"] = "EASY_PAY";
42
+ ProductSceneEnum["CASHIER_PAYMENT"] = "CASHIER_PAYMENT";
43
+ ProductSceneEnum["AUTO_DEBIT"] = "AUTO_DEBIT";
44
+ ProductSceneEnum["AUTO_DEBIT_PAY"] = "AUTO_DEBIT_PAY";
45
+ ProductSceneEnum["VAULTING"] = "VAULTING";
46
+ ProductSceneEnum["FLASH_BUY"] = "FLASH_BUY";
47
+ ProductSceneEnum["CARD_APPLE_PAY"] = "CARD_APPLE_PAY";
48
+ ProductSceneEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT";
49
+ ProductSceneEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS";
50
+ ProductSceneEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
51
+ return ProductSceneEnum;
52
+ }({});
53
+ export var PaymentMethodCategoryTypeEnum = /*#__PURE__*/function (PaymentMethodCategoryTypeEnum) {
54
+ PaymentMethodCategoryTypeEnum["CARD"] = "CARD";
55
+ PaymentMethodCategoryTypeEnum["WALLET"] = "WALLET";
56
+ PaymentMethodCategoryTypeEnum["BANK"] = "BANK";
57
+ PaymentMethodCategoryTypeEnum["APM"] = "APM";
58
+ PaymentMethodCategoryTypeEnum["ALL"] = "ALL";
59
+ return PaymentMethodCategoryTypeEnum;
59
60
  }({});
60
61
 
61
62
  /** 表单地址数据 */
@@ -88,11 +89,11 @@ export var networkModeEnum = /*#__PURE__*/function (networkModeEnum) {
88
89
  networkModeEnum["session"] = "session";
89
90
  return networkModeEnum;
90
91
  }({});
91
- export var environmentEnum = /*#__PURE__*/function (environmentEnum) {
92
- environmentEnum["sandbox"] = "sandbox";
93
- environmentEnum["prod"] = "prod";
94
- environmentEnum["light_sandbox"] = "light_sandbox";
95
- return environmentEnum;
92
+ export var EnvironmentEnum = /*#__PURE__*/function (EnvironmentEnum) {
93
+ EnvironmentEnum["sandbox"] = "sandbox";
94
+ EnvironmentEnum["prod"] = "prod";
95
+ EnvironmentEnum["light_sandbox"] = "light_sandbox";
96
+ return EnvironmentEnum;
96
97
  }({});
97
98
  export var osTypeEnum = /*#__PURE__*/function (osTypeEnum) {
98
99
  osTypeEnum["IOS"] = "IOS";
@@ -107,10 +108,10 @@ export var terminalTypeEnum = /*#__PURE__*/function (terminalTypeEnum) {
107
108
  terminalTypeEnum["MINI_APP"] = "MINI_APP";
108
109
  return terminalTypeEnum;
109
110
  }({});
110
- export var platformEnum = /*#__PURE__*/function (platformEnum) {
111
- platformEnum["desktop"] = "desktop";
112
- platformEnum["mobile"] = "mobile";
113
- return platformEnum;
111
+ export var PlatformEnum = /*#__PURE__*/function (PlatformEnum) {
112
+ PlatformEnum["desktop"] = "desktop";
113
+ PlatformEnum["mobile"] = "mobile";
114
+ return PlatformEnum;
114
115
  }({});
115
116
 
116
117
  /**
@@ -129,17 +130,17 @@ export var platformEnum = /*#__PURE__*/function (platformEnum) {
129
130
  * @description Create an event handler, In pop-up layer mode, the user clicks the semi floating layer close button and is called.
130
131
  */
131
132
 
132
- export var messageName = /*#__PURE__*/function (messageName) {
133
- messageName["SDK_TO_APP"] = "SDK_TO_APP";
134
- messageName["APP_TO_SDK"] = "APP_TO_SDK";
135
- messageName["APP_TO_APP"] = "APP_TO_APP";
136
- return messageName;
137
- }({});
138
- export var targetEnum = /*#__PURE__*/function (targetEnum) {
139
- targetEnum["BLANK"] = "_blank";
140
- targetEnum["SELF"] = "_self";
141
- targetEnum["REPLACE"] = "_replace";
142
- return targetEnum;
133
+ export var MessageName = /*#__PURE__*/function (MessageName) {
134
+ MessageName["SDK_TO_APP"] = "SDK_TO_APP";
135
+ MessageName["APP_TO_SDK"] = "APP_TO_SDK";
136
+ MessageName["APP_TO_APP"] = "APP_TO_APP";
137
+ return MessageName;
138
+ }({});
139
+ export var TargetEnum = /*#__PURE__*/function (TargetEnum) {
140
+ TargetEnum["BLANK"] = "_blank";
141
+ TargetEnum["SELF"] = "_self";
142
+ TargetEnum["REPLACE"] = "_replace";
143
+ return TargetEnum;
143
144
  }({});
144
145
  export var errorEnum = /*#__PURE__*/function (errorEnum) {
145
146
  errorEnum["PARAMS"] = "PARAMS";
@@ -208,4 +209,53 @@ export var ProductSceneVersion = /*#__PURE__*/function (ProductSceneVersion) {
208
209
  ProductSceneVersion["V1"] = "1.0";
209
210
  ProductSceneVersion["V2"] = "2.0";
210
211
  return ProductSceneVersion;
212
+ }({});
213
+ export var AccountStatusEnum = /*#__PURE__*/function (AccountStatusEnum) {
214
+ AccountStatusEnum["EFFECTIVE"] = "EFFECTIVE";
215
+ AccountStatusEnum["UNREGISTERED"] = "UNREGISTERED";
216
+ return AccountStatusEnum;
217
+ }({});
218
+
219
+ // element 接口start
220
+
221
+ export var InterActionTypeEnum = /*#__PURE__*/function (InterActionTypeEnum) {
222
+ InterActionTypeEnum["COLLECT_REDIRECT"] = "COLLECT_REDIRECT";
223
+ InterActionTypeEnum["SHOW_CODE"] = "SHOW_CODE";
224
+ InterActionTypeEnum["COLLECT_SHOW_CODE"] = "COLLECT_SHOW_CODE";
225
+ InterActionTypeEnum["REDIRECT"] = "REDIRECT";
226
+ return InterActionTypeEnum;
227
+ }({});
228
+ // element 接口end
229
+
230
+ export var ElementPaymentMethod = /*#__PURE__*/function (ElementPaymentMethod) {
231
+ ElementPaymentMethod["CONTAINER_ELEMENT"] = "CONTAINER_ELEMENT";
232
+ ElementPaymentMethod["AUTH_ELEMENT"] = "AUTH_ELEMENT";
233
+ ElementPaymentMethod["ADDRESS_ELEMENT"] = "ADDRESS_ELEMENT";
234
+ ElementPaymentMethod["PAYMENT_ELEMENT"] = "PAYMENT_ELEMENT";
235
+ return ElementPaymentMethod;
236
+ }({});
237
+ export var ElementPaymentEvent = /*#__PURE__*/function (ElementPaymentEvent) {
238
+ ElementPaymentEvent["INITIAL_DATA_READY"] = "initialDataReady";
239
+ ElementPaymentEvent["CAPTURE_ASSET"] = "onCaptureAsset";
240
+ ElementPaymentEvent["SIGN_OUT"] = "onSignout";
241
+ ElementPaymentEvent["BLUR"] = "onBlur";
242
+ ElementPaymentEvent["VALIDATE"] = "validate";
243
+ ElementPaymentEvent["SUBMIT_RISK"] = "onSubmitRisk";
244
+ ElementPaymentEvent["AFTER_SUBMIT"] = "onAfterSubmit";
245
+ ElementPaymentEvent["SIZE_CHANGE"] = "onSizeChange";
246
+ ElementPaymentEvent["LAUNCH"] = "onLaunch";
247
+ ElementPaymentEvent["CALLBACK"] = "callback";
248
+ ElementPaymentEvent["LOG"] = "log";
249
+ return ElementPaymentEvent;
250
+ }({});
251
+ export var ConnectErrorCode = /*#__PURE__*/function (ConnectErrorCode) {
252
+ ConnectErrorCode["RISK_REJECT"] = "RISK_REJECT";
253
+ ConnectErrorCode["USER_AUTH_VERIFICATION_FAILED"] = "USER_AUTH_VERIFICATION_FAILED";
254
+ ConnectErrorCode["USER_NOT_EXISTS"] = "USER_NOT_EXISTS";
255
+ return ConnectErrorCode;
256
+ }({});
257
+ export var RiskSdkInfoEnum = /*#__PURE__*/function (RiskSdkInfoEnum) {
258
+ RiskSdkInfoEnum["NEED"] = "need";
259
+ RiskSdkInfoEnum["NO_NEED"] = "noneed";
260
+ return RiskSdkInfoEnum;
211
261
  }({});
@@ -1,6 +1,6 @@
1
- import { Iselector, renderDisplayTypeEnum } from '../types';
1
+ import { Iselector, DisplayTypeEnum } from '../types';
2
2
  /**
3
3
  * @description context中需要包含app节点,用于插入selector中
4
4
  */
5
- export declare const createIframeNode: (context: any, selector: Iselector, renderDisplayType: renderDisplayTypeEnum) => Promise<void>;
5
+ export declare const createIframeNode: (context: any, selector: Iselector, renderDisplayType: DisplayTypeEnum) => Promise<void>;
6
6
  export declare const createPreloadIframeNode: (virtualPreloadIframe: any) => void;
@@ -7,7 +7,7 @@
7
7
  /* eslint-disable @typescript-eslint/no-explicit-any */
8
8
  import { getType } from '.';
9
9
  import { ERRORMESSAGE, EVENT } from "../constant";
10
- import { messageName, renderDisplayTypeEnum } from "../types";
10
+ import { MessageName, DisplayTypeEnum } from "../types";
11
11
  /**
12
12
  * @description context中需要包含app节点,用于插入selector中
13
13
  */
@@ -24,7 +24,7 @@ export var createIframeNode = function createIframeNode(context, selector, rende
24
24
  };
25
25
  reject(error);
26
26
  context._dispatchToSDK({
27
- name: messageName.APP_TO_SDK,
27
+ name: MessageName.APP_TO_SDK,
28
28
  instanceId: context.AMSSDK._instanceId,
29
29
  context: {
30
30
  event: EVENT.error.name,
@@ -33,7 +33,7 @@ export var createIframeNode = function createIframeNode(context, selector, rende
33
33
  });
34
34
  return;
35
35
  }
36
- if (renderDisplayType === renderDisplayTypeEnum.popup) dorpinDom.innerHTML = '';
36
+ if (renderDisplayType === DisplayTypeEnum.popup) dorpinDom.innerHTML = '';
37
37
  if (context.app) {
38
38
  dorpinDom.appendChild(context.app);
39
39
  }
@@ -1,12 +1,88 @@
1
- import { isAndroid, isIOS } from "./ua";
2
- import { RULES } from "../constant/index";
1
+ var UA_MATCH_RULES = [{
2
+ matchRule: 'AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$',
3
+ iosScheme: 'https',
4
+ andScheme: ''
5
+ }, {
6
+ matchRule: 'HeyTapBrowser',
7
+ iosScheme: '',
8
+ andScheme: ''
9
+ }, {
10
+ matchRule: 'HuaweiBrowser',
11
+ iosScheme: '',
12
+ andScheme: ''
13
+ }, {
14
+ matchRule: 'Kwai',
15
+ iosScheme: 'kwai',
16
+ andScheme: ''
17
+ }, {
18
+ matchRule: 'MQQBrowser',
19
+ iosScheme: 'mttbrowser',
20
+ andScheme: ''
21
+ }, {
22
+ matchRule: 'MicroMessenger',
23
+ iosScheme: '',
24
+ andScheme: ''
25
+ }, {
26
+ matchRule: 'MiuiBrowser',
27
+ iosScheme: '',
28
+ andScheme: ''
29
+ }, {
30
+ matchRule: 'Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$',
31
+ iosScheme: 'googlechrome',
32
+ andScheme: ''
33
+ }, {
34
+ matchRule: 'Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$',
35
+ iosScheme: 'googlechrome',
36
+ andScheme: ''
37
+ }, {
38
+ matchRule: 'NewsArticle',
39
+ iosScheme: 'snssdk141',
40
+ andScheme: ''
41
+ }, {
42
+ matchRule: 'UCBrowser',
43
+ iosScheme: 'ucbrowser',
44
+ andScheme: ''
45
+ }, {
46
+ matchRule: 'VideoArticle',
47
+ iosScheme: 'snssdk32',
48
+ andScheme: ''
49
+ }, {
50
+ matchRule: 'VivoBrowser',
51
+ iosScheme: '',
52
+ andScheme: ''
53
+ }, {
54
+ matchRule: 'ZhongAnWebView',
55
+ iosScheme: 'zaapp',
56
+ andScheme: ''
57
+ }, {
58
+ matchRule: 'aweme',
59
+ iosScheme: 'snssdk1128',
60
+ andScheme: ''
61
+ }, {
62
+ matchRule: 'aweme_lite',
63
+ iosScheme: 'snssdk2329',
64
+ andScheme: ''
65
+ }, {
66
+ matchRule: 'com.xs.fm',
67
+ iosScheme: 'novelfm3040',
68
+ andScheme: ''
69
+ }, {
70
+ matchRule: 'netdisk',
71
+ iosScheme: '',
72
+ andScheme: ''
73
+ }, {
74
+ matchRule: 'qqnews',
75
+ iosScheme: 'qqnews',
76
+ andScheme: ''
77
+ }];
78
+
3
79
  /**
4
80
  * 通过配置规则检测 UA 和获得回跳 scheme
5
81
  */
6
82
  export function getBackScheme(mockUa, logger) {
7
83
  var ua = mockUa || window.navigator.userAgent || '';
8
84
  // 获取规则
9
- var uaMatchedRule = RULES;
85
+ var uaMatchedRule = UA_MATCH_RULES;
10
86
  var matchedRule;
11
87
  var matched = null;
12
88
  for (var i = 0; i < uaMatchedRule.length; i++) {
@@ -39,4 +115,20 @@ function logBackScheme(logger, userAgent, scheme) {
39
115
  backScheme: scheme
40
116
  });
41
117
  }
118
+ }
119
+
120
+ /**
121
+ * 当前运行环境是否 Android
122
+ */
123
+ function isAndroid(mockUA) {
124
+ var ua = (mockUA || navigator.userAgent).toLowerCase();
125
+ return /android|adr|linux/.test(ua);
126
+ }
127
+
128
+ /**
129
+ * 当前运行环境是否 IOS
130
+ */
131
+ function isIOS(mockUA) {
132
+ var ua = (mockUA || navigator.userAgent).toLowerCase();
133
+ return /iphone|ipad|ipod|ios|macintosh/.test(ua);
42
134
  }
@@ -1,5 +1,5 @@
1
- import { IsecurityConfig, productSceneEnum, DeviceIdParameter } from '../types';
2
- export declare const getSecurityConfigStorageKey: (scene: productSceneEnum) => string;
1
+ import { IsecurityConfig, ProductSceneEnum, DeviceIdParameter } from '../types';
2
+ export declare const getSecurityConfigStorageKey: (scene: ProductSceneEnum) => string;
3
3
  export declare enum SecurityRegionEnum {
4
4
  SG = "SG",
5
5
  US = "US",
@@ -8,7 +8,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
8
8
  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; }
9
9
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
10
  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); }
11
- import { productSceneEnum } from "../types";
11
+ import { ProductSceneEnum } from "../types";
12
12
  import APDID from "./jshield-apdid/apdid-core.umd.min";
13
13
  export var getSecurityConfigStorageKey = function getSecurityConfigStorageKey(scene) {
14
14
  return "AMSSDK_SECURITY_CONFIG_".concat(scene);
@@ -24,7 +24,7 @@ export var securityHost = {
24
24
  US: 'https://open-na-global.alipay.com/api/open/risk_client',
25
25
  DE: 'https://open-de-global.alipay.com/api/open/risk_client'
26
26
  };
27
- export var sceneMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, productSceneEnum.CASHIER_PAYMENT, 'Acquirer'), productSceneEnum.AUTO_DEBIT, 'Acquirer'), productSceneEnum.VAULTING, 'Acquirer'), productSceneEnum.CARD_APPLE_PAY, 'Acquirer'), "EASYPAY", 'EasyPay'), productSceneEnum.EASY_PAY, 'EasyPay'), productSceneEnum.FLASH_BUY, 'OneAccount'), productSceneEnum.ELEMENT_PAYMENT, 'Acquirer');
27
+ export var sceneMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ProductSceneEnum.CASHIER_PAYMENT, 'Acquirer'), ProductSceneEnum.AUTO_DEBIT, 'Acquirer'), ProductSceneEnum.VAULTING, 'Acquirer'), ProductSceneEnum.CARD_APPLE_PAY, 'Acquirer'), "EASYPAY", 'EasyPay'), ProductSceneEnum.EASY_PAY, 'EasyPay'), ProductSceneEnum.FLASH_BUY, 'OneAccount'), ProductSceneEnum.ELEMENT_PAYMENT, 'Acquirer');
28
28
  export var getSecurityHost = function getSecurityHost(region) {
29
29
  return securityHost[region] || securityHost[SecurityRegionEnum.SG];
30
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "1.23.0",
3
+ "version": "1.25.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",
@@ -15,6 +15,7 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "build": "father build",
18
+ "build:w": "father dev",
18
19
  "dev": "father dev",
19
20
  "ci": "npm run lint",
20
21
  "cov": "jest --coverage",
@@ -1,2 +0,0 @@
1
- export * from './isAndroid';
2
- export * from './isIOS';
@@ -1,2 +0,0 @@
1
- export * from "./isAndroid";
2
- export * from "./isIOS";
@@ -1,4 +0,0 @@
1
- /**
2
- * 当前运行环境是否 Android
3
- */
4
- export declare function isAndroid(mockUA?: string): boolean;
@@ -1,7 +0,0 @@
1
- /**
2
- * 当前运行环境是否 Android
3
- */
4
- export function isAndroid(mockUA) {
5
- var ua = (mockUA || navigator.userAgent).toLowerCase();
6
- return /android|adr|linux/.test(ua);
7
- }
@@ -1,4 +0,0 @@
1
- /**
2
- * 当前运行环境是否 IOS
3
- */
4
- export declare function isIOS(mockUA?: string): boolean;
@@ -1,7 +0,0 @@
1
- /**
2
- * 当前运行环境是否 IOS
3
- */
4
- export function isIOS(mockUA) {
5
- var ua = (mockUA || navigator.userAgent).toLowerCase();
6
- return /iphone|ipad|ipod|ios|macintosh/.test(ua);
7
- }