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