@alipay/ams-checkout 1.39.0 → 1.41.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.
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/component/component.inline.style.js +1 -1
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +7 -7
- package/esm/core/component/index.d.ts +1 -1
- package/esm/foundation/product-processor/autoDebit/deps.d.ts +14 -0
- package/esm/foundation/product-processor/autoDebit/deps.js +12 -0
- package/esm/foundation/product-processor/autoDebit/index.d.ts +48 -0
- package/esm/foundation/product-processor/autoDebit/index.js +466 -0
- package/esm/foundation/service/container/index.js +6 -5
- package/esm/foundation/service/requester/requester.js +2 -2
- package/esm/foundation/utils/web_app_url_utils.d.ts +3 -3
- package/esm/foundation/utils/web_app_url_utils.js +15 -11
- package/esm/index.d.ts +8 -5
- package/esm/index.js +101 -52
- package/esm/plugin/component/cashierApp.js +2 -2
- package/esm/request/index.js +2 -2
- package/esm/types/index.d.ts +13 -6
- package/esm/types/index.js +2 -1
- package/esm/util/index.d.ts +12 -1
- package/esm/util/index.js +39 -3
- package/esm/util/spm-map.d.ts +18 -4
- package/esm/util/spm-map.js +20 -6
- package/package.json +1 -1
package/esm/util/index.js
CHANGED
@@ -148,14 +148,33 @@ var isAndroid = /Android/i.test(UA);
|
|
148
148
|
var isMacOS = /\bMacintosh\b/.test(UA);
|
149
149
|
var isWindowsNT = /Windows NT/.test(UA);
|
150
150
|
var isMobile = function isMobile() {
|
151
|
-
return /Android|iPhone|iPad|iPod|Mobile/.test(UA);
|
151
|
+
return /Android|iPhone|iPad|iPod|Mobile/.test(UA) || isOpenHarmonyMobile();
|
152
|
+
};
|
153
|
+
var isOpenHarmony = function isOpenHarmony() {
|
154
|
+
// 检查是否为鸿蒙操作系统
|
155
|
+
return /OpenHarmony/i.test(navigator.userAgent);
|
156
|
+
};
|
157
|
+
var isOpenHarmonyMobile = function isOpenHarmonyMobile() {
|
158
|
+
// 检查是否为鸿蒙操作系统
|
159
|
+
var isHarmonyOS = /OpenHarmony/i.test(navigator.userAgent);
|
160
|
+
// 检查是否为手机设备
|
161
|
+
var isPhone = /Phone/i.test(navigator.userAgent);
|
162
|
+
// 检查是否为平板设备
|
163
|
+
var isTablet = /Tablet/i.test(navigator.userAgent);
|
164
|
+
// 返回是否为鸿蒙手机或平板
|
165
|
+
return isHarmonyOS && (isPhone || isTablet);
|
166
|
+
};
|
167
|
+
var isOpenHarmonyPC = function isOpenHarmonyPC() {
|
168
|
+
// 检查是否为鸿蒙操作系统
|
169
|
+
return /OpenHarmony/i.test(navigator.userAgent) && /PC/i.test(navigator.userAgent);
|
152
170
|
};
|
153
171
|
var device = {
|
154
172
|
iOS: isIOS,
|
155
173
|
Android: isAndroid,
|
156
174
|
macOS: isMacOS,
|
157
175
|
WindowsNT: isWindowsNT,
|
158
|
-
isMobile: !!isMobile()
|
176
|
+
isMobile: !!isMobile(),
|
177
|
+
isOpenHarmonyMobile: !!isOpenHarmonyMobile()
|
159
178
|
};
|
160
179
|
var safeJson = function safeJson(data, obj) {
|
161
180
|
try {
|
@@ -343,4 +362,21 @@ var isEmpty = function isEmpty(value) {
|
|
343
362
|
}
|
344
363
|
return false;
|
345
364
|
};
|
346
|
-
|
365
|
+
|
366
|
+
/**
|
367
|
+
* 判断一个值是否为真
|
368
|
+
* @param value 要判断的值
|
369
|
+
* @returns 如果值为true或者字符串"true"(不区分大小写),则返回true,否则返回false
|
370
|
+
*/
|
371
|
+
var isTrue = function isTrue(value) {
|
372
|
+
return value === true || typeof value === 'string' && value.toLowerCase() === 'true';
|
373
|
+
};
|
374
|
+
export var omit = function omit(obj, keys) {
|
375
|
+
return Object.keys(obj).reduce(function (acc, key) {
|
376
|
+
if (!keys.includes(key)) {
|
377
|
+
acc[key] = obj[key];
|
378
|
+
}
|
379
|
+
return acc;
|
380
|
+
}, {});
|
381
|
+
};
|
382
|
+
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, loadSDKScript, isEmpty, isTrue };
|
package/esm/util/spm-map.d.ts
CHANGED
@@ -1,4 +1,22 @@
|
|
1
|
+
export declare const ELEMENT_SPM_MAP: {
|
2
|
+
sdk_event_mount_element: string;
|
3
|
+
sdk_element_create: string;
|
4
|
+
sdk_element_mount_fail: string;
|
5
|
+
sdk_element_mount_start: string;
|
6
|
+
multiple_instance_error: string;
|
7
|
+
auto_apple_pay_start: string;
|
8
|
+
auto_apple_pay_failed: string;
|
9
|
+
auto_apple_pay_success: string;
|
10
|
+
};
|
1
11
|
export declare const SPM_MAP: {
|
12
|
+
sdk_event_mount_element: string;
|
13
|
+
sdk_element_create: string;
|
14
|
+
sdk_element_mount_fail: string;
|
15
|
+
sdk_element_mount_start: string;
|
16
|
+
multiple_instance_error: string;
|
17
|
+
auto_apple_pay_start: string;
|
18
|
+
auto_apple_pay_failed: string;
|
19
|
+
auto_apple_pay_success: string;
|
2
20
|
sdk_error_runtime_error: string;
|
3
21
|
sdk_event_sdkQuery_failed: string;
|
4
22
|
container_error_error_insert_js: string;
|
@@ -28,7 +46,6 @@ export declare const SPM_MAP: {
|
|
28
46
|
sdk_event_webAppTimeout: string;
|
29
47
|
sdk_error_getGaidFailed: string;
|
30
48
|
sdk_error_securitySdkInitTokenFailed: string;
|
31
|
-
sdk_event_mount_element: string;
|
32
49
|
container_error_error_invalid_param: string;
|
33
50
|
container_error_error_set_ua_failed: string;
|
34
51
|
sdk_event_onAddressResult: string;
|
@@ -164,9 +181,6 @@ export declare const SPM_MAP: {
|
|
164
181
|
load_item_sdk_timeout: string;
|
165
182
|
MerchantValidationError: string;
|
166
183
|
PaymentAuthorizedError: string;
|
167
|
-
sdk_element_create: string;
|
168
|
-
sdk_element_mount_fail: string;
|
169
|
-
sdk_element_mount_start: string;
|
170
184
|
'ApplePaySession is only support in Safari': string;
|
171
185
|
'Abnormal params paymentSessionFactor': string;
|
172
186
|
'Abnormal params recurringInfo': string;
|
package/esm/util/spm-map.js
CHANGED
@@ -1,4 +1,22 @@
|
|
1
|
-
|
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
4
|
+
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; }
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
6
|
+
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); }
|
7
|
+
// 埋点维护地址: https://log.alipay.com/index_v4.htm/home/common?spma=a3753&tabKey=log
|
8
|
+
|
9
|
+
export var ELEMENT_SPM_MAP = {
|
10
|
+
sdk_event_mount_element: 'a3753.b101271.c388193.d513193',
|
11
|
+
sdk_element_create: 'a3753.b101271.c386688',
|
12
|
+
sdk_element_mount_fail: 'a3753.b101271.c386691',
|
13
|
+
sdk_element_mount_start: 'a3753.b101271.c386690',
|
14
|
+
multiple_instance_error: 'a3753.b101271.c403950',
|
15
|
+
auto_apple_pay_start: 'a3753.b107385.c398110',
|
16
|
+
auto_apple_pay_failed: 'a3753.b107385.c398111',
|
17
|
+
auto_apple_pay_success: 'a3753.b107385.c398112'
|
18
|
+
};
|
19
|
+
export var SPM_MAP = _objectSpread({
|
2
20
|
sdk_error_runtime_error: 'a3753.b101271.c388188.d512342',
|
3
21
|
sdk_event_sdkQuery_failed: 'a3753.b101271.c388188.d512343',
|
4
22
|
container_error_error_insert_js: 'a3753.b101271.c388188.d512344',
|
@@ -28,7 +46,6 @@ export var SPM_MAP = {
|
|
28
46
|
sdk_event_webAppTimeout: 'a3753.b101271.c388189.d512356',
|
29
47
|
sdk_error_getGaidFailed: 'a3753.b101271.c388193.d513038',
|
30
48
|
sdk_error_securitySdkInitTokenFailed: 'a3753.b101271.c388193.d513044',
|
31
|
-
sdk_event_mount_element: 'a3753.b101271.c388193.d513193',
|
32
49
|
container_error_error_invalid_param: 'a3753.b101271.c388193.d513220',
|
33
50
|
container_error_error_set_ua_failed: 'a3753.b101271.c388193.d513221',
|
34
51
|
sdk_event_onAddressResult: 'a3753.b101271.c388193.d513194',
|
@@ -164,12 +181,9 @@ export var SPM_MAP = {
|
|
164
181
|
load_item_sdk_timeout: 'a3753.b101271.c388188.d512345',
|
165
182
|
MerchantValidationError: 'a3753.b101271.c388189.d518377',
|
166
183
|
PaymentAuthorizedError: 'a3753.b101271.c388189.d518377',
|
167
|
-
sdk_element_create: 'a3753.b101271.c386688',
|
168
|
-
sdk_element_mount_fail: 'a3753.b101271.c386691',
|
169
|
-
sdk_element_mount_start: 'a3753.b101271.c386690',
|
170
184
|
'ApplePaySession is only support in Safari': 'a3753.b101271.c388189.d518377',
|
171
185
|
'Abnormal params paymentSessionFactor': 'a3753.b101271.c388189.d518377',
|
172
186
|
'Abnormal params recurringInfo': 'a3753.b101271.c388189.d518377',
|
173
187
|
'Payment processing but user dismissed the sheet': 'a3753.b101271.c388189.d518377',
|
174
188
|
'User dismissed the sheet': 'a3753.b101271.c388189.d518377'
|
175
|
-
};
|
189
|
+
}, ELEMENT_SPM_MAP);
|