@alipay/ams-checkout 0.0.1725951289-dev.4 → 0.0.1726046231-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/config/index.d.ts +7 -7
  3. package/esm/config/index.js +7 -7
  4. package/esm/constant/index.d.ts +6 -8
  5. package/esm/constant/index.js +9 -81
  6. package/esm/core/bus/ability/globalData.d.ts +10 -0
  7. package/esm/core/bus/ability/globalData.js +89 -0
  8. package/esm/core/bus/ability/request.d.ts +10 -0
  9. package/esm/core/bus/ability/request.js +151 -0
  10. package/esm/core/bus/interface.d.ts +12 -0
  11. package/esm/core/bus/interface.js +16 -2
  12. package/esm/core/component/address.d.ts +2 -2
  13. package/esm/core/component/appPreloadProcessing.js +2 -0
  14. package/esm/core/component/ckp/index.d.ts +3 -3
  15. package/esm/core/component/ckp/index.js +3 -3
  16. package/esm/core/component/element/components/address.d.ts +17 -0
  17. package/esm/core/component/element/components/address.js +63 -0
  18. package/esm/core/component/element/components/auth.d.ts +17 -0
  19. package/esm/core/component/element/components/auth.js +54 -0
  20. package/esm/core/component/element/components/payment.d.ts +17 -0
  21. package/esm/core/component/element/components/payment.js +67 -0
  22. package/esm/core/component/element/index.d.ts +44 -0
  23. package/esm/core/component/element/index.js +615 -0
  24. package/esm/core/component/element/mock.d.ts +3 -0
  25. package/esm/core/component/element/mock.js +1156 -0
  26. package/esm/core/component/element/type.d.ts +120 -0
  27. package/esm/core/component/element/type.js +14 -0
  28. package/esm/core/component/element/utils.d.ts +13 -0
  29. package/esm/core/component/element/utils.js +6 -0
  30. package/esm/core/component/index.d.ts +5 -5
  31. package/esm/core/component/index.js +20 -16
  32. package/esm/core/drop-in/index.d.ts +2 -2
  33. package/esm/core/drop-in/index.js +2 -2
  34. package/esm/core/instance/index.d.ts +5 -6
  35. package/esm/core/instance/index.js +11 -14
  36. package/esm/foundation/core/index.d.ts +26 -0
  37. package/esm/foundation/core/index.js +301 -0
  38. package/esm/foundation/index.d.ts +71 -0
  39. package/esm/foundation/index.js +42 -0
  40. package/esm/foundation/product-processor/easysafepay/deps.d.ts +15 -0
  41. package/esm/foundation/product-processor/easysafepay/deps.js +9 -0
  42. package/esm/foundation/product-processor/easysafepay/index.d.ts +26 -0
  43. package/esm/foundation/product-processor/easysafepay/index.js +536 -0
  44. package/esm/foundation/service/container/index.d.ts +28 -0
  45. package/esm/foundation/service/container/index.js +255 -0
  46. package/esm/foundation/service/container/popup.d.ts +17 -0
  47. package/esm/foundation/service/container/popup.js +103 -0
  48. package/esm/foundation/service/container/utils.d.ts +7 -0
  49. package/esm/foundation/service/container/utils.js +48 -0
  50. package/esm/foundation/service/event-bus/ability/callback.d.ts +9 -0
  51. package/esm/foundation/service/event-bus/ability/callback.js +55 -0
  52. package/esm/foundation/service/event-bus/ability/globalData.d.ts +10 -0
  53. package/esm/foundation/service/event-bus/ability/globalData.js +89 -0
  54. package/esm/foundation/service/event-bus/ability/request.d.ts +10 -0
  55. package/esm/foundation/service/event-bus/ability/request.js +151 -0
  56. package/esm/foundation/service/event-bus/ability/security.d.ts +12 -0
  57. package/esm/foundation/service/event-bus/ability/security.js +151 -0
  58. package/esm/foundation/service/event-bus/ability/tracker.d.ts +9 -0
  59. package/esm/foundation/service/event-bus/ability/tracker.js +80 -0
  60. package/esm/foundation/service/event-bus/busManager.d.ts +127 -0
  61. package/esm/foundation/service/event-bus/busManager.js +398 -0
  62. package/esm/foundation/service/event-bus/index.d.ts +20 -0
  63. package/esm/foundation/service/event-bus/index.js +88 -0
  64. package/esm/foundation/service/event-center.d.ts +75 -0
  65. package/esm/foundation/service/event-center.js +244 -0
  66. package/esm/foundation/service/global-data/index.d.ts +11 -0
  67. package/esm/foundation/service/global-data/index.js +69 -0
  68. package/esm/foundation/service/index.d.ts +19 -0
  69. package/esm/foundation/service/index.js +82 -0
  70. package/esm/foundation/service/log/index.d.ts +43 -0
  71. package/esm/foundation/service/log/index.js +235 -0
  72. package/esm/foundation/service/log/types.d.ts +32 -0
  73. package/esm/foundation/service/log/types.js +1 -0
  74. package/esm/foundation/service/requester/deps.d.ts +17 -0
  75. package/esm/foundation/service/requester/deps.js +11 -0
  76. package/esm/foundation/service/requester/requester.d.ts +22 -0
  77. package/esm/foundation/service/requester/requester.js +211 -0
  78. package/esm/foundation/service/security/index.d.ts +26 -0
  79. package/esm/foundation/service/security/index.js +216 -0
  80. package/esm/{util → foundation/service/security}/security.d.ts +2 -2
  81. package/esm/{util → foundation/service/security}/security.js +3 -3
  82. package/esm/foundation/types/index.d.ts +4 -0
  83. package/esm/foundation/types/index.js +4 -0
  84. package/esm/foundation/utils/gray_scale_utils.d.ts +7 -0
  85. package/esm/foundation/utils/gray_scale_utils.js +40 -0
  86. package/esm/foundation/utils/payment_context_utils.d.ts +13 -0
  87. package/esm/foundation/utils/payment_context_utils.js +57 -0
  88. package/esm/foundation/utils/redirect_utils.d.ts +6 -0
  89. package/esm/foundation/utils/redirect_utils.js +99 -0
  90. package/esm/foundation/utils/system_events.d.ts +4 -0
  91. package/esm/foundation/utils/system_events.js +71 -0
  92. package/esm/foundation/utils/web_app_url_utils.d.ts +37 -0
  93. package/esm/foundation/utils/web_app_url_utils.js +97 -0
  94. package/esm/index.d.ts +16 -10
  95. package/esm/index.js +70 -59
  96. package/esm/plugin/applepay/component.js +3 -3
  97. package/esm/plugin/applepay/service.d.ts +2 -2
  98. package/esm/plugin/applepay/service.js +2 -2
  99. package/esm/plugin/component/cashierApp.d.ts +7 -5
  100. package/esm/plugin/component/cashierApp.js +16 -8
  101. package/esm/plugin/component/channel.d.ts +3 -4
  102. package/esm/plugin/component/channel.js +1 -37
  103. package/esm/plugin/component/component.inline.style.d.ts +4 -4
  104. package/esm/plugin/component/component.inline.style.js +10 -7
  105. package/esm/plugin/component/component.popup.style.d.ts +15 -6
  106. package/esm/plugin/component/component.popup.style.js +33 -15
  107. package/esm/plugin/component/index.d.ts +7 -8
  108. package/esm/plugin/component/index.js +130 -176
  109. package/esm/plugin/const.js +5 -5
  110. package/esm/plugin/drop-in/index.d.ts +5 -5
  111. package/esm/plugin/drop-in/index.js +7 -7
  112. package/esm/plugin/payment-element/utils.d.ts +1 -1
  113. package/esm/plugin/payment-element/utils.js +2 -1
  114. package/esm/plugin/type.d.ts +4 -4
  115. package/esm/service/element.d.ts +4 -0
  116. package/esm/service/element.js +51 -0
  117. package/esm/service/index.d.ts +1 -0
  118. package/esm/service/index.js +2 -0
  119. package/esm/types/index.d.ts +257 -39
  120. package/esm/types/index.js +107 -59
  121. package/esm/util/createIframeNode.d.ts +2 -2
  122. package/esm/util/createIframeNode.js +3 -3
  123. package/esm/util/index.d.ts +1 -1
  124. package/esm/util/index.js +3 -4
  125. package/package.json +2 -2
  126. package/esm/util/getBackScheme.d.ts +0 -5
  127. package/esm/util/getBackScheme.js +0 -42
  128. package/esm/util/ua/index.d.ts +0 -2
  129. package/esm/util/ua/index.js +0 -2
  130. package/esm/util/ua/isAndroid.d.ts +0 -4
  131. package/esm/util/ua/isAndroid.js +0 -7
  132. package/esm/util/ua/isIOS.d.ts +0 -4
  133. package/esm/util/ua/isIOS.js +0 -7
