1 |
|
2 | import { CloudBaseError } from './error';
|
3 | export declare type CustomEvent = 'logout';
|
4 | declare global {
|
5 | namespace NodeJS {
|
6 | interface Process extends EventEmitter {
|
7 | IS_DEBUG: boolean;
|
8 | CLI_VERSION: string;
|
9 | on(event: CustomEvent, listener: BeforeExitListener): any;
|
10 | emit(event: CustomEvent, message?: any): any;
|
11 | }
|
12 | }
|
13 | }
|
14 | export declare type TExportFunctionVoid = () => Promise<void | CloudBaseError>;
|
15 | export interface PermanentCredential {
|
16 | secretId?: string;
|
17 | secretKey?: string;
|
18 | }
|
19 | export interface TmpCredential {
|
20 | tmpSecretId?: string;
|
21 | tmpSecretKey?: string;
|
22 | tmpToken?: string;
|
23 | tmpExpired?: string;
|
24 | expired?: string;
|
25 | authTime?: string;
|
26 | refreshToken?: string;
|
27 | uin?: string;
|
28 | hash?: string;
|
29 | }
|
30 | export declare type Credential = TmpCredential & PermanentCredential;
|
31 | export interface AuthSecret {
|
32 | secretId: string;
|
33 | secretKey: string;
|
34 | token?: string;
|
35 | }
|
36 | export interface SSH {
|
37 | host: string;
|
38 | port: string;
|
39 | username: string;
|
40 | password: string;
|
41 | }
|
42 | export interface IConfig {
|
43 | credential?: Credential;
|
44 | ssh?: SSH;
|
45 | }
|
46 | export interface ICloudBaseConfig {
|
47 | envId: string;
|
48 | functionRoot?: string;
|
49 | functions?: ICloudFunction[];
|
50 | servers?: ServerConfig[];
|
51 | }
|
52 | export interface IGetCredential {
|
53 | secretId?: string;
|
54 | secretKey?: string;
|
55 | token: string;
|
56 | }
|
57 | export declare enum ServerLanguageType {
|
58 | node = "node"
|
59 | }
|
60 | export interface ServerConfig {
|
61 | type: ServerLanguageType.node;
|
62 | name: string;
|
63 | path: string;
|
64 | }
|
65 | export interface IFunctionPackResult {
|
66 | success: boolean;
|
67 | assets: string[];
|
68 | vemo?: boolean;
|
69 | }
|
70 | export interface IFunctionVPC {
|
71 | subnetId: string;
|
72 | vpcId: string;
|
73 | }
|
74 | export interface ICloudFunctionConfig {
|
75 | timeout?: number;
|
76 | envVariables?: Record<string, string | number | boolean>;
|
77 | runtime?: string;
|
78 | vpc?: IFunctionVPC;
|
79 | installDependency?: boolean;
|
80 | l5?: boolean;
|
81 | }
|
82 | export interface ICloudFunctionTrigger {
|
83 | name: string;
|
84 | type: string;
|
85 | config: string;
|
86 | }
|
87 | export interface ICloudFunction {
|
88 | name: string;
|
89 | config?: ICloudFunctionConfig;
|
90 | triggers?: ICloudFunctionTrigger[];
|
91 | params?: Record<string, string>;
|
92 | handler?: string;
|
93 | ignore?: string | string[];
|
94 | timeout?: number;
|
95 | envVariables?: Record<string, string | number | boolean>;
|
96 | runtime?: string;
|
97 | vpc?: IFunctionVPC;
|
98 | l5?: boolean;
|
99 | installDependency?: boolean;
|
100 | isWaitInstall?: boolean;
|
101 | }
|
102 | export interface ICreateFunctionOptions {
|
103 | func?: ICloudFunction;
|
104 | functions?: ICloudFunction[];
|
105 | functionRootPath?: string;
|
106 | envId: string;
|
107 | force?: boolean;
|
108 | base64Code?: string;
|
109 | log?: boolean;
|
110 | codeSecret?: string;
|
111 | }
|
112 | export interface IListFunctionOptions {
|
113 | limit?: number;
|
114 | offset?: number;
|
115 | envId: string;
|
116 | }
|
117 | export interface IFunctionLogOptions {
|
118 | functionName: string;
|
119 | envId: string;
|
120 | offset?: number;
|
121 | limit?: number;
|
122 | order?: string;
|
123 | orderBy?: string;
|
124 | startTime?: string;
|
125 | endTime?: string;
|
126 | functionRequestI?: string;
|
127 | }
|
128 | export interface IUpdateFunctionConfigOptions {
|
129 | functionName: string;
|
130 | config: ICloudFunctionConfig;
|
131 | envId: string;
|
132 | }
|
133 | export interface InvokeFunctionOptions {
|
134 | functionName: string;
|
135 | params?: Record<string, any>;
|
136 | envId: string;
|
137 | }
|
138 | export interface IFunctionBatchOptions {
|
139 | functions: ICloudFunction[];
|
140 | envId: string;
|
141 | log?: boolean;
|
142 | }
|
143 | export interface IFunctionTriggerOptions {
|
144 | functionName: string;
|
145 | triggers?: ICloudFunctionTrigger[];
|
146 | triggerName?: string;
|
147 | envId: string;
|
148 | }
|
149 | export interface ILoginOptions {
|
150 | key?: boolean;
|
151 | secretId?: string;
|
152 | secretKey?: string;
|
153 | getAuthUrl?: (url: string) => string;
|
154 | }
|
155 | export interface GatewayContext {
|
156 | envId: string;
|
157 | config: ICloudBaseConfig;
|
158 | }
|
159 | export interface ICreateFunctionGatewayOptions {
|
160 | envId: string;
|
161 | path: string;
|
162 | name: string;
|
163 | }
|
164 | export interface IQueryGatewayOptions {
|
165 | envId: string;
|
166 | domain?: string;
|
167 | path?: string;
|
168 | gatewayId?: string;
|
169 | name?: string;
|
170 | }
|
171 | export interface IDeleteGatewayOptions {
|
172 | envId: string;
|
173 | path?: string;
|
174 | gatewayId?: string;
|
175 | name?: string;
|
176 | }
|
177 | export interface IBindGatewayDomainOptions {
|
178 | envId: string;
|
179 | domain: string;
|
180 | }
|
181 | export interface IQueryGatewayDomainOptions {
|
182 | envId: string;
|
183 | domain?: string;
|
184 | }
|
185 | export interface IUnbindGatewayDomainOptions {
|
186 | envId: string;
|
187 | domain: string;
|
188 | }
|