-
Notifications
You must be signed in to change notification settings - Fork 0
/
System.ts
62 lines (57 loc) · 1.42 KB
/
System.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
interface System {
owner: string;
repo: string;
api: {
github: string;
};
core(): typeof import("@phatdev/pkg");
system: {
generate_random_string(length: number): Promise<string>;
jsonRequest(host: string, endpoint: string, ssl: boolean): Promise<any>;
textRequest(host: string, endpoint: string, ssl: boolean): Promise<any>;
};
}
export const System: System = {
owner: "phatdev12",
repo: "phatdev12",
api: {
github: "api.github.com"
},
/**
*
* @returns
*/
core() {
return import('@phatdev/pkg') as unknown as typeof import("@phatdev/pkg")
},
system: {
/**
*
* @param length
* @returns
*/
async generate_random_string(length) {
return (await System.core()).generate_random_string(length);
},
/**
*
* @param host
* @param endpoint
* @param ssl
* @returns
*/
async jsonRequest(host, endpoint, ssl) {
return (await System.core()).jsonRequest(host, endpoint, ssl);
},
/**
*
* @param host
* @param endpoint
* @param ssl
* @returns
*/
async textRequest(host, endpoint, ssl) {
return (await System.core()).textRequest(host, endpoint, ssl);
},
}
}