-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
86 lines (81 loc) · 3.07 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { Client as ScfClient } from 'tencentcloud-sdk-nodejs/tencentcloud/services/scf/v20180416/scf_client'
type CloudConfig = {
SecretId: string
SecretKey: string
Region?: string
Bucket?: string
}
type CloudOptions = {
debug?: boolean
config?: CloudConfig
namespace?: string
}
type UpdateFuncEnvConfig = {
Key?: string
Value?: string
}[]
type UpdateFuncLayerConfig = {
LayerName: string,
LayerVersion: number
}
declare namespace utils {
namespace cos {
function getList<T>(dir:string, options:CloudOptions): Promise<T[]>
function deleteFile<T>(filepath:string, options:CloudOptions): Promise<T>
function deleteDir<T>(dir:string, options:CloudOptions): Promise<T>
function uploadFolder<T>(localFolder:string, remotePrefix:string, options:CloudOptions): Promise<T>
function uploadFile<T>(localPath:string, remotePath:string, options:CloudOptions): Promise<T>
function createCompressTask<T>(
compressDir: string,
options: {
config: CloudConfig
compressConfig: {
Flatten?: string
Format?: string
Type?: string
CompressKey?: string
UrlList?: string
Prefix?: string
Key?: string[]
IgnoreError?: string
}
outputConfig: {
Bucket?: string
Region?: string
Object: string
}
}
): Promise<T>
}
namespace cdn {
function refreshDirs<T>(name:string[], options?:CloudOptions): Promise<T>
function getDomainList(options?:CloudOptions): Promise<any>
}
namespace scf {
function getClient(config:CloudConfig): ScfClient
function getFuncList(options?:CloudOptions): Promise<any[]>
function getFunc(name:string, options?:CloudOptions): Promise<any>
function getLayer(name:string, options?:CloudOptions)
function getLayerVersion(name:string, ver:number, options?:CloudOptions)
function deleteLayerVersion(name:string, ver:number, options?:CloudOptions)
function createLayerVersionFromCos(name:string, layer: {
runtime: string[]
cosBucket: string
cosObject: string
cosRegion: string
desc: string
}, options?:CloudOptions):Promise<number>
function updateCodeByCos(name:string, cos:{
name: string
region: string
filename: string
},options?:CloudOptions)
function deleteFunc(name:string, options?:CloudOptions)
function updateFuncEnv(name:string, env: UpdateFuncEnvConfig, options?:CloudOptions)
function updateFuncLayerConfig(name:string, layerConfig:UpdateFuncLayerConfig, options?:CloudOptions)
function waitFunctionActive(name:string, version:string, options?:CloudOptions)
function startPersistentInstance(name:string, options?:CloudOptions)
function cancelPersistentInstance(name:string, options?:CloudOptions)
}
}
export = utils