mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-31 11:49:14 +01:00
* feat: add object base64 hash method * chore: add script to add package * feat: add request-handler package * wip: add request handlers for all jobs and widget api procedures * wip: remove errors shown in logs, add missing decryption for secrets in cached-request-job-handler * wip: highly improve request handler, add request handlers for calendar, media-server, indexer-manager and more, add support for multiple inputs from job handler creator * refactor: move media-server requests to request-handler, add invalidation logic for dns-hole and media requests * refactor: remove unused integration item middleware * feat: add invalidation to switch entity action of smart-home * fix: lint issues * chore: use integration-kind-by-category instead of union for request-handlers * fix: build not working for tasks and websocket * refactor: add more logs * refactor: readd timestamp logic for diconnect status * fix: lint and typecheck issue * chore: address pull request feedback
16 lines
432 B
TypeScript
16 lines
432 B
TypeScript
import { hashKey } from "@tanstack/query-core";
|
|
|
|
export function objectKeys<O extends object>(obj: O): (keyof O)[] {
|
|
return Object.keys(obj) as (keyof O)[];
|
|
}
|
|
|
|
type Entries<T> = {
|
|
[K in keyof T]: [K, T[K]];
|
|
}[keyof 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");
|
|
};
|