@cloudbase/cli 2.2.4-private.3 → 2.2.4-private.5

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.
@@ -60,11 +60,12 @@ function promisifyProcess(p, pipe = false) {
60
60
  exports.promisifyProcess = promisifyProcess;
61
61
  function getLowcodeCli() {
62
62
  return __awaiter(this, void 0, void 0, function* () {
63
+ var _a;
63
64
  const key = '@cloudbase/lowcode-cli';
64
65
  const cache = new Map();
65
66
  let result;
66
67
  if (!cache.get(key)) {
67
- const module = yield Promise.resolve().then(() => __importStar(require(key)));
68
+ const module = yield (_a = key, Promise.resolve().then(() => __importStar(require(_a))));
68
69
  cache.set(key, module);
69
70
  }
70
71
  result = cache.get(key);
@@ -18,6 +18,15 @@ const debug_logger_1 = require("../debug-logger");
18
18
  let commonCredential;
19
19
  const isTokenExpired = (credential, gap = 120) => credential.accessTokenExpired && Number(credential.accessTokenExpired) < Date.now() + gap * 1000;
20
20
  class CloudApiService {
21
+ static getInstance(service) {
22
+ var _a;
23
+ if ((_a = CloudApiService.serviceCacheMap) === null || _a === void 0 ? void 0 : _a[service]) {
24
+ return CloudApiService.serviceCacheMap[service];
25
+ }
26
+ const apiService = new CloudApiService(service);
27
+ CloudApiService.serviceCacheMap[service] = apiService;
28
+ return apiService;
29
+ }
21
30
  constructor(service, baseParams, version = '') {
22
31
  this.apiService = new cloud_api_1.CloudApiService({
23
32
  service,
@@ -38,15 +47,6 @@ class CloudApiService {
38
47
  })
39
48
  });
40
49
  }
41
- static getInstance(service) {
42
- var _a;
43
- if ((_a = CloudApiService.serviceCacheMap) === null || _a === void 0 ? void 0 : _a[service]) {
44
- return CloudApiService.serviceCacheMap[service];
45
- }
46
- const apiService = new CloudApiService(service);
47
- CloudApiService.serviceCacheMap[service] = apiService;
48
- return apiService;
49
- }
50
50
  request(action, data = {}, method = 'POST') {
51
51
  return __awaiter(this, void 0, void 0, function* () {
52
52
  const region = this.region || (yield (0, toolbox_1.getRegion)());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cli",
3
- "version": "2.2.4-private.3",
3
+ "version": "2.2.4-private.5",
4
4
  "description": "cli tool for cloudbase",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "@cloudbase/cloud-api": "^0.5.5",
34
34
  "@cloudbase/framework-core": "^1.9.6",
35
- "@cloudbase/lowcode-cli": "0.18.5-private.0",
35
+ "@cloudbase/lowcode-cli": "0.18.5-private.4",
36
36
  "@cloudbase/manager-node": "4.0.1",
37
37
  "@cloudbase/toolbox": "^0.7.4",
38
38
  "@sentry/node": "^5.10.2",
@@ -1,4 +1,4 @@
1
1
  import { ParamTypes } from '../constants';
2
- declare type GetterFunction = (target: any) => Promise<any> | any;
2
+ type GetterFunction = (target: any) => Promise<any> | any;
3
3
  export declare const createParamDecorator: (paramtype: ParamTypes, getter: GetterFunction) => () => (target: any, key: string | symbol, index: number) => void;
4
4
  export {};
package/types/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- export declare type CustomEvent = 'logout';
2
+ export type CustomEvent = 'logout';
3
3
  export interface ICommandContext {
4
4
  cmd: string;
5
5
  envId: string;
@@ -33,7 +33,7 @@ export interface TmpCredential {
33
33
  uin?: string;
34
34
  hash?: string;
35
35
  }
36
- export declare type Credential = TmpCredential & PermanentCredential;
36
+ export type Credential = TmpCredential & PermanentCredential;
37
37
  export interface AuthSecret {
38
38
  secretId: string;
39
39
  secretKey: string;
@@ -10,7 +10,7 @@ export interface IArgs {
10
10
  }
11
11
  export declare const getArgs: () => Arguments<IArgs>;
12
12
  export declare function getPrivateSettings(config: ICloudBaseRcSettings, cmd?: string): undefined | IPrivateSettings;
13
- declare type IAbsUrl = `http://${string}` | `https://${string}`;
13
+ type IAbsUrl = `http://${string}` | `https://${string}`;
14
14
  export interface IPrivateSettings {
15
15
  credential: Credential;
16
16
  endpoints: {
@@ -1,5 +1,5 @@
1
1
  export * from './del';
2
- export declare type SizeUnit = 'KB' | 'MB' | 'GB';
2
+ export type SizeUnit = 'KB' | 'MB' | 'GB';
3
3
  export declare function checkFullAccess(dest: string, throwError?: boolean): boolean;
4
4
  export declare function checkWritable(dest: string, throwError?: boolean): boolean;
5
5
  export declare function checkReadable(dest: string, throwError?: boolean): boolean;
@@ -1,7 +1,7 @@
1
1
  import _fetch, { RequestInit } from 'node-fetch';
2
- declare type fetchReturnType = ReturnType<typeof _fetch>;
3
- declare type UnPromisify<T> = T extends PromiseLike<infer U> ? U : T;
4
- declare type fetchReturnTypeExtracted = UnPromisify<fetchReturnType>;
2
+ type fetchReturnType = ReturnType<typeof _fetch>;
3
+ type UnPromisify<T> = T extends PromiseLike<infer U> ? U : T;
4
+ type fetchReturnTypeExtracted = UnPromisify<fetchReturnType>;
5
5
  export declare function fetch(url: string, config?: RequestInit): Promise<any>;
6
6
  export declare function postFetch(url: string, data?: Record<string, any>): Promise<any>;
7
7
  export declare function fetchStream(url: any, config?: Record<string, any>): Promise<fetchReturnTypeExtracted>;
@@ -8,7 +8,7 @@ declare class Loading {
8
8
  fail(text: string): void;
9
9
  }
10
10
  export declare const loadingFactory: () => Loading;
11
- declare type Task<T> = (flush: (text: string) => void, ...args: any[]) => Promise<T>;
11
+ type Task<T> = (flush: (text: string) => void, ...args: any[]) => Promise<T>;
12
12
  export interface ILoadingOptions {
13
13
  startTip?: string;
14
14
  successTip?: string;
@@ -1,4 +1,4 @@
1
- export declare type AsyncTask = () => Promise<any>;
1
+ export type AsyncTask = () => Promise<any>;
2
2
  export declare class AsyncTaskParallelController {
3
3
  maxParallel: number;
4
4
  tasks: AsyncTask[];
@@ -1,4 +1,4 @@
1
- declare type SimpleValue = number | string | boolean;
1
+ type SimpleValue = number | string | boolean;
2
2
  export declare function assertTruthy(val: SimpleValue | SimpleValue[], errMsg: string): void;
3
3
  export declare function assertHas(obj: any, prop: string, errMsg: any): void;
4
4
  export declare const validateIp: (ip: string) => boolean;