Compare commits
2 Commits
a14795f347
...
f4c5745bd8
Author | SHA1 | Date | |
---|---|---|---|
f4c5745bd8 | |||
0d229d9da6 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@navy.gif/wrappers",
|
"name": "@navy.gif/wrappers",
|
||||||
"version": "1.7.3",
|
"version": "1.7.4",
|
||||||
"description": "Various wrapper classes I use in my projects",
|
"description": "Various wrapper classes I use in my projects",
|
||||||
"repository": "https://git.corgi.wtf/Navy.gif/wrappers.git",
|
"repository": "https://git.corgi.wtf/Navy.gif/wrappers.git",
|
||||||
"author": "Navy.gif",
|
"author": "Navy.gif",
|
||||||
|
@ -3,7 +3,6 @@ import dns from 'node:dns/promises';
|
|||||||
import mysql, { PoolCluster, PoolClusterConfig, PoolConfig, PoolConnection, FieldInfo, OkPacket } from 'mysql';
|
import mysql, { PoolCluster, PoolClusterConfig, PoolConfig, PoolConnection, FieldInfo, OkPacket } from 'mysql';
|
||||||
|
|
||||||
import { ILogger, IServer } from './interfaces/index.js';
|
import { ILogger, IServer } from './interfaces/index.js';
|
||||||
import { LoggerClientOptions } from './interfaces/Logger.js';
|
|
||||||
|
|
||||||
const SAFE_TO_RETRY = [ 'ER_LOCK_DEADLOCK', 'PROTOCOL_CONNECTION_LOST' ];
|
const SAFE_TO_RETRY = [ 'ER_LOCK_DEADLOCK', 'PROTOCOL_CONNECTION_LOST' ];
|
||||||
|
|
||||||
@ -24,7 +23,7 @@ export type MariaOptions = {
|
|||||||
cluster?: PoolClusterConfig,
|
cluster?: PoolClusterConfig,
|
||||||
client?: PoolConfig,
|
client?: PoolConfig,
|
||||||
credentials: Credentials,
|
credentials: Credentials,
|
||||||
loggerOptions?: LoggerClientOptions,
|
loggerOptions?: object,
|
||||||
donorQuery?: boolean,
|
donorQuery?: boolean,
|
||||||
recordMetrics?: boolean,
|
recordMetrics?: boolean,
|
||||||
metricsBuckets?: number[],
|
metricsBuckets?: number[],
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { inspect } from 'node:util';
|
import { inspect } from 'node:util';
|
||||||
import { MongoClient, MongoClientOptions, Db, Document, WithId, ObjectId, Filter, IndexSpecification, CreateIndexesOptions, FindOptions, ModifyResult } from 'mongodb';
|
import { MongoClient, MongoClientOptions, Db, Document, WithId, ObjectId, Filter, IndexSpecification, CreateIndexesOptions, FindOptions, ModifyResult } from 'mongodb';
|
||||||
import { IServer, ILogger, LoggerClientOptions } from './interfaces/index.js';
|
import { IServer, ILogger } from './interfaces/index.js';
|
||||||
|
|
||||||
type Credentials = {
|
type Credentials = {
|
||||||
URI?: string,
|
URI?: string,
|
||||||
@ -19,7 +19,7 @@ type MongoQuery = {
|
|||||||
|
|
||||||
export type MongoOptions = {
|
export type MongoOptions = {
|
||||||
credentials: Credentials,
|
credentials: Credentials,
|
||||||
loggerOptions?: LoggerClientOptions,
|
loggerOptions?: object,
|
||||||
client?: MongoClientOptions,
|
client?: MongoClientOptions,
|
||||||
load?: boolean,
|
load?: boolean,
|
||||||
recordMetrics?: boolean,
|
recordMetrics?: boolean,
|
||||||
|
@ -1,19 +1,7 @@
|
|||||||
export type LoggerClientOptions = {
|
|
||||||
guard: string,
|
|
||||||
customStreams: string[],
|
|
||||||
logLevel: number,
|
|
||||||
logLevelMapping: {[key: string]: number}
|
|
||||||
}
|
|
||||||
|
|
||||||
type WriteOptions = {
|
|
||||||
subheader?: string,
|
|
||||||
broadcast?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ILogger {
|
export interface ILogger {
|
||||||
info(str: string | object, opts?: WriteOptions): void
|
info(...args: (string | object)[]): void
|
||||||
status(str: string | object, opts?: WriteOptions): void
|
status(...args: (string | object)[]): void
|
||||||
debug(str: string | object, opts?: WriteOptions): void
|
debug(...args: (string | object)[]): void
|
||||||
warn(str: string | object, opts?: WriteOptions): void
|
warn(...args: (string | object)[]): void
|
||||||
error(str: string | object, opts?: WriteOptions): void
|
error(...args: (string | object)[]): void
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
import { ILogger, LoggerClientOptions } from './Logger.js';
|
import { ILogger } from './Logger.js';
|
||||||
|
|
||||||
export interface IServer {
|
export interface IServer {
|
||||||
createLogger(obj: object, options?: Partial<LoggerClientOptions>): ILogger
|
createLogger(obj: object, options?: object): ILogger
|
||||||
registerMetric(metric: object): void
|
registerMetric(metric: object): void
|
||||||
}
|
}
|
@ -1,2 +1,2 @@
|
|||||||
export { ILogger, LoggerClientOptions } from './Logger.js';
|
export { ILogger } from './Logger.js';
|
||||||
export { IServer } from './Server.js';
|
export { IServer } from './Server.js';
|
Loading…
Reference in New Issue
Block a user