Passed
Push — master ( 542b84...8f7113 )
by xu
40s queued 11s
created

index.d.ts   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 26
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 22
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 5
mnd 0
bc 0
fnc 5
bpm 0
cpm 1
noi 0

5 Functions

Rating   Name   Duplication   Size   Complexity  
A ➔ request 0 2 1
A ➔ purgeDirsCache 0 2 1
A ➔ transformerUrls 0 1 1
A ➔ purgeUrlsCache 0 1 1
A ➔ buildRequestParams 0 1 1
1
export interface Response {
2
    code: number;
3
    message: string;
4
    codeDesc: string;
5
    data: { count: number, task_id: string };
6
}
7
8
export = class Refresh {
9
    public host: string;
10
    public protocol: string;
11
    public constructor(public configs: {
12
        SecretId: string;
13
        SecretKey: string;
14
        Timestamp?: number;
15
        Nonce?: number;
16
        path?: string;
17
    });
18
19
    public purgeDirsCache(dirs: string | string[]): Promise<Response>
20
    public purgeUrlsCache(dirs: string | string[]): Promise<Response>
21
22
    public request(params: any): Promise<Response>
23
    public transformerUrls(urls: string | string[], type?: 'urls' | 'dirs'): Record<string, string>
24
    public buildRequestParams(urls: string | string[], type?: 'urls' | 'dirs', action?: 'RefreshCdnUrl' | 'RefreshCdnDir'): Record<string, string>
25
}
26