@autofleet/nitur 2.2.1-1 → 2.2.1-2
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/lib/alive-endpoint/base.cjs.map +1 -1
- package/lib/alive-endpoint/base.d.cts +2 -2
- package/lib/alive-endpoint/base.d.ts +2 -2
- package/lib/alive-endpoint/base.js.map +1 -1
- package/package.json +1 -1
- package/lib/logger/src/index.d.cts +0 -31
- package/lib/logger/src/index.d.ts +0 -31
- package/lib/logger.d.cts +0 -7
- package/lib/logger.d.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.cjs","names":[],"sources":["../../src/alive-endpoint/base.ts"],"sourcesContent":["import type { logger as loggerFallback } from '../logger';\n\nexport interface SystemAliveParameters {\n rabbit?: null | { isConnected: () => PromiseLike<boolean>; };\n sequelize?: null | { query(sql: string | { query: string; values: unknown[]; }): PromiseLike<any>; };\n redis?: null | { ping: () => Promise<void>; };\n elasticsearch?: null | { ping: () => Promise<boolean>; };\n logger?:
|
|
1
|
+
{"version":3,"file":"base.cjs","names":[],"sources":["../../src/alive-endpoint/base.ts"],"sourcesContent":["// import type { logger as loggerFallback } from '../logger';\n\nimport type { SimpleLogger } from '../health/shared';\n\nexport interface SystemAliveParameters {\n rabbit?: null | { isConnected: () => PromiseLike<boolean>; };\n sequelize?: null | { query(sql: string | { query: string; values: unknown[]; }): PromiseLike<any>; };\n redis?: null | { ping: () => Promise<void>; };\n elasticsearch?: null | { ping: () => Promise<boolean>; };\n logger?: SimpleLogger;\n}\n\nexport async function systemAliveCheck({\n rabbit = null,\n sequelize = null,\n redis = null,\n elasticsearch = null,\n}: SystemAliveParameters): Promise<{ status: 'ok'; }> {\n if (rabbit) {\n const isRabbitAlive = await rabbit.isConnected();\n if (!isRabbitAlive) {\n throw new Error('Rabbit is not alive');\n }\n }\n\n if (sequelize) {\n const [[{ status }]] = await sequelize.query('select \\'ok\\' as status');\n if (status !== 'ok') {\n throw new Error('Sequelize is not alive');\n }\n }\n\n if (redis) {\n await redis.ping();\n }\n\n if (elasticsearch) {\n await elasticsearch.ping();\n }\n\n return { status: 'ok' };\n};\n"],"mappings":"AAYA,eAAsB,EAAiB,CACrC,SAAS,KACT,YAAY,KACZ,QAAQ,KACR,gBAAgB,KACM,CAA8B,CACpD,GAAI,EAAQ,CACV,IAAM,EAAgB,KAAM,GAAO,aAAa,CAChD,IAAK,EACH,KAAM,CAAI,MAAM,sBAAA,AAEnB,CAED,GAAI,EAAW,CACb,GAAM,CAAC,CAAC,CAAE,SAAQ,CAAC,CAAC,CAAG,KAAM,GAAU,MAAM,wBAA0B,CACvE,GAAI,IAAW,KACb,KAAM,CAAI,MAAM,yBAAA,AAEnB,CAUD,OARI,GACF,KAAM,GAAM,MAAM,CAGhB,GACF,KAAM,GAAc,MAAM,CAGrB,CAAE,OAAQ,IAAM,CACxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SimpleLogger } from "../health/shared.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/alive-endpoint/base.d.ts
|
|
4
4
|
interface SystemAliveParameters {
|
|
@@ -17,7 +17,7 @@ interface SystemAliveParameters {
|
|
|
17
17
|
elasticsearch?: null | {
|
|
18
18
|
ping: () => Promise<boolean>;
|
|
19
19
|
};
|
|
20
|
-
logger?:
|
|
20
|
+
logger?: SimpleLogger;
|
|
21
21
|
}
|
|
22
22
|
declare function systemAliveCheck({
|
|
23
23
|
rabbit,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SimpleLogger } from "../health/shared.js";
|
|
2
2
|
|
|
3
3
|
//#region src/alive-endpoint/base.d.ts
|
|
4
4
|
interface SystemAliveParameters {
|
|
@@ -17,7 +17,7 @@ interface SystemAliveParameters {
|
|
|
17
17
|
elasticsearch?: null | {
|
|
18
18
|
ping: () => Promise<boolean>;
|
|
19
19
|
};
|
|
20
|
-
logger?:
|
|
20
|
+
logger?: SimpleLogger;
|
|
21
21
|
}
|
|
22
22
|
declare function systemAliveCheck({
|
|
23
23
|
rabbit,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","names":[],"sources":["../../src/alive-endpoint/base.ts"],"sourcesContent":["import type { logger as loggerFallback } from '../logger';\n\nexport interface SystemAliveParameters {\n rabbit?: null | { isConnected: () => PromiseLike<boolean>; };\n sequelize?: null | { query(sql: string | { query: string; values: unknown[]; }): PromiseLike<any>; };\n redis?: null | { ping: () => Promise<void>; };\n elasticsearch?: null | { ping: () => Promise<boolean>; };\n logger?:
|
|
1
|
+
{"version":3,"file":"base.js","names":[],"sources":["../../src/alive-endpoint/base.ts"],"sourcesContent":["// import type { logger as loggerFallback } from '../logger';\n\nimport type { SimpleLogger } from '../health/shared';\n\nexport interface SystemAliveParameters {\n rabbit?: null | { isConnected: () => PromiseLike<boolean>; };\n sequelize?: null | { query(sql: string | { query: string; values: unknown[]; }): PromiseLike<any>; };\n redis?: null | { ping: () => Promise<void>; };\n elasticsearch?: null | { ping: () => Promise<boolean>; };\n logger?: SimpleLogger;\n}\n\nexport async function systemAliveCheck({\n rabbit = null,\n sequelize = null,\n redis = null,\n elasticsearch = null,\n}: SystemAliveParameters): Promise<{ status: 'ok'; }> {\n if (rabbit) {\n const isRabbitAlive = await rabbit.isConnected();\n if (!isRabbitAlive) {\n throw new Error('Rabbit is not alive');\n }\n }\n\n if (sequelize) {\n const [[{ status }]] = await sequelize.query('select \\'ok\\' as status');\n if (status !== 'ok') {\n throw new Error('Sequelize is not alive');\n }\n }\n\n if (redis) {\n await redis.ping();\n }\n\n if (elasticsearch) {\n await elasticsearch.ping();\n }\n\n return { status: 'ok' };\n};\n"],"mappings":"AAYA,eAAsB,EAAiB,CACrC,SAAS,KACT,YAAY,KACZ,QAAQ,KACR,gBAAgB,KACM,CAA8B,CACpD,GAAI,EAAQ,CACV,IAAM,EAAgB,KAAM,GAAO,aAAa,CAChD,IAAK,EACH,KAAM,CAAI,MAAM,sBAAA,AAEnB,CAED,GAAI,EAAW,CACb,GAAM,CAAC,CAAC,CAAE,SAAQ,CAAC,CAAC,CAAG,KAAM,GAAU,MAAM,wBAA0B,CACvE,GAAI,IAAW,KACb,KAAM,CAAI,MAAM,yBAAA,AAEnB,CAUD,OARI,GACF,KAAM,GAAM,MAAM,CAGhB,GACF,KAAM,GAAc,MAAM,CAGrB,CAAE,OAAQ,IAAM,CACxB"}
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import Pino from "pino";
|
|
2
|
-
|
|
3
|
-
//#region ../logger/src/index.d.ts
|
|
4
|
-
declare enum LogLevel {
|
|
5
|
-
trace = "trace",
|
|
6
|
-
debug = "debug",
|
|
7
|
-
info = "info",
|
|
8
|
-
warn = "warn",
|
|
9
|
-
error = "error",
|
|
10
|
-
fatal = "fatal",
|
|
11
|
-
}
|
|
12
|
-
type MiddlewareFunction = () => Record<string, unknown>;
|
|
13
|
-
declare class LoggerInstanceManager {
|
|
14
|
-
#private;
|
|
15
|
-
constructor(logLevel?: LogLevel);
|
|
16
|
-
// To support winston like logging in pino
|
|
17
|
-
private winstonLikeLoggerCall;
|
|
18
|
-
private addMetadata;
|
|
19
|
-
addContextMiddleware: (middleware: MiddlewareFunction) => number;
|
|
20
|
-
trace: (message: string, meta?: unknown) => void;
|
|
21
|
-
debug: (message: string, meta?: unknown) => void;
|
|
22
|
-
info: (message: string, meta?: unknown) => void;
|
|
23
|
-
warn: (message: string, meta?: unknown) => void;
|
|
24
|
-
error: (message: string, meta?: unknown) => void;
|
|
25
|
-
fatal: (message: string, meta?: unknown) => void;
|
|
26
|
-
child: (metadata: Record<string, unknown>) => Pino.Logger;
|
|
27
|
-
get level(): Pino.LevelWithSilentOrString;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { LoggerInstanceManager };
|
|
31
|
-
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import Pino from "pino";
|
|
2
|
-
|
|
3
|
-
//#region ../logger/src/index.d.ts
|
|
4
|
-
declare enum LogLevel {
|
|
5
|
-
trace = "trace",
|
|
6
|
-
debug = "debug",
|
|
7
|
-
info = "info",
|
|
8
|
-
warn = "warn",
|
|
9
|
-
error = "error",
|
|
10
|
-
fatal = "fatal",
|
|
11
|
-
}
|
|
12
|
-
type MiddlewareFunction = () => Record<string, unknown>;
|
|
13
|
-
declare class LoggerInstanceManager {
|
|
14
|
-
#private;
|
|
15
|
-
constructor(logLevel?: LogLevel);
|
|
16
|
-
// To support winston like logging in pino
|
|
17
|
-
private winstonLikeLoggerCall;
|
|
18
|
-
private addMetadata;
|
|
19
|
-
addContextMiddleware: (middleware: MiddlewareFunction) => number;
|
|
20
|
-
trace: (message: string, meta?: unknown) => void;
|
|
21
|
-
debug: (message: string, meta?: unknown) => void;
|
|
22
|
-
info: (message: string, meta?: unknown) => void;
|
|
23
|
-
warn: (message: string, meta?: unknown) => void;
|
|
24
|
-
error: (message: string, meta?: unknown) => void;
|
|
25
|
-
fatal: (message: string, meta?: unknown) => void;
|
|
26
|
-
child: (metadata: Record<string, unknown>) => Pino.Logger;
|
|
27
|
-
get level(): Pino.LevelWithSilentOrString;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { LoggerInstanceManager };
|
|
31
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/logger.d.cts
DELETED