@cloud-cli/px 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/proxy-manager.d.ts +1 -1
- package/dist/proxy-manager.js +2 -3
- package/package.json +2 -1
- package/.prettierrc +0 -9
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { HttpProxy, Domain } from './proxy-manager.js';
|
|
|
2
2
|
declare const _default: {
|
|
3
3
|
add(options: HttpProxy): Promise<unknown>;
|
|
4
4
|
remove(options: HttpProxy): Promise<unknown>;
|
|
5
|
+
list(): HttpProxy[];
|
|
5
6
|
get(options: Domain): HttpProxy[];
|
|
6
7
|
reload(): void;
|
|
7
8
|
domains(): string[];
|
|
8
|
-
list(): string[];
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,9 @@ export default {
|
|
|
7
7
|
remove(options) {
|
|
8
8
|
return manager.removeProxy(options);
|
|
9
9
|
},
|
|
10
|
+
list() {
|
|
11
|
+
return manager.getProxyList();
|
|
12
|
+
},
|
|
10
13
|
get(options) {
|
|
11
14
|
return manager.getProxyListForDomain(options);
|
|
12
15
|
},
|
|
@@ -16,7 +19,4 @@ export default {
|
|
|
16
19
|
domains() {
|
|
17
20
|
return manager.getDomainList();
|
|
18
21
|
},
|
|
19
|
-
list() {
|
|
20
|
-
return manager.getProxyList();
|
|
21
|
-
},
|
|
22
22
|
};
|
package/dist/proxy-manager.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare class ProxyManager {
|
|
|
11
11
|
addProxy(proxy: HttpProxy): Promise<unknown>;
|
|
12
12
|
removeProxy(options: HttpProxy): Promise<unknown>;
|
|
13
13
|
getDomainList(): string[];
|
|
14
|
-
getProxyList():
|
|
14
|
+
getProxyList(): HttpProxy[];
|
|
15
15
|
getProxyListForDomain(options: Domain): HttpProxy[];
|
|
16
16
|
reloadProxies(): void;
|
|
17
17
|
private readProxyList;
|
package/dist/proxy-manager.js
CHANGED
|
@@ -59,7 +59,7 @@ export class ProxyManager {
|
|
|
59
59
|
return this.proxyList.map((p) => p.domain);
|
|
60
60
|
}
|
|
61
61
|
getProxyList() {
|
|
62
|
-
return this.proxyList.
|
|
62
|
+
return this.proxyList.slice();
|
|
63
63
|
}
|
|
64
64
|
getProxyListForDomain(options) {
|
|
65
65
|
return this.proxyList.filter((p) => p.domain === options.domain);
|
|
@@ -108,8 +108,7 @@ export class ProxyManager {
|
|
|
108
108
|
return '';
|
|
109
109
|
}
|
|
110
110
|
saveProxies() {
|
|
111
|
-
|
|
112
|
-
writeFileSync(configurationFile, JSON.stringify(proxies));
|
|
111
|
+
writeFileSync(configurationFile, JSON.stringify(this.proxyList));
|
|
113
112
|
}
|
|
114
113
|
closeProxy() {
|
|
115
114
|
this.proxy.close();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-cli/px",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Reverse Proxy",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"devDependencies": {
|
|
19
|
+
"@cloud-cli/prettier-config": "^1.0.0",
|
|
19
20
|
"@types/jasmine": "^4.0.3",
|
|
20
21
|
"@types/jest": "^27.0.1",
|
|
21
22
|
"@types/node": "^14.18.21",
|