feat: add import for config files from oldmarr (#1019)
* wip: add oldmarr config import
* wip: add support for wrong amount of categories / sections with autofix, color mapping, position adjustments of wrappers
* fix: lockfile broken
* feat: add support for form data trpc requests
* wip: improve file upload
* refactor: restructure import, add import configuration
* wip: add configurations for import to modal
* refactor: move oldmarr import to old-import package
* fix: column count not respects screen size for board
* feat: add beta badge for oldmarr config import
* chore: address pull request feedback
* fix: format issues
* fix: inconsistent versions
* fix: deepsource issues
* fix: revert {} to Record<string, never> convertion to prevent typecheck issue
* fix: inconsistent zod version
* fix: format issue
* chore: address pull request feedback
* fix: wrong import
* fix: broken lock file
* fix: inconsistent versions
* fix: format issues
This commit is contained in:
40
packages/old-schema/src/widget.ts
Normal file
40
packages/old-schema/src/widget.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { tileBaseSchema } from "./tile";
|
||||
|
||||
export const oldmarrWidgetKinds = [
|
||||
"calendar",
|
||||
"indexer-manager",
|
||||
"dashdot",
|
||||
"usenet",
|
||||
"weather",
|
||||
"torrents-status",
|
||||
"dlspeed",
|
||||
"date",
|
||||
"rss",
|
||||
"video-stream",
|
||||
"iframe",
|
||||
"media-server",
|
||||
"media-requests-list",
|
||||
"media-requests-stats",
|
||||
"dns-hole-summary",
|
||||
"dns-hole-controls",
|
||||
"bookmark",
|
||||
"notebook",
|
||||
"smart-home/entity-state",
|
||||
"smart-home/trigger-automation",
|
||||
"health-monitoring",
|
||||
"media-transcoding",
|
||||
] as const;
|
||||
|
||||
export type OldmarrWidgetKind = (typeof oldmarrWidgetKinds)[number];
|
||||
|
||||
export const oldmarrWidgetSchema = z
|
||||
.object({
|
||||
id: z.string(),
|
||||
type: z.enum(oldmarrWidgetKinds),
|
||||
properties: z.record(z.unknown()),
|
||||
})
|
||||
.and(tileBaseSchema);
|
||||
|
||||
export type OldmarrWidget = z.infer<typeof oldmarrWidgetSchema>;
|
||||
Reference in New Issue
Block a user