feat: add onboarding with oldmarr import (#1606)
This commit is contained in:
@@ -47,6 +47,8 @@ const integrationSchema = z.enum([
|
||||
"tdarr",
|
||||
]);
|
||||
|
||||
export type OldmarrIntegrationType = z.infer<typeof integrationSchema>;
|
||||
|
||||
const appIntegrationPropertySchema = z.object({
|
||||
type: z.enum(["private", "public"]),
|
||||
field: z.enum(["apiKey", "password", "username"]),
|
||||
|
||||
@@ -28,3 +28,5 @@ export const oldmarrConfigSchema = z.object({
|
||||
});
|
||||
|
||||
export type OldmarrConfig = z.infer<typeof oldmarrConfigSchema>;
|
||||
export type OldmarrCategorySection = z.infer<typeof categorySchema>;
|
||||
export type OldmarrEmptySection = z.infer<typeof wrapperSchema>;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
export type { OldmarrConfig } from "./config";
|
||||
export type { OldmarrConfig, OldmarrCategorySection, OldmarrEmptySection } from "./config";
|
||||
export { oldmarrConfigSchema } from "./config";
|
||||
export type { OldmarrApp } from "./app";
|
||||
export type { OldmarrApp, OldmarrIntegrationType } from "./app";
|
||||
export type { OldmarrWidget, OldmarrWidgetKind } from "./widget";
|
||||
export { oldmarrWidgetKinds } from "./widget";
|
||||
export { boardSizes } from "./tile";
|
||||
export type { BoardSize } from "./tile";
|
||||
|
||||
@@ -32,11 +32,17 @@ const accessSettingsSchema = z.object({
|
||||
allowGuests: z.boolean(),
|
||||
});
|
||||
|
||||
const gridstackSettingsSchema = z.object({
|
||||
columnCountSmall: z.number(),
|
||||
columnCountMedium: z.number(),
|
||||
columnCountLarge: z.number(),
|
||||
});
|
||||
const gridstackSettingsSchema = z
|
||||
.object({
|
||||
columnCountSmall: z.number(),
|
||||
columnCountMedium: z.number(),
|
||||
columnCountLarge: z.number(),
|
||||
})
|
||||
.catch({
|
||||
columnCountSmall: 3,
|
||||
columnCountMedium: 6,
|
||||
columnCountLarge: 12,
|
||||
});
|
||||
|
||||
const layoutSettingsSchema = z.object({
|
||||
enabledLeftSidebar: z.boolean(),
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { objectKeys } from "@homarr/common";
|
||||
|
||||
const createAreaSchema = <TType extends string, TPropertiesSchema extends z.AnyZodObject>(
|
||||
type: TType,
|
||||
propertiesSchema: TPropertiesSchema,
|
||||
@@ -53,3 +55,6 @@ export const tileBaseSchema = z.object({
|
||||
area: areaSchema,
|
||||
shape: shapeSchema,
|
||||
});
|
||||
|
||||
export const boardSizes = objectKeys(shapeSchema._def.shape());
|
||||
export type BoardSize = (typeof boardSizes)[number];
|
||||
|
||||
Reference in New Issue
Block a user