@alipay/ams-checkout 0.0.1730107332-dev.4 → 0.0.1730441340-dev.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.
Files changed (127) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/config/index.d.ts +7 -7
  3. package/esm/config/index.js +7 -7
  4. package/esm/constant/index.d.ts +6 -7
  5. package/esm/constant/index.js +80 -11
  6. package/esm/{foundation/service/api-bus → core/bus}/ability/callback.d.ts +2 -2
  7. package/esm/{foundation/service/api-bus → core/bus}/ability/callback.js +1 -1
  8. package/esm/{foundation/service/api-bus → core/bus}/ability/security.d.ts +4 -6
  9. package/esm/{foundation/service/api-bus → core/bus}/ability/security.js +35 -92
  10. package/esm/{foundation/service/api-bus → core/bus}/ability/tracker.d.ts +4 -4
  11. package/esm/{foundation/service/api-bus → core/bus}/ability/tracker.js +3 -6
  12. package/esm/{foundation/service/api-bus/busManager.d.ts → core/bus/index.d.ts} +15 -17
  13. package/esm/{foundation/service/api-bus/busManager.js → core/bus/index.js} +35 -67
  14. package/esm/{foundation/service/api-bus → core/bus}/interface.d.ts +0 -12
  15. package/esm/{foundation/service/api-bus → core/bus}/interface.js +2 -16
  16. package/esm/core/component/address.d.ts +8 -0
  17. package/esm/{foundation/service/api-bus/ability/globalData.js → core/component/address.js} +58 -75
  18. package/esm/core/component/appPreloadProcessing.d.ts +1 -0
  19. package/esm/{foundation/service/container/popup.js → core/component/appPreloadProcessing.js} +83 -97
  20. package/esm/core/component/ckp/index.d.ts +27 -0
  21. package/esm/core/component/ckp/index.js +166 -0
  22. package/esm/core/component/index.d.ts +51 -0
  23. package/esm/core/component/index.js +531 -0
  24. package/esm/core/drop-in/index.d.ts +22 -0
  25. package/esm/core/drop-in/index.js +104 -0
  26. package/esm/core/instance/index.d.ts +89 -0
  27. package/esm/core/instance/index.js +499 -0
  28. package/esm/index.d.ts +28 -5
  29. package/esm/index.js +158 -29
  30. package/esm/plugin/applepay/component.d.ts +50 -0
  31. package/esm/plugin/applepay/component.js +339 -0
  32. package/esm/plugin/applepay/index.d.ts +17 -0
  33. package/esm/plugin/applepay/index.js +117 -0
  34. package/esm/plugin/applepay/interface.d.ts +161 -0
  35. package/esm/plugin/applepay/interface.js +69 -0
  36. package/esm/plugin/applepay/service.d.ts +54 -0
  37. package/esm/plugin/applepay/service.js +289 -0
  38. package/esm/plugin/component/cashierApp.d.ts +34 -0
  39. package/esm/plugin/component/cashierApp.js +237 -0
  40. package/esm/{component → plugin/component}/channel.d.ts +4 -3
  41. package/esm/{component → plugin/component}/channel.js +37 -1
  42. package/esm/plugin/component/component.inline.style.d.ts +10 -0
  43. package/esm/{component → plugin/component}/component.inline.style.js +9 -11
  44. package/esm/{component → plugin/component}/component.popup.style.d.ts +6 -15
  45. package/esm/{component → plugin/component}/component.popup.style.js +18 -36
  46. package/esm/plugin/component/index.d.ts +126 -0
  47. package/esm/plugin/component/index.js +1839 -0
  48. package/esm/{component → plugin/component}/popupWindow.style.js +2 -2
  49. package/esm/plugin/const.d.ts +2 -0
  50. package/esm/plugin/const.js +33 -0
  51. package/esm/plugin/drop-in/index.d.ts +71 -0
  52. package/esm/plugin/drop-in/index.js +324 -0
  53. package/esm/plugin/payment-element/utils.d.ts +2 -0
  54. package/esm/plugin/payment-element/utils.js +6 -0
  55. package/esm/plugin/paypal/index.d.ts +20 -0
  56. package/esm/plugin/paypal/index.js +390 -0
  57. package/esm/plugin/type.d.ts +34 -0
  58. package/esm/plugin/utils.d.ts +6 -0
  59. package/esm/plugin/utils.js +21 -0
  60. package/esm/types/index.d.ts +55 -61
  61. package/esm/types/index.js +62 -63
  62. package/esm/util/createIframeNode.d.ts +6 -0
  63. package/esm/util/createIframeNode.js +48 -0
  64. package/esm/util/getBackScheme.d.ts +2 -2
  65. package/esm/util/getBackScheme.js +2 -94
  66. package/esm/util/index.d.ts +11 -1
  67. package/esm/util/index.js +84 -3
  68. package/esm/util/intl-callapp/es/index.js +0 -1
  69. package/esm/{foundation/service/security → util}/security.d.ts +2 -2
  70. package/esm/{foundation/service/security → util}/security.js +3 -3
  71. package/esm/util/ua/index.d.ts +2 -0
  72. package/esm/util/ua/index.js +2 -0
  73. package/esm/util/ua/isAndroid.d.ts +4 -0
  74. package/esm/util/ua/isAndroid.js +7 -0
  75. package/esm/util/ua/isIOS.d.ts +4 -0
  76. package/esm/util/ua/isIOS.js +7 -0
  77. package/package.json +2 -2
  78. package/esm/component/component.inline.style.d.ts +0 -10
  79. package/esm/foundation/core/index.d.ts +0 -26
  80. package/esm/foundation/core/index.js +0 -364
  81. package/esm/foundation/index.d.ts +0 -74
  82. package/esm/foundation/index.js +0 -42
  83. package/esm/foundation/product-processor/easysafepay/deps.d.ts +0 -18
  84. package/esm/foundation/product-processor/easysafepay/deps.js +0 -12
  85. package/esm/foundation/product-processor/easysafepay/index.d.ts +0 -27
  86. package/esm/foundation/product-processor/easysafepay/index.js +0 -596
  87. package/esm/foundation/service/api-bus/ability/globalData.d.ts +0 -10
  88. package/esm/foundation/service/api-bus/ability/request.d.ts +0 -10
  89. package/esm/foundation/service/api-bus/ability/request.js +0 -151
  90. package/esm/foundation/service/api-bus/index.d.ts +0 -20
  91. package/esm/foundation/service/api-bus/index.js +0 -88
  92. package/esm/foundation/service/container/index.d.ts +0 -28
  93. package/esm/foundation/service/container/index.js +0 -256
  94. package/esm/foundation/service/container/popup.d.ts +0 -17
  95. package/esm/foundation/service/container/utils.d.ts +0 -7
  96. package/esm/foundation/service/container/utils.js +0 -48
  97. package/esm/foundation/service/event-center.d.ts +0 -74
  98. package/esm/foundation/service/event-center.js +0 -213
  99. package/esm/foundation/service/global-data/index.d.ts +0 -11
  100. package/esm/foundation/service/global-data/index.js +0 -68
  101. package/esm/foundation/service/index.d.ts +0 -19
  102. package/esm/foundation/service/index.js +0 -82
  103. package/esm/foundation/service/log/index.d.ts +0 -43
  104. package/esm/foundation/service/log/index.js +0 -235
  105. package/esm/foundation/service/log/types.d.ts +0 -32
  106. package/esm/foundation/service/requester/deps.d.ts +0 -17
  107. package/esm/foundation/service/requester/deps.js +0 -11
  108. package/esm/foundation/service/requester/requester.d.ts +0 -22
  109. package/esm/foundation/service/requester/requester.js +0 -214
  110. package/esm/foundation/service/security/index.d.ts +0 -28
  111. package/esm/foundation/service/security/index.js +0 -285
  112. package/esm/foundation/types/index.d.ts +0 -4
  113. package/esm/foundation/types/index.js +0 -4
  114. package/esm/foundation/utils/gray_scale_utils.d.ts +0 -7
  115. package/esm/foundation/utils/gray_scale_utils.js +0 -40
  116. package/esm/foundation/utils/payment_context_utils.d.ts +0 -13
  117. package/esm/foundation/utils/payment_context_utils.js +0 -57
  118. package/esm/foundation/utils/payment_product_utils.d.ts +0 -13
  119. package/esm/foundation/utils/payment_product_utils.js +0 -38
  120. package/esm/foundation/utils/redirect_utils.d.ts +0 -6
  121. package/esm/foundation/utils/redirect_utils.js +0 -115
  122. package/esm/foundation/utils/system_events.d.ts +0 -4
  123. package/esm/foundation/utils/system_events.js +0 -71
  124. package/esm/foundation/utils/web_app_url_utils.d.ts +0 -46
  125. package/esm/foundation/utils/web_app_url_utils.js +0 -112
  126. /package/esm/{component → plugin/component}/popupWindow.style.d.ts +0 -0
  127. /package/esm/{foundation/service/log/types.js → plugin/type.js} +0 -0
