A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.
feat(board): add mobile home board (#1910)
Meier Lukase01d74f4f89a
diff --git a/apps/nextjs/src/app/[locale]/boards/[name]/settings/page.tsx b/apps/nextjs/src/app/[locale]/boards/[name]/settings/page.tsxindex 36818573a..1ffb892d1 100644--- a/apps/nextjs/src/app/[locale]/boards/[name]/settings/page.tsx+++ b/apps/nextjs/src/app/[locale]/boards/[name]/settings/page.tsx@@ -101,7 +101,11 @@ export default async function BoardSettingsPage(props: Props) {<BoardAccessSettings board={board} initialPermissions={permissions} /></AccordionItemFor><AccordionItemFor value="dangerZone" icon={IconAlertTriangle} danger noPadding>- <DangerZoneSettingsContent hideVisibility={boardSettings.homeBoardId === board.id} />+ <DangerZoneSettingsContent+ hideVisibility={+ boardSettings.homeBoardId === board.id || boardSettings.mobileHomeBoardId === board.id+ }+ /></AccordionItemFor></>)}diff --git a/apps/nextjs/src/app/[locale]/manage/boards/_components/board-card-menu-dropdown.tsx b/apps/nextjs/src/app/[locale]/manage/boards/_components/board-card-menu-dropdown.tsxindex eef7dedb2..68ecf3a57 100644--- a/apps/nextjs/src/app/[locale]/manage/boards/_components/board-card-menu-dropdown.tsx+++ b/apps/nextjs/src/app/[locale]/manage/boards/_components/board-card-menu-dropdown.tsx@@ -3,7 +3,7 @@import { useCallback } from "react";import Link from "next/link";import { Menu } from "@mantine/core";-import { IconCopy, IconHome, IconSettings, IconTrash } from "@tabler/icons-react";+import { IconCopy, IconDeviceMobile, IconHome, IconSettings, IconTrash } from "@tabler/icons-react";import type { RouterOutputs } from "@homarr/api";import { clientApi } from "@homarr/api/client";@@ -43,6 +43,12 @@ export const BoardCardMenuDropdown = ({ board }: BoardCardMenuDropdownProps) =>await revalidatePathActionAsync("/");},});+ const setMobileHomeBoardMutation = clientApi.board.setMobileHomeBoard.useMutation({+ onSettled: async () => {+ // Revalidate all as it's part of the user settings, /boards page and board manage page+ await revalidatePathActionAsync("/");+ },+ });const deleteBoardMutation = clientApi.board.deleteBoard.useMutation({onSettled: async () => {await revalidatePathActionAsync("/manage/boards");@@ -68,6 +74,10 @@ export const BoardCardMenuDropdown = ({ board }: BoardCardMenuDropdownProps) =>await setHomeBoardMutation.mutateAsync({ id: board.id });}, [board.id, setHomeBoardMutation]);+ const handleSetMobileHomeBoard = useCallback(async () => {+ await setMobileHomeBoardMutation.mutateAsync({ id: board.id });+ }, [board.id, setMobileHomeBoardMutation]);+const handleDuplicateBoard = useCallback(() => {openDuplicateModal({board: {@@ -85,6 +95,9 @@ export const BoardCardMenuDropdown = ({ board }: BoardCardMenuDropdownProps) =><Menu.Item onClick={handleSetHomeBoard} leftSection={<IconHome {...iconProps} />}>{t("setHomeBoard.label")}</Menu.Item>+ <Menu.Item onClick={handleSetMobileHomeBoard} leftSection={<IconDeviceMobile {...iconProps} />}>+ {t("setMobileHomeBoard.label")}+ </Menu.Item>{session?.user.permissions.includes("board-create") && (<Menu.Item onClick={handleDuplicateBoard} leftSection={<IconCopy {...iconProps} />}>{t("duplicate.label")}diff --git a/apps/nextjs/src/app/[locale]/manage/boards/page.tsx b/apps/nextjs/src/app/[locale]/manage/boards/page.tsxindex 2b1529894..4974b6a86 100644--- a/apps/nextjs/src/app/[locale]/manage/boards/page.tsx+++ b/apps/nextjs/src/app/[locale]/manage/boards/page.tsx@@ -15,7 +15,7 @@ import {Title,Tooltip,} from "@mantine/core";-import { IconDotsVertical, IconHomeFilled, IconLock, IconWorld } from "@tabler/icons-react";+import { IconDeviceMobile, IconDotsVertical, IconHomeFilled, IconLock, IconWorld } from "@tabler/icons-react";import type { RouterOutputs } from "@homarr/api";import { api } from "@homarr/api/server";@@ -88,6 +88,14 @@ const BoardCard = async ({ board }: BoardCardProps) => {</Tooltip>)}+ {board.isMobileHome && (+ <Tooltip label={t("action.setMobileHomeBoard.badge.tooltip")}>+ <Badge tt="none" color="yellow" variant="light" leftSection={<IconDeviceMobile size=".7rem" />}>+ {t("action.setMobileHomeBoard.badge.label")}+ </Badge>+ </Tooltip>+ )}+{board.creator && (<Group gap="xs"><UserAvatar user={board.creator} size="sm" />diff --git a/apps/nextjs/src/app/[locale]/manage/settings/_components/board-settings-form.tsx b/apps/nextjs/src/app/[locale]/manage/settings/_components/board-settings-form.tsxindex 8890cbce0..69f2329b0 100644--- a/apps/nextjs/src/app/[locale]/manage/settings/_components/board-settings-form.tsx+++ b/apps/nextjs/src/app/[locale]/manage/settings/_components/board-settings-form.tsx@@ -37,6 +37,25 @@ export const BoardSettingsForm = ({ defaultValues }: { defaultValues: ServerSett)}{...form.getInputProps("homeBoardId")}/>+ <SelectWithCustomItems+ label={tBoard("homeBoard.mobileLabel")}+ description={tBoard("homeBoard.description")}+ data={selectableBoards.map((board) => ({+ value: board.id,+ label: board.name,+ image: board.logoImageUrl,+ }))}+ SelectOption={({ label, image }: { value: string; label: string; image: string | null }) => (+ <Group>+ {/* eslint-disable-next-line @next/next/no-img-element */}+ {image ? <img width={16} height={16} src={image} alt={label} /> : <IconLayoutDashboard size={16} />}+ <Text fz="sm" fw={500}>+ {label}+ </Text>+ </Group>+ )}+ {...form.getInputProps("mobileHomeBoardId")}+ /></>)}</CommonSettingsForm>diff --git a/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/_change-home-board.tsx b/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/_change-home-board.tsxindex b6fe54770..1666e15b2 100644--- a/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/_change-home-board.tsx+++ b/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/_change-home-board.tsx@@ -18,13 +18,14 @@ interface ChangeHomeBoardFormProps {export const ChangeHomeBoardForm = ({ user, boardsData }: ChangeHomeBoardFormProps) => {const t = useI18n();- const { mutate, isPending } = clientApi.user.changeHomeBoardId.useMutation({+ const { mutate, isPending } = clientApi.user.changeHomeBoards.useMutation({async onSettled() {await revalidatePathActionAsync(`/manage/users/${user.id}`);},onSuccess(_, variables) {form.setInitialValues({homeBoardId: variables.homeBoardId,+ mobileHomeBoardId: variables.mobileHomeBoardId,});showSuccessNotification({message: t("user.action.changeHomeBoard.notification.success.message"),@@ -36,9 +37,10 @@ export const ChangeHomeBoardForm = ({ user, boardsData }: ChangeHomeBoardFormPro});},});- const form = useZodForm(validation.user.changeHomeBoard, {+ const form = useZodForm(validation.user.changeHomeBoards, {initialValues: {homeBoardId: user.homeBoardId ?? "",+ mobileHomeBoardId: user.mobileHomeBoardId ?? "",},});@@ -52,7 +54,18 @@ export const ChangeHomeBoardForm = ({ user, boardsData }: ChangeHomeBoardFormProreturn (<form onSubmit={form.onSubmit(handleSubmit)}><Stack gap="md">- <Select w="100%" data={boardsData} {...form.getInputProps("homeBoardId")} />+ <Select+ label={t("management.page.user.setting.general.item.board.type.general")}+ w="100%"+ data={boardsData}+ {...form.getInputProps("homeBoardId")}+ />+ <Select+ label={t("management.page.user.setting.general.item.board.type.mobile")}+ w="100%"+ data={boardsData}+ {...form.getInputProps("mobileHomeBoardId")}+ /><Group justify="end"><Button type="submit" color="teal" loading={isPending}>@@ -64,4 +77,4 @@ export const ChangeHomeBoardForm = ({ user, boardsData }: ChangeHomeBoardFormPro);};-type FormType = z.infer<typeof validation.user.changeHomeBoard>;+type FormType = z.infer<typeof validation.user.changeHomeBoards>;diff --git a/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/page.tsx b/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/page.tsxindex 8753412b2..23d167e5b 100644--- a/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/page.tsx+++ b/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/page.tsx@@ -89,7 +89,7 @@ export default async function EditUserPage(props: Props) {</Stack><Stack mb="lg">- <Title order={2}>{tGeneral("item.board")}</Title>+ <Title order={2}>{tGeneral("item.board.title")}</Title><ChangeHomeBoardFormuser={user}boardsData={boards.map((board) => ({diff --git a/packages/api/src/router/board.ts b/packages/api/src/router/board.tsindex 182fc90d4..1fc1b9abf 100644--- a/packages/api/src/router/board.ts+++ b/packages/api/src/router/board.ts@@ -2,7 +2,8 @@ import { TRPCError } from "@trpc/server";import superjson from "superjson";import { constructBoardPermissions } from "@homarr/auth/shared";-import type { Database, InferInsertModel, SQL } from "@homarr/db";+import type { DeviceType } from "@homarr/common/server";+import type { Database, InferInsertModel, InferSelectModel, SQL } from "@homarr/db";import { and, createId, eq, inArray, like, or } from "@homarr/db";import { getServerSettingByKeyAsync } from "@homarr/db/queries";import {@@ -121,6 +122,7 @@ export const boardRouter = createTRPCRouter({return dbBoards.map((board) => ({...board,isHome: currentUserWhenPresent?.homeBoardId === board.id,+ isMobileHome: currentUserWhenPresent?.mobileHomeBoardId === board.id,}));}),search: publicProcedure@@ -194,6 +196,7 @@ export const boardRouter = createTRPCRouter({logoImageUrl: board.logoImageUrl,permissions: constructBoardPermissions(board, ctx.session),isHome: currentUserWhenPresent?.homeBoardId === board.id,+ isMobileHome: currentUserWhenPresent?.mobileHomeBoardId === board.id,}));}),createBoard: permissionRequiredProcedure@@ -336,7 +339,10 @@ export const boardRouter = createTRPCRouter({await throwIfActionForbiddenAsync(ctx, eq(boards.id, input.id), "full");const boardSettings = await getServerSettingByKeyAsync(ctx.db, "board");- if (input.visibility !== "public" && boardSettings.homeBoardId === input.id) {+ if (+ input.visibility !== "public" &&+ (boardSettings.homeBoardId === input.id || boardSettings.mobileHomeBoardId === input.id)+ ) {throw new TRPCError({code: "BAD_REQUEST",message: "Cannot make home board private",@@ -358,30 +364,30 @@ export const boardRouter = createTRPCRouter({await ctx.db.update(users).set({ homeBoardId: input.id }).where(eq(users.id, ctx.session.user.id));}),+ setMobileHomeBoard: protectedProcedure.input(z.object({ id: z.string() })).mutation(async ({ ctx, input }) => {+ await throwIfActionForbiddenAsync(ctx, eq(boards.id, input.id), "view");++ await ctx.db.update(users).set({ mobileHomeBoardId: input.id }).where(eq(users.id, ctx.session.user.id));+ }),getHomeBoard: publicProcedure.query(async ({ ctx }) => {const userId = ctx.session?.user.id;const user = userId- ? await ctx.db.query.users.findFirst({+ ? ((await ctx.db.query.users.findFirst({where: eq(users.id, userId),- })+ })) ?? null): null;- // 1. user home board, 2. home board, 3. not found- let boardWhere: SQL<unknown> | null = null;- if (user?.homeBoardId) {- boardWhere = eq(boards.id, user.homeBoardId);- } else {- const boardSettings = await getServerSettingByKeyAsync(ctx.db, "board");- boardWhere = boardSettings.homeBoardId ? eq(boards.id, boardSettings.homeBoardId) : null;- }+ const homeBoardId = await getHomeIdBoardAsync(ctx.db, user, ctx.deviceType);- if (!boardWhere) {+ if (!homeBoardId) {throw new TRPCError({code: "NOT_FOUND",message: "No home board found",});}+ const boardWhere = eq(boards.id, homeBoardId);+await throwIfActionForbiddenAsync(ctx, boardWhere, "view");return await getFullBoardWithWhereAsync(ctx.db, boardWhere, ctx.session?.user.id ?? null);@@ -692,6 +698,29 @@ export const boardRouter = createTRPCRouter({}),});+/**+ * Get the home board id of the user with the given device type+ * For an example of a user with deviceType = 'mobile' it would go through the following order:+ * 1. user.mobileHomeBoardId+ * 2. user.homeBoardId+ * 3. serverSettings.mobileHomeBoardId+ * 4. serverSettings.homeBoardId+ * 5. show NOT_FOUND error+ */+const getHomeIdBoardAsync = async (+ db: Database,+ user: InferSelectModel<typeof users> | null,+ deviceType: DeviceType,+) => {+ const settingKey = deviceType === "mobile" ? "mobileHomeBoardId" : "homeBoardId";+ if (user?.[settingKey] || user?.homeBoardId) {+ return user[settingKey] ?? user.homeBoardId;+ } else {+ const boardSettings = await getServerSettingByKeyAsync(db, "board");+ return boardSettings[settingKey] ?? boardSettings.homeBoardId;+ }+};+const noBoardWithSimilarNameAsync = async (db: Database, name: string, ignoredIds: string[] = []) => {const boards = await db.query.boards.findMany({columns: {diff --git a/packages/api/src/router/test/app.spec.ts b/packages/api/src/router/test/app.spec.tsindex 4da8a6117..488a2ed8f 100644--- a/packages/api/src/router/test/app.spec.ts+++ b/packages/api/src/router/test/app.spec.ts@@ -24,6 +24,7 @@ describe("all should return all apps", () => {const db = createDb();const caller = appRouter.createCaller({db,+ deviceType: undefined,session: createDefaultSession(),});@@ -55,6 +56,7 @@ describe("all should return all apps", () => {// Arrangeconst caller = appRouter.createCaller({db: createDb(),+ deviceType: undefined,session: null,});@@ -72,6 +74,7 @@ describe("byId should return an app by id", () => {const db = createDb();const caller = appRouter.createCaller({db,+ deviceType: undefined,session: null,});vi.spyOn(appAccessControl, "canUserSeeAppAsync").mockReturnValue(Promise.resolve(true));@@ -103,6 +106,7 @@ describe("byId should return an app by id", () => {const db = createDb();const caller = appRouter.createCaller({db,+ deviceType: undefined,session: null,});await db.insert(apps).values([@@ -128,6 +132,7 @@ describe("byId should return an app by id", () => {const db = createDb();const caller = appRouter.createCaller({db,+ deviceType: undefined,session: null,});@@ -145,6 +150,7 @@ describe("create should create a new app with all arguments", () => {const db = createDb();const caller = appRouter.createCaller({db,+ deviceType: undefined,session: createDefaultSession(["app-create"]),});const input = {@@ -171,6 +177,7 @@ describe("create should create a new app with all arguments", () => {const db = createDb();const caller = appRouter.createCaller({db,+ deviceType: undefined,session: createDefaultSession(["app-create"]),});const input = {@@ -199,6 +206,7 @@ describe("update should update an app", () => {const db = createDb();const caller = appRouter.createCaller({db,+ deviceType: undefined,session: createDefaultSession(["app-modify-all"]),});@@ -237,6 +245,7 @@ describe("update should update an app", () => {const db = createDb();const caller = appRouter.createCaller({db,+ deviceType: undefined,session: createDefaultSession(["app-modify-all"]),});@@ -261,6 +270,7 @@ describe("delete should delete an app", () => {const db = createDb();const caller = appRouter.createCaller({db,+ deviceType: undefined,session: createDefaultSession(["app-full-all"]),});diff --git a/packages/api/src/router/test/board.spec.ts b/packages/api/src/router/test/board.spec.tsindex 8c0da79e5..b829bf6c3 100644--- a/packages/api/src/router/test/board.spec.ts+++ b/packages/api/src/router/test/board.spec.ts@@ -52,7 +52,7 @@ describe("getAllBoards should return all boards accessable to the current user",test("without session it should return only public boards", async () => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: null });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: null });const user1 = await createRandomUserAsync(db);const user2 = await createRandomUserAsync(db);@@ -85,6 +85,7 @@ describe("getAllBoards should return all boards accessable to the current user",const db = createDb();const caller = boardRouter.createCaller({db,+ deviceType: undefined,session: {user: {id: defaultCreatorId,@@ -124,7 +125,7 @@ describe("getAllBoards should return all boards accessable to the current user",test("with session user beeing creator it should return all private boards of them", async () => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const user1 = await createRandomUserAsync(db);const user2 = await createRandomUserAsync(db);@@ -168,6 +169,7 @@ describe("getAllBoards should return all boards accessable to the current user",const db = createDb();const caller = boardRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});@@ -232,6 +234,7 @@ describe("getAllBoards should return all boards accessable to the current user",const db = createDb();const caller = boardRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});@@ -290,7 +293,7 @@ describe("createBoard should create a new board", () => {permissions: ["board-create"] satisfies GroupPermissionKey[],},};- const caller = boardRouter.createCaller({ db, session });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session });await db.insert(users).values({id: defaultCreatorId,@@ -316,7 +319,7 @@ describe("createBoard should create a new board", () => {test("should throw error when user has no board-create permission", async () => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () => await caller.createBoard({ name: "newBoard", columnCount: 12, isPublic: true });@@ -330,7 +333,7 @@ describe("rename board should rename board", () => {test("should rename board", async () => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");await db.insert(users).values({@@ -358,7 +361,7 @@ describe("rename board should rename board", () => {test("should throw error when similar board name exists", async () => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });await db.insert(users).values({id: defaultCreatorId,@@ -385,7 +388,7 @@ describe("rename board should rename board", () => {test("should throw error when board not found", async () => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () => await caller.renameBoard({ id: "nonExistentBoardId", name: "newName" });@@ -401,7 +404,7 @@ describe("changeBoardVisibility should change board visibility", () => {async (visibility) => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");await db.insert(users).values({@@ -436,7 +439,7 @@ describe("deleteBoard should delete board", () => {test("should delete board", async () => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");await db.insert(users).values({@@ -463,7 +466,7 @@ describe("deleteBoard should delete board", () => {test("should throw error when board not found", async () => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () => await caller.deleteBoard({ id: "nonExistentBoardId" });@@ -478,7 +481,7 @@ describe("getHomeBoard should return home board", () => {// Arrangeconst spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const fullBoardProps = await createFullBoardAsync(db, "home");await db@@ -502,7 +505,7 @@ describe("getHomeBoard should return home board", () => {// Arrangeconst spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const fullBoardProps = await createFullBoardAsync(db, "home");await db.insert(serverSettings).values({@@ -523,7 +526,7 @@ describe("getHomeBoard should return home board", () => {test("should throw error when home board not configured in serverSettings", async () => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });await createFullBoardAsync(db, "home");// Act@@ -539,7 +542,7 @@ describe("getBoardByName should return board by name", () => {// Arrangeconst spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const fullBoardProps = await createFullBoardAsync(db, name);@@ -557,7 +560,7 @@ describe("getBoardByName should return board by name", () => {it("should throw error when not present", async () => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });await createFullBoardAsync(db, "default");// Act@@ -573,7 +576,7 @@ describe("savePartialBoardSettings should save general settings", () => {// Arrangeconst spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const newPageTitle = "newPageTitle";const newMetaTitle = "newMetaTitle";@@ -633,7 +636,7 @@ describe("savePartialBoardSettings should save general settings", () => {it("should throw error when board not found", async () => {const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const actAsync = async () =>await caller.savePartialBoardSettings({@@ -652,7 +655,7 @@ describe("saveBoard should save full board", () => {it("should remove section when not present in input", async () => {const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const { boardId, sectionId } = await createFullBoardAsync(db, "default");@@ -689,7 +692,7 @@ describe("saveBoard should save full board", () => {it("should remove item when not present in input", async () => {const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const { boardId, itemId, sectionId } = await createFullBoardAsync(db, "default");@@ -744,7 +747,7 @@ describe("saveBoard should save full board", () => {it("should remove integration reference when not present in input", async () => {const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const anotherIntegration = {id: createId(),kind: "adGuardHome",@@ -814,7 +817,7 @@ describe("saveBoard should save full board", () => {async (partialSection) => {const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const { boardId, sectionId } = await createFullBoardAsync(db, "default");@@ -867,7 +870,7 @@ describe("saveBoard should save full board", () => {it("should add item when present in input", async () => {const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const { boardId, sectionId } = await createFullBoardAsync(db, "default");@@ -931,7 +934,7 @@ describe("saveBoard should save full board", () => {it("should add integration reference when present in input", async () => {const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const integration = {id: createId(),kind: "plex",@@ -998,7 +1001,7 @@ describe("saveBoard should save full board", () => {});it("should update section when present in input", async () => {const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const { boardId, sectionId } = await createFullBoardAsync(db, "default");const newSectionId = createId();@@ -1056,7 +1059,7 @@ describe("saveBoard should save full board", () => {it("should update item when present in input", async () => {const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const { boardId, itemId, sectionId } = await createFullBoardAsync(db, "default");@@ -1112,7 +1115,7 @@ describe("saveBoard should save full board", () => {});it("should fail when board not found", async () => {const db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const actAsync = async () =>await caller.saveBoard({@@ -1128,7 +1131,7 @@ describe("getBoardPermissions should return board permissions", () => {test("should return board permissions", async () => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const user1 = await createRandomUserAsync(db);@@ -1202,7 +1205,7 @@ describe("saveUserBoardPermissions should save user board permissions", () => {async (permission) => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");const user1 = await createRandomUserAsync(db);@@ -1244,7 +1247,7 @@ describe("saveGroupBoardPermissions should save group board permissions", () =>async (permission) => {// Arrangeconst db = createDb();- const caller = boardRouter.createCaller({ db, session: defaultSession });+ const caller = boardRouter.createCaller({ db, deviceType: undefined, session: defaultSession });const spy = vi.spyOn(boardAccess, "throwIfActionForbiddenAsync");await db.insert(users).values({diff --git a/packages/api/src/router/test/docker/docker-router.spec.ts b/packages/api/src/router/test/docker/docker-router.spec.tsindex f81313fe2..24e3793c4 100644--- a/packages/api/src/router/test/docker/docker-router.spec.ts+++ b/packages/api/src/router/test/docker/docker-router.spec.ts@@ -52,6 +52,7 @@ describe("All procedures should only be accessible for users with admin permissi// Arrangeconst caller = dockerRouter.createCaller({db: null as unknown as Database,+ deviceType: undefined,session: createSessionWithPermissions("admin"),});@@ -68,6 +69,7 @@ describe("All procedures should only be accessible for users with admin permissi);const caller = dockerRouter.createCaller({db: null as unknown as Database,+ deviceType: undefined,session: createSessionWithPermissions(...groupPermissionsWithoutAdmin),});@@ -81,6 +83,7 @@ describe("All procedures should only be accessible for users with admin permissi// Arrangeconst caller = dockerRouter.createCaller({db: null as unknown as Database,+ deviceType: undefined,session: null,});diff --git a/packages/api/src/router/test/group.spec.ts b/packages/api/src/router/test/group.spec.tsindex e3d989ab7..f4d879005 100644--- a/packages/api/src/router/test/group.spec.ts+++ b/packages/api/src/router/test/group.spec.ts@@ -37,7 +37,7 @@ describe("paginated should return a list of groups with pagination", () => {async (page, expectedCount) => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });await db.insert(groups).values([1, 2, 3, 4, 5].map((number) => ({@@ -60,7 +60,7 @@ describe("paginated should return a list of groups with pagination", () => {test("with 5 groups in database and pagesize set to 3 it should return total count 5", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });await db.insert(groups).values([1, 2, 3, 4, 5].map((number) => ({@@ -81,7 +81,7 @@ describe("paginated should return a list of groups with pagination", () => {test("groups should contain id, name, email and image of members", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const user = createDummyUser();await db.insert(users).values(user);@@ -117,7 +117,7 @@ describe("paginated should return a list of groups with pagination", () => {async (query, expectedCount, firstKey) => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });await db.insert(groups).values(["first", "second", "third", "forth", "fifth"].map((key, index) => ({@@ -140,7 +140,7 @@ describe("paginated should return a list of groups with pagination", () => {test("without admin permissions it should throw unauthorized error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: defaultSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () => await caller.getPaginated({});@@ -154,7 +154,7 @@ describe("byId should return group by id including members and permissions", ()test('should return group with id "1" with members and permissions', async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const user = createDummyUser();const groupId = "1";@@ -197,7 +197,7 @@ describe("byId should return group by id including members and permissions", ()test("with group id 1 and group 2 in database it should throw NOT_FOUND error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });await db.insert(groups).values({id: "2",@@ -214,7 +214,7 @@ describe("byId should return group by id including members and permissions", ()test("without admin permissions it should throw unauthorized error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: defaultSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () => await caller.getById({ id: "1" });@@ -228,7 +228,7 @@ describe("create should create group in database", () => {test("with valid input (64 character name) and non existing name it should be successful", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const name = "a".repeat(64);await db.insert(users).values(defaultSession.user);@@ -252,7 +252,7 @@ describe("create should create group in database", () => {test("with more than 64 characters name it should fail while validation", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const longName = "a".repeat(65);// Act@@ -273,7 +273,7 @@ describe("create should create group in database", () => {])("with similar name %s it should fail to create %s", async (similarName, nameToCreate) => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });await db.insert(groups).values({id: createId(),@@ -290,7 +290,7 @@ describe("create should create group in database", () => {test("without admin permissions it should throw unauthorized error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: defaultSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () => await caller.createGroup({ name: "test" });@@ -307,7 +307,7 @@ describe("update should update name with value that is no duplicate", () => {])("update should update name from %s to %s normalized", async (initialValue, updateValue, expectedValue) => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const groupId = createId();await db.insert(groups).values([@@ -340,7 +340,7 @@ describe("update should update name with value that is no duplicate", () => {])("with similar name %s it should fail to update %s", async (updateValue, initialDuplicate) => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const groupId = createId();await db.insert(groups).values([@@ -368,7 +368,7 @@ describe("update should update name with value that is no duplicate", () => {test("with non existing id it should throw not found error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });await db.insert(groups).values({id: createId(),@@ -389,7 +389,7 @@ describe("update should update name with value that is no duplicate", () => {test("without admin permissions it should throw unauthorized error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: defaultSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () =>@@ -407,7 +407,7 @@ describe("savePermissions should save permissions for group", () => {test("with existing group and permissions it should save permissions", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const groupId = createId();await db.insert(groups).values({@@ -437,7 +437,7 @@ describe("savePermissions should save permissions for group", () => {test("with non existing group it should throw not found error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });await db.insert(groups).values({id: createId(),@@ -458,7 +458,7 @@ describe("savePermissions should save permissions for group", () => {test("without admin permissions it should throw unauthorized error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: defaultSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () =>@@ -476,7 +476,7 @@ describe("transferOwnership should transfer ownership of group", () => {test("with existing group and user it should transfer ownership", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const groupId = createId();const newUserId = createId();@@ -513,7 +513,7 @@ describe("transferOwnership should transfer ownership of group", () => {test("with non existing group it should throw not found error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });await db.insert(groups).values({id: createId(),@@ -534,7 +534,7 @@ describe("transferOwnership should transfer ownership of group", () => {test("without admin permissions it should throw unauthorized error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: defaultSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () =>@@ -552,7 +552,7 @@ describe("deleteGroup should delete group", () => {test("with existing group it should delete group", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const groupId = createId();await db.insert(groups).values([@@ -581,7 +581,7 @@ describe("deleteGroup should delete group", () => {test("with non existing group it should throw not found error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });await db.insert(groups).values({id: createId(),@@ -601,7 +601,7 @@ describe("deleteGroup should delete group", () => {test("without admin permissions it should throw unauthorized error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: defaultSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () =>@@ -620,7 +620,7 @@ describe("addMember should add member to group", () => {const db = createDb();const spy = vi.spyOn(env, "env", "get");spy.mockReturnValue({ AUTH_PROVIDERS: ["credentials"] } as never);- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const groupId = createId();const userId = createId();@@ -658,7 +658,7 @@ describe("addMember should add member to group", () => {test("with non existing group it should throw not found error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });await db.insert(users).values({id: createId(),@@ -679,7 +679,7 @@ describe("addMember should add member to group", () => {test("without admin permissions it should throw unauthorized error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: defaultSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () =>@@ -697,7 +697,7 @@ describe("addMember should add member to group", () => {const db = createDb();const spy = vi.spyOn(env, "env", "get");spy.mockReturnValue({ AUTH_PROVIDERS: ["ldap"] } as never);- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const groupId = createId();const userId = createId();@@ -735,7 +735,7 @@ describe("removeMember should remove member from group", () => {const db = createDb();const spy = vi.spyOn(env, "env", "get");spy.mockReturnValue({ AUTH_PROVIDERS: ["credentials"] } as never);- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const groupId = createId();const userId = createId();@@ -776,7 +776,7 @@ describe("removeMember should remove member from group", () => {test("with non existing group it should throw not found error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });await db.insert(users).values({id: createId(),@@ -797,7 +797,7 @@ describe("removeMember should remove member from group", () => {test("without admin permissions it should throw unauthorized error", async () => {// Arrangeconst db = createDb();- const caller = groupRouter.createCaller({ db, session: defaultSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: defaultSession });// Actconst actAsync = async () =>@@ -815,7 +815,7 @@ describe("removeMember should remove member from group", () => {const db = createDb();const spy = vi.spyOn(env, "env", "get");spy.mockReturnValue({ AUTH_PROVIDERS: ["ldap"] } as never);- const caller = groupRouter.createCaller({ db, session: adminSession });+ const caller = groupRouter.createCaller({ db, deviceType: undefined, session: adminSession });const groupId = createId();const userId = createId();diff --git a/packages/api/src/router/test/integration/integration-router.spec.ts b/packages/api/src/router/test/integration/integration-router.spec.tsindex 6b8b48cc8..2aaf75a2f 100644--- a/packages/api/src/router/test/integration/integration-router.spec.ts+++ b/packages/api/src/router/test/integration/integration-router.spec.ts@@ -33,6 +33,7 @@ describe("all should return all integrations", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(),});@@ -63,6 +64,7 @@ describe("byId should return an integration by id", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-full-all"]),});@@ -89,6 +91,7 @@ describe("byId should return an integration by id", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-full-all"]),});@@ -100,6 +103,7 @@ describe("byId should return an integration by id", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-full-all"]),});@@ -147,6 +151,7 @@ describe("byId should return an integration by id", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-interact-all"]),});@@ -172,6 +177,7 @@ describe("create should create a new integration", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-create"]),});const input = {@@ -206,6 +212,7 @@ describe("create should create a new integration", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-create"]),});const input = {@@ -249,6 +256,7 @@ describe("create should create a new integration", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-interact-all"]),});const input = {@@ -272,6 +280,7 @@ describe("update should update an integration", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-full-all"]),});@@ -346,6 +355,7 @@ describe("update should update an integration", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-full-all"]),});@@ -364,6 +374,7 @@ describe("update should update an integration", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-interact-all"]),});@@ -386,6 +397,7 @@ describe("delete should delete an integration", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-full-all"]),});@@ -419,6 +431,7 @@ describe("delete should delete an integration", () => {const db = createDb();const caller = integrationRouter.createCaller({db,+ deviceType: undefined,session: defaultSessionWithPermissions(["integration-interact-all"]),});diff --git a/packages/api/src/router/test/invite.spec.ts b/packages/api/src/router/test/invite.spec.tsindex c03d9a180..fce81edd4 100644--- a/packages/api/src/router/test/invite.spec.ts+++ b/packages/api/src/router/test/invite.spec.ts@@ -38,6 +38,7 @@ describe("all should return all existing invites without sensitive informations"const db = createDb();const caller = inviteRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});@@ -72,6 +73,7 @@ describe("all should return all existing invites without sensitive informations"const db = createDb();const caller = inviteRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});@@ -111,6 +113,7 @@ describe("create should create a new invite expiring on the specified date withconst db = createDb();const caller = inviteRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});await db.insert(users).values({@@ -142,6 +145,7 @@ describe("delete should remove invite by id", () => {const db = createDb();const caller = inviteRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});@@ -179,6 +183,7 @@ describe("delete should remove invite by id", () => {const db = createDb();const caller = inviteRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});diff --git a/packages/api/src/router/test/serverSettings.spec.ts b/packages/api/src/router/test/serverSettings.spec.tsindex a3ae26422..f2d3d848c 100644--- a/packages/api/src/router/test/serverSettings.spec.ts+++ b/packages/api/src/router/test/serverSettings.spec.ts@@ -26,6 +26,7 @@ describe("getAll server settings", () => {const db = createDb();const caller = serverSettingsRouter.createCaller({db,+ deviceType: undefined,session: null,});@@ -44,6 +45,7 @@ describe("getAll server settings", () => {const db = createDb();const caller = serverSettingsRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});@@ -58,6 +60,7 @@ describe("saveSettings", () => {const db = createDb();const caller = serverSettingsRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});diff --git a/packages/api/src/router/test/user.spec.ts b/packages/api/src/router/test/user.spec.tsindex 9aa6e1c1b..fc5f5af13 100644--- a/packages/api/src/router/test/user.spec.ts+++ b/packages/api/src/router/test/user.spec.ts@@ -42,6 +42,7 @@ describe("initUser should initialize the first user", () => {await createOnboardingStepAsync(db, "user");const caller = userRouter.createCaller({db,+ deviceType: undefined,session: null,});@@ -65,6 +66,7 @@ describe("initUser should initialize the first user", () => {await createOnboardingStepAsync(db, "user");const caller = userRouter.createCaller({db,+ deviceType: undefined,session: null,});@@ -89,6 +91,7 @@ describe("initUser should initialize the first user", () => {await createOnboardingStepAsync(db, "user");const caller = userRouter.createCaller({db,+ deviceType: undefined,session: null,});@@ -109,6 +112,7 @@ describe("register should create a user with valid invitation", () => {const db = createDb();const caller = userRouter.createCaller({db,+ deviceType: undefined,session: null,});@@ -164,6 +168,7 @@ describe("register should create a user with valid invitation", () => {const db = createDb();const caller = userRouter.createCaller({db,+ deviceType: undefined,session: null,});@@ -206,6 +211,7 @@ describe("editProfile shoud update user", () => {const db = createDb();const caller = userRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});@@ -242,6 +248,7 @@ describe("editProfile shoud update user", () => {const db = createDb();const caller = userRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});@@ -277,6 +284,7 @@ describe("delete should delete user", () => {const db = createDb();const caller = userRouter.createCaller({db,+ deviceType: undefined,session: defaultSession,});diff --git a/packages/api/src/router/test/widgets/app.spec.ts b/packages/api/src/router/test/widgets/app.spec.tsindex a728f9a94..3aacd2f59 100644--- a/packages/api/src/router/test/widgets/app.spec.ts+++ b/packages/api/src/router/test/widgets/app.spec.ts@@ -18,6 +18,7 @@ describe("ping should call sendPingRequestAsync with url and return result", ()const db = createDb();const caller = appRouter.createCaller({db,+ deviceType: undefined,session: null,});spy.mockImplementation(() => Promise.resolve({ error: "error" }));@@ -37,6 +38,7 @@ describe("ping should call sendPingRequestAsync with url and return result", ()const db = createDb();const caller = appRouter.createCaller({db,+ deviceType: undefined,session: null,});spy.mockImplementation(() => Promise.resolve({ statusCode: 200 }));diff --git a/packages/api/src/router/user.ts b/packages/api/src/router/user.tsindex 168d850bb..0309fae64 100644--- a/packages/api/src/router/user.ts+++ b/packages/api/src/router/user.ts@@ -3,7 +3,7 @@ import { TRPCError } from "@trpc/server";import { createSaltAsync, hashPasswordAsync } from "@homarr/auth";import type { Database } from "@homarr/db";import { and, createId, eq, like } from "@homarr/db";-import { groupMembers, groupPermissions, groups, invites, users } from "@homarr/db/schema";+import { boards, groupMembers, groupPermissions, groups, invites, users } from "@homarr/db/schema";import { selectUserSchema } from "@homarr/db/validationSchemas";import { credentialsAdminGroup } from "@homarr/definitions";import type { SupportedAuthProvider } from "@homarr/definitions";@@ -18,6 +18,7 @@ import {protectedProcedure,publicProcedure,} from "../trpc";+import { throwIfActionForbiddenAsync } from "./board/board-access";import { throwIfCredentialsDisabled } from "./invite/checks";import { nextOnboardingStepAsync } from "./onboard/onboard-queries";@@ -209,6 +210,7 @@ export const userRouter = createTRPCRouter({image: true,provider: true,homeBoardId: true,+ mobileHomeBoardId: true,firstDayOfWeek: true,pingIconsEnabled: true,defaultSearchEngineId: true,@@ -232,6 +234,7 @@ export const userRouter = createTRPCRouter({image: true,provider: true,homeBoardId: true,+ mobileHomeBoardId: true,firstDayOfWeek: true,pingIconsEnabled: true,defaultSearchEngineId: true,@@ -373,8 +376,8 @@ export const userRouter = createTRPCRouter({}).where(eq(users.id, input.userId));}),- changeHomeBoardId: protectedProcedure- .input(convertIntersectionToZodObject(validation.user.changeHomeBoard.and(z.object({ userId: z.string() }))))+ changeHomeBoards: protectedProcedure+ .input(convertIntersectionToZodObject(validation.user.changeHomeBoards.and(z.object({ userId: z.string() })))).output(z.void()).meta({ openapi: { method: "PATCH", path: "/api/users/changeHome", tags: ["users"], protect: true } }).mutation(async ({ input, ctx }) => {@@ -401,10 +404,13 @@ export const userRouter = createTRPCRouter({});}+ await throwIfActionForbiddenAsync(ctx, eq(boards.id, input.userId), "view");+await ctx.db.update(users).set({homeBoardId: input.homeBoardId,+ mobileHomeBoardId: input.mobileHomeBoardId,}).where(eq(users.id, input.userId));}),diff --git a/packages/api/src/trpc.ts b/packages/api/src/trpc.tsindex 64a2bf1e3..6f88a8cd2 100644--- a/packages/api/src/trpc.ts+++ b/packages/api/src/trpc.ts@@ -12,6 +12,7 @@ import type { OpenApiMeta } from "trpc-to-openapi";import type { Session } from "@homarr/auth";import { FlattenError } from "@homarr/common";+import { userAgent } from "@homarr/common/server";import { db } from "@homarr/db";import type { GroupPermissionKey, OnboardingStep } from "@homarr/definitions";import { logger } from "@homarr/log";@@ -39,6 +40,7 @@ export const createTRPCContext = (opts: { headers: Headers; session: Session | nreturn {session,+ deviceType: userAgent(opts.headers).device.type,db,};};diff --git a/packages/common/src/server.ts b/packages/common/src/server.tsindex 6979f7b10..3b0958cbc 100644--- a/packages/common/src/server.ts+++ b/packages/common/src/server.ts@@ -1,2 +1,3 @@export * from "./security";export * from "./encryption";+export * from "./user-agent";diff --git a/packages/common/src/user-agent.ts b/packages/common/src/user-agent.tsnew file mode 100644index 000000000..b4a90dfb3--- /dev/null+++ b/packages/common/src/user-agent.ts@@ -0,0 +1,11 @@+import { userAgent as userAgentNextServer } from "next/server";++import type { Modify } from "./types";++export const userAgent = (headers: Headers) => {+ return userAgentNextServer({ headers }) as Omit<ReturnType<typeof userAgentNextServer>, "device"> & {+ device: Modify<ReturnType<typeof userAgentNextServer>["device"], { type: DeviceType }>;+ };+};++export type DeviceType = "console" | "mobile" | "tablet" | "smarttv" | "wearable" | "embedded" | undefined;diff --git a/packages/db/migrations/mysql/0020_salty_doorman.sql b/packages/db/migrations/mysql/0020_salty_doorman.sqlnew file mode 100644index 000000000..5a92f9205--- /dev/null+++ b/packages/db/migrations/mysql/0020_salty_doorman.sql@@ -0,0 +1,2 @@+ALTER TABLE `user` ADD `mobile_home_board_id` varchar(64);--> statement-breakpoint+ALTER TABLE `user` ADD CONSTRAINT `user_mobile_home_board_id_board_id_fk` FOREIGN KEY (`mobile_home_board_id`) REFERENCES `board`(`id`) ON DELETE set null ON UPDATE no action;\ No newline at end of filediff --git a/packages/db/migrations/mysql/meta/0020_snapshot.json b/packages/db/migrations/mysql/meta/0020_snapshot.jsonnew file mode 100644index 000000000..02538145b--- /dev/null+++ b/packages/db/migrations/mysql/meta/0020_snapshot.json@@ -0,0 +1,1700 @@+{+ "version": "5",+ "dialect": "mysql",+ "id": "15a80313-f75e-4d8d-b9ec-8cb1de245493",+ "prevId": "0587ca9d-bbfc-4241-ba82-e52a7664a1dc",+ "tables": {+ "account": {+ "name": "account",+ "columns": {+ "user_id": {+ "name": "user_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "type": {+ "name": "type",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "provider": {+ "name": "provider",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "provider_account_id": {+ "name": "provider_account_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "refresh_token": {+ "name": "refresh_token",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "access_token": {+ "name": "access_token",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "expires_at": {+ "name": "expires_at",+ "type": "int",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "token_type": {+ "name": "token_type",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "scope": {+ "name": "scope",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "id_token": {+ "name": "id_token",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "session_state": {+ "name": "session_state",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {+ "userId_idx": {+ "name": "userId_idx",+ "columns": ["user_id"],+ "isUnique": false+ }+ },+ "foreignKeys": {+ "account_user_id_user_id_fk": {+ "name": "account_user_id_user_id_fk",+ "tableFrom": "account",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "account_provider_provider_account_id_pk": {+ "name": "account_provider_provider_account_id_pk",+ "columns": ["provider", "provider_account_id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "apiKey": {+ "name": "apiKey",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "api_key": {+ "name": "api_key",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "salt": {+ "name": "salt",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "apiKey_user_id_user_id_fk": {+ "name": "apiKey_user_id_user_id_fk",+ "tableFrom": "apiKey",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "apiKey_id": {+ "name": "apiKey_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "app": {+ "name": "app",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "icon_url": {+ "name": "icon_url",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "href": {+ "name": "href",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {+ "app_id": {+ "name": "app_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "boardGroupPermission": {+ "name": "boardGroupPermission",+ "columns": {+ "board_id": {+ "name": "board_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "group_id": {+ "name": "group_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "permission": {+ "name": "permission",+ "type": "varchar(128)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "boardGroupPermission_board_id_board_id_fk": {+ "name": "boardGroupPermission_board_id_board_id_fk",+ "tableFrom": "boardGroupPermission",+ "tableTo": "board",+ "columnsFrom": ["board_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "boardGroupPermission_group_id_group_id_fk": {+ "name": "boardGroupPermission_group_id_group_id_fk",+ "tableFrom": "boardGroupPermission",+ "tableTo": "group",+ "columnsFrom": ["group_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "boardGroupPermission_board_id_group_id_permission_pk": {+ "name": "boardGroupPermission_board_id_group_id_permission_pk",+ "columns": ["board_id", "group_id", "permission"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "boardUserPermission": {+ "name": "boardUserPermission",+ "columns": {+ "board_id": {+ "name": "board_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "permission": {+ "name": "permission",+ "type": "varchar(128)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "boardUserPermission_board_id_board_id_fk": {+ "name": "boardUserPermission_board_id_board_id_fk",+ "tableFrom": "boardUserPermission",+ "tableTo": "board",+ "columnsFrom": ["board_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "boardUserPermission_user_id_user_id_fk": {+ "name": "boardUserPermission_user_id_user_id_fk",+ "tableFrom": "boardUserPermission",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "boardUserPermission_board_id_user_id_permission_pk": {+ "name": "boardUserPermission_board_id_user_id_permission_pk",+ "columns": ["board_id", "user_id", "permission"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "board": {+ "name": "board",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "varchar(256)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "is_public": {+ "name": "is_public",+ "type": "boolean",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": false+ },+ "creator_id": {+ "name": "creator_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "page_title": {+ "name": "page_title",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "meta_title": {+ "name": "meta_title",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "logo_image_url": {+ "name": "logo_image_url",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "favicon_image_url": {+ "name": "favicon_image_url",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "background_image_url": {+ "name": "background_image_url",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "background_image_attachment": {+ "name": "background_image_attachment",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "('fixed')"+ },+ "background_image_repeat": {+ "name": "background_image_repeat",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "('no-repeat')"+ },+ "background_image_size": {+ "name": "background_image_size",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "('cover')"+ },+ "primary_color": {+ "name": "primary_color",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "('#fa5252')"+ },+ "secondary_color": {+ "name": "secondary_color",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "('#fd7e14')"+ },+ "opacity": {+ "name": "opacity",+ "type": "int",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 100+ },+ "custom_css": {+ "name": "custom_css",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "column_count": {+ "name": "column_count",+ "type": "int",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 10+ }+ },+ "indexes": {},+ "foreignKeys": {+ "board_creator_id_user_id_fk": {+ "name": "board_creator_id_user_id_fk",+ "tableFrom": "board",+ "tableTo": "user",+ "columnsFrom": ["creator_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "board_id": {+ "name": "board_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {+ "board_name_unique": {+ "name": "board_name_unique",+ "columns": ["name"]+ }+ },+ "checkConstraint": {}+ },+ "groupMember": {+ "name": "groupMember",+ "columns": {+ "group_id": {+ "name": "group_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "groupMember_group_id_group_id_fk": {+ "name": "groupMember_group_id_group_id_fk",+ "tableFrom": "groupMember",+ "tableTo": "group",+ "columnsFrom": ["group_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "groupMember_user_id_user_id_fk": {+ "name": "groupMember_user_id_user_id_fk",+ "tableFrom": "groupMember",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "groupMember_group_id_user_id_pk": {+ "name": "groupMember_group_id_user_id_pk",+ "columns": ["group_id", "user_id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "groupPermission": {+ "name": "groupPermission",+ "columns": {+ "group_id": {+ "name": "group_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "permission": {+ "name": "permission",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "groupPermission_group_id_group_id_fk": {+ "name": "groupPermission_group_id_group_id_fk",+ "tableFrom": "groupPermission",+ "tableTo": "group",+ "columnsFrom": ["group_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "group": {+ "name": "group",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "owner_id": {+ "name": "owner_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "group_owner_id_user_id_fk": {+ "name": "group_owner_id_user_id_fk",+ "tableFrom": "group",+ "tableTo": "user",+ "columnsFrom": ["owner_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "group_id": {+ "name": "group_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {+ "group_name_unique": {+ "name": "group_name_unique",+ "columns": ["name"]+ }+ },+ "checkConstraint": {}+ },+ "iconRepository": {+ "name": "iconRepository",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "slug": {+ "name": "slug",+ "type": "varchar(150)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {+ "iconRepository_id": {+ "name": "iconRepository_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "icon": {+ "name": "icon",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "varchar(250)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "url": {+ "name": "url",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "checksum": {+ "name": "checksum",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "icon_repository_id": {+ "name": "icon_repository_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "icon_icon_repository_id_iconRepository_id_fk": {+ "name": "icon_icon_repository_id_iconRepository_id_fk",+ "tableFrom": "icon",+ "tableTo": "iconRepository",+ "columnsFrom": ["icon_repository_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "icon_id": {+ "name": "icon_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "integrationGroupPermissions": {+ "name": "integrationGroupPermissions",+ "columns": {+ "integration_id": {+ "name": "integration_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "group_id": {+ "name": "group_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "permission": {+ "name": "permission",+ "type": "varchar(128)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "integrationGroupPermissions_integration_id_integration_id_fk": {+ "name": "integrationGroupPermissions_integration_id_integration_id_fk",+ "tableFrom": "integrationGroupPermissions",+ "tableTo": "integration",+ "columnsFrom": ["integration_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "integrationGroupPermissions_group_id_group_id_fk": {+ "name": "integrationGroupPermissions_group_id_group_id_fk",+ "tableFrom": "integrationGroupPermissions",+ "tableTo": "group",+ "columnsFrom": ["group_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "integration_group_permission__pk": {+ "name": "integration_group_permission__pk",+ "columns": ["integration_id", "group_id", "permission"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "integration_item": {+ "name": "integration_item",+ "columns": {+ "item_id": {+ "name": "item_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "integration_id": {+ "name": "integration_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "integration_item_item_id_item_id_fk": {+ "name": "integration_item_item_id_item_id_fk",+ "tableFrom": "integration_item",+ "tableTo": "item",+ "columnsFrom": ["item_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "integration_item_integration_id_integration_id_fk": {+ "name": "integration_item_integration_id_integration_id_fk",+ "tableFrom": "integration_item",+ "tableTo": "integration",+ "columnsFrom": ["integration_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "integration_item_item_id_integration_id_pk": {+ "name": "integration_item_item_id_integration_id_pk",+ "columns": ["item_id", "integration_id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "integrationSecret": {+ "name": "integrationSecret",+ "columns": {+ "kind": {+ "name": "kind",+ "type": "varchar(16)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "value": {+ "name": "value",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "updated_at": {+ "name": "updated_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "integration_id": {+ "name": "integration_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {+ "integration_secret__kind_idx": {+ "name": "integration_secret__kind_idx",+ "columns": ["kind"],+ "isUnique": false+ },+ "integration_secret__updated_at_idx": {+ "name": "integration_secret__updated_at_idx",+ "columns": ["updated_at"],+ "isUnique": false+ }+ },+ "foreignKeys": {+ "integrationSecret_integration_id_integration_id_fk": {+ "name": "integrationSecret_integration_id_integration_id_fk",+ "tableFrom": "integrationSecret",+ "tableTo": "integration",+ "columnsFrom": ["integration_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "integrationSecret_integration_id_kind_pk": {+ "name": "integrationSecret_integration_id_kind_pk",+ "columns": ["integration_id", "kind"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "integrationUserPermission": {+ "name": "integrationUserPermission",+ "columns": {+ "integration_id": {+ "name": "integration_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "permission": {+ "name": "permission",+ "type": "varchar(128)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "integrationUserPermission_integration_id_integration_id_fk": {+ "name": "integrationUserPermission_integration_id_integration_id_fk",+ "tableFrom": "integrationUserPermission",+ "tableTo": "integration",+ "columnsFrom": ["integration_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "integrationUserPermission_user_id_user_id_fk": {+ "name": "integrationUserPermission_user_id_user_id_fk",+ "tableFrom": "integrationUserPermission",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "integrationUserPermission_integration_id_user_id_permission_pk": {+ "name": "integrationUserPermission_integration_id_user_id_permission_pk",+ "columns": ["integration_id", "user_id", "permission"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "integration": {+ "name": "integration",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "url": {+ "name": "url",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "kind": {+ "name": "kind",+ "type": "varchar(128)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {+ "integration__kind_idx": {+ "name": "integration__kind_idx",+ "columns": ["kind"],+ "isUnique": false+ }+ },+ "foreignKeys": {},+ "compositePrimaryKeys": {+ "integration_id": {+ "name": "integration_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "invite": {+ "name": "invite",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "token": {+ "name": "token",+ "type": "varchar(512)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "expiration_date": {+ "name": "expiration_date",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "creator_id": {+ "name": "creator_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "invite_creator_id_user_id_fk": {+ "name": "invite_creator_id_user_id_fk",+ "tableFrom": "invite",+ "tableTo": "user",+ "columnsFrom": ["creator_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "invite_id": {+ "name": "invite_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {+ "invite_token_unique": {+ "name": "invite_token_unique",+ "columns": ["token"]+ }+ },+ "checkConstraint": {}+ },+ "item": {+ "name": "item",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "section_id": {+ "name": "section_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "kind": {+ "name": "kind",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "x_offset": {+ "name": "x_offset",+ "type": "int",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "y_offset": {+ "name": "y_offset",+ "type": "int",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "width": {+ "name": "width",+ "type": "int",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "height": {+ "name": "height",+ "type": "int",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "options": {+ "name": "options",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "('{\"json\": {}}')"+ },+ "advanced_options": {+ "name": "advanced_options",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "('{\"json\": {}}')"+ }+ },+ "indexes": {},+ "foreignKeys": {+ "item_section_id_section_id_fk": {+ "name": "item_section_id_section_id_fk",+ "tableFrom": "item",+ "tableTo": "section",+ "columnsFrom": ["section_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "item_id": {+ "name": "item_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "media": {+ "name": "media",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "varchar(512)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "content": {+ "name": "content",+ "type": "BLOB",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "content_type": {+ "name": "content_type",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "size": {+ "name": "size",+ "type": "int",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "(now())"+ },+ "creator_id": {+ "name": "creator_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "media_creator_id_user_id_fk": {+ "name": "media_creator_id_user_id_fk",+ "tableFrom": "media",+ "tableTo": "user",+ "columnsFrom": ["creator_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "media_id": {+ "name": "media_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "onboarding": {+ "name": "onboarding",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "step": {+ "name": "step",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "previous_step": {+ "name": "previous_step",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {+ "onboarding_id": {+ "name": "onboarding_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "search_engine": {+ "name": "search_engine",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "icon_url": {+ "name": "icon_url",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "short": {+ "name": "short",+ "type": "varchar(8)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "url_template": {+ "name": "url_template",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "type": {+ "name": "type",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'generic'"+ },+ "integration_id": {+ "name": "integration_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "search_engine_integration_id_integration_id_fk": {+ "name": "search_engine_integration_id_integration_id_fk",+ "tableFrom": "search_engine",+ "tableTo": "integration",+ "columnsFrom": ["integration_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "search_engine_id": {+ "name": "search_engine_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {+ "search_engine_short_unique": {+ "name": "search_engine_short_unique",+ "columns": ["short"]+ }+ },+ "checkConstraint": {}+ },+ "section": {+ "name": "section",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "board_id": {+ "name": "board_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "kind": {+ "name": "kind",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "x_offset": {+ "name": "x_offset",+ "type": "int",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "y_offset": {+ "name": "y_offset",+ "type": "int",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "width": {+ "name": "width",+ "type": "int",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "height": {+ "name": "height",+ "type": "int",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "parent_section_id": {+ "name": "parent_section_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "section_board_id_board_id_fk": {+ "name": "section_board_id_board_id_fk",+ "tableFrom": "section",+ "tableTo": "board",+ "columnsFrom": ["board_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "section_parent_section_id_section_id_fk": {+ "name": "section_parent_section_id_section_id_fk",+ "tableFrom": "section",+ "tableTo": "section",+ "columnsFrom": ["parent_section_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "section_id": {+ "name": "section_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "serverSetting": {+ "name": "serverSetting",+ "columns": {+ "setting_key": {+ "name": "setting_key",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "value": {+ "name": "value",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "('{\"json\": {}}')"+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {+ "serverSetting_setting_key": {+ "name": "serverSetting_setting_key",+ "columns": ["setting_key"]+ }+ },+ "uniqueConstraints": {+ "serverSetting_settingKey_unique": {+ "name": "serverSetting_settingKey_unique",+ "columns": ["setting_key"]+ }+ },+ "checkConstraint": {}+ },+ "session": {+ "name": "session",+ "columns": {+ "session_token": {+ "name": "session_token",+ "type": "varchar(512)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "expires": {+ "name": "expires",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {+ "user_id_idx": {+ "name": "user_id_idx",+ "columns": ["user_id"],+ "isUnique": false+ }+ },+ "foreignKeys": {+ "session_user_id_user_id_fk": {+ "name": "session_user_id_user_id_fk",+ "tableFrom": "session",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "session_session_token": {+ "name": "session_session_token",+ "columns": ["session_token"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "user": {+ "name": "user",+ "columns": {+ "id": {+ "name": "id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "email": {+ "name": "email",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "email_verified": {+ "name": "email_verified",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "image": {+ "name": "image",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "password": {+ "name": "password",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "salt": {+ "name": "salt",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "provider": {+ "name": "provider",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'credentials'"+ },+ "home_board_id": {+ "name": "home_board_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "mobile_home_board_id": {+ "name": "mobile_home_board_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "default_search_engine_id": {+ "name": "default_search_engine_id",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "color_scheme": {+ "name": "color_scheme",+ "type": "varchar(5)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'dark'"+ },+ "first_day_of_week": {+ "name": "first_day_of_week",+ "type": "tinyint",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 1+ },+ "ping_icons_enabled": {+ "name": "ping_icons_enabled",+ "type": "boolean",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "user_home_board_id_board_id_fk": {+ "name": "user_home_board_id_board_id_fk",+ "tableFrom": "user",+ "tableTo": "board",+ "columnsFrom": ["home_board_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "user_mobile_home_board_id_board_id_fk": {+ "name": "user_mobile_home_board_id_board_id_fk",+ "tableFrom": "user",+ "tableTo": "board",+ "columnsFrom": ["mobile_home_board_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "user_default_search_engine_id_search_engine_id_fk": {+ "name": "user_default_search_engine_id_search_engine_id_fk",+ "tableFrom": "user",+ "tableTo": "search_engine",+ "columnsFrom": ["default_search_engine_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "user_id": {+ "name": "user_id",+ "columns": ["id"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ },+ "verificationToken": {+ "name": "verificationToken",+ "columns": {+ "identifier": {+ "name": "identifier",+ "type": "varchar(64)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "token": {+ "name": "token",+ "type": "varchar(512)",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "expires": {+ "name": "expires",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {+ "verificationToken_identifier_token_pk": {+ "name": "verificationToken_identifier_token_pk",+ "columns": ["identifier", "token"]+ }+ },+ "uniqueConstraints": {},+ "checkConstraint": {}+ }+ },+ "views": {},+ "_meta": {+ "schemas": {},+ "tables": {},+ "columns": {}+ },+ "internal": {+ "tables": {},+ "indexes": {}+ }+}diff --git a/packages/db/migrations/mysql/meta/_journal.json b/packages/db/migrations/mysql/meta/_journal.jsonindex 381e67a28..0cd3cfe2a 100644--- a/packages/db/migrations/mysql/meta/_journal.json+++ b/packages/db/migrations/mysql/meta/_journal.json@@ -141,6 +141,13 @@"when": 1735651231818,"tag": "0019_crazy_marvel_zombies","breakpoints": true+ },+ {+ "idx": 20,+ "version": "5",+ "when": 1736514409126,+ "tag": "0020_salty_doorman",+ "breakpoints": true}]}diff --git a/packages/db/migrations/sqlite/0020_empty_hellfire_club.sql b/packages/db/migrations/sqlite/0020_empty_hellfire_club.sqlnew file mode 100644index 000000000..095f964fa--- /dev/null+++ b/packages/db/migrations/sqlite/0020_empty_hellfire_club.sql@@ -0,0 +1 @@+ALTER TABLE `user` ADD `mobile_home_board_id` text REFERENCES board(id);\ No newline at end of filediff --git a/packages/db/migrations/sqlite/meta/0020_snapshot.json b/packages/db/migrations/sqlite/meta/0020_snapshot.jsonnew file mode 100644index 000000000..65af0e6a6--- /dev/null+++ b/packages/db/migrations/sqlite/meta/0020_snapshot.json@@ -0,0 +1,1625 @@+{+ "version": "6",+ "dialect": "sqlite",+ "id": "b3f4436c-11ae-4c7c-a242-ce4b2e134edd",+ "prevId": "08cb7257-ba7e-4d4e-9fe7-85656fc115b0",+ "tables": {+ "account": {+ "name": "account",+ "columns": {+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "type": {+ "name": "type",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "provider": {+ "name": "provider",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "provider_account_id": {+ "name": "provider_account_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "refresh_token": {+ "name": "refresh_token",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "access_token": {+ "name": "access_token",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "expires_at": {+ "name": "expires_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "token_type": {+ "name": "token_type",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "scope": {+ "name": "scope",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "id_token": {+ "name": "id_token",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "session_state": {+ "name": "session_state",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {+ "userId_idx": {+ "name": "userId_idx",+ "columns": ["user_id"],+ "isUnique": false+ }+ },+ "foreignKeys": {+ "account_user_id_user_id_fk": {+ "name": "account_user_id_user_id_fk",+ "tableFrom": "account",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "account_provider_provider_account_id_pk": {+ "columns": ["provider", "provider_account_id"],+ "name": "account_provider_provider_account_id_pk"+ }+ },+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "apiKey": {+ "name": "apiKey",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "api_key": {+ "name": "api_key",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "salt": {+ "name": "salt",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "apiKey_user_id_user_id_fk": {+ "name": "apiKey_user_id_user_id_fk",+ "tableFrom": "apiKey",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "app": {+ "name": "app",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "icon_url": {+ "name": "icon_url",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "href": {+ "name": "href",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "boardGroupPermission": {+ "name": "boardGroupPermission",+ "columns": {+ "board_id": {+ "name": "board_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "group_id": {+ "name": "group_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "permission": {+ "name": "permission",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "boardGroupPermission_board_id_board_id_fk": {+ "name": "boardGroupPermission_board_id_board_id_fk",+ "tableFrom": "boardGroupPermission",+ "tableTo": "board",+ "columnsFrom": ["board_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "boardGroupPermission_group_id_group_id_fk": {+ "name": "boardGroupPermission_group_id_group_id_fk",+ "tableFrom": "boardGroupPermission",+ "tableTo": "group",+ "columnsFrom": ["group_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "boardGroupPermission_board_id_group_id_permission_pk": {+ "columns": ["board_id", "group_id", "permission"],+ "name": "boardGroupPermission_board_id_group_id_permission_pk"+ }+ },+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "boardUserPermission": {+ "name": "boardUserPermission",+ "columns": {+ "board_id": {+ "name": "board_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "permission": {+ "name": "permission",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "boardUserPermission_board_id_board_id_fk": {+ "name": "boardUserPermission_board_id_board_id_fk",+ "tableFrom": "boardUserPermission",+ "tableTo": "board",+ "columnsFrom": ["board_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "boardUserPermission_user_id_user_id_fk": {+ "name": "boardUserPermission_user_id_user_id_fk",+ "tableFrom": "boardUserPermission",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "boardUserPermission_board_id_user_id_permission_pk": {+ "columns": ["board_id", "user_id", "permission"],+ "name": "boardUserPermission_board_id_user_id_permission_pk"+ }+ },+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "board": {+ "name": "board",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "is_public": {+ "name": "is_public",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": false+ },+ "creator_id": {+ "name": "creator_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "page_title": {+ "name": "page_title",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "meta_title": {+ "name": "meta_title",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "logo_image_url": {+ "name": "logo_image_url",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "favicon_image_url": {+ "name": "favicon_image_url",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "background_image_url": {+ "name": "background_image_url",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "background_image_attachment": {+ "name": "background_image_attachment",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'fixed'"+ },+ "background_image_repeat": {+ "name": "background_image_repeat",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'no-repeat'"+ },+ "background_image_size": {+ "name": "background_image_size",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'cover'"+ },+ "primary_color": {+ "name": "primary_color",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'#fa5252'"+ },+ "secondary_color": {+ "name": "secondary_color",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'#fd7e14'"+ },+ "opacity": {+ "name": "opacity",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 100+ },+ "custom_css": {+ "name": "custom_css",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "column_count": {+ "name": "column_count",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 10+ }+ },+ "indexes": {+ "board_name_unique": {+ "name": "board_name_unique",+ "columns": ["name"],+ "isUnique": true+ }+ },+ "foreignKeys": {+ "board_creator_id_user_id_fk": {+ "name": "board_creator_id_user_id_fk",+ "tableFrom": "board",+ "tableTo": "user",+ "columnsFrom": ["creator_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "groupMember": {+ "name": "groupMember",+ "columns": {+ "group_id": {+ "name": "group_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "groupMember_group_id_group_id_fk": {+ "name": "groupMember_group_id_group_id_fk",+ "tableFrom": "groupMember",+ "tableTo": "group",+ "columnsFrom": ["group_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "groupMember_user_id_user_id_fk": {+ "name": "groupMember_user_id_user_id_fk",+ "tableFrom": "groupMember",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "groupMember_group_id_user_id_pk": {+ "columns": ["group_id", "user_id"],+ "name": "groupMember_group_id_user_id_pk"+ }+ },+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "groupPermission": {+ "name": "groupPermission",+ "columns": {+ "group_id": {+ "name": "group_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "permission": {+ "name": "permission",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "groupPermission_group_id_group_id_fk": {+ "name": "groupPermission_group_id_group_id_fk",+ "tableFrom": "groupPermission",+ "tableTo": "group",+ "columnsFrom": ["group_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "group": {+ "name": "group",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "owner_id": {+ "name": "owner_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {+ "group_name_unique": {+ "name": "group_name_unique",+ "columns": ["name"],+ "isUnique": true+ }+ },+ "foreignKeys": {+ "group_owner_id_user_id_fk": {+ "name": "group_owner_id_user_id_fk",+ "tableFrom": "group",+ "tableTo": "user",+ "columnsFrom": ["owner_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "iconRepository": {+ "name": "iconRepository",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "slug": {+ "name": "slug",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "icon": {+ "name": "icon",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "url": {+ "name": "url",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "checksum": {+ "name": "checksum",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "icon_repository_id": {+ "name": "icon_repository_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "icon_icon_repository_id_iconRepository_id_fk": {+ "name": "icon_icon_repository_id_iconRepository_id_fk",+ "tableFrom": "icon",+ "tableTo": "iconRepository",+ "columnsFrom": ["icon_repository_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "integrationGroupPermissions": {+ "name": "integrationGroupPermissions",+ "columns": {+ "integration_id": {+ "name": "integration_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "group_id": {+ "name": "group_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "permission": {+ "name": "permission",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "integrationGroupPermissions_integration_id_integration_id_fk": {+ "name": "integrationGroupPermissions_integration_id_integration_id_fk",+ "tableFrom": "integrationGroupPermissions",+ "tableTo": "integration",+ "columnsFrom": ["integration_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "integrationGroupPermissions_group_id_group_id_fk": {+ "name": "integrationGroupPermissions_group_id_group_id_fk",+ "tableFrom": "integrationGroupPermissions",+ "tableTo": "group",+ "columnsFrom": ["group_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "integrationGroupPermissions_integration_id_group_id_permission_pk": {+ "columns": ["integration_id", "group_id", "permission"],+ "name": "integrationGroupPermissions_integration_id_group_id_permission_pk"+ }+ },+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "integration_item": {+ "name": "integration_item",+ "columns": {+ "item_id": {+ "name": "item_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "integration_id": {+ "name": "integration_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "integration_item_item_id_item_id_fk": {+ "name": "integration_item_item_id_item_id_fk",+ "tableFrom": "integration_item",+ "tableTo": "item",+ "columnsFrom": ["item_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "integration_item_integration_id_integration_id_fk": {+ "name": "integration_item_integration_id_integration_id_fk",+ "tableFrom": "integration_item",+ "tableTo": "integration",+ "columnsFrom": ["integration_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "integration_item_item_id_integration_id_pk": {+ "columns": ["item_id", "integration_id"],+ "name": "integration_item_item_id_integration_id_pk"+ }+ },+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "integrationSecret": {+ "name": "integrationSecret",+ "columns": {+ "kind": {+ "name": "kind",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "value": {+ "name": "value",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "updated_at": {+ "name": "updated_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "integration_id": {+ "name": "integration_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {+ "integration_secret__kind_idx": {+ "name": "integration_secret__kind_idx",+ "columns": ["kind"],+ "isUnique": false+ },+ "integration_secret__updated_at_idx": {+ "name": "integration_secret__updated_at_idx",+ "columns": ["updated_at"],+ "isUnique": false+ }+ },+ "foreignKeys": {+ "integrationSecret_integration_id_integration_id_fk": {+ "name": "integrationSecret_integration_id_integration_id_fk",+ "tableFrom": "integrationSecret",+ "tableTo": "integration",+ "columnsFrom": ["integration_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "integrationSecret_integration_id_kind_pk": {+ "columns": ["integration_id", "kind"],+ "name": "integrationSecret_integration_id_kind_pk"+ }+ },+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "integrationUserPermission": {+ "name": "integrationUserPermission",+ "columns": {+ "integration_id": {+ "name": "integration_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "permission": {+ "name": "permission",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "integrationUserPermission_integration_id_integration_id_fk": {+ "name": "integrationUserPermission_integration_id_integration_id_fk",+ "tableFrom": "integrationUserPermission",+ "tableTo": "integration",+ "columnsFrom": ["integration_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "integrationUserPermission_user_id_user_id_fk": {+ "name": "integrationUserPermission_user_id_user_id_fk",+ "tableFrom": "integrationUserPermission",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {+ "integrationUserPermission_integration_id_user_id_permission_pk": {+ "columns": ["integration_id", "user_id", "permission"],+ "name": "integrationUserPermission_integration_id_user_id_permission_pk"+ }+ },+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "integration": {+ "name": "integration",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "url": {+ "name": "url",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "kind": {+ "name": "kind",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {+ "integration__kind_idx": {+ "name": "integration__kind_idx",+ "columns": ["kind"],+ "isUnique": false+ }+ },+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "invite": {+ "name": "invite",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "token": {+ "name": "token",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "expiration_date": {+ "name": "expiration_date",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "creator_id": {+ "name": "creator_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {+ "invite_token_unique": {+ "name": "invite_token_unique",+ "columns": ["token"],+ "isUnique": true+ }+ },+ "foreignKeys": {+ "invite_creator_id_user_id_fk": {+ "name": "invite_creator_id_user_id_fk",+ "tableFrom": "invite",+ "tableTo": "user",+ "columnsFrom": ["creator_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "item": {+ "name": "item",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "section_id": {+ "name": "section_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "kind": {+ "name": "kind",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "x_offset": {+ "name": "x_offset",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "y_offset": {+ "name": "y_offset",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "width": {+ "name": "width",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "height": {+ "name": "height",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "options": {+ "name": "options",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'{\"json\": {}}'"+ },+ "advanced_options": {+ "name": "advanced_options",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'{\"json\": {}}'"+ }+ },+ "indexes": {},+ "foreignKeys": {+ "item_section_id_section_id_fk": {+ "name": "item_section_id_section_id_fk",+ "tableFrom": "item",+ "tableTo": "section",+ "columnsFrom": ["section_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "media": {+ "name": "media",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "content": {+ "name": "content",+ "type": "blob",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "content_type": {+ "name": "content_type",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "size": {+ "name": "size",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "created_at": {+ "name": "created_at",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "(unixepoch())"+ },+ "creator_id": {+ "name": "creator_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "media_creator_id_user_id_fk": {+ "name": "media_creator_id_user_id_fk",+ "tableFrom": "media",+ "tableTo": "user",+ "columnsFrom": ["creator_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "onboarding": {+ "name": "onboarding",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "step": {+ "name": "step",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "previous_step": {+ "name": "previous_step",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "search_engine": {+ "name": "search_engine",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "icon_url": {+ "name": "icon_url",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "short": {+ "name": "short",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "description": {+ "name": "description",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "url_template": {+ "name": "url_template",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "type": {+ "name": "type",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'generic'"+ },+ "integration_id": {+ "name": "integration_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {+ "search_engine_short_unique": {+ "name": "search_engine_short_unique",+ "columns": ["short"],+ "isUnique": true+ }+ },+ "foreignKeys": {+ "search_engine_integration_id_integration_id_fk": {+ "name": "search_engine_integration_id_integration_id_fk",+ "tableFrom": "search_engine",+ "tableTo": "integration",+ "columnsFrom": ["integration_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "section": {+ "name": "section",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "board_id": {+ "name": "board_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "kind": {+ "name": "kind",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "x_offset": {+ "name": "x_offset",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "y_offset": {+ "name": "y_offset",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "width": {+ "name": "width",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "height": {+ "name": "height",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "parent_section_id": {+ "name": "parent_section_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "section_board_id_board_id_fk": {+ "name": "section_board_id_board_id_fk",+ "tableFrom": "section",+ "tableTo": "board",+ "columnsFrom": ["board_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ },+ "section_parent_section_id_section_id_fk": {+ "name": "section_parent_section_id_section_id_fk",+ "tableFrom": "section",+ "tableTo": "section",+ "columnsFrom": ["parent_section_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "serverSetting": {+ "name": "serverSetting",+ "columns": {+ "setting_key": {+ "name": "setting_key",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "value": {+ "name": "value",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'{\"json\": {}}'"+ }+ },+ "indexes": {+ "serverSetting_settingKey_unique": {+ "name": "serverSetting_settingKey_unique",+ "columns": ["setting_key"],+ "isUnique": true+ }+ },+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "session": {+ "name": "session",+ "columns": {+ "session_token": {+ "name": "session_token",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "user_id": {+ "name": "user_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "expires": {+ "name": "expires",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {+ "user_id_idx": {+ "name": "user_id_idx",+ "columns": ["user_id"],+ "isUnique": false+ }+ },+ "foreignKeys": {+ "session_user_id_user_id_fk": {+ "name": "session_user_id_user_id_fk",+ "tableFrom": "session",+ "tableTo": "user",+ "columnsFrom": ["user_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "user": {+ "name": "user",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true,+ "autoincrement": false+ },+ "name": {+ "name": "name",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "email": {+ "name": "email",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "email_verified": {+ "name": "email_verified",+ "type": "integer",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "image": {+ "name": "image",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "password": {+ "name": "password",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "salt": {+ "name": "salt",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "provider": {+ "name": "provider",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'credentials'"+ },+ "home_board_id": {+ "name": "home_board_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "mobile_home_board_id": {+ "name": "mobile_home_board_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "default_search_engine_id": {+ "name": "default_search_engine_id",+ "type": "text",+ "primaryKey": false,+ "notNull": false,+ "autoincrement": false+ },+ "color_scheme": {+ "name": "color_scheme",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": "'dark'"+ },+ "first_day_of_week": {+ "name": "first_day_of_week",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": 1+ },+ "ping_icons_enabled": {+ "name": "ping_icons_enabled",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false,+ "default": false+ }+ },+ "indexes": {},+ "foreignKeys": {+ "user_home_board_id_board_id_fk": {+ "name": "user_home_board_id_board_id_fk",+ "tableFrom": "user",+ "tableTo": "board",+ "columnsFrom": ["home_board_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "user_mobile_home_board_id_board_id_fk": {+ "name": "user_mobile_home_board_id_board_id_fk",+ "tableFrom": "user",+ "tableTo": "board",+ "columnsFrom": ["mobile_home_board_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ },+ "user_default_search_engine_id_search_engine_id_fk": {+ "name": "user_default_search_engine_id_search_engine_id_fk",+ "tableFrom": "user",+ "tableTo": "search_engine",+ "columnsFrom": ["default_search_engine_id"],+ "columnsTo": ["id"],+ "onDelete": "set null",+ "onUpdate": "no action"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "checkConstraints": {}+ },+ "verificationToken": {+ "name": "verificationToken",+ "columns": {+ "identifier": {+ "name": "identifier",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "token": {+ "name": "token",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ },+ "expires": {+ "name": "expires",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "autoincrement": false+ }+ },+ "indexes": {},+ "foreignKeys": {},+ "compositePrimaryKeys": {+ "verificationToken_identifier_token_pk": {+ "columns": ["identifier", "token"],+ "name": "verificationToken_identifier_token_pk"+ }+ },+ "uniqueConstraints": {},+ "checkConstraints": {}+ }+ },+ "views": {},+ "enums": {},+ "_meta": {+ "schemas": {},+ "tables": {},+ "columns": {}+ },+ "internal": {+ "indexes": {}+ }+}diff --git a/packages/db/migrations/sqlite/meta/_journal.json b/packages/db/migrations/sqlite/meta/_journal.jsonindex 6de47a722..2f5e7b122 100644--- a/packages/db/migrations/sqlite/meta/_journal.json+++ b/packages/db/migrations/sqlite/meta/_journal.json@@ -141,6 +141,13 @@"when": 1735651175378,"tag": "0019_steady_darkhawk","breakpoints": true+ },+ {+ "idx": 20,+ "version": "6",+ "when": 1736510755691,+ "tag": "0020_empty_hellfire_club",+ "breakpoints": true}]}diff --git a/packages/db/schema/mysql.ts b/packages/db/schema/mysql.tsindex 9c7408e24..6b75bbf04 100644--- a/packages/db/schema/mysql.ts+++ b/packages/db/schema/mysql.ts@@ -62,6 +62,9 @@ export const users = mysqlTable("user", {homeBoardId: varchar({ length: 64 }).references((): AnyMySqlColumn => boards.id, {onDelete: "set null",}),+ mobileHomeBoardId: varchar({ length: 64 }).references((): AnyMySqlColumn => boards.id, {+ onDelete: "set null",+ }),defaultSearchEngineId: varchar({ length: 64 }).references(() => searchEngines.id, {onDelete: "set null",}),diff --git a/packages/db/schema/sqlite.ts b/packages/db/schema/sqlite.tsindex 5da9caa16..3640aefa4 100644--- a/packages/db/schema/sqlite.ts+++ b/packages/db/schema/sqlite.ts@@ -45,6 +45,9 @@ export const users = sqliteTable("user", {homeBoardId: text().references((): AnySQLiteColumn => boards.id, {onDelete: "set null",}),+ mobileHomeBoardId: text().references((): AnySQLiteColumn => boards.id, {+ onDelete: "set null",+ }),defaultSearchEngineId: text().references(() => searchEngines.id, {onDelete: "set null",}),diff --git a/packages/server-settings/src/index.ts b/packages/server-settings/src/index.tsindex 1381dc98f..35f73699f 100644--- a/packages/server-settings/src/index.ts+++ b/packages/server-settings/src/index.ts@@ -27,6 +27,7 @@ export const defaultServerSettings = {},board: {homeBoardId: null as string | null,+ mobileHomeBoardId: null as string | null,},appearance: {defaultColorScheme: "light" as ColorScheme,diff --git a/packages/spotlight/src/modes/app-integration-board/boards-search-group.tsx b/packages/spotlight/src/modes/app-integration-board/boards-search-group.tsxindex ca201b5bc..e093795f1 100644--- a/packages/spotlight/src/modes/app-integration-board/boards-search-group.tsx+++ b/packages/spotlight/src/modes/app-integration-board/boards-search-group.tsx@@ -1,5 +1,5 @@import { Group, Stack, Text } from "@mantine/core";-import { IconHome, IconLayoutDashboard, IconLink, IconSettings } from "@tabler/icons-react";+import { IconDeviceMobile, IconHome, IconLayoutDashboard, IconLink, IconSettings } from "@tabler/icons-react";import { clientApi } from "@homarr/api/client";import { useI18n } from "@homarr/translation/client";@@ -59,6 +59,30 @@ const boardChildrenOptions = createChildrenOptions<Board>({};},},+ {+ key: "mobileBoard",+ Component: () => {+ const t = useI18n();++ return (+ <Group mx="md" my="sm">+ <IconDeviceMobile stroke={1.5} />+ <Text>{t("search.mode.appIntegrationBoard.group.board.children.action.mobileBoard.label")}</Text>+ </Group>+ );+ },+ useInteraction(option) {+ const { mutateAsync } = clientApi.board.setMobileHomeBoard.useMutation();++ return {+ type: "javaScript",+ // eslint-disable-next-line no-restricted-syntax+ async onSelect() {+ await mutateAsync({ id: option.id });+ },+ };+ },+ },{key: "settings",Component: () => {diff --git a/packages/translation/src/lang/en.json b/packages/translation/src/lang/en.jsonindex 0f7f627c2..22e69f867 100644--- a/packages/translation/src/lang/en.json+++ b/packages/translation/src/lang/en.json@@ -2153,6 +2153,13 @@"tooltip": "This board will show as your home board"}},+ "setMobileHomeBoard": {+ "label": "Set as your mobile board",+ "badge": {+ "label": "Mobile",+ "tooltip": "This board will show as your mobile board"+ }+ },"duplicate": {"label": "Duplicate board"},@@ -2189,7 +2196,13 @@"title": "General","item": {"language": "Language & Region",- "board": "Home board",+ "board": {+ "title": "Home board",+ "type": {+ "general": "General",+ "mobile": "Mobile"+ }+ },"defaultSearchEngine": "Default search engine","firstDayOfWeek": "First day of the week","accessibility": "Accessibility"@@ -2349,6 +2362,7 @@"title": "Boards","homeBoard": {"label": "Global home board",+ "mobileLabel": "Global mobile board","description": "Only public boards are available for selection"}},@@ -2738,6 +2752,9 @@"homeBoard": {"label": "Set as home board"},+ "mobileBoard": {+ "label": "Set as mobile board"+ },"settings": {"label": "Open settings"}diff --git a/packages/validation/src/user.ts b/packages/validation/src/user.tsindex 6688cdcd8..c97ff5054 100644--- a/packages/validation/src/user.ts+++ b/packages/validation/src/user.ts@@ -106,7 +106,8 @@ const changePasswordSchema = addConfirmPasswordRefinement(baseChangePasswordScheconst changePasswordApiSchema = addConfirmPasswordRefinement(baseChangePasswordSchema);const changeHomeBoardSchema = z.object({- homeBoardId: z.string().min(1),+ homeBoardId: z.string().nullable(),+ mobileHomeBoardId: z.string().nullable(),});const changeDefaultSearchEngineSchema = z.object({@@ -135,7 +136,7 @@ export const userSchemas = {password: passwordSchema,editProfile: editProfileSchema,changePassword: changePasswordSchema,- changeHomeBoard: changeHomeBoardSchema,+ changeHomeBoards: changeHomeBoardSchema,changeDefaultSearchEngine: changeDefaultSearchEngineSchema,changePasswordApi: changePasswordApiSchema,changeColorScheme: changeColorSchemeSchema,