Compare commits

..
3 changed files with 18 additions and 11 deletions

No files matched your search

+14 -3
View File
@@ -1,5 +1,3 @@
import { hashKey } from "@tanstack/query-core";
export function objectKeys<O extends object>(obj: O): (keyof O)[] {
return Object.keys(obj) as (keyof O)[];
}
@@ -11,5 +9,18 @@ type Entries<T> = {
export const objectEntries = <T extends object>(obj: T) => Object.entries(obj) as Entries<T>;
export const hashObjectBase64 = (obj: object) => {
return Buffer.from(hashKey([obj])).toString("base64");
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");
};
@@ -1,5 +1,5 @@
import superjson from "superjson";
import Transport from "winston-transport";
import winston from "winston";
import type { RedisClient } from "../../redis/client";
import { createRedisClient } from "../../redis/client";
@@ -7,11 +7,7 @@ import { createRedisClient } from "../../redis/client";
const messageSymbol = Symbol.for("message");
const levelSymbol = Symbol.for("level");
//
// Inherit from `winston-transport` so you can take advantage
// of the base functionality and `.exceptions.handle()`.
//
export class RedisTransport extends Transport {
export class RedisTransport extends winston.Transport {
private redis: RedisClient | null = null;
public static readonly publishChannel = "pubSub:logging";
+2 -2
View File
@@ -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
nodeLinker: hoisted
enableGlobalVirtualStore: true
strictPeerDependencies: false
engineStrict: true
verifyDepsBeforeRun: warn