@e-mc/types 0.10.2 → 0.10.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/README.md +6 -6
- package/constant.d.ts +8 -37
- package/index.d.ts +15 -28
- package/lib/asset.d.ts +2 -2
- package/lib/cloud.d.ts +1 -1
- package/lib/compat-v4.d.ts +6 -11
- package/lib/compress.d.ts +8 -9
- package/lib/core.d.ts +7 -7
- package/lib/db.d.ts +14 -16
- package/lib/document.d.ts +4 -6
- package/lib/filemanager.d.ts +9 -10
- package/lib/http.d.ts +1 -2
- package/lib/index.d.ts +57 -58
- package/lib/logger.d.ts +0 -3
- package/lib/module.d.ts +46 -23
- package/lib/node.d.ts +2 -2
- package/lib/object.d.ts +2 -0
- package/lib/request.d.ts +15 -13
- package/lib/settings.d.ts +70 -93
- package/lib/squared.d.ts +45 -9
- package/lib/type.d.ts +6 -11
- package/package.json +2 -2
- package/lib/dom.d.ts +0 -9
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.10.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.10.4/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { LogArguments } from "./lib/logger";
|
|
@@ -37,7 +37,7 @@ function isObject(value: unknown): value is object;
|
|
|
37
37
|
function isPlainObject(value: unknown): value is Record<string | number | symbol, unknown>;
|
|
38
38
|
function isString(value: unknown): value is string;
|
|
39
39
|
function isEmpty(value: unknown): boolean;
|
|
40
|
-
function asFunction(value: unknown, sync?: boolean): ((...args: unknown[]) =>
|
|
40
|
+
function asFunction(value: unknown, sync?: boolean): ((...args: unknown[]) => unknown) | null;
|
|
41
41
|
function parseTime(value: number | string, start?: number): number;
|
|
42
42
|
function parseExpires(value: number | string, start?: number): number;
|
|
43
43
|
function formatTime(value: number, char: string): string;
|
|
@@ -196,10 +196,10 @@ const IMPORT_MAP: Record<string, string | undefined>;
|
|
|
196
196
|
|
|
197
197
|
## References
|
|
198
198
|
|
|
199
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
200
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
201
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
202
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
199
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/index.d.ts
|
|
200
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/logger.d.ts
|
|
201
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/module.d.ts
|
|
202
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/object.d.ts
|
|
203
203
|
|
|
204
204
|
* https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
|
205
205
|
* https://www.npmjs.com/package/@types/bytes
|
package/constant.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const enum INTERNAL {
|
|
2
|
-
VERSION = '0.
|
|
2
|
+
VERSION = '0.9.14',
|
|
3
3
|
TEMP_DIR = 'tmp',
|
|
4
4
|
CJS = '__cjs__'
|
|
5
5
|
}
|
|
@@ -8,7 +8,6 @@ export const enum VAL_MESSAGE {
|
|
|
8
8
|
SUCCESS = 'Success',
|
|
9
9
|
COMPLETED = 'Completed',
|
|
10
10
|
CHECKSUM = 'Checksum matched',
|
|
11
|
-
MODIFIED_FILE = 'File modified',
|
|
12
11
|
MODIFIED_DIRECTORY = 'Directory was modified',
|
|
13
12
|
COMMIT_TRANSACTION = 'Transactions were committed'
|
|
14
13
|
}
|
|
@@ -39,22 +38,18 @@ export const enum ERR_MESSAGE {
|
|
|
39
38
|
FAIL = 'FAIL!',
|
|
40
39
|
WARN = 'WARN!',
|
|
41
40
|
ABORTED = 'Aborted',
|
|
42
|
-
EXPIRED = 'Expired',
|
|
43
41
|
ABORTED_HOST = 'Aborted by host',
|
|
44
42
|
ABORTED_CLIENT = 'Aborted by client',
|
|
45
43
|
ABORTED_PROCESS = 'Aborted by process',
|
|
46
|
-
ABORTED_OPERATION = '
|
|
44
|
+
ABORTED_OPERATION = 'The operation was aborted',
|
|
47
45
|
FAILED = 'Failed',
|
|
48
46
|
FAILED_CHECKSUM = 'Checksum did not match',
|
|
49
47
|
PARAMETERS = 'Invalid parameters',
|
|
50
48
|
FORMAT = 'Invalid format',
|
|
51
49
|
CHECKSUM = 'Invalid checksum',
|
|
52
|
-
CONFIG = 'Invalid config',
|
|
53
50
|
RESPONSE = 'Invalid response',
|
|
54
|
-
FUNCTION = 'Invalid function',
|
|
55
51
|
SIZE = 'Size limit was exceeded',
|
|
56
52
|
ERROR_CODE = 'Error code',
|
|
57
|
-
BUSY_RESOURCE = 'Resource already in use',
|
|
58
53
|
PERMISSION = 'Operation not permitted',
|
|
59
54
|
EXEC_PERMISSION = 'Exec command not permitted',
|
|
60
55
|
NOT_CACHEABLE = 'Not able to cache',
|
|
@@ -69,7 +64,6 @@ export const enum ERR_MESSAGE {
|
|
|
69
64
|
TIMEOUT = 'Timeout was exceeded',
|
|
70
65
|
HANDLED_REJECTION = 'Handled rejection',
|
|
71
66
|
UNSUPPORTED_ACCESS = 'Unsupported access',
|
|
72
|
-
UNSUPPORTED_PROTOCOL = 'Unsupported protocol',
|
|
73
67
|
UNSUPPORTED_MIME = 'Unsupported MIME',
|
|
74
68
|
UNSUPPORTED_READ = 'Not permitted to read file',
|
|
75
69
|
UNSUPPORTED_WRITE = 'Not permitted to write file',
|
|
@@ -78,7 +72,6 @@ export const enum ERR_MESSAGE {
|
|
|
78
72
|
NOTFOUND_BINARY = 'Binary not found',
|
|
79
73
|
NOTFOUND_PACKAGE = 'Package not found',
|
|
80
74
|
NOTFOUND_MIME = 'MIME not found',
|
|
81
|
-
NOTFOUND_TLS = 'TLS/SSL key and cert not found',
|
|
82
75
|
INSTALL = 'Install required?',
|
|
83
76
|
INLINE_METHOD = 'Unable to parse inline method',
|
|
84
77
|
INLINE_OBJECT = 'Unable to parse inline object',
|
|
@@ -125,7 +118,6 @@ export const enum ERR_DB {
|
|
|
125
118
|
TABLE = 'Missing database table',
|
|
126
119
|
QUERY = 'Missing database query',
|
|
127
120
|
CONNECTION = 'Missing connection string',
|
|
128
|
-
TLS = 'Missing TLS/SSL credentials',
|
|
129
121
|
CLIENT = 'Unable to configure client',
|
|
130
122
|
EXEC_QUERY = 'Unable to execute query',
|
|
131
123
|
FILTER_QUERY = 'Unable to filter results',
|
|
@@ -167,10 +159,6 @@ export const enum ERR_CLOUD {
|
|
|
167
159
|
METADATA_FAIL = 'Metadata failed'
|
|
168
160
|
}
|
|
169
161
|
|
|
170
|
-
export const enum ERR_COMPRESS {
|
|
171
|
-
API_KEY = 'Missing API key'
|
|
172
|
-
}
|
|
173
|
-
|
|
174
162
|
export const enum ERR_IMAGE {
|
|
175
163
|
ROTATE = 'Unable to rotate image',
|
|
176
164
|
FINALIZE = 'Unable to finalize image',
|
|
@@ -180,16 +168,7 @@ export const enum ERR_IMAGE {
|
|
|
180
168
|
|
|
181
169
|
export const enum ERR_HTTP {
|
|
182
170
|
HEADERS = 'Unable to process headers',
|
|
183
|
-
FORMAT = 'Unable to parse URI response',
|
|
184
|
-
SERVER_WEBSOCKET = 'Unable to create WebSocket server',
|
|
185
171
|
ETAG = 'ETag not supported',
|
|
186
|
-
REQUEST = 'Invalid HTTP request',
|
|
187
|
-
TIMEOUT = 'HTTP request timeout',
|
|
188
|
-
TIMEOUT_CONNECTION = 'HTTP connection timeout',
|
|
189
|
-
DATA_RECEIVED = 'No data received',
|
|
190
|
-
REDIRECT_LIMIT = 'Exceeded redirect limit',
|
|
191
|
-
REDIRECT_FOLLOW = 'Follow redirect was disabled',
|
|
192
|
-
REDIRECT_MISSING = 'Missing redirect location',
|
|
193
172
|
DOWNLOAD_SUCCESS = 'No files were successfully downloaded',
|
|
194
173
|
MULTIPART_ATTACH = 'No files were attached'
|
|
195
174
|
}
|
|
@@ -250,14 +229,6 @@ export const enum PACKAGE_NAME {
|
|
|
250
229
|
WATCH_FILEGROUP = '@e-mc/watch/filegroup'
|
|
251
230
|
}
|
|
252
231
|
|
|
253
|
-
export const enum MIME_TYPE {
|
|
254
|
-
MULTIPART = 'multipart/form-data',
|
|
255
|
-
URLENCODED = 'application/x-www-form-urlencoded',
|
|
256
|
-
JSON = 'application/json',
|
|
257
|
-
TEXT = 'text/plain',
|
|
258
|
-
OCTET_STREAM = 'application/octet-stream'
|
|
259
|
-
}
|
|
260
|
-
|
|
261
232
|
export const enum ASSET_FLAG {
|
|
262
233
|
NONE = 0,
|
|
263
234
|
IGNORE = 1,
|
|
@@ -292,15 +263,15 @@ export const enum LOG_TYPE {
|
|
|
292
263
|
}
|
|
293
264
|
|
|
294
265
|
export const enum LOG_STATE {
|
|
295
|
-
STDIN,
|
|
296
|
-
STDOUT,
|
|
297
|
-
STDERR
|
|
266
|
+
STDIN = 0,
|
|
267
|
+
STDOUT = 1,
|
|
268
|
+
STDERR = 2
|
|
298
269
|
}
|
|
299
270
|
|
|
300
271
|
export const enum READDIR_SORT {
|
|
301
|
-
FILE,
|
|
302
|
-
DIRECTORY,
|
|
303
|
-
DESCENDING
|
|
272
|
+
FILE = 0,
|
|
273
|
+
DIRECTORY = 1,
|
|
274
|
+
DESCENDING = 2
|
|
304
275
|
}
|
|
305
276
|
|
|
306
277
|
export const enum SETTINGS_KEY_NAME {
|
package/index.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
/// <reference lib="dom" />
|
|
2
1
|
/// <reference path="./lib/type.d.ts" />
|
|
3
2
|
/// <reference path="./lib/object.d.ts" />
|
|
4
3
|
|
|
5
4
|
import type { LogArguments } from './lib/logger';
|
|
5
|
+
import type { CloneObjectOptions } from './lib/module';
|
|
6
6
|
|
|
7
|
-
import type { BinaryLike,
|
|
7
|
+
import type { BinaryLike, CipherGCMTypes, Encoding } from 'crypto';
|
|
8
8
|
|
|
9
9
|
// @ts-ignore
|
|
10
10
|
import type { BytesOptions } from 'bytes';
|
|
11
11
|
|
|
12
|
+
declare class AbortError extends Error {
|
|
13
|
+
code: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
declare namespace types {
|
|
13
17
|
interface LOG_TYPE {
|
|
14
18
|
UNKNOWN: 0;
|
|
@@ -262,24 +266,10 @@ declare namespace types {
|
|
|
262
266
|
|
|
263
267
|
const IMPORT_MAP: StringMap;
|
|
264
268
|
|
|
265
|
-
interface CloneObjectOptions<T = unknown> {
|
|
266
|
-
target?: T;
|
|
267
|
-
deep?: boolean;
|
|
268
|
-
deepIgnore?: WeakSet<object>;
|
|
269
|
-
mergeArray?: MergeArrayMethod;
|
|
270
|
-
mergeDepth?: number;
|
|
271
|
-
typedArray?: boolean;
|
|
272
|
-
symbol?: boolean;
|
|
273
|
-
inherited?: boolean;
|
|
274
|
-
nonenumerable?: boolean;
|
|
275
|
-
preserve?: boolean;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
type MergeArrayMethod = "concat" | "concat-pre" | "includes" | "unshift" | "push" | "flat" | "join" | "slice" | "reverse" | ["flat", number] | ["join", string] | ["slice", number, number?];
|
|
279
269
|
type WatchEventValue = WATCH_EVENT[keyof WATCH_EVENT];
|
|
280
270
|
|
|
281
271
|
function createAbortError(reject: true): Promise<never>;
|
|
282
|
-
function createAbortError():
|
|
272
|
+
function createAbortError(): AbortError;
|
|
283
273
|
function hasBit(value: unknown, flags: number): boolean;
|
|
284
274
|
function ignoreFlag(value: unknown): boolean;
|
|
285
275
|
function cloneFlag(value: unknown): boolean;
|
|
@@ -290,7 +280,7 @@ declare namespace types {
|
|
|
290
280
|
function mainFlag(value: unknown): boolean;
|
|
291
281
|
function existsFlag(value: unknown): boolean;
|
|
292
282
|
function getLogCurrent(): Null<LogArguments>;
|
|
293
|
-
function setLogCurrent(value:
|
|
283
|
+
function setLogCurrent(value: LogArguments): void;
|
|
294
284
|
function setTempDir(value: string): boolean;
|
|
295
285
|
function getTempDir(): string;
|
|
296
286
|
function isArray<T>(value: unknown): value is T[];
|
|
@@ -298,12 +288,12 @@ declare namespace types {
|
|
|
298
288
|
function isPlainObject<T = PlainObject>(value: unknown): value is T;
|
|
299
289
|
function isString(value: unknown): value is string;
|
|
300
290
|
function isEmpty(value: unknown): boolean;
|
|
301
|
-
function asFunction<
|
|
302
|
-
function parseTime(value:
|
|
303
|
-
function parseExpires(value:
|
|
291
|
+
function asFunction<U = unknown, V = unknown>(value: unknown, sync?: boolean): Null<FunctionType<U, V>>;
|
|
292
|
+
function parseTime(value: NumString, start?: number): number;
|
|
293
|
+
function parseExpires(value: NumString, start?: number): number;
|
|
304
294
|
function formatTime(value: number, char: string): string;
|
|
305
295
|
function formatTime(value: number, elapsed?: boolean, char?: string): string;
|
|
306
|
-
function convertTime(value:
|
|
296
|
+
function convertTime(value: NumString): number;
|
|
307
297
|
function convertTime(value: HighResolutionTime, format: true): string;
|
|
308
298
|
function convertTime(value: HighResolutionTime, format?: boolean): number;
|
|
309
299
|
function hasGlob(value: string): boolean;
|
|
@@ -321,16 +311,13 @@ declare namespace types {
|
|
|
321
311
|
function getEncoding(value: unknown, fallback?: BufferEncoding): BufferEncoding;
|
|
322
312
|
function encryptUTF8(algorithm: CipherGCMTypes, key: BinaryLike, iv: BinaryLike, data: string, encoding?: Encoding): Undef<string>;
|
|
323
313
|
function decryptUTF8(algorithm: CipherGCMTypes, key: BinaryLike, iv: BinaryLike, data: string, encoding?: Encoding): Undef<string>;
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
function generateUUID(options?: RandomUUIDOptions): string;
|
|
314
|
+
/** @deprecated crypto.randomUUID */
|
|
315
|
+
function generateUUID(): string;
|
|
327
316
|
function incrementUUID(restart?: boolean): string;
|
|
328
317
|
function validateUUID(value: unknown): boolean;
|
|
329
318
|
function randomString(format: string, dictionary?: string): string;
|
|
330
319
|
function errorValue(value: string, hint?: string): Error;
|
|
331
|
-
function errorMessage(title:
|
|
332
|
-
function supported(major: number, minor?: number, patch?: number, lts?: boolean): boolean;
|
|
333
|
-
function importESM<T = unknown>(name: string, isDefault?: boolean, fromPath?: boolean): Promise<T>;
|
|
320
|
+
function errorMessage(title: NumString, value: string, hint?: string): Error;
|
|
334
321
|
function purgeMemory(percent?: number): number;
|
|
335
322
|
}
|
|
336
323
|
|
package/lib/asset.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface BinaryAction {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface StreamAction {
|
|
18
|
-
minStreamSize?:
|
|
18
|
+
minStreamSize?: NumString;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export interface FileData<T extends ExternalAsset> extends MimeTypeAction {
|
|
@@ -74,4 +74,4 @@ export interface ExternalAsset extends FileAsset, BundleAction, BinaryAction, St
|
|
|
74
74
|
invalid?: boolean;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
export type HashAlgorithm = "md5" | "sha1" | "sha256" | "sha224" | "sha384" | "sha512"
|
|
77
|
+
export type HashAlgorithm = "md5" | "sha1" | "sha256" | "sha224" | "sha384" | "sha512";
|
package/lib/cloud.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export interface CloudStorageAdmin<T = unknown, U = string, V = unknown, W = unk
|
|
|
43
43
|
export interface CloudStorageAction<T = unknown, U = string, V = unknown, W = unknown, X = unknown, Y = unknown> extends Partial<LocationUri>, StreamAction {
|
|
44
44
|
active?: boolean;
|
|
45
45
|
overwrite?: boolean;
|
|
46
|
-
chunkSize?:
|
|
46
|
+
chunkSize?: NumString;
|
|
47
47
|
chunkLimit?: number;
|
|
48
48
|
flags?: number;
|
|
49
49
|
admin?: CloudStorageAdmin<T, U, V, W, X, Y>;
|
package/lib/compat-v4.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { CloudConstructor, FileManagerConstructor, ICloud, IFileManager, IHost, IModule, ModuleConstructor, WatchConstructor } from './index';
|
|
2
2
|
|
|
3
|
-
import type { CloneObjectOptions } from '../index.d';
|
|
4
3
|
import type { ExternalAsset } from './asset';
|
|
5
4
|
import type { CacheOptions } from './core';
|
|
6
5
|
import type { QueryResult } from './db';
|
|
7
6
|
import type { ITransformSeries, OutV3, TransformSeriesConstructor } from './document';
|
|
8
7
|
import type { IHttpMemoryCache } from './filemanager';
|
|
9
8
|
import type { HttpAgentSettings, HttpProtocolVersion, HttpRequestClient, InternetProtocolVersion } from './http';
|
|
10
|
-
import type {
|
|
9
|
+
import type { CloneObjectOptions, GetFunctionsOptions } from './module';
|
|
11
10
|
import type { LogFailOptions, LogType, LogValue } from './logger';
|
|
12
11
|
import type { HostConfig, OpenOptions, ProxySettings } from './request';
|
|
13
12
|
import type { DbCoerceSettings, DnsLookupSettings, HttpMemorySettings, HttpSettings } from './settings';
|
|
@@ -18,10 +17,6 @@ import type { Readable, Writable } from 'stream';
|
|
|
18
17
|
|
|
19
18
|
type CpuUsage = NodeJS.CpuUsage;
|
|
20
19
|
|
|
21
|
-
export interface GetFunctionsOptions extends ParseFunctionOptions {
|
|
22
|
-
outFailed?: string[];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
20
|
export interface IModuleLibV4 {
|
|
26
21
|
isString(value: unknown): value is string;
|
|
27
22
|
isObject<T = object>(value: unknown): value is T;
|
|
@@ -35,12 +30,12 @@ export interface IModuleLibV4 {
|
|
|
35
30
|
isFileHTTP(value: string | URL): boolean;
|
|
36
31
|
isFileUNC(value: string | URL): boolean;
|
|
37
32
|
isPathUNC(value: string | URL): boolean;
|
|
38
|
-
toTimeMs(hrtime: HighResolutionTime, format?: boolean):
|
|
33
|
+
toTimeMs(hrtime: HighResolutionTime, format?: boolean): NumString;
|
|
39
34
|
renameExt(value: string, ext: string, when?: string): string;
|
|
40
35
|
existsSafe(value: string, isFile?: boolean): boolean;
|
|
41
36
|
readFileSafe(value: string, encoding: BufferEncoding | "buffer", cache?: boolean): Null<Bufferable>;
|
|
42
37
|
getFunctions<T extends FunctionType>(values: unknown[], absolute?: boolean | GetFunctionsOptions, sync?: boolean, outFailed?: string[]): T[];
|
|
43
|
-
formatSize(value:
|
|
38
|
+
formatSize(value: NumString, options?: PlainObject): NumString;
|
|
44
39
|
hasSameStat(src: string, dest: string, keepEmpty?: boolean): boolean;
|
|
45
40
|
hasSize(value: string, keepEmpty?: boolean): boolean;
|
|
46
41
|
getSize(value: string, diskUsed?: boolean): number;
|
|
@@ -67,7 +62,7 @@ export interface IFileManagerCompatV4<T extends ExternalAsset = ExternalAsset> e
|
|
|
67
62
|
httpProxy: Null<ProxySettings>;
|
|
68
63
|
acceptEncoding: boolean;
|
|
69
64
|
keepAliveTimeout: number;
|
|
70
|
-
addDns(hostname: string, address: string, family?:
|
|
65
|
+
addDns(hostname: string, address: string, family?: NumString): void;
|
|
71
66
|
lookupDns(hostname: string): LookupFunction;
|
|
72
67
|
getHttpProxy(uri: string, localhost?: boolean): Null<ProxySettings>;
|
|
73
68
|
getHttpHeaders(uri: string): Undef<OutgoingHttpHeaders>;
|
|
@@ -80,7 +75,7 @@ export interface IFileManagerCompatV4<T extends ExternalAsset = ExternalAsset> e
|
|
|
80
75
|
}
|
|
81
76
|
|
|
82
77
|
export interface FileManagerCompatV4Constructor<T extends ExternalAsset = ExternalAsset> extends FileManagerConstructor<T> {
|
|
83
|
-
fromHttpStatusCode(value:
|
|
78
|
+
fromHttpStatusCode(value: NumString): string;
|
|
84
79
|
resetHttpHost(version?: HttpProtocolVersion): void;
|
|
85
80
|
defineHttpBuffer(options: HttpMemorySettings): void;
|
|
86
81
|
defineHttpSettings(options: HttpSettings): void;
|
|
@@ -110,7 +105,7 @@ export interface WatchCompatV4Constructor<T extends IFileManager<U>, U extends E
|
|
|
110
105
|
readTLSKey(value: string, cache?: boolean): string;
|
|
111
106
|
readTLSCert(value: string, cache?: boolean): string;
|
|
112
107
|
isCert(value: string): boolean;
|
|
113
|
-
parseExpires(value:
|
|
108
|
+
parseExpires(value: NumString, start?: number): number;
|
|
114
109
|
}
|
|
115
110
|
|
|
116
111
|
export interface ITransformSeriesCompatV4<T = AnyObject, U = T> extends ITransformSeries<T, U>, PropertyAction<OutV3, "out"> {}
|
package/lib/compress.d.ts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import type { CompressFormat as ICompressFormat
|
|
1
|
+
import type { CompressFormat as ICompressFormat } from './squared';
|
|
2
2
|
|
|
3
3
|
import type { LogBaseOptions, LogTime } from './logger';
|
|
4
|
-
import type { ThrowsAction } from './module';
|
|
5
4
|
|
|
6
5
|
type ResultCallback<T = Null<Buffer | Uint8Array>> = (err: unknown, data?: T, ext?: string) => void;
|
|
7
6
|
type ResultData = Null<Buffer | Uint8Array> | string;
|
|
8
7
|
|
|
9
|
-
export interface CompressFormat extends ICompressFormat, LogBaseOptions
|
|
8
|
+
export interface CompressFormat extends ICompressFormat, LogBaseOptions {
|
|
10
9
|
filename?: string;
|
|
11
|
-
mimeType?: string;
|
|
12
10
|
startTime?: LogTime;
|
|
13
11
|
etag?: string;
|
|
12
|
+
proxyUrl?: string | ((uri: string) => Undef<string>);
|
|
14
13
|
outExt?: string;
|
|
15
14
|
outFile?: string;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
export interface
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
export interface Woff {
|
|
18
|
+
toWoff(this: void, data: BufferLike): Buffer;
|
|
19
|
+
toSfnt(this: void, data: BufferLike): Buffer;
|
|
20
|
+
}
|
|
21
21
|
|
|
22
22
|
export type BufferLike = Buffer | Uint8Array | ArrayBuffer | SharedArrayBuffer | readonly number[];
|
|
23
23
|
export type TryFileCompressor = (data: string | Buffer, output: string, config: CompressFormat, callback?: ResultCallback<ResultData>) => Void<Promise<ResultData>>;
|
|
24
24
|
export type TryFileCompressorAsync = (data: string | Buffer, output: string, config: CompressFormat) => Promise<ResultData>;
|
|
25
|
-
export type BufferResult = Null<Buffer | Uint8Array>;
|
|
26
|
-
export type PluginCompressor = FunctionArgs<[CompressFormat['options'], string?], FunctionArgs<[Buffer], Promise<Buffer | Uint8Array>>>;
|
|
25
|
+
export type BufferResult = Null<Buffer | Uint8Array>;
|
package/lib/core.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint @typescript-eslint/no-explicit-any: "off" */
|
|
2
|
+
|
|
1
3
|
import type { DataSource, RequestBase } from './squared';
|
|
2
4
|
|
|
3
5
|
import type { IExternalConfig, IExternalFunction, IHost, IModule, ModuleConstructor } from './index';
|
|
@@ -40,7 +42,6 @@ export interface IClientDb<T extends IHost, U extends ClientModule<ClientDbSetti
|
|
|
40
42
|
getQueryResult(source: string, credential: unknown, queryString: string, options?: CacheOptions | string, renewCache?: boolean): Undef<QueryResult>;
|
|
41
43
|
setQueryResult(source: string, credential: unknown, queryString: string, result: unknown, sessionKey?: string): QueryResult;
|
|
42
44
|
setQueryResult(source: string, credential: unknown, queryString: string, result: unknown, options?: CacheOptions | string): QueryResult;
|
|
43
|
-
getCacheResult(source: string, credential: unknown, queryString: string, cacheValue: CacheOptions, ignoreCache?: IntBool | FirstOf<number, number>): Undef<QueryResult>;
|
|
44
45
|
applyState(items: ArrayOf<V>, value: number, as?: boolean): void;
|
|
45
46
|
commit(items?: V[]): Promise<boolean>;
|
|
46
47
|
valueOfKey(credential: unknown, name: keyof W, component?: keyof X): unknown;
|
|
@@ -61,8 +62,8 @@ export interface ClientDbConstructor<T extends IHost = IHost, U extends ClientMo
|
|
|
61
62
|
readonly TRANSACTION_ABORT: number;
|
|
62
63
|
readonly TRANSACTION_FAIL: number;
|
|
63
64
|
loadSettings(settings: Pick<Settings, "process" | "memory">, password?: string): boolean;
|
|
64
|
-
getTimeout(value: Undef<
|
|
65
|
-
convertTime(value:
|
|
65
|
+
getTimeout(value: Undef<NumString | TimeoutAction>): number;
|
|
66
|
+
convertTime(value: NumString): number;
|
|
66
67
|
findResult(source: string, credential: unknown, queryString: string, timeout: number, sessionKey?: string | boolean, renewCache?: boolean): Undef<QueryResult>;
|
|
67
68
|
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, options: StoreResultOptions): QueryResult;
|
|
68
69
|
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, sessionKey: string, sessionExpires: number): QueryResult;
|
|
@@ -130,17 +131,16 @@ export interface PermissionAction {
|
|
|
130
131
|
permission?: PermittedDirectories;
|
|
131
132
|
}
|
|
132
133
|
|
|
133
|
-
export interface HostInitConfig
|
|
134
|
+
export interface HostInitConfig extends PlainObject, RequestBase<HostInitLog> {
|
|
134
135
|
username?: string;
|
|
135
136
|
ignoreModules?: string[];
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
export interface HostInitLog {
|
|
139
140
|
enabled?: boolean;
|
|
140
|
-
level?:
|
|
141
|
+
level?: NumString;
|
|
141
142
|
exclude?: ArrayOf<string>;
|
|
142
143
|
useColor?: boolean;
|
|
143
|
-
silent?: boolean;
|
|
144
144
|
showProgress?: boolean;
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -158,7 +158,7 @@ export interface StoreResultOptions {
|
|
|
158
158
|
export interface CacheOptions {
|
|
159
159
|
value?: DbCacheValue;
|
|
160
160
|
renewCache?: boolean;
|
|
161
|
-
exclusiveOf?:
|
|
161
|
+
exclusiveOf?: [number, number?, number?];
|
|
162
162
|
sessionKey?: string;
|
|
163
163
|
}
|
|
164
164
|
|
package/lib/db.d.ts
CHANGED
|
@@ -32,12 +32,14 @@ export interface ProcessRowsOptions {
|
|
|
32
32
|
parallel?: boolean;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export interface DbConnection
|
|
36
|
-
protocol: string;
|
|
35
|
+
export interface DbConnection {
|
|
37
36
|
hostname: string;
|
|
38
|
-
|
|
37
|
+
password: string;
|
|
39
38
|
pathname: string;
|
|
39
|
+
port: string;
|
|
40
|
+
protocol: string;
|
|
40
41
|
search: string;
|
|
42
|
+
username: string;
|
|
41
43
|
database: string;
|
|
42
44
|
}
|
|
43
45
|
|
|
@@ -54,7 +56,7 @@ export interface ServerAuth<T = number> extends AuthValue, IdentifierAction {
|
|
|
54
56
|
database?: string;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
export interface IDbPool<T extends DbDataSource = DbDataSource, U = unknown, V = unknown
|
|
59
|
+
export interface IDbPool<T extends DbDataSource = DbDataSource, U = unknown, V = unknown> {
|
|
58
60
|
client: U;
|
|
59
61
|
lastAccessed: number;
|
|
60
62
|
success: number;
|
|
@@ -63,7 +65,7 @@ export interface IDbPool<T extends DbDataSource = DbDataSource, U = unknown, V =
|
|
|
63
65
|
uuidKey: Null<AuthValue>;
|
|
64
66
|
add(item: T, uuidKey?: string): this;
|
|
65
67
|
has(item: T): boolean;
|
|
66
|
-
getConnection(
|
|
68
|
+
getConnection(): Promise<V>;
|
|
67
69
|
remove(): void;
|
|
68
70
|
detach(force?: boolean): Promise<void>;
|
|
69
71
|
close(): Promise<void>;
|
|
@@ -76,20 +78,16 @@ export interface IDbPool<T extends DbDataSource = DbDataSource, U = unknown, V =
|
|
|
76
78
|
set parent(value: ObjectMap<IDbPool<T>>);
|
|
77
79
|
}
|
|
78
80
|
|
|
79
|
-
export interface DbPoolConstructor<T extends DbDataSource = DbDataSource, U = unknown, V = unknown
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
validateKey<X extends IDbPool>(pools: ObjectMap<X>, username: string, uuidKey: unknown): [string, Null<X>];
|
|
86
|
-
checkTimeout<X extends IDbPool>(pools: ObjectMap<X>, value: number, limit?: number): Promise<number>;
|
|
87
|
-
readonly prototype: IDbPool<T, U, V, W>;
|
|
88
|
-
new(pool: U, poolKey: string, uuidKey?: Null<AuthValue>): IDbPool<T, U, V, W>;
|
|
81
|
+
export interface DbPoolConstructor<T extends DbDataSource = DbDataSource, U = unknown, V = unknown> {
|
|
82
|
+
findKey<W extends IDbPool, X extends DbDataSource>(pools: ObjectMap<W>, uuidKey: unknown, poolKey: Undef<string>, ...items: X[]): Null<W>;
|
|
83
|
+
validateKey<W extends IDbPool>(pools: ObjectMap<W>, username: string, uuidKey: unknown): [string, Null<W>];
|
|
84
|
+
checkTimeout<W extends IDbPool>(pools: ObjectMap<W>, value: number, limit?: number): Promise<number>;
|
|
85
|
+
readonly prototype: IDbPool<T, U, V>;
|
|
86
|
+
new(pool: U, poolKey: string, uuidKey?: Null<AuthValue>): IDbPool<T, U, V>;
|
|
89
87
|
}
|
|
90
88
|
|
|
91
89
|
export interface TimeoutAction {
|
|
92
|
-
timeout?:
|
|
90
|
+
timeout?: NumString;
|
|
93
91
|
}
|
|
94
92
|
|
|
95
93
|
export type DbSource = "mariadb" | "mongodb" | "mssql" | "mysql" | "oracle" | "postgres" | "redis";
|
package/lib/document.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import type { LogComponent, LogDate } from './logger';
|
|
|
7
7
|
import type { DocumentTransform } from './settings';
|
|
8
8
|
|
|
9
9
|
export interface DocumentAsset extends ExternalAsset, StorageAction<CloudStorage> {
|
|
10
|
-
inlineFilename?: string;
|
|
11
10
|
initialValue?: InitialValue & { inlineFilename?: string };
|
|
12
11
|
}
|
|
13
12
|
|
|
@@ -16,7 +15,7 @@ export interface StartOfSourceMap {
|
|
|
16
15
|
sourceRoot?: string;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
export interface RawSourceMap<T =
|
|
18
|
+
export interface RawSourceMap<T = NumString> extends StartOfSourceMap {
|
|
20
19
|
version: T;
|
|
21
20
|
sources: string[];
|
|
22
21
|
names: string[];
|
|
@@ -89,8 +88,7 @@ export interface ITransformSeries<T = AnyObject, U = T> extends IModule, Transfo
|
|
|
89
88
|
getMainFile(code?: string, imports?: StringMap): Undef<SourceInput<string>>;
|
|
90
89
|
getSourceFiles(imports?: StringMap): Undef<SourceInput>;
|
|
91
90
|
toBaseConfig(all?: boolean): T;
|
|
92
|
-
upgrade<V = unknown>(context: V, dirname?: string,
|
|
93
|
-
upgradeESM<V = unknown>(context: V, dirname?: string, pkgname?: string): Promise<V>;
|
|
91
|
+
upgrade<V = unknown>(context: V, dirname?: string, name?: string): V;
|
|
94
92
|
set code(value);
|
|
95
93
|
get code(): string;
|
|
96
94
|
get out(): IOut;
|
|
@@ -176,8 +174,8 @@ export interface LintMessage {
|
|
|
176
174
|
export interface GenerateLintTableOptions extends Partial<LocationUri> {
|
|
177
175
|
leadingText?: string;
|
|
178
176
|
trailingText?: string;
|
|
179
|
-
errorCount?: number
|
|
180
|
-
warningCount?: number
|
|
177
|
+
errorCount?: number;
|
|
178
|
+
warningCount?: number;
|
|
181
179
|
fatalErrorCount?: number;
|
|
182
180
|
timeStamp?: LogDate;
|
|
183
181
|
ruleWidth?: number;
|
package/lib/filemanager.d.ts
CHANGED
|
@@ -10,13 +10,13 @@ import type { RequestInit } from './request';
|
|
|
10
10
|
import type { FETCH_TYPE } from '../index.d';
|
|
11
11
|
|
|
12
12
|
export const enum FINALIZE_STATE {
|
|
13
|
-
READY,
|
|
14
|
-
COMMIT,
|
|
15
|
-
END,
|
|
16
|
-
RESTART,
|
|
17
|
-
QUEUED,
|
|
18
|
-
RESTARTED,
|
|
19
|
-
ABORTED
|
|
13
|
+
READY = 0,
|
|
14
|
+
COMMIT = 1,
|
|
15
|
+
END = 2,
|
|
16
|
+
RESTART = 3,
|
|
17
|
+
QUEUED = 4,
|
|
18
|
+
RESTARTED = 5,
|
|
19
|
+
ABORTED = 6
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const enum INCREMENTAL {
|
|
@@ -26,8 +26,8 @@ export const enum INCREMENTAL {
|
|
|
26
26
|
EXISTS = 'exists'
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export interface RequestData<T extends ExternalAsset = ExternalAsset
|
|
30
|
-
timeout?: ObjectMap<
|
|
29
|
+
export interface RequestData<T extends ExternalAsset = ExternalAsset> extends IRequestData<T>, RequestInit {
|
|
30
|
+
timeout?: ObjectMap<NumString>;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export interface InstallData<T extends IModule = IModule, U extends ModuleConstructor = ModuleConstructor> {
|
|
@@ -99,7 +99,6 @@ export interface DeleteFileAddendum {
|
|
|
99
99
|
export interface HostInitLog extends IHostInitLog {
|
|
100
100
|
useNumeric: boolean;
|
|
101
101
|
showSize?: boolean;
|
|
102
|
-
showDiff?: string[];
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
export interface FindAssetOptions<T extends ExternalAsset = ExternalAsset> {
|
package/lib/http.d.ts
CHANGED
|
@@ -93,11 +93,10 @@ export interface SecureConfig<T = string, U = T> {
|
|
|
93
93
|
key?: U;
|
|
94
94
|
cert?: T;
|
|
95
95
|
passphrase?: U;
|
|
96
|
-
ciphers?: string;
|
|
97
96
|
version?: SecureVersion;
|
|
98
97
|
}
|
|
99
98
|
|
|
100
|
-
export interface ServerPort<T =
|
|
99
|
+
export interface ServerPort<T = NumString> {
|
|
101
100
|
port?: T;
|
|
102
101
|
}
|
|
103
102
|
|