@alipay/ams-checkout 0.0.1733711101-dev.3 → 0.0.1733711101-dev.4
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.
@@ -14,29 +14,33 @@ export var LogComplianceProcessor = /*#__PURE__*/function () {
|
|
14
14
|
key: "extractComplianceParams",
|
15
15
|
value: function extractComplianceParams(eventName, params, errorLogCallback) {
|
16
16
|
var _this = this;
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
var
|
31
|
-
|
32
|
-
if (key in LogComplianceExtendKeys.complianceExtParams) {
|
33
|
-
newParams[key] = "".concat(params[key]);
|
34
|
-
} else {
|
17
|
+
try {
|
18
|
+
// 触发防抖上报
|
19
|
+
logDebounceTracker.track(function () {
|
20
|
+
_this.flushAbnormalInfo(errorLogCallback);
|
21
|
+
});
|
22
|
+
// 事件名检测
|
23
|
+
var isSpmId = eventName ? eventName.includes('.') : false;
|
24
|
+
if (!isSpmId) {
|
25
|
+
// 非SPM,说明是未做映射的,需要加到埋点里面
|
26
|
+
this.reportHasAbnormalEventName(eventName);
|
27
|
+
}
|
28
|
+
var newParams = {};
|
29
|
+
// 逐个字段检查
|
30
|
+
for (var _i = 0, _Object$keys = Object.keys(params); _i < _Object$keys.length; _i++) {
|
31
|
+
var key = _Object$keys[_i];
|
35
32
|
// 如果当前字段不在合规表中,说明是未合规字段,剔除并且上报异常
|
36
|
-
|
33
|
+
if (key in LogComplianceExtendKeys.complianceExtParams) {
|
34
|
+
newParams[key] = "".concat(params[key]);
|
35
|
+
} else {
|
36
|
+
// 如果当前字段不在合规表中,说明是未合规字段,剔除并且上报异常
|
37
|
+
this.reportHasIllegalExtendInfoKey(eventName, key);
|
38
|
+
}
|
37
39
|
}
|
40
|
+
return newParams;
|
41
|
+
} catch (error) {
|
42
|
+
console.error(error);
|
38
43
|
}
|
39
|
-
return newParams;
|
40
44
|
}
|
41
45
|
}, {
|
42
46
|
key: "reportHasAbnormalEventName",
|
@@ -54,38 +58,43 @@ export var LogComplianceProcessor = /*#__PURE__*/function () {
|
|
54
58
|
}, {
|
55
59
|
key: "flushAbnormalInfo",
|
56
60
|
value: function flushAbnormalInfo(errorLogCallback) {
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
+
try {
|
62
|
+
var _this$abnormalEventNa;
|
63
|
+
if (((_this$abnormalEventNa = this.abnormalEventNameSet) === null || _this$abnormalEventNa === void 0 ? void 0 : _this$abnormalEventNa.size) > 0) {
|
64
|
+
// 不正常的事件名按|分割
|
65
|
+
// Abnormal event use event name with divider "|"
|
66
|
+
var abnormalEventNames = Array.from(this.abnormalEventNameSet).join('|');
|
67
|
+
errorLogCallback && errorLogCallback({
|
68
|
+
title: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_NAME.spmId
|
69
|
+
}, {
|
70
|
+
eventAlias: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_NAME.alias,
|
71
|
+
errorMessage: abnormalEventNames
|
72
|
+
});
|
73
|
+
this.abnormalEventNameSet.clear();
|
74
|
+
}
|
75
|
+
// process nonComplianceEventKeys
|
76
|
+
// eg: if sdk_event_createComponent has key1,key2,key3
|
77
|
+
// sdk_event_createComponent>key1+key2+key3|otherEventName>key1+key2+key3
|
78
|
+
var nonComplianceEventKeysList = [];
|
79
|
+
if (Object.keys(this.nonComplianceEventKeys).length === 0) {
|
80
|
+
return;
|
81
|
+
}
|
82
|
+
for (var eventName in this.nonComplianceEventKeys) {
|
83
|
+
var keys = this.nonComplianceEventKeys[eventName];
|
84
|
+
var keyStr = "".concat(eventName, ">").concat(Array.from(keys).join('+'));
|
85
|
+
nonComplianceEventKeysList.push(keyStr);
|
86
|
+
}
|
87
|
+
var nonComplianceEventKeysLogString = nonComplianceEventKeysList.join('|');
|
61
88
|
errorLogCallback && errorLogCallback({
|
62
|
-
title: KEYS.
|
89
|
+
title: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_EXT_INFO.spmId
|
63
90
|
}, {
|
64
|
-
eventAlias: KEYS.
|
65
|
-
errorMessage:
|
91
|
+
eventAlias: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_EXT_INFO.alias,
|
92
|
+
errorMessage: nonComplianceEventKeysLogString
|
66
93
|
});
|
67
|
-
this.
|
68
|
-
}
|
69
|
-
|
70
|
-
// eg: if sdk_event_createComponent has key1,key2,key3
|
71
|
-
// sdk_event_createComponent>key1+key2+key3|otherEventName>key1+key2+key3
|
72
|
-
var nonComplianceEventKeysList = [];
|
73
|
-
if (Object.keys(this.nonComplianceEventKeys).length === 0) {
|
74
|
-
return;
|
75
|
-
}
|
76
|
-
for (var eventName in this.nonComplianceEventKeys) {
|
77
|
-
var keys = this.nonComplianceEventKeys[eventName];
|
78
|
-
var keyStr = "".concat(eventName, ">").concat(Array.from(keys).join('+'));
|
79
|
-
nonComplianceEventKeysList.push(keyStr);
|
94
|
+
this.nonComplianceEventKeys = {};
|
95
|
+
} catch (error) {
|
96
|
+
console.error(error);
|
80
97
|
}
|
81
|
-
var nonComplianceEventKeysLogString = nonComplianceEventKeysList.join('|');
|
82
|
-
errorLogCallback && errorLogCallback({
|
83
|
-
title: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_EXT_INFO.spmId
|
84
|
-
}, {
|
85
|
-
eventAlias: KEYS.EVENT_SDK_ON_ABNORMAL_EVENT_EXT_INFO.alias,
|
86
|
-
errorMessage: nonComplianceEventKeysLogString
|
87
|
-
});
|
88
|
-
this.nonComplianceEventKeys = {};
|
89
98
|
}
|
90
99
|
}]);
|
91
100
|
return LogComplianceProcessor;
|
@@ -80,6 +80,7 @@ export var RequesterService = /*#__PURE__*/function () {
|
|
80
80
|
errorMessage = (resData === null || resData === void 0 ? void 0 : resData.errorMessage) || (handleGetWayError === null || handleGetWayError === void 0 ? void 0 : handleGetWayError.errorMessage);
|
81
81
|
errorCode = handleGetWayError === null || handleGetWayError === void 0 ? void 0 : handleGetWayError.errorCode;
|
82
82
|
this.reportRequestTimeCost({
|
83
|
+
title: 'a3753.b101271.c388193.d521387',
|
83
84
|
name: options === null || options === void 0 ? void 0 : options['Operation-Type'],
|
84
85
|
label: 'request',
|
85
86
|
time: Date.now() - startTime,
|
@@ -95,6 +96,7 @@ export var RequesterService = /*#__PURE__*/function () {
|
|
95
96
|
}));
|
96
97
|
case 20:
|
97
98
|
this.reportRequestTimeCost({
|
99
|
+
title: 'a3753.b101271.c388193.d521387',
|
98
100
|
name: options === null || options === void 0 ? void 0 : options['Operation-Type'],
|
99
101
|
label: 'request',
|
100
102
|
time: Date.now() - startTime,
|
@@ -116,6 +118,7 @@ export var RequesterService = /*#__PURE__*/function () {
|
|
116
118
|
timeoutCode = _context.t0 !== null && _context.t0 !== void 0 && (_error$message = _context.t0.message) !== null && _error$message !== void 0 && _error$message.includes('timeout') ? errorEnum.TIMEOUT : '';
|
117
119
|
_errorCode = (_error === null || _error === void 0 ? void 0 : _error.errorCode) || timeoutCode;
|
118
120
|
this.reportRequestTimeCost({
|
121
|
+
title: 'a3753.b101271.c388193.d521387',
|
119
122
|
name: options === null || options === void 0 ? void 0 : options['Operation-Type'],
|
120
123
|
label: 'request',
|
121
124
|
time: Date.now() - startTime,
|