@@ -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
  }
@@ -4,7 +4,6 @@
4
4
  * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
5
5
  * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
6
6
  */
7
- declare const getType: (target: any) => string;
8
7
  declare class EventCenter {
9
8
  private events;
10
9
  private eventsKey;
@@ -15,6 +14,7 @@ declare class EventCenter {
15
14
  once(name: string, func: any, key?: string): void;
16
15
  isExist(name: string): boolean;
17
16
  }
17
+ declare const getType: (target: any) => string;
18
18
  declare const getViewPort: (key: string) => any;
19
19
  declare const getOrigin: () => string;
20
20
  declare const serialize: (obj: Record<string, string>) => string;
package/esm/util/index.js CHANGED
@@ -12,10 +12,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
12
12
  * 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.
13
13
  */
14
14
  /* eslint-disable @typescript-eslint/no-explicit-any */
15
-
16
- var getType = function getType(target) {
17
- return Object.prototype.toString.call(target).slice(8, -1).toLowerCase();
18
- };
19
15
  var EventCenter = /*#__PURE__*/function () {
20
16
  function EventCenter() {
21
17
  _classCallCheck(this, EventCenter);
@@ -91,6 +87,9 @@ var EventCenter = /*#__PURE__*/function () {
91
87
  }]);
92
88
  return EventCenter;
93
89
  }();
