@alipay/ams-checkout 0.0.1779094014-dev.2 → 0.0.1779094014-dev.3

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 (33) hide show
  1. package/ams-checkout.js +3 -3
  2. package/dist/ams-checkout.min.js +1 -1
  3. package/dist/ams-checkout.min.js.map +1 -1
  4. package/esm/config/index.d.ts +7 -0
  5. package/esm/config/index.js +2 -2
  6. package/esm/core/component/element/index.js +1 -1
  7. package/esm/core/component/element/modernElementController/adapter.d.ts +1 -2
  8. package/esm/core/component/element/modernElementController/index.js +4 -13
  9. package/esm/modern/index.js +1 -1
  10. package/esm/modern/stageName.d.ts +3 -0
  11. package/esm/modern/stageName.js +1 -0
  12. package/esm/modern/tools.d.ts +16 -0
  13. package/esm/modern/tools.js +1 -0
  14. package/esm/util/logger.js +1 -2
  15. package/package.json +3 -2
  16. package/types.d.ts +147 -0
  17. package/types.untrimmed.d.ts +150 -0
  18. package/esm/modern/oneapi/iexpfront/PaymentSessionService.d.ts +0 -23
  19. package/esm/modern/oneapi/iexpfront/PaymentSessionService.js +0 -55
  20. package/esm/modern/oneapi/iexpfront/definitions.d.ts +0 -3656
  21. package/esm/modern/oneapi/iexpfront/definitions.js +0 -1
  22. package/esm/modern/tools/AntomSDKError.d.ts +0 -47
  23. package/esm/modern/tools/AntomSDKError.js +0 -47
  24. package/esm/modern/tools/buildPageUrl.d.ts +0 -4
  25. package/esm/modern/tools/buildPageUrl.js +0 -19
  26. package/esm/modern/tools/getDevReqConfig.d.ts +0 -2
  27. package/esm/modern/tools/getDevReqConfig.js +0 -16
  28. package/esm/modern/tools/getLocaleFromRenderData.d.ts +0 -6
  29. package/esm/modern/tools/getLocaleFromRenderData.js +0 -20
  30. package/esm/modern/tools/getMetaData.d.ts +0 -102
  31. package/esm/modern/tools/getMetaData.js +0 -7
  32. package/esm/modern/tools/openModal.d.ts +0 -20
  33. package/esm/modern/tools/openModal.js +0 -221
@@ -1,3 +1,10 @@
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
+ */
1
8
  export declare const marmotMap: Record<string, string>;
2
9
  export declare const marmotConfigMap: Record<string, string>;
3
10
  export declare const v2AppMarmotMap: Record<string, string>;
