@e-mc/types 0.10.6 → 0.11.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/LICENSE +1 -1
- package/README.md +12 -10
- package/constant.d.ts +39 -10
- package/index.d.ts +35 -20
- package/index.js +86 -114
- package/lib/asset.d.ts +3 -3
- package/lib/cloud.d.ts +11 -4
- package/lib/compress.d.ts +12 -11
- package/lib/core.d.ts +31 -30
- package/lib/db.d.ts +20 -17
- package/lib/document.d.ts +17 -16
- package/lib/filemanager.d.ts +12 -11
- package/lib/http.d.ts +7 -6
- package/lib/image.d.ts +53 -43
- package/lib/index.d.ts +195 -170
- package/lib/logger.d.ts +7 -2
- package/lib/module.d.ts +31 -44
- package/lib/node.d.ts +9 -3
- package/lib/object.d.ts +1 -3
- package/lib/request.d.ts +96 -24
- package/lib/settings.d.ts +126 -90
- package/lib/squared.d.ts +26 -57
- package/lib/type.d.ts +11 -6
- package/lib/watch.d.ts +5 -5
- package/package.json +4 -3
- package/lib/compat-v4.d.ts +0 -116
package/lib/settings.d.ts
CHANGED
|
@@ -4,15 +4,15 @@ import type { HashAlgorithm } from './asset';
|
|
|
4
4
|
import type { CloudSource } from './cloud';
|
|
5
5
|
import type { PermissionAction, PermissionReadWrite, PermittedDirectories } from './core';
|
|
6
6
|
import type { DbSource, TimeoutAction } from './db';
|
|
7
|
-
import type { HttpOutgoingHeaders, SecureConfig, ServerPort } from './http';
|
|
8
|
-
import type { BackgroundColor, BroadcastOutMethod, ErrorOutMethod, ForegroundColor, LoggerColor, LoggerStatus, TextAlign } from './logger';
|
|
7
|
+
import type { AuthValue, HttpOutgoingHeaders, SecureConfig, ServerPort } from './http';
|
|
8
|
+
import type { BackgroundColor, BroadcastOutMethod, ErrorOutMethod, ForegroundColor, LoggerColor, LoggerStatus, TextAlign, TextWrapStyle } from './logger';
|
|
9
9
|
import type { ExecAction, IncludeAction } from './module';
|
|
10
10
|
|
|
11
|
-
import type { SpawnOptions } from 'child_process';
|
|
12
|
-
import type { BinaryLike, CipherGCMTypes } from 'crypto';
|
|
13
|
-
import type { LookupAddress } from 'dns';
|
|
14
|
-
import type { BrotliOptions, ZlibOptions } from 'zlib';
|
|
15
|
-
|
|
11
|
+
import type { SpawnOptions } from 'node:child_process';
|
|
12
|
+
import type { BinaryLike, CipherGCMTypes } from 'node:crypto';
|
|
13
|
+
import type { LookupAddress } from 'node:dns';
|
|
14
|
+
import type { BrotliOptions, ZlibOptions } from 'node:zlib';
|
|
15
|
+
import type { BackgroundColor as IBackgroundColor } from 'chalk';
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
import type { Unit } from 'bytes';
|
|
18
18
|
// @ts-ignore
|
|
@@ -22,13 +22,18 @@ import type { Options as ZopfliOptions } from 'node-zopfli';
|
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
import type { PicomatchOptions } from 'picomatch';
|
|
24
24
|
|
|
25
|
+
interface MinMax<T = number> {
|
|
26
|
+
min?: T;
|
|
27
|
+
max?: T;
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
export interface HandlerModule<T = PlainObject> extends HandlerSettings<T> {
|
|
26
31
|
handler?: string;
|
|
27
32
|
extensions?: string[];
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
export interface HandlerSettings<T = PlainObject> {
|
|
31
|
-
settings?: T & { broadcast_id?:
|
|
36
|
+
settings?: T & { broadcast_id?: string | string[] };
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
export interface ClientModule<T = ClientSettings> extends HandlerModule<T>, PermissionAction {}
|
|
@@ -38,19 +43,23 @@ export interface ClientSettings<T = PlainObject> extends PlainObject {
|
|
|
38
43
|
cache_dir?: string;
|
|
39
44
|
}
|
|
40
45
|
|
|
41
|
-
export interface NodeModule<T =
|
|
46
|
+
export interface NodeModule<T = NodeSettings> extends HandlerSettings<T> {
|
|
42
47
|
process?: {
|
|
43
48
|
cpu_usage?: boolean;
|
|
44
49
|
memory_usage?: boolean;
|
|
45
50
|
inline?: boolean;
|
|
46
51
|
};
|
|
47
52
|
require?: {
|
|
48
|
-
ext?:
|
|
53
|
+
ext?: string | string[] | boolean;
|
|
49
54
|
npm?: boolean;
|
|
50
55
|
inline?: boolean;
|
|
51
56
|
};
|
|
52
57
|
}
|
|
53
58
|
|
|
59
|
+
export interface NodeSettings extends PlainObject {
|
|
60
|
+
package_manager?: "npm" | "yarn" | "pnpm";
|
|
61
|
+
}
|
|
62
|
+
|
|
54
63
|
export interface ProcessModule<T = PlainObject> extends HandlerSettings<T> {
|
|
55
64
|
env?: ProcessEnvConfig;
|
|
56
65
|
thread?: {
|
|
@@ -59,13 +68,13 @@ export interface ProcessModule<T = PlainObject> extends HandlerSettings<T> {
|
|
|
59
68
|
private?: boolean;
|
|
60
69
|
};
|
|
61
70
|
queue?: {
|
|
62
|
-
limit?:
|
|
63
|
-
expires?:
|
|
64
|
-
priority: { bypass?:
|
|
71
|
+
limit?: number | string;
|
|
72
|
+
expires?: number | string;
|
|
73
|
+
priority: { bypass?: number | string } & MinMax<number | string>;
|
|
65
74
|
};
|
|
66
|
-
limit?:
|
|
67
|
-
sub_limit?:
|
|
68
|
-
expires?:
|
|
75
|
+
limit?: number | string;
|
|
76
|
+
sub_limit?: number | string;
|
|
77
|
+
expires?: number | string;
|
|
69
78
|
};
|
|
70
79
|
cipher?: CipherConfig;
|
|
71
80
|
password?: string;
|
|
@@ -77,34 +86,37 @@ export interface ProcessEnvConfig {
|
|
|
77
86
|
|
|
78
87
|
export interface TempModule<T = PlainObject> extends HandlerSettings<T> {
|
|
79
88
|
dir?: string;
|
|
89
|
+
env?: string;
|
|
90
|
+
os?: boolean;
|
|
80
91
|
write?: boolean;
|
|
81
92
|
}
|
|
82
93
|
|
|
83
94
|
export interface PermissionModule<T = PermissionSettings> extends PermittedDirectories, HandlerSettings<T> {
|
|
84
95
|
home_read?: boolean;
|
|
85
96
|
home_write?: boolean;
|
|
86
|
-
process_exec?:
|
|
97
|
+
process_exec?: Array<string | ExecOptions>;
|
|
87
98
|
}
|
|
88
99
|
|
|
89
100
|
export interface PermissionSettings extends PlainObject {
|
|
90
|
-
picomatch?:
|
|
91
|
-
minimatch?:
|
|
101
|
+
picomatch?: PicomatchOptions | null;
|
|
102
|
+
minimatch?: MinimatchOptions | null;
|
|
92
103
|
}
|
|
93
104
|
|
|
94
105
|
export interface DownloadModule<T = PlainObject> extends HandlerSettings<T> {
|
|
95
|
-
expires?:
|
|
106
|
+
expires?: number | string;
|
|
96
107
|
aria2?: {
|
|
97
108
|
bin?: string | false;
|
|
98
109
|
exec?: ExecAction;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
check_integrity?: boolean;
|
|
111
|
+
update_status?: number | string | { interval?: number | string; broadcast_only?: boolean };
|
|
112
|
+
max_concurrent_downloads?: number | string;
|
|
113
|
+
max_connection_per_server?: number | string;
|
|
114
|
+
bt_stop_timeout?: number | string;
|
|
115
|
+
bt_tracker_connect_timeout?: number | string;
|
|
116
|
+
bt_tracker_timeout?: number | string;
|
|
105
117
|
min_split_size?: string;
|
|
106
|
-
disk_cache?:
|
|
107
|
-
lowest_speed_limit?:
|
|
118
|
+
disk_cache?: number | string;
|
|
119
|
+
lowest_speed_limit?: number | string;
|
|
108
120
|
always_resume?: boolean;
|
|
109
121
|
file_allocation?: "none" | "prealloc" | "trunc" | "falloc";
|
|
110
122
|
conf_path?: string;
|
|
@@ -132,7 +144,7 @@ export interface DocumentGroup<T = { imports?: StringMap } & AnyObject, U = AnyO
|
|
|
132
144
|
}
|
|
133
145
|
|
|
134
146
|
export interface DocumentUserSettings<T = AnyObject, U = T> extends DocumentGroup<T, U>, PlainObject {
|
|
135
|
-
extensions?:
|
|
147
|
+
extensions?: string[] | null;
|
|
136
148
|
imports_strict?: boolean;
|
|
137
149
|
}
|
|
138
150
|
|
|
@@ -144,13 +156,13 @@ export interface DocumentComponentOption<T = unknown> {
|
|
|
144
156
|
cache?: T;
|
|
145
157
|
coerce?: boolean;
|
|
146
158
|
abort?: boolean;
|
|
147
|
-
local_file?:
|
|
159
|
+
local_file?: number | string;
|
|
148
160
|
}
|
|
149
161
|
|
|
150
|
-
export interface DocumentSettings extends DocumentGroup, PurgeAction, ClientSettings<
|
|
151
|
-
imports_strict?: boolean;
|
|
162
|
+
export interface DocumentSettings<T extends DocumentUserSettings = DocumentUserSettings> extends DocumentGroup, PurgeAction, ClientSettings<T>, PlainObject {
|
|
152
163
|
directory?: DocumentDirectory;
|
|
153
164
|
options?: DocumentComponentOptions;
|
|
165
|
+
imports_strict?: boolean;
|
|
154
166
|
}
|
|
155
167
|
|
|
156
168
|
export interface DocumentDirectory extends StringMap {
|
|
@@ -165,14 +177,14 @@ export interface ClientDbSettings<T = PlainObject> extends ClientSettings<T>, Pu
|
|
|
165
177
|
imports?: StringMap;
|
|
166
178
|
}
|
|
167
179
|
|
|
168
|
-
export interface MemoryModule<T = MemorySettings> extends HandlerSettings<T>, Record<string,
|
|
180
|
+
export interface MemoryModule<T = MemorySettings> extends HandlerSettings<T>, Record<string, T | ObjectMap<PurgeBase> | undefined> {}
|
|
169
181
|
|
|
170
182
|
export interface MemorySettings extends PlainObject {
|
|
171
183
|
users?: boolean | string[];
|
|
172
184
|
cache_disk?: MemoryCacheDiskSettings;
|
|
173
185
|
}
|
|
174
186
|
|
|
175
|
-
export interface MemoryCacheDiskSettings<T =
|
|
187
|
+
export interface MemoryCacheDiskSettings<T = number | string> extends IncludeAction<string[] | null> {
|
|
176
188
|
enabled?: boolean;
|
|
177
189
|
min_size?: T;
|
|
178
190
|
max_size?: T;
|
|
@@ -189,12 +201,12 @@ export interface DbUserSettings extends DbSourceDataType<{ commands?: ObjectMap<
|
|
|
189
201
|
|
|
190
202
|
export interface DbCacheSettings extends TimeoutAction {
|
|
191
203
|
dir?: string;
|
|
192
|
-
purge?:
|
|
204
|
+
purge?: number | string;
|
|
193
205
|
when_empty?: boolean;
|
|
194
206
|
}
|
|
195
207
|
|
|
196
208
|
export interface DbSourceOptions {
|
|
197
|
-
pool?: PoolConfig<
|
|
209
|
+
pool?: PoolConfig<number | string>;
|
|
198
210
|
cache?: DbCacheValue;
|
|
199
211
|
coerce?: DbCoerceValue;
|
|
200
212
|
}
|
|
@@ -204,20 +216,20 @@ export interface DbCoerceSettings<T = boolean> {
|
|
|
204
216
|
options?: T;
|
|
205
217
|
}
|
|
206
218
|
|
|
207
|
-
export interface PurgeBase<T =
|
|
219
|
+
export interface PurgeBase<T = number | string> extends MinMax {
|
|
208
220
|
enabled?: boolean;
|
|
209
221
|
percent?: T;
|
|
210
222
|
limit?: number;
|
|
211
223
|
}
|
|
212
224
|
|
|
213
225
|
export interface PurgeComponent extends PurgeBase {
|
|
214
|
-
interval?:
|
|
226
|
+
interval?: number | string;
|
|
215
227
|
all?: boolean | number;
|
|
216
228
|
log?: boolean;
|
|
217
229
|
prefix?: string;
|
|
218
230
|
}
|
|
219
231
|
|
|
220
|
-
export type DbCacheValue =
|
|
232
|
+
export type DbCacheValue = number | string | DbCacheSettings;
|
|
221
233
|
export type DbCoerceValue = boolean | DbCoerceSettings;
|
|
222
234
|
export type DbSourceDataType<T = unknown> = {
|
|
223
235
|
[K in DbSource]?: T;
|
|
@@ -234,35 +246,42 @@ export interface ImageSettings extends PlainObject {
|
|
|
234
246
|
};
|
|
235
247
|
}
|
|
236
248
|
|
|
237
|
-
export interface RequestModule<T = RequestSettings> extends HandlerSettings<T
|
|
238
|
-
timeout?:
|
|
239
|
-
read_timeout?:
|
|
249
|
+
export interface RequestModule<T = RequestSettings> extends HandlerSettings<T>, HttpHostSettings {
|
|
250
|
+
timeout?: number | string;
|
|
251
|
+
read_timeout?: number | string;
|
|
240
252
|
agent?: {
|
|
241
253
|
keep_alive?: boolean;
|
|
242
|
-
timeout?:
|
|
254
|
+
timeout?: number | string;
|
|
243
255
|
};
|
|
244
256
|
disk?: HttpDiskSettings;
|
|
245
257
|
buffer?: HttpMemorySettings;
|
|
246
258
|
connect?: HttpConnectSettings;
|
|
247
259
|
dns?: DnsLookupSettings;
|
|
248
260
|
use?: {
|
|
249
|
-
http_version?:
|
|
261
|
+
http_version?: number | string;
|
|
250
262
|
accept_encoding?: boolean;
|
|
251
263
|
};
|
|
252
|
-
proxy?:
|
|
253
|
-
address?: string;
|
|
254
|
-
port?: NumString;
|
|
255
|
-
keep_alive?: boolean;
|
|
256
|
-
};
|
|
264
|
+
proxy?: HttpProxySettings;
|
|
257
265
|
headers?: HttpOutgoingHeaders;
|
|
258
|
-
certs?: ObjectMap<SecureConfig<
|
|
266
|
+
certs?: ObjectMap<SecureConfig<string | string[]>>;
|
|
267
|
+
post_limit?: number | string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface HttpProxySettings extends AuthValue, IncludeAction {
|
|
271
|
+
address?: string;
|
|
272
|
+
port?: number | string;
|
|
273
|
+
origin?: string;
|
|
274
|
+
keep_alive?: boolean;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface HttpHostSettings {
|
|
259
278
|
localhost?: string[];
|
|
260
279
|
protocol?: {
|
|
261
280
|
"http/1.1"?: string[];
|
|
262
281
|
h2c?: string[];
|
|
263
282
|
h2?: string[];
|
|
264
283
|
};
|
|
265
|
-
|
|
284
|
+
write_stream?: ObjectMap<number | string>;
|
|
266
285
|
}
|
|
267
286
|
|
|
268
287
|
export interface RequestSettings extends PurgeAction, PlainObject {
|
|
@@ -270,7 +289,7 @@ export interface RequestSettings extends PurgeAction, PlainObject {
|
|
|
270
289
|
}
|
|
271
290
|
|
|
272
291
|
export interface WatchModule<T = WatchSettings> extends HandlerModule<T>, ServerInfo {
|
|
273
|
-
interval?:
|
|
292
|
+
interval?: number | string;
|
|
274
293
|
}
|
|
275
294
|
|
|
276
295
|
export interface WatchSettings<T = WatchUserSettings> extends ClientSettings<ObjectMap<T>>, PlainObject {}
|
|
@@ -279,19 +298,15 @@ export interface CompressModule<U = CompressSettings> extends HandlerSettings<U>
|
|
|
279
298
|
gzip?: ZlibOptions;
|
|
280
299
|
brotli?: BrotliOptions;
|
|
281
300
|
zopfli?: ZopfliOptions;
|
|
282
|
-
tinify?: {
|
|
283
|
-
api_key?: string;
|
|
284
|
-
proxy?: string;
|
|
285
|
-
};
|
|
286
301
|
}
|
|
287
302
|
|
|
288
303
|
export interface CompressSettings extends PlainObject {
|
|
289
304
|
cache?: boolean;
|
|
290
|
-
cache_expires?:
|
|
291
|
-
gzip_level?:
|
|
292
|
-
brotli_quality?:
|
|
293
|
-
zopfli_iterations?:
|
|
294
|
-
chunk_size?:
|
|
305
|
+
cache_expires?: number | string;
|
|
306
|
+
gzip_level?: number | string;
|
|
307
|
+
brotli_quality?: number | string;
|
|
308
|
+
zopfli_iterations?: number | string;
|
|
309
|
+
chunk_size?: number | string;
|
|
295
310
|
}
|
|
296
311
|
|
|
297
312
|
export interface TaskModule<T = PlainObject> extends ClientModule<T>, PlainObject {}
|
|
@@ -315,18 +330,32 @@ export interface CloudAuthSettings {
|
|
|
315
330
|
database?: boolean;
|
|
316
331
|
}
|
|
317
332
|
|
|
318
|
-
export interface ErrorModule extends HandlerModule {
|
|
333
|
+
export interface ErrorModule<T = ErrorSettings> extends HandlerModule<T> {
|
|
319
334
|
out?: string | ErrorOutMethod;
|
|
320
335
|
abort?: string[];
|
|
321
336
|
fatal?: boolean;
|
|
322
|
-
recursion_limit?:
|
|
337
|
+
recursion_limit?: number | string;
|
|
323
338
|
}
|
|
324
339
|
|
|
325
|
-
export interface
|
|
340
|
+
export interface ErrorSettings extends PlainObject {
|
|
341
|
+
trap_exceptions?: boolean;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface LoggerProgress extends LoggerFormatColor {
|
|
345
|
+
scroll_buffer?: number | string;
|
|
346
|
+
max_width?: number | string;
|
|
347
|
+
use_color?: boolean;
|
|
348
|
+
text_wrap?: TextWrapStyle;
|
|
349
|
+
box_char?: string;
|
|
350
|
+
raw_mode?: boolean;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export interface LoggerModule<T = number | string, U = boolean | T, V = LoggerFormat<T>> {
|
|
326
354
|
enabled?: boolean;
|
|
327
|
-
level?:
|
|
355
|
+
level?: number | string;
|
|
328
356
|
production?: string[];
|
|
329
357
|
format?: LoggerFormatSettings<V>;
|
|
358
|
+
progress?: LoggerProgress;
|
|
330
359
|
meter?: LoggerMeterSettings<T>;
|
|
331
360
|
broadcast?: BroadcastServer & { color?: boolean };
|
|
332
361
|
status?: boolean | LoggerStatus;
|
|
@@ -359,9 +388,10 @@ export interface LoggerFormatSettings<T = PlainObject> {
|
|
|
359
388
|
session_id?: T;
|
|
360
389
|
message?: T;
|
|
361
390
|
meter?: T;
|
|
391
|
+
error?: T;
|
|
362
392
|
}
|
|
363
393
|
|
|
364
|
-
export interface LoggerMeterSettings<T =
|
|
394
|
+
export interface LoggerMeterSettings<T = number | string> {
|
|
365
395
|
http?: T;
|
|
366
396
|
image?: T;
|
|
367
397
|
compress?: T;
|
|
@@ -370,53 +400,59 @@ export interface LoggerMeterSettings<T = NumString> {
|
|
|
370
400
|
|
|
371
401
|
export interface LoggerProcessSettings extends LoggerColor {
|
|
372
402
|
cpu?: boolean;
|
|
373
|
-
cpu_bar?: boolean |
|
|
403
|
+
cpu_bar?: boolean | number | number[];
|
|
404
|
+
cpu_bar_color?: [typeof IBackgroundColor, typeof IBackgroundColor, typeof IBackgroundColor];
|
|
374
405
|
cpu_single_core?: boolean;
|
|
375
406
|
mem?: boolean;
|
|
376
407
|
mem_format?: "%" | Unit;
|
|
377
408
|
}
|
|
378
409
|
|
|
379
|
-
export interface
|
|
380
|
-
width?: T;
|
|
410
|
+
export interface LoggerFormatColor {
|
|
381
411
|
color?: ForegroundColor;
|
|
382
412
|
bg_color?: BackgroundColor;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export interface LoggerFormat<T = number | string> extends LoggerFormatColor {
|
|
416
|
+
width?: T;
|
|
417
|
+
alt_color?: ForegroundColor;
|
|
383
418
|
bg_alt_color?: BackgroundColor;
|
|
384
419
|
bold?: boolean;
|
|
385
420
|
justify?: TextAlign;
|
|
386
421
|
unit?: string;
|
|
387
422
|
as?: StringMap;
|
|
423
|
+
braces?: string | [string, string];
|
|
388
424
|
}
|
|
389
425
|
|
|
390
426
|
export interface HttpSettings {
|
|
391
|
-
version?:
|
|
392
|
-
timeout?:
|
|
427
|
+
version?: number | string;
|
|
428
|
+
timeout?: number | string;
|
|
393
429
|
headers?: HttpOutgoingHeaders;
|
|
394
|
-
certs?: ObjectMap<SecureConfig<
|
|
430
|
+
certs?: ObjectMap<SecureConfig<string | string[]>>;
|
|
395
431
|
}
|
|
396
432
|
|
|
397
433
|
export interface HttpDiskSettings extends IncludeAction {
|
|
398
434
|
enabled?: boolean;
|
|
399
|
-
limit?:
|
|
400
|
-
expires?:
|
|
435
|
+
limit?: number | string;
|
|
436
|
+
expires?: number | string;
|
|
401
437
|
}
|
|
402
438
|
|
|
403
439
|
export interface HttpMemorySettings extends HttpDiskSettings {
|
|
404
|
-
limit_all?:
|
|
405
|
-
to_disk?:
|
|
406
|
-
purge_amount?:
|
|
440
|
+
limit_all?: number | string;
|
|
441
|
+
to_disk?: number | string | [number | string, (number | string)?];
|
|
442
|
+
purge_amount?: number | string;
|
|
407
443
|
}
|
|
408
444
|
|
|
409
445
|
export interface HttpConnectSettings {
|
|
410
|
-
timeout?:
|
|
411
|
-
retry_wait?:
|
|
412
|
-
retry_after?:
|
|
413
|
-
retry_limit?:
|
|
414
|
-
redirect_limit?:
|
|
446
|
+
timeout?: number | string;
|
|
447
|
+
retry_wait?: number | string;
|
|
448
|
+
retry_after?: number | string;
|
|
449
|
+
retry_limit?: number | string;
|
|
450
|
+
redirect_limit?: number | string;
|
|
415
451
|
}
|
|
416
452
|
|
|
417
453
|
export interface DnsLookupSettings {
|
|
418
|
-
family?:
|
|
419
|
-
expires?:
|
|
454
|
+
family?: number | string;
|
|
455
|
+
expires?: number | string;
|
|
420
456
|
resolve?: ObjectMap<Partial<LookupAddress>>;
|
|
421
457
|
}
|
|
422
458
|
|
|
@@ -424,18 +460,18 @@ export interface HashConfig extends IncludeAction<ObjectMap<string[] | "*">> {
|
|
|
424
460
|
enabled?: boolean;
|
|
425
461
|
algorithm?: HashAlgorithm;
|
|
426
462
|
etag?: boolean;
|
|
427
|
-
expires?:
|
|
463
|
+
expires?: number | string;
|
|
428
464
|
renew?: boolean;
|
|
429
|
-
limit?:
|
|
465
|
+
limit?: number | string;
|
|
430
466
|
}
|
|
431
467
|
|
|
432
|
-
export interface BroadcastServer extends ServerInfo<ArrayOf<
|
|
468
|
+
export interface BroadcastServer extends ServerInfo<ArrayOf<number | string>> {
|
|
433
469
|
out?: string | BroadcastOutMethod;
|
|
434
470
|
}
|
|
435
471
|
|
|
436
472
|
export interface ExecOptions extends SpawnOptions {
|
|
437
473
|
command?: string;
|
|
438
|
-
warn?:
|
|
474
|
+
warn?: string | string[];
|
|
439
475
|
}
|
|
440
476
|
|
|
441
477
|
export interface PurgeAction {
|
|
@@ -457,12 +493,12 @@ export interface CipherConfig {
|
|
|
457
493
|
iv?: BinaryLike;
|
|
458
494
|
}
|
|
459
495
|
|
|
460
|
-
export interface ServerInfo<T =
|
|
496
|
+
export interface ServerInfo<T = number | string> extends ServerPort<T> {
|
|
461
497
|
enabled?: boolean;
|
|
462
498
|
secure?: SecureConfig & ServerPort<T>;
|
|
463
499
|
}
|
|
464
500
|
|
|
465
501
|
export type WatchUserSettings = ObjectMap<WatchInterval>;
|
|
466
|
-
export type DocumentTransform =
|
|
502
|
+
export type DocumentTransform = boolean | "etag" | HashAlgorithm | HashConfig | null;
|
|
467
503
|
|
|
468
504
|
export type { ExecAction, PermissionReadWrite, SecureConfig };
|
package/lib/squared.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference path="type.d.ts" />
|
|
2
|
-
/// <reference path="object.d.ts" />
|
|
3
2
|
|
|
4
|
-
import type { BinaryToTextEncoding } from "crypto";
|
|
3
|
+
import type { BinaryToTextEncoding } from "node:crypto";
|
|
5
4
|
|
|
6
5
|
interface Asset extends MimeTypeAction {
|
|
7
6
|
uri?: string;
|
|
@@ -23,20 +22,13 @@ interface BlobValue extends KeyValue<string, unknown> {
|
|
|
23
22
|
filename?: string;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
interface
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
bottom: T;
|
|
30
|
-
left: T;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface BoxRectDimension extends BoxRect, Dimension {
|
|
34
|
-
numberOfLines?: number;
|
|
35
|
-
overflow?: boolean;
|
|
25
|
+
export interface KeyValue<T, out U> {
|
|
26
|
+
key: T;
|
|
27
|
+
value: U;
|
|
36
28
|
}
|
|
37
29
|
|
|
38
30
|
export interface FileAsset extends TextAsset, OutputAction, DocumentAction, MultipartAction, ResourceAction, IncrementalAction, ChecksumAction {
|
|
39
|
-
format?:
|
|
31
|
+
format?: string | string[];
|
|
40
32
|
dataView?: NodeJS.ArrayBufferView;
|
|
41
33
|
base64?: string;
|
|
42
34
|
imported?: boolean | string[];
|
|
@@ -53,7 +45,7 @@ export interface DataSource<T = unknown> extends DocumentAction {
|
|
|
53
45
|
preRender?: string | FunctionType;
|
|
54
46
|
whenEmpty?: string | FunctionType;
|
|
55
47
|
removeEmpty?: boolean;
|
|
56
|
-
ignoreCache?:
|
|
48
|
+
ignoreCache?: IntBool | FirstOf<number, number>;
|
|
57
49
|
transactionState?: number;
|
|
58
50
|
transactionFail?: boolean;
|
|
59
51
|
}
|
|
@@ -64,10 +56,11 @@ export interface DbDataSource<T = unknown, U = unknown, V = unknown, W = unknown
|
|
|
64
56
|
credential?: string | W;
|
|
65
57
|
options?: U;
|
|
66
58
|
update?: V;
|
|
67
|
-
withCommand?: string |
|
|
59
|
+
withCommand?: string | [string, string];
|
|
68
60
|
parallel?: boolean;
|
|
61
|
+
flat?: number;
|
|
69
62
|
willAbort?: boolean;
|
|
70
|
-
streamRow?:
|
|
63
|
+
streamRow?: boolean | string | ((row: unknown) => Error | false | void) | null;
|
|
71
64
|
usePool?: boolean | X;
|
|
72
65
|
}
|
|
73
66
|
|
|
@@ -91,11 +84,11 @@ export interface WatchAction {
|
|
|
91
84
|
}
|
|
92
85
|
|
|
93
86
|
export interface BundleAction<T = unknown> {
|
|
94
|
-
bundleId?:
|
|
87
|
+
bundleId?: number | string;
|
|
95
88
|
bundleIndex?: number;
|
|
96
89
|
bundleReplace?: T;
|
|
97
90
|
bundleQueue?: Promise<unknown>[];
|
|
98
|
-
trailingContent?:
|
|
91
|
+
trailingContent?: string | string[];
|
|
99
92
|
exported?: boolean;
|
|
100
93
|
}
|
|
101
94
|
|
|
@@ -105,7 +98,7 @@ export interface ChecksumAction {
|
|
|
105
98
|
}
|
|
106
99
|
|
|
107
100
|
export interface DocumentAction {
|
|
108
|
-
document?:
|
|
101
|
+
document?: string | string[];
|
|
109
102
|
encoding?: BufferEncoding;
|
|
110
103
|
}
|
|
111
104
|
|
|
@@ -208,6 +201,7 @@ export interface ViewEngine {
|
|
|
208
201
|
name?: string;
|
|
209
202
|
singleRow?: boolean;
|
|
210
203
|
outputEmpty?: boolean;
|
|
204
|
+
expires?: number | string;
|
|
211
205
|
options?: {
|
|
212
206
|
compile?: PlainObject;
|
|
213
207
|
output?: PlainObject;
|
|
@@ -225,7 +219,7 @@ export interface CompressFormat extends CompressLevel {
|
|
|
225
219
|
condition?: string;
|
|
226
220
|
plugin?: string;
|
|
227
221
|
timeout?: number;
|
|
228
|
-
options?: PlainObject
|
|
222
|
+
options?: PlainObject;
|
|
229
223
|
}
|
|
230
224
|
|
|
231
225
|
export interface WatchInterval<T = FileAsset> extends TaskBase {
|
|
@@ -242,7 +236,7 @@ export interface WatchReload extends WebSocketClient {
|
|
|
242
236
|
|
|
243
237
|
export interface WebSocketResponse {
|
|
244
238
|
event?: string;
|
|
245
|
-
socketId?:
|
|
239
|
+
socketId?: string | string[];
|
|
246
240
|
type?: string;
|
|
247
241
|
encoding?: BufferEncoding;
|
|
248
242
|
value?: unknown;
|
|
@@ -268,17 +262,17 @@ export interface BroadcastResponse extends WebSocketResponse {
|
|
|
268
262
|
|
|
269
263
|
export interface FileInfo {
|
|
270
264
|
name: string;
|
|
271
|
-
size:
|
|
265
|
+
size: number | string;
|
|
272
266
|
}
|
|
273
267
|
|
|
274
268
|
export interface RequestBase<T = PlainObject> {
|
|
275
269
|
baseUrl?: string;
|
|
276
270
|
priority?: number;
|
|
277
271
|
threads?: number;
|
|
278
|
-
broadcastId?:
|
|
279
|
-
log?: boolean |
|
|
280
|
-
error?: { abort?: boolean |
|
|
281
|
-
ignoreExtensions?: boolean |
|
|
272
|
+
broadcastId?: string | string[];
|
|
273
|
+
log?: boolean | string | string[] | T;
|
|
274
|
+
error?: { abort?: boolean | string | string[]; fatal?: boolean };
|
|
275
|
+
ignoreExtensions?: boolean | string | string[];
|
|
282
276
|
}
|
|
283
277
|
|
|
284
278
|
export interface RequestData extends RequestBase, ImportAction<StringMap>, IncrementalAction {
|
|
@@ -322,32 +316,7 @@ export interface ResponseError {
|
|
|
322
316
|
|
|
323
317
|
export interface RequestObserve extends WebSocketClient {
|
|
324
318
|
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;
|
|
319
|
+
expires?: number | string;
|
|
351
320
|
}
|
|
352
321
|
|
|
353
322
|
export interface ChecksumBase<T = BinaryToTextEncoding> {
|
|
@@ -357,15 +326,15 @@ export interface ChecksumBase<T = BinaryToTextEncoding> {
|
|
|
357
326
|
|
|
358
327
|
export interface ChecksumOutput<T = BinaryToTextEncoding> extends ChecksumBase<T> {
|
|
359
328
|
filename?: string;
|
|
360
|
-
include?:
|
|
361
|
-
exclude?:
|
|
329
|
+
include?: string | string[];
|
|
330
|
+
exclude?: string | string[];
|
|
362
331
|
recursive?: boolean | 1;
|
|
363
332
|
}
|
|
364
333
|
|
|
365
334
|
export interface TaskBase {
|
|
366
|
-
interval?:
|
|
367
|
-
start?:
|
|
368
|
-
expires?:
|
|
335
|
+
interval?: number | string;
|
|
336
|
+
start?: number | string;
|
|
337
|
+
expires?: number | string;
|
|
369
338
|
}
|
|
370
339
|
|
|
371
340
|
export type WebSocketEvent = "close" | "error";
|