@alipay/ams-checkout 0.0.1730107332-dev.4 → 0.0.1730107332-dev.41

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 (122) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/component/channel.d.ts +2 -3
  3. package/esm/component/channel.js +55 -29
  4. package/esm/component/component.inline.style.js +1 -1
  5. package/esm/component/component.popup.style.d.ts +1 -3
  6. package/esm/component/component.popup.style.js +1 -3
  7. package/esm/config/index.d.ts +7 -7
  8. package/esm/config/index.js +10 -10
  9. package/esm/constant/index.d.ts +3 -0
  10. package/esm/constant/index.js +3 -0
  11. package/esm/core/bus/ability/callback.d.ts +9 -0
  12. package/esm/core/bus/ability/callback.js +55 -0
  13. package/esm/core/bus/ability/security.d.ts +10 -0
  14. package/esm/core/bus/ability/security.js +104 -0
  15. package/esm/core/bus/ability/tracker.d.ts +9 -0
  16. package/esm/core/bus/ability/tracker.js +77 -0
  17. package/esm/core/bus/index.d.ts +125 -0
  18. package/esm/core/bus/index.js +366 -0
  19. package/esm/core/bus/interface.d.ts +36 -0
  20. package/esm/core/bus/interface.js +40 -0
  21. package/esm/core/component/address.d.ts +8 -0
  22. package/esm/core/component/address.js +72 -0
  23. package/esm/core/component/appPreloadProcessing.d.ts +1 -0
  24. package/esm/core/component/appPreloadProcessing.js +89 -0
  25. package/esm/core/component/ckp/index.d.ts +27 -0
  26. package/esm/core/component/ckp/index.js +167 -0
  27. package/esm/core/component/element/components/address.d.ts +19 -0
  28. package/esm/core/component/element/components/address.js +68 -0
  29. package/esm/core/component/element/components/auth.d.ts +17 -0
  30. package/esm/core/component/element/components/auth.js +60 -0
  31. package/esm/core/component/element/components/payment.d.ts +19 -0
  32. package/esm/core/component/element/components/payment.js +74 -0
  33. package/esm/core/component/element/index.d.ts +47 -0
  34. package/esm/core/component/element/index.js +816 -0
  35. package/esm/core/component/element/mock.d.ts +4 -0
  36. package/esm/core/component/element/mock.js +491 -0
  37. package/esm/core/component/element/type.d.ts +190 -0
  38. package/esm/core/component/element/type.js +35 -0
  39. package/esm/core/component/element/utils.d.ts +13 -0
  40. package/esm/core/component/element/utils.js +6 -0
  41. package/esm/core/component/index.d.ts +51 -0
  42. package/esm/core/component/index.js +531 -0
  43. package/esm/core/drop-in/index.d.ts +22 -0
  44. package/esm/core/drop-in/index.js +104 -0
  45. package/esm/core/instance/index.d.ts +89 -0
  46. package/esm/core/instance/index.js +499 -0
  47. package/esm/foundation/core/index.d.ts +3 -3
  48. package/esm/foundation/core/index.js +10 -8
  49. package/esm/foundation/index.d.ts +6 -5
  50. package/esm/foundation/product-processor/easysafepay/deps.d.ts +6 -6
  51. package/esm/foundation/product-processor/easysafepay/deps.js +4 -4
  52. package/esm/foundation/product-processor/easysafepay/index.d.ts +2 -3
  53. package/esm/foundation/product-processor/easysafepay/index.js +110 -243
  54. package/esm/foundation/service/api-bus/index.d.ts +2 -2
  55. package/esm/foundation/service/container/index.d.ts +4 -2
  56. package/esm/foundation/service/container/index.js +43 -1
  57. package/esm/foundation/service/event-center.d.ts +6 -4
  58. package/esm/foundation/service/event-center.js +47 -17
  59. package/esm/foundation/service/global-data/index.d.ts +2 -2
  60. package/esm/foundation/service/index.d.ts +2 -2
  61. package/esm/foundation/service/log/index.d.ts +2 -2
  62. package/esm/foundation/service/log/index.js +1 -1
  63. package/esm/foundation/service/requester/deps.d.ts +1 -1
  64. package/esm/foundation/service/requester/requester.d.ts +2 -2
  65. package/esm/foundation/service/security/index.d.ts +2 -2
  66. package/esm/foundation/service/security/index.js +5 -20
  67. package/esm/foundation/utils/redirect_utils.d.ts +5 -0
  68. package/esm/foundation/utils/redirect_utils.js +205 -58
  69. package/esm/foundation/utils/system_events.js +0 -5
  70. package/esm/foundation/utils/web_app_url_utils.js +1 -1
  71. package/esm/index.d.ts +31 -2
  72. package/esm/index.js +146 -6
  73. package/esm/plugin/applepay/component.d.ts +50 -0
  74. package/esm/plugin/applepay/component.js +339 -0
  75. package/esm/plugin/applepay/index.d.ts +17 -0
  76. package/esm/plugin/applepay/index.js +117 -0
  77. package/esm/plugin/applepay/interface.d.ts +161 -0
  78. package/esm/plugin/applepay/interface.js +69 -0
  79. package/esm/plugin/applepay/service.d.ts +54 -0
  80. package/esm/plugin/applepay/service.js +289 -0
  81. package/esm/plugin/component/cashierApp.d.ts +36 -0
  82. package/esm/plugin/component/cashierApp.js +244 -0
  83. package/esm/plugin/component/channel.d.ts +21 -0
  84. package/esm/plugin/component/channel.js +89 -0
  85. package/esm/plugin/component/component.inline.style.d.ts +10 -0
  86. package/esm/plugin/component/component.inline.style.js +121 -0
  87. package/esm/plugin/component/component.popup.style.d.ts +16 -0
  88. package/esm/plugin/component/component.popup.style.js +174 -0
  89. package/esm/plugin/component/index.d.ts +127 -0
  90. package/esm/plugin/component/index.js +1896 -0
  91. package/esm/plugin/component/popupWindow.style.d.ts +11 -0
  92. package/esm/plugin/component/popupWindow.style.js +121 -0
  93. package/esm/plugin/const.d.ts +2 -0
  94. package/esm/plugin/const.js +33 -0
  95. package/esm/plugin/drop-in/index.d.ts +71 -0
  96. package/esm/plugin/drop-in/index.js +324 -0
  97. package/esm/plugin/payment-element/utils.d.ts +2 -0
  98. package/esm/plugin/payment-element/utils.js +6 -0
  99. package/esm/plugin/paypal/index.d.ts +20 -0
  100. package/esm/plugin/paypal/index.js +390 -0
  101. package/esm/plugin/type.d.ts +34 -0
  102. package/esm/plugin/type.js +1 -0
  103. package/esm/plugin/utils.d.ts +6 -0
  104. package/esm/plugin/utils.js +21 -0
  105. package/esm/service/element.d.ts +4 -0
  106. package/esm/service/element.js +51 -0
  107. package/esm/service/index.d.ts +1 -0
  108. package/esm/service/index.js +2 -0
  109. package/esm/types/index.d.ts +228 -26
  110. package/esm/types/index.js +54 -5
  111. package/esm/util/createIframeNode.d.ts +6 -0
  112. package/esm/util/createIframeNode.js +48 -0
  113. package/esm/util/getBackScheme.d.ts +2 -2
  114. package/esm/util/getBackScheme.js +2 -2
  115. package/esm/util/index.d.ts +11 -1
  116. package/esm/util/index.js +84 -3
  117. package/esm/util/intl-callapp/es/index.js +0 -1
  118. package/esm/util/security.d.ts +33 -0
  119. package/esm/util/security.js +182 -0
  120. package/package.json +2 -1
  121. package/esm/foundation/types/index.d.ts +0 -4
  122. package/esm/foundation/types/index.js +0 -4