@@ -10,7 +10,6 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
10
10
  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; }
11
11
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
12
  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); }
13
- import { ServiceProvider } from '..';
14
13
  /**
15
14
  * Bus 埋点内容定义
16
15
  */
@@ -122,26 +121,20 @@ export var BusSubscriber = /*#__PURE__*/_createClass(function BusSubscriber() {
122
121
  */
123
122
  export var BusManager = /*#__PURE__*/function () {
124
123
  function BusManager() {
125
- var instanceId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
126
124
  _classCallCheck(this, BusManager);
127
- // Instance Variable
128
- _defineProperty(this, "isDebug", true);
129
- _defineProperty(this, "instanceId", void 0);
130
- _defineProperty(this, "logger", void 0);
131
- this.instanceId = instanceId;
132
- this.logger = ServiceProvider.getInstance(this.instanceId).getService('Log');
133
125
  }
134
- _createClass(BusManager, [{
126
+ _createClass(BusManager, null, [{
135
127
  key: "debugTrace",
136
- value: function debugTrace(enable) {
128
+ value: function debugTrace(enable, logger) {
137
129
  this.isDebug = enable;
130
+ this.logger = logger;
138
131
  }
139
132
  }, {
140
133
  key: "traceLog",
141
134
  value: function traceLog(title, optionalParams) {
142
135
  var report = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
143
136
  if (this.isDebug) {
144
- console.log([BusManager.TAG, title].concat(JSON.stringify(optionalParams)).join(BusManager._logSplit));
137
+ console.log([BusManager.TAG, title].concat(JSON.stringify(optionalParams)).join(this._logSplit));
145
138
  }
146
139
  if (report && this.logger) {
147
140
  this.logger.logInfo({
@@ -155,7 +148,7 @@ export var BusManager = /*#__PURE__*/function () {
155
148
  key: "traceError",
156
149
  value: function traceError(title, optionalParams) {
157
150
  if (this.isDebug) {
158
- console.error([BusManager.TAG, title].concat(JSON.stringify(optionalParams)).join(BusManager._logSplit));
151
+ console.error([BusManager.TAG, title].concat(JSON.stringify(optionalParams)).join(this._logSplit));
159
152
  }
160
153
  if (this.logger) {
161
154
  this.logger.logError({
@@ -168,14 +161,14 @@ export var BusManager = /*#__PURE__*/function () {
168
161
  }, {
169
162
  key: "clear",
170
163
  value: function clear() {
171
- this.traceLog(BusLogEventEnum.sdk_event_busClear);
164
+ BusManager.traceLog(BusLogEventEnum.sdk_event_busClear);
172
165
  BusManager.interceptors.length = 0;
173
166
  BusManager.subscribersMap.clear();
174
167
  }
175
168
  }, {
176
169
  key: "addInterceptor",
177
170
  value: function addInterceptor(interceptor) {
178
- this.traceLog(BusLogEventEnum.sdk_event_busAddInterceptor);
171
+ BusManager.traceLog(BusLogEventEnum.sdk_event_busAddInterceptor);
179
172
  if (!BusManager.interceptors.includes(interceptor)) {
180
173
  BusManager.interceptors.push(interceptor);
181
174
  }
@@ -193,7 +186,7 @@ export var BusManager = /*#__PURE__*/function () {
193
186
  });
194
187
  setTimeout(function () {
195
188
  if (failed) {
196
- _this.traceError(BusLogEventEnum.sdk_error_busPublishNoResult, {
189
+ BusManager.traceError(BusLogEventEnum.sdk_error_busPublishNoResult, {
197
190
  action: message.getAction()
198
191
  });
199
192
  if ((config === null || config === void 0 ? void 0 : config.fallback) !== null) {
@@ -208,27 +201,20 @@ export var BusManager = /*#__PURE__*/function () {
208
201
  }, {
209
202
  key: "publish",
210
203
  value: function publish(message, callback) {
211
- var _this2 = this;
212
204
  var _callBack = function _callBack(result) {
213
- _this2.traceLog(BusLogEventEnum.sdk_event_busPublishCallback, {
214
- action: message.getAction(),
215
- instanceId: _this2.instanceId
205
+ BusManager.traceLog(BusLogEventEnum.sdk_event_busPublishCallback, {
206
+ action: message.getAction()
216
207
  });
217
208
  if (callback) {
218
209
  callback(result);
219
210
  }
220
211
  };
221
212
  var context = new BusContext(_callBack);
222
- var actionName = this.instanceId ? BusManager.getInstanceActionName(message.getAction(), this.instanceId) : message.getAction();
213
+ var actionName = message.getAction();
223
214
  var subscribers = BusManager.subscribersMap.get(actionName);
224
- this.traceLog(BusLogEventEnum.sdk_event_busPublishMessage, {
225
- action: message.getAction(),
226
- instanceId: this.instanceId
215
+ BusManager.traceLog(BusLogEventEnum.sdk_event_busPublishMessage, {
216
+ action: message.getAction()
227
217
  });
228
- if (!subscribers && this.instanceId) {
229
- // 如果没有找到特定实例的订阅者,尝试查找通用订阅者
230
- subscribers = BusManager.subscribersMap.get(message.getAction());
231
- }
232
218
  if (subscribers) {
233
219
  var _iterator = _createForOfIteratorHelper(subscribers),
234
220
  _step;
@@ -238,9 +224,8 @@ export var BusManager = /*#__PURE__*/function () {
238
224
  try {
239
225
  subscriber.onMessage(context, message);
240
226
  } catch (e) {
241
- this.traceError(BusLogEventEnum.sdk_error_busPublishError, {
227
+ BusManager.traceError(BusLogEventEnum.sdk_error_busPublishError, {
242
228
  action: message.getAction(),
243
- instanceId: this.instanceId,
244
229
  error: e
245
230
  });
246
231
  var _iterator2 = _createForOfIteratorHelper(BusManager.interceptors),
@@ -269,6 +254,7 @@ export var BusManager = /*#__PURE__*/function () {
269
254
  try {
270
255
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
271
256
  var _interceptor = _step3.value;
257
+ BusManager.traceLog('onUnsubscribedAction', JSON.stringify(message));
272
258
  handle = handle || (_interceptor === null || _interceptor === void 0 ? void 0 : _interceptor.onUnsubscribedAction(message.getAction()));
273
259
  }
274
260
  } catch (err) {
@@ -277,11 +263,10 @@ export var BusManager = /*#__PURE__*/function () {
277
263
  _iterator3.f();
278
264
  }
279
265
  if (handle) {
280
- this.publish(message, callback); // Re-publish the message
266
+ BusManager.publish(message, callback); // Re-publish the message
281
267
  } else {
282
- this.traceError(BusLogEventEnum.sdk_error_busPublishUnsubscribeError, {
283
- action: message.getAction(),
284
- instanceId: this.instanceId
268
+ BusManager.traceError(BusLogEventEnum.sdk_error_busPublishUnsubscribeError, {
269
+ action: message.getAction()
285
270
  });
286
271
  }
287
272
  }
@@ -289,20 +274,18 @@ export var BusManager = /*#__PURE__*/function () {
289
274
  }, {
290
275
  key: "subscribe",
291
276
  value: function subscribe(subscriber) {
292
- this.traceLog(BusLogEventEnum.sdk_event_busSubscribe, {
293
- actions: subscriber.actionNames(),
294
- instanceId: this.instanceId
277
+ BusManager.traceLog(BusLogEventEnum.sdk_event_busSubscribe, {
278
+ actions: subscriber === null || subscriber === void 0 ? void 0 : subscriber.actionNames()
295
279
  });
296
280
  var _iterator4 = _createForOfIteratorHelper(subscriber.actionNames()),
297
281
  _step4;
298
282
  try {
299
283
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
300
284
  var _actionName = _step4.value;
301
- var key = this.instanceId ? BusManager.getInstanceActionName(_actionName, this.instanceId) : _actionName;
302
- if (!BusManager.subscribersMap.has(key)) {
303
- BusManager.subscribersMap.set(key, []);
285
+ if (!BusManager.subscribersMap.has(_actionName)) {
286
+ BusManager.subscribersMap.set(_actionName, []);
304
287
  }
305
- var subscribers = BusManager.subscribersMap.get(key);
288
+ var subscribers = BusManager.subscribersMap.get(_actionName);
306
289
  if (subscribers && !subscribers.includes(subscriber)) {
307
290
  subscribers.push(subscriber);
308
291
  }
@@ -316,25 +299,20 @@ export var BusManager = /*#__PURE__*/function () {
316
299
  }, {
317
300
  key: "unsubscribe",
318
301
  value: function unsubscribe(subscriber) {
319
- this.traceLog(BusLogEventEnum.sdk_event_busUnsubscribe, {
320
- actions: subscriber.actionNames(),
321
- instanceId: this.instanceId
302
+ BusManager.traceLog(BusLogEventEnum.sdk_event_busUnsubscribe, {
303
+ actions: subscriber === null || subscriber === void 0 ? void 0 : subscriber.actionNames()
322
304
  });
323
305
  var _iterator5 = _createForOfIteratorHelper(subscriber.actionNames()),
324
306
  _step5;
325
307
  try {
326
308
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
327
309
  var _actionName2 = _step5.value;
328
- var key = this.instanceId ? BusManager.getInstanceActionName(_actionName2, this.instanceId) : _actionName2;
329
- var subscribers = BusManager.subscribersMap.get(key);
310
+ var subscribers = BusManager.subscribersMap.get(_actionName2);
330
311
  if (subscribers) {
331
312
  var index = subscribers.indexOf(subscriber);
332
313
  if (index !== -1) {
333
314
  subscribers.splice(index, 1);
334
315
  }
335
- if (subscribers.length === 0) {
336
- BusManager.subscribersMap.delete(key);
337
- }
338
316
  }
339
317
  }
340
318
  } catch (err) {
@@ -346,16 +324,10 @@ export var BusManager = /*#__PURE__*/function () {
346
324
  }, {
347
325
  key: "isSubscribed",
348
326
  value: function isSubscribed(actionName) {
349
- var key = this.instanceId ? BusManager.getInstanceActionName(actionName, this.instanceId) : actionName;
350
- var subscribers = BusManager.subscribersMap.get(key);
351
- if (!subscribers && this.instanceId) {
352
- // 如果没有找到特定实例的订阅者,检查是否有通用订阅者
353
- subscribers = BusManager.subscribersMap.get(actionName);
354
- }
327
+ var subscribers = BusManager.subscribersMap.get(actionName);
355
328
  if (subscribers && subscribers.length > 0) {
356
- this.traceLog(BusLogEventEnum.sdk_event_busIsSubscribe, {
329
+ BusManager.traceLog(BusLogEventEnum.sdk_event_busIsSubscribe, {
357
330
  action: actionName,
358
- instanceId: this.instanceId,
359
331
  sub: true
360
332
  });
361
333
  return true;
@@ -374,25 +346,21 @@ export var BusManager = /*#__PURE__*/function () {
374
346
  _iterator6.f();
375
347
  }
376
348
  if (handle) {
377
- return BusManager.subscribersMap.has(key);
349
+ // 内部会上报
350
+ return BusManager.subscribersMap.has(actionName);
378
351
  }
379
- this.traceLog(BusLogEventEnum.sdk_event_busIsSubscribe, {
352
+ BusManager.traceLog(BusLogEventEnum.sdk_event_busIsSubscribe, {
380
353
  action: actionName,
381
- instanceId: this.instanceId,
382
354
  sub: false
383
355
  });
384
356
  return false;
385
357
  }
386
- }], [{
387
- key: "getInstanceActionName",
388
- value: function getInstanceActionName(actionName, instanceId) {
389
- return "".concat(actionName, "@").concat(instanceId);
390
- }
391
358
  }]);
392
359
  return BusManager;
393
360
  }();
394
- // Static Variable
361
+ _defineProperty(BusManager, "TAG", 'BusManager');
362
+ _defineProperty(BusManager, "_logSplit", ' , ');
395
363
  _defineProperty(BusManager, "interceptors", []);
396
364
  _defineProperty(BusManager, "subscribersMap", new Map());
397
- _defineProperty(BusManager, "TAG", 'BusManager');
398
- _defineProperty(BusManager, "_logSplit", ' , ');
365
+ _defineProperty(BusManager, "isDebug", true);
366
+ _defineProperty(BusManager, "logger", void 0);
@@ -13,19 +13,7 @@ export declare enum PaypalActionEnum {
13
13
  export declare enum SDKCallbackActionEnum {
14
14
  onEventCallback = "onEventCallback"
15
15
  }
16
- export declare enum RequestActiontEnum {
17
- request = "request",
18
- getEnvInfo = "getEnvInfo",
19
- getUserAgent = "getUserAgent"
20
- }
21
- export declare enum DataActiontEnum {
22
- getGlobalData = "getGlobalData",
23
- setGlobalData = "setGlobalData",
24
- clearGlobalData = "clearGlobalData"
25
- }
26
16
  export declare enum SecuritySDKActionEnum {
27
- preInitSecurity = "preInitSecurity",
28
- initSecurity = "initSecurity",
29
17
  getSecurityDeviceId = "getSecurityDeviceId"
30
18
  }
31
19
  export declare enum TrackerActionEnum {
@@ -17,21 +17,7 @@ export var SDKCallbackActionEnum = /*#__PURE__*/function (SDKCallbackActionEnum)
17
17
  SDKCallbackActionEnum["onEventCallback"] = "onEventCallback";
18
18
  return SDKCallbackActionEnum;
19
19
  }({});
20
- export var RequestActiontEnum = /*#__PURE__*/function (RequestActiontEnum) {
21
- RequestActiontEnum["request"] = "request";
22
- RequestActiontEnum["getEnvInfo"] = "getEnvInfo";
23
- RequestActiontEnum["getUserAgent"] = "getUserAgent";
24
- return RequestActiontEnum;
25
- }({});
26
- export var DataActiontEnum = /*#__PURE__*/function (DataActiontEnum) {
27
- DataActiontEnum["getGlobalData"] = "getGlobalData";
28
- DataActiontEnum["setGlobalData"] = "setGlobalData";
29
- DataActiontEnum["clearGlobalData"] = "clearGlobalData";
30
- return DataActiontEnum;
31
- }({});
32
20
  export var SecuritySDKActionEnum = /*#__PURE__*/function (SecuritySDKActionEnum) {
33
- SecuritySDKActionEnum["preInitSecurity"] = "preInitSecurity";
34
- SecuritySDKActionEnum["initSecurity"] = "initSecurity";
35
21
  SecuritySDKActionEnum["getSecurityDeviceId"] = "getSecurityDeviceId";
36
22
  return SecuritySDKActionEnum;
37
23
  }({});
@@ -43,10 +29,10 @@ export var ComponentActiontEnum = /*#__PURE__*/function (ComponentActiontEnum) {
43
29
  ComponentActiontEnum["onDestory"] = "onDestory";
44
30
  return ComponentActiontEnum;
45
31
  }({});
46
- RequestActiontEnum = /*#__PURE__*/function (RequestActiontEnum) {
32
+ export var RequestActiontEnum = /*#__PURE__*/function (RequestActiontEnum) {
47
33
  RequestActiontEnum["onDestory"] = "httpRequest";
48
34
  return RequestActiontEnum;
49
- }(RequestActiontEnum || {});
35
+ }({});
50
36
  export var LoadingActiontEnum = /*#__PURE__*/function (LoadingActiontEnum) {
51
37
  LoadingActiontEnum["showLoading"] = "showLoading";
52
38
  LoadingActiontEnum["dismissLoading"] = "dismissLoading";
@@ -0,0 +1,8 @@
1
+ import { IoptionsParams } from '../../types';
2
+ import { AMSComponent } from './index';
3
+ export declare class AddressComponent extends AMSComponent {
4
+ constructor(options: IoptionsParams & {
5
+ appVersion: string;
6
+ });
7
+ getValue(hasValidate?: boolean): Promise<unknown>;
8
+ }
@@ -2,6 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
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; }
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); }
5
7
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
6
8
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
7
9
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -9,81 +11,62 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
9
11
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
10
12
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
13
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
12
- 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; }
13
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
14
- 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); }
15
- import { ServiceProvider } from "../../../../foundation/service";
16
- import { BusSubscriber } from "../../../../foundation/service/api-bus/busManager";
17
- import { DataActiontEnum } from "../interface";
18
- export var DataBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
19
- _inherits(DataBusSubscriber, _BusSubscriber);
20
- var _super = _createSuper(DataBusSubscriber);
21
- function DataBusSubscriber(instanceId) {
22
- var _this;
23
- _classCallCheck(this, DataBusSubscriber);
24
- _this = _super.call(this);
25
- _defineProperty(_assertThisInitialized(_this), "instanceId", void 0);
26
- _this.instanceId = instanceId;
27
- return _this;
14
+ /**
15
+ * Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
16
+ *
17
+ * 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:
18
+ * 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
19
+ * 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.
20
+ */
21
+ import { v4 as uuid } from 'uuid';
22
+ import { BusManager, BusMessage } from "../bus";
23
+ import { AMSComponent } from "./index";
24
+ export var AddressComponent = /*#__PURE__*/function (_AMSComponent) {
25
+ _inherits(AddressComponent, _AMSComponent);
26
+ var _super = _createSuper(AddressComponent);
27
+ function AddressComponent(options) {
28
+ _classCallCheck(this, AddressComponent);
29
+ return _super.call(this, options);
28
30
  }
29
- _createClass(DataBusSubscriber, [{
30
- key: "actionNames",
31
- value: function actionNames() {
32
- return Object.values(DataActiontEnum);
33
- }
34
- }, {
35
- key: "getGlobalData",
36
- value: function getGlobalData(context, message) {
37
- var data = message.getJSONObject();
38
- console.log("getGlobalData", message);
39
- if (data && data !== null && data !== void 0 && data.dataKey) {
40
- var dataService = ServiceProvider.getInstance(this.instanceId).getService('GlobalData');
41
- var resData = dataService.getGlobalData(data.dataKey);
42
- context === null || context === void 0 || context.onCallBack(message.result(resData));
43
- } else {
44
- var error = Error('GetGlobalData Failed: Data Key is null');
45
- context === null || context === void 0 || context.onCallBack(message.result(error));
46
- }
47
- }
48
- }, {
49
- key: "setGlobalData",
50
- value: function setGlobalData(context, message) {
51
- var data = message.getJSONObject();
52
- console.log("getGlobalData", message);
53
- if (data && data !== null && data !== void 0 && data.dataKey && data !== null && data !== void 0 && data.data) {
54
- var dataService = ServiceProvider.getInstance(this.instanceId).getService('GlobalData');
55
- dataService.setGlobalData(data.dataKey, data.data);
56
- context === null || context === void 0 || context.onCallBack(message.result(true));
57
- } else {
58
- var error = Error('SetGlobalData Failed: Data Key or Data is null');
59
- context === null || context === void 0 || context.onCallBack(message.result(error));
60
- }
61
- }
62
- }, {
63
- key: "clearGlobalData",
64
- value: function clearGlobalData(context, message) {
65
- console.log("clearGlobalData", message);
66
- var dataService = ServiceProvider.getInstance(this.instanceId).getService('GlobalData');
67
- dataService.clearGlobalData();
68
- context === null || context === void 0 || context.onCallBack(message.result(true));
69
- }
70
- }, {
71
- key: "onMessage",
72
- value: function onMessage(context, message) {
73
- switch (message.getAction()) {
74
- case DataActiontEnum.getGlobalData:
75
- this.getGlobalData(context, message);
76
- break;
77
- case DataActiontEnum.setGlobalData:
78
- this.setGlobalData(context, message);
79
- break;
80
- case DataActiontEnum.clearGlobalData:
81
- this.clearGlobalData(context, message);
82
- break;
83
- default:
84
- console.log("Unknown action: " + message.getAction());
85
- }
31
+ _createClass(AddressComponent, [{
32
+ key: "getValue",
33
+ value: function getValue(hasValidate) {
34
+ var _this = this;
35
+ return new Promise(function (resolve, reject) {
36
+ try {
37
+ var _this$getBusActionNam;
38
+ var eventCallbackId = uuid();
39
+ _this.logger.logInfo({
40
+ title: 'sdk_event_apiGetValue'
41
+ });
42
+ var actionName = (_this$getBusActionNam = _this.getBusActionNames()) === null || _this$getBusActionNam === void 0 ? void 0 : _this$getBusActionNam.getValue;
43
+ if (actionName && BusManager.isSubscribed(actionName)) {
44
+ // 执行出错了,在通用拦截器返回
45
+ BusManager.publishForResult(new BusMessage(actionName, JSON.stringify({
46
+ appendParams: _this._appendParams,
47
+ options: _this.originOptions,
48
+ data: hasValidate
49
+ }))).then(function (busMessage) {
50
+ resolve(busMessage === null || busMessage === void 0 ? void 0 : busMessage.getJSONObject());
51
+ });
52
+ } else {
53
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
+ _this._eventCenter.once(eventCallbackId, function (_data) {
55
+ resolve(_data);
56
+ });
57
+ _this._componentApp.dispatchToApp({
58
+ context: {
59
+ event: 'getValue',
60
+ eventCallbackId: eventCallbackId,
61
+ data: hasValidate
62
+ }
63
+ });
64
+ }
65
+ } catch (error) {
66
+ reject(error);
67
+ }
68
+ });
86
69
  }
87
70
  }]);
88
- return DataBusSubscriber;
89
- }(BusSubscriber);
71
+ return AddressComponent;
72
+ }(AMSComponent);
@@ -0,0 +1 @@
1
+ export declare function loadChannelPneumaticControl(paymentSessionFactor: any, logger: any): Promise<unknown>;