@e-mc/core 0.13.5 → 0.13.7

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.
Files changed (3) hide show
  1. package/README.md +18 -13
  2. package/index.js +613 -373
  3. package/package.json +3 -3
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.5/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.13.7/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { DataSource, LogStatus, WorkerAction } from "./squared";
@@ -74,6 +74,7 @@ interface HostConstructor extends ModuleConstructor {
74
74
  getThreadCount(full: true): ThreadCountStat;
75
75
  getThreadCount(username: string, iv?: BinaryLike): ThreadCountStat;
76
76
  getThreadCount(username?: string | boolean, iv?: BinaryLike): number;
77
+ parseIp(value: unknown, kind?: "ipv4" | "ipv6"): string;
77
78
  getPermissionFromSettings(freeze?: boolean): IPermission;
78
79
  readonly prototype: IHost;
79
80
  new(config?: HostInitConfig): IHost;
@@ -102,11 +103,11 @@ interface IClientDb extends IClient<IHost, ClientModule<ClientDbSettings>> {
102
103
  hasCache(source: string, sessionKey?: string): boolean;
103
104
  hasCoerce(source: string, component: keyof DbCoerceSettings, uuidKey: string | undefined): boolean;
104
105
  hasCoerce(source: string, component: keyof DbCoerceSettings, credential?: unknown): boolean;
106
+ getQueryResult(source: string, credential: unknown, queryString: string, options: CacheOptions): QueryResult | undefined;
105
107
  getQueryResult(source: string, credential: unknown, queryString: string, renewCache: boolean): QueryResult | undefined;
106
108
  getQueryResult(source: string, credential: unknown, queryString: string, sessionKey?: string, renewCache?: boolean): QueryResult | undefined;
107
- getQueryResult(source: string, credential: unknown, queryString: string, options?: CacheOptions, renewCache?: boolean): QueryResult | undefined;
109
+ setQueryResult(source: string, credential: unknown, queryString: string, result: unknown, options: CacheOptions): QueryResult;
108
110
  setQueryResult(source: string, credential: unknown, queryString: string, result: unknown, sessionKey?: string): QueryResult;
109
- setQueryResult(source: string, credential: unknown, queryString: string, result: unknown, options?: CacheOptions): QueryResult;
110
111
  getCacheResult(source: string, credential: unknown, queryString: string, cacheValue: CacheOptions, ignoreCache?: unknown): QueryResult | undefined;
111
112
  applyState(items: DataSource | DataSource[], value: number, as?: boolean): void;
112
113
  commit(items?: DataSource[]): Promise<boolean>;
@@ -130,12 +131,16 @@ interface ClientDbConstructor extends ClientConstructor<IHost, ClientModule> {
130
131
  loadSettings(settings: Pick<Settings, "process" | "memory">, password?: string): boolean;
131
132
  getTimeout(value: number | string | TimeoutAction | undefined): number;
132
133
  convertTime(value: number | string): number;
133
- findResult(source: string, credential: unknown, queryString: string, timeout: number, sessionKey?: string | boolean, renewCache?: boolean): QueryResult | undefined;
134
+ findResult(source: string, credential: unknown, queryString: string, timeout: number, renewCache: boolean): QueryResult | undefined;
135
+ findResult(source: string, credential: unknown, queryString: string, timeout: number, sessionKey?: string, renewCache?: boolean): QueryResult | undefined;
134
136
  storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, options: StoreResultOptions): QueryResult;
137
+ /** @deprecated */
135
138
  storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, sessionKey: string, sessionExpires: number): QueryResult;
136
139
  storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, cache: DbCacheValue): QueryResult;
137
- storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, cache: DbCacheValue | undefined, options: StoreResultOptions): QueryResult;
138
- purgeResult(prefix?: string): Promise<number>;
140
+ storeResult(source: string, credential: unknown, queryString: string, result: QueryResult, cache: DbCacheValue | undefined, options: Omit<StoreResultOptions, "cache">): QueryResult;
141
+ findSession(source: string, user: string, key: string): unknown;
142
+ storeSession(source: string, user: string, key: string, result: unknown, expires?: number): void;
143
+ purgeResult(prefix?: string, lru?: boolean | number): Promise<number>;
139
144
  extractUUID(credential: unknown): string;
140
145
  setPoolConfig(value: unknown): void;
141
146
  getPoolConfig(source: string): unknown;
@@ -319,13 +324,13 @@ NOTE: **@e-mc/core** is mostly a collection of abstract base classes which canno
319
324
 
320
325
  ## References
321
326
 
322
- - https://www.unpkg.com/@e-mc/types@0.13.5/lib/squared.d.ts
323
- - https://www.unpkg.com/@e-mc/types@0.13.5/lib/core.d.ts
324
- - https://www.unpkg.com/@e-mc/types@0.13.5/lib/db.d.ts
325
- - https://www.unpkg.com/@e-mc/types@0.13.5/lib/dom.d.ts
326
- - https://www.unpkg.com/@e-mc/types@0.13.5/lib/logger.d.ts
327
- - https://www.unpkg.com/@e-mc/types@0.13.5/lib/node.d.ts
328
- - https://www.unpkg.com/@e-mc/types@0.13.5/lib/settings.d.ts
327
+ - https://www.unpkg.com/@e-mc/types@0.13.7/lib/squared.d.ts
328
+ - https://www.unpkg.com/@e-mc/types@0.13.7/lib/core.d.ts
329
+ - https://www.unpkg.com/@e-mc/types@0.13.7/lib/db.d.ts
330
+ - https://www.unpkg.com/@e-mc/types@0.13.7/lib/dom.d.ts
331
+ - https://www.unpkg.com/@e-mc/types@0.13.7/lib/logger.d.ts
332
+ - https://www.unpkg.com/@e-mc/types@0.13.7/lib/node.d.ts
333
+ - https://www.unpkg.com/@e-mc/types@0.13.7/lib/settings.d.ts
329
334
 
330
335
  * https://www.npmjs.com/package/@types/node
331
336