@e-mc/types 0.9.9 → 0.10.1
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/README.md +13 -9
- package/constant.d.ts +37 -8
- package/index.d.ts +27 -14
- package/index.js +319 -218
- package/lib/asset.d.ts +2 -2
- package/lib/cloud.d.ts +1 -1
- package/lib/compat-v4.d.ts +11 -6
- package/lib/compress.d.ts +9 -8
- package/lib/core.d.ts +7 -7
- package/lib/db.d.ts +13 -9
- package/lib/document.d.ts +6 -4
- package/lib/filemanager.d.ts +10 -9
- package/lib/http.d.ts +2 -1
- package/lib/index.d.ts +53 -46
- package/lib/logger.d.ts +3 -0
- package/lib/module.d.ts +21 -38
- package/lib/node.d.ts +2 -2
- package/lib/object.d.ts +0 -2
- package/lib/request.d.ts +8 -4
- package/lib/settings.d.ts +93 -70
- package/lib/squared.d.ts +9 -45
- package/lib/type.d.ts +6 -4
- package/package.json +2 -2
package/lib/logger.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface LogBaseOptions extends LoggerColor, Pick<LogOptions, "queue" |
|
|
|
12
12
|
sessionId?: string;
|
|
13
13
|
abortable?: boolean;
|
|
14
14
|
titleJustify?: TextAlign;
|
|
15
|
+
rawOutput?: boolean;
|
|
15
16
|
broadcastId?: BroadcastValue;
|
|
16
17
|
newline?: boolean | number;
|
|
17
18
|
}
|
|
@@ -52,6 +53,7 @@ export interface LogMessageOptions extends LogBaseOptions {
|
|
|
52
53
|
messageUnit?: string;
|
|
53
54
|
messageUnitMinWidth?: number;
|
|
54
55
|
messageUnitIndent?: number | [number, string];
|
|
56
|
+
messageTextWrap?: boolean | TextWrapStyle;
|
|
55
57
|
progressBar?: boolean;
|
|
56
58
|
alwaysVisible?: boolean;
|
|
57
59
|
titleIndent?: boolean | number;
|
|
@@ -106,6 +108,7 @@ export type LogComponent = Partial<Pick<LogStatus<StatusType>, "type" | "value"
|
|
|
106
108
|
export type BackgroundColor = typeof IBackgroundColor | HexColor;
|
|
107
109
|
export type ForegroundColor = typeof IForegroundColor | HexColor;
|
|
108
110
|
export type TextAlign = "left" | "center" | "right";
|
|
111
|
+
export type TextWrapStyle = "ellipsis" | "nowrap" | "ellipsis-end" | "nowrap-end" | "none";
|
|
109
112
|
export type ErrorOutMethod = (err: Error, data: LogTypeValue, require?: NodeRequire) => void;
|
|
110
113
|
export type BroadcastOutMethod = (value: string, options: LogMessageOptions, require?: NodeRequire) => void;
|
|
111
114
|
export type BroadcastValue = ArrayOf<string> | { value: ArrayOf<string>; stripAnsi?: boolean };
|
package/lib/module.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import type { ChecksumBase } from './squared';
|
|
|
3
3
|
import type { StreamAction } from './asset';
|
|
4
4
|
|
|
5
5
|
import type { HashOptions } from 'crypto';
|
|
6
|
+
import type { Readable } from 'stream';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
export const enum NORMALIZE_FLAGS {
|
|
8
9
|
NONE = 0,
|
|
9
10
|
RESOLVE = 1,
|
|
10
11
|
ENSURE_DIR = 2,
|
|
@@ -15,16 +16,29 @@ export interface RequireAction {
|
|
|
15
16
|
requireExt?: ArrayOf<string> | boolean;
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
export interface ThrowsAction {
|
|
20
|
+
throwsPermission?: boolean;
|
|
21
|
+
throwsDoesNotExist?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ExecAction {
|
|
25
|
+
uid?: number | string;
|
|
26
|
+
gid?: number | string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IncludeAction<T = string[]> {
|
|
30
|
+
include?: T;
|
|
31
|
+
exclude?: T;
|
|
32
|
+
}
|
|
33
|
+
|
|
18
34
|
export interface PermissionOptions {
|
|
19
35
|
ownPermissionOnly?: boolean;
|
|
20
36
|
hostPermissionOnly?: boolean;
|
|
21
37
|
}
|
|
22
38
|
|
|
23
|
-
export interface FileSystemOptions extends PermissionOptions {
|
|
39
|
+
export interface FileSystemOptions extends PermissionOptions, ThrowsAction {
|
|
24
40
|
absolutePath?: boolean;
|
|
25
41
|
ignorePermission?: boolean;
|
|
26
|
-
throwsPermission?: boolean;
|
|
27
|
-
throwsDoesNotExist?: boolean;
|
|
28
42
|
}
|
|
29
43
|
|
|
30
44
|
export interface ReadFileOptions extends FileSystemOptions, StreamBase, RequireAction {
|
|
@@ -55,10 +69,6 @@ export interface RemoveDirOptions extends FileSystemOptions {
|
|
|
55
69
|
export type MoveFileOptions = CopyFileOptions;
|
|
56
70
|
export type CreateDirOptions = FileSystemOptions;
|
|
57
71
|
|
|
58
|
-
export interface GetFunctionsOptions extends ParseFunctionOptions {
|
|
59
|
-
outFailed?: string[];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
72
|
export interface ParseFunctionOptions extends RequireAction {
|
|
63
73
|
absolute?: boolean;
|
|
64
74
|
sync?: boolean;
|
|
@@ -66,19 +76,6 @@ export interface ParseFunctionOptions extends RequireAction {
|
|
|
66
76
|
context?: unknown;
|
|
67
77
|
}
|
|
68
78
|
|
|
69
|
-
export interface CloneObjectOptions<T = unknown> {
|
|
70
|
-
target?: T;
|
|
71
|
-
deep?: boolean;
|
|
72
|
-
deepIgnore?: WeakSet<object>;
|
|
73
|
-
typedArray?: boolean;
|
|
74
|
-
mergeArray?: MergeArrayMethod;
|
|
75
|
-
mergeDepth?: number;
|
|
76
|
-
symbol?: boolean;
|
|
77
|
-
inherited?: boolean;
|
|
78
|
-
nonenumerable?: boolean;
|
|
79
|
-
preserve?: boolean;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
79
|
export interface CheckSemVerOptions extends MinMax {
|
|
83
80
|
startDir?: string;
|
|
84
81
|
unstable: boolean;
|
|
@@ -114,12 +111,9 @@ export interface ReadBufferOptions extends StreamBase {
|
|
|
114
111
|
cache?: boolean;
|
|
115
112
|
}
|
|
116
113
|
|
|
117
|
-
export interface AsHashOptions extends HashOptions, ChecksumBase {
|
|
118
|
-
/** @deprecated */
|
|
119
|
-
minLength?: number;
|
|
120
|
-
}
|
|
114
|
+
export interface AsHashOptions extends HashOptions, ChecksumBase {}
|
|
121
115
|
|
|
122
|
-
export interface
|
|
116
|
+
export interface TempDirOptions {
|
|
123
117
|
pathname?: string;
|
|
124
118
|
filename?: string;
|
|
125
119
|
moduleDir?: boolean;
|
|
@@ -128,18 +122,7 @@ export interface GetTempDirOptions {
|
|
|
128
122
|
increment?: number;
|
|
129
123
|
}
|
|
130
124
|
|
|
131
|
-
export interface ExecAction {
|
|
132
|
-
uid?: NumString;
|
|
133
|
-
gid?: NumString;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export interface IncludeAction<T = string[]> {
|
|
137
|
-
include?: T;
|
|
138
|
-
exclude?: T;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export type NormalizeFlags = typeof NORMALIZE_FLAGS[keyof typeof NORMALIZE_FLAGS];
|
|
142
125
|
export type ReadTextOptions = ReadBufferOptions;
|
|
143
126
|
export type ReadFileCallback<T extends Bufferable = Bufferable> = (err: Null<NodeJS.ErrnoException>, data?: T) => void;
|
|
144
127
|
export type ProtocolType = "http" | "https" | "http/s" | "ftp" | "sftp" | "s/ftp" | "torrent" | "unc" | "file";
|
|
145
|
-
export type
|
|
128
|
+
export type FileTypeFormat = Bufferable | Uint8Array | ArrayBuffer | Readable;
|
package/lib/node.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { RequestData as IRequestData } from './squared';
|
|
2
2
|
|
|
3
3
|
import type { ExternalAsset } from './asset';
|
|
4
|
-
import type { HostInitConfig } from './core';
|
|
4
|
+
import type { HostInitConfig, HostInitLog } from './core';
|
|
5
5
|
import type { DownloadModule, ErrorModule, LoggerModule, MemoryModule, NodeModule, PermissionModule, ProcessModule, RequestModule, TempModule } from './settings';
|
|
6
6
|
|
|
7
|
-
export interface RequestData<T extends ExternalAsset = ExternalAsset> extends Readonly<Omit<IRequestData, "log">>, Readonly<HostInitConfig
|
|
7
|
+
export interface RequestData<T extends ExternalAsset = ExternalAsset, U extends HostInitLog = HostInitLog> extends Readonly<Omit<IRequestData, "log">>, Readonly<HostInitConfig<U>> {
|
|
8
8
|
readonly assets?: T[];
|
|
9
9
|
}
|
|
10
10
|
|
package/lib/object.d.ts
CHANGED
package/lib/request.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BinaryAction } from './asset';
|
|
2
2
|
import type { HttpProtocolVersion, InternetProtocolVersion } from './http';
|
|
3
|
+
import type { HttpHostSettings } from './settings';
|
|
3
4
|
|
|
4
5
|
import type { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http';
|
|
5
6
|
import type { Readable, Writable } from 'stream';
|
|
@@ -39,14 +40,16 @@ export interface IHttpHost {
|
|
|
39
40
|
get hostname(): string;
|
|
40
41
|
get port(): string;
|
|
41
42
|
get origin(): string;
|
|
43
|
+
get streamSize(): number;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
export interface HttpHostConstructor {
|
|
45
47
|
normalizeOrigin(value: string): string;
|
|
46
48
|
formatBasicAuth(url: URL): string;
|
|
47
49
|
getBasicAuth(url: URL): Undef<OutgoingHttpHeaders>;
|
|
48
|
-
defineLocalHost(
|
|
49
|
-
defineProtocolNegotiation(
|
|
50
|
+
defineLocalHost(values: string[]): void;
|
|
51
|
+
defineProtocolNegotiation(data: ObjectMap<string[]>): void;
|
|
52
|
+
defineHostConfig(settings: HttpHostSettings): void;
|
|
50
53
|
readonly prototype: IHttpHost;
|
|
51
54
|
new(url: URL, httpVersion?: HttpProtocolVersion): IHttpHost;
|
|
52
55
|
}
|
|
@@ -54,13 +57,14 @@ export interface HttpHostConstructor {
|
|
|
54
57
|
export interface OpenOptions extends KeepAliveAction, SilentAction {
|
|
55
58
|
host?: IHttpHost;
|
|
56
59
|
url?: URL;
|
|
60
|
+
base?: boolean;
|
|
57
61
|
socketPath?: string;
|
|
58
62
|
httpVersion?: HttpProtocolVersion;
|
|
59
63
|
method?: "GET" | "POST" | "HEAD";
|
|
60
64
|
search?: StringMap;
|
|
61
65
|
follow_redirect?: boolean;
|
|
62
66
|
encoding?: BufferEncoding;
|
|
63
|
-
maxBufferSize?:
|
|
67
|
+
maxBufferSize?: number | string;
|
|
64
68
|
format?: BufferFormat | { out?: BufferFormat; parser?: PlainObject };
|
|
65
69
|
headers?: OutgoingHttpHeaders;
|
|
66
70
|
timeout?: number;
|
|
@@ -68,7 +72,7 @@ export interface OpenOptions extends KeepAliveAction, SilentAction {
|
|
|
68
72
|
postData?: unknown;
|
|
69
73
|
connected?: (headers: IncomingHttpHeaders) => Void<boolean>;
|
|
70
74
|
statusMessage?: string;
|
|
71
|
-
progressId?:
|
|
75
|
+
progressId?: number | string;
|
|
72
76
|
outFormat?: { out: BufferFormat; parser?: PlainObject };
|
|
73
77
|
outFilename?: Null<string>;
|
|
74
78
|
outHeaders?: Null<IncomingHttpHeaders>;
|
package/lib/settings.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { CloudSource } from './cloud';
|
|
|
5
5
|
import type { PermissionAction, PermissionReadWrite, PermittedDirectories } from './core';
|
|
6
6
|
import type { DbSource, TimeoutAction } from './db';
|
|
7
7
|
import type { HttpOutgoingHeaders, SecureConfig, ServerPort } from './http';
|
|
8
|
-
import type { BackgroundColor, BroadcastOutMethod, ErrorOutMethod, ForegroundColor, LoggerColor, LoggerStatus, TextAlign } from './logger';
|
|
8
|
+
import type { BackgroundColor, BroadcastOutMethod, ErrorOutMethod, ForegroundColor, LoggerColor, LoggerStatus, TextAlign, TextWrapStyle } from './logger';
|
|
9
9
|
import type { ExecAction, IncludeAction } from './module';
|
|
10
10
|
|
|
11
11
|
import type { SpawnOptions } from 'child_process';
|
|
@@ -13,6 +13,7 @@ import type { BinaryLike, CipherGCMTypes } from 'crypto';
|
|
|
13
13
|
import type { LookupAddress } from 'dns';
|
|
14
14
|
import type { BrotliOptions, ZlibOptions } from 'zlib';
|
|
15
15
|
|
|
16
|
+
import type { BackgroundColor as IBackgroundColor } from 'chalk';
|
|
16
17
|
// @ts-ignore
|
|
17
18
|
import type { Unit } from 'bytes';
|
|
18
19
|
// @ts-ignore
|
|
@@ -59,13 +60,13 @@ export interface ProcessModule<T = PlainObject> extends HandlerSettings<T> {
|
|
|
59
60
|
private?: boolean;
|
|
60
61
|
};
|
|
61
62
|
queue?: {
|
|
62
|
-
limit?:
|
|
63
|
-
expires?:
|
|
64
|
-
priority: { bypass?:
|
|
63
|
+
limit?: number | string;
|
|
64
|
+
expires?: number | string;
|
|
65
|
+
priority: { bypass?: number | string } & MinMax<number | string>;
|
|
65
66
|
};
|
|
66
|
-
limit?:
|
|
67
|
-
sub_limit?:
|
|
68
|
-
expires?:
|
|
67
|
+
limit?: number | string;
|
|
68
|
+
sub_limit?: number | string;
|
|
69
|
+
expires?: number | string;
|
|
69
70
|
};
|
|
70
71
|
cipher?: CipherConfig;
|
|
71
72
|
password?: string;
|
|
@@ -77,6 +78,7 @@ export interface ProcessEnvConfig {
|
|
|
77
78
|
|
|
78
79
|
export interface TempModule<T = PlainObject> extends HandlerSettings<T> {
|
|
79
80
|
dir?: string;
|
|
81
|
+
env?: string;
|
|
80
82
|
write?: boolean;
|
|
81
83
|
}
|
|
82
84
|
|
|
@@ -92,19 +94,20 @@ export interface PermissionSettings extends PlainObject {
|
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
export interface DownloadModule<T = PlainObject> extends HandlerSettings<T> {
|
|
95
|
-
expires?:
|
|
97
|
+
expires?: number | string;
|
|
96
98
|
aria2?: {
|
|
97
99
|
bin?: string | false;
|
|
98
100
|
exec?: ExecAction;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
check_integrity?: boolean;
|
|
102
|
+
update_status?: number | string | { interval?: number | string; broadcast_only?: boolean };
|
|
103
|
+
max_concurrent_downloads?: number | string;
|
|
104
|
+
max_connection_per_server?: number | string;
|
|
105
|
+
bt_stop_timeout?: number | string;
|
|
106
|
+
bt_tracker_connect_timeout?: number | string;
|
|
107
|
+
bt_tracker_timeout?: number | string;
|
|
105
108
|
min_split_size?: string;
|
|
106
|
-
disk_cache?:
|
|
107
|
-
lowest_speed_limit?:
|
|
109
|
+
disk_cache?: number | string;
|
|
110
|
+
lowest_speed_limit?: number | string;
|
|
108
111
|
always_resume?: boolean;
|
|
109
112
|
file_allocation?: "none" | "prealloc" | "trunc" | "falloc";
|
|
110
113
|
conf_path?: string;
|
|
@@ -144,13 +147,13 @@ export interface DocumentComponentOption<T = unknown> {
|
|
|
144
147
|
cache?: T;
|
|
145
148
|
coerce?: boolean;
|
|
146
149
|
abort?: boolean;
|
|
147
|
-
local_file?:
|
|
150
|
+
local_file?: number | string;
|
|
148
151
|
}
|
|
149
152
|
|
|
150
|
-
export interface DocumentSettings extends DocumentGroup, PurgeAction, ClientSettings<
|
|
151
|
-
imports_strict?: boolean;
|
|
153
|
+
export interface DocumentSettings<T extends DocumentUserSettings = DocumentUserSettings> extends DocumentGroup, PurgeAction, ClientSettings<T>, PlainObject {
|
|
152
154
|
directory?: DocumentDirectory;
|
|
153
155
|
options?: DocumentComponentOptions;
|
|
156
|
+
imports_strict?: boolean;
|
|
154
157
|
}
|
|
155
158
|
|
|
156
159
|
export interface DocumentDirectory extends StringMap {
|
|
@@ -172,7 +175,7 @@ export interface MemorySettings extends PlainObject {
|
|
|
172
175
|
cache_disk?: MemoryCacheDiskSettings;
|
|
173
176
|
}
|
|
174
177
|
|
|
175
|
-
export interface MemoryCacheDiskSettings<T =
|
|
178
|
+
export interface MemoryCacheDiskSettings<T = number | string> extends IncludeAction<Null<string[]>> {
|
|
176
179
|
enabled?: boolean;
|
|
177
180
|
min_size?: T;
|
|
178
181
|
max_size?: T;
|
|
@@ -189,12 +192,12 @@ export interface DbUserSettings extends DbSourceDataType<{ commands?: ObjectMap<
|
|
|
189
192
|
|
|
190
193
|
export interface DbCacheSettings extends TimeoutAction {
|
|
191
194
|
dir?: string;
|
|
192
|
-
purge?:
|
|
195
|
+
purge?: number | string;
|
|
193
196
|
when_empty?: boolean;
|
|
194
197
|
}
|
|
195
198
|
|
|
196
199
|
export interface DbSourceOptions {
|
|
197
|
-
pool?: PoolConfig<
|
|
200
|
+
pool?: PoolConfig<number | string>;
|
|
198
201
|
cache?: DbCacheValue;
|
|
199
202
|
coerce?: DbCoerceValue;
|
|
200
203
|
}
|
|
@@ -204,20 +207,20 @@ export interface DbCoerceSettings<T = boolean> {
|
|
|
204
207
|
options?: T;
|
|
205
208
|
}
|
|
206
209
|
|
|
207
|
-
export interface PurgeBase<T =
|
|
210
|
+
export interface PurgeBase<T = number | string> extends MinMax {
|
|
208
211
|
enabled?: boolean;
|
|
209
212
|
percent?: T;
|
|
210
213
|
limit?: number;
|
|
211
214
|
}
|
|
212
215
|
|
|
213
216
|
export interface PurgeComponent extends PurgeBase {
|
|
214
|
-
interval?:
|
|
217
|
+
interval?: number | string;
|
|
215
218
|
all?: boolean | number;
|
|
216
219
|
log?: boolean;
|
|
217
220
|
prefix?: string;
|
|
218
221
|
}
|
|
219
222
|
|
|
220
|
-
export type DbCacheValue =
|
|
223
|
+
export type DbCacheValue = number | string | DbCacheSettings;
|
|
221
224
|
export type DbCoerceValue = boolean | DbCoerceSettings;
|
|
222
225
|
export type DbSourceDataType<T = unknown> = {
|
|
223
226
|
[K in DbSource]?: T;
|
|
@@ -234,35 +237,42 @@ export interface ImageSettings extends PlainObject {
|
|
|
234
237
|
};
|
|
235
238
|
}
|
|
236
239
|
|
|
237
|
-
export interface RequestModule<T = RequestSettings> extends HandlerSettings<T
|
|
238
|
-
timeout?:
|
|
239
|
-
read_timeout?:
|
|
240
|
+
export interface RequestModule<T = RequestSettings> extends HandlerSettings<T>, HttpHostSettings {
|
|
241
|
+
timeout?: number | string;
|
|
242
|
+
read_timeout?: number | string;
|
|
240
243
|
agent?: {
|
|
241
244
|
keep_alive?: boolean;
|
|
242
|
-
timeout?:
|
|
245
|
+
timeout?: number | string;
|
|
243
246
|
};
|
|
244
247
|
disk?: HttpDiskSettings;
|
|
245
248
|
buffer?: HttpMemorySettings;
|
|
246
249
|
connect?: HttpConnectSettings;
|
|
247
250
|
dns?: DnsLookupSettings;
|
|
248
251
|
use?: {
|
|
249
|
-
http_version?:
|
|
252
|
+
http_version?: number | string;
|
|
250
253
|
accept_encoding?: boolean;
|
|
251
254
|
};
|
|
252
|
-
proxy?:
|
|
253
|
-
address?: string;
|
|
254
|
-
port?: NumString;
|
|
255
|
-
keep_alive?: boolean;
|
|
256
|
-
};
|
|
255
|
+
proxy?: HttpProxySettings;
|
|
257
256
|
headers?: HttpOutgoingHeaders;
|
|
258
257
|
certs?: ObjectMap<SecureConfig<ArrayOf<string>>>;
|
|
258
|
+
post_limit?: number | string;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export interface HttpProxySettings extends AuthValue, IncludeAction {
|
|
262
|
+
address?: string;
|
|
263
|
+
port?: number | string;
|
|
264
|
+
origin?: string;
|
|
265
|
+
keep_alive?: boolean;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface HttpHostSettings {
|
|
259
269
|
localhost?: string[];
|
|
260
270
|
protocol?: {
|
|
261
271
|
"http/1.1"?: string[];
|
|
262
272
|
h2c?: string[];
|
|
263
273
|
h2?: string[];
|
|
264
274
|
};
|
|
265
|
-
|
|
275
|
+
write_stream?: ObjectMap<number | string>;
|
|
266
276
|
}
|
|
267
277
|
|
|
268
278
|
export interface RequestSettings extends PurgeAction, PlainObject {
|
|
@@ -270,7 +280,7 @@ export interface RequestSettings extends PurgeAction, PlainObject {
|
|
|
270
280
|
}
|
|
271
281
|
|
|
272
282
|
export interface WatchModule<T = WatchSettings> extends HandlerModule<T>, ServerInfo {
|
|
273
|
-
interval?:
|
|
283
|
+
interval?: number | string;
|
|
274
284
|
}
|
|
275
285
|
|
|
276
286
|
export interface WatchSettings<T = WatchUserSettings> extends ClientSettings<ObjectMap<T>>, PlainObject {}
|
|
@@ -279,19 +289,15 @@ export interface CompressModule<U = CompressSettings> extends HandlerSettings<U>
|
|
|
279
289
|
gzip?: ZlibOptions;
|
|
280
290
|
brotli?: BrotliOptions;
|
|
281
291
|
zopfli?: ZopfliOptions;
|
|
282
|
-
tinify?: {
|
|
283
|
-
api_key?: string;
|
|
284
|
-
proxy?: string;
|
|
285
|
-
};
|
|
286
292
|
}
|
|
287
293
|
|
|
288
294
|
export interface CompressSettings extends PlainObject {
|
|
289
295
|
cache?: boolean;
|
|
290
|
-
cache_expires?:
|
|
291
|
-
gzip_level?:
|
|
292
|
-
brotli_quality?:
|
|
293
|
-
zopfli_iterations?:
|
|
294
|
-
chunk_size?:
|
|
296
|
+
cache_expires?: number | string;
|
|
297
|
+
gzip_level?: number | string;
|
|
298
|
+
brotli_quality?: number | string;
|
|
299
|
+
zopfli_iterations?: number | string;
|
|
300
|
+
chunk_size?: number | string;
|
|
295
301
|
}
|
|
296
302
|
|
|
297
303
|
export interface TaskModule<T = PlainObject> extends ClientModule<T>, PlainObject {}
|
|
@@ -319,14 +325,24 @@ export interface ErrorModule extends HandlerModule {
|
|
|
319
325
|
out?: string | ErrorOutMethod;
|
|
320
326
|
abort?: string[];
|
|
321
327
|
fatal?: boolean;
|
|
322
|
-
recursion_limit?:
|
|
328
|
+
recursion_limit?: number | string;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export interface LoggerProgress extends LoggerFormatColor {
|
|
332
|
+
scroll_buffer?: number | string;
|
|
333
|
+
max_width?: number | string;
|
|
334
|
+
use_color?: boolean;
|
|
335
|
+
text_wrap?: TextWrapStyle;
|
|
336
|
+
box_char?: string;
|
|
337
|
+
raw_mode?: boolean;
|
|
323
338
|
}
|
|
324
339
|
|
|
325
|
-
export interface LoggerModule<T =
|
|
340
|
+
export interface LoggerModule<T = number | string, U = boolean | T, V = LoggerFormat<T>> {
|
|
326
341
|
enabled?: boolean;
|
|
327
|
-
level?:
|
|
342
|
+
level?: number | string;
|
|
328
343
|
production?: string[];
|
|
329
344
|
format?: LoggerFormatSettings<V>;
|
|
345
|
+
progress?: LoggerProgress;
|
|
330
346
|
meter?: LoggerMeterSettings<T>;
|
|
331
347
|
broadcast?: BroadcastServer & { color?: boolean };
|
|
332
348
|
status?: boolean | LoggerStatus;
|
|
@@ -359,9 +375,10 @@ export interface LoggerFormatSettings<T = PlainObject> {
|
|
|
359
375
|
session_id?: T;
|
|
360
376
|
message?: T;
|
|
361
377
|
meter?: T;
|
|
378
|
+
error?: T;
|
|
362
379
|
}
|
|
363
380
|
|
|
364
|
-
export interface LoggerMeterSettings<T =
|
|
381
|
+
export interface LoggerMeterSettings<T = number | string> {
|
|
365
382
|
http?: T;
|
|
366
383
|
image?: T;
|
|
367
384
|
compress?: T;
|
|
@@ -371,52 +388,58 @@ export interface LoggerMeterSettings<T = NumString> {
|
|
|
371
388
|
export interface LoggerProcessSettings extends LoggerColor {
|
|
372
389
|
cpu?: boolean;
|
|
373
390
|
cpu_bar?: boolean | ArrayOf<number>;
|
|
391
|
+
cpu_bar_color?: [typeof IBackgroundColor, typeof IBackgroundColor, typeof IBackgroundColor];
|
|
374
392
|
cpu_single_core?: boolean;
|
|
375
393
|
mem?: boolean;
|
|
376
394
|
mem_format?: "%" | Unit;
|
|
377
395
|
}
|
|
378
396
|
|
|
379
|
-
export interface
|
|
380
|
-
width?: T;
|
|
397
|
+
export interface LoggerFormatColor {
|
|
381
398
|
color?: ForegroundColor;
|
|
382
399
|
bg_color?: BackgroundColor;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export interface LoggerFormat<T = number | string> extends LoggerFormatColor {
|
|
403
|
+
width?: T;
|
|
404
|
+
alt_color?: ForegroundColor;
|
|
383
405
|
bg_alt_color?: BackgroundColor;
|
|
384
406
|
bold?: boolean;
|
|
385
407
|
justify?: TextAlign;
|
|
386
408
|
unit?: string;
|
|
387
409
|
as?: StringMap;
|
|
410
|
+
braces?: string | TupleOf<string>;
|
|
388
411
|
}
|
|
389
412
|
|
|
390
413
|
export interface HttpSettings {
|
|
391
|
-
version?:
|
|
392
|
-
timeout?:
|
|
414
|
+
version?: number | string;
|
|
415
|
+
timeout?: number | string;
|
|
393
416
|
headers?: HttpOutgoingHeaders;
|
|
394
417
|
certs?: ObjectMap<SecureConfig<ArrayOf<string>>>;
|
|
395
418
|
}
|
|
396
419
|
|
|
397
420
|
export interface HttpDiskSettings extends IncludeAction {
|
|
398
421
|
enabled?: boolean;
|
|
399
|
-
limit?:
|
|
400
|
-
expires?:
|
|
422
|
+
limit?: number | string;
|
|
423
|
+
expires?: number | string;
|
|
401
424
|
}
|
|
402
425
|
|
|
403
426
|
export interface HttpMemorySettings extends HttpDiskSettings {
|
|
404
|
-
limit_all?:
|
|
405
|
-
to_disk?:
|
|
406
|
-
purge_amount?:
|
|
427
|
+
limit_all?: number | string;
|
|
428
|
+
to_disk?: number | string | [number | string, (number | string)?];
|
|
429
|
+
purge_amount?: number | string;
|
|
407
430
|
}
|
|
408
431
|
|
|
409
432
|
export interface HttpConnectSettings {
|
|
410
|
-
timeout?:
|
|
411
|
-
retry_wait?:
|
|
412
|
-
retry_after?:
|
|
413
|
-
retry_limit?:
|
|
414
|
-
redirect_limit?:
|
|
433
|
+
timeout?: number | string;
|
|
434
|
+
retry_wait?: number | string;
|
|
435
|
+
retry_after?: number | string;
|
|
436
|
+
retry_limit?: number | string;
|
|
437
|
+
redirect_limit?: number | string;
|
|
415
438
|
}
|
|
416
439
|
|
|
417
440
|
export interface DnsLookupSettings {
|
|
418
|
-
family?:
|
|
419
|
-
expires?:
|
|
441
|
+
family?: number | string;
|
|
442
|
+
expires?: number | string;
|
|
420
443
|
resolve?: ObjectMap<Partial<LookupAddress>>;
|
|
421
444
|
}
|
|
422
445
|
|
|
@@ -424,12 +447,12 @@ export interface HashConfig extends IncludeAction<ObjectMap<string[] | "*">> {
|
|
|
424
447
|
enabled?: boolean;
|
|
425
448
|
algorithm?: HashAlgorithm;
|
|
426
449
|
etag?: boolean;
|
|
427
|
-
expires?:
|
|
450
|
+
expires?: number | string;
|
|
428
451
|
renew?: boolean;
|
|
429
|
-
limit?:
|
|
452
|
+
limit?: number | string;
|
|
430
453
|
}
|
|
431
454
|
|
|
432
|
-
export interface BroadcastServer extends ServerInfo<ArrayOf<
|
|
455
|
+
export interface BroadcastServer extends ServerInfo<ArrayOf<number | string>> {
|
|
433
456
|
out?: string | BroadcastOutMethod;
|
|
434
457
|
}
|
|
435
458
|
|
|
@@ -457,7 +480,7 @@ export interface CipherConfig {
|
|
|
457
480
|
iv?: BinaryLike;
|
|
458
481
|
}
|
|
459
482
|
|
|
460
|
-
export interface ServerInfo<T =
|
|
483
|
+
export interface ServerInfo<T = number | string> extends ServerPort<T> {
|
|
461
484
|
enabled?: boolean;
|
|
462
485
|
secure?: SecureConfig & ServerPort<T>;
|
|
463
486
|
}
|
package/lib/squared.d.ts
CHANGED
|
@@ -23,18 +23,6 @@ interface BlobValue extends KeyValue<string, unknown> {
|
|
|
23
23
|
filename?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
interface BoxRect<T = number> {
|
|
27
|
-
top: T;
|
|
28
|
-
right: T;
|
|
29
|
-
bottom: T;
|
|
30
|
-
left: T;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface BoxRectDimension extends BoxRect, Dimension {
|
|
34
|
-
numberOfLines?: number;
|
|
35
|
-
overflow?: boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
26
|
export interface FileAsset extends TextAsset, OutputAction, DocumentAction, MultipartAction, ResourceAction, IncrementalAction, ChecksumAction {
|
|
39
27
|
format?: ArrayOf<string>;
|
|
40
28
|
dataView?: NodeJS.ArrayBufferView;
|
|
@@ -53,7 +41,7 @@ export interface DataSource<T = unknown> extends DocumentAction {
|
|
|
53
41
|
preRender?: string | FunctionType;
|
|
54
42
|
whenEmpty?: string | FunctionType;
|
|
55
43
|
removeEmpty?: boolean;
|
|
56
|
-
ignoreCache?:
|
|
44
|
+
ignoreCache?: IntBool | FirstOf<number, number>;
|
|
57
45
|
transactionState?: number;
|
|
58
46
|
transactionFail?: boolean;
|
|
59
47
|
}
|
|
@@ -66,6 +54,7 @@ export interface DbDataSource<T = unknown, U = unknown, V = unknown, W = unknown
|
|
|
66
54
|
update?: V;
|
|
67
55
|
withCommand?: string | TupleOf<string>;
|
|
68
56
|
parallel?: boolean;
|
|
57
|
+
flat?: number;
|
|
69
58
|
willAbort?: boolean;
|
|
70
59
|
streamRow?: Null<boolean | string | ((row: unknown) => Void<Error | false>)>;
|
|
71
60
|
usePool?: boolean | X;
|
|
@@ -91,7 +80,7 @@ export interface WatchAction {
|
|
|
91
80
|
}
|
|
92
81
|
|
|
93
82
|
export interface BundleAction<T = unknown> {
|
|
94
|
-
bundleId?:
|
|
83
|
+
bundleId?: number | string;
|
|
95
84
|
bundleIndex?: number;
|
|
96
85
|
bundleReplace?: T;
|
|
97
86
|
bundleQueue?: Promise<unknown>[];
|
|
@@ -225,7 +214,7 @@ export interface CompressFormat extends CompressLevel {
|
|
|
225
214
|
condition?: string;
|
|
226
215
|
plugin?: string;
|
|
227
216
|
timeout?: number;
|
|
228
|
-
options?: PlainObject
|
|
217
|
+
options?: PlainObject;
|
|
229
218
|
}
|
|
230
219
|
|
|
231
220
|
export interface WatchInterval<T = FileAsset> extends TaskBase {
|
|
@@ -268,7 +257,7 @@ export interface BroadcastResponse extends WebSocketResponse {
|
|
|
268
257
|
|
|
269
258
|
export interface FileInfo {
|
|
270
259
|
name: string;
|
|
271
|
-
size:
|
|
260
|
+
size: number | string;
|
|
272
261
|
}
|
|
273
262
|
|
|
274
263
|
export interface RequestBase<T = PlainObject> {
|
|
@@ -322,32 +311,7 @@ export interface ResponseError {
|
|
|
322
311
|
|
|
323
312
|
export interface RequestObserve extends WebSocketClient {
|
|
324
313
|
action?: string;
|
|
325
|
-
expires?:
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
export interface FinalizedElement {
|
|
329
|
-
documentId: string;
|
|
330
|
-
bounds: BoxRectDimension;
|
|
331
|
-
css: PlainObject;
|
|
332
|
-
outerWrapperIds?: string[];
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
export interface ConditionProperty {
|
|
336
|
-
conditionText: string;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
export interface CssConditionData extends ConditionProperty {
|
|
340
|
-
name?: string;
|
|
341
|
-
conditionText: string;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
export interface ControllerSettingsDirectoryUI {
|
|
345
|
-
layout: string;
|
|
346
|
-
string: string;
|
|
347
|
-
font: string;
|
|
348
|
-
image: string;
|
|
349
|
-
video: string;
|
|
350
|
-
audio: string;
|
|
314
|
+
expires?: number | string;
|
|
351
315
|
}
|
|
352
316
|
|
|
353
317
|
export interface ChecksumBase<T = BinaryToTextEncoding> {
|
|
@@ -363,9 +327,9 @@ export interface ChecksumOutput<T = BinaryToTextEncoding> extends ChecksumBase<T
|
|
|
363
327
|
}
|
|
364
328
|
|
|
365
329
|
export interface TaskBase {
|
|
366
|
-
interval?:
|
|
367
|
-
start?:
|
|
368
|
-
expires?:
|
|
330
|
+
interval?: number | string;
|
|
331
|
+
start?: number | string;
|
|
332
|
+
expires?: number | string;
|
|
369
333
|
}
|
|
370
334
|
|
|
371
335
|
export type WebSocketEvent = "close" | "error";
|