@alipay/ams-checkout 1.30.0 → 1.31.1

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 (38) 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/core/component/ckp/index.js +2 -0
  5. package/esm/core/component/element/components/address.d.ts +1 -1
  6. package/esm/core/component/element/components/address.js +2 -2
  7. package/esm/core/component/element/components/payment.d.ts +1 -1
  8. package/esm/core/component/element/components/payment.js +2 -2
  9. package/esm/core/component/element/index.d.ts +7 -6
  10. package/esm/core/component/element/index.js +287 -222
  11. package/esm/core/component/element/type.d.ts +171 -12
  12. package/esm/core/component/element/type.js +48 -3
  13. package/esm/core/component/index.js +5 -0
  14. package/esm/core/instance/index.js +12 -1
  15. package/esm/foundation/index.d.ts +1 -1
  16. package/esm/foundation/product-processor/easysafepay/index.d.ts +0 -2
  17. package/esm/foundation/product-processor/easysafepay/index.js +29 -73
  18. package/esm/foundation/service/container/index.d.ts +0 -2
  19. package/esm/foundation/service/container/index.js +20 -47
  20. package/esm/foundation/utils/payment_product_utils.d.ts +1 -1
  21. package/esm/foundation/utils/payment_product_utils.js +2 -2
  22. package/esm/foundation/utils/preload_helper.d.ts +21 -0
  23. package/esm/foundation/utils/preload_helper.js +143 -0
  24. package/esm/index.d.ts +7 -2
  25. package/esm/index.js +94 -7
  26. package/esm/plugin/component/index.d.ts +1 -0
  27. package/esm/plugin/component/index.js +24 -11
  28. package/esm/service/index.d.ts +0 -1
  29. package/esm/service/index.js +0 -2
  30. package/esm/types/index.d.ts +8 -117
  31. package/esm/types/index.js +2 -34
  32. package/esm/util/security.d.ts +1 -0
  33. package/esm/util/security.js +3 -1
  34. package/esm/util/spm-map.d.ts +3 -0
  35. package/esm/util/spm-map.js +3 -0
  36. package/package.json +1 -1
  37. package/esm/service/element.d.ts +0 -4
  38. package/esm/service/element.js +0 -51
@@ -6,8 +6,8 @@
6
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
7
  */
8
8
  import { IApplePayContactField } from '../plugin/applepay/interface';
9
- export * from '../core/component/element/type';
10
9
  export type onChange = () => onCnageResult;
