lack 1.3.1 → 1.3.4
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/assets/ts/src/types/base.d.ts +7 -7
- package/assets/ts/src/types/global.d.ts +41 -38
- package/bin/watch.js +2 -2
- package/package.json +1 -1
|
@@ -5,11 +5,11 @@ import { ParsedUrlQuery } from 'querystring';
|
|
|
5
5
|
import { Socket } from 'net';
|
|
6
6
|
|
|
7
7
|
declare global {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
namespace WhistleBase {
|
|
9
|
+
class Request extends IncomingMessage {}
|
|
10
|
+
class Response extends ServerResponse {}
|
|
11
|
+
class HttpServer extends Server {}
|
|
12
|
+
class Socks extends Socket {}
|
|
13
|
+
type UrlQuery = ParsedUrlQuery;
|
|
14
|
+
}
|
|
15
15
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/triple-slash-reference, @typescript-eslint/naming-convention */
|
|
2
|
+
|
|
1
3
|
/// <reference path="base.d.ts" />
|
|
2
4
|
|
|
3
5
|
declare module 'koa-onerror';
|
|
@@ -6,42 +8,42 @@ declare namespace Whistle {
|
|
|
6
8
|
type Body = string | false;
|
|
7
9
|
|
|
8
10
|
interface LRUOptions<K = any, V = any> {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
max?: number;
|
|
12
|
+
maxAge?: number;
|
|
13
|
+
length?(value: V, key?: K): number;
|
|
14
|
+
dispose?(key: K, value: V): void;
|
|
15
|
+
stale?: boolean;
|
|
16
|
+
noDisposeOnSet?: boolean;
|
|
17
|
+
}
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
interface LRUEntry<K, V> {
|
|
20
|
+
k: K;
|
|
21
|
+
v: V;
|
|
22
|
+
e: number;
|
|
23
|
+
}
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
interface LRUCache<K = any, V = any> {
|
|
26
|
+
new (options?: LRUOptions<K, V>): this;
|
|
27
|
+
readonly length: number;
|
|
28
|
+
readonly itemCount: number;
|
|
29
|
+
allowStale: boolean;
|
|
30
|
+
lengthCalculator(value: V): number;
|
|
31
|
+
max: number;
|
|
32
|
+
maxAge: number;
|
|
33
|
+
set(key: K, value: V, maxAge?: number): boolean;
|
|
34
|
+
get(key: K): V;
|
|
35
|
+
peek(key: K): V;
|
|
36
|
+
has(key: K): boolean;
|
|
37
|
+
del(key: K): void;
|
|
38
|
+
reset(): void;
|
|
39
|
+
prune(): void;
|
|
40
|
+
forEach<T = this>(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void;
|
|
41
|
+
rforEach<T = this>(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void;
|
|
42
|
+
keys(): K[];
|
|
43
|
+
values(): V[];
|
|
44
|
+
dump(): Array<LRUEntry<K, V>>;
|
|
45
|
+
load(cacheEntries: ReadonlyArray<LRUEntry<K, V>>): void;
|
|
46
|
+
}
|
|
45
47
|
|
|
46
48
|
interface Frame {
|
|
47
49
|
reqId: string;
|
|
@@ -266,6 +268,7 @@ declare namespace Whistle {
|
|
|
266
268
|
commonName: string;
|
|
267
269
|
realUrl: string;
|
|
268
270
|
relativeUrl: string;
|
|
271
|
+
extraUrl: string;
|
|
269
272
|
method: string;
|
|
270
273
|
clientPort: string;
|
|
271
274
|
globalValue: string;
|
|
@@ -303,10 +306,10 @@ declare namespace Whistle {
|
|
|
303
306
|
}
|
|
304
307
|
|
|
305
308
|
class PluginServerSocket extends WhistleBase.Socks {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
setReqRules: SetRules;
|
|
310
|
+
setResRules: SetRules;
|
|
311
|
+
disableTrailers?: boolean;
|
|
312
|
+
}
|
|
310
313
|
class PluginUIRequest extends WhistleBase.Request {
|
|
311
314
|
clientIp: string;
|
|
312
315
|
Storage: Storage;
|
package/bin/watch.js
CHANGED
|
@@ -9,7 +9,7 @@ const touch = () => {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
module.exports = (dirs) => {
|
|
12
|
-
const watchList = ['index.js', 'rules.txt', '_rules.txt', 'reqRules.txt', 'resRules.txt', 'lib'];
|
|
12
|
+
const watchList = ['index.js', 'rules.txt', '_rules.txt', 'reqRules.txt', 'resRules.txt', 'lib', 'dist'];
|
|
13
13
|
if (dirs && typeof dirs === 'string') {
|
|
14
14
|
dirs.split(',').forEach((dir) => {
|
|
15
15
|
dir = dir.trim();
|
|
@@ -19,7 +19,7 @@ module.exports = (dirs) => {
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
let timer;
|
|
22
|
-
console.log(`Watching
|
|
22
|
+
console.log(`Watching the following files/folders changes:\n${watchList.join('\n')}\n`); // eslint-disable-line
|
|
23
23
|
chokidar.watch(watchList, {
|
|
24
24
|
ignored: /(^|[/\\])(\..|node_modules([/\\]|$))/,
|
|
25
25
|
}).on('raw', (_, filename) => {
|