@cloudbase/manager-node 4.2.4 → 4.2.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.
- package/lib/access/index.js +141 -0
- package/lib/access/types.js +2 -0
- package/lib/billing/index.js +36 -0
- package/lib/cam/index.js +77 -0
- package/lib/cloudBaseRun/index.js +36 -0
- package/lib/cloudBaseRun/types.js +2 -0
- package/lib/common/index.js +39 -0
- package/lib/constant.js +55 -0
- package/lib/context.js +14 -0
- package/lib/database/index.js +244 -0
- package/lib/debug.js +34 -0
- package/lib/env/index.js +289 -0
- package/lib/environment.js +124 -0
- package/lib/environmentManager.js +44 -0
- package/lib/error.js +16 -0
- package/lib/function/index.js +1019 -0
- package/lib/function/packer.js +129 -0
- package/lib/function/types.js +2 -0
- package/lib/hosting/index.js +461 -0
- package/lib/index.js +83 -0
- package/lib/interfaces/base.interface.js +2 -0
- package/lib/interfaces/billing.interface.js +2 -0
- package/lib/interfaces/cam.interface.js +2 -0
- package/lib/interfaces/flexdb.interface.js +2 -0
- package/lib/interfaces/function.interface.js +2 -0
- package/lib/interfaces/index.js +19 -0
- package/lib/interfaces/storage.interface.js +2 -0
- package/lib/interfaces/tcb.interface.js +2 -0
- package/lib/storage/index.js +1051 -0
- package/lib/third/index.js +18 -0
- package/lib/user/index.js +136 -0
- package/lib/user/types.js +2 -0
- package/lib/utils/auth.js +97 -0
- package/lib/utils/cloud-api-request.js +212 -0
- package/lib/utils/cloudbase-request.js +69 -0
- package/lib/utils/envLazy.js +18 -0
- package/lib/utils/fs.js +64 -0
- package/lib/utils/http-request.js +44 -0
- package/lib/utils/index.js +103 -0
- package/lib/utils/parallel.js +69 -0
- package/lib/utils/runenv.js +8 -0
- package/lib/utils/uuid.js +18 -0
- package/package.json +1 -1
- package/types/access/index.d.ts +38 -0
- package/types/access/types.d.ts +42 -0
- package/types/billing/index.d.ts +21 -0
- package/types/cam/index.d.ts +63 -0
- package/types/cloudBaseRun/index.d.ts +12 -0
- package/types/cloudBaseRun/types.d.ts +21 -0
- package/types/common/index.d.ts +18 -0
- package/types/constant.d.ts +44 -0
- package/types/context.d.ts +17 -0
- package/types/database/index.d.ts +66 -0
- package/types/debug.d.ts +1 -0
- package/types/env/index.d.ts +127 -0
- package/types/environment.d.ts +51 -0
- package/types/environmentManager.d.ts +13 -0
- package/types/error.d.ts +18 -0
- package/types/function/index.d.ts +379 -0
- package/types/function/packer.d.ts +37 -0
- package/types/function/types.d.ts +154 -0
- package/types/hosting/index.d.ts +253 -0
- package/types/index.d.ts +52 -0
- package/types/interfaces/base.interface.d.ts +7 -0
- package/types/interfaces/billing.interface.d.ts +18 -0
- package/types/interfaces/cam.interface.d.ts +24 -0
- package/types/interfaces/flexdb.interface.d.ts +67 -0
- package/types/interfaces/function.interface.d.ts +65 -0
- package/types/interfaces/index.d.ts +7 -0
- package/types/interfaces/storage.interface.d.ts +26 -0
- package/types/interfaces/tcb.interface.d.ts +305 -0
- package/types/storage/index.d.ts +324 -0
- package/types/third/index.d.ts +11 -0
- package/types/user/index.d.ts +52 -0
- package/types/user/types.d.ts +20 -0
- package/types/utils/auth.d.ts +8 -0
- package/types/utils/cloud-api-request.d.ts +21 -0
- package/types/utils/cloudbase-request.d.ts +14 -0
- package/types/utils/envLazy.d.ts +1 -0
- package/types/utils/fs.d.ts +7 -0
- package/types/utils/http-request.d.ts +2 -0
- package/types/utils/index.d.ts +20 -0
- package/types/utils/parallel.d.ts +17 -0
- package/types/utils/runenv.d.ts +1 -0
- package/types/utils/uuid.d.ts +2 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CloudBaseContext } from '../context';
|
|
2
|
+
export declare class CloudService {
|
|
3
|
+
service: string;
|
|
4
|
+
version: string;
|
|
5
|
+
url: string;
|
|
6
|
+
action: string;
|
|
7
|
+
method: 'POST' | 'GET';
|
|
8
|
+
secretId: string;
|
|
9
|
+
secretKey: string;
|
|
10
|
+
token: string;
|
|
11
|
+
timeout: number;
|
|
12
|
+
data: Record<string, any>;
|
|
13
|
+
payload: Record<string, any>;
|
|
14
|
+
baseParams: Record<string, any>;
|
|
15
|
+
cloudBaseContext: CloudBaseContext;
|
|
16
|
+
constructor(context: CloudBaseContext, service: string, version: string, baseParams?: Record<string, any>);
|
|
17
|
+
get baseUrl(): any;
|
|
18
|
+
request<T extends {}>(action: string, data?: Record<string, any>, method?: 'POST' | 'GET'): Promise<T>;
|
|
19
|
+
requestWithSign(): Promise<any>;
|
|
20
|
+
getRequestSign(timestamp: number): string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function cloudBaseRequest(options: {
|
|
2
|
+
config: {
|
|
3
|
+
envId: string;
|
|
4
|
+
secretId: string;
|
|
5
|
+
secretKey: string;
|
|
6
|
+
token?: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
proxy: string;
|
|
9
|
+
region: string;
|
|
10
|
+
};
|
|
11
|
+
params: Record<string, any>;
|
|
12
|
+
method?: string;
|
|
13
|
+
headers?: Record<string, any>;
|
|
14
|
+
}): Promise<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function preLazy(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare type SizeUnit = 'MB' | 'GB';
|
|
2
|
+
export declare function checkFullAccess(dest: string, throwError?: boolean): boolean;
|
|
3
|
+
export declare function checkReadable(dest: string, throwError?: boolean): boolean;
|
|
4
|
+
export declare function isDirectory(dest: string): boolean;
|
|
5
|
+
export declare function formateFileSize(size: number, unit: SizeUnit): string;
|
|
6
|
+
export declare function delSync(patterns: string | readonly string[]): void;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { guid6 } from './uuid';
|
|
2
|
+
export * from './cloud-api-request';
|
|
3
|
+
export * from './auth';
|
|
4
|
+
export * from './cloudbase-request';
|
|
5
|
+
export * from './http-request';
|
|
6
|
+
export * from './envLazy';
|
|
7
|
+
export * from './fs';
|
|
8
|
+
interface IZipOption {
|
|
9
|
+
dirPath: string;
|
|
10
|
+
outputPath: string;
|
|
11
|
+
ignore?: string | string[];
|
|
12
|
+
pattern?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function compressToZip(option: IZipOption): Promise<unknown>;
|
|
15
|
+
export declare function getRuntime(): string;
|
|
16
|
+
export declare function getEnvVar(envName: string): string;
|
|
17
|
+
export declare function rsaEncrypt(data: string): string;
|
|
18
|
+
export declare function sleep(time: number): Promise<void>;
|
|
19
|
+
export declare function upperCaseStringFisrt(str: string): string;
|
|
20
|
+
export declare function upperCaseObjKey(object: any): any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare type AsyncTask = () => Promise<any>;
|
|
2
|
+
/**
|
|
3
|
+
* 异步任务并发控制器,以一定的并发数执行所有任务
|
|
4
|
+
* 不具备队列性质,异步任务随机执行
|
|
5
|
+
* 单个任务异常,错误会返回,单不会退出执行
|
|
6
|
+
* 所有任务执行
|
|
7
|
+
*/
|
|
8
|
+
export declare class AsyncTaskParallelController {
|
|
9
|
+
maxParallel: number;
|
|
10
|
+
tasks: AsyncTask[];
|
|
11
|
+
checkInterval: number;
|
|
12
|
+
totalTasks: number;
|
|
13
|
+
constructor(maxParallel: number, checkInterval?: number);
|
|
14
|
+
loadTasks(tasks: AsyncTask[]): void;
|
|
15
|
+
push(task: AsyncTask): void;
|
|
16
|
+
run(): Promise<any[]>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function checkIsInScf(): boolean;
|