@@ -13,7 +13,7 @@ import { addInlineLoading, createInlineBaseElement } from "../../../component/co
13
13
  import { addPopupLoading, createBaseElement } from "../../../component/component.popup.style";
14
14
  import { COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, ERRORMESSAGE, LOADING_ID, MOCKUP_ID } from "../../../constant";
15
15
  import { ServiceProvider } from "../index";
16
- import { EVENT } from "../../../constant";
16
+ import { EVENT, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT } from "../../../constant";
17
17
  import { PopupManager } from "./popup";
18
18
  /**
19
19
  * @author 谦彧 <zhangmian.zm@alipay.com>
@@ -31,6 +31,7 @@ export var ContainerService = /*#__PURE__*/function () {
31
31
  _defineProperty(this, "logService", void 0);
32
32
  _defineProperty(this, "displayInfo", void 0);
33
33
  _defineProperty(this, "webApp", void 0);
34
+ _defineProperty(this, "_webAppHeartBeatTimeoutFn", void 0);
34
35
  // if this variable is true, SDK will invoke listener instead of showing loading
35
36
  _defineProperty(this, "customizedLoadingListener", void 0);
36
37
  }
@@ -181,6 +182,7 @@ export var ContainerService = /*#__PURE__*/function () {
181
182
  });
