@be-link/shield-for-tcb-node-sdk 0.0.7 → 0.1.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.
@@ -3,11 +3,11 @@ export default abstract class BaseService {
3
3
  /** URL一级路径 */
4
4
  protected abstract prefixUrl: string;
5
5
  /** 子网域名 */
6
- protected readonly natDevHost = "http://yayvmsbg.shield-for-tcb.07vmo6rk.by26x7u9.com:8090";
7
- protected readonly natProdHost = "";
6
+ protected readonly natDevHost = "http://shield:8090";
7
+ protected readonly natProdHost = "http://shield:8090";
8
8
  /** 公网域名 */
9
- protected readonly publicDevHost = "https://shield-for-tcb-196345-5-1304510571.sh.run.tcloudbase.com";
10
- protected readonly publicProdHost = "";
9
+ protected readonly publicDevHost = "https://ecommerce-dev.wejourney.top";
10
+ protected readonly publicProdHost = "https://ecommerce-release.wejourney.top";
11
11
  constructor();
12
12
  /** 获取API URL */
13
13
  protected getApiUrl(func: Function): string;
@@ -8,11 +8,11 @@ const string_1 = require("../utils/string");
8
8
  class BaseService {
9
9
  constructor() {
10
10
  /** 子网域名 */
11
- this.natDevHost = 'http://yayvmsbg.shield-for-tcb.07vmo6rk.by26x7u9.com:8090';
12
- this.natProdHost = '';
11
+ this.natDevHost = 'http://shield:8090';
12
+ this.natProdHost = 'http://shield:8090';
13
13
  /** 公网域名 */
14
- this.publicDevHost = 'https://shield-for-tcb-196345-5-1304510571.sh.run.tcloudbase.com';
15
- this.publicProdHost = '';
14
+ this.publicDevHost = 'https://ecommerce-dev.wejourney.top';
15
+ this.publicProdHost = 'https://ecommerce-release.wejourney.top';
16
16
  /** 如果是云函数环境, 默认走公网访问 */
17
17
  this.isPublicEnv = (process.env.CONTAINER_ENV || 'SCF') === 'SCF';
18
18
  }
@@ -12,7 +12,7 @@ export declare class ConfigService extends BaseService implements Service.Config
12
12
  fetchConfig(req: Service.Request.QueryFetchConfig): Promise<any>;
13
13
  fetchGlobalDynamicConfig(): Promise<Service.Response.IFetchGlobalDynamicConfigResponse>;
14
14
  getCosTempSecret(): Promise<Service.Response.CosTempSecretResponse>;
15
- fetchSystemTime(): Promise<Date>;
15
+ fetchSystemTime(): Promise<number>;
16
16
  }
17
17
  export declare const backendConfigService: ConfigService;
18
18
  export declare const frontendConfigService: ConfigService;
@@ -9,7 +9,7 @@ const BaseService_1 = __importDefault(require("../BaseService"));
9
9
  class ConfigService extends BaseService_1.default {
10
10
  constructor(options) {
11
11
  super();
12
- this.prefixUrl = '/config';
12
+ this.prefixUrl = '/shield/config';
13
13
  this.caller = options?.caller ?? 'backend';
14
14
  }
15
15
  get shouldSkipErrorHandling() {
@@ -60,6 +60,6 @@ export declare namespace Service {
60
60
  * 获取系统时间
61
61
  * @returns 系统时间
62
62
  */
63
- fetchSystemTime(): Promise<Date>;
63
+ fetchSystemTime(): Promise<number>;
64
64
  }
65
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/shield-for-tcb-node-sdk",
3
- "version": "0.0.7",
3
+ "version": "0.1.0",
4
4
  "description": "ShieldForTCB Node.js SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/utils/http.js CHANGED
@@ -74,7 +74,7 @@ async function callApi(url, request, options) {
74
74
  console.error(`shield-for-tcb 异常: ${axiosError.message}, requestId: ${requestId}`);
75
75
  console.info('响应信息', data.message);
76
76
  console.error('异常堆栈', JSON.stringify(error.stack));
77
- throw new Error(data.errorType + ' - ' + data.message);
77
+ throw axiosError;
78
78
  }
79
79
  // 调用dns模块解析url
80
80
  const dns = await Promise.resolve().then(() => __importStar(require('dns')));