@cloudbase/manager-node 4.2.4 → 4.2.6
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 +288 -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,154 @@
|
|
|
1
|
+
export interface ITag {
|
|
2
|
+
TagKey: string;
|
|
3
|
+
TagValue: string[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* VPC
|
|
7
|
+
*/
|
|
8
|
+
export interface IVpc {
|
|
9
|
+
VpcId: string;
|
|
10
|
+
VpcName: string;
|
|
11
|
+
CidrBlock: string;
|
|
12
|
+
Ipv6CidrBlock: string;
|
|
13
|
+
IsDefault: false;
|
|
14
|
+
EnableMulticast: false;
|
|
15
|
+
CreatedTime: string;
|
|
16
|
+
EnableDhcp: boolean;
|
|
17
|
+
DhcpOptionsId: string;
|
|
18
|
+
DnsServerSet: string[];
|
|
19
|
+
DomainName: string;
|
|
20
|
+
TagSet: any[];
|
|
21
|
+
AssistantCidrSet: any[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 子网
|
|
25
|
+
*/
|
|
26
|
+
export interface ISubnet {
|
|
27
|
+
VpcId: string;
|
|
28
|
+
SubnetId: string;
|
|
29
|
+
SubnetName: string;
|
|
30
|
+
CidrBlock: string;
|
|
31
|
+
Ipv6CidrBlock: string;
|
|
32
|
+
IsDefault: boolean;
|
|
33
|
+
IsRemoteVpcSnat: boolean;
|
|
34
|
+
EnableBroadcast: boolean;
|
|
35
|
+
Zone: string;
|
|
36
|
+
RouteTableId: string;
|
|
37
|
+
NetworkAclId: string;
|
|
38
|
+
TotalIpAddressCount: number;
|
|
39
|
+
AvailableIpAddressCount: number;
|
|
40
|
+
CreatedTime: string;
|
|
41
|
+
TagSet: any[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 函数
|
|
45
|
+
*/
|
|
46
|
+
export interface IFunctionLog {
|
|
47
|
+
FunctionName: string;
|
|
48
|
+
RetMsg: string;
|
|
49
|
+
RequestId: string;
|
|
50
|
+
StartTime?: string;
|
|
51
|
+
RetCode?: number;
|
|
52
|
+
InvokeFinished?: number;
|
|
53
|
+
Duration?: number;
|
|
54
|
+
BillDuration?: number;
|
|
55
|
+
MemUsage: number;
|
|
56
|
+
Log?: string;
|
|
57
|
+
Level?: string;
|
|
58
|
+
Source?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface ILogFilter {
|
|
61
|
+
RetCode?: 'not0' | 'is0' | 'TimeLimitExceeded' | 'ResourceLimitExceeded' | 'UserCodeException';
|
|
62
|
+
}
|
|
63
|
+
export declare type IRegion = number;
|
|
64
|
+
export interface IEnvVariable {
|
|
65
|
+
Key: string;
|
|
66
|
+
Value: string;
|
|
67
|
+
}
|
|
68
|
+
export interface ITrigger {
|
|
69
|
+
Name: string;
|
|
70
|
+
Type: string;
|
|
71
|
+
Config: string;
|
|
72
|
+
TriggerName: string;
|
|
73
|
+
TriggerDesc: string;
|
|
74
|
+
}
|
|
75
|
+
export interface IFunctionInfo {
|
|
76
|
+
FunctionName: string;
|
|
77
|
+
FunctionId: string;
|
|
78
|
+
Runtime: string;
|
|
79
|
+
Handler: string;
|
|
80
|
+
CodeSize: number;
|
|
81
|
+
Timeout: number;
|
|
82
|
+
FunctionVersion: string;
|
|
83
|
+
MemorySize: number;
|
|
84
|
+
UseGpu: 'TRUE' | 'FALSE';
|
|
85
|
+
CodeInfo: string;
|
|
86
|
+
CodeResult: string;
|
|
87
|
+
CodeError: string;
|
|
88
|
+
ErrNo: number;
|
|
89
|
+
Role: string;
|
|
90
|
+
InstallDependency: 'FALSE' | 'TRUE';
|
|
91
|
+
AddTime: string;
|
|
92
|
+
ModTime: string;
|
|
93
|
+
Namespace: string;
|
|
94
|
+
Status: string;
|
|
95
|
+
StatusDesc: string;
|
|
96
|
+
Description: string;
|
|
97
|
+
Tags: ITag[];
|
|
98
|
+
VpcConfig: {
|
|
99
|
+
VpcId?: string;
|
|
100
|
+
SubnetId?: string;
|
|
101
|
+
vpc?: string;
|
|
102
|
+
subnet?: string;
|
|
103
|
+
};
|
|
104
|
+
Environment: {
|
|
105
|
+
Variables: IEnvVariable[];
|
|
106
|
+
};
|
|
107
|
+
Type: string;
|
|
108
|
+
EipConfig: {
|
|
109
|
+
EipFixed: 'FALSE' | 'TRUE';
|
|
110
|
+
Eips: string[];
|
|
111
|
+
};
|
|
112
|
+
PublicNetConfig: {
|
|
113
|
+
PublicNetStatus: 'ENABLE' | 'DISABLE';
|
|
114
|
+
EipConfig: {
|
|
115
|
+
EipStatus: 'ENABLE' | 'DISABLE';
|
|
116
|
+
EipAddress: string[];
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
Triggers: ITrigger[];
|
|
120
|
+
}
|
|
121
|
+
export interface IFunctionCode {
|
|
122
|
+
CosBucketName?: string;
|
|
123
|
+
CosObjectName?: string;
|
|
124
|
+
ZipFile: string;
|
|
125
|
+
}
|
|
126
|
+
export interface ILayerVersionItem {
|
|
127
|
+
LayerName: string;
|
|
128
|
+
LayerVersion: number;
|
|
129
|
+
}
|
|
130
|
+
export interface IFunctionUpdateAttribute {
|
|
131
|
+
Code: IFunctionCode;
|
|
132
|
+
Description: string;
|
|
133
|
+
FunctionName: string;
|
|
134
|
+
MemorySize: number;
|
|
135
|
+
Timeout: number;
|
|
136
|
+
UseGpu: 'FALSE' | 'TRUE';
|
|
137
|
+
Namespace: string;
|
|
138
|
+
Environment: {
|
|
139
|
+
Variables: IEnvVariable[];
|
|
140
|
+
};
|
|
141
|
+
VpcConfig: {
|
|
142
|
+
VpcId: string;
|
|
143
|
+
SubnetId: string;
|
|
144
|
+
};
|
|
145
|
+
InstallDependency?: 'FALSE' | 'TRUE';
|
|
146
|
+
PublicNetConfig: {
|
|
147
|
+
PublicNetStatus: string;
|
|
148
|
+
EipConfig: {
|
|
149
|
+
EipStatus: string;
|
|
150
|
+
EipAddress: string[];
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
Layers?: ILayerVersionItem[];
|
|
154
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Environment } from '../environment';
|
|
3
|
+
import { IListFileInfo } from '../interfaces';
|
|
4
|
+
export interface IProgressData {
|
|
5
|
+
loaded: number;
|
|
6
|
+
total: number;
|
|
7
|
+
speed: number;
|
|
8
|
+
percent: number;
|
|
9
|
+
}
|
|
10
|
+
export declare type OnProgress = (progressData: IProgressData) => void;
|
|
11
|
+
export declare type OnFileFinish = (error: Error, res: any, fileData: any) => void;
|
|
12
|
+
export interface IHostingFileOptions {
|
|
13
|
+
localPath: string;
|
|
14
|
+
cloudPath?: string;
|
|
15
|
+
parallel?: number;
|
|
16
|
+
files?: {
|
|
17
|
+
localPath: string;
|
|
18
|
+
cloudPath: string;
|
|
19
|
+
}[];
|
|
20
|
+
onProgress?: OnProgress;
|
|
21
|
+
onFileFinish?: OnFileFinish;
|
|
22
|
+
ignore?: string | string[];
|
|
23
|
+
retryCount?: number;
|
|
24
|
+
retryInterval?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface IHostingFilesOptions {
|
|
27
|
+
localPath?: string;
|
|
28
|
+
cloudPath?: string;
|
|
29
|
+
parallel?: number;
|
|
30
|
+
files: {
|
|
31
|
+
localPath: string;
|
|
32
|
+
cloudPath: string;
|
|
33
|
+
}[];
|
|
34
|
+
onProgress?: OnProgress;
|
|
35
|
+
onFileFinish?: OnFileFinish;
|
|
36
|
+
ignore?: string | string[];
|
|
37
|
+
retryCount?: number;
|
|
38
|
+
retryInterval?: number;
|
|
39
|
+
}
|
|
40
|
+
export declare type IHostingOptions = IHostingFileOptions | IHostingFilesOptions;
|
|
41
|
+
export interface IHostingCloudOptions {
|
|
42
|
+
cloudPath: string;
|
|
43
|
+
isDir: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface IBindDomainOptions {
|
|
46
|
+
domain: string;
|
|
47
|
+
certId: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ICheckSourceOptions {
|
|
50
|
+
domains: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface ITcbOrigin {
|
|
53
|
+
Master: string;
|
|
54
|
+
Slave: string;
|
|
55
|
+
}
|
|
56
|
+
export interface IIpFilter {
|
|
57
|
+
Switch: string;
|
|
58
|
+
FilterType?: string;
|
|
59
|
+
Filters?: string[];
|
|
60
|
+
}
|
|
61
|
+
export interface IIpFreqLimit {
|
|
62
|
+
Switch: string;
|
|
63
|
+
Qps?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface ITcbAuthentication {
|
|
66
|
+
Switch: string;
|
|
67
|
+
SecretKey: string;
|
|
68
|
+
SignParam?: string;
|
|
69
|
+
TimeParam?: string;
|
|
70
|
+
ExpireTime?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface ITcbCache {
|
|
73
|
+
RuleType: string;
|
|
74
|
+
RuleValue: string;
|
|
75
|
+
CacheTtl: number;
|
|
76
|
+
}
|
|
77
|
+
export interface ITcbRefererRule {
|
|
78
|
+
RefererType: string;
|
|
79
|
+
Referers: string[];
|
|
80
|
+
AllowEmpty: boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface ITcbReferer {
|
|
83
|
+
Switch: string;
|
|
84
|
+
RefererRules?: ITcbRefererRule[];
|
|
85
|
+
}
|
|
86
|
+
export interface ITcbDomainConfig {
|
|
87
|
+
Cache?: ITcbCache[];
|
|
88
|
+
IpFilter?: IIpFilter;
|
|
89
|
+
IpFreqLimit?: IIpFreqLimit;
|
|
90
|
+
Refer?: ITcbReferer;
|
|
91
|
+
}
|
|
92
|
+
export interface IModifyOptions {
|
|
93
|
+
domain: string;
|
|
94
|
+
domainId: number;
|
|
95
|
+
domainConfig: ITcbDomainConfig;
|
|
96
|
+
}
|
|
97
|
+
export interface IDeleteDomainOptions {
|
|
98
|
+
domain: string;
|
|
99
|
+
}
|
|
100
|
+
export interface IDomainInfo {
|
|
101
|
+
Domain: string;
|
|
102
|
+
DomainId: number;
|
|
103
|
+
Status: 'process' | 'online' | 'offline';
|
|
104
|
+
DomainConfig: Record<string, string>;
|
|
105
|
+
CName: String;
|
|
106
|
+
}
|
|
107
|
+
export interface IHostingInfo {
|
|
108
|
+
EnvId: string;
|
|
109
|
+
CdnDomain: string;
|
|
110
|
+
Bucket: string;
|
|
111
|
+
Regoin: string;
|
|
112
|
+
Status: string;
|
|
113
|
+
MaxDomain: number;
|
|
114
|
+
Id: number;
|
|
115
|
+
PolicyId: number;
|
|
116
|
+
}
|
|
117
|
+
export interface IRoutingRules {
|
|
118
|
+
keyPrefixEquals?: string;
|
|
119
|
+
httpErrorCodeReturnedEquals?: string;
|
|
120
|
+
replaceKeyWith?: string;
|
|
121
|
+
replaceKeyPrefixWith?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface IBucketWebsiteOptiosn {
|
|
124
|
+
indexDocument: string;
|
|
125
|
+
errorDocument?: string;
|
|
126
|
+
routingRules?: Array<IRoutingRules>;
|
|
127
|
+
}
|
|
128
|
+
export interface IFindOptions {
|
|
129
|
+
prefix?: string;
|
|
130
|
+
marker?: string;
|
|
131
|
+
maxKeys?: number;
|
|
132
|
+
}
|
|
133
|
+
export declare class HostingService {
|
|
134
|
+
private environment;
|
|
135
|
+
private tcbService;
|
|
136
|
+
private cdnService;
|
|
137
|
+
constructor(environment: Environment);
|
|
138
|
+
/**
|
|
139
|
+
* 获取 hosting 信息
|
|
140
|
+
*/
|
|
141
|
+
getInfo(): Promise<IHostingInfo[]>;
|
|
142
|
+
/**
|
|
143
|
+
* 开启 hosting 服务,异步任务
|
|
144
|
+
*/
|
|
145
|
+
enableService(): Promise<{
|
|
146
|
+
code: number;
|
|
147
|
+
requestId: string;
|
|
148
|
+
}>;
|
|
149
|
+
findFiles(options: IFindOptions): Promise<any>;
|
|
150
|
+
/**
|
|
151
|
+
* 展示文件列表
|
|
152
|
+
*/
|
|
153
|
+
listFiles(): Promise<IListFileInfo[]>;
|
|
154
|
+
/**
|
|
155
|
+
* 销毁静态托管服务
|
|
156
|
+
*/
|
|
157
|
+
destroyService(): Promise<{
|
|
158
|
+
code: number;
|
|
159
|
+
requestId: string;
|
|
160
|
+
}>;
|
|
161
|
+
/**
|
|
162
|
+
* 支持上传单个文件,文件夹,或多个文件
|
|
163
|
+
* @param options
|
|
164
|
+
*/
|
|
165
|
+
uploadFiles(options: IHostingOptions): Promise<any>;
|
|
166
|
+
/**
|
|
167
|
+
* 删除文件或文件夹
|
|
168
|
+
* @param options
|
|
169
|
+
*/
|
|
170
|
+
deleteFiles(options: IHostingCloudOptions): Promise<{
|
|
171
|
+
Deleted: {
|
|
172
|
+
Key: string;
|
|
173
|
+
}[];
|
|
174
|
+
Error: Object[];
|
|
175
|
+
} | {
|
|
176
|
+
Deleted: any[];
|
|
177
|
+
Error: any[];
|
|
178
|
+
}>;
|
|
179
|
+
/**
|
|
180
|
+
* 下载文件
|
|
181
|
+
* @param {string} cloudPath 云端文件路径
|
|
182
|
+
* @param {string} localPath 文件本地存储路径,文件需指定文件名称
|
|
183
|
+
* @returns {Promise<NodeJS.ReadableStream>}
|
|
184
|
+
*/
|
|
185
|
+
downloadFile(options: {
|
|
186
|
+
cloudPath: string;
|
|
187
|
+
localPath?: string;
|
|
188
|
+
}): Promise<NodeJS.ReadableStream | string>;
|
|
189
|
+
/**
|
|
190
|
+
* 下载文件夹
|
|
191
|
+
* @param {string} cloudPath 云端文件路径
|
|
192
|
+
* @param {string} localPath 本地文件夹存储路径
|
|
193
|
+
* @returns {Promise<(NodeJS.ReadableStream | string)[]>}
|
|
194
|
+
*/
|
|
195
|
+
downloadDirectory(options: {
|
|
196
|
+
cloudPath: string;
|
|
197
|
+
localPath?: string;
|
|
198
|
+
}): Promise<void>;
|
|
199
|
+
walkLocalDir(envId: string, dir: string): Promise<string[]>;
|
|
200
|
+
/**
|
|
201
|
+
* 绑定自定义域名
|
|
202
|
+
* @param {IBindDomainOptions} options
|
|
203
|
+
* @returns
|
|
204
|
+
* @memberof HostingService
|
|
205
|
+
*/
|
|
206
|
+
CreateHostingDomain(options: IBindDomainOptions): Promise<{}>;
|
|
207
|
+
/**
|
|
208
|
+
* 删除托管域名
|
|
209
|
+
*
|
|
210
|
+
* @param {IBindDomainOptions} options
|
|
211
|
+
* @returns
|
|
212
|
+
* @memberof HostingService
|
|
213
|
+
*/
|
|
214
|
+
deleteHostingDomain(options: IDeleteDomainOptions): Promise<{
|
|
215
|
+
RequestId: string;
|
|
216
|
+
}>;
|
|
217
|
+
/**
|
|
218
|
+
* 查询域名状态信息
|
|
219
|
+
* @param options
|
|
220
|
+
*/
|
|
221
|
+
tcbCheckResource(options: ICheckSourceOptions): Promise<{
|
|
222
|
+
Domains: IDomainInfo[];
|
|
223
|
+
RecordCount: number;
|
|
224
|
+
RequestId: string;
|
|
225
|
+
}>;
|
|
226
|
+
/**
|
|
227
|
+
* 域名配置变更
|
|
228
|
+
* @param options
|
|
229
|
+
*/
|
|
230
|
+
tcbModifyAttribute(options: IModifyOptions): Promise<{}>;
|
|
231
|
+
/**
|
|
232
|
+
* 查询静态网站配置
|
|
233
|
+
* @memberof HostingService
|
|
234
|
+
*/
|
|
235
|
+
getWebsiteConfig(): Promise<any>;
|
|
236
|
+
/**
|
|
237
|
+
* 配置静态网站文档
|
|
238
|
+
* @param options
|
|
239
|
+
*/
|
|
240
|
+
setWebsiteDocument(options: IBucketWebsiteOptiosn): Promise<any>;
|
|
241
|
+
/**
|
|
242
|
+
* 检查 hosting 服务状态
|
|
243
|
+
*/
|
|
244
|
+
private checkStatus;
|
|
245
|
+
/**
|
|
246
|
+
* 获取配置
|
|
247
|
+
*/
|
|
248
|
+
private getHostingConfig;
|
|
249
|
+
/**
|
|
250
|
+
* 将 cloudPath 转换成 cloudPath/ 形式
|
|
251
|
+
*/
|
|
252
|
+
private getCloudKey;
|
|
253
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { EnvService } from './env';
|
|
2
|
+
import { FunctionService } from './function';
|
|
3
|
+
import { StorageService } from './storage';
|
|
4
|
+
import { DatabaseService } from './database';
|
|
5
|
+
import { CommonService } from './common';
|
|
6
|
+
import { HostingService } from './hosting';
|
|
7
|
+
import { Environment } from './environment';
|
|
8
|
+
import { EnvironmentManager } from './environmentManager';
|
|
9
|
+
import { ThirdService } from './third';
|
|
10
|
+
import { AccessService } from './access';
|
|
11
|
+
import { UserService } from './user';
|
|
12
|
+
import { CloudBaseRunService } from './cloudBaseRun';
|
|
13
|
+
interface CloudBaseConfig {
|
|
14
|
+
secretId?: string;
|
|
15
|
+
secretKey?: string;
|
|
16
|
+
token?: string;
|
|
17
|
+
envId?: string;
|
|
18
|
+
proxy?: string;
|
|
19
|
+
region?: string;
|
|
20
|
+
envType?: string;
|
|
21
|
+
}
|
|
22
|
+
declare class CloudBase {
|
|
23
|
+
private static cloudBase;
|
|
24
|
+
/**
|
|
25
|
+
* init 初始化 为单例
|
|
26
|
+
*
|
|
27
|
+
* @static
|
|
28
|
+
* @param {ManagerConfig} config
|
|
29
|
+
* @returns {CloudBase}
|
|
30
|
+
* @memberof CloudBase
|
|
31
|
+
*/
|
|
32
|
+
static init(config: CloudBaseConfig): CloudBase;
|
|
33
|
+
private context;
|
|
34
|
+
private cloudBaseConfig;
|
|
35
|
+
private environmentManager;
|
|
36
|
+
constructor(config?: CloudBaseConfig);
|
|
37
|
+
addEnvironment(envId: string): void;
|
|
38
|
+
currentEnvironment(): Environment;
|
|
39
|
+
get functions(): FunctionService;
|
|
40
|
+
get storage(): StorageService;
|
|
41
|
+
get database(): DatabaseService;
|
|
42
|
+
get hosting(): HostingService;
|
|
43
|
+
get access(): AccessService;
|
|
44
|
+
get cloudApp(): CloudBaseRunService;
|
|
45
|
+
commonService(service?: string, version?: string): CommonService;
|
|
46
|
+
get env(): EnvService;
|
|
47
|
+
get third(): ThirdService;
|
|
48
|
+
get user(): UserService;
|
|
49
|
+
getEnvironmentManager(): EnvironmentManager;
|
|
50
|
+
getManagerConfig(): CloudBaseConfig;
|
|
51
|
+
}
|
|
52
|
+
export = CloudBase;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IResponseInfo } from './base.interface';
|
|
2
|
+
export interface IGoodItem {
|
|
3
|
+
GoodsCategoryId: number;
|
|
4
|
+
RegionId: number;
|
|
5
|
+
ZoneId: number;
|
|
6
|
+
GoodsNum: number;
|
|
7
|
+
ProjectId: number;
|
|
8
|
+
PayMode: number;
|
|
9
|
+
Platform: number;
|
|
10
|
+
GoodsDetail: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IGenerateDealsRes extends IResponseInfo {
|
|
13
|
+
OrderIds: Array<string>;
|
|
14
|
+
}
|
|
15
|
+
export interface IPayDealsRes extends IResponseInfo {
|
|
16
|
+
OrderIds: Array<string>;
|
|
17
|
+
ResourceIds: Array<string>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IResponseInfo } from './base.interface';
|
|
2
|
+
interface IRoleInfo {
|
|
3
|
+
RoleId: string;
|
|
4
|
+
RoleName: string;
|
|
5
|
+
PolicyDocument: string;
|
|
6
|
+
Description: string;
|
|
7
|
+
AddTime: string;
|
|
8
|
+
UpdateTime: string;
|
|
9
|
+
ConsoleLogin: number;
|
|
10
|
+
}
|
|
11
|
+
export interface IRoleListRes extends IResponseInfo {
|
|
12
|
+
List: Array<IRoleInfo>;
|
|
13
|
+
TotalNum: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ICreateRoleRes extends IResponseInfo {
|
|
16
|
+
RoleId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ICheckTcbServiceRes extends IResponseInfo {
|
|
19
|
+
Initialized: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface IGetRoleRes extends IResponseInfo {
|
|
22
|
+
RoleInfo: IRoleInfo;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface IExistsRes {
|
|
2
|
+
RequestId: string;
|
|
3
|
+
Msg?: string;
|
|
4
|
+
Exists: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface IDatabaseTableReq {
|
|
7
|
+
Tag: string;
|
|
8
|
+
TableName: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IndexInfo {
|
|
11
|
+
Name: string;
|
|
12
|
+
Size: number;
|
|
13
|
+
Keys: Indexkey[];
|
|
14
|
+
Accesses: IndexAccesses;
|
|
15
|
+
Unique: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface IndexAccesses {
|
|
18
|
+
Ops: number;
|
|
19
|
+
Since: string;
|
|
20
|
+
}
|
|
21
|
+
export interface Indexkey {
|
|
22
|
+
Name?: string;
|
|
23
|
+
Direction?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface DropIndex {
|
|
26
|
+
IndexName: string;
|
|
27
|
+
}
|
|
28
|
+
export interface CreateIndex {
|
|
29
|
+
IndexName: string;
|
|
30
|
+
MgoKeySchema: MgoKeySchema;
|
|
31
|
+
}
|
|
32
|
+
export interface MgoKeySchema {
|
|
33
|
+
MgoIndexKeys: MgoIndexKeys[];
|
|
34
|
+
MgoIsUnique: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface Pager {
|
|
37
|
+
Offset: number;
|
|
38
|
+
Limit: number;
|
|
39
|
+
Total: number;
|
|
40
|
+
}
|
|
41
|
+
export interface MgoIndexKeys {
|
|
42
|
+
Name: string;
|
|
43
|
+
Direction: string;
|
|
44
|
+
}
|
|
45
|
+
export interface TableInfo {
|
|
46
|
+
TableName: string;
|
|
47
|
+
CollectionName: string;
|
|
48
|
+
Count: number;
|
|
49
|
+
Size: number;
|
|
50
|
+
IndexCount: number;
|
|
51
|
+
IndexSize: number;
|
|
52
|
+
}
|
|
53
|
+
export interface GoodsDetail {
|
|
54
|
+
QuataId: string;
|
|
55
|
+
DiskSize?: number;
|
|
56
|
+
ConnNum?: number;
|
|
57
|
+
ReadOperands?: number;
|
|
58
|
+
WriteOperands?: number;
|
|
59
|
+
CollectionLimits?: number;
|
|
60
|
+
SingleCollectionIndexLimits?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface ResourceAmount {
|
|
63
|
+
UsedDiskSize?: number;
|
|
64
|
+
ReadOperands?: number;
|
|
65
|
+
WriteOperands?: number;
|
|
66
|
+
TableNum?: number;
|
|
67
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface IFunctionVPC {
|
|
2
|
+
subnetId: string;
|
|
3
|
+
vpcId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ICloudFunctionTrigger {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
config: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ICloudFunctionConfig {
|
|
11
|
+
timeout?: number;
|
|
12
|
+
envVariables?: Record<string, string | number | boolean>;
|
|
13
|
+
runtime?: string;
|
|
14
|
+
vpc?: IFunctionVPC;
|
|
15
|
+
installDependency?: boolean;
|
|
16
|
+
l5?: boolean;
|
|
17
|
+
memorySize?: number;
|
|
18
|
+
role?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface LayerVersionSimple {
|
|
21
|
+
LayerName: string;
|
|
22
|
+
LayerVersion: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ICloudFunction extends ICloudFunctionConfig {
|
|
25
|
+
name: string;
|
|
26
|
+
handler?: string;
|
|
27
|
+
codeSecret?: string;
|
|
28
|
+
isWaitInstall?: boolean;
|
|
29
|
+
ignore?: string | string[];
|
|
30
|
+
layers?: {
|
|
31
|
+
name: string;
|
|
32
|
+
version: number;
|
|
33
|
+
}[];
|
|
34
|
+
triggers?: ICloudFunctionTrigger[];
|
|
35
|
+
}
|
|
36
|
+
export interface IFunctionLogOptions {
|
|
37
|
+
name: string;
|
|
38
|
+
offset?: number;
|
|
39
|
+
limit?: number;
|
|
40
|
+
order?: string;
|
|
41
|
+
orderBy?: string;
|
|
42
|
+
startTime?: string;
|
|
43
|
+
endTime?: string;
|
|
44
|
+
requestId?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface IFunctionInvokeRes {
|
|
47
|
+
RequestId: string;
|
|
48
|
+
Log: string;
|
|
49
|
+
RetMsg: string;
|
|
50
|
+
ErrMsg: string;
|
|
51
|
+
MemUsage: number;
|
|
52
|
+
Duration: number;
|
|
53
|
+
BillDuration: number;
|
|
54
|
+
FunctionRequestId: string;
|
|
55
|
+
}
|
|
56
|
+
export interface IFunctionLogRes {
|
|
57
|
+
RequestId: string;
|
|
58
|
+
Data: [];
|
|
59
|
+
TotalCount: number;
|
|
60
|
+
}
|
|
61
|
+
export interface IFunctionDownloadUrlRes {
|
|
62
|
+
Url: string;
|
|
63
|
+
RequestId: string;
|
|
64
|
+
CodeSha256: string;
|
|
65
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface IUploadMetadata {
|
|
2
|
+
token: string;
|
|
3
|
+
url: string;
|
|
4
|
+
authorization: string;
|
|
5
|
+
fileId: string;
|
|
6
|
+
cosFileId: string;
|
|
7
|
+
download_url: string;
|
|
8
|
+
}
|
|
9
|
+
export interface IListFileInfo {
|
|
10
|
+
Key: string;
|
|
11
|
+
LastModified: string;
|
|
12
|
+
ETag: string;
|
|
13
|
+
Size: string;
|
|
14
|
+
Owner: string;
|
|
15
|
+
StorageClass: string;
|
|
16
|
+
}
|
|
17
|
+
export interface IFileInfo {
|
|
18
|
+
Size: string;
|
|
19
|
+
Type: string;
|
|
20
|
+
Date: string;
|
|
21
|
+
ETag: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ITempUrlInfo {
|
|
24
|
+
cloudPath: string;
|
|
25
|
+
maxAge?: number;
|
|
26
|
+
}
|