forked from Nike-Inc/cerberus-node-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
47 lines (42 loc) · 1.38 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
declare module 'cerberus-node-client' {
interface CerberusClientOptions {
hostUrl: string;
region?: string;
token?: string;
debug?: boolean;
}
interface ListKeyResult {
keys: string[];
}
interface SecureFileSummary {
sdbox_id: string;
path: string;
size_in_bytes: number;
name: string;
created_by: string;
created_ts: string;
last_updated_by: string;
last_updated_ts: string;
}
interface ListFileResult {
has_next: boolean;
next_offset: string;
limit: number;
offset: number;
file_count_in_result: number;
total_file_count: number;
secure_file_summaries: SecureFileSummary[];
}
class CerberusClient {
constructor(options: CerberusClientOptions);
writeSecureData(path: string, data: Record<string, string>): Promise<void>;
getSecureData(path: string): Promise<Record<string, string>>;
deleteSecureData(path: string): Promise<void>;
listPathsForSecureData(path: string): Promise<ListKeyResult>;
listFile(path: string): Promise<ListFileResult>;
readFile(path: string): Promise<Buffer | string>;
writeFile(path: string, data: string | Buffer): Promise<object>;
deleteFile(path: string): Promise<object>;
}
export = CerberusClient;
}