@e-mc/types 0.13.4 → 0.13.6
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 +5 -5
- package/constant.d.ts +1 -1
- package/index.js +1 -2
- package/lib/core.d.ts +5 -2
- package/lib/dom.d.ts +9 -0
- package/lib/http.d.ts +4 -4
- package/lib/index.d.ts +4 -2
- package/lib/request.d.ts +3 -1
- package/lib/settings.d.ts +6 -0
- package/package.json +1 -1
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.13.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.13.6/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { LogArguments } from "./lib/logger";
|
|
@@ -208,10 +208,10 @@ const IMPORT_MAP: Record<string, string | undefined>;
|
|
|
208
208
|
|
|
209
209
|
## References
|
|
210
210
|
|
|
211
|
-
- https://www.unpkg.com/@e-mc/types@0.13.
|
|
212
|
-
- https://www.unpkg.com/@e-mc/types@0.13.
|
|
213
|
-
- https://www.unpkg.com/@e-mc/types@0.13.
|
|
214
|
-
- https://www.unpkg.com/@e-mc/types@0.13.
|
|
211
|
+
- https://www.unpkg.com/@e-mc/types@0.13.6/index.d.ts
|
|
212
|
+
- https://www.unpkg.com/@e-mc/types@0.13.6/lib/logger.d.ts
|
|
213
|
+
- https://www.unpkg.com/@e-mc/types@0.13.6/lib/module.d.ts
|
|
214
|
+
- https://www.unpkg.com/@e-mc/types@0.13.6/lib/node.d.ts
|
|
215
215
|
|
|
216
216
|
* https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
|
217
217
|
* https://www.npmjs.com/package/@types/bytes
|
package/constant.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -176,8 +176,7 @@ function fromObject(value, typedArray, structured, shared) {
|
|
|
176
176
|
function trimQuote(value) {
|
|
177
177
|
value = value.trim();
|
|
178
178
|
const first = value[0];
|
|
179
|
-
|
|
180
|
-
return first === last && (first === '"' || first === "'" || first === "`") ? value.substring(1, value.length - 1) : value;
|
|
179
|
+
return first === value.at(-1) && (first === '"' || first === "'" || first === "`") ? value.substring(1, value.length - 1) : value;
|
|
181
180
|
}
|
|
182
181
|
function checkCipherType(value) {
|
|
183
182
|
switch (value) {
|
package/lib/core.d.ts
CHANGED
|
@@ -70,10 +70,13 @@ export interface ClientDbConstructor<T extends IHost = IHost, U extends ClientMo
|
|
|
70
70
|
convertTime(value: number | string): number;
|
|
71
71
|
findResult(source: string, credential: unknown, queryString: string, timeout: number, sessionKey?: string | boolean, renewCache?: boolean): QueryResult | undefined;
|
|
72
72
|
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, options: StoreResultOptions): QueryResult;
|
|
73
|
+
/** @deprecated */
|
|
73
74
|
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, sessionKey: string, sessionExpires: number): QueryResult;
|
|
74
75
|
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, cache: DbCacheValue): QueryResult;
|
|
75
|
-
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, cache: DbCacheValue | undefined, options: StoreResultOptions): QueryResult;
|
|
76
|
-
|
|
76
|
+
storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, cache: DbCacheValue | undefined, options: Omit<StoreResultOptions, "cache">): QueryResult;
|
|
77
|
+
findSession<W = unknown>(source: string, user: string, key: string): W | undefined;
|
|
78
|
+
storeSession(source: string, user: string, key: string, result: unknown, expires?: number): void;
|
|
79
|
+
purgeResult(prefix?: string, lru?: boolean | number): Promise<number>;
|
|
77
80
|
extractUUID(credential: unknown): string;
|
|
78
81
|
setPoolConfig(value: unknown): void;
|
|
79
82
|
getPoolConfig(source: string): unknown;
|
package/lib/dom.d.ts
ADDED
package/lib/http.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LookupAddress } from 'node:dns';
|
|
2
|
-
import type { ClientRequest, Agent as HttpAgent, OutgoingHttpHeaders } from 'node:http';
|
|
2
|
+
import type { AgentOptions, ClientRequest, Agent as HttpAgent, OutgoingHttpHeaders } from 'node:http';
|
|
3
3
|
import type { Agent as HttpsAgent } from 'node:https';
|
|
4
4
|
import type { ClientHttp2Stream } from 'node:http2';
|
|
5
5
|
import type { SecureVersion } from 'node:tls';
|
|
@@ -85,11 +85,10 @@ export interface HeadersAction {
|
|
|
85
85
|
headers?: OutgoingHttpHeaders | Headers;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
export interface HttpAgentSettings {
|
|
88
|
+
export interface HttpAgentSettings extends HttpAgentOptions {
|
|
89
89
|
http?: HttpAgent;
|
|
90
90
|
https?: HttpsAgent;
|
|
91
91
|
keepAlive?: boolean;
|
|
92
|
-
timeout?: number;
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
export interface SecureConfig<T = string, U = T> {
|
|
@@ -114,6 +113,7 @@ export interface AuthValue {
|
|
|
114
113
|
|
|
115
114
|
export type HttpRequestClient = ClientRequest | ClientHttp2Stream;
|
|
116
115
|
export type HttpOutgoingHeaders = ObjectMap<OutgoingHttpHeaders>;
|
|
116
|
+
export type HttpAgentOptions = Pick<AgentOptions, "timeout" | "maxSockets" | "maxTotalSockets" | "keepAliveMsecs" | "maxFreeSockets" | "proxyEnv">;
|
|
117
117
|
export type HttpProtocolVersion = 1 | 2 | 3;
|
|
118
118
|
export type InternetProtocolVersion = 0 | 4 | 6;
|
|
119
|
-
export type LookupCallback = (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family?: number) => void;
|
|
119
|
+
export type LookupCallback = (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family?: number) => void;
|
package/lib/index.d.ts
CHANGED
|
@@ -625,6 +625,7 @@ declare namespace functions {
|
|
|
625
625
|
defineHttpCache(options: HttpMemorySettings, disk?: boolean): void;
|
|
626
626
|
defineHttpConnect(options: HttpConnectSettings): void;
|
|
627
627
|
defineHttpAdapter(module: unknown): void;
|
|
628
|
+
generateSessionId(): string;
|
|
628
629
|
readonly prototype: IFileManager<T>;
|
|
629
630
|
new(baseDirectory: string, config: RequestData<T>, postFinalize?: PostFinalizeCallback): IFileManager<T>;
|
|
630
631
|
new(baseDirectory: string, config: RequestData<T>, permission?: IPermission | null, postFinalize?: PostFinalizeCallback): IFileManager<T>;
|
|
@@ -680,7 +681,7 @@ declare namespace functions {
|
|
|
680
681
|
getThreadCount(username: string, iv?: BinaryLike): ThreadCountStat;
|
|
681
682
|
getThreadCount(username?: string | boolean, iv?: BinaryLike): number;
|
|
682
683
|
getLogDelayed(): FormatMessageArgs[];
|
|
683
|
-
getPermissionFromSettings(): IPermission;
|
|
684
|
+
getPermissionFromSettings(freeze?: boolean): IPermission;
|
|
684
685
|
readonly prototype: IHost;
|
|
685
686
|
new(config?: HostInitConfig): IHost;
|
|
686
687
|
}
|
|
@@ -689,7 +690,7 @@ declare namespace functions {
|
|
|
689
690
|
readonly status: LogStatus<StatusType>[];
|
|
690
691
|
readonly errors: unknown[];
|
|
691
692
|
supported(major: number, minor?: number, patch?: number, lts?: boolean): boolean;
|
|
692
|
-
supports(name: string, value?: boolean): boolean;
|
|
693
|
+
supports(name: string, value?: boolean, locked?: boolean): boolean;
|
|
693
694
|
getTempDir(options: TempDirOptions): string;
|
|
694
695
|
getTempDir(uuidDir: boolean, createDir: boolean): string;
|
|
695
696
|
getTempDir(pathname: string, createDir: boolean): string;
|
|
@@ -900,6 +901,7 @@ declare namespace functions {
|
|
|
900
901
|
sanitizeArgs(values: string[], doubleQuote?: boolean): string[];
|
|
901
902
|
purgeMemory(percent: number, limit: number, parent?: boolean): Promise<number>;
|
|
902
903
|
purgeMemory(percent?: number, limit?: number | boolean, parent?: unknown): Promise<number>;
|
|
904
|
+
availableParallelism(factor?: number): number;
|
|
903
905
|
canWrite(name: "temp" | "home"): boolean;
|
|
904
906
|
loadSettings(settings: Settings, password?: string): boolean;
|
|
905
907
|
readonly prototype: IModule<T>;
|
package/lib/request.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { EncodingAction } from './squared';
|
|
|
2
2
|
|
|
3
3
|
import type { IRequest } from './index';
|
|
4
4
|
import type { BinaryAction } from './asset';
|
|
5
|
-
import type { HeadersAction, HttpProtocolVersion, HttpRequestClient, InternetProtocolVersion } from './http';
|
|
5
|
+
import type { HeadersAction, HttpAgentOptions, HttpProtocolVersion, HttpRequestClient, InternetProtocolVersion } from './http';
|
|
6
6
|
import type { IncludeAction } from './module';
|
|
7
7
|
import type { ErrorCode } from './node';
|
|
8
8
|
import type { HttpHostSettings, RequestModule } from './settings';
|
|
@@ -12,7 +12,9 @@ import type { Readable, Writable } from 'node:stream';
|
|
|
12
12
|
|
|
13
13
|
interface KeepAliveAction {
|
|
14
14
|
keepAlive?: boolean;
|
|
15
|
+
/** @deprecated */
|
|
15
16
|
agentTimeout?: number;
|
|
17
|
+
agentOptions?: HttpAgentOptions;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
interface SilentAction {
|
package/lib/settings.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { ExecAction, IncludeAction } from './module';
|
|
|
11
11
|
import type { SpawnOptions } from 'node:child_process';
|
|
12
12
|
import type { BinaryLike, CipherGCMTypes } from 'node:crypto';
|
|
13
13
|
import type { LookupAddress } from 'node:dns';
|
|
14
|
+
import type { AgentOptions } from 'node:http';
|
|
14
15
|
import type { BrotliOptions, ZlibOptions } from 'node:zlib';
|
|
15
16
|
// @ts-ignore
|
|
16
17
|
import type { BackgroundColor as IBackgroundColor } from 'chalk';
|
|
@@ -314,7 +315,9 @@ export interface RequestModule<T = RequestSettings> extends HandlerSettings<T>,
|
|
|
314
315
|
read_timeout?: number | string;
|
|
315
316
|
agent?: {
|
|
316
317
|
keep_alive?: boolean;
|
|
318
|
+
keep_alive_interval?: number | string;
|
|
317
319
|
timeout?: number | string;
|
|
320
|
+
proxy_env?: AgentOptions["proxyEnv"];
|
|
318
321
|
};
|
|
319
322
|
disk?: HttpDiskSettings;
|
|
320
323
|
buffer?: HttpMemorySettings;
|
|
@@ -335,6 +338,7 @@ export interface HttpProxySettings extends AuthValue, IncludeAction {
|
|
|
335
338
|
port?: number | string;
|
|
336
339
|
origin?: string;
|
|
337
340
|
keep_alive?: boolean;
|
|
341
|
+
keep_alive_interval?: number | string;
|
|
338
342
|
}
|
|
339
343
|
|
|
340
344
|
export interface HttpHostSettings {
|
|
@@ -360,6 +364,7 @@ export interface WatchSettings<T = WatchUserSettings> extends ClientSettings<Obj
|
|
|
360
364
|
export interface CompressModule<U = CompressSettings> extends HandlerSettings<U> {
|
|
361
365
|
gzip?: ZlibOptions;
|
|
362
366
|
brotli?: BrotliOptions;
|
|
367
|
+
/** @deprecated */
|
|
363
368
|
zopfli?: ZopfliOptions;
|
|
364
369
|
}
|
|
365
370
|
|
|
@@ -369,6 +374,7 @@ export interface CompressSettings extends PlainObject {
|
|
|
369
374
|
cache_expires?: number | string;
|
|
370
375
|
gzip_level?: number | string;
|
|
371
376
|
brotli_quality?: number | string;
|
|
377
|
+
/** @deprecated */
|
|
372
378
|
zopfli_iterations?: number | string;
|
|
373
379
|
chunk_size?: number | string;
|
|
374
380
|
}
|