182
183
  this.eventCenter.listen(EVENT.popupWindow.name, function (data) {
183
184
  var _this2$displayInfo;
185
+ if (data.paymentElementOldModel) return;
184
186
  _this2.popupManager.popup(_objectSpread({
185
187
  platform: (_this2$displayInfo = _this2.displayInfo) === null || _this2$displayInfo === void 0 ? void 0 : _this2$displayInfo.platform
186
188
  }, data)).catch(function (error) {
@@ -202,6 +204,9 @@ export var ContainerService = /*#__PURE__*/function () {
202
204
  this.eventCenter.listen(EVENT.hideCloseButton.name, function () {
203
205
  _this2.changeCloseBtnVisibility(false);
204
206
  });
207
+ this.eventCenter.listen(EVENT.appHeartBeat.name, function () {
208
+ _this2.handleAppHeartBeat();
209
+ });
205
210
  }
206
211
  }, {
207
212
  key: "addCapabilityToApiBusManager",
@@ -241,6 +246,43 @@ export var ContainerService = /*#__PURE__*/function () {
241
246
  this.webApp.style.height = "".concat(data.height, "px");
242
247
  }
243
248
  }
249
+ }, {
250
+ key: "handleAppHeartBeat",
251
+ value: function handleAppHeartBeat() {
252
+ var _this3 = this;
253
+ try {
254
+ if (!this._webAppHeartBeatTimeoutFn) {
255
+ this._webAppHeartBeatTimeoutFn = function () {
256
+ if (_this3.webApp && _this3.displayInfo) {
257
+ _this3.logService.logError({
258
+ title: 'sdk_error_appHeartBeatTimeout'
259
+ });
260
+ }
261
+ };
262
+ }
263
+ if (window._webAppHeartBeatTimeoutId) {
264
+ clearTimeout(window._webAppHeartBeatTimeoutId);
265
+ window._webAppHeartBeatTimeoutId = null;
266
+ }
267
+ if (this._webAppHeartBeatTimeoutFn) {
268
+ window._webAppHeartBeatTimeoutId = setTimeout(this._webAppHeartBeatTimeoutFn, TIMEOUT_WEB_APP_HEART_BEAT);
269
+ }
270
+ setTimeout(function () {
271
+ if (_this3.webApp && _this3.displayInfo) {
272
+ _this3.eventCenter.dispatchToApp({
273
+ event: 'sdkHeartBeat',
274
+ data: {}
275
+ });
276
+ }
277
+ }, TIME_DELAY_SEND_HEART_BEAT);
278
+ } catch (error) {
279
+ this.logService.logError({
280
+ title: 'sdk_error_handleAppHeartBeat'
281
+ }, {
282
+ errorMessage: error.message
283
+ });
284
+ }
285
+ }
244
286
  }, {
245
287
  key: "changeCloseBtnVisibility",
246
288
  value: function changeCloseBtnVisibility(isShow) {
@@ -1,4 +1,4 @@
1
- import { EventPayload, EventPayloadContext, IOptionsParams } from '../../types';
1
+ import { EventPayload, EventPayloadContext, IoptionsParams } from '../../types';
2
2
  import { SDKMetaData, Service } from '../index';
3
3
  /**
4
4
  * @author 江跃 <jiangbin.gjb@antgroup.com>
@@ -12,7 +12,7 @@ export declare class EventCenter implements Service {
12
12
  /**
13
13
  * Initializes the event center
14
14
  */
15
- init(initOptions: IOptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
15
+ init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
16
16
  /**
17
17
  * Cleans up event listeners when the event center is destroyed.
18
18
  */
@@ -27,6 +27,7 @@ export declare class EventCenter implements Service {
27
27
  * @param domain - The domain of the app.
28
28
  */
29
29
  addIFrame(iframe: HTMLIFrameElement): void;
30
+ removeIFrame(iframe: HTMLIFrameElement): void;
30
31
  /**
31
32
  * Handles messages received from the app.
32
33
  * @param e - The message event.
@@ -54,13 +55,14 @@ export declare class EventCenter implements Service {
54
55
  * @param name - The name of the event to emit.
55
56
  * @param data - The event data to pass to the event listeners.
56
57
  */
57
- emit(name: string, data: any, eventPayload?: EventPayload): void;
58
+ emit(name: string, data: any, EventPayload?: EventPayload): void;
58
59
  /**
59
60
  * Registers a callback for an event and immediately dispatches the event to the app.
60
61
  * @param payloadContext - The context containing event information and callback ID.
61
62
  * @param func - The callback function to execute when the event is emitted.
62
63
  */
63
64
  emitAndListen(payloadContext: EventPayloadContext, func: IListener): void;
65
+ queryParse(url?: string): Record<string, any>;
64
66
  /**
65
67
  * Dispatches the event payload to the app via postMessage.
66
68
  * @param payloadContext - The context containing event to be dispatched.
@@ -69,6 +71,6 @@ export declare class EventCenter implements Service {
69
71
  isExist(name: string): boolean;
70
72
  }
71
73
  interface IListener {
72
- (data: any, eventPayload?: EventPayload): void;
74
+ (data: any, EventPayload?: EventPayload): void;
73
75
  }
74
76
  export {};
@@ -1,4 +1,6 @@
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; }
2
4
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
5
  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
6
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -7,7 +9,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7
9
  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); }
8
10
  import { v4 as uuid } from 'uuid';
9
11
  import { ERRORMESSAGE } from "../../constant";
10
- import { MessageName } from "../../types";
12
+ import { EventPayload, MessageName } from "../../types";
11
13
  import { isJsonString } from "../../util";
12
14
  import { getIframeOrigin, registerSystemEvents, unRegisterSystemEvents } from "../utils/system_events";
13
15
 
@@ -70,6 +72,16 @@ export var EventCenter = /*#__PURE__*/function () {
70
72
  origin: getIframeOrigin(iframe)
71
73
  });
72
74
  }
75
+ }, {
76
+ key: "removeIFrame",
77
+ value: function removeIFrame(iframe) {
78
+ var index = this.iframes.findIndex(function (item) {
79
+ return item.origin === getIframeOrigin(iframe);
80
+ });
81
+ if (index !== -1) {
82
+ this.iframes.splice(index, 1);
83
+ }
84
+ }
73
85
 
74
86
  /**
75
87
  * Handles messages received from the app.
@@ -79,7 +91,6 @@ export var EventCenter = /*#__PURE__*/function () {
79
91
  key: "handleAppMessage",
80
92
  value: function handleAppMessage(e) {
81
93
  var _e$data;
82
- // console.log('sdk received message:', e);
83
94
  if (!this.iframes.some(function (iframe) {
84
95
  return iframe.origin === e.origin;
85
96
  })) return;
@@ -88,15 +99,13 @@ export var EventCenter = /*#__PURE__*/function () {
88
99
  }
89
100
  var isJson = isJsonString(e.data);
90
101
  if (isJson) {
91
- var _eventPayload = JSON.parse(e.data);
92
- console.log('handleAppMessage', _eventPayload);
93
- if (_eventPayload.name !== MessageName.APP_TO_SDK) {
102
+ var _EventPayload = JSON.parse(e.data);
103
+ if (_EventPayload.name !== MessageName.APP_TO_SDK) {
94
104
  return;
95
105
  }
96
- this._handleAppMessage(_eventPayload);
106
+ this._handleAppMessage(_EventPayload);
97
107
  } else {
98
- console.warn(ERRORMESSAGE.NOT_JSON_FORMAT);
99
- // TODO: 异常上报
108
+ console.error(ERRORMESSAGE.NOT_JSON_FORMAT);
100
109
  }
101
110
  }
102
111
 
@@ -106,11 +115,11 @@ export var EventCenter = /*#__PURE__*/function () {
106
115
  */
107
116
  }, {
108
117
  key: "_handleAppMessage",
109
- value: function _handleAppMessage(eventPayload) {
110
- var context = eventPayload.context;
118
+ value: function _handleAppMessage(EventPayload) {
119
+ var context = EventPayload.context;
111
120
  var event = context.event,
112
121
  data = context.data;
113
- this.emit(event, data, eventPayload);
122
+ this.emit(event, data, EventPayload);
114
123
  }
115
124
 
116
125
  /**
@@ -156,11 +165,11 @@ export var EventCenter = /*#__PURE__*/function () {
156
165
  */
157
166
  }, {
158
167
  key: "emit",
159
- value: function emit(name, data, eventPayload) {
168
+ value: function emit(name, data, EventPayload) {
160
169
  if (this.events.has(name)) {
161
170
  var eventList = this.events.get(name);
162
171
  eventList.forEach(function (item) {
163
- item.func(data, eventPayload);
172
+ item.func(data, EventPayload);
164
173
  });
165
174
  }
166
175
  }
@@ -179,6 +188,23 @@ export var EventCenter = /*#__PURE__*/function () {
179
188
  this.listen(payloadContext.eventCallbackId, func);
180
189
  this.dispatchToApp(payloadContext);
181
190
  }
191
+ }, {
192
+ key: "queryParse",
193
+ value: function queryParse(url) {
194
+ var qs = {};
195
+ var urlString = url;
196
+ if (!urlString) {
197
+ urlString = window.location.href;
198
+ }
199
+ urlString.replace(/([^?=&#]+)(=([^&#]*))?/g, function (_$0, $1, _$2, $3) {
200
+ if ($3 === undefined) {
201
+ return '';
202
+ }
203
+ qs[$1] = decodeURIComponent($3);
204
+ return qs[$1];
205
+ });
206
+ return qs;
207
+ }
182
208
 
183
209
  /**
184
210
  * Dispatches the event payload to the app via postMessage.
@@ -187,20 +213,24 @@ export var EventCenter = /*#__PURE__*/function () {
187
213
  }, {
188
214
  key: "dispatchToApp",
189
215
  value: function dispatchToApp(payloadContext) {
190
- var _this$iframes;
216
+ var _this$iframes,
217
+ _this = this;
191
218
  var data = {
192
219
  name: MessageName.SDK_TO_APP,
193
220
  context: payloadContext,
194
221
  instanceId: this.instanceId
195
222
  };
196
- console.log('dispatchToApp', payloadContext);
197
223
  (_this$iframes = this.iframes) === null || _this$iframes === void 0 || _this$iframes.forEach(function (iframe) {
198
224
  var _iframe$origin;
199
225
  if (!iframe.ref.contentWindow) {
200
- console.warn('get app contentWindow error', iframe);
226
+ console.error('get app contentWindow error', iframe);
201
227
  return;
202
228
  }
203
- iframe.ref.contentWindow.postMessage(JSON.stringify(data), (_iframe$origin = iframe.origin) !== null && _iframe$origin !== void 0 ? _iframe$origin : '*');
229
+ var _ref = _this.queryParse(iframe.ref.src) || {},
230
+ instanceId = _ref.instanceId;
231
+ iframe.ref.contentWindow.postMessage(JSON.stringify(_objectSpread(_objectSpread({}, data), {}, {
232
+ instanceId: instanceId
233
+ })), (_iframe$origin = iframe.origin) !== null && _iframe$origin !== void 0 ? _iframe$origin : '*');
204
234
  });
205
235
  }
206
236
  }, {
@@ -1,8 +1,8 @@
1
- import { IOptionsParams } from "../../../types";
1
+ import { IoptionsParams } from "../../../types";
2
2
  import { Service } from "../../index";
3
3
  export declare class GlobalDataService implements Service {
4
4
  private globalData;
5
- init(initOptions: IOptionsParams, instanceId: string): void;
5
+ init(initOptions: IoptionsParams, instanceId: string): void;
6
6
  destroy(): void;
7
7
  update(): void;
8
8
  getGlobalData(dataKey: string): any;
@@ -1,4 +1,4 @@
1
- import { IOptionsParams } from '../../types';
1
+ import { IoptionsParams } from '../../types';
2
2
  import { PaymentContext, SDKMetaData, Service } from '../index';
3
3
  /**
4
4
  * @author 谦彧 <zhangmian.zm@alipay.com>
@@ -12,7 +12,7 @@ export declare class ServiceProvider {
12
12
  private services;
13
13
  private extendServices;
14
14
  private constructor();
15
- init(initOptions: IOptionsParams, sdkMetaData: SDKMetaData): void;
15
+ init(initOptions: IoptionsParams, sdkMetaData: SDKMetaData): void;
16
16
  update(paymentContext: PaymentContext): void;
17
17
  getService<T>(serviceName: ServiceName): T;
18
18
  registerService(serviceName: string, service: Service): void;
@@ -1,5 +1,5 @@
1
1
  import { PaymentContext, SDKMetaData, Service } from '../../index';
2
- import { IOptionsParams } from '../../../types';
2
+ import { IoptionsParams } from '../../../types';
3
3
  import { LogExtra, LogMetaData, LogPayload } from './types';
4
4
  /**
5
5
  * @author 谦彧 <zhangmian.zm@alipay.com>
@@ -25,7 +25,7 @@ export declare class LogService implements Service {
25
25
  private isLoaded;
26
26
  private trackId;
27
27
  constructor();
28
- init(initOptions: IOptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
28
+ init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
29
29
  update(paymentContext: PaymentContext): void;
30
30
  destroy(): void;
31
31
  setMetaData(metaData: LogMetaData): void;
@@ -124,7 +124,7 @@ export var LogService = /*#__PURE__*/function () {
124
124
  })
125
125
  });
126
126
  if (this.debug) {
127
- console.log(payload);
127
+ console.log('[web-sdk] Log', payload, extra);
128
128
  }
129
129
  this.send();
130
130
  return this;
@@ -7,7 +7,7 @@ export type { LogPayload, LogExtra } from '../log/types';
7
7
  export type { LogService } from '../log';
8
8
  export type { Service, PaymentContext } from '../../index';
9
9
  export { fomatGetwayError } from '../../../request/utils';
10
- export type { IOptionsParams, IPaymentSessionMetaData } from '../../../types';
10
+ export type { IoptionsParams, IPaymentSessionMetaData } from '../../../types';
11
11
  export { sdkVersion } from '../../../config/index';
12
12
  export { appId, hostSignMap, lightSandboxMap, requestHost, sofaId, tntInstId } from '../../../config/request';
13
13
  export type { RequestConfig } from '../../../types';
@@ -1,4 +1,4 @@
1
- import { IOptionsParams, PaymentContext, RequestConfig, SDKMetaData, Service } from './deps';
1
+ import { IoptionsParams, PaymentContext, RequestConfig, SDKMetaData, Service } from './deps';
2
2
  /**
3
3
  * @author congle.zzq <congle.zzq@alipay.com>
4
4
  * @date 2024/9/18
@@ -6,7 +6,7 @@ import { IOptionsParams, PaymentContext, RequestConfig, SDKMetaData, Service } f
6
6
  export declare class RequesterService implements Service {
7
7
  private sandboxFlag?;
8
8
  private instanceId;
9
- init(initOptions: IOptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
9
+ init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
10
10
  /**
11
11
  *
12
12
  * @param requestData 请求参数
@@ -1,11 +1,11 @@
1
- import { DeviceIdParameter, IOptionsParams } from '../../../types';
1
+ import { DeviceIdParameter, IoptionsParams } from '../../../types';
2
2
  import { PaymentContext, SDKMetaData, Service } from '../../index';
3
3
  import { Security } from './security';
4
4
  export declare class SecurityService implements Service {
5
5
  private logger;
6
6
  private productScene;
7
7
  static securitySdkMap: Map<string, Security>;
8
- init(initOptions: IOptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
8
+ init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
9
9
  update(paymentContext: PaymentContext): void;
10
10
  destroy(): void;
11
11
  getDeviceId(deviceIdParameter?: DeviceIdParameter, isPolling?: boolean): Promise<string>;
@@ -9,7 +9,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
9
9
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
10
  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); }
11
11
  import { ProductSceneEnum } from "../../../types";
12
- import { Security, SecurityRegionEnum, getSecurityConfigStorageKey, getSecurityHost, getSecurityScene } from "./security";
12
+ import { Security, getSecurityConfigStorageKey, getSecurityHost, getSecurityScene } from "./security";
13
13
  import { getOrSetStorageId, safeJson } from "../../../util";
14
14
  import { ServiceProvider } from '..';
15
15
  export var SecurityService = /*#__PURE__*/function () {
@@ -172,28 +172,13 @@ export var SecurityService = /*#__PURE__*/function () {
172
172
  product: _this2.productScene,
173
173
  sign: isPre ? 'Active initialization' : 'SDK internal initialization'
174
174
  }).send();
175
+ reject();
175
176
  }, timeout);
176
177
  }
177
- _this2._newSecuritySDKByScene({
178
- product: _this2.productScene,
179
- region: isPre ? SecurityRegionEnum.SG : undefined
180
- }, function () {
181
- _this2.logger.logInfo({
182
- title: "sdk_event_securitySdk".concat(sdkAction, "Success")
183
- }, isPre ? {
184
- product: _this2.productScene
185
- } : undefined).send();
186
- resolve();
187
- }, function (msg) {
188
- _this2.logger.logError({
189
- title: 'sdk_error_securitySdkInitFailed',
190
- msg: msg || undefined
191
- }, {
192
- product: _this2.productScene,
193
- sign: isPre ? 'Active initialization' : 'SDK internal initialization'
194
- }).send();
178
+ console.log('[web-sdk][security-sdk] mock init timeout');
179
+ setTimeout(function () {
195
180
  reject();
196
- });
181
+ }, 5000);
197
182
  }));
198
183
  case 7:
199
184
  case "end":
@@ -1,6 +1,11 @@
1
1
  import { RedirectBehaviorPayload } from '../index';
2
+ import { LogService } from '../service/log';
2
3
  /**
3
4
  * @author 谦彧 <zhangmian.zm@alipay.com>
4
5
  * @date 2024/9/19
5
6
  */
6
7
  export declare const redirect: (payload: RedirectBehaviorPayload, instanceId: string) => void;
8
+ /**
9
+ * 通过配置规则检测 UA 和获得回跳 scheme
10
+ */
11
+ export declare function getBackScheme(mockUa?: string, logger?: LogService): any;