10
+ export { type IElementOptions, ElementType, ThemeType, PaymentElementLayout } from '../core/component/element/type';
11
11
  interface onCnageResult {
12
12
  complete: boolean;
13
13
  addressValue: AddressItem[];
@@ -38,6 +38,11 @@ export interface IoptionsParams {
38
38
  product?: string;
39
39
  networkMode?: string;
40
40
  mode?: string;
41
+ securityRegion?: 'US' | 'SG' | 'DE';
42
+ }
43
+ export interface IPreloadOptions {
44
+ environment?: string;
45
+ securityRegion?: 'US' | 'SG' | 'DE';
41
46
  }
42
47
  export interface IApplePayOptionsParams extends Pick<IoptionsParams, 'locale' | 'environment' | 'onEventCallback' | 'analytics'> {
43
48
  }
@@ -224,6 +229,7 @@ export interface IsecurityConfig {
224
229
  export interface InitSecurityConfig {
225
230
  product: ProductSceneEnum;
226
231
  region?: string;
232
+ securityRegion?: 'US' | 'SG' | 'DE';
227
233
  }
228
234
  export interface frontModulesToBeLoadedInterface {
229
235
  acquirerName: string;
@@ -673,43 +679,7 @@ export type IAppendParams = {
673
679
  componentSign: ComponentSignEnum;
674
680
  iframeNodesParams: IappendIframeNodesParams;
675
681
  };
676
- export declare enum AccountStatusEnum {
677
- EFFECTIVE = "EFFECTIVE",
678
- UNREGISTERED = "UNREGISTERED"
679
- }
680
- export type IAccountInfo = {
681
- email?: string;
682
- verifyId?: string;
683
- accountStatus?: AccountStatusEnum;
684
- oneAccountId?: string;
685
- needOtp?: boolean;
686
- errorMsg?: string;
687
- inputStatus?: 'success' | 'loading' | 'error' | 'focused' | '';
688
- resendLeftTimes?: number;
689
- };
690
- export interface AccountQueryRequest {
691
- paymentSessionData: string;
692
- paymentSessionConfig: any;
693
- accountInfo: IAccountInfo;
694
- }
695
- export interface ShippingsItem {
696
- shippingName: {
697
- firstName: string;
698
- lastName: string;
699
- };
700
- prefer: '1' | '0';
701
- shippingId: string;
702
- shippingPhoneNo: string;
703
- shippingAddress: {
704
- region: string;
705
- state: string;
706
- city: string;
707
- address1: string;
708
- address2: string;
709
- zipCode: string;
710
- };
711
- }
712
- export interface ISubPaymentElementView {
682
+ interface ISubPaymentElementView {
713
683
  defaultText: string;
714
684
  defaultValue: string;
715
685
  elementMandatory: boolean;
@@ -805,85 +775,6 @@ export interface IPaymentMethod {
805
775
  paymentAmountView?: IAmountView;
806
776
  paymentQuoteId?: string;
807
777
  }
808
- interface Estimate {
809
- unit: string;
810
- value: number;
811
- }
812
- interface DeliveryEstimate {
813
- maximum: Estimate;
814
- minimum: Estimate;
815
- }
816
- interface FixedAmount {
817
- amount: number;
818
- currency: string;
819
- }
820
- interface ShippingRateData {
821
- displayName: string;
822
- deliveryEstimate: DeliveryEstimate;
823
- fixedAmount: FixedAmount;
824
- }
825
- export interface ShippingAddress {
826
- address1: string;
827
- address2: string;
828
- city: string;
829
- region: string;
830
- state: string;
831
- zipCode: string;
832
- }
833
- export interface IUserName {
834
- firstName: string;
835
- middleName?: string;
836
- lastName: string;
837
- fullName?: string;
838
- }
839
- export type Shippings = ShippingsItem[];
840
- export type IPaymentMethods = IPaymentMethod[];
841
- export interface CKPShipping {
842
- shippingRateId?: string;
843
- shippingRateData?: ShippingRateData;
844
- shippingAddress: ShippingAddress;
845
- shippingFee?: IAmount;
846
- shippingFeeView?: IAmountView;
847
- shippingDescription?: string;
848
- deliveryEstimate?: DeliveryEstimate;
849
- shippingFeeId?: string;
850
- shippingName?: IUserName;
851
- shippingPhoneNo?: string;
852
- shipToEmail?: string;
853
- notes?: string;
854
- }
855
- export interface AccountQueryResult {
856
- accountInfo: IAccountInfo;
857
- actionForm?: ActionForm;
858
- paymentMethods: IPaymentMethods;
859
- shippings: Shippings;
860
- success: boolean;
861
- errorCode?: string;
862
- errorMessage?: string;
863
- errorStatus?: string;
864
- shippingInfo?: CKPShipping;
865
- }
866
- export declare enum ElementPaymentMethod {
867
- CONTAINER_ELEMENT = "CONTAINER_ELEMENT",
868
- AUTH_ELEMENT = "AUTH_ELEMENT",
869
- ADDRESS_ELEMENT = "ADDRESS_ELEMENT",
870
- PAYMENT_ELEMENT = "PAYMENT_ELEMENT"
871
- }
872
- export declare enum ElementPaymentEvent {
873
- RENDER_COMPONENT = "renderComponent",
874
- CAPTURE_ASSET = "onCaptureAsset",
875
- SIGN_OUT = "onSignout",
876
- BLUR = "onBlur",
877
- VALIDATE = "submitPay",
878
- SUBMIT_RISK = "onSubmitRisk",
879
- AFTER_SUBMIT = "onAfterSubmit",
880
- SIZE_CHANGE = "onSizeChange",
881
- LAUNCH = "onLaunch",
882
- CALLBACK = "callback",
883
- SEND_MUITI_APP_EVENT_TO_SDK = "sendMuitiAppEventToSdk",
884
- LOG = "log",
885
- HANDLE_PAYMENT = "handlePayment"
886
- }
887
778
  export declare enum ConnectErrorCode {
888
779
  RISK_REJECT = "RISK_REJECT",
889
780
  USER_AUTH_VERIFICATION_FAILED = "USER_AUTH_VERIFICATION_FAILED",
@@ -7,7 +7,8 @@
7
7
  */
8
8
 
9
9
  /* eslint-disable @typescript-eslint/no-explicit-any */
10
- export * from "../core/component/element/type";
10
+
11
+ export { ElementType, ThemeType, PaymentElementLayout } from "../core/component/element/type";
11
12
 
12
13
  /**
13
14
  * SDK options
@@ -211,14 +212,6 @@ export var ProductSceneVersion = /*#__PURE__*/function (ProductSceneVersion) {
211
212
  ProductSceneVersion["V2"] = "2.0";
212
213
  return ProductSceneVersion;
213
214
  }({});
214
- export var AccountStatusEnum = /*#__PURE__*/function (AccountStatusEnum) {
215
- AccountStatusEnum["EFFECTIVE"] = "EFFECTIVE";
216
- AccountStatusEnum["UNREGISTERED"] = "UNREGISTERED";
217
- return AccountStatusEnum;
218
- }({});
219
-
220
- // element 接口start
221
-
222
215
  export var InterActionTypeEnum = /*#__PURE__*/function (InterActionTypeEnum) {
223
216
  InterActionTypeEnum["COLLECT_REDIRECT"] = "COLLECT_REDIRECT";
224
217
  InterActionTypeEnum["SHOW_CODE"] = "SHOW_CODE";
@@ -226,31 +219,6 @@ export var InterActionTypeEnum = /*#__PURE__*/function (InterActionTypeEnum) {
226
219
  InterActionTypeEnum["REDIRECT"] = "REDIRECT";
227
220
  return InterActionTypeEnum;
228
221
  }({});
229
- // element 接口end
230
-
231
- export var ElementPaymentMethod = /*#__PURE__*/function (ElementPaymentMethod) {
232
- ElementPaymentMethod["CONTAINER_ELEMENT"] = "CONTAINER_ELEMENT";
233
- ElementPaymentMethod["AUTH_ELEMENT"] = "AUTH_ELEMENT";
234
- ElementPaymentMethod["ADDRESS_ELEMENT"] = "ADDRESS_ELEMENT";
235
- ElementPaymentMethod["PAYMENT_ELEMENT"] = "PAYMENT_ELEMENT";
236
- return ElementPaymentMethod;
237
- }({});
238
- export var ElementPaymentEvent = /*#__PURE__*/function (ElementPaymentEvent) {
239
- ElementPaymentEvent["RENDER_COMPONENT"] = "renderComponent";
240
- ElementPaymentEvent["CAPTURE_ASSET"] = "onCaptureAsset";
241
- ElementPaymentEvent["SIGN_OUT"] = "onSignout";
242
- ElementPaymentEvent["BLUR"] = "onBlur";
243
- ElementPaymentEvent["VALIDATE"] = "submitPay";
244
- ElementPaymentEvent["SUBMIT_RISK"] = "onSubmitRisk";
245
- ElementPaymentEvent["AFTER_SUBMIT"] = "onAfterSubmit";
246
- ElementPaymentEvent["SIZE_CHANGE"] = "onSizeChange";
247
- ElementPaymentEvent["LAUNCH"] = "onLaunch";
248
- ElementPaymentEvent["CALLBACK"] = "callback";
249
- ElementPaymentEvent["SEND_MUITI_APP_EVENT_TO_SDK"] = "sendMuitiAppEventToSdk";
250
- ElementPaymentEvent["LOG"] = "log";
251
- ElementPaymentEvent["HANDLE_PAYMENT"] = "handlePayment";
252
- return ElementPaymentEvent;
253
- }({});
254
222
  export var ConnectErrorCode = /*#__PURE__*/function (ConnectErrorCode) {
255
223
  ConnectErrorCode["RISK_REJECT"] = "RISK_REJECT";
256
224
  ConnectErrorCode["USER_AUTH_VERIFICATION_FAILED"] = "USER_AUTH_VERIFICATION_FAILED";
@@ -13,6 +13,7 @@ export declare const securityHost: {
13
13
  export declare const sceneMap: {
14
14
  CASHIER_PAYMENT: string;
15
15
  AUTO_DEBIT: string;
16
+ AUTO_DEBIT_PAY: string;
16
17
  VAULTING: string;
17
18
  CARD_APPLE_PAY: string;
18
19
  EASYPAY: string;
@@ -24,11 +24,12 @@ export var securityHost = {
24
24
  US: 'https://open-na-global.alipay.com/api/open/risk_client',
25
25
  DE: 'https://open-de-global.alipay.com/api/open/risk_client'
26
26
  };
27
- export var sceneMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ProductSceneEnum.CASHIER_PAYMENT, 'Acquirer'), ProductSceneEnum.AUTO_DEBIT, 'Acquirer'), ProductSceneEnum.VAULTING, 'Acquirer'), ProductSceneEnum.CARD_APPLE_PAY, 'Acquirer'), "EASYPAY", 'EasyPay'), ProductSceneEnum.EASY_PAY, 'EasyPay'), ProductSceneEnum.FLASH_BUY, 'OneAccount'), ProductSceneEnum.ELEMENT_PAYMENT, 'Acquirer');
27
+ export var sceneMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ProductSceneEnum.CASHIER_PAYMENT, 'Acquirer'), ProductSceneEnum.AUTO_DEBIT, 'Acquirer'), ProductSceneEnum.AUTO_DEBIT_PAY, 'Acquirer'), ProductSceneEnum.VAULTING, 'Acquirer'), ProductSceneEnum.CARD_APPLE_PAY, 'Acquirer'), "EASYPAY", 'EasyPay'), ProductSceneEnum.EASY_PAY, 'EasyPay'), ProductSceneEnum.FLASH_BUY, 'OneAccount'), ProductSceneEnum.ELEMENT_PAYMENT, 'Acquirer');
28
28
  export var getSecurityHost = function getSecurityHost(region) {
29
29
  return securityHost[region] || securityHost[SecurityRegionEnum.SG];
30
30
  };
31
31
  export var getSecurityScene = function getSecurityScene(product) {
32
+ console.log('getSecurityScene', product);
32
33
  return sceneMap[product] || '';
33
34
  };
34
35
  export var Security = /*#__PURE__*/function () {
@@ -42,6 +43,7 @@ export var Security = /*#__PURE__*/function () {
42
43
  _createClass(Security, [{
43
44
  key: "initSecurity",
44
45
  value: function initSecurity(successCallback, failCallback) {
46
+ console.log(this.scene, 'preloadSecuritySDK');
45
47
  if (!this.scene) {
46
48
  throw new Error('securityConfig parameter error');
47
49
  }
@@ -164,6 +164,9 @@ export declare const SPM_MAP: {
164
164
  load_item_sdk_timeout: string;
165
165
  MerchantValidationError: string;
166
166
  PaymentAuthorizedError: string;
167
+ sdk_element_create: string;
168
+ sdk_element_mount_fail: string;
169
+ sdk_element_mount_start: string;
167
170
  'ApplePaySession is only support in Safari': string;
168
171
  'Abnormal params paymentSessionFactor': string;
169
172
  'Abnormal params recurringInfo': string;
@@ -164,6 +164,9 @@ export var SPM_MAP = {
164
164
  load_item_sdk_timeout: 'a3753.b101271.c388188.d512345',
165
165
  MerchantValidationError: 'a3753.b101271.c388189.d518377',
166
166
  PaymentAuthorizedError: 'a3753.b101271.c388189.d518377',
167
+ sdk_element_create: 'a3753.b101271.c386688',
168
+ sdk_element_mount_fail: 'a3753.b101271.c386691',
169
+ sdk_element_mount_start: 'a3753.b101271.c386690',
167
170
  'ApplePaySession is only support in Safari': 'a3753.b101271.c388189.d518377',
168
171
  'Abnormal params paymentSessionFactor': 'a3753.b101271.c388189.d518377',
169
172
  'Abnormal params recurringInfo': 'a3753.b101271.c388189.d518377',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "1.30.0",
3
+ "version": "1.31.1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",
@@ -1,4 +0,0 @@
1
- import { AccountQueryRequest, RequestConfig, AccountQueryResult, CashierSdkActionQueryRequest, CashierSdkActionQueryResult } from '../types';
2
- import type { Logger } from '../util/logger';
3
- export declare function getElementOneAccount(payload: AccountQueryRequest, options: RequestConfig, logger: Logger): Promise<AccountQueryResult>;
4
- export declare function getElementSdkAction(payload: CashierSdkActionQueryRequest, options: RequestConfig, logger: Logger): Promise<CashierSdkActionQueryResult>;
@@ -1,51 +0,0 @@
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
- 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; }
4
- 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; }
5
- 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; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
- 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
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
10
- import { request } from "../request";
11
- export function getElementOneAccount(_x, _x2, _x3) {
12
- return _getElementOneAccount.apply(this, arguments);
13
- }
14
- function _getElementOneAccount() {
15
- _getElementOneAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(payload, options, logger) {
16
- return _regeneratorRuntime().wrap(function _callee$(_context) {
17
- while (1) switch (_context.prev = _context.next) {
18
- case 0:
19
- return _context.abrupt("return", request(payload, _objectSpread(_objectSpread({}, options), {}, {
20
- 'Operation-Type': 'com.ipay.iexpfront.one.account.query'
21
- }), logger));
22
- case 1:
23
- case "end":
24
- return _context.stop();
25
- }
26
- }, _callee);
27
- }));
28
- return _getElementOneAccount.apply(this, arguments);
29
- }
30
- export function getElementSdkAction(_x4, _x5, _x6) {
31
- return _getElementSdkAction.apply(this, arguments);
32
- }
33
- function _getElementSdkAction() {
34
- _getElementSdkAction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(payload, options, logger) {
35
- var _options;
36
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
37
- while (1) switch (_context2.prev = _context2.next) {
38
- case 0:
39
- // const deviceId = await getDeviceId();
40
- _options = _objectSpread({}, options);
41
- return _context2.abrupt("return", request(payload, _objectSpread(_objectSpread({}, _options), {}, {
42
- 'Operation-Type': 'com.ipay.iexpcashier.sdkAction.query'
43
- }), logger));
44
- case 2:
45
- case "end":
46
- return _context2.stop();
47
- }
48
- }, _callee2);
49
- }));
50
- return _getElementSdkAction.apply(this, arguments);
51
- }