@@ -5,7 +5,7 @@
5
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
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
- import json from "../../package.json";
8
+
9
9
  export var marmotMap = {
10
10
  dev: 'http://page.alipay.net/page/antom-web-checkout/src/component-app',
11
11
  sit: 'http://page.test.alipay.net/page/antom-web-checkout/src/component-app',
@@ -30,7 +30,7 @@ export var v2AppMarmotMap = {
30
30
  light_sandbox: 'https://checkout.antom.com',
31
31
  prod: 'https://checkout.antom.com'
32
32
  };
33
- export var sdkVersion = json.version;
33
+ export var sdkVersion = "0.0.1779094014-dev.3";
34
34
 
35
35
  /**
36
36
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
@@ -10,7 +10,7 @@ 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 { getMetaData } from "../../../modern/tools/getMetaData";
13
+ import { getMetaData } from "../../../modern/tools";
14
14
  import ElementController from "./elementController";
15
15
  import { ModernElementController } from "./modernElementController";
16
16
  import { InvalidElementConfigError } from "./type";
@@ -1,7 +1,6 @@
1
- import type { ErrorPayload } from '@antintl/opensdk-core';
2
1
  import type { IPaymentApiResponse } from '../type';
3
2
  import { EventCallbackCode } from '../type';
4
- import type { SubmitResult } from "../../../../modern/sdk/types";
3
+ import type { SubmitResult, ErrorPayload } from "../../../../modern/tools";
5
4
  export declare function adaptSubmitResult(result: SubmitResult): IPaymentApiResponse;
6
5
  export declare function adaptErrorToEventCallback(error: ErrorPayload): {
7
6
  code: EventCallbackCode;
@@ -19,20 +19,11 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
19
19
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
20
20
  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; } }
21
21
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
- import { MessageType } from '@antintl/opensdk-core';
23
- import { SDKBridge } from '@antintl/opensdk-bridge';
24
- import { request, parseHostSign } from '@antintl/antom-toolset';
22
+ import { MessageType, request, parseHostSign, SDKBridge } from "../../../../modern/tools";
23
+ import { AntomSDKError, openModal, sdkQuery, getLocaleFromRenderData, getDevReqConfig, getMetaData, buildPageUrl, debugError, debug } from "../../../../modern/tools";
25
24
  import { device } from "../../../../util";
26
- import { openModal } from "../../../../modern/tools/openModal";
27
- import { sdkQuery } from "../../../../modern/oneapi/iexpfront/PaymentSessionService";
28
- import { getLocaleFromRenderData } from "../../../../modern/tools/getLocaleFromRenderData";
29
- import { getDevReqConfig } from "../../../../modern/tools/getDevReqConfig";
30
25
  import { EventCallbackCode } from "../type";
31
26
  import { adaptSubmitResult, adaptErrorToEventCallback, adaptAppearance } from "./adapter";
32
- import { getMetaData } from "../../../../modern/tools/getMetaData";
33
- import { debugError, debug } from '@antintl/opensdk-core';
34
- import { buildPageUrl } from "../../../../modern/tools/buildPageUrl";
35
- import { AntomSDKError } from "../../../../modern/tools/AntomSDKError";
36
27
  var MOUNT_TIMEOUT = 16000;
37
28
 
38
29
  /**
@@ -222,7 +213,7 @@ export var ModernElementController = /*#__PURE__*/function () {
222
213
  request.setGlobalOptions({
223
214
  hostSign: parseHostSign(sessionData),
224
215
  env: this.options.environment,
225
- sdkVersion: "0.0.1779094014-dev.2" || ''
216
+ sdkVersion: "0.0.1779094014-dev.3" || ''
226
217
  });
227
218
 
228
219
  // 调用 sdkQuery 获取渲染数据,参照 VaultingElement.setup()
@@ -259,7 +250,7 @@ export var ModernElementController = /*#__PURE__*/function () {
259
250
  // 新增字段
260
251
  renderData: result.data,
261
252
  renderDataError: result.error,
262
- sdkVersion: "0.0.1779094014-dev.2" || '',
253
+ sdkVersion: "0.0.1779094014-dev.3" || '',
263
254
  merchantId: ((_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.merchantId) || '',
264
255
  env: this.options.environment || 'prod',
265
256
  _requestConfig: _objectSpread({
@@ -13,7 +13,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
13
13
  import { createLoader } from '@antglobal/create-sdk-loader';
14
14
  // @@antom-types是类型导出,不要用作值引入
15
15
 
16
- var stageName = true ? 'DEV' : false ? 'LOCAL' : 'PROD';
16
+ import { stageName } from "./stageName";
17
17
  var SDKURL = {
18
18
  DEV: "https://sdk-dev.marmot-cloud.com/package/ams-checkout/".concat("dev-1779094014", "/ams-checkout.js"),
19
19
  LOCAL: "http://localhost:3000/ams-checkout.min.js",
@@ -0,0 +1,3 @@
1
+ type StageName = 'DEV' | 'PROD' | 'LOCAL';
2
+ export declare const stageName: StageName;
3
+ export {};
@@ -0,0 +1 @@
1
+ export var stageName = true ? 'DEV' : false ? 'LOCAL' : 'PROD';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @description modern tools,提供给老sdk使用,所以必须使用umd打包方式,不要修改
3
+ */
4
+ export { buildPageUrl } from './sdk/tools/buildPageUrl';
5
+ export { getDevReqConfig } from './sdk/tools/getDevReqConfig';
6
+ export { getLocaleFromRenderData } from './sdk/tools/getLocaleFromRenderData';
7
+ export { getMetaData } from './sdk/tools/getMetaData';
8
+ export { openModal } from './sdk/tools/openModal';
9
+ export { AntomSDKError } from './sdk/types';
10
+ export { sdkQuery } from './sdk/oneapi/iexpfront/PaymentSessionService';
11
+ export type { AntomBridgeEventMap, SubmitResult } from './sdk/types';
12
+ export type { ErrorPayload, BaseBridgeEventMap } from '@antintl/opensdk-core';
13
+ export { MessageType } from '@antintl/opensdk-core';
14
+ export { debugError, debug } from '@antintl/opensdk-core';
15
+ export { request, parseHostSign } from '@antintl/antom-toolset';
16
+ export { SDKBridge } from '@antintl/opensdk-bridge';