@cloudbase/manager-node 4.2.3 → 4.2.4
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/CHANGELOG.md +4 -0
- package/package.json +4 -3
- package/lib/access/index.js +0 -141
- package/lib/access/types.js +0 -2
- package/lib/billing/index.js +0 -36
- package/lib/cam/index.js +0 -77
- package/lib/cloudBaseRun/index.js +0 -36
- package/lib/cloudBaseRun/types.js +0 -2
- package/lib/common/index.js +0 -39
- package/lib/constant.js +0 -51
- package/lib/context.js +0 -14
- package/lib/database/index.js +0 -244
- package/lib/debug.js +0 -34
- package/lib/env/index.js +0 -488
- package/lib/environment.js +0 -124
- package/lib/environmentManager.js +0 -44
- package/lib/error.js +0 -16
- package/lib/function/index.js +0 -1022
- package/lib/function/packer.js +0 -129
- package/lib/function/types.js +0 -2
- package/lib/hosting/index.js +0 -461
- package/lib/index.js +0 -83
- package/lib/interfaces/base.interface.js +0 -2
- package/lib/interfaces/billing.interface.js +0 -2
- package/lib/interfaces/cam.interface.js +0 -2
- package/lib/interfaces/flexdb.interface.js +0 -2
- package/lib/interfaces/function.interface.js +0 -2
- package/lib/interfaces/index.js +0 -19
- package/lib/interfaces/storage.interface.js +0 -2
- package/lib/interfaces/tcb.interface.js +0 -2
- package/lib/storage/index.js +0 -1037
- package/lib/third/index.js +0 -18
- package/lib/user/index.js +0 -136
- package/lib/user/types.js +0 -2
- package/lib/utils/auth.js +0 -97
- package/lib/utils/cloud-api-request.js +0 -205
- package/lib/utils/cloudbase-request.js +0 -69
- package/lib/utils/envLazy.js +0 -18
- package/lib/utils/fs.js +0 -64
- package/lib/utils/http-request.js +0 -44
- package/lib/utils/index.js +0 -103
- package/lib/utils/parallel.js +0 -69
- package/lib/utils/uuid.js +0 -18
- package/src/access/index.ts +0 -168
- package/src/access/types.ts +0 -55
- package/src/billing/index.ts +0 -43
- package/src/cam/index.ts +0 -106
- package/src/cloudBaseRun/index.ts +0 -40
- package/src/cloudBaseRun/types.ts +0 -24
- package/src/common/index.ts +0 -54
- package/src/constant.ts +0 -56
- package/src/context.ts +0 -18
- package/src/database/index.ts +0 -369
- package/src/debug.ts +0 -34
- package/src/env/index.ts +0 -614
- package/src/environment.ts +0 -156
- package/src/environmentManager.ts +0 -50
- package/src/error.ts +0 -27
- package/src/function/index.ts +0 -1378
- package/src/function/packer.ts +0 -164
- package/src/function/types.ts +0 -165
- package/src/hosting/index.ts +0 -698
- package/src/index.ts +0 -127
- package/src/interfaces/base.interface.ts +0 -8
- package/src/interfaces/billing.interface.ts +0 -21
- package/src/interfaces/cam.interface.ts +0 -28
- package/src/interfaces/flexdb.interface.ts +0 -104
- package/src/interfaces/function.interface.ts +0 -75
- package/src/interfaces/index.ts +0 -7
- package/src/interfaces/storage.interface.ts +0 -29
- package/src/interfaces/tcb.interface.ts +0 -642
- package/src/storage/index.ts +0 -1290
- package/src/third/index.ts +0 -24
- package/src/user/index.ts +0 -174
- package/src/user/types.ts +0 -21
- package/src/utils/auth.ts +0 -112
- package/src/utils/cloud-api-request.ts +0 -252
- package/src/utils/cloudbase-request.ts +0 -109
- package/src/utils/envLazy.ts +0 -15
- package/src/utils/fs.ts +0 -57
- package/src/utils/http-request.ts +0 -37
- package/src/utils/index.ts +0 -103
- package/src/utils/parallel.ts +0 -82
- package/src/utils/uuid.ts +0 -14
- package/types/access/index.d.ts +0 -38
- package/types/access/types.d.ts +0 -42
- package/types/billing/index.d.ts +0 -21
- package/types/cam/index.d.ts +0 -63
- package/types/cloudBaseRun/index.d.ts +0 -12
- package/types/cloudBaseRun/types.d.ts +0 -21
- package/types/common/index.d.ts +0 -18
- package/types/constant.d.ts +0 -37
- package/types/context.d.ts +0 -17
- package/types/database/index.d.ts +0 -66
- package/types/debug.d.ts +0 -1
- package/types/env/index.d.ts +0 -144
- package/types/environment.d.ts +0 -51
- package/types/environmentManager.d.ts +0 -13
- package/types/error.d.ts +0 -18
- package/types/function/index.d.ts +0 -379
- package/types/function/packer.d.ts +0 -37
- package/types/function/types.d.ts +0 -156
- package/types/hosting/index.d.ts +0 -253
- package/types/index.d.ts +0 -52
- package/types/interfaces/base.interface.d.ts +0 -7
- package/types/interfaces/billing.interface.d.ts +0 -18
- package/types/interfaces/cam.interface.d.ts +0 -24
- package/types/interfaces/flexdb.interface.d.ts +0 -67
- package/types/interfaces/function.interface.d.ts +0 -65
- package/types/interfaces/index.d.ts +0 -7
- package/types/interfaces/storage.interface.d.ts +0 -26
- package/types/interfaces/tcb.interface.d.ts +0 -305
- package/types/storage/index.d.ts +0 -324
- package/types/third/index.d.ts +0 -11
- package/types/user/index.d.ts +0 -52
- package/types/user/types.d.ts +0 -20
- package/types/utils/auth.d.ts +0 -8
- package/types/utils/cloud-api-request.d.ts +0 -21
- package/types/utils/cloudbase-request.d.ts +0 -14
- package/types/utils/envLazy.d.ts +0 -1
- package/types/utils/fs.d.ts +0 -7
- package/types/utils/http-request.d.ts +0 -2
- package/types/utils/index.d.ts +0 -20
- package/types/utils/parallel.d.ts +0 -17
- package/types/utils/uuid.d.ts +0 -2
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import { IResponseInfo } from './base.interface';
|
|
2
|
-
export interface EndUserInfo {
|
|
3
|
-
UUId?: string;
|
|
4
|
-
WXOpenId?: string;
|
|
5
|
-
QQOpenId?: string;
|
|
6
|
-
Phone?: string;
|
|
7
|
-
Email?: string;
|
|
8
|
-
NickName?: string;
|
|
9
|
-
Gender?: string;
|
|
10
|
-
AvatarUrl?: string;
|
|
11
|
-
UpdateTime?: string;
|
|
12
|
-
CreateTime?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface AuthDomain {
|
|
15
|
-
Id?: string;
|
|
16
|
-
Domain?: string;
|
|
17
|
-
Type?: string;
|
|
18
|
-
Status?: string;
|
|
19
|
-
CreateTime?: string;
|
|
20
|
-
UpdateTime?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface LoginConfigItem {
|
|
23
|
-
Platform?: string;
|
|
24
|
-
PlatformId?: string;
|
|
25
|
-
CreateTime?: string;
|
|
26
|
-
UpdateTime?: string;
|
|
27
|
-
Status?: string;
|
|
28
|
-
Id?: string;
|
|
29
|
-
}
|
|
30
|
-
export interface FunctionLimit {
|
|
31
|
-
NumberLimit?: number;
|
|
32
|
-
CallLimit?: LimitInfo;
|
|
33
|
-
ResourceUsageLimit?: LimitInfo;
|
|
34
|
-
ConcurrentLimit?: number;
|
|
35
|
-
OutboundTrafficLimit?: LimitInfo;
|
|
36
|
-
}
|
|
37
|
-
export interface StorageLimit {
|
|
38
|
-
CapacityLimit?: number;
|
|
39
|
-
DownloadLimit?: LimitInfo;
|
|
40
|
-
UploadLimit?: LimitInfo;
|
|
41
|
-
CdnOriginFlowLimit?: LimitInfo;
|
|
42
|
-
CdnFlowLimit?: LimitInfo;
|
|
43
|
-
UploadLimitMonthly?: LimitInfo;
|
|
44
|
-
DownloadLimitMonthly?: LimitInfo;
|
|
45
|
-
}
|
|
46
|
-
export interface DatabaseLimit {
|
|
47
|
-
CapacityLimit?: number;
|
|
48
|
-
ConnectionLimit?: number;
|
|
49
|
-
CollectionLimit?: number;
|
|
50
|
-
IndexLimit?: number;
|
|
51
|
-
ReadLimit?: LimitInfo;
|
|
52
|
-
WriteLimit?: LimitInfo;
|
|
53
|
-
QPSLimit?: number;
|
|
54
|
-
}
|
|
55
|
-
export interface LimitInfo {
|
|
56
|
-
MaxSize?: number;
|
|
57
|
-
TimeUnit?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface UserInfo {
|
|
60
|
-
OpenId?: string;
|
|
61
|
-
GrantUserInfo?: boolean;
|
|
62
|
-
NickName?: string;
|
|
63
|
-
Country?: string;
|
|
64
|
-
Province?: string;
|
|
65
|
-
City?: string;
|
|
66
|
-
Gender?: number;
|
|
67
|
-
Language?: string;
|
|
68
|
-
AvatarUrl?: string;
|
|
69
|
-
CreateTime?: string;
|
|
70
|
-
UpdateTime?: string;
|
|
71
|
-
}
|
|
72
|
-
export interface ResourcesInfo {
|
|
73
|
-
ResourceType?: string;
|
|
74
|
-
ResourceName: string;
|
|
75
|
-
Status: number;
|
|
76
|
-
MaxSize: number;
|
|
77
|
-
CurSize: number;
|
|
78
|
-
Unit: string;
|
|
79
|
-
}
|
|
80
|
-
export interface InvoicePostInfo {
|
|
81
|
-
PostId: string;
|
|
82
|
-
Contact?: string;
|
|
83
|
-
Province?: string;
|
|
84
|
-
City?: string;
|
|
85
|
-
Address?: string;
|
|
86
|
-
PostalCode?: string;
|
|
87
|
-
Cellphone?: string;
|
|
88
|
-
}
|
|
89
|
-
export interface RecoverResult {
|
|
90
|
-
Result?: string;
|
|
91
|
-
ErrorMessage: string;
|
|
92
|
-
RecoverJobId: string;
|
|
93
|
-
}
|
|
94
|
-
export interface RecoverJobStatus {
|
|
95
|
-
JobId?: string;
|
|
96
|
-
Status?: string;
|
|
97
|
-
ErrorMessage: string;
|
|
98
|
-
}
|
|
99
|
-
export interface StorageException {
|
|
100
|
-
Bucket?: string;
|
|
101
|
-
COSStatus?: string;
|
|
102
|
-
COSRecoverJobId: string;
|
|
103
|
-
}
|
|
104
|
-
export interface LogServiceException {
|
|
105
|
-
LogsetName?: string;
|
|
106
|
-
Status?: string;
|
|
107
|
-
FunctionUpdateJobId: string;
|
|
108
|
-
}
|
|
109
|
-
export interface EnvInfo {
|
|
110
|
-
EnvId?: string;
|
|
111
|
-
Source?: string;
|
|
112
|
-
Alias?: string;
|
|
113
|
-
CreateTime?: string;
|
|
114
|
-
UpdateTime?: string;
|
|
115
|
-
Status?: string;
|
|
116
|
-
Databases?: DatabasesInfo[];
|
|
117
|
-
Storages?: StorageInfo[];
|
|
118
|
-
Functions?: FunctionInfo[];
|
|
119
|
-
PackageId: string;
|
|
120
|
-
PackageName: string;
|
|
121
|
-
LogServices: LogServiceInfo[];
|
|
122
|
-
CustomLogServices: {
|
|
123
|
-
CreateTime: string;
|
|
124
|
-
ClsLogsetId: string;
|
|
125
|
-
ClsTopicId: string;
|
|
126
|
-
ClsRegion: string;
|
|
127
|
-
}[];
|
|
128
|
-
}
|
|
129
|
-
export interface FunctionInfo {
|
|
130
|
-
Namespace?: string;
|
|
131
|
-
Region?: string;
|
|
132
|
-
}
|
|
133
|
-
export interface DatabasesInfo {
|
|
134
|
-
InstanceId?: string;
|
|
135
|
-
Status?: string;
|
|
136
|
-
Region?: string;
|
|
137
|
-
}
|
|
138
|
-
export interface StorageInfo {
|
|
139
|
-
Region?: string;
|
|
140
|
-
Bucket?: string;
|
|
141
|
-
CdnDomain?: string;
|
|
142
|
-
AppId?: string;
|
|
143
|
-
}
|
|
144
|
-
export interface LogServiceInfo {
|
|
145
|
-
LogsetName?: string;
|
|
146
|
-
LogsetId?: string;
|
|
147
|
-
TopicName?: string;
|
|
148
|
-
TopicId?: string;
|
|
149
|
-
Region?: string;
|
|
150
|
-
}
|
|
151
|
-
export interface VoucherUseHistory {
|
|
152
|
-
VoucherId?: string;
|
|
153
|
-
UsedAmount?: number;
|
|
154
|
-
UsedTime?: string;
|
|
155
|
-
PayInfo?: string;
|
|
156
|
-
SeqId?: string;
|
|
157
|
-
}
|
|
158
|
-
export interface Volucher {
|
|
159
|
-
VoucherId?: string;
|
|
160
|
-
OwnerUin?: string;
|
|
161
|
-
Amount?: number;
|
|
162
|
-
LeftAmount?: number;
|
|
163
|
-
UseDeadLine?: string;
|
|
164
|
-
Status: number;
|
|
165
|
-
BaseAmount?: number;
|
|
166
|
-
}
|
|
167
|
-
export interface PackageInfo {
|
|
168
|
-
PackageId?: string;
|
|
169
|
-
Name?: string;
|
|
170
|
-
Desc?: string;
|
|
171
|
-
Detail?: string;
|
|
172
|
-
}
|
|
173
|
-
export interface EnvBillingInfoItem {
|
|
174
|
-
EnvId?: string;
|
|
175
|
-
PackageId?: string;
|
|
176
|
-
IsAutoRenew?: boolean;
|
|
177
|
-
Status?: string;
|
|
178
|
-
PayMode?: string;
|
|
179
|
-
IsolatedTime?: string;
|
|
180
|
-
ExpireTime?: string;
|
|
181
|
-
CreateTime?: string;
|
|
182
|
-
UpdateTime?: string;
|
|
183
|
-
IsAlwaysFree?: boolean;
|
|
184
|
-
}
|
|
185
|
-
export interface InvoiceVATGeneral {
|
|
186
|
-
TaxPayerType?: string;
|
|
187
|
-
TaxPayerNumber?: string;
|
|
188
|
-
BankDeposit?: string;
|
|
189
|
-
BankAccount?: string;
|
|
190
|
-
RegisterAddress?: string;
|
|
191
|
-
RegisterPhone?: string;
|
|
192
|
-
}
|
|
193
|
-
export interface InvoiceVATSpecial {
|
|
194
|
-
TaxPayerNumber?: string;
|
|
195
|
-
BankDeposit?: string;
|
|
196
|
-
BankAccount?: string;
|
|
197
|
-
RegisterAddress?: string;
|
|
198
|
-
RegisterPhone?: string;
|
|
199
|
-
}
|
|
200
|
-
export interface InvoiceBasicInfo {
|
|
201
|
-
InvoiceId?: string;
|
|
202
|
-
UserType?: string;
|
|
203
|
-
Amount?: number;
|
|
204
|
-
Status?: string;
|
|
205
|
-
InvoiceTime?: string;
|
|
206
|
-
}
|
|
207
|
-
export interface QuotaOverlimit {
|
|
208
|
-
ResourceName?: string;
|
|
209
|
-
QuotaName?: string;
|
|
210
|
-
QuotaChName?: string;
|
|
211
|
-
QuotaUsaged?: number;
|
|
212
|
-
Unit?: string;
|
|
213
|
-
Comments: string;
|
|
214
|
-
}
|
|
215
|
-
export interface InvoiceAmountOverlimit {
|
|
216
|
-
IsAmountOverlimit?: boolean;
|
|
217
|
-
RefundAmount?: number;
|
|
218
|
-
InvoiceAmount?: number;
|
|
219
|
-
}
|
|
220
|
-
export interface DealInfo {
|
|
221
|
-
TranId?: string;
|
|
222
|
-
DealOwner?: string;
|
|
223
|
-
CreateTime?: string;
|
|
224
|
-
PackageId?: string;
|
|
225
|
-
DealStatus?: number;
|
|
226
|
-
DealCost?: number;
|
|
227
|
-
EnvId?: string;
|
|
228
|
-
PayTime?: string;
|
|
229
|
-
TimeSpan?: number;
|
|
230
|
-
Price?: number;
|
|
231
|
-
PayMode?: number;
|
|
232
|
-
ProductName?: string;
|
|
233
|
-
TimeUnit?: string;
|
|
234
|
-
RefundAmount?: number;
|
|
235
|
-
DealStatusDes: string;
|
|
236
|
-
VoucherDecline: number;
|
|
237
|
-
HasReturnPayCode: boolean;
|
|
238
|
-
}
|
|
239
|
-
export interface MonitorResource {
|
|
240
|
-
Name?: string;
|
|
241
|
-
Index?: string[];
|
|
242
|
-
Period?: number[];
|
|
243
|
-
EnIndex?: string[];
|
|
244
|
-
EnName?: string;
|
|
245
|
-
IndexUnit?: string[];
|
|
246
|
-
Convergence?: number[];
|
|
247
|
-
ConvergenceName?: string[];
|
|
248
|
-
}
|
|
249
|
-
export interface CollectionDispension {
|
|
250
|
-
CollectionName?: string;
|
|
251
|
-
DocCount?: number;
|
|
252
|
-
}
|
|
253
|
-
export interface MonitorPolicyInfo {
|
|
254
|
-
Name?: string;
|
|
255
|
-
PolicyId: number;
|
|
256
|
-
Note?: string;
|
|
257
|
-
Convergence?: number;
|
|
258
|
-
ResType: string;
|
|
259
|
-
ResName: string;
|
|
260
|
-
Objects: string[];
|
|
261
|
-
}
|
|
262
|
-
export interface FileDownloadRespInfo {
|
|
263
|
-
FileId?: string;
|
|
264
|
-
DownloadUrl?: string;
|
|
265
|
-
Code?: string;
|
|
266
|
-
}
|
|
267
|
-
export interface FileDownloadReqInfo {
|
|
268
|
-
FileId?: string;
|
|
269
|
-
TTL: number;
|
|
270
|
-
}
|
|
271
|
-
export interface FileDeleteInfo {
|
|
272
|
-
FileId?: string;
|
|
273
|
-
Code?: string;
|
|
274
|
-
}
|
|
275
|
-
export interface CommParam {
|
|
276
|
-
OpenId: string;
|
|
277
|
-
EnvName?: string;
|
|
278
|
-
Module?: string;
|
|
279
|
-
}
|
|
280
|
-
export interface CloudBaseGWAPI {
|
|
281
|
-
ServiceId: string;
|
|
282
|
-
APIId: string;
|
|
283
|
-
Path: string;
|
|
284
|
-
Type: number;
|
|
285
|
-
Name: string;
|
|
286
|
-
CreateTime: number;
|
|
287
|
-
}
|
|
288
|
-
export interface CloudBaseGWService {
|
|
289
|
-
ServiceId: string;
|
|
290
|
-
Domain: string;
|
|
291
|
-
OpenTime: number;
|
|
292
|
-
}
|
|
293
|
-
export interface ICreatePostpayRes extends IResponseInfo {
|
|
294
|
-
TranId: string;
|
|
295
|
-
}
|
|
296
|
-
export interface ICreateFunctionHttpServiceRes extends IResponseInfo {
|
|
297
|
-
APIId: string;
|
|
298
|
-
Endpoint: string;
|
|
299
|
-
}
|
|
300
|
-
export interface IGWOrDomainNumRes extends IResponseInfo {
|
|
301
|
-
Count: number;
|
|
302
|
-
}
|
|
303
|
-
export interface IHttpServiceDomainRes extends IResponseInfo {
|
|
304
|
-
ServiceSet: Array<CloudBaseGWService>;
|
|
305
|
-
}
|
package/types/storage/index.d.ts
DELETED
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Environment } from '../environment';
|
|
3
|
-
import { IUploadMetadata, IListFileInfo, IFileInfo, ITempUrlInfo, IResponseInfo } from '../interfaces';
|
|
4
|
-
export interface IProgressData {
|
|
5
|
-
loaded: number;
|
|
6
|
-
total: number;
|
|
7
|
-
speed: number;
|
|
8
|
-
percent: number;
|
|
9
|
-
}
|
|
10
|
-
export interface IOptions {
|
|
11
|
-
onProgress?: OnProgress;
|
|
12
|
-
onFileFinish?: OnFileFinish;
|
|
13
|
-
ignore?: string | string[];
|
|
14
|
-
fileId?: boolean;
|
|
15
|
-
parallel?: number;
|
|
16
|
-
}
|
|
17
|
-
export interface IFileOptions extends IOptions {
|
|
18
|
-
localPath: string;
|
|
19
|
-
cloudPath?: string;
|
|
20
|
-
parallel?: number;
|
|
21
|
-
retryCount?: number;
|
|
22
|
-
retryInterval?: number;
|
|
23
|
-
}
|
|
24
|
-
export interface IFilesOptions extends IOptions {
|
|
25
|
-
ignore?: string | string[];
|
|
26
|
-
files: {
|
|
27
|
-
localPath: string;
|
|
28
|
-
cloudPath?: string;
|
|
29
|
-
}[];
|
|
30
|
-
retryCount?: number;
|
|
31
|
-
retryInterval?: number;
|
|
32
|
-
}
|
|
33
|
-
export interface ICustomOptions {
|
|
34
|
-
bucket: string;
|
|
35
|
-
region: string;
|
|
36
|
-
}
|
|
37
|
-
export interface IWalkCloudDirOptions {
|
|
38
|
-
prefix: string;
|
|
39
|
-
bucket: string;
|
|
40
|
-
region: string;
|
|
41
|
-
marker?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface IRoutingRules {
|
|
44
|
-
keyPrefixEquals?: string;
|
|
45
|
-
httpErrorCodeReturnedEquals?: string;
|
|
46
|
-
replaceKeyWith?: string;
|
|
47
|
-
replaceKeyPrefixWith?: string;
|
|
48
|
-
}
|
|
49
|
-
export interface IBucketWebsiteOptions {
|
|
50
|
-
indexDocument: string;
|
|
51
|
-
errorDocument?: string;
|
|
52
|
-
routingRules?: Array<IRoutingRules>;
|
|
53
|
-
region: string;
|
|
54
|
-
bucket: string;
|
|
55
|
-
}
|
|
56
|
-
export interface IGetBucketOpions {
|
|
57
|
-
bucket?: string;
|
|
58
|
-
region?: string;
|
|
59
|
-
prefix?: string;
|
|
60
|
-
marker?: string;
|
|
61
|
-
maxKeys?: number;
|
|
62
|
-
}
|
|
63
|
-
export declare type AclType = 'READONLY' | 'PRIVATE' | 'ADMINWRITE' | 'ADMINONLY';
|
|
64
|
-
declare type OnProgress = (progressData: IProgressData) => void;
|
|
65
|
-
declare type OnFileFinish = (error: Error, res: any, fileData: any) => void;
|
|
66
|
-
export declare class StorageService {
|
|
67
|
-
private environment;
|
|
68
|
-
private tcbService;
|
|
69
|
-
constructor(environment: Environment);
|
|
70
|
-
/**
|
|
71
|
-
* 上传文件
|
|
72
|
-
* localPath 为文件夹时,会尝试在文件夹中寻找 cloudPath 中的文件名
|
|
73
|
-
* @param {string} localPath 本地文件的绝对路径
|
|
74
|
-
* @param {string} cloudPath 云端文件路径,如 img/test.png
|
|
75
|
-
* @returns {Promise<any>}
|
|
76
|
-
*/
|
|
77
|
-
uploadFile(options: IFileOptions): Promise<any>;
|
|
78
|
-
/**
|
|
79
|
-
* 批量上传文件,默认并发 5
|
|
80
|
-
* @param options
|
|
81
|
-
*/
|
|
82
|
-
uploadFiles(options: IFilesOptions): Promise<void>;
|
|
83
|
-
/**
|
|
84
|
-
* 上传文件,支持自定义 Bucket 和 Region
|
|
85
|
-
* @param {string} localPath
|
|
86
|
-
* @param {string} cloudPath
|
|
87
|
-
* @param {string} bucket
|
|
88
|
-
* @param {string} region
|
|
89
|
-
*/
|
|
90
|
-
uploadFileCustom(options: IFileOptions & ICustomOptions): Promise<any>;
|
|
91
|
-
/**
|
|
92
|
-
* 上传文件夹
|
|
93
|
-
* @param {string} localPath 本地文件夹路径
|
|
94
|
-
* @param {string} cloudPath 云端文件夹
|
|
95
|
-
* @param {number} parallel 并发量
|
|
96
|
-
* @param {number} retryCount 重试次数
|
|
97
|
-
* @param {number} retryInterval 重试时间间隔(毫秒)
|
|
98
|
-
* @param {(string | string[])} ignore
|
|
99
|
-
* @param {(string | string[])} ignore
|
|
100
|
-
* @returns {Promise<void>}
|
|
101
|
-
*/
|
|
102
|
-
uploadDirectory(options: IFileOptions): Promise<void>;
|
|
103
|
-
/**
|
|
104
|
-
* 上传文件夹,支持自定义 Region 和 Bucket
|
|
105
|
-
* @param {string} localPath
|
|
106
|
-
* @param {string} cloudPath
|
|
107
|
-
* @param {number} parallel
|
|
108
|
-
* @param {number} retryCount
|
|
109
|
-
* @param {number} retryInterval
|
|
110
|
-
* @param {string} bucket
|
|
111
|
-
* @param {string} region
|
|
112
|
-
* @param {IOptions} options
|
|
113
|
-
* @returns {Promise<void>}
|
|
114
|
-
*/
|
|
115
|
-
uploadDirectoryCustom(options: IFileOptions & ICustomOptions): Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* 批量上传文件
|
|
118
|
-
* @param options
|
|
119
|
-
*/
|
|
120
|
-
uploadFilesCustom(options: IFilesOptions & ICustomOptions): Promise<any>;
|
|
121
|
-
/**
|
|
122
|
-
* 创建一个空的文件夹
|
|
123
|
-
* @param {string} cloudPath
|
|
124
|
-
*/
|
|
125
|
-
createCloudDirectroy(cloudPath: string): Promise<void>;
|
|
126
|
-
/**
|
|
127
|
-
* 创建一个空的文件夹,支持自定义 Region 和 Bucket
|
|
128
|
-
* @param {string} cloudPath
|
|
129
|
-
* @param {string} bucket
|
|
130
|
-
* @param {string} region
|
|
131
|
-
*/
|
|
132
|
-
createCloudDirectroyCustom(options: ICustomOptions & {
|
|
133
|
-
cloudPath: string;
|
|
134
|
-
}): Promise<void>;
|
|
135
|
-
/**
|
|
136
|
-
* 下载文件
|
|
137
|
-
* @param {string} cloudPath 云端文件路径
|
|
138
|
-
* @param {string} localPath 文件本地存储路径,文件需指定文件名称
|
|
139
|
-
* @returns {Promise<NodeJS.ReadableStream>}
|
|
140
|
-
*/
|
|
141
|
-
downloadFile(options: {
|
|
142
|
-
cloudPath: string;
|
|
143
|
-
localPath?: string;
|
|
144
|
-
}): Promise<NodeJS.ReadableStream | string>;
|
|
145
|
-
/**
|
|
146
|
-
* 下载文件夹
|
|
147
|
-
* @param {string} cloudPath 云端文件路径
|
|
148
|
-
* @param {string} localPath 本地文件夹存储路径
|
|
149
|
-
* @returns {Promise<(NodeJS.ReadableStream | string)[]>}
|
|
150
|
-
*/
|
|
151
|
-
downloadDirectory(options: {
|
|
152
|
-
cloudPath: string;
|
|
153
|
-
localPath?: string;
|
|
154
|
-
parallel?: number;
|
|
155
|
-
}): Promise<(NodeJS.ReadableStream | string)[]>;
|
|
156
|
-
/**
|
|
157
|
-
* 列出文件夹下的文件
|
|
158
|
-
* @link https://cloud.tencent.com/document/product/436/7734
|
|
159
|
-
* @param {string} cloudPath 云端文件夹,如果为空字符串,则表示根目录
|
|
160
|
-
* @returns {Promise<ListFileInfo[]>}
|
|
161
|
-
*/
|
|
162
|
-
listDirectoryFiles(cloudPath: string): Promise<IListFileInfo[]>;
|
|
163
|
-
/**
|
|
164
|
-
* 获取文件临时下载链接
|
|
165
|
-
* @param {((string | ITempUrlInfo)[])} fileList 文件路径或文件信息数组
|
|
166
|
-
* @returns {Promise<{ fileId: string; url: string }[]>}
|
|
167
|
-
*/
|
|
168
|
-
getTemporaryUrl(fileList: (string | ITempUrlInfo)[]): Promise<{
|
|
169
|
-
fileId: string;
|
|
170
|
-
url: string;
|
|
171
|
-
}[]>;
|
|
172
|
-
/**
|
|
173
|
-
* 删除文件
|
|
174
|
-
* @param {string[]} cloudPathList 云端文件路径数组
|
|
175
|
-
* @returns {Promise<void>}
|
|
176
|
-
*/
|
|
177
|
-
deleteFile(cloudPathList: string[]): Promise<void>;
|
|
178
|
-
/**
|
|
179
|
-
* 删除文件,可以指定 Bucket 和 Region
|
|
180
|
-
* @param {string[]} cloudPathList
|
|
181
|
-
* @param {string} bucket
|
|
182
|
-
* @param {string} region
|
|
183
|
-
* @returns {Promise<void>}
|
|
184
|
-
*/
|
|
185
|
-
deleteFileCustom(cloudPathList: string[], bucket: string, region: string): Promise<void>;
|
|
186
|
-
/**
|
|
187
|
-
* 获取文件信息
|
|
188
|
-
* @param {string} cloudPath 云端文件路径
|
|
189
|
-
* @returns {Promise<FileInfo>}
|
|
190
|
-
*/
|
|
191
|
-
getFileInfo(cloudPath: string): Promise<IFileInfo>;
|
|
192
|
-
/**
|
|
193
|
-
* 删除文件夹
|
|
194
|
-
* @param {string} cloudPath 云端文件夹路径
|
|
195
|
-
* @returns {Promise<void>}
|
|
196
|
-
*/
|
|
197
|
-
deleteDirectory(cloudPath: string): Promise<{
|
|
198
|
-
Deleted: {
|
|
199
|
-
Key: string;
|
|
200
|
-
}[];
|
|
201
|
-
Error: Object[];
|
|
202
|
-
}>;
|
|
203
|
-
/**
|
|
204
|
-
* 删除文件,可以指定 bucket 和 region
|
|
205
|
-
* @param {string} cloudPath
|
|
206
|
-
* @param {string} bucket
|
|
207
|
-
* @param {string} region
|
|
208
|
-
* @returns {Promise<void>}
|
|
209
|
-
*/
|
|
210
|
-
deleteDirectoryCustom(options: {
|
|
211
|
-
cloudPath: string;
|
|
212
|
-
} & ICustomOptions): Promise<{
|
|
213
|
-
Deleted: {
|
|
214
|
-
Key: string;
|
|
215
|
-
}[];
|
|
216
|
-
Error: Object[];
|
|
217
|
-
}>;
|
|
218
|
-
/**
|
|
219
|
-
* 获取文件存储权限
|
|
220
|
-
* READONLY:所有用户可读,仅创建者和管理员可写
|
|
221
|
-
* PRIVATE:仅创建者及管理员可读写
|
|
222
|
-
* ADMINWRITE:所有用户可读,仅管理员可写
|
|
223
|
-
* ADMINONLY:仅管理员可读写
|
|
224
|
-
* @returns
|
|
225
|
-
*/
|
|
226
|
-
getStorageAcl(): Promise<AclType>;
|
|
227
|
-
/**
|
|
228
|
-
* 设置文件存储权限
|
|
229
|
-
* READONLY:所有用户可读,仅创建者和管理员可写
|
|
230
|
-
* PRIVATE:仅创建者及管理员可读写
|
|
231
|
-
* ADMINWRITE:所有用户可读,仅管理员可写
|
|
232
|
-
* ADMINONLY:仅管理员可读写
|
|
233
|
-
* @param {string} acl
|
|
234
|
-
* @returns
|
|
235
|
-
*/
|
|
236
|
-
setStorageAcl(acl: AclType): Promise<IResponseInfo>;
|
|
237
|
-
/**
|
|
238
|
-
* 遍历云端文件夹
|
|
239
|
-
* @param {string} prefix
|
|
240
|
-
* @param {string} [marker] 路径开始标志
|
|
241
|
-
* @returns {Promise<IListFileInfo[]>}
|
|
242
|
-
*/
|
|
243
|
-
walkCloudDir(prefix: string, marker?: string): Promise<IListFileInfo[]>;
|
|
244
|
-
/**
|
|
245
|
-
* 遍历云端文件夹,支持自定义 Bucket 和 Region
|
|
246
|
-
* @param {string} prefix
|
|
247
|
-
* @param {string} [marker]
|
|
248
|
-
* @param {string} bucket
|
|
249
|
-
* @param {string} region
|
|
250
|
-
* @returns {Promise<IListFileInfo[]>}
|
|
251
|
-
*/
|
|
252
|
-
walkCloudDirCustom(options: IWalkCloudDirOptions): Promise<IListFileInfo[]>;
|
|
253
|
-
/**
|
|
254
|
-
* 遍历本地文件夹
|
|
255
|
-
* 忽略不包含 dir 路径,即如果 ignore 匹配 dir,dir 也不会被忽略
|
|
256
|
-
* @private
|
|
257
|
-
* @param {string} dir
|
|
258
|
-
* @param {(string | string[])} [ignore]
|
|
259
|
-
* @returns
|
|
260
|
-
*/
|
|
261
|
-
walkLocalDir(dir: string, ignore?: string | string[]): Promise<string[]>;
|
|
262
|
-
/**
|
|
263
|
-
* 获取文件上传链接属性
|
|
264
|
-
*/
|
|
265
|
-
getUploadMetadata(path: string): Promise<IUploadMetadata>;
|
|
266
|
-
/**
|
|
267
|
-
* 获取静态网站配置
|
|
268
|
-
*/
|
|
269
|
-
getWebsiteConfig(options: {
|
|
270
|
-
bucket: string;
|
|
271
|
-
region: string;
|
|
272
|
-
}): Promise<any>;
|
|
273
|
-
/**
|
|
274
|
-
* 配置文档
|
|
275
|
-
*/
|
|
276
|
-
putBucketWebsite(options: IBucketWebsiteOptions): Promise<any>;
|
|
277
|
-
/**
|
|
278
|
-
* 查询object列表
|
|
279
|
-
* @param {IGetBucketOpions} options
|
|
280
|
-
* @memberof StorageService
|
|
281
|
-
*/
|
|
282
|
-
getBucket(options: IGetBucketOpions): Promise<any>;
|
|
283
|
-
/**
|
|
284
|
-
* 获取 COS 配置
|
|
285
|
-
*/
|
|
286
|
-
private getCos;
|
|
287
|
-
/**
|
|
288
|
-
* 将 cloudPath 转换成 cloudPath/ 形式
|
|
289
|
-
*/
|
|
290
|
-
private getCloudKey;
|
|
291
|
-
/**
|
|
292
|
-
* 将 cloudPath 转换成 fileId
|
|
293
|
-
*/
|
|
294
|
-
private cloudPathToFileId;
|
|
295
|
-
/**
|
|
296
|
-
* 获取存储桶配置
|
|
297
|
-
*/
|
|
298
|
-
private getStorageConfig;
|
|
299
|
-
/**
|
|
300
|
-
* 带重试功能的上传多文件函数
|
|
301
|
-
* @param uploadFiles sdk上传函数
|
|
302
|
-
* @param options sdk上传函数参数
|
|
303
|
-
* @param times 重试次数
|
|
304
|
-
* @param interval 重试时间间隔(毫秒)
|
|
305
|
-
* @param failedFiles 失败文件列表
|
|
306
|
-
* @returns
|
|
307
|
-
*/
|
|
308
|
-
private uploadFilesWithRetry;
|
|
309
|
-
/**
|
|
310
|
-
* 拼接路径下载单文件
|
|
311
|
-
* @param file
|
|
312
|
-
* @param cloudDirectoryKey
|
|
313
|
-
* @param resolveLocalPath
|
|
314
|
-
* @returns
|
|
315
|
-
*/
|
|
316
|
-
private downloadWithFilePath;
|
|
317
|
-
/**
|
|
318
|
-
* 根据下载结果返回错误列表
|
|
319
|
-
* @param res
|
|
320
|
-
* @returns
|
|
321
|
-
*/
|
|
322
|
-
private determineDownLoadResultIsError;
|
|
323
|
-
}
|
|
324
|
-
export {};
|
package/types/third/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Environment } from '../environment';
|
|
2
|
-
export declare class ThirdService {
|
|
3
|
-
private cloudService;
|
|
4
|
-
constructor(environment: Environment);
|
|
5
|
-
deleteThirdPartAttach(options: {
|
|
6
|
-
ThirdPartAppid: string;
|
|
7
|
-
TypeFlag: number;
|
|
8
|
-
}): Promise<{
|
|
9
|
-
RequestId: string;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
package/types/user/index.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Environment } from '../environment';
|
|
2
|
-
import { EndUserInfo, EndUserStatus } from './types';
|
|
3
|
-
export declare class UserService {
|
|
4
|
-
private environment;
|
|
5
|
-
private tcbService;
|
|
6
|
-
constructor(environment: Environment);
|
|
7
|
-
getEndUserList(options: {
|
|
8
|
-
limit: number;
|
|
9
|
-
offset: number;
|
|
10
|
-
}): Promise<{
|
|
11
|
-
Total: number;
|
|
12
|
-
Users: EndUserInfo[];
|
|
13
|
-
RequestId: string;
|
|
14
|
-
}>;
|
|
15
|
-
setEndUserStatus(options: {
|
|
16
|
-
uuid: string;
|
|
17
|
-
status: EndUserStatus;
|
|
18
|
-
}): Promise<{
|
|
19
|
-
RequestId: string;
|
|
20
|
-
}>;
|
|
21
|
-
deleteEndUsers(options: {
|
|
22
|
-
userList: string[];
|
|
23
|
-
}): Promise<{
|
|
24
|
-
RequestId: string;
|
|
25
|
-
}>;
|
|
26
|
-
createEndUser(options: {
|
|
27
|
-
username: string;
|
|
28
|
-
password: string;
|
|
29
|
-
}): Promise<{
|
|
30
|
-
RequestId: string;
|
|
31
|
-
User: EndUserInfo;
|
|
32
|
-
}>;
|
|
33
|
-
modifyEndUser(options: {
|
|
34
|
-
uuid: string;
|
|
35
|
-
password?: string;
|
|
36
|
-
username?: string;
|
|
37
|
-
}): Promise<{
|
|
38
|
-
RequestId: string;
|
|
39
|
-
}>;
|
|
40
|
-
updateEndUser(options: {
|
|
41
|
-
uuid: string;
|
|
42
|
-
nickName: string;
|
|
43
|
-
gender: string;
|
|
44
|
-
avatarUrl: string;
|
|
45
|
-
country: string;
|
|
46
|
-
province: string;
|
|
47
|
-
city: string;
|
|
48
|
-
}): Promise<{
|
|
49
|
-
RequestId: string;
|
|
50
|
-
}>;
|
|
51
|
-
private isValidStr;
|
|
52
|
-
}
|
package/types/user/types.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface EndUserInfo {
|
|
2
|
-
UUId: string;
|
|
3
|
-
WXOpenId: string;
|
|
4
|
-
QQOpenId: string;
|
|
5
|
-
Phone: string;
|
|
6
|
-
Email: string;
|
|
7
|
-
NickName: string;
|
|
8
|
-
Gender: string;
|
|
9
|
-
AvatarUrl: string;
|
|
10
|
-
Country: string;
|
|
11
|
-
Province: string;
|
|
12
|
-
City: string;
|
|
13
|
-
UpdateTime: string;
|
|
14
|
-
CreateTime: string;
|
|
15
|
-
IsAnonymous: boolean;
|
|
16
|
-
IsDisabled: boolean;
|
|
17
|
-
HasPassword: boolean;
|
|
18
|
-
UserName: string;
|
|
19
|
-
}
|
|
20
|
-
export declare type EndUserStatus = 'ENABLE' | 'DISABLE';
|