90
+ var getType = function getType(target) {
91
+ return Object.prototype.toString.call(target).slice(8, -1).toLowerCase();
92
+ };
94
93
  var getViewPort = function getViewPort(key) {
95
94
  var meta = document.getElementsByTagName('meta');
96
95
  // HTMLMetaElement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1725951289-dev.4",
3
+ "version": "0.0.1726046231-dev.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",
@@ -15,7 +15,7 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "build": "father build",
18
- "dev": "father dev",
18
+ "build:w": "father dev",
19
19
  "ci": "npm run lint",
20
20
  "cov": "jest --coverage",
21
21
  "format": "prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"",
@@ -1,5 +0,0 @@
1
- import { Logger } from './logger';
2
- /**
3
- * 通过配置规则检测 UA 和获得回跳 scheme
4
- */
5
- export declare function getBackScheme(mockUa?: string, logger?: Logger): any;
@@ -1,42 +0,0 @@
1
- import { isAndroid, isIOS } from "./ua";
2
- import { RULES } from "../constant/index";
3
- /**
4
- * 通过配置规则检测 UA 和获得回跳 scheme
5
- */
6
- export function getBackScheme(mockUa, logger) {
7
- var ua = mockUa || window.navigator.userAgent || '';
8
- // 获取规则
9
- var uaMatchedRule = RULES;
10
- var matchedRule;
11
- var matched = null;
12
- for (var i = 0; i < uaMatchedRule.length; i++) {
13
- var rule = uaMatchedRule[i];
14
- matched = ua.match(rule.matchRule);
15
- if (matched) {
16
- matchedRule = rule;
17
- break;
18
- }
19
- }
20
- if (!matchedRule) {
21
- logBackScheme(logger, ua, '');
22
- return;
23
- }
24
- if (isAndroid(ua)) {
25
- logBackScheme(logger, ua, matchedRule.andScheme);
26
- return matchedRule.andScheme;
27
- }
28
- if (isIOS(ua)) {
29
- logBackScheme(logger, ua, matchedRule.iosScheme);
30
- return matchedRule.iosScheme;
31
- }
32
- }
33
- function logBackScheme(logger, userAgent, scheme) {
34
- if (logger) {
35
- logger.logInfo({
36
- title: 'a3753.b101271.c377460'
37
- }, {
38
- userAgent: userAgent,
39
- backScheme: scheme
40
- });
41
- }
42
- }
@@ -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
- }