@alipay/ams-checkout 1.5.2 → 1.5.8
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/config/request.js +3 -3
- package/esm/core/component/index.d.ts +4 -11
- package/esm/core/component/index.js +41 -32
- package/esm/core/drop-in/index.d.ts +0 -7
- package/esm/core/drop-in/index.js +16 -16
- package/esm/core/instance/index.js +2 -1
- package/esm/index.js +1 -1
- package/esm/plugin/component/cashierApp.d.ts +3 -1
- package/esm/plugin/component/cashierApp.js +8 -4
- package/esm/plugin/component/component.inline.style.d.ts +1 -1
- package/esm/plugin/component/component.popup.style.d.ts +1 -1
- package/esm/plugin/component/component.popup.style.js +26 -24
- package/esm/plugin/component/index.d.ts +6 -8
- package/esm/plugin/component/index.js +106 -57
- package/esm/plugin/drop-in/index.d.ts +5 -5
- package/esm/plugin/drop-in/index.js +2 -1
- package/esm/request/index.d.ts +0 -7
- package/esm/request/index.js +27 -18
- package/esm/request/utils.d.ts +1 -1
- package/esm/request/utils.js +3 -0
- package/esm/service/index.js +4 -4
- package/esm/types/index.d.ts +36 -9
- package/esm/types/index.js +3 -1
- package/esm/util/createIframeNode.js +7 -0
- package/esm/util/get.js +8 -1
- package/esm/util/index.d.ts +3 -3
- package/esm/util/index.js +6 -9
- package/esm/util/security.d.ts +12 -0
- package/esm/util/security.js +107 -0
- package/package.json +1 -1
package/esm/config/request.js
CHANGED
@@ -12,8 +12,8 @@ var _queryParse = queryParse(),
|
|
12
12
|
groupId = _queryParse.groupId,
|
13
13
|
host = _queryParse.requestHost;
|
14
14
|
export var requestHost = {
|
15
|
-
local: 'http://imgs-
|
16
|
-
dev: host || 'http://imgs-
|
15
|
+
local: 'http://imgs-6517.sggz00b.dev.alipay.net/mgw.htm',
|
16
|
+
dev: host || 'http://imgs-6517.sggz00b.dev.alipay.net/mgw.htm',
|
17
17
|
sit: host || 'http://imgs-9.sggz00a.test.alipay.net/mgw.htm',
|
18
18
|
pre: 'https://imgs-sea-pre.alipay.com/mgw.htm',
|
19
19
|
prod: 'https://imgs-sea-global.alipay.com/mgw.htm',
|
@@ -22,7 +22,7 @@ export var requestHost = {
|
|
22
22
|
export var clientId = '5J5Y8X4E2Y25GR00690';
|
23
23
|
export var tntInstId = 'ALIPW3SG';
|
24
24
|
export var appId = 'ANTOM_PAYMENT_WEB';
|
25
|
-
export var sofaId = groupId || '
|
25
|
+
export var sofaId = groupId || 'GROUP_20230913102142';
|
26
26
|
export var hostSignMap = function hostSignMap(hostSign, env) {
|
27
27
|
var map = {
|
28
28
|
SG: 'https://imgs-sea-global.alipay.com/mgw.htm',
|
@@ -1,12 +1,5 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
3
|
-
*
|
4
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
5
|
-
* 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
|
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
|
-
*/
|
8
1
|
import ComponentApp from '../../plugin/component';
|
9
|
-
import { IcreateComponent, IoptionsParams, Iselector } from '../../types';
|
2
|
+
import { IcreateComponent, IoptionsParams, Iselector, Isubmit } from '../../types';
|
10
3
|
import CoreInstance from '../instance/index';
|
11
4
|
export declare class AMSComponent extends CoreInstance {
|
12
5
|
_componentApp: ComponentApp;
|
@@ -15,17 +8,17 @@ export declare class AMSComponent extends CoreInstance {
|
|
15
8
|
private pluginAppendIframe;
|
16
9
|
/**
|
17
10
|
* @description Create component application
|
18
|
-
* @param params - The data source created by the component, necessary
|
11
|
+
* @param params - The data source created by the component, necessary sessionData, optional appearance configuration, and refer to the documentation for other parameters and detailed information.
|
19
12
|
*/
|
20
13
|
createComponent(params: IcreateComponent): Promise<void>;
|
21
14
|
/**
|
22
15
|
* @description Create and render components in the specified element area
|
23
|
-
* @param params - The data source created by the component, necessary
|
16
|
+
* @param params - The data source created by the component, necessary sessionData, necessary element selector IDs, optional appearance configurations, and refer to the documentation for other parameters and detailed information.
|
24
17
|
*/
|
25
18
|
mountComponent(params: IcreateComponent, selector: Iselector): Promise<void>;
|
26
19
|
/**
|
27
20
|
* @description Execute payment submission process
|
28
21
|
* @description - When using your own payment button, you can execute the submit payment process by actively calling this function.
|
29
22
|
*/
|
30
|
-
submit():
|
23
|
+
submit(data?: Isubmit): Promise<unknown>;
|
31
24
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
function _typeof(
|
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
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3
3
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
4
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
@@ -16,7 +16,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
16
16
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
17
17
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
18
18
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
19
|
-
function _iterableToArrayLimit(
|
19
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
20
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
21
21
|
/**
|
22
22
|
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
@@ -25,7 +25,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
25
|
* 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
|
26
26
|
* 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.
|
27
27
|
*/
|
28
|
-
|
28
|
+
import { v4 as uuid } from 'uuid';
|
29
29
|
import { COMPONENTPLUGINID, ERRORMESSAGE, EVENT } from "../../constant";
|
30
30
|
import ComponentApp from "../../plugin/component";
|
31
31
|
import { componentSignEnum, modeEnum, networkModeEnum, productSceneEnum, renderDisplayTypeEnum } from "../../types";
|
@@ -41,12 +41,12 @@ var getComponentSign = function getComponentSign(params) {
|
|
41
41
|
paymentMethodCategoryType = _params$paymentSessio4 === void 0 ? '' : _params$paymentSessio4;
|
42
42
|
return productScene && paymentMethodCategoryType ? "".concat(productScene, "_").concat(paymentMethodCategoryType) : componentSignEnum.NONE;
|
43
43
|
};
|
44
|
-
var
|
44
|
+
var parseSessionData = function parseSessionData(sessionData) {
|
45
45
|
try {
|
46
|
-
return [JSON.parse(atob(
|
46
|
+
return [JSON.parse(atob(sessionData.split('&&')[3])), sessionData.split('&&').slice(0, 3).join('&&')];
|
47
47
|
} catch (error) {
|
48
|
-
console.error('Parsing
|
49
|
-
return [{},
|
48
|
+
console.error('Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK.');
|
49
|
+
return [{}, sessionData];
|
50
50
|
}
|
51
51
|
};
|
52
52
|
|
@@ -59,23 +59,23 @@ var resetEasyPaySceneVersion = function resetEasyPaySceneVersion(parseData) {
|
|
59
59
|
}
|
60
60
|
}
|
61
61
|
};
|
62
|
-
var
|
63
|
-
var
|
64
|
-
|
65
|
-
parseData =
|
66
|
-
|
62
|
+
var handleSessionData = function handleSessionData(originSessionData) {
|
63
|
+
var _parseSessionData = parseSessionData(originSessionData),
|
64
|
+
_parseSessionData2 = _slicedToArray(_parseSessionData, 2),
|
65
|
+
parseData = _parseSessionData2[0],
|
66
|
+
sessionData = _parseSessionData2[1];
|
67
67
|
resetEasyPaySceneVersion(parseData);
|
68
|
-
return [parseData,
|
68
|
+
return [parseData, sessionData];
|
69
69
|
};
|
70
70
|
var handleParams = function handleParams(params) {
|
71
71
|
var _params = Object.assign({
|
72
72
|
paymentSessionMetaData: {},
|
73
73
|
renderDisplayType: renderDisplayTypeEnum.popup
|
74
74
|
}, params);
|
75
|
-
var
|
76
|
-
|
77
|
-
parseData =
|
78
|
-
|
75
|
+
var _handleSessionData = handleSessionData(_params.sessionData),
|
76
|
+
_handleSessionData2 = _slicedToArray(_handleSessionData, 2),
|
77
|
+
parseData = _handleSessionData2[0],
|
78
|
+
sessionData = _handleSessionData2[1];
|
79
79
|
var componentSign = getComponentSign(parseData);
|
80
80
|
if (componentSign === componentSignEnum.NONE) {
|
81
81
|
// eslint-disable-next-line prefer-promise-reject-errors
|
@@ -84,7 +84,7 @@ var handleParams = function handleParams(params) {
|
|
84
84
|
message: "Abnormal response data, interface failure, or unsupported payment method"
|
85
85
|
});
|
86
86
|
}
|
87
|
-
_params.
|
87
|
+
_params.sessionData = sessionData;
|
88
88
|
_params.paymentSessionMetaData = parseData;
|
89
89
|
return Promise.resolve({
|
90
90
|
iframeNodesParams: _params,
|
@@ -119,7 +119,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
119
119
|
selector: selector,
|
120
120
|
renderDisplayType: renderDisplayType
|
121
121
|
}, params);
|
122
|
-
if (_params && !_params.
|
122
|
+
if (_params && !_params.sessionData) {
|
123
123
|
return Promise.reject(ERRORMESSAGE.CREATEPAYMENT_PARAMETER_ERROR);
|
124
124
|
}
|
125
125
|
if (this.options.networkMode === networkModeEnum.proxy) {
|
@@ -140,7 +140,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
140
140
|
|
141
141
|
/**
|
142
142
|
* @description Create component application
|
143
|
-
* @param params - The data source created by the component, necessary
|
143
|
+
* @param params - The data source created by the component, necessary sessionData, optional appearance configuration, and refer to the documentation for other parameters and detailed information.
|
144
144
|
*/
|
145
145
|
}, {
|
146
146
|
key: "createComponent",
|
@@ -160,7 +160,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
160
160
|
}
|
161
161
|
/**
|
162
162
|
* @description Create and render components in the specified element area
|
163
|
-
* @param params - The data source created by the component, necessary
|
163
|
+
* @param params - The data source created by the component, necessary sessionData, necessary element selector IDs, optional appearance configurations, and refer to the documentation for other parameters and detailed information.
|
164
164
|
*/
|
165
165
|
}, {
|
166
166
|
key: "mountComponent",
|
@@ -185,17 +185,26 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
185
185
|
*/
|
186
186
|
}, {
|
187
187
|
key: "submit",
|
188
|
-
value: function submit() {
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
188
|
+
value: function submit(data) {
|
189
|
+
var _this4 = this;
|
190
|
+
return new Promise(function (resolve, reject) {
|
191
|
+
try {
|
192
|
+
var eventCallbackId = uuid();
|
193
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
194
|
+
_this4._eventCenter.once(eventCallbackId, function (_data) {
|
195
|
+
resolve(_data);
|
196
|
+
});
|
197
|
+
_this4._componentApp.dispatchToApp({
|
198
|
+
context: {
|
199
|
+
event: 'submitPay',
|
200
|
+
eventCallbackId: eventCallbackId,
|
201
|
+
data: data
|
202
|
+
}
|
203
|
+
});
|
204
|
+
} catch (error) {
|
205
|
+
reject(error);
|
206
|
+
}
|
207
|
+
});
|
199
208
|
}
|
200
209
|
}]);
|
201
210
|
return AMSComponent;
|
@@ -1,10 +1,3 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
3
|
-
*
|
4
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
5
|
-
* 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
|
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
|
-
*/
|
8
1
|
import { IcreatePaymentParams, IoptionsParams } from '../../types';
|
9
2
|
export declare const mixinDropInConstructor: (options: IoptionsParams, context: any) => void;
|
10
3
|
/**
|
@@ -8,7 +8,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
8
8
|
* 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
|
9
9
|
* 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.
|
10
10
|
*/
|
11
|
-
|
11
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
12
12
|
import { BASEPLUGINID, ERRORMESSAGE, EVENT } from "../../constant";
|
13
13
|
import CheckoutApp from "../../plugin/drop-in";
|
14
14
|
import { messageName, networkModeEnum } from "../../types";
|
@@ -49,8 +49,8 @@ export var createPayment = function createPayment(params) {
|
|
49
49
|
export var confirmPayment = function confirmPayment(result) {
|
50
50
|
var _this2 = this;
|
51
51
|
return new Promise(function (resolve, reject) {
|
52
|
-
_this2.eventCenter.once('onRedirect', function (
|
53
|
-
_this2._redirect(
|
52
|
+
_this2.eventCenter.once('onRedirect', function (payload) {
|
53
|
+
_this2._redirect(payload).then(function () {
|
54
54
|
resolve();
|
55
55
|
}).catch(function (err) {
|
56
56
|
reject(err);
|
@@ -73,21 +73,21 @@ export var confirmPayment = function confirmPayment(result) {
|
|
73
73
|
*/
|
74
74
|
export var _subscribeFromCheckoutPlugin = function _subscribeFromCheckoutPlugin() {
|
75
75
|
var _this3 = this;
|
76
|
-
var eventKeyMap = new Map([[EVENT.error.name, function (
|
77
|
-
_this3.eventCenter.emit(EVENT.error.name,
|
78
|
-
}], [EVENT.ready.name, function (
|
79
|
-
_this3.eventCenter.emit(EVENT.ready.name,
|
80
|
-
}], [EVENT.redirect.name, function (
|
81
|
-
_this3.eventCenter.emit(EVENT.redirect.name,
|
82
|
-
}], [EVENT.paymentMethodSelected.name, function (
|
83
|
-
_this3.checkoutState.paymentMethodType =
|
76
|
+
var eventKeyMap = new Map([[EVENT.error.name, function (payload) {
|
77
|
+
_this3.eventCenter.emit(EVENT.error.name, payload.context.data);
|
78
|
+
}], [EVENT.ready.name, function (payload) {
|
79
|
+
_this3.eventCenter.emit(EVENT.ready.name, payload.context.data);
|
80
|
+
}], [EVENT.redirect.name, function (payload) {
|
81
|
+
_this3.eventCenter.emit(EVENT.redirect.name, payload.context.data);
|
82
|
+
}], [EVENT.paymentMethodSelected.name, function (payload) {
|
83
|
+
_this3.checkoutState.paymentMethodType = payload.context.data.paymentMethodType;
|
84
84
|
_this3.eventCenter.emit(EVENT.paymentMethodSelected.name, {
|
85
|
-
paymentMethodType:
|
85
|
+
paymentMethodType: payload.context.data.paymentMethodType
|
86
86
|
});
|
87
|
-
}], [EVENT.sizeChanged.name, function (
|
88
|
-
_this3.eventCenter.emit(EVENT.sizeChanged.name,
|
89
|
-
}], [EVENT.log.name, function (
|
90
|
-
_this3.eventCenter.emit(EVENT.log.name,
|
87
|
+
}], [EVENT.sizeChanged.name, function (payload) {
|
88
|
+
_this3.eventCenter.emit(EVENT.sizeChanged.name, payload.context.data);
|
89
|
+
}], [EVENT.log.name, function (payload) {
|
90
|
+
_this3.eventCenter.emit(EVENT.log.name, payload.context.data);
|
91
91
|
}]]);
|
92
92
|
var _iterator = _createForOfIteratorHelper(eventKeyMap.keys()),
|
93
93
|
_step;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
function _typeof(
|
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
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
3
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
@@ -15,6 +15,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
15
15
|
* 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
|
16
16
|
* 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.
|
17
17
|
*/
|
18
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
18
19
|
import { v4 as uuid } from 'uuid';
|
19
20
|
import { ERRORMESSAGE, EVENT } from "../../constant";
|
20
21
|
import { environmentEnum, modeEnum, networkModeEnum, osTypeEnum, terminalTypeEnum } from "../../types/index";
|
package/esm/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
function _typeof(
|
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
2
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
3
3
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
4
4
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { componentSignEnum, Ianalytics } from '../../types';
|
2
|
-
|
2
|
+
import { renderDisplayTypeEnum } from '../../types/index';
|
3
|
+
export declare const getAppPath: (environment: string, appVersion: string, componentSign: componentSignEnum, productSceneVersion: string, extendInfo: string) => any;
|
3
4
|
export declare const getAppDomain: (domainParams: {
|
4
5
|
environment: string;
|
5
6
|
appVersion: string;
|
@@ -16,6 +17,7 @@ export declare const getIframeUrl: (iframeParams: {
|
|
16
17
|
extendInfo: string;
|
17
18
|
locale: string;
|
18
19
|
instanceId: string;
|
20
|
+
renderDisplayType: renderDisplayTypeEnum;
|
19
21
|
}) => string;
|
20
22
|
/**
|
21
23
|
* @description Create iframe
|
@@ -1,4 +1,4 @@
|
|
1
|
-
function _typeof(
|
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
2
|
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; }
|
3
3
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
4
4
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
@@ -22,7 +22,7 @@ var getAppVersion = function getAppVersion(_extendInfo) {
|
|
22
22
|
};
|
23
23
|
var getFinalProductSceneVersion = function getFinalProductSceneVersion(componentSign, productSceneVersion) {
|
24
24
|
var _signSupportMap;
|
25
|
-
var signSupportMap = (_signSupportMap = {}, _defineProperty(_signSupportMap, componentSignEnum.NONE, ['']), _defineProperty(_signSupportMap, componentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), _signSupportMap);
|
25
|
+
var signSupportMap = (_signSupportMap = {}, _defineProperty(_signSupportMap, componentSignEnum.NONE, ['']), _defineProperty(_signSupportMap, componentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), _defineProperty(_signSupportMap, componentSignEnum.VAULTING_CARD, ['1.0']), _signSupportMap);
|
26
26
|
var supportProductSceneVersion = signSupportMap[componentSign];
|
27
27
|
// 从左到右,从旧到新
|
28
28
|
var isSupport = supportProductSceneVersion.find(function (it) {
|
@@ -69,7 +69,8 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
|
|
69
69
|
appVersion = iframeParams.appVersion,
|
70
70
|
extendInfo = iframeParams.extendInfo,
|
71
71
|
locale = iframeParams.locale,
|
72
|
-
instanceId = iframeParams.instanceId
|
72
|
+
instanceId = iframeParams.instanceId,
|
73
|
+
renderDisplayType = iframeParams.renderDisplayType;
|
73
74
|
var path = getAppPath(environment, appVersion, componentSign, productSceneVersion, extendInfo || '');
|
74
75
|
var initialScale = 1;
|
75
76
|
var scale = getViewPort('initial-scale') || initialScale;
|
@@ -80,8 +81,10 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
|
|
80
81
|
requestHost = _queryParse$requestHo === void 0 ? '' : _queryParse$requestHo,
|
81
82
|
_queryParse$groupId = _queryParse.groupId,
|
82
83
|
groupId = _queryParse$groupId === void 0 ? '' : _queryParse$groupId,
|
83
|
-
LOCAL_MOCK = _queryParse.LOCAL_MOCK
|
84
|
+
LOCAL_MOCK = _queryParse.LOCAL_MOCK,
|
85
|
+
_displayType = _queryParse._displayType;
|
84
86
|
var urlParams = Object.assign({}, {
|
87
|
+
displayType: renderDisplayType,
|
85
88
|
locale: locale,
|
86
89
|
scale: scale,
|
87
90
|
instanceId: instanceId,
|
@@ -94,6 +97,7 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
|
|
94
97
|
if (groupId) urlParams.groupId = groupId;
|
95
98
|
if (environment === 'light_sandbox' || _light_sandbox === 'true') urlParams.sandbox = 'true';
|
96
99
|
if (environment === 'sandbox' || _sandbox === 'true') urlParams.shadow = 'true';
|
100
|
+
if (_displayType) urlParams.displayType = _displayType;
|
97
101
|
var locationSearch = serialize(urlParams);
|
98
102
|
return "".concat(path, "?").concat(locationSearch);
|
99
103
|
};
|
@@ -8,4 +8,4 @@
|
|
8
8
|
import { platformEnum } from '../../types';
|
9
9
|
export declare const inlineComponentAddCss: () => void;
|
10
10
|
export declare const addInlineLoading: (_selector: HTMLDivElement, platform: platformEnum) => void;
|
11
|
-
export declare const createInlineBaseElement: (selector: string) => HTMLDivElement
|
11
|
+
export declare const createInlineBaseElement: (selector: string) => HTMLDivElement;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { platformEnum } from '../../types';
|
2
2
|
export declare const componentAddCSS: () => void;
|
3
|
-
export declare const createBaseElement: (platform: platformEnum, closeBtnFunc: () => void) => HTMLDivElement
|
3
|
+
export declare const createBaseElement: (platform: platformEnum, closeBtnFunc: () => void) => HTMLDivElement;
|
4
4
|
export declare const createCloseBtn: (platform: platformEnum, closeBtnFunc: () => void) => void;
|
5
5
|
export declare const createRetentionPopup: (platform: platformEnum, remainBtnFunc: () => void, leaveBtnFunc: () => void) => void;
|
6
6
|
export declare const hideRetentionPopup: () => void;
|
@@ -72,7 +72,7 @@ export var hideRetentionPopup = function hideRetentionPopup() {
|
|
72
72
|
retentionPopup.classList.add("".concat(COMPONENT_RETENTION_ID, "-hidden"));
|
73
73
|
setTimeout(function () {
|
74
74
|
retentionPopup.classList.remove("".concat(COMPONENT_RETENTION_ID, "-hidden"));
|
75
|
-
container === null || container === void 0
|
75
|
+
container === null || container === void 0 || container.classList.remove("".concat(COMPONENT_CONTAINER_ID, "-opacity"));
|
76
76
|
}, ANIMATION_TIME);
|
77
77
|
}
|
78
78
|
};
|
@@ -87,7 +87,7 @@ export var removeRetentionPopup = function removeRetentionPopup(platform, remain
|
|
87
87
|
if (leaveBtn) {
|
88
88
|
leaveBtn.removeEventListener(clickEventName, leaveBtnFunc);
|
89
89
|
}
|
90
|
-
(_document$getElementB = document.getElementById(COMPONENT_RETENTION_ID)) === null || _document$getElementB === void 0
|
90
|
+
(_document$getElementB = document.getElementById(COMPONENT_RETENTION_ID)) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
91
91
|
};
|
92
92
|
export var createMockup = function createMockup() {
|
93
93
|
var body = document.getElementsByTagName('body')[0];
|
@@ -106,13 +106,15 @@ export var createMockup = function createMockup() {
|
|
106
106
|
};
|
107
107
|
export var addPopupLoading = function addPopupLoading() {
|
108
108
|
var loading = document.createElement('div');
|
109
|
-
loading === null || loading === void 0
|
109
|
+
loading === null || loading === void 0 || loading.classList.add(LOADING_ID);
|
110
110
|
loading.id = LOADING_ID;
|
111
111
|
loading.innerHTML = '<div class="line"><div></div><div></div><div></div><div></div></div>';
|
112
112
|
loading.style.fontSize = "".concat(getDesignFontSize(), "px");
|
113
113
|
var body = document.getElementsByTagName('body')[0];
|
114
|
-
body === null || body === void 0
|
114
|
+
body === null || body === void 0 || body.appendChild(loading);
|
115
115
|
};
|
116
|
+
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
116
118
|
export var handleDeclareInfo = function handleDeclareInfo(_ref) {
|
117
119
|
var _ref$closeDialogData = _ref.closeDialogData,
|
118
120
|
closeDialogData = _ref$closeDialogData === void 0 ? {} : _ref$closeDialogData;
|
@@ -121,40 +123,40 @@ export var handleDeclareInfo = function handleDeclareInfo(_ref) {
|
|
121
123
|
var retentionTitle = document.getElementById("".concat(COMPONENT_RETENTION_ID, "-title"));
|
122
124
|
if (retentionTitle) {
|
123
125
|
var _closeDialogData$titl, _closeDialogData$titl2, _closeDialogData$titl3;
|
124
|
-
retentionTitle.style.fontSize = "".concat(closeDialogData === null || closeDialogData === void 0
|
125
|
-
retentionTitle.style.color = closeDialogData === null || closeDialogData === void 0
|
126
|
-
retentionTitle.innerHTML = closeDialogData === null || closeDialogData === void 0
|
126
|
+
retentionTitle.style.fontSize = "".concat(closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$titl = closeDialogData.title) === null || _closeDialogData$titl === void 0 ? void 0 : _closeDialogData$titl.fontSize, "px");
|
127
|
+
retentionTitle.style.color = closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$titl2 = closeDialogData.title) === null || _closeDialogData$titl2 === void 0 ? void 0 : _closeDialogData$titl2.fontColor;
|
128
|
+
retentionTitle.innerHTML = closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$titl3 = closeDialogData.title) === null || _closeDialogData$titl3 === void 0 ? void 0 : _closeDialogData$titl3.text;
|
127
129
|
}
|
128
130
|
var retentionMessage = document.getElementById("".concat(COMPONENT_RETENTION_ID, "-sub-title"));
|
129
131
|
if (retentionMessage) {
|
130
132
|
var _closeDialogData$mess, _closeDialogData$mess2, _closeDialogData$mess3;
|
131
|
-
retentionMessage.style.fontSize = "".concat(closeDialogData === null || closeDialogData === void 0
|
132
|
-
retentionMessage.style.color = closeDialogData === null || closeDialogData === void 0
|
133
|
-
retentionMessage.innerHTML = closeDialogData === null || closeDialogData === void 0
|
133
|
+
retentionMessage.style.fontSize = "".concat(closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$mess = closeDialogData.message) === null || _closeDialogData$mess === void 0 ? void 0 : _closeDialogData$mess.fontSize, "px");
|
134
|
+
retentionMessage.style.color = closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$mess2 = closeDialogData.message) === null || _closeDialogData$mess2 === void 0 ? void 0 : _closeDialogData$mess2.fontColor;
|
135
|
+
retentionMessage.innerHTML = closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$mess3 = closeDialogData.message) === null || _closeDialogData$mess3 === void 0 ? void 0 : _closeDialogData$mess3.text;
|
134
136
|
}
|
135
137
|
var remainBtn = document.getElementById("".concat(COMPONENT_RETENTION_ID, "-remain"));
|
136
138
|
if (remainBtn) {
|
137
139
|
var _closeDialogData$btnO, _closeDialogData$btnO2, _closeDialogData$btnO3, _closeDialogData$btnO4, _closeDialogData$btnO5, _closeDialogData$btnO7;
|
138
|
-
remainBtn.innerHTML = closeDialogData === null || closeDialogData === void 0
|
139
|
-
remainBtn.style.fontSize = "".concat(closeDialogData === null || closeDialogData === void 0
|
140
|
-
remainBtn.style.color = closeDialogData === null || closeDialogData === void 0
|
141
|
-
remainBtn.style.borderRadius = "".concat(closeDialogData === null || closeDialogData === void 0
|
142
|
-
if ((closeDialogData === null || closeDialogData === void 0
|
140
|
+
remainBtn.innerHTML = closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnO = closeDialogData.btnOK) === null || _closeDialogData$btnO === void 0 ? void 0 : _closeDialogData$btnO.text;
|
141
|
+
remainBtn.style.fontSize = "".concat(closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnO2 = closeDialogData.btnOK) === null || _closeDialogData$btnO2 === void 0 ? void 0 : _closeDialogData$btnO2.fontSize, "px");
|
142
|
+
remainBtn.style.color = closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnO3 = closeDialogData.btnOK) === null || _closeDialogData$btnO3 === void 0 ? void 0 : _closeDialogData$btnO3.fontColor;
|
143
|
+
remainBtn.style.borderRadius = "".concat(closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnO4 = closeDialogData.btnOK) === null || _closeDialogData$btnO4 === void 0 ? void 0 : _closeDialogData$btnO4.corner, "px");
|
144
|
+
if ((closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnO5 = closeDialogData.btnOK) === null || _closeDialogData$btnO5 === void 0 ? void 0 : _closeDialogData$btnO5.type) === 'stroke') {
|
143
145
|
var _closeDialogData$btnO6;
|
144
|
-
remainBtn.style.border = "1px solid ".concat(closeDialogData === null || closeDialogData === void 0
|
145
|
-
} else remainBtn.style.backgroundColor = closeDialogData === null || closeDialogData === void 0
|
146
|
+
remainBtn.style.border = "1px solid ".concat(closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnO6 = closeDialogData.btnOK) === null || _closeDialogData$btnO6 === void 0 ? void 0 : _closeDialogData$btnO6.bg);
|
147
|
+
} else remainBtn.style.backgroundColor = closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnO7 = closeDialogData.btnOK) === null || _closeDialogData$btnO7 === void 0 ? void 0 : _closeDialogData$btnO7.bg;
|
146
148
|
}
|
147
149
|
var leaveBrn = document.getElementById("".concat(COMPONENT_RETENTION_ID, "-leave"));
|
148
150
|
if (leaveBrn) {
|
149
151
|
var _closeDialogData$btnC, _closeDialogData$btnC2, _closeDialogData$btnC3, _closeDialogData$btnC4, _closeDialogData$btnC5, _closeDialogData$btnC7;
|
150
|
-
leaveBrn.innerHTML = closeDialogData === null || closeDialogData === void 0
|
151
|
-
leaveBrn.style.fontSize = "".concat(closeDialogData === null || closeDialogData === void 0
|
152
|
-
leaveBrn.style.color = closeDialogData === null || closeDialogData === void 0
|
153
|
-
leaveBrn.style.borderRadius = "".concat(closeDialogData === null || closeDialogData === void 0
|
154
|
-
if ((closeDialogData === null || closeDialogData === void 0
|
152
|
+
leaveBrn.innerHTML = closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnC = closeDialogData.btnCancel) === null || _closeDialogData$btnC === void 0 ? void 0 : _closeDialogData$btnC.text;
|
153
|
+
leaveBrn.style.fontSize = "".concat(closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnC2 = closeDialogData.btnCancel) === null || _closeDialogData$btnC2 === void 0 ? void 0 : _closeDialogData$btnC2.fontSize, "px");
|
154
|
+
leaveBrn.style.color = closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnC3 = closeDialogData.btnCancel) === null || _closeDialogData$btnC3 === void 0 ? void 0 : _closeDialogData$btnC3.fontColor;
|
155
|
+
leaveBrn.style.borderRadius = "".concat(closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnC4 = closeDialogData.btnCancel) === null || _closeDialogData$btnC4 === void 0 ? void 0 : _closeDialogData$btnC4.corner, "px");
|
156
|
+
if ((closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnC5 = closeDialogData.btnCancel) === null || _closeDialogData$btnC5 === void 0 ? void 0 : _closeDialogData$btnC5.type) === 'stroke') {
|
155
157
|
var _closeDialogData$btnC6;
|
156
|
-
leaveBrn.style.border = "1px solid ".concat(closeDialogData === null || closeDialogData === void 0
|
157
|
-
} else leaveBrn.style.backgroundColor = closeDialogData === null || closeDialogData === void 0
|
158
|
+
leaveBrn.style.border = "1px solid ".concat(closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnC6 = closeDialogData.btnCancel) === null || _closeDialogData$btnC6 === void 0 ? void 0 : _closeDialogData$btnC6.bg);
|
159
|
+
} else leaveBrn.style.backgroundColor = closeDialogData === null || closeDialogData === void 0 || (_closeDialogData$btnC7 = closeDialogData.btnCancel) === null || _closeDialogData$btnC7 === void 0 ? void 0 : _closeDialogData$btnC7.bg;
|
158
160
|
}
|
159
161
|
}
|
160
162
|
} catch (error) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type AMSCheckout from '../../core/instance';
|
2
|
-
import type {
|
2
|
+
import type { eventPayload, eventPayloadContext, IappendIframeNodesParams, Iselector } from '../../types';
|
3
3
|
import { componentSignEnum, platformEnum, renderDisplayTypeEnum } from '../../types';
|
4
4
|
type IrenderFuncParams = (context: ComponentApp, selector: Iselector, renderDisplayType: renderDisplayTypeEnum) => Promise<void>;
|
5
5
|
export default class ComponentApp {
|
@@ -7,7 +7,7 @@ export default class ComponentApp {
|
|
7
7
|
AMSSDK: AMSCheckout;
|
8
8
|
platform: platformEnum;
|
9
9
|
_performanceData: any[];
|
10
|
-
_loadAppPromiseResolve: ((value:
|
10
|
+
_loadAppPromiseResolve: ((value: boolean) => void) | null;
|
11
11
|
_isInitComponent: boolean;
|
12
12
|
private appDomain;
|
13
13
|
private createIframeNode;
|
@@ -32,6 +32,7 @@ export default class ComponentApp {
|
|
32
32
|
* @description Set the rendering capability of the cashier plug-in. Different technology stacks have some differences in the packaging and use of rendering functions
|
33
33
|
*/
|
34
34
|
setRender(renderFunc: IrenderFuncParams): void;
|
35
|
+
initAPSecurity(): void;
|
35
36
|
/**
|
36
37
|
* @description render iframe content
|
37
38
|
*/
|
@@ -58,7 +59,7 @@ export default class ComponentApp {
|
|
58
59
|
/**
|
59
60
|
* @description Processing messages from iframe
|
60
61
|
*/
|
61
|
-
_handleAppMessage(data:
|
62
|
+
_handleAppMessage(data: eventPayload): void;
|
62
63
|
private handleSizeChanged;
|
63
64
|
private handleRedirect;
|
64
65
|
private handleDeclareInfo;
|
@@ -66,15 +67,12 @@ export default class ComponentApp {
|
|
66
67
|
/**
|
67
68
|
* @description Send message to SDK
|
68
69
|
*/
|
69
|
-
dispatchToSDK(event: string, data: any): void;
|
70
|
+
dispatchToSDK(event: string, data: any, eventCallbackId?: string): void;
|
70
71
|
/**
|
71
72
|
* @description Send message to iframe
|
72
73
|
*/
|
73
74
|
dispatchToApp(payload: {
|
74
|
-
context:
|
75
|
-
event: string;
|
76
|
-
data: any;
|
77
|
-
};
|
75
|
+
context: eventPayloadContext;
|
78
76
|
}): any;
|
79
77
|
/**
|
80
78
|
* @description Subscribe to messages from SDK
|