@alipay/ams-checkout 0.0.1710748686-dev.2 → 0.0.1711691167-dev.2
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/constant/index.d.ts +2 -2
- package/esm/constant/index.js +4 -4
- package/esm/core/bus/ability/callback.d.ts +9 -0
- package/esm/core/bus/ability/callback.js +55 -0
- package/esm/core/bus/ability/security.d.ts +10 -0
- package/esm/core/bus/ability/security.js +104 -0
- package/esm/core/bus/ability/tracker.d.ts +9 -0
- package/esm/core/bus/ability/tracker.js +77 -0
- package/esm/core/bus/index.d.ts +125 -0
- package/esm/core/bus/index.js +366 -0
- package/esm/core/bus/interface.d.ts +36 -0
- package/esm/core/bus/interface.js +40 -0
- package/esm/core/component/index.d.ts +15 -1
- package/esm/core/component/index.js +189 -26
- package/esm/core/instance/index.d.ts +12 -1
- package/esm/core/instance/index.js +54 -11
- package/esm/index.d.ts +0 -3
- package/esm/index.js +8 -18
- package/esm/{core/applepay/index.d.ts → plugin/applepay/component.d.ts} +27 -8
- package/esm/{core/applepay/index.js → plugin/applepay/component.js} +150 -180
- package/esm/plugin/applepay/index.d.ts +17 -0
- package/esm/plugin/applepay/index.js +117 -0
- package/esm/{common → plugin}/applepay/interface.d.ts +62 -3
- package/esm/plugin/applepay/interface.js +69 -0
- package/esm/{common/applepay/index.d.ts → plugin/applepay/service.d.ts} +13 -7
- package/esm/{common/applepay/index.js → plugin/applepay/service.js} +159 -41
- package/esm/plugin/component/index.d.ts +2 -2
- package/esm/plugin/component/index.js +68 -46
- package/esm/plugin/const.d.ts +2 -0
- package/esm/plugin/const.js +33 -0
- package/esm/plugin/paypal/index.d.ts +20 -0
- package/esm/plugin/paypal/index.js +377 -0
- package/esm/plugin/type.d.ts +33 -0
- package/esm/plugin/utils.d.ts +6 -0
- package/esm/plugin/utils.js +21 -0
- package/esm/request/index.d.ts +1 -1
- package/esm/service/index.d.ts +1 -1
- package/esm/types/index.d.ts +108 -6
- package/esm/types/index.js +26 -1
- package/esm/util/index.d.ts +2 -1
- package/esm/util/index.js +4 -2
- package/esm/util/logger.d.ts +4 -0
- package/esm/util/logger.js +23 -3
- package/esm/util/versionCompare.d.ts +1 -1
- package/package.json +1 -1
- /package/esm/{common/applepay/interface.js → plugin/type.js} +0 -0
package/esm/types/index.js
CHANGED
@@ -41,6 +41,15 @@ export var paymentMethodCategoryTypeEnum = /*#__PURE__*/function (paymentMethodC
|
|
41
41
|
paymentMethodCategoryTypeEnum["APM"] = "APM";
|
42
42
|
return paymentMethodCategoryTypeEnum;
|
43
43
|
}({});
|
44
|
+
export var payPalConfigurationIntentEnum = /*#__PURE__*/function (payPalConfigurationIntentEnum) {
|
45
|
+
payPalConfigurationIntentEnum["intent"] = "intent";
|
46
|
+
payPalConfigurationIntentEnum["capture"] = "capture";
|
47
|
+
return payPalConfigurationIntentEnum;
|
48
|
+
}({});
|
49
|
+
export var PaymentAmountEnum = /*#__PURE__*/function (PaymentAmountEnum) {
|
50
|
+
PaymentAmountEnum["USD"] = "USD";
|
51
|
+
return PaymentAmountEnum;
|
52
|
+
}({});
|
44
53
|
export var localeEnum = /*#__PURE__*/function (localeEnum) {
|
45
54
|
localeEnum["en-US"] = "en-US";
|
46
55
|
return localeEnum;
|
@@ -153,9 +162,14 @@ export var eventCodeEnum = /*#__PURE__*/function (eventCodeEnum) {
|
|
153
162
|
eventCodeEnum["SDK_CREATECOMPONENT_ERROR"] = "SDK_CREATECOMPONENT_ERROR";
|
154
163
|
eventCodeEnum["SDK_CALL_URL_ERROR"] = "SDK_CALL_URL_ERROR";
|
155
164
|
eventCodeEnum["SDK_CALL_URL_SUCCESS"] = "SDK_CALL_URL_SUCCESS";
|
156
|
-
eventCodeEnum["
|
165
|
+
eventCodeEnum["SDK_PAYMENT_SUCCESSFUL"] = "SDK_PAYMENT_SUCCESSFUL";
|
157
166
|
eventCodeEnum["SDK_PAYMENT_FAIL"] = "SDK_PAYMENT_FAIL";
|
167
|
+
eventCodeEnum["SDK_PAYMENT_ERROR"] = "SDK_PAYMENT_ERROR";
|
158
168
|
eventCodeEnum["SDK_PAYMENT_CANCEL"] = "SDK_PAYMENT_CANCEL";
|
169
|
+
eventCodeEnum["SDK_PAYMENT_PROCESSING"] = "SDK_PAYMENT_PROCESSING";
|
170
|
+
eventCodeEnum["SDK_PAYMENT_WARN"] = "SDK_PAYMENT_WARN";
|
171
|
+
eventCodeEnum["SDK_PAYMENT_SHIPPINGCHANGE"] = "SDK_PAYMENT_SHIPPINGCHANGE";
|
172
|
+
eventCodeEnum["SDK_PAYMENT_APPROVE"] = "SDK_PAYMENT_APPROVE";
|
159
173
|
return eventCodeEnum;
|
160
174
|
}({});
|
161
175
|
export var RedirectType = /*#__PURE__*/function (RedirectType) {
|
@@ -164,4 +178,15 @@ export var RedirectType = /*#__PURE__*/function (RedirectType) {
|
|
164
178
|
RedirectType["NormalUrl"] = "NormalUrl";
|
165
179
|
RedirectType["Unknown"] = "Unknown";
|
166
180
|
return RedirectType;
|
181
|
+
}({});
|
182
|
+
export var PaypalMethodEnum = /*#__PURE__*/function (PaypalMethodEnum) {
|
183
|
+
PaypalMethodEnum["PAYPAL_CHECKOUT"] = "PAYPAL_CHECKOUT";
|
184
|
+
PaypalMethodEnum["PAYPAL_VAULT"] = "PAYPAL_VAULT";
|
185
|
+
PaypalMethodEnum["PAYPAL_PAYLATER"] = "PAYPAL_PAYLATER";
|
186
|
+
return PaypalMethodEnum;
|
187
|
+
}({});
|
188
|
+
export var ProductSceneVersion = /*#__PURE__*/function (ProductSceneVersion) {
|
189
|
+
ProductSceneVersion["V1"] = "1.0";
|
190
|
+
ProductSceneVersion["V2"] = "2.0";
|
191
|
+
return ProductSceneVersion;
|
167
192
|
}({});
|
package/esm/util/index.d.ts
CHANGED
@@ -37,5 +37,6 @@ declare const addSetFontSizeEvent: () => void;
|
|
37
37
|
*/
|
38
38
|
declare const getOrSetStorageId: (key: string, value?: string) => string;
|
39
39
|
declare const checkTimeElapsed: () => boolean;
|
40
|
+
declare const isFunction: (func: any) => boolean;
|
40
41
|
declare function parseBase64ToString(base64: string): string;
|
41
|
-
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, };
|
42
|
+
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, };
|
package/esm/util/index.js
CHANGED
@@ -246,7 +246,9 @@ var checkTimeElapsed = function checkTimeElapsed() {
|
|
246
246
|
localStorage.setItem(key, currentTime.toString());
|
247
247
|
return true;
|
248
248
|
};
|
249
|
-
|
249
|
+
var isFunction = function isFunction(func) {
|
250
|
+
return typeof func === 'function';
|
251
|
+
};
|
250
252
|
// https://developer.mozilla.org/en-US/docs/Glossary/Base64
|
251
253
|
function parseBase64ToString(base64) {
|
252
254
|
try {
|
@@ -259,4 +261,4 @@ function parseBase64ToString(base64) {
|
|
259
261
|
return null;
|
260
262
|
}
|
261
263
|
}
|
262
|
-
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString };
|
264
|
+
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString };
|
package/esm/util/logger.d.ts
CHANGED
@@ -23,6 +23,7 @@ export interface LogMetaData {
|
|
23
23
|
paymentMethodType?: string;
|
24
24
|
paymentMethodCategoryType?: string;
|
25
25
|
requestSeq?: string;
|
26
|
+
trackId?: string;
|
26
27
|
}
|
27
28
|
interface Config {
|
28
29
|
scriptUrl: string;
|
@@ -41,6 +42,7 @@ export declare class Logger {
|
|
41
42
|
private debug;
|
42
43
|
private componentStartTime;
|
43
44
|
private isLoaded;
|
45
|
+
private trackId;
|
44
46
|
constructor(config: Config, debug: boolean);
|
45
47
|
setMedta(mdata: LogMetaData): void;
|
46
48
|
logError(error: LogPayload, extra?: Extra): Logger;
|
@@ -51,6 +53,8 @@ export declare class Logger {
|
|
51
53
|
initTracker(): void;
|
52
54
|
send(): void;
|
53
55
|
setComponentStartTime(val: number): void;
|
56
|
+
setTrackId(trackId: string): void;
|
57
|
+
getComponentStartTime(): number;
|
54
58
|
}
|
55
59
|
export declare const LogConfig: Config;
|
56
60
|
export {};
|
package/esm/util/logger.js
CHANGED
@@ -15,6 +15,7 @@ export var Logger = /*#__PURE__*/function () {
|
|
15
15
|
_defineProperty(this, "debug", void 0);
|
16
16
|
_defineProperty(this, "componentStartTime", void 0);
|
17
17
|
_defineProperty(this, "isLoaded", void 0);
|
18
|
+
_defineProperty(this, "trackId", void 0);
|
18
19
|
this.logs = [];
|
19
20
|
this.config = config;
|
20
21
|
this.debug = debug;
|
@@ -99,19 +100,28 @@ export var Logger = /*#__PURE__*/function () {
|
|
99
100
|
try {
|
100
101
|
var log = logs.pop();
|
101
102
|
if (log.type === 'error') {
|
103
|
+
var _log$logPayload;
|
102
104
|
logError(log.logPayload, _objectSpread({
|
103
105
|
fsDuration: fsDuration,
|
104
|
-
timeStamp: now
|
106
|
+
timeStamp: now,
|
107
|
+
trackId: this.trackId,
|
108
|
+
title: (_log$logPayload = log.logPayload) === null || _log$logPayload === void 0 ? void 0 : _log$logPayload.title
|
105
109
|
}, log === null || log === void 0 ? void 0 : log.extra));
|
106
110
|
} else if (log.type === 'info') {
|
111
|
+
var _log$logPayload2;
|
107
112
|
logInfo(log.logPayload, _objectSpread({
|
108
113
|
fsDuration: fsDuration,
|
109
|
-
timeStamp: now
|
114
|
+
timeStamp: now,
|
115
|
+
trackId: this.trackId,
|
116
|
+
title: (_log$logPayload2 = log.logPayload) === null || _log$logPayload2 === void 0 ? void 0 : _log$logPayload2.title
|
110
117
|
}, log === null || log === void 0 ? void 0 : log.extra));
|
111
118
|
} else if (log.type === 'rpc') {
|
119
|
+
var _log$logPayload3;
|
112
120
|
reportRPC(log.logPayload, _objectSpread({
|
113
121
|
fsDuration: fsDuration,
|
114
|
-
timeStamp: now
|
122
|
+
timeStamp: now,
|
123
|
+
trackId: this.trackId,
|
124
|
+
title: (_log$logPayload3 = log.logPayload) === null || _log$logPayload3 === void 0 ? void 0 : _log$logPayload3.title
|
115
125
|
}, log === null || log === void 0 ? void 0 : log.extra));
|
116
126
|
}
|
117
127
|
} catch (error) {
|
@@ -166,6 +176,16 @@ export var Logger = /*#__PURE__*/function () {
|
|
166
176
|
value: function setComponentStartTime(val) {
|
167
177
|
this.componentStartTime = val;
|
168
178
|
}
|
179
|
+
}, {
|
180
|
+
key: "setTrackId",
|
181
|
+
value: function setTrackId(trackId) {
|
182
|
+
this.trackId = trackId;
|
183
|
+
}
|
184
|
+
}, {
|
185
|
+
key: "getComponentStartTime",
|
186
|
+
value: function getComponentStartTime() {
|
187
|
+
return this.componentStartTime;
|
188
|
+
}
|
169
189
|
}]);
|
170
190
|
return Logger;
|
171
191
|
}();
|
package/package.json
CHANGED
File without changes
|