Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8eda766c7 |
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { hashKey } from "@tanstack/query-core";
|
||||
|
||||
export function objectKeys<O extends object>(obj: O): (keyof O)[] {
|
||||
return Object.keys(obj) as (keyof O)[];
|
||||
}
|
||||
@@ -9,18 +11,5 @@ type Entries<T> = {
|
||||
export const objectEntries = <T extends object>(obj: T) => Object.entries(obj) as Entries<T>;
|
||||
|
||||
export const hashObjectBase64 = (obj: object) => {
|
||||
const json = JSON.stringify([obj], (_, val) =>
|
||||
typeof val === "object" && val !== null && !Array.isArray(val)
|
||||
? Object.keys(val)
|
||||
.toSorted()
|
||||
.reduce(
|
||||
(acc, key) => {
|
||||
acc[key] = (val as Record<string, unknown>)[key];
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, unknown>,
|
||||
)
|
||||
: val,
|
||||
);
|
||||
return Buffer.from(json).toString("base64");
|
||||
return Buffer.from(hashKey([obj])).toString("base64");
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
import superjson from "superjson";
|
||||
import winston from "winston";
|
||||
import Transport from "winston-transport";
|
||||
|
||||
import type { RedisClient } from "../../redis/client";
|
||||
import { createRedisClient } from "../../redis/client";
|
||||
@@ -7,7 +7,11 @@ import { createRedisClient } from "../../redis/client";
|
||||
const messageSymbol = Symbol.for("message");
|
||||
const levelSymbol = Symbol.for("level");
|
||||
|
||||
export class RedisTransport extends winston.Transport {
|
||||
//
|
||||
// Inherit from `winston-transport` so you can take advantage
|
||||
// of the base functionality and `.exceptions.handle()`.
|
||||
//
|
||||
export class RedisTransport extends Transport {
|
||||
private redis: RedisClient | null = null;
|
||||
public static readonly publishChannel = "pubSub:logging";
|
||||
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ catalog:
|
||||
"@dnd-kit/utilities": ^3.2.2
|
||||
"@drizzle-team/brocli": ^0.12.0
|
||||
"@extractus/feed-extractor": 7.2.1
|
||||
"@gfazioli/mantine-onboarding-tour": ^4.0.5
|
||||
'@gfazioli/mantine-onboarding-tour': ^4.0.5
|
||||
"@gitbeaker/rest": ^43.8.0
|
||||
"@homarr/gridstack": ^1.12.0
|
||||
"@homarr/node-unifi": ^2.6.0
|
||||
@@ -191,7 +191,7 @@ catalog:
|
||||
zod-form-data: ^3.0.2
|
||||
zod-validation-error: ^5.0.0
|
||||
catalogMode: strict
|
||||
enableGlobalVirtualStore: true
|
||||
nodeLinker: hoisted
|
||||
strictPeerDependencies: false
|
||||
engineStrict: true
|
||||
verifyDepsBeforeRun: warn
|
||||
|
||||
Reference in new issue
Block a user