wcz-layout 9.6.6 → 9.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/components.mjs +7 -7
  2. package/dist/components.mjs.map +1 -1
  3. package/dist/data/client.d.mts +2 -1
  4. package/dist/data/client.mjs +2 -2
  5. package/dist/data/client.mjs.map +1 -1
  6. package/dist/data/server.d.mts +1 -1
  7. package/dist/data/server.mjs +2 -2
  8. package/dist/entra-CJSyeQsx.mjs.map +1 -1
  9. package/dist/{file-BTFDDalH.mjs → file-BWcNzq55.mjs} +4 -4
  10. package/dist/file-BWcNzq55.mjs.map +1 -0
  11. package/dist/{file-CuvAmdJW.mjs → file-DimNsRly.mjs} +3 -4
  12. package/dist/{file-CuvAmdJW.mjs.map → file-DimNsRly.mjs.map} +1 -1
  13. package/dist/index.d.mts +1 -0
  14. package/dist/index.mjs +53 -43
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/{peoplesoft-D4w8d4s1.d.mts → peoplesoft-CskGsqd6.d.mts} +2 -1
  17. package/dist/{peoplesoft-DGdM1bws.mjs → peoplesoft-DTPGpN2h.mjs} +2 -2
  18. package/dist/{peoplesoft-DGdM1bws.mjs.map → peoplesoft-DTPGpN2h.mjs.map} +1 -1
  19. package/dist/utils-DjdexspV.mjs.map +1 -1
  20. package/dist/vite.mjs.map +1 -1
  21. package/package.json +128 -127
  22. package/skills/data-grid/SKILL.md +142 -142
  23. package/skills/general/SKILL.md +94 -94
  24. package/skills/migrations/SKILL.md +6 -0
  25. package/skills/migrations/versions/migrate-v9-to-v10.tsx +9 -0
  26. package/skills/services/SKILL.md +31 -31
  27. package/skills/start/SKILL.md +47 -47
  28. package/skills/start/steps/01-git-setup.md +0 -1
  29. package/skills/start/steps/04-wicop-setup.md +105 -80
  30. package/skills/start/steps/05-database-setup.md +52 -44
  31. package/skills/start/steps/06-entra-setup.md +96 -98
  32. package/skills/start/steps/07-vault-setup.md +57 -17
  33. package/dist/file-BTFDDalH.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { n as RouterIconButton, t as RouterListItemButton } from "./RouterListItemButton-ULMlaQh6.mjs";
2
- import { a as fileQueryOptions, i as fileMetasQueryOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions } from "./file-CuvAmdJW.mjs";
2
+ import { a as fileQueryOptions, i as fileMetasQueryOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions } from "./file-DimNsRly.mjs";
3
3
  import { t as useDialogs } from "./useDialogs-BUzVrTSP.mjs";
4
4
  import { c } from "react/compiler-runtime";
5
5
  import { Box, Button, CircularProgress, Dialog, Divider, Fab, IconButton, ImageListItem, ImageListItemBar, Link, List, ListItemButton, ListItemIcon, ListItemText, Menu, Skeleton, Stack, Tab, Tooltip, Typography, useTheme } from "@mui/material";
@@ -150,9 +150,9 @@ const baseStyle = {
150
150
  };
151
151
  const Dropzone = (t0) => {
152
152
  const $ = c(32);
153
- if ($[0] !== "b5bf5b5d281edd44834873bfefae09761c13d535bf60e1ff80df8ed9edd6a03b") {
153
+ if ($[0] !== "835a1014bc277abe6d9ec1a05ba4c7bf5844ace27aac767fe4a606b16069e907") {
154
154
  for (let $i = 0; $i < 32; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
155
- $[0] = "b5bf5b5d281edd44834873bfefae09761c13d535bf60e1ff80df8ed9edd6a03b";
155
+ $[0] = "835a1014bc277abe6d9ec1a05ba4c7bf5844ace27aac767fe4a606b16069e907";
156
156
  }
157
157
  let progress;
158
158
  let props;
@@ -432,9 +432,9 @@ const ActionsMenu = (t0) => {
432
432
  const IMAGE_SIZE = 150;
433
433
  const FileViewerGrid = (t0) => {
434
434
  const $ = c(13);
435
- if ($[0] !== "bc5b647583214f754be7f38d757996f0eba6fa435240965b8abc15fa6f9a6a5c") {
435
+ if ($[0] !== "fb41b3b0b995b83bc7531222ea82e43374e75765dca0bbfabbc703db4b87aac4") {
436
436
  for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
437
- $[0] = "bc5b647583214f754be7f38d757996f0eba6fa435240965b8abc15fa6f9a6a5c";
437
+ $[0] = "fb41b3b0b995b83bc7531222ea82e43374e75765dca0bbfabbc703db4b87aac4";
438
438
  }
439
439
  const { sx, size, itemBar } = t0;
440
440
  const { fileMetas } = useFile();
@@ -576,9 +576,9 @@ const GridFileViewerItem = ({ meta, size, itemBar }) => {
576
576
  //#region src/components/file/fileViewer/FileViewerList.tsx
577
577
  const FileViewerList = (t0) => {
578
578
  const $ = c(6);
579
- if ($[0] !== "e722a3273480830659aee3fb7ea3f313b724a6b70ec66bb9e867418a71728eba") {
579
+ if ($[0] !== "90821c9c06bc31e3067959087f22fa79fc3b392b2e1718015a5455d608dce1c7") {
580
580
  for (let $i = 0; $i < 6; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
581
- $[0] = "e722a3273480830659aee3fb7ea3f313b724a6b70ec66bb9e867418a71728eba";
581
+ $[0] = "90821c9c06bc31e3067959087f22fa79fc3b392b2e1718015a5455d608dce1c7";
582
582
  }
583
583
  const { sx } = t0;
584
584
  const { fileMetas } = useFile();
@@ -1 +1 @@
1
- {"version":3,"file":"components.mjs","names":["reference","children","progress","sx","handleOnDownload","isDownloading","handleOnDelete","isDeleting","handleMenuClose","fileMeta","size","itemBar","sx","fileMeta","m","images","index","reference","reference","reference","reference","reference"],"sources":["../src/components/core/TypographyWithIcon.tsx","../src/components/core/Fullscreen.tsx","../src/components/file/Dropzone.tsx","../src/contexts/FileContext.ts","../src/components/file/fileViewer/common/ActionsMenu.tsx","../src/components/file/fileViewer/FileViewerGrid.tsx","../src/components/file/fileViewer/FileViewerList.tsx","../src/components/file/fileViewer/ImageViewer.tsx","../src/components/file/FileViewer.tsx","../src/components/data-grid/EditableColumnHeader.tsx","../src/components/router/RouterButton.tsx","../src/components/router/RouterFab.tsx","../src/components/router/RouterGridActionsCellItem.tsx","../src/components/router/RouterLink.tsx","../src/components/router/RouterTab.tsx","../src/components/router/RouterNotFound.tsx","../src/components/router/RouterError.tsx"],"sourcesContent":["import { Typography } from \"@mui/material\";\nimport type { TypographyProps } from \"@mui/material\";\n\ninterface TypographyWithIconProps extends TypographyProps {\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n gap?: number | string;\n}\n\nexport const TypographyWithIcon: React.FC<TypographyWithIconProps> = ({\n startIcon,\n endIcon,\n children,\n gap = 1,\n sx,\n ...props\n}) => (\n <Typography\n component=\"span\"\n sx={[\n {\n display: \"inline-flex\",\n alignItems: \"center\",\n verticalAlign: \"middle\",\n gap,\n \"& > svg\": { display: \"block\", flexShrink: 0 },\n },\n ...(Array.isArray(sx) ? sx : [sx]),\n ]}\n {...props}\n >\n {startIcon}\n {children}\n {endIcon}\n </Typography>\n);\n","import { Box } from \"@mui/material\";\nimport { useEffectEvent, useLayoutEffect, useRef, useState } from \"react\";\nimport type { BoxProps } from \"@mui/material\";\nimport type { FC } from \"react\";\n\nexport const Fullscreen: FC<BoxProps> = ({ children, sx, ...props }) => {\n const reference = useRef<HTMLDivElement | null>(null);\n const [height, setHeight] = useState<number>();\n\n const recompute = useEffectEvent(() => {\n if (!reference.current) return;\n const top = reference.current.getBoundingClientRect().top;\n const viewportHeight = window.visualViewport?.height ?? window.innerHeight;\n const avail = Math.max(0, Math.floor(viewportHeight - top));\n setHeight(avail);\n });\n\n useLayoutEffect(() => {\n const element = reference.current;\n if (!element) return;\n\n recompute();\n\n window.addEventListener(\"resize\", recompute);\n\n const ro = new ResizeObserver(recompute);\n ro.observe(document.documentElement);\n ro.observe(document.body);\n ro.observe(element);\n\n return () => {\n window.removeEventListener(\"resize\", recompute);\n ro.disconnect();\n };\n }, []);\n\n return (\n <Box\n ref={reference}\n sx={{\n display: \"flex\",\n flexDirection: \"column\",\n boxSizing: \"border-box\",\n minHeight: 0,\n width: \"100%\",\n overflow: \"auto\",\n height,\n ...sx,\n }}\n {...props}\n >\n {children}\n </Box>\n );\n};\n","import CloudUpload from \"@mui/icons-material/CloudUpload\";\r\nimport type { SxProps, Theme } from \"@mui/material\";\r\nimport { Box, CircularProgress, Typography, useTheme } from \"@mui/material\";\r\nimport type { CSSProperties, FC } from \"react\";\r\nimport type { DropzoneOptions } from \"react-dropzone\";\r\nimport { useDropzone } from \"react-dropzone\";\r\nimport { useTranslation } from \"react-i18next\";\r\n\r\nconst baseStyle: CSSProperties = {\r\n flex: 1,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n alignItems: \"center\",\r\n padding: \"20px\",\r\n borderWidth: 2,\r\n borderRadius: 2,\r\n borderStyle: \"dashed\",\r\n outline: \"none\",\r\n transition: \"border .24s ease-in-out\",\r\n cursor: \"pointer\",\r\n};\r\n\r\ninterface DropzoneProps extends DropzoneOptions {\r\n sx?: SxProps<Theme>;\r\n progress?: number;\r\n}\r\n\r\nexport const Dropzone: FC<DropzoneProps> = ({ sx, progress, ...props }) => {\r\n const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject } = useDropzone(props);\r\n const { t } = useTranslation();\r\n const theme = useTheme();\r\n\r\n const style = {\r\n ...baseStyle,\r\n cursor: progress ? \"progress\" : props.disabled ? \"not-allowed\" : \"pointer\",\r\n borderColor: (theme.vars || theme).palette.text.disabled,\r\n ...(isFocused ? { borderColor: (theme.vars || theme).palette.primary.main } : {}),\r\n ...(isDragAccept ? { borderColor: (theme.vars || theme).palette.success.main } : {}),\r\n ...(isDragReject ? { borderColor: (theme.vars || theme).palette.error.main } : {}),\r\n };\r\n\r\n return (\r\n <Box {...getRootProps({ style })} sx={sx}>\r\n <input {...getInputProps()} style={{ display: \"none\" }} />\r\n {progress ? (\r\n <CircularProgress size={24} variant=\"determinate\" value={progress} />\r\n ) : (\r\n <CloudUpload />\r\n )}\r\n <Typography>{t(\"Layout.File.DragSomeFilesHereOrClickToSelectThem\")}</Typography>\r\n </Box>\r\n );\r\n};\r\n","import { createContext, useContext } from \"react\";\nimport type { FileMeta } from \"../models/file/FileMeta\";\nimport type { FileActions } from \"~/models/file/FileActions\";\n\nexport interface FileContextValue {\n appName: string;\n fileMetas: Array<FileMeta>;\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\n actions?: FileActions;\n setImageId: (imageId: string) => void;\n}\n\nexport const FileContext = createContext<FileContextValue | null>(null);\n\nexport const useFile = () => {\n const context = useContext(FileContext);\n if (!context) {\n throw new Error(\"FileViewer components must be used within FileViewer\");\n }\n return context;\n};\n","import Delete from \"@mui/icons-material/Delete\";\nimport FileDownload from \"@mui/icons-material/FileDownload\";\nimport { List, ListItemButton, ListItemIcon, ListItemText, Menu } from \"@mui/material\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { useTranslation } from \"react-i18next\";\nimport type { FC } from \"react\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { useDialogs } from \"~/hooks/useDialogs\";\nimport { deleteFileMutationOptions, downloadFileMutationOptions } from \"~/data/client/file\";\nimport { rootRouteId, useMatch } from \"@tanstack/react-router\";\n\ninterface ActionsMenuProps {\n meta: FileMeta;\n menu: { mouseX: number; mouseY: number } | null;\n setMenu: (menu: { mouseX: number; mouseY: number } | null) => void;\n}\n\nexport const ActionsMenu: FC<ActionsMenuProps> = ({ meta, menu, setMenu }) => {\n const { t } = useTranslation();\n const { fileMetas, onDelete, actions, appName } = useFile();\n const { confirm } = useDialogs();\n\n const handleMenuClose = () => {\n setMenu(null);\n };\n\n const rootMatch = useMatch({ from: rootRouteId });\n const queryClient = rootMatch.context.queryClient;\n\n const { mutate: download, isPending: isDownloading } = useMutation(downloadFileMutationOptions());\n const { mutate: deleteFile, isPending: isDeleting } = useMutation(\n deleteFileMutationOptions({ queryClient }),\n );\n\n const handleOnDownload = () => {\n handleMenuClose();\n download({ id: meta.id, appName, fileName: meta.fileName, fileExtension: meta.fileExtension });\n };\n\n const handleOnDelete = async () => {\n if (!(await confirm(t(\"Layout.File.AreYouSureYouWantToDelete\", { name: meta.fileName }))))\n return;\n\n deleteFile({ id: meta.id, appName });\n handleMenuClose();\n\n if (onDelete) {\n const remainingFileMetas: Array<FileMeta> = fileMetas.filter((m) => m.id !== meta.id);\n onDelete({ remainingFileMetas, deletedFileMeta: meta });\n }\n };\n\n return (\n <Menu\n open={menu !== null}\n onClose={handleMenuClose}\n anchorReference=\"anchorPosition\"\n variant=\"menu\"\n anchorPosition={menu === null ? undefined : { top: menu.mouseY, left: menu.mouseX }}\n >\n <List disablePadding>\n {actions?.download !== false && (\n <ListItemButton onClick={handleOnDownload} disabled={isDownloading}>\n <ListItemIcon>\n <FileDownload />\n </ListItemIcon>\n <ListItemText>{t(\"Layout.File.Download\")}</ListItemText>\n </ListItemButton>\n )}\n {actions?.delete !== false && (\n <ListItemButton onClick={handleOnDelete} disabled={isDeleting}>\n <ListItemIcon>\n <Delete />\n </ListItemIcon>\n <ListItemText>{t(\"Layout.File.Delete\")}</ListItemText>\n </ListItemButton>\n )}\n </List>\n </Menu>\n );\n};\n","import MoreVert from \"@mui/icons-material/MoreVert\";\r\nimport {\r\n Box,\r\n IconButton,\r\n ImageListItem,\r\n ImageListItemBar,\r\n Skeleton,\r\n Stack,\r\n Tooltip,\r\n} from \"@mui/material\";\r\nimport { grey } from \"@mui/material/colors\";\r\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\r\nimport React, { Fragment, useEffect, useRef, useState } from \"react\";\r\nimport { useInView } from \"react-intersection-observer\";\r\nimport { ActionsMenu } from \"./common/ActionsMenu\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport type { SxProps, Theme } from \"@mui/material\";\r\nimport { useFile } from \"~/contexts/FileContext\";\r\nimport {\r\n downloadFileMutationOptions,\r\n fileQueryOptions,\r\n fileThumbnailQueryOptions,\r\n openFileMutationOptions,\r\n} from \"~/data/client/file\";\r\n\r\nconst IMAGE_SIZE = 150;\r\n\r\ntype FileViewerGridItemBar = \"hidden\" | \"always\" | \"onMouseEnter\";\r\n\r\nexport interface FileViewerGridProps {\r\n size?: number;\r\n itemBar?: FileViewerGridItemBar;\r\n sx?: SxProps<Theme>;\r\n}\r\n\r\nexport const FileViewerGrid: React.FC<FileViewerGridProps> = ({\r\n sx,\r\n size,\r\n itemBar,\r\n}) => {\r\n const { fileMetas } = useFile();\r\n\r\n return (\r\n <Stack direction=\"row\" spacing={1} sx={{ overflow: \"auto\", ...sx }}>\r\n {fileMetas.map((fileMeta) => (\r\n <GridFileViewerItem\r\n key={fileMeta.id}\r\n meta={fileMeta}\r\n size={size}\r\n itemBar={itemBar}\r\n />\r\n ))}\r\n </Stack>\r\n );\r\n};\r\n\r\ninterface GridFileViewerItemProps {\r\n meta: FileMeta;\r\n size?: number;\r\n itemBar?: FileViewerGridItemBar;\r\n}\r\n\r\nexport const GridFileViewerItem: React.FC<GridFileViewerItemProps> = ({\r\n meta,\r\n size,\r\n itemBar,\r\n}) => {\r\n const { setImageId, actions, appName } = useFile();\r\n const [showItemBar, setShowItemBar] = useState<boolean>(itemBar === \"always\");\r\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number } | null>(\r\n null,\r\n );\r\n const { ref, inView } = useInView();\r\n const queryClient = useQueryClient();\r\n const target = useRef<Window | null>(null);\r\n\r\n useEffect(() => {\r\n setShowItemBar(itemBar === \"always\");\r\n }, [itemBar]);\r\n\r\n const { data: source, isPending } = useQuery({\r\n ...fileThumbnailQueryOptions({ id: meta.id, appName }),\r\n enabled: inView,\r\n });\r\n\r\n const handleOnMouseEnter = () => setShowItemBar(true);\r\n const handleOnMouseLeave = () =>\r\n itemBar !== \"always\" && setShowItemBar(false);\r\n\r\n const openMenu = (event: React.MouseEvent) => {\r\n setMenu(\r\n menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null,\r\n );\r\n setTimeout(() => setShowItemBar(true));\r\n };\r\n\r\n const { mutate: openFile } = useMutation(openFileMutationOptions({ target }));\r\n const { mutate: download } = useMutation(downloadFileMutationOptions());\r\n\r\n const onClick = () => {\r\n switch (meta.mediaType) {\r\n case \"image\": {\r\n return setImageId(meta.id);\r\n }\r\n case \"application\":\r\n case \"video\": {\r\n target.current = window.open(\"about:blank\", \"_blank\");\r\n return openFile({ id: meta.id, appName });\r\n }\r\n default: {\r\n return download({\r\n id: meta.id,\r\n appName,\r\n fileName: meta.fileName,\r\n fileExtension: meta.fileExtension,\r\n });\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <Fragment>\r\n <ImageListItem\r\n sx={{ width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }}\r\n onMouseEnter={handleOnMouseEnter}\r\n onMouseLeave={handleOnMouseLeave}\r\n ref={ref}\r\n >\r\n {isPending ? (\r\n <Skeleton\r\n variant=\"rectangular\"\r\n width={size ?? IMAGE_SIZE}\r\n height={size ?? IMAGE_SIZE}\r\n />\r\n ) : (\r\n <Box\r\n component=\"img\"\r\n src={source}\r\n loading=\"lazy\"\r\n alt={\"thumbnail-\" + meta.id}\r\n onClick={onClick}\r\n onMouseEnter={() =>\r\n queryClient.prefetchQuery(\r\n fileQueryOptions({ id: meta.id, appName }),\r\n )\r\n }\r\n sx={{\r\n cursor: \"pointer\",\r\n objectFit: \"contain\",\r\n width: size ?? IMAGE_SIZE,\r\n height: size ?? IMAGE_SIZE,\r\n }}\r\n />\r\n )}\r\n {itemBar !== \"hidden\" && showItemBar && (\r\n <ImageListItemBar\r\n title={\r\n <Tooltip title={meta.fileName}>\r\n <Box>{meta.fileName}</Box>\r\n </Tooltip>\r\n }\r\n actionIcon={\r\n (actions?.download !== false || actions.delete !== false) && (\r\n <IconButton\r\n sx={{ color: grey[100] }}\r\n onClick={openMenu}\r\n aria-label=\"File actions\"\r\n >\r\n <MoreVert />\r\n </IconButton>\r\n )\r\n }\r\n />\r\n )}\r\n </ImageListItem>\r\n\r\n {(actions?.download !== false || actions.delete !== false) && (\r\n <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />\r\n )}\r\n </Fragment>\r\n );\r\n};\r\n","import AttachFile from \"@mui/icons-material/AttachFile\";\r\nimport Image from \"@mui/icons-material/Image\";\r\nimport MoreVert from \"@mui/icons-material/MoreVert\";\r\nimport SmartDisplay from \"@mui/icons-material/SmartDisplay\";\r\nimport { IconButton, List, ListItemButton, ListItemIcon, ListItemText } from \"@mui/material\";\r\nimport { Fragment, useRef, useState } from \"react\";\r\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\r\nimport { ActionsMenu } from \"./common/ActionsMenu\";\r\nimport type { FC } from \"react\";\r\nimport type { SxProps, Theme } from \"@mui/material\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { useFile } from \"~/contexts/FileContext\";\r\nimport {\r\n downloadFileMutationOptions,\r\n fileQueryOptions,\r\n openFileMutationOptions,\r\n} from \"~/data/client/file\";\r\n\r\nexport interface FileViewerListProps {\r\n sx?: SxProps<Theme>;\r\n}\r\n\r\nexport const FileViewerList: FC<FileViewerListProps> = ({ sx }) => {\r\n const { fileMetas } = useFile();\r\n\r\n return (\r\n <List dense sx={sx}>\r\n {fileMetas.map((fileMeta) => (\r\n <ListFileViewerItem key={fileMeta.id} meta={fileMeta} />\r\n ))}\r\n </List>\r\n );\r\n};\r\n\r\ninterface ListFileViewerItemProps {\r\n meta: FileMeta;\r\n}\r\n\r\nexport const ListFileViewerItem: React.FC<ListFileViewerItemProps> = ({ meta }) => {\r\n const { setImageId, actions, appName } = useFile();\r\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number } | null>(null);\r\n const queryClient = useQueryClient();\r\n const target = useRef<Window | null>(null);\r\n\r\n const openMenu = (event: React.MouseEvent) => {\r\n event.stopPropagation();\r\n setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);\r\n };\r\n\r\n const { mutate: openFile } = useMutation(openFileMutationOptions({ target }));\r\n const { mutate: download } = useMutation(downloadFileMutationOptions());\r\n\r\n const onClick = () => {\r\n switch (meta.mediaType) {\r\n case \"image\": {\r\n return setImageId(meta.id);\r\n }\r\n case \"application\":\r\n case \"video\": {\r\n target.current = window.open(\"about:blank\", \"_blank\");\r\n return openFile({ id: meta.id, appName });\r\n }\r\n default: {\r\n return download({\r\n id: meta.id,\r\n appName,\r\n fileName: meta.fileName,\r\n fileExtension: meta.fileExtension,\r\n });\r\n }\r\n }\r\n };\r\n\r\n const icon = () => {\r\n switch (meta.mediaType) {\r\n case \"image\": {\r\n return <Image />;\r\n }\r\n case \"video\": {\r\n return <SmartDisplay />;\r\n }\r\n default: {\r\n return <AttachFile />;\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <Fragment>\r\n <ListItemButton\r\n key={meta.id}\r\n onClick={onClick}\r\n onMouseEnter={() => queryClient.prefetchQuery(fileQueryOptions({ id: meta.id, appName }))}\r\n >\r\n <ListItemIcon>{icon()}</ListItemIcon>\r\n <ListItemText primary={`${meta.fileName}.${meta.fileExtension}`} />\r\n {(actions?.download !== false || actions.delete !== false) && (\r\n <IconButton edge=\"end\" onClick={openMenu} aria-label=\"File actions\">\r\n <MoreVert />\r\n </IconButton>\r\n )}\r\n </ListItemButton>\r\n\r\n {(actions?.download !== false || actions.delete !== false) && (\r\n <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />\r\n )}\r\n </Fragment>\r\n );\r\n};\r\n","import Close from \"@mui/icons-material/Close\";\nimport { Box, Dialog, Fab, Skeleton } from \"@mui/material\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport React, { useEffect } from \"react\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { fileQueryOptions } from \"~/data/client/file\";\n\ninterface ImageViewerProps {\n metaId: string;\n}\n\nexport const ImageViewer: React.FC<ImageViewerProps> = ({ metaId }) => {\n const { fileMetas, setImageId, appName } = useFile();\n\n const meta = fileMetas.find((m) => m.id === metaId);\n\n const { data: source, isPending } = useQuery({\n ...fileQueryOptions({ id: meta?.id ?? \"\", appName }),\n enabled: !!meta,\n });\n\n useEffect(() => {\n if (metaId) globalThis.addEventListener(\"keydown\", handleOnKeydown);\n\n return () => {\n globalThis.removeEventListener(\"keydown\", handleOnKeydown);\n };\n }, [metaId]);\n\n const handleOnKeydown = (event: KeyboardEvent) => {\n const images: Array<FileMeta> = fileMetas.filter((m) => m.mediaType === \"image\");\n const imageIndex: number = images.findIndex((m) => m.id === metaId);\n\n switch (event.key) {\n case \"ArrowLeft\": {\n return handleOnArrowLeft(images, imageIndex);\n }\n case \"ArrowRight\": {\n return handleOnArrowRight(images, imageIndex);\n }\n case \"Backspace\":\n case \"Escape\": {\n event.preventDefault();\n return onClose();\n }\n }\n };\n\n const handleOnArrowLeft = (images: Array<FileMeta>, index: number) => {\n if (index > 0) {\n const previousFile: FileMeta = images[index - 1];\n setImageId(previousFile.id);\n }\n };\n\n const handleOnArrowRight = (images: Array<FileMeta>, index: number) => {\n if (index < images.length - 1) {\n const nextFile: FileMeta = images[index + 1];\n setImageId(nextFile.id);\n }\n };\n\n const onClose = () => setImageId(\"\");\n\n if (!meta) return null;\n\n return (\n <Dialog open onClose={onClose} maxWidth=\"xl\">\n {isPending ? (\n <Skeleton\n variant=\"rectangular\"\n sx={{\n width: { xs: \"100vw\", sm: 600 },\n height: { xs: \"calc(100vh - 56px)\", sm: \"calc(100vh - 64px)\" },\n }}\n />\n ) : (\n <Box\n component=\"img\"\n src={source}\n alt={meta.fileName}\n sx={{\n maxWidth: \"100vw\",\n maxHeight: { xs: \"calc(100vh - 56px)\", sm: \"calc(100vh - 64px)\" },\n }}\n />\n )}\n\n <Fab\n size=\"medium\"\n onClick={onClose}\n aria-label=\"Close\"\n sx={{ position: \"fixed\", top: 8, right: 8 }}\n >\n <Close />\n </Fab>\n </Dialog>\n );\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport type { ComponentType, FC, ReactNode } from \"react\";\nimport { useState } from \"react\";\nimport { FileContext } from \"~/contexts/FileContext\";\nimport type { FileActions } from \"~/models/file/FileActions\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { fileMetasQueryOptions } from \"~/data/client/file\";\nimport type { FileViewerGridProps } from \"./fileViewer/FileViewerGrid\";\nimport { FileViewerGrid } from \"./fileViewer/FileViewerGrid\";\nimport type { FileViewerListProps } from \"./fileViewer/FileViewerList\";\nimport { FileViewerList } from \"./fileViewer/FileViewerList\";\nimport { ImageViewer } from \"./fileViewer/ImageViewer\";\n\ninterface FileViewerComponent {\n Grid: ComponentType<FileViewerGridProps>;\n List: ComponentType<FileViewerListProps>;\n}\n\ninterface FileViewerProps {\n appName: string;\n subId: string;\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\n actions?: FileActions;\n children: (component: FileViewerComponent) => ReactNode;\n}\n\nexport const FileViewer: FC<FileViewerProps> = ({\n appName,\n subId,\n onDelete,\n actions,\n children,\n}) => {\n const { data: fileMetas = [] } = useQuery({\n ...fileMetasQueryOptions({ appName, subId }),\n enabled: !!subId,\n });\n const [imageId, setImageId] = useState<string>(\"\");\n\n if (fileMetas.length === 0) return null;\n\n return (\n <FileContext.Provider value={{ appName, fileMetas, onDelete, actions, setImageId }}>\n {children({ Grid: FileViewerGrid, List: FileViewerList })}\n <ImageViewer metaId={imageId} />\n </FileContext.Provider>\n );\n};\n","import Edit from \"@mui/icons-material/Edit\";\nimport { TypographyWithIcon } from \"../core/TypographyWithIcon\";\nimport type { GridColumnHeaderParams, GridValidRowModel } from \"@mui/x-data-grid-premium\";\n\nexport const EditableColumnHeader = <T extends GridValidRowModel>({\n colDef,\n}: GridColumnHeaderParams<T>) => {\n return (\n <TypographyWithIcon\n endIcon={<Edit color=\"disabled\" fontSize=\"small\" />}\n variant=\"body2\"\n className=\"MuiDataGrid-columnHeaderTitle\"\n >\n {colDef.headerName}\n </TypographyWithIcon>\n );\n};\n","import { Button } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { ButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, ButtonProps<\"a\">>(\n function ButtonComponent(props, reference) {\n return <Button ref={reference} component=\"a\" {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { Fab } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { FabProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, FabProps<\"a\">>(\n function FabComponent(props, reference) {\n return <Fab ref={reference} component=\"a\" {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterFab: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { GridActionsCellItem } from \"@mui/x-data-grid-premium\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { GridActionsCellItemProps } from \"@mui/x-data-grid-premium\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLButtonElement, GridActionsCellItemProps>(\n function GridActionsCellItemComponent(props, reference) {\n return <GridActionsCellItem ref={reference} component=\"a\" {...props} />;\n },\n) as React.ForwardRefExoticComponent<\n GridActionsCellItemProps & React.RefAttributes<HTMLButtonElement>\n>;\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterGridActionsCellItem: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { Link } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { LinkProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, LinkProps>(\n function LinkComponent(props, reference) {\n return <Link ref={reference} {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterLink: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { Tab } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { TabProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, TabProps<\"a\">>(\n function TabComponent(props, reference) {\n return <Tab ref={reference} component=\"a\" {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterTab: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { Box, Divider, Typography } from \"@mui/material\";\nimport { useTranslation } from \"react-i18next\";\n\nexport function RouterNotFound() {\n const { t } = useTranslation();\n\n return (\n <Box\n sx={{\n height: \"100vh\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n textAlign: \"center\",\n px: 2,\n }}\n >\n <Box sx={{ display: \"flex\", alignItems: \"center\", mb: 4 }}>\n <Typography variant=\"h3\" component=\"span\" sx={{ fontWeight: 500, lineHeight: 1 }}>\n 404\n </Typography>\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\n <Typography variant=\"h5\" component=\"span\">\n {t(\"Layout.ThisPageCouldNotBeFound\")}\n </Typography>\n </Box>\n </Box>\n );\n}\n","import { Box, Divider, Typography } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\n\ninterface RouterErrorProps {\n error: ErrorComponentProps[\"error\"];\n}\n\nexport const RouterError: FC<RouterErrorProps> = ({ error }) => {\n return (\n <Box\n sx={{\n height: \"100vh\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n textAlign: \"center\",\n px: 2,\n }}\n >\n <Box sx={{ display: \"flex\", alignItems: \"center\", mb: 4 }}>\n <Typography variant=\"h3\" component=\"span\" sx={{ fontWeight: 500, lineHeight: 1 }}>\n {error.name || \"500\"}\n </Typography>\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\n <Typography variant=\"h5\" component=\"span\">\n {error.message}\n </Typography>\n </Box>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAa,sBAAyD,EACpE,WACA,SACA,UACA,MAAM,GACN,IACA,GAAG,YAEH,qBAAC,YAAD;CACE,WAAU;CACV,IAAI,CACF;EACE,SAAS;EACT,YAAY;EACZ,eAAe;EACf;EACA,WAAW;GAAE,SAAS;GAAS,YAAY;EAAE;CAC/C,GACA,GAAI,MAAM,QAAQ,EAAE,IAAI,KAAK,CAAC,EAAE,CAAE;CAEpC,GAAI;CAZN,UAAA;EAcG;EACA;EACA;CACS;;;;AC7Bd,MAAa,cAA2B,OAAA;CAAA,MAAA,IAAA,EAAA,EAAA;CAAA,IAAA,EAAA,OAAA,oEAAA;EAAA,KAAA,IAAA,KAAA,GAAA,KAAA,IAAA,MAAA,GAAA,EAAA,MAAA,OAAA,IAAA,2BAAA;EAAA,EAAA,KAAA;CAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,IAAA;EAAC,CAAA,CAAA,UAAA,OAAA,SAAA;EAA0B,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA;EAAA,WAAA,EAAA;EAAA,QAAA,EAAA;EAAA,KAAA,EAAA;CAAA;CACjE,MAAA,YAAkB,OAA8B,IAAI;CACpD,MAAA,CAAA,QAAA,aAA4B,SAAiB;CAAE,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EAEd,WAAA;GAC/B,IAAI,CAAC,UAAS,SAAQ;GACtB,MAAA,MAAY,UAAS,QAAQ,sBAAuB,CAAC,CAAA;GACrD,MAAA,iBAAuB,OAAM,gBAAuB,UAAI,OAAM;GAC9D,MAAA,QAA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AAA,SAAA;EAC1D,KAAA,oBAAC,YAAD;GAAoB,SAAA;GAAe,WAAA;GAChC,UAAA,MAAK;EADG,CAAA;EAEE,EAAA,KAAA,MAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,MAAA,EAAA,QAAA,IAAA;EAlBjB,KAAA,oBAAC,KAAD;GACM,IAAA;GAUJ,UAAA,qBAAC,KAAD;IAAS,IAAA;IAAT,UAAA;KACE;KAGA;KACA;IALE;;EAXF,CAAA;EAoBE,EAAA,KAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OApBN;AAoBM"}
1
+ {"version":3,"file":"components.mjs","names":["reference","children","progress","sx","handleOnDownload","isDownloading","handleOnDelete","isDeleting","handleMenuClose","fileMeta","size","itemBar","sx","fileMeta","m","images","index","reference","reference","reference","reference","reference"],"sources":["../src/components/core/TypographyWithIcon.tsx","../src/components/core/Fullscreen.tsx","../src/components/file/Dropzone.tsx","../src/contexts/FileContext.ts","../src/components/file/fileViewer/common/ActionsMenu.tsx","../src/components/file/fileViewer/FileViewerGrid.tsx","../src/components/file/fileViewer/FileViewerList.tsx","../src/components/file/fileViewer/ImageViewer.tsx","../src/components/file/FileViewer.tsx","../src/components/data-grid/EditableColumnHeader.tsx","../src/components/router/RouterButton.tsx","../src/components/router/RouterFab.tsx","../src/components/router/RouterGridActionsCellItem.tsx","../src/components/router/RouterLink.tsx","../src/components/router/RouterTab.tsx","../src/components/router/RouterNotFound.tsx","../src/components/router/RouterError.tsx"],"sourcesContent":["import { Typography } from \"@mui/material\";\nimport type { TypographyProps } from \"@mui/material\";\n\ninterface TypographyWithIconProps extends TypographyProps {\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n gap?: number | string;\n}\n\nexport const TypographyWithIcon: React.FC<TypographyWithIconProps> = ({\n startIcon,\n endIcon,\n children,\n gap = 1,\n sx,\n ...props\n}) => (\n <Typography\n component=\"span\"\n sx={[\n {\n display: \"inline-flex\",\n alignItems: \"center\",\n verticalAlign: \"middle\",\n gap,\n \"& > svg\": { display: \"block\", flexShrink: 0 },\n },\n ...(Array.isArray(sx) ? sx : [sx]),\n ]}\n {...props}\n >\n {startIcon}\n {children}\n {endIcon}\n </Typography>\n);\n","import { Box } from \"@mui/material\";\nimport { useEffectEvent, useLayoutEffect, useRef, useState } from \"react\";\nimport type { BoxProps } from \"@mui/material\";\nimport type { FC } from \"react\";\n\nexport const Fullscreen: FC<BoxProps> = ({ children, sx, ...props }) => {\n const reference = useRef<HTMLDivElement | null>(null);\n const [height, setHeight] = useState<number>();\n\n const recompute = useEffectEvent(() => {\n if (!reference.current) return;\n const top = reference.current.getBoundingClientRect().top;\n const viewportHeight = window.visualViewport?.height ?? window.innerHeight;\n const avail = Math.max(0, Math.floor(viewportHeight - top));\n setHeight(avail);\n });\n\n useLayoutEffect(() => {\n const element = reference.current;\n if (!element) return;\n\n recompute();\n\n window.addEventListener(\"resize\", recompute);\n\n const ro = new ResizeObserver(recompute);\n ro.observe(document.documentElement);\n ro.observe(document.body);\n ro.observe(element);\n\n return () => {\n window.removeEventListener(\"resize\", recompute);\n ro.disconnect();\n };\n }, []);\n\n return (\n <Box\n ref={reference}\n sx={{\n display: \"flex\",\n flexDirection: \"column\",\n boxSizing: \"border-box\",\n minHeight: 0,\n width: \"100%\",\n overflow: \"auto\",\n height,\n ...sx,\n }}\n {...props}\n >\n {children}\n </Box>\n );\n};\n","import CloudUpload from \"@mui/icons-material/CloudUpload\";\nimport type { SxProps, Theme } from \"@mui/material\";\nimport { Box, CircularProgress, Typography, useTheme } from \"@mui/material\";\nimport type { CSSProperties, FC } from \"react\";\nimport type { DropzoneOptions } from \"react-dropzone\";\nimport { useDropzone } from \"react-dropzone\";\nimport { useTranslation } from \"react-i18next\";\n\nconst baseStyle: CSSProperties = {\n flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n padding: \"20px\",\n borderWidth: 2,\n borderRadius: 2,\n borderStyle: \"dashed\",\n outline: \"none\",\n transition: \"border .24s ease-in-out\",\n cursor: \"pointer\",\n};\n\ninterface DropzoneProps extends DropzoneOptions {\n sx?: SxProps<Theme>;\n progress?: number;\n}\n\nexport const Dropzone: FC<DropzoneProps> = ({ sx, progress, ...props }) => {\n const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject } = useDropzone(props);\n const { t } = useTranslation();\n const theme = useTheme();\n\n const style = {\n ...baseStyle,\n cursor: progress ? \"progress\" : props.disabled ? \"not-allowed\" : \"pointer\",\n borderColor: (theme.vars || theme).palette.text.disabled,\n ...(isFocused ? { borderColor: (theme.vars || theme).palette.primary.main } : {}),\n ...(isDragAccept ? { borderColor: (theme.vars || theme).palette.success.main } : {}),\n ...(isDragReject ? { borderColor: (theme.vars || theme).palette.error.main } : {}),\n };\n\n return (\n <Box {...getRootProps({ style })} sx={sx}>\n <input {...getInputProps()} style={{ display: \"none\" }} />\n {progress ? (\n <CircularProgress size={24} variant=\"determinate\" value={progress} />\n ) : (\n <CloudUpload />\n )}\n <Typography>{t(\"Layout.File.DragSomeFilesHereOrClickToSelectThem\")}</Typography>\n </Box>\n );\n};\n","import { createContext, useContext } from \"react\";\nimport type { FileMeta } from \"../models/file/FileMeta\";\nimport type { FileActions } from \"~/models/file/FileActions\";\n\nexport interface FileContextValue {\n appName: string;\n fileMetas: Array<FileMeta>;\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\n actions?: FileActions;\n setImageId: (imageId: string) => void;\n}\n\nexport const FileContext = createContext<FileContextValue | null>(null);\n\nexport const useFile = () => {\n const context = useContext(FileContext);\n if (!context) {\n throw new Error(\"FileViewer components must be used within FileViewer\");\n }\n return context;\n};\n","import Delete from \"@mui/icons-material/Delete\";\nimport FileDownload from \"@mui/icons-material/FileDownload\";\nimport { List, ListItemButton, ListItemIcon, ListItemText, Menu } from \"@mui/material\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { useTranslation } from \"react-i18next\";\nimport type { FC } from \"react\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { useDialogs } from \"~/hooks/useDialogs\";\nimport { deleteFileMutationOptions, downloadFileMutationOptions } from \"~/data/client/file\";\nimport { rootRouteId, useMatch } from \"@tanstack/react-router\";\n\ninterface ActionsMenuProps {\n meta: FileMeta;\n menu: { mouseX: number; mouseY: number } | null;\n setMenu: (menu: { mouseX: number; mouseY: number } | null) => void;\n}\n\nexport const ActionsMenu: FC<ActionsMenuProps> = ({ meta, menu, setMenu }) => {\n const { t } = useTranslation();\n const { fileMetas, onDelete, actions, appName } = useFile();\n const { confirm } = useDialogs();\n\n const handleMenuClose = () => {\n setMenu(null);\n };\n\n const rootMatch = useMatch({ from: rootRouteId });\n const queryClient = rootMatch.context.queryClient;\n\n const { mutate: download, isPending: isDownloading } = useMutation(downloadFileMutationOptions());\n const { mutate: deleteFile, isPending: isDeleting } = useMutation(\n deleteFileMutationOptions({ queryClient }),\n );\n\n const handleOnDownload = () => {\n handleMenuClose();\n download({ id: meta.id, appName, fileName: meta.fileName, fileExtension: meta.fileExtension });\n };\n\n const handleOnDelete = async () => {\n if (!(await confirm(t(\"Layout.File.AreYouSureYouWantToDelete\", { name: meta.fileName }))))\n return;\n\n deleteFile({ id: meta.id, appName });\n handleMenuClose();\n\n if (onDelete) {\n const remainingFileMetas: Array<FileMeta> = fileMetas.filter((m) => m.id !== meta.id);\n onDelete({ remainingFileMetas, deletedFileMeta: meta });\n }\n };\n\n return (\n <Menu\n open={menu !== null}\n onClose={handleMenuClose}\n anchorReference=\"anchorPosition\"\n variant=\"menu\"\n anchorPosition={menu === null ? undefined : { top: menu.mouseY, left: menu.mouseX }}\n >\n <List disablePadding>\n {actions?.download !== false && (\n <ListItemButton onClick={handleOnDownload} disabled={isDownloading}>\n <ListItemIcon>\n <FileDownload />\n </ListItemIcon>\n <ListItemText>{t(\"Layout.File.Download\")}</ListItemText>\n </ListItemButton>\n )}\n {actions?.delete !== false && (\n <ListItemButton onClick={handleOnDelete} disabled={isDeleting}>\n <ListItemIcon>\n <Delete />\n </ListItemIcon>\n <ListItemText>{t(\"Layout.File.Delete\")}</ListItemText>\n </ListItemButton>\n )}\n </List>\n </Menu>\n );\n};\n","import MoreVert from \"@mui/icons-material/MoreVert\";\nimport {\n Box,\n IconButton,\n ImageListItem,\n ImageListItemBar,\n Skeleton,\n Stack,\n Tooltip,\n} from \"@mui/material\";\nimport { grey } from \"@mui/material/colors\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport React, { Fragment, useEffect, useRef, useState } from \"react\";\nimport { useInView } from \"react-intersection-observer\";\nimport { ActionsMenu } from \"./common/ActionsMenu\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport type { SxProps, Theme } from \"@mui/material\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport {\n downloadFileMutationOptions,\n fileQueryOptions,\n fileThumbnailQueryOptions,\n openFileMutationOptions,\n} from \"~/data/client/file\";\n\nconst IMAGE_SIZE = 150;\n\ntype FileViewerGridItemBar = \"hidden\" | \"always\" | \"onMouseEnter\";\n\nexport interface FileViewerGridProps {\n size?: number;\n itemBar?: FileViewerGridItemBar;\n sx?: SxProps<Theme>;\n}\n\nexport const FileViewerGrid: React.FC<FileViewerGridProps> = ({ sx, size, itemBar }) => {\n const { fileMetas } = useFile();\n\n return (\n <Stack direction=\"row\" spacing={1} sx={{ overflow: \"auto\", ...sx }}>\n {fileMetas.map((fileMeta) => (\n <GridFileViewerItem key={fileMeta.id} meta={fileMeta} size={size} itemBar={itemBar} />\n ))}\n </Stack>\n );\n};\n\ninterface GridFileViewerItemProps {\n meta: FileMeta;\n size?: number;\n itemBar?: FileViewerGridItemBar;\n}\n\nexport const GridFileViewerItem: React.FC<GridFileViewerItemProps> = ({ meta, size, itemBar }) => {\n const { setImageId, actions, appName } = useFile();\n const [showItemBar, setShowItemBar] = useState<boolean>(itemBar === \"always\");\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number } | null>(null);\n const { ref, inView } = useInView();\n const queryClient = useQueryClient();\n const target = useRef<Window | null>(null);\n\n useEffect(() => {\n setShowItemBar(itemBar === \"always\");\n }, [itemBar]);\n\n const { data: source, isPending } = useQuery({\n ...fileThumbnailQueryOptions({ id: meta.id, appName }),\n enabled: inView,\n });\n\n const handleOnMouseEnter = () => setShowItemBar(true);\n const handleOnMouseLeave = () => itemBar !== \"always\" && setShowItemBar(false);\n\n const openMenu = (event: React.MouseEvent) => {\n setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);\n setTimeout(() => setShowItemBar(true));\n };\n\n const { mutate: openFile } = useMutation(openFileMutationOptions({ target }));\n const { mutate: download } = useMutation(downloadFileMutationOptions());\n\n const onClick = () => {\n switch (meta.mediaType) {\n case \"image\": {\n return setImageId(meta.id);\n }\n case \"application\":\n case \"video\": {\n target.current = window.open(\"about:blank\", \"_blank\");\n return openFile({ id: meta.id, appName });\n }\n default: {\n return download({\n id: meta.id,\n appName,\n fileName: meta.fileName,\n fileExtension: meta.fileExtension,\n });\n }\n }\n };\n\n return (\n <Fragment>\n <ImageListItem\n sx={{ width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n ref={ref}\n >\n {isPending ? (\n <Skeleton variant=\"rectangular\" width={size ?? IMAGE_SIZE} height={size ?? IMAGE_SIZE} />\n ) : (\n <Box\n component=\"img\"\n src={source}\n loading=\"lazy\"\n alt={\"thumbnail-\" + meta.id}\n onClick={onClick}\n onMouseEnter={() =>\n queryClient.prefetchQuery(fileQueryOptions({ id: meta.id, appName }))\n }\n sx={{\n cursor: \"pointer\",\n objectFit: \"contain\",\n width: size ?? IMAGE_SIZE,\n height: size ?? IMAGE_SIZE,\n }}\n />\n )}\n {itemBar !== \"hidden\" && showItemBar && (\n <ImageListItemBar\n title={\n <Tooltip title={meta.fileName}>\n <Box>{meta.fileName}</Box>\n </Tooltip>\n }\n actionIcon={\n (actions?.download !== false || actions.delete !== false) && (\n <IconButton sx={{ color: grey[100] }} onClick={openMenu} aria-label=\"File actions\">\n <MoreVert />\n </IconButton>\n )\n }\n />\n )}\n </ImageListItem>\n\n {(actions?.download !== false || actions.delete !== false) && (\n <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />\n )}\n </Fragment>\n );\n};\n","import AttachFile from \"@mui/icons-material/AttachFile\";\nimport Image from \"@mui/icons-material/Image\";\nimport MoreVert from \"@mui/icons-material/MoreVert\";\nimport SmartDisplay from \"@mui/icons-material/SmartDisplay\";\nimport { IconButton, List, ListItemButton, ListItemIcon, ListItemText } from \"@mui/material\";\nimport { Fragment, useRef, useState } from \"react\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { ActionsMenu } from \"./common/ActionsMenu\";\nimport type { FC } from \"react\";\nimport type { SxProps, Theme } from \"@mui/material\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport {\n downloadFileMutationOptions,\n fileQueryOptions,\n openFileMutationOptions,\n} from \"~/data/client/file\";\n\nexport interface FileViewerListProps {\n sx?: SxProps<Theme>;\n}\n\nexport const FileViewerList: FC<FileViewerListProps> = ({ sx }) => {\n const { fileMetas } = useFile();\n\n return (\n <List dense sx={sx}>\n {fileMetas.map((fileMeta) => (\n <ListFileViewerItem key={fileMeta.id} meta={fileMeta} />\n ))}\n </List>\n );\n};\n\ninterface ListFileViewerItemProps {\n meta: FileMeta;\n}\n\nexport const ListFileViewerItem: React.FC<ListFileViewerItemProps> = ({ meta }) => {\n const { setImageId, actions, appName } = useFile();\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number } | null>(null);\n const queryClient = useQueryClient();\n const target = useRef<Window | null>(null);\n\n const openMenu = (event: React.MouseEvent) => {\n event.stopPropagation();\n setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);\n };\n\n const { mutate: openFile } = useMutation(openFileMutationOptions({ target }));\n const { mutate: download } = useMutation(downloadFileMutationOptions());\n\n const onClick = () => {\n switch (meta.mediaType) {\n case \"image\": {\n return setImageId(meta.id);\n }\n case \"application\":\n case \"video\": {\n target.current = window.open(\"about:blank\", \"_blank\");\n return openFile({ id: meta.id, appName });\n }\n default: {\n return download({\n id: meta.id,\n appName,\n fileName: meta.fileName,\n fileExtension: meta.fileExtension,\n });\n }\n }\n };\n\n const icon = () => {\n switch (meta.mediaType) {\n case \"image\": {\n return <Image />;\n }\n case \"video\": {\n return <SmartDisplay />;\n }\n default: {\n return <AttachFile />;\n }\n }\n };\n\n return (\n <Fragment>\n <ListItemButton\n key={meta.id}\n onClick={onClick}\n onMouseEnter={() => queryClient.prefetchQuery(fileQueryOptions({ id: meta.id, appName }))}\n >\n <ListItemIcon>{icon()}</ListItemIcon>\n <ListItemText primary={`${meta.fileName}.${meta.fileExtension}`} />\n {(actions?.download !== false || actions.delete !== false) && (\n <IconButton edge=\"end\" onClick={openMenu} aria-label=\"File actions\">\n <MoreVert />\n </IconButton>\n )}\n </ListItemButton>\n\n {(actions?.download !== false || actions.delete !== false) && (\n <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />\n )}\n </Fragment>\n );\n};\n","import Close from \"@mui/icons-material/Close\";\nimport { Box, Dialog, Fab, Skeleton } from \"@mui/material\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport React, { useEffect } from \"react\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { useFile } from \"~/contexts/FileContext\";\nimport { fileQueryOptions } from \"~/data/client/file\";\n\ninterface ImageViewerProps {\n metaId: string;\n}\n\nexport const ImageViewer: React.FC<ImageViewerProps> = ({ metaId }) => {\n const { fileMetas, setImageId, appName } = useFile();\n\n const meta = fileMetas.find((m) => m.id === metaId);\n\n const { data: source, isPending } = useQuery({\n ...fileQueryOptions({ id: meta?.id ?? \"\", appName }),\n enabled: !!meta,\n });\n\n useEffect(() => {\n if (metaId) globalThis.addEventListener(\"keydown\", handleOnKeydown);\n\n return () => {\n globalThis.removeEventListener(\"keydown\", handleOnKeydown);\n };\n }, [metaId]);\n\n const handleOnKeydown = (event: KeyboardEvent) => {\n const images: Array<FileMeta> = fileMetas.filter((m) => m.mediaType === \"image\");\n const imageIndex: number = images.findIndex((m) => m.id === metaId);\n\n switch (event.key) {\n case \"ArrowLeft\": {\n return handleOnArrowLeft(images, imageIndex);\n }\n case \"ArrowRight\": {\n return handleOnArrowRight(images, imageIndex);\n }\n case \"Backspace\":\n case \"Escape\": {\n event.preventDefault();\n return onClose();\n }\n }\n };\n\n const handleOnArrowLeft = (images: Array<FileMeta>, index: number) => {\n if (index > 0) {\n const previousFile: FileMeta = images[index - 1];\n setImageId(previousFile.id);\n }\n };\n\n const handleOnArrowRight = (images: Array<FileMeta>, index: number) => {\n if (index < images.length - 1) {\n const nextFile: FileMeta = images[index + 1];\n setImageId(nextFile.id);\n }\n };\n\n const onClose = () => setImageId(\"\");\n\n if (!meta) return null;\n\n return (\n <Dialog open onClose={onClose} maxWidth=\"xl\">\n {isPending ? (\n <Skeleton\n variant=\"rectangular\"\n sx={{\n width: { xs: \"100vw\", sm: 600 },\n height: { xs: \"calc(100vh - 56px)\", sm: \"calc(100vh - 64px)\" },\n }}\n />\n ) : (\n <Box\n component=\"img\"\n src={source}\n alt={meta.fileName}\n sx={{\n maxWidth: \"100vw\",\n maxHeight: { xs: \"calc(100vh - 56px)\", sm: \"calc(100vh - 64px)\" },\n }}\n />\n )}\n\n <Fab\n size=\"medium\"\n onClick={onClose}\n aria-label=\"Close\"\n sx={{ position: \"fixed\", top: 8, right: 8 }}\n >\n <Close />\n </Fab>\n </Dialog>\n );\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport type { ComponentType, FC, ReactNode } from \"react\";\nimport { useState } from \"react\";\nimport { FileContext } from \"~/contexts/FileContext\";\nimport type { FileActions } from \"~/models/file/FileActions\";\nimport type { FileMeta } from \"~/models/file/FileMeta\";\nimport { fileMetasQueryOptions } from \"~/data/client/file\";\nimport type { FileViewerGridProps } from \"./fileViewer/FileViewerGrid\";\nimport { FileViewerGrid } from \"./fileViewer/FileViewerGrid\";\nimport type { FileViewerListProps } from \"./fileViewer/FileViewerList\";\nimport { FileViewerList } from \"./fileViewer/FileViewerList\";\nimport { ImageViewer } from \"./fileViewer/ImageViewer\";\n\ninterface FileViewerComponent {\n Grid: ComponentType<FileViewerGridProps>;\n List: ComponentType<FileViewerListProps>;\n}\n\ninterface FileViewerProps {\n appName: string;\n subId: string;\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\n actions?: FileActions;\n children: (component: FileViewerComponent) => ReactNode;\n}\n\nexport const FileViewer: FC<FileViewerProps> = ({\n appName,\n subId,\n onDelete,\n actions,\n children,\n}) => {\n const { data: fileMetas = [] } = useQuery({\n ...fileMetasQueryOptions({ appName, subId }),\n enabled: !!subId,\n });\n const [imageId, setImageId] = useState<string>(\"\");\n\n if (fileMetas.length === 0) return null;\n\n return (\n <FileContext.Provider value={{ appName, fileMetas, onDelete, actions, setImageId }}>\n {children({ Grid: FileViewerGrid, List: FileViewerList })}\n <ImageViewer metaId={imageId} />\n </FileContext.Provider>\n );\n};\n","import Edit from \"@mui/icons-material/Edit\";\nimport { TypographyWithIcon } from \"../core/TypographyWithIcon\";\nimport type { GridColumnHeaderParams, GridValidRowModel } from \"@mui/x-data-grid-premium\";\n\nexport const EditableColumnHeader = <T extends GridValidRowModel>({\n colDef,\n}: GridColumnHeaderParams<T>) => {\n return (\n <TypographyWithIcon\n endIcon={<Edit color=\"disabled\" fontSize=\"small\" />}\n variant=\"body2\"\n className=\"MuiDataGrid-columnHeaderTitle\"\n >\n {colDef.headerName}\n </TypographyWithIcon>\n );\n};\n","import { Button } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { ButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, ButtonProps<\"a\">>(\n function ButtonComponent(props, reference) {\n return <Button ref={reference} component=\"a\" {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { Fab } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { FabProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, FabProps<\"a\">>(\n function FabComponent(props, reference) {\n return <Fab ref={reference} component=\"a\" {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterFab: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { GridActionsCellItem } from \"@mui/x-data-grid-premium\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { GridActionsCellItemProps } from \"@mui/x-data-grid-premium\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLButtonElement, GridActionsCellItemProps>(\n function GridActionsCellItemComponent(props, reference) {\n return <GridActionsCellItem ref={reference} component=\"a\" {...props} />;\n },\n) as React.ForwardRefExoticComponent<\n GridActionsCellItemProps & React.RefAttributes<HTMLButtonElement>\n>;\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterGridActionsCellItem: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { Link } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { LinkProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, LinkProps>(\n function LinkComponent(props, reference) {\n return <Link ref={reference} {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterLink: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { Tab } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { TabProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, TabProps<\"a\">>(\n function TabComponent(props, reference) {\n return <Tab ref={reference} component=\"a\" {...props} />;\n },\n);\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterTab: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n","import { Box, Divider, Typography } from \"@mui/material\";\nimport { useTranslation } from \"react-i18next\";\n\nexport function RouterNotFound() {\n const { t } = useTranslation();\n\n return (\n <Box\n sx={{\n height: \"100vh\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n textAlign: \"center\",\n px: 2,\n }}\n >\n <Box sx={{ display: \"flex\", alignItems: \"center\", mb: 4 }}>\n <Typography variant=\"h3\" component=\"span\" sx={{ fontWeight: 500, lineHeight: 1 }}>\n 404\n </Typography>\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\n <Typography variant=\"h5\" component=\"span\">\n {t(\"Layout.ThisPageCouldNotBeFound\")}\n </Typography>\n </Box>\n </Box>\n );\n}\n","import { Box, Divider, Typography } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\n\ninterface RouterErrorProps {\n error: ErrorComponentProps[\"error\"];\n}\n\nexport const RouterError: FC<RouterErrorProps> = ({ error }) => {\n return (\n <Box\n sx={{\n height: \"100vh\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n textAlign: \"center\",\n px: 2,\n }}\n >\n <Box sx={{ display: \"flex\", alignItems: \"center\", mb: 4 }}>\n <Typography variant=\"h3\" component=\"span\" sx={{ fontWeight: 500, lineHeight: 1 }}>\n {error.name || \"500\"}\n </Typography>\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\n <Typography variant=\"h5\" component=\"span\">\n {error.message}\n </Typography>\n </Box>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAa,sBAAyD,EACpE,WACA,SACA,UACA,MAAM,GACN,IACA,GAAG,YAEH,qBAAC,YAAD;CACE,WAAU;CACV,IAAI,CACF;EACE,SAAS;EACT,YAAY;EACZ,eAAe;EACf;EACA,WAAW;GAAE,SAAS;GAAS,YAAY;EAAE;CAC/C,GACA,GAAI,MAAM,QAAQ,EAAE,IAAI,KAAK,CAAC,EAAE,CAAE;CAEpC,GAAI;CAZN,UAAA;EAcG;EACA;EACA;CACS;;;;AC7Bd,MAAa,cAA2B,OAAA;CAAA,MAAA,IAAA,EAAA,EAAA;CAAA,IAAA,EAAA,OAAA,oEAAA;EAAA,KAAA,IAAA,KAAA,GAAA,KAAA,IAAA,MAAA,GAAA,EAAA,MAAA,OAAA,IAAA,2BAAA;EAAA,EAAA,KAAA;CAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,IAAA;EAAC,CAAA,CAAA,UAAA,OAAA,SAAA;EAA0B,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA;EAAA,WAAA,EAAA;EAAA,QAAA,EAAA;EAAA,KAAA,EAAA;CAAA;CACjE,MAAA,YAAkB,OAA8B,IAAI;CACpD,MAAA,CAAA,QAAA,aAA4B,SAAiB;CAAE,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EAEd,WAAA;GAC/B,IAAI,CAAC,UAAS,SAAQ;GACtB,MAAA,MAAY,UAAS,QAAQ,sBAAuB,CAAC,CAAA;GACrD,MAAA,iBAAuB,OAAM,gBAAuB,UAAI,OAAM;GAC9D,MAAA,QAAc,KAAI,IAAK,GAAG,KAAI,MAAO,iBA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SAAA;EAC1D,KAAA,oBAAC,YAAD;GAAoB,SAAA;GAAe,WAAA;GAChC,UAAA,MAAK;EADG,CAAA;EAEE,EAAA,KAAA,MAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,MAAA,EAAA,QAAA,IAAA;EAlBjB,KAAA,oBAAC,KAAD;GACM,IAAA;GAUJ,UAAA,qBAAC,KAAD;IAAS,IAAA;IAAT,UAAA;KACE;KAGA;KACA;IALE;;EAXF,CAAA;EAoBE,EAAA,KAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OApBN;AAoBM"}
@@ -1,5 +1,5 @@
1
1
  import { t as QueryClientParam } from "../QueryClientParam-Cbb0MIKg.mjs";
2
- import { M as UploadFileResult, O as FileSchema, b as GetApprovalsSchema, i as SearchEmployeesSchema, k as GetFileMetasSchema, n as DepartmentIdSchema, r as EmployeeIdSchema, t as CompanyCodeSchema, y as GetApprovalSchema } from "../peoplesoft-D4w8d4s1.mjs";
2
+ import { M as UploadFileResult, O as FileSchema, b as GetApprovalsSchema, i as SearchEmployeesSchema, k as GetFileMetasSchema, n as DepartmentIdSchema, r as EmployeeIdSchema, t as CompanyCodeSchema, y as GetApprovalSchema } from "../peoplesoft-CskGsqd6.mjs";
3
3
  import z, { z as z$1 } from "zod";
4
4
  //#region src/data/client/file.d.ts
5
5
  declare const fileMetasQueryOptions: (params: z$1.input<typeof GetFileMetasSchema>) => import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
@@ -111,6 +111,7 @@ declare const batchDeleteFilesMutationOptions: ({ queryClient }: QueryClientPara
111
111
  subId: string;
112
112
  }, unknown>, "mutationKey">;
113
113
  declare const uploadFileMutationOptions: ({ queryClient }: QueryClientParam) => Omit<import("@tanstack/react-query").UseMutationOptions<UploadFileResult, Error, {
114
+ id?: string | undefined;
114
115
  appName: string;
115
116
  subId: string;
116
117
  file: File;
@@ -1,6 +1,6 @@
1
- import { a as fileQueryOptions, c as updateFileMetaMutationOptions, i as fileMetasQueryOptions, l as uploadFileMutationOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions, t as batchDeleteFilesMutationOptions } from "../file-CuvAmdJW.mjs";
1
+ import { a as fileQueryOptions, c as updateFileMetaMutationOptions, i as fileMetasQueryOptions, l as uploadFileMutationOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions, t as batchDeleteFilesMutationOptions } from "../file-DimNsRly.mjs";
2
2
  import { a as ResubmitApprovalSchema, i as CreateApprovalSchema, n as ApproveApprovalSchema, o as WithdrawApprovalSchema, r as CancelApprovalSchema } from "../Approval-C-hF4jbT.mjs";
3
- import { C as createApproval, D as withdrawApproval, E as resubmitApproval, S as cancelApproval, T as getApprovals, _ as getPreviousEmployeeIds$1, a as getActiveEmployees$1, b as GetApprovalsSchema, c as getDepartmentEmployees$1, d as getEmployeeByEmployeeId$1, f as getEmployeeGeneralManager$1, g as getEmployees$1, h as getEmployeeSupervisor$1, i as SearchEmployeesSchema, l as getDepartmentManager$1, m as getEmployeeSubordinates$1, n as DepartmentIdSchema, o as getCompanyGeneralManager$1, p as getEmployeeManager$1, r as EmployeeIdSchema, s as getDepartmentById$1, t as CompanyCodeSchema, u as getDepartments$1, v as searchEmployees$1, w as getApproval, x as approveApproval, y as GetApprovalSchema } from "../peoplesoft-DGdM1bws.mjs";
3
+ import { C as createApproval, D as withdrawApproval, E as resubmitApproval, S as cancelApproval, T as getApprovals, _ as getPreviousEmployeeIds$1, a as getActiveEmployees$1, b as GetApprovalsSchema, c as getDepartmentEmployees$1, d as getEmployeeByEmployeeId$1, f as getEmployeeGeneralManager$1, g as getEmployees$1, h as getEmployeeSupervisor$1, i as SearchEmployeesSchema, l as getDepartmentManager$1, m as getEmployeeSubordinates$1, n as DepartmentIdSchema, o as getCompanyGeneralManager$1, p as getEmployeeManager$1, r as EmployeeIdSchema, s as getDepartmentById$1, t as CompanyCodeSchema, u as getDepartments$1, v as searchEmployees$1, w as getApproval, x as approveApproval, y as GetApprovalSchema } from "../peoplesoft-DTPGpN2h.mjs";
4
4
  import { mutationOptions, queryOptions } from "@tanstack/react-query";
5
5
  import "zod";
6
6
  import { createServerFn } from "@tanstack/react-start";
@@ -1 +1 @@
1
- {"version":3,"file":"client.mjs","names":[],"sources":["../../src/data/client/approval.ts","../../src/data/client/peoplesoft.ts"],"sourcesContent":["import { mutationOptions, queryOptions } from \"@tanstack/react-query\";\r\nimport { createServerFn } from \"@tanstack/react-start\";\r\nimport type { z } from \"zod\";\r\nimport type { QueryClientParam } from \"~/models/QueryClientParam\";\r\nimport {\r\n ApproveApprovalSchema,\r\n CancelApprovalSchema,\r\n CreateApprovalSchema,\r\n ResubmitApprovalSchema,\r\n WithdrawApprovalSchema,\r\n} from \"~/models/approval/Approval\";\r\nimport {\r\n GetApprovalSchema,\r\n GetApprovalsSchema,\r\n approveApproval,\r\n cancelApproval,\r\n createApproval,\r\n getApproval,\r\n getApprovals,\r\n resubmitApproval,\r\n withdrawApproval,\r\n} from \"~/data/server/approval\";\r\n\r\nconst QUERY_KEY = \"approval\";\r\n\r\nconst getApprovalsRpc = createServerFn({ method: \"GET\" })\r\n .validator(GetApprovalsSchema)\r\n .handler(({ data }) => getApprovals({ data }));\r\n\r\nconst getApprovalRpc = createServerFn({ method: \"GET\" })\r\n .validator(GetApprovalSchema)\r\n .handler(({ data }) => getApproval({ data }));\r\n\r\nconst createApprovalRpc = createServerFn({ method: \"POST\" })\r\n .validator(CreateApprovalSchema)\r\n .handler(({ data }) => createApproval({ data }));\r\n\r\nconst approveApprovalRpc = createServerFn({ method: \"POST\" })\r\n .validator(ApproveApprovalSchema)\r\n .handler(({ data }) => approveApproval({ data }));\r\n\r\nconst resubmitApprovalRpc = createServerFn({ method: \"POST\" })\r\n .validator(ResubmitApprovalSchema)\r\n .handler(({ data }) => resubmitApproval({ data }));\r\n\r\nconst withdrawApprovalRpc = createServerFn({ method: \"POST\" })\r\n .validator(WithdrawApprovalSchema)\r\n .handler(({ data }) => withdrawApproval({ data }));\r\n\r\nconst cancelApprovalRpc = createServerFn({ method: \"POST\" })\r\n .validator(CancelApprovalSchema)\r\n .handler(({ data }) => cancelApproval({ data }));\r\n\r\nexport const approvalsQueryOptions = (params: z.input<typeof GetApprovalsSchema>) =>\r\n queryOptions({\r\n queryKey: [QUERY_KEY, params],\r\n queryFn: () => getApprovalsRpc({ data: params }),\r\n });\r\n\r\nexport const approvalQueryOptions = (params: z.input<typeof GetApprovalSchema>) =>\r\n queryOptions({\r\n queryKey: [QUERY_KEY, params],\r\n queryFn: () => getApprovalRpc({ data: params }),\r\n });\r\n\r\nexport const createApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof CreateApprovalSchema>) => createApprovalRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\r\n });\r\n\r\nexport const approveApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof ApproveApprovalSchema>) => approveApprovalRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\r\n });\r\n\r\nexport const resubmitApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof ResubmitApprovalSchema>) => resubmitApprovalRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\r\n });\r\n\r\nexport const withdrawApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof WithdrawApprovalSchema>) => withdrawApprovalRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\r\n });\r\n\r\nexport const cancelApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof CancelApprovalSchema>) => cancelApprovalRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\r\n });\r\n","import { queryOptions } from \"@tanstack/react-query\";\nimport { createServerFn } from \"@tanstack/react-start\";\nimport z from \"zod\";\nimport {\n CompanyCodeSchema,\n DepartmentIdSchema,\n EmployeeIdSchema,\n getActiveEmployees as getActiveEmployeesServerFn,\n getCompanyGeneralManager as getCompanyGeneralManagerServerFn,\n getDepartmentById as getDepartmentByIdServerFn,\n getDepartmentEmployees as getDepartmentEmployeesServerFn,\n getDepartmentManager as getDepartmentManagerServerFn,\n getDepartments as getDepartmentsServerFn,\n getEmployeeByEmployeeId as getEmployeeByEmployeeIdServerFn,\n getEmployeeGeneralManager as getEmployeeGeneralManagerServerFn,\n getEmployeeManager as getEmployeeManagerServerFn,\n getEmployees as getEmployeesServerFn,\n getEmployeeSubordinates as getEmployeeSubordinatesServerFn,\n getEmployeeSupervisor as getEmployeeSupervisorServerFn,\n getPreviousEmployeeIds as getPreviousEmployeeIdsServerFn,\n searchEmployees as searchEmployeesServerFn,\n SearchEmployeesSchema,\n} from \"~/data/server/peoplesoft\";\n\nconst QUERY_KEY = \"peoplesoft\";\nconst DAY = 1000 * 60 * 60 * 24;\n\nexport const searchEmployees = createServerFn({ method: \"GET\" })\n .validator(SearchEmployeesSchema)\n .handler(({ data }) => searchEmployeesServerFn({ data }));\n\nexport const getEmployees = createServerFn({ method: \"GET\" }).handler(() => getEmployeesServerFn());\n\nexport const getActiveEmployees = createServerFn({ method: \"GET\" }).handler(() =>\n getActiveEmployeesServerFn(),\n);\n\nexport const getEmployeeByEmployeeId = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeByEmployeeIdServerFn({ data }));\n\nexport const getPreviousEmployeeIds = createServerFn({ method: \"GET\" }).handler(() =>\n getPreviousEmployeeIdsServerFn(),\n);\n\nexport const getEmployeeSupervisor = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeSupervisorServerFn({ data }));\n\nexport const getEmployeeSubordinates = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeSubordinatesServerFn({ data }));\n\nexport const getEmployeeManager = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeManagerServerFn({ data }));\n\nexport const getEmployeeGeneralManager = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeGeneralManagerServerFn({ data }));\n\nexport const getDepartments = createServerFn({ method: \"GET\" }).handler(() =>\n getDepartmentsServerFn(),\n);\n\nexport const getDepartmentById = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentByIdServerFn({ data }));\n\nexport const getDepartmentManager = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentManagerServerFn({ data }));\n\nexport const getDepartmentEmployees = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentEmployeesServerFn({ data }));\n\nexport const getCompanyGeneralManager = createServerFn({ method: \"GET\" })\n .validator(CompanyCodeSchema)\n .handler(({ data }) => getCompanyGeneralManagerServerFn({ data }));\n\nconst baseOptions = {\n staleTime: DAY,\n gcTime: DAY,\n refetchOnWindowFocus: false,\n};\n\nexport const searchEmployeesQueryOptions = (params: z.infer<typeof SearchEmployeesSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"search\", params],\n queryFn: () => searchEmployees({ data: params }),\n ...baseOptions,\n });\n\nexport const employeesQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\"],\n queryFn: () => getEmployees(),\n ...baseOptions,\n });\n\nexport const activeEmployeesQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"active\"],\n queryFn: () => getActiveEmployees(),\n ...baseOptions,\n });\n\nexport const employeeByEmployeeIdQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", params],\n queryFn: () => getEmployeeByEmployeeId({ data: params }),\n ...baseOptions,\n });\n\nexport const previousEmployeeIdsQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"previousIds\"],\n queryFn: () => getPreviousEmployeeIds(),\n ...baseOptions,\n });\n\nexport const employeeSupervisorQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"supervisor\", params],\n queryFn: () => getEmployeeSupervisor({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeSubordinatesQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"subordinates\", params],\n queryFn: () => getEmployeeSubordinates({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeManagerQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"manager\", params],\n queryFn: () => getEmployeeManager({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeGeneralManagerQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"generalManager\", params],\n queryFn: () => getEmployeeGeneralManager({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentsQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\"],\n queryFn: () => getDepartments(),\n ...baseOptions,\n });\n\nexport const departmentByIdQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", params],\n queryFn: () => getDepartmentById({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentManagerQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", \"manager\", params],\n queryFn: () => getDepartmentManager({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentEmployeesQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", \"employees\", params],\n queryFn: () => getDepartmentEmployees({ data: params }),\n ...baseOptions,\n });\n\nexport const companyGeneralManagerQueryOptions = (params: z.infer<typeof CompanyCodeSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"company\", \"generalManager\", params],\n queryFn: () => getCompanyGeneralManager({ data: params }),\n ...baseOptions,\n });\n"],"mappings":";;;;;;;AAuBA,MAAM,cAAY;AAElB,MAAM,kBAAkB,eAAe,EAAE,QAAQ,MAAM,CAAC,CAAC,CACtD,UAAU,kBAAkB,CAAC,CAC7B,SAAS,EAAE,WAAW,aAAa,EAAE,KAAK,CAAC,CAAC;AAE/C,MAAM,iBAAiB,eAAe,EAAE,QAAQ,MAAM,CAAC,CAAC,CACrD,UAAU,iBAAiB,CAAC,CAC5B,SAAS,EAAE,WAAW,YAAY,EAAE,KAAK,CAAC,CAAC;AAE9C,MAAM,oBAAoB,eAAe,EAAE,QAAQ,OAAO,CAAC,CAAC,CACzD,UAAU,oBAAoB,CAAC,CAC/B,SAAS,EAAE,WAAW,eAAe,EAAE,KAAK,CAAC,CAAC;AAEjD,MAAM,qBAAqB,eAAe,EAAE,QAAQ,OAAO,CAAC,CAAC,CAC1D,UAAU,qBAAqB,CAAC,CAChC,SAAS,EAAE,WAAW,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAElD,MAAM,sBAAsB,eAAe,EAAE,QAAQ,OAAO,CAAC,CAAC,CAC3D,UAAU,sBAAsB,CAAC,CACjC,SAAS,EAAE,WAAW,iBAAiB,EAAE,KAAK,CAAC,CAAC;AAEnD,MAAM,sBAAsB,eAAe,EAAE,QAAQ,OAAO,CAAC,CAAC,C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C;EAAW;EAAW;EAAkB;CAAM;CACzD,eAAe,yBAAyB,EAAE,MAAM,OAAO,CAAC;CACxD,GAAG;AACL,CAAC"}
1
+ {"version":3,"file":"client.mjs","names":[],"sources":["../../src/data/client/approval.ts","../../src/data/client/peoplesoft.ts"],"sourcesContent":["import { mutationOptions, queryOptions } from \"@tanstack/react-query\";\nimport { createServerFn } from \"@tanstack/react-start\";\nimport type { z } from \"zod\";\nimport type { QueryClientParam } from \"~/models/QueryClientParam\";\nimport {\n ApproveApprovalSchema,\n CancelApprovalSchema,\n CreateApprovalSchema,\n ResubmitApprovalSchema,\n WithdrawApprovalSchema,\n} from \"~/models/approval/Approval\";\nimport {\n GetApprovalSchema,\n GetApprovalsSchema,\n approveApproval,\n cancelApproval,\n createApproval,\n getApproval,\n getApprovals,\n resubmitApproval,\n withdrawApproval,\n} from \"~/data/server/approval\";\n\nconst QUERY_KEY = \"approval\";\n\nconst getApprovalsRpc = createServerFn({ method: \"GET\" })\n .validator(GetApprovalsSchema)\n .handler(({ data }) => getApprovals({ data }));\n\nconst getApprovalRpc = createServerFn({ method: \"GET\" })\n .validator(GetApprovalSchema)\n .handler(({ data }) => getApproval({ data }));\n\nconst createApprovalRpc = createServerFn({ method: \"POST\" })\n .validator(CreateApprovalSchema)\n .handler(({ data }) => createApproval({ data }));\n\nconst approveApprovalRpc = createServerFn({ method: \"POST\" })\n .validator(ApproveApprovalSchema)\n .handler(({ data }) => approveApproval({ data }));\n\nconst resubmitApprovalRpc = createServerFn({ method: \"POST\" })\n .validator(ResubmitApprovalSchema)\n .handler(({ data }) => resubmitApproval({ data }));\n\nconst withdrawApprovalRpc = createServerFn({ method: \"POST\" })\n .validator(WithdrawApprovalSchema)\n .handler(({ data }) => withdrawApproval({ data }));\n\nconst cancelApprovalRpc = createServerFn({ method: \"POST\" })\n .validator(CancelApprovalSchema)\n .handler(({ data }) => cancelApproval({ data }));\n\nexport const approvalsQueryOptions = (params: z.input<typeof GetApprovalsSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, params],\n queryFn: () => getApprovalsRpc({ data: params }),\n });\n\nexport const approvalQueryOptions = (params: z.input<typeof GetApprovalSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, params],\n queryFn: () => getApprovalRpc({ data: params }),\n });\n\nexport const createApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\n mutationOptions({\n mutationFn: (data: z.input<typeof CreateApprovalSchema>) => createApprovalRpc({ data }),\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\n });\n\nexport const approveApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\n mutationOptions({\n mutationFn: (data: z.input<typeof ApproveApprovalSchema>) => approveApprovalRpc({ data }),\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\n });\n\nexport const resubmitApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\n mutationOptions({\n mutationFn: (data: z.input<typeof ResubmitApprovalSchema>) => resubmitApprovalRpc({ data }),\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\n });\n\nexport const withdrawApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\n mutationOptions({\n mutationFn: (data: z.input<typeof WithdrawApprovalSchema>) => withdrawApprovalRpc({ data }),\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\n });\n\nexport const cancelApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\n mutationOptions({\n mutationFn: (data: z.input<typeof CancelApprovalSchema>) => cancelApprovalRpc({ data }),\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\n });\n","import { queryOptions } from \"@tanstack/react-query\";\nimport { createServerFn } from \"@tanstack/react-start\";\nimport z from \"zod\";\nimport {\n CompanyCodeSchema,\n DepartmentIdSchema,\n EmployeeIdSchema,\n getActiveEmployees as getActiveEmployeesServerFn,\n getCompanyGeneralManager as getCompanyGeneralManagerServerFn,\n getDepartmentById as getDepartmentByIdServerFn,\n getDepartmentEmployees as getDepartmentEmployeesServerFn,\n getDepartmentManager as getDepartmentManagerServerFn,\n getDepartments as getDepartmentsServerFn,\n getEmployeeByEmployeeId as getEmployeeByEmployeeIdServerFn,\n getEmployeeGeneralManager as getEmployeeGeneralManagerServerFn,\n getEmployeeManager as getEmployeeManagerServerFn,\n getEmployees as getEmployeesServerFn,\n getEmployeeSubordinates as getEmployeeSubordinatesServerFn,\n getEmployeeSupervisor as getEmployeeSupervisorServerFn,\n getPreviousEmployeeIds as getPreviousEmployeeIdsServerFn,\n searchEmployees as searchEmployeesServerFn,\n SearchEmployeesSchema,\n} from \"~/data/server/peoplesoft\";\n\nconst QUERY_KEY = \"peoplesoft\";\nconst DAY = 1000 * 60 * 60 * 24;\n\nexport const searchEmployees = createServerFn({ method: \"GET\" })\n .validator(SearchEmployeesSchema)\n .handler(({ data }) => searchEmployeesServerFn({ data }));\n\nexport const getEmployees = createServerFn({ method: \"GET\" }).handler(() => getEmployeesServerFn());\n\nexport const getActiveEmployees = createServerFn({ method: \"GET\" }).handler(() =>\n getActiveEmployeesServerFn(),\n);\n\nexport const getEmployeeByEmployeeId = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeByEmployeeIdServerFn({ data }));\n\nexport const getPreviousEmployeeIds = createServerFn({ method: \"GET\" }).handler(() =>\n getPreviousEmployeeIdsServerFn(),\n);\n\nexport const getEmployeeSupervisor = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeSupervisorServerFn({ data }));\n\nexport const getEmployeeSubordinates = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeSubordinatesServerFn({ data }));\n\nexport const getEmployeeManager = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeManagerServerFn({ data }));\n\nexport const getEmployeeGeneralManager = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeGeneralManagerServerFn({ data }));\n\nexport const getDepartments = createServerFn({ method: \"GET\" }).handler(() =>\n getDepartmentsServerFn(),\n);\n\nexport const getDepartmentById = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentByIdServerFn({ data }));\n\nexport const getDepartmentManager = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentManagerServerFn({ data }));\n\nexport const getDepartmentEmployees = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentEmployeesServerFn({ data }));\n\nexport const getCompanyGeneralManager = createServerFn({ method: \"GET\" })\n .validator(CompanyCodeSchema)\n .handler(({ data }) => getCompanyGeneralManagerServerFn({ data }));\n\nconst baseOptions = {\n staleTime: DAY,\n gcTime: DAY,\n refetchOnWindowFocus: false,\n};\n\nexport const searchEmployeesQueryOptions = (params: z.infer<typeof SearchEmployeesSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"search\", params],\n queryFn: () => searchEmployees({ data: params }),\n ...baseOptions,\n });\n\nexport const employeesQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\"],\n queryFn: () => getEmployees(),\n ...baseOptions,\n });\n\nexport const activeEmployeesQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"active\"],\n queryFn: () => getActiveEmployees(),\n ...baseOptions,\n });\n\nexport const employeeByEmployeeIdQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", params],\n queryFn: () => getEmployeeByEmployeeId({ data: params }),\n ...baseOptions,\n });\n\nexport const previousEmployeeIdsQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"previousIds\"],\n queryFn: () => getPreviousEmployeeIds(),\n ...baseOptions,\n });\n\nexport const employeeSupervisorQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"supervisor\", params],\n queryFn: () => getEmployeeSupervisor({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeSubordinatesQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"subordinates\", params],\n queryFn: () => getEmployeeSubordinates({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeManagerQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"manager\", params],\n queryFn: () => getEmployeeManager({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeGeneralManagerQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"generalManager\", params],\n queryFn: () => getEmployeeGeneralManager({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentsQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\"],\n queryFn: () => getDepartments(),\n ...baseOptions,\n });\n\nexport const departmentByIdQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", params],\n queryFn: () => getDepartmentById({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentManagerQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", \"manager\", params],\n queryFn: () => getDepartmentManager({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentEmployeesQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", \"employees\", params],\n queryFn: () => getDepartmentEmployees({ data: params }),\n ...baseOptions,\n });\n\nexport const companyGeneralManagerQueryOptions = (params: z.infer<typeof CompanyCodeSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"company\", \"generalManager\", params],\n queryFn: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EH,MAAa,+BAA+B,WAC1C,aAAa;CACX,UAAU;EAAC;EAAW;EAAY;EAAW;CAAM;CACnD,eAAe,mBAAmB,EAAE,MAAM,OAAO,CAAC;CAClD,GAAG;AACL,CAAC;AAEH,MAAa,sCAAsC,WACjD,aAAa;CACX,UAAU;EAAC;EAAW;EAAY;EAAkB;CAAM;CAC1D,eAAe,0BAA0B,EAAE,MAAM,OAAO,CAAC;CACzD,GAAG;AACL,CAAC;AAEH,MAAa,gCACX,aAAa;CACX,UAAU,CAAC,WAAW,YAAY;CAClC,eAAe,eAAe;CAC9B,GAAG;AACL,CAAC;AAEH,MAAa,8BAA8B,WACzC,aAAa;CACX,UAAU;EAAC;EAAW;EAAc;CAAM;CAC1C,eAAe,kBAAkB,EAAE,MAAM,OAAO,CAAC;CACjD,GAAG;AACL,CAAC;AAEH,MAAa,iCAAiC,WAC5C,aAAa;CACX,UAAU;EAAC;EAAW;EAAc;EAAW;CAAM;CACrD,eAAe,qBAAqB,EAAE,MAAM,OAAO,CAAC;CACpD,GAAG;AACL,CAAC;AAEH,MAAa,mCAAmC,WAC9C,aAAa;CACX,UAAU;EAAC;EAAW;EAAc;EAAa;CAAM;CACvD,eAAe,uBAAuB,EAAE,MAAM,OAAO,CAAC;CACtD,GAAG;AACL,CAAC;AAEH,MAAa,qCAAqC,WAChD,aAAa;CACX,UAAU;EAAC;EAAW;EAAW;EAAkB;CAAM;CACzD,eAAe,yBAAyB,EAAE,MAAM,OAAO,CAAC;CACxD,GAAG;AACL,CAAC"}
@@ -1,4 +1,4 @@
1
- import { A as UpdateFileMetaSchema, B as uploadFile, C as createApproval, D as withdrawApproval, E as resubmitApproval, F as downloadFile, I as getFile, L as getFileMetas, M as UploadFileResult, N as batchDeleteFiles, O as FileSchema, P as deleteFile, R as getFileThumbnail, S as cancelApproval, T as getApprovals, _ as getPreviousEmployeeIds, a as getActiveEmployees, b as GetApprovalsSchema, c as getDepartmentEmployees, d as getEmployeeByEmployeeId, f as getEmployeeGeneralManager, g as getEmployees, h as getEmployeeSupervisor, i as SearchEmployeesSchema, j as UploadFileMetaSchema, k as GetFileMetasSchema, l as getDepartmentManager, m as getEmployeeSubordinates, n as DepartmentIdSchema, o as getCompanyGeneralManager, p as getEmployeeManager, r as EmployeeIdSchema, s as getDepartmentById, t as CompanyCodeSchema, u as getDepartments, v as searchEmployees, w as getApproval, x as approveApproval, y as GetApprovalSchema, z as updateFileMeta } from "../peoplesoft-D4w8d4s1.mjs";
1
+ import { A as UpdateFileMetaSchema, B as uploadFile, C as createApproval, D as withdrawApproval, E as resubmitApproval, F as downloadFile, I as getFile, L as getFileMetas, M as UploadFileResult, N as batchDeleteFiles, O as FileSchema, P as deleteFile, R as getFileThumbnail, S as cancelApproval, T as getApprovals, _ as getPreviousEmployeeIds, a as getActiveEmployees, b as GetApprovalsSchema, c as getDepartmentEmployees, d as getEmployeeByEmployeeId, f as getEmployeeGeneralManager, g as getEmployees, h as getEmployeeSupervisor, i as SearchEmployeesSchema, j as UploadFileMetaSchema, k as GetFileMetasSchema, l as getDepartmentManager, m as getEmployeeSubordinates, n as DepartmentIdSchema, o as getCompanyGeneralManager, p as getEmployeeManager, r as EmployeeIdSchema, s as getDepartmentById, t as CompanyCodeSchema, u as getDepartments, v as searchEmployees, w as getApproval, x as approveApproval, y as GetApprovalSchema, z as updateFileMeta } from "../peoplesoft-CskGsqd6.mjs";
2
2
  import { n as EmailSchema } from "../Email-CKUxOURX.mjs";
3
3
  import { z as z$1 } from "zod";
4
4
  //#region src/data/server/email.d.ts
@@ -1,6 +1,6 @@
1
- import { a as batchDeleteFiles, c as getFile, d as updateFileMeta, f as uploadFile, i as UploadFileMetaSchema, l as getFileMetas, n as GetFileMetasSchema, o as deleteFile, p as createApi, r as UpdateFileMetaSchema, s as downloadFile, t as FileSchema, u as getFileThumbnail } from "../file-BTFDDalH.mjs";
1
+ import { a as batchDeleteFiles, c as getFile, d as updateFileMeta, f as uploadFile, i as UploadFileMetaSchema, l as getFileMetas, n as GetFileMetasSchema, o as deleteFile, p as createApi, r as UpdateFileMetaSchema, s as downloadFile, t as FileSchema, u as getFileThumbnail } from "../file-BWcNzq55.mjs";
2
2
  import { t as EmailSchema } from "../Email-BzQQkbe9.mjs";
3
- import { C as createApproval, D as withdrawApproval, E as resubmitApproval, S as cancelApproval, T as getApprovals, _ as getPreviousEmployeeIds, a as getActiveEmployees, b as GetApprovalsSchema, c as getDepartmentEmployees, d as getEmployeeByEmployeeId, f as getEmployeeGeneralManager, g as getEmployees, h as getEmployeeSupervisor, i as SearchEmployeesSchema, l as getDepartmentManager, m as getEmployeeSubordinates, n as DepartmentIdSchema, o as getCompanyGeneralManager, p as getEmployeeManager, r as EmployeeIdSchema, s as getDepartmentById, t as CompanyCodeSchema, u as getDepartments, v as searchEmployees, w as getApproval, x as approveApproval, y as GetApprovalSchema } from "../peoplesoft-DGdM1bws.mjs";
3
+ import { C as createApproval, D as withdrawApproval, E as resubmitApproval, S as cancelApproval, T as getApprovals, _ as getPreviousEmployeeIds, a as getActiveEmployees, b as GetApprovalsSchema, c as getDepartmentEmployees, d as getEmployeeByEmployeeId, f as getEmployeeGeneralManager, g as getEmployees, h as getEmployeeSupervisor, i as SearchEmployeesSchema, l as getDepartmentManager, m as getEmployeeSubordinates, n as DepartmentIdSchema, o as getCompanyGeneralManager, p as getEmployeeManager, r as EmployeeIdSchema, s as getDepartmentById, t as CompanyCodeSchema, u as getDepartments, v as searchEmployees, w as getApproval, x as approveApproval, y as GetApprovalSchema } from "../peoplesoft-DTPGpN2h.mjs";
4
4
  import { createServerOnlyFn } from "@tanstack/react-start";
5
5
  //#region src/data/server/email.ts
6
6
  const sendEmail = createServerOnlyFn(async ({ data }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"entra-CJSyeQsx.mjs","names":[],"sources":["../src/lib/auth/entra.ts"],"sourcesContent":["import {\r\n ConfidentialClientApplication,\r\n CryptoProvider,\r\n InteractionRequiredAuthError,\r\n ServerError,\r\n} from \"@azure/msal-node\";\r\nimport type { TokenPayload } from \"~/models/TokenPayload\";\r\nimport { serverEnv } from \"~/env\";\r\n\r\n/**\r\n * Scopes requested during the interactive login. `offline_access` yields the\r\n * refresh token that the session is built around; `User.Read` lets us read the\r\n * user's Graph profile (e.g. avatar). Resource API scopes (file, approval, …) are\r\n * acquired on demand via {@link acquireDelegatedToken} using the multi-resource\r\n * refresh token.\r\n */\r\nexport const LOGIN_SCOPES = [\"openid\", \"profile\", \"offline_access\", \"User.Read\"];\r\n\r\n/** Entra authority for this tenant. */\r\nexport const ENTRA_AUTHORITY = `https://login.microsoftonline.com/${serverEnv.ENTRA_TENANT_ID}`;\r\n\r\n/** Shared across login/callback/refresh calls — stateless and cheap to reuse. */\r\nexport const cryptoProvider = new CryptoProvider();\r\n\r\n/**\r\n * Creates a confidential client (no persistent cache plugin).\r\n *\r\n * The interactive/refresh flows below deliberately use a FRESH client per token\r\n * operation rather than a singleton: the client's in-memory cache then holds only\r\n * that operation's tokens, so {@link extractRefreshToken} reads the correct user's\r\n * refresh token — a shared client would accumulate (and leak) every user's tokens.\r\n * Persisting just the refresh token (not the whole multi-KB MSAL cache) is what\r\n * keeps the session in a small cookie with no server-side token store.\r\n */\r\nexport const createConfidentialClient = (): ConfidentialClientApplication =>\r\n new ConfidentialClientApplication({\r\n auth: {\r\n clientId: serverEnv.ENTRA_CLIENT_ID,\r\n clientSecret: serverEnv.ENTRA_CLIENT_SECRET,\r\n authority: ENTRA_AUTHORITY,\r\n },\r\n });\r\n\r\n/**\r\n * Pulls the refresh-token secret out of a client's in-memory MSAL cache. MSAL\r\n * intentionally hides refresh tokens, so reading the serialized cache is the only\r\n * way to persist just the RT (instead of the whole cache) in the session cookie.\r\n */\r\nfunction extractRefreshToken(client: ConfidentialClientApplication): string | undefined {\r\n const cache = JSON.parse(client.getTokenCache().serialize()) as {\r\n RefreshToken?: Record<string, { secret?: string }>;\r\n };\r\n return Object.values(cache.RefreshToken ?? {})[0]?.secret;\r\n}\r\n\r\n/** First leg of the auth-code flow: the URL to redirect the browser to. */\r\nexport function buildAuthCodeUrl(opts: {\r\n redirectUri: string;\r\n state: string;\r\n codeChallenge: string;\r\n}): Promise<string> {\r\n return createConfidentialClient().getAuthCodeUrl({\r\n scopes: LOGIN_SCOPES,\r\n redirectUri: opts.redirectUri,\r\n responseMode: \"query\",\r\n state: opts.state,\r\n codeChallenge: opts.codeChallenge,\r\n codeChallengeMethod: \"S256\",\r\n });\r\n}\r\n\r\n/**\r\n * Second leg of the auth-code flow: exchange the code for tokens, returning the\r\n * refresh token and the id-token claims to persist in the session.\r\n */\r\nexport async function exchangeCodeForSession(opts: {\r\n code: string;\r\n redirectUri: string;\r\n codeVerifier: string;\r\n}): Promise<{ refreshToken: string; claims: TokenPayload }> {\r\n const client = createConfidentialClient();\r\n const result = await client.acquireTokenByCode({\r\n code: opts.code,\r\n scopes: LOGIN_SCOPES,\r\n redirectUri: opts.redirectUri,\r\n codeVerifier: opts.codeVerifier,\r\n });\r\n\r\n const refreshToken = extractRefreshToken(client);\r\n if (!refreshToken)\r\n throw new Error(\"No refresh token returned (is the offline_access scope granted?)\");\r\n\r\n return { refreshToken, claims: (result.idTokenClaims ?? {}) as TokenPayload };\r\n}\r\n\r\n/**\r\n * Acquires a delegated access token for `scopes` from the stored refresh token.\r\n * Entra rotates the refresh token on each use, so the (possibly new) refresh\r\n * token is returned for the caller to persist. Throws when the refresh token is\r\n * expired/revoked and interaction is required.\r\n */\r\n/** The refresh token is expired/revoked — the user must sign in interactively. */\r\nexport class SessionExpiredError extends Error {}\r\n\r\nexport async function acquireDelegatedToken(opts: {\r\n refreshToken: string;\r\n scopes: ReadonlyArray<string>;\r\n}): Promise<{ accessToken: string; refreshToken: string }> {\r\n const client = createConfidentialClient();\r\n let result;\r\n try {\r\n result = await client.acquireTokenByRefreshToken({\r\n refreshToken: opts.refreshToken,\r\n scopes: [...opts.scopes],\r\n forceCache: true,\r\n });\r\n } catch (error) {\r\n // Revocation, inactivity expiry (AADSTS70008/700082/50173) and Conditional\r\n // Access sign-in frequency (AADSTS70043) all surface as interaction-required\r\n // or invalid_grant — the session is dead, only an interactive login helps.\r\n // Missing consent for the requested resource (AADSTS65001) looks the same to\r\n // MSAL but is a configuration bug, not a dead session — let it surface as-is.\r\n if (\r\n (error instanceof InteractionRequiredAuthError && error.subError !== \"consent_required\") ||\r\n (error instanceof ServerError && error.errorCode === \"invalid_grant\")\r\n )\r\n throw new SessionExpiredError(error.message);\r\n throw error;\r\n }\r\n if (!result) throw new Error(\"Failed to acquire token from refresh token\");\r\n\r\n return {\r\n accessToken: result.accessToken,\r\n refreshToken: extractRefreshToken(client) ?? opts.refreshToken,\r\n };\r\n}\r\n\r\n/** Entra's front-channel logout endpoint, which clears the user's IdP session. */\r\nexport function buildLogoutUrl(postLogoutRedirectUri: string): string {\r\n const base = `${ENTRA_AUTHORITY}/oauth2/v2.0/logout`;\r\n return `${base}?post_logout_redirect_uri=${encodeURIComponent(postLogoutRedirectUri)}`;\r\n}\r\n"],"mappings":";;;;;;;;;;AAgBA,MAAa,eAAe;CAAC;CAAU;CAAW;CAAkB;AAAW;;AAG/E,MAAa,kBAAkB,qCAAqC,UAAU;;AAG9E,MAAa,iBAAiB,IAAI,eAAe;;;;;;;;;;;AAYjD,MAAa,iCACX,IAAI,8BAA8B,EAChC,MAAM;CACJ,UAAU,UAAU;CACpB,cAAc,UAAU;CACxB,WAAW;AACb,EACF,CAAC;;;;;;AAOH,SAAS,oBAAoB,QAA2D;CACtF,MAAM,QAAQ,KAAK,MAAM,OAAO,cAAc,CAAC,CAAC,UAAU,CAAC;CAG3D,OAAO,OAAO,OAAO,MAAM,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;AACrD;;AAGA,SAAgB,iBAAiB,MAIb;CAClB,OAAO,yBAAyB,CAAC,CAAC,eAAe;EAC/C,QAAQ;EACR,aAAa,KAAK;EAClB,cAAc;EACd,OAAO,KAAK;EACZ,eAAe,KAAK;EACpB,qBAAqB;CACvB,CAAC;AACH;;;;;AAMA,eAAsB,uBAAuB,MAIe;CAC1D,MAAM,SAAS,yBAAyB;CACxC,MAAM,SAAS,MAAM,OAAO,mBAAmB;EAC7C,MAAM,KAAK;EACX,QAAQ;EACR,aAAa,KAAK;EAClB,cAAc,KAAK;CACrB,CAAC;CAED,MAAM,eAAe,oBAAoB,MAAM;CAC/C,IAAI,CAAC,cACH,MAAM,IAAI,MAAM,kEAAkE;CAEpF,OAAO;EAAE;EAAc,QAAS,OAAO,iBAAiB,CAAC;CAAmB;AAC9E;;;;;;;;AASA,IAAa,sBAAb,cAAyC,MAAM,CAAA;AAE/C,eAAsB,sBAAsB,MAGe;CACzD,MAAM,SAAS,yBAAyB;CACxC,IAAI;CACJ,IAAI;EACF,SAAS,MAAM,OAAO,2BAA2B;GAC/C,cAAc,KAAK;GACnB,QAAQ,CAAC,GAAG,KAAK,MAAM;GACvB,YAAY;EACd,CAAC;CACH,SAAS,OAAO;EAMd,IACG,iBAAiB,gCAAgC,MAAM,aAAa,sBACpE,iBAAiB,eAAe,MAAM,cAAc,iBAErD,MAAM,IAAI,oBAAoB,MAAM,OAAO;EAC7C,MAAM;CACR;CACA,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,4CAA4C;CAEzE,OAAO;EACL,aAAa,OAAO;EACpB,cAAc,oBAAoB,MAAM,KAAK,KAAK;CACpD;AACF;;AAGA,SAAgB,eAAe,uBAAuC;CAEpE,OAAO,GAAG,GADM,gBAAe,qBACjB,4BAA6B,mBAAmB,qBAAqB;AACrF"}
1
+ {"version":3,"file":"entra-CJSyeQsx.mjs","names":[],"sources":["../src/lib/auth/entra.ts"],"sourcesContent":["import {\n ConfidentialClientApplication,\n CryptoProvider,\n InteractionRequiredAuthError,\n ServerError,\n} from \"@azure/msal-node\";\nimport type { TokenPayload } from \"~/models/TokenPayload\";\nimport { serverEnv } from \"~/env\";\n\n/**\n * Scopes requested during the interactive login. `offline_access` yields the\n * refresh token that the session is built around; `User.Read` lets us read the\n * user's Graph profile (e.g. avatar). Resource API scopes (file, approval, …) are\n * acquired on demand via {@link acquireDelegatedToken} using the multi-resource\n * refresh token.\n */\nexport const LOGIN_SCOPES = [\"openid\", \"profile\", \"offline_access\", \"User.Read\"];\n\n/** Entra authority for this tenant. */\nexport const ENTRA_AUTHORITY = `https://login.microsoftonline.com/${serverEnv.ENTRA_TENANT_ID}`;\n\n/** Shared across login/callback/refresh calls — stateless and cheap to reuse. */\nexport const cryptoProvider = new CryptoProvider();\n\n/**\n * Creates a confidential client (no persistent cache plugin).\n *\n * The interactive/refresh flows below deliberately use a FRESH client per token\n * operation rather than a singleton: the client's in-memory cache then holds only\n * that operation's tokens, so {@link extractRefreshToken} reads the correct user's\n * refresh token — a shared client would accumulate (and leak) every user's tokens.\n * Persisting just the refresh token (not the whole multi-KB MSAL cache) is what\n * keeps the session in a small cookie with no server-side token store.\n */\nexport const createConfidentialClient = (): ConfidentialClientApplication =>\n new ConfidentialClientApplication({\n auth: {\n clientId: serverEnv.ENTRA_CLIENT_ID,\n clientSecret: serverEnv.ENTRA_CLIENT_SECRET,\n authority: ENTRA_AUTHORITY,\n },\n });\n\n/**\n * Pulls the refresh-token secret out of a client's in-memory MSAL cache. MSAL\n * intentionally hides refresh tokens, so reading the serialized cache is the only\n * way to persist just the RT (instead of the whole cache) in the session cookie.\n */\nfunction extractRefreshToken(client: ConfidentialClientApplication): string | undefined {\n const cache = JSON.parse(client.getTokenCache().serialize()) as {\n RefreshToken?: Record<string, { secret?: string }>;\n };\n return Object.values(cache.RefreshToken ?? {})[0]?.secret;\n}\n\n/** First leg of the auth-code flow: the URL to redirect the browser to. */\nexport function buildAuthCodeUrl(opts: {\n redirectUri: string;\n state: string;\n codeChallenge: string;\n}): Promise<string> {\n return createConfidentialClient().getAuthCodeUrl({\n scopes: LOGIN_SCOPES,\n redirectUri: opts.redirectUri,\n responseMode: \"query\",\n state: opts.state,\n codeChallenge: opts.codeChallenge,\n codeChallengeMethod: \"S256\",\n });\n}\n\n/**\n * Second leg of the auth-code flow: exchange the code for tokens, returning the\n * refresh token and the id-token claims to persist in the session.\n */\nexport async function exchangeCodeForSession(opts: {\n code: string;\n redirectUri: string;\n codeVerifier: string;\n}): Promise<{ refreshToken: string; claims: TokenPayload }> {\n const client = createConfidentialClient();\n const result = await client.acquireTokenByCode({\n code: opts.code,\n scopes: LOGIN_SCOPES,\n redirectUri: opts.redirectUri,\n codeVerifier: opts.codeVerifier,\n });\n\n const refreshToken = extractRefreshToken(client);\n if (!refreshToken)\n throw new Error(\"No refresh token returned (is the offline_access scope granted?)\");\n\n return { refreshToken, claims: (result.idTokenClaims ?? {}) as TokenPayload };\n}\n\n/**\n * Acquires a delegated access token for `scopes` from the stored refresh token.\n * Entra rotates the refresh token on each use, so the (possibly new) refresh\n * token is returned for the caller to persist. Throws when the refresh token is\n * expired/revoked and interaction is required.\n */\n/** The refresh token is expired/revoked — the user must sign in interactively. */\nexport class SessionExpiredError extends Error {}\n\nexport async function acquireDelegatedToken(opts: {\n refreshToken: string;\n scopes: ReadonlyArray<string>;\n}): Promise<{ accessToken: string; refreshToken: string }> {\n const client = createConfidentialClient();\n let result;\n try {\n result = await client.acquireTokenByRefreshToken({\n refreshToken: opts.refreshToken,\n scopes: [...opts.scopes],\n forceCache: true,\n });\n } catch (error) {\n // Revocation, inactivity expiry (AADSTS70008/700082/50173) and Conditional\n // Access sign-in frequency (AADSTS70043) all surface as interaction-required\n // or invalid_grant — the session is dead, only an interactive login helps.\n // Missing consent for the requested resource (AADSTS65001) looks the same to\n // MSAL but is a configuration bug, not a dead session — let it surface as-is.\n if (\n (error instanceof InteractionRequiredAuthError && error.subError !== \"consent_required\") ||\n (error instanceof ServerError && error.errorCode === \"invalid_grant\")\n )\n throw new SessionExpiredError(error.message);\n throw error;\n }\n if (!result) throw new Error(\"Failed to acquire token from refresh token\");\n\n return {\n accessToken: result.accessToken,\n refreshToken: extractRefreshToken(client) ?? opts.refreshToken,\n };\n}\n\n/** Entra's front-channel logout endpoint, which clears the user's IdP session. */\nexport function buildLogoutUrl(postLogoutRedirectUri: string): string {\n const base = `${ENTRA_AUTHORITY}/oauth2/v2.0/logout`;\n return `${base}?post_logout_redirect_uri=${encodeURIComponent(postLogoutRedirectUri)}`;\n}\n"],"mappings":";;;;;;;;;;AAgBA,MAAa,eAAe;CAAC;CAAU;CAAW;CAAkB;AAAW;;AAG/E,MAAa,kBAAkB,qCAAqC,UAAU;;AAG9E,MAAa,iBAAiB,IAAI,eAAe;;;;;;;;;;;AAYjD,MAAa,iCACX,IAAI,8BAA8B,EAChC,MAAM;CACJ,UAAU,UAAU;CACpB,cAAc,UAAU;CACxB,WAAW;AACb,EACF,CAAC;;;;;;AAOH,SAAS,oBAAoB,QAA2D;CACtF,MAAM,QAAQ,KAAK,MAAM,OAAO,cAAc,CAAC,CAAC,UAAU,CAAC;CAG3D,OAAO,OAAO,OAAO,MAAM,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;AACrD;;AAGA,SAAgB,iBAAiB,MAIb;CAClB,OAAO,yBAAyB,CAAC,CAAC,eAAe;EAC/C,QAAQ;EACR,aAAa,KAAK;EAClB,cAAc;EACd,OAAO,KAAK;EACZ,eAAe,KAAK;EACpB,qBAAqB;CACvB,CAAC;AACH;;;;;AAMA,eAAsB,uBAAuB,MAIe;CAC1D,MAAM,SAAS,yBAAyB;CACxC,MAAM,SAAS,MAAM,OAAO,mBAAmB;EAC7C,MAAM,KAAK;EACX,QAAQ;EACR,aAAa,KAAK;EAClB,cAAc,KAAK;CACrB,CAAC;CAED,MAAM,eAAe,oBAAoB,MAAM;CAC/C,IAAI,CAAC,cACH,MAAM,IAAI,MAAM,kEAAkE;CAEpF,OAAO;EAAE;EAAc,QAAS,OAAO,iBAAiB,CAAC;CAAmB;AAC9E;;;;;;;;AASA,IAAa,sBAAb,cAAyC,MAAM,CAAA;AAE/C,eAAsB,sBAAsB,MAGe;CACzD,MAAM,SAAS,yBAAyB;CACxC,IAAI;CACJ,IAAI;EACF,SAAS,MAAM,OAAO,2BAA2B;GAC/C,cAAc,KAAK;GACnB,QAAQ,CAAC,GAAG,KAAK,MAAM;GACvB,YAAY;EACd,CAAC;CACH,SAAS,OAAO;EAMd,IACG,iBAAiB,gCAAgC,MAAM,aAAa,sBACpE,iBAAiB,eAAe,MAAM,cAAc,iBAErD,MAAM,IAAI,oBAAoB,MAAM,OAAO;EAC7C,MAAM;CACR;CACA,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,4CAA4C;CAEzE,OAAO;EACL,aAAa,OAAO;EACpB,cAAc,oBAAoB,MAAM,KAAK,KAAK;CACpD;AACF;;AAGA,SAAgB,eAAe,uBAAuC;CAEpE,OAAO,GAAG,GADM,gBAAe,qBACjB,4BAA6B,mBAAmB,qBAAqB;AACrF"}
@@ -40,6 +40,7 @@ const UpdateFileMetaSchema = FileMetaSchema.extend({ fileName: z$1.string().min(
40
40
  const DeleteFileSchema = FileSchema;
41
41
  const BatchDeleteFilesSchema = GetFileMetasSchema;
42
42
  const UploadFileMetaSchema = z$1.object({
43
+ id: z$1.uuid().default(uuidv7),
43
44
  appName: z$1.string().min(1).max(255),
44
45
  subId: z$1.uuid(),
45
46
  file: z$1.instanceof(File)
@@ -138,7 +139,6 @@ const uploadFile = createServerOnlyFn(async ({ data }) => {
138
139
  const input = UploadFileMetaSchema.parse(data);
139
140
  const accessToken = await getSessionUser() ? await getAccessToken("file") : await getAppToken("file");
140
141
  const stream = Readable.fromWeb(input.file.stream());
141
- const id = uuidv7();
142
142
  await new Promise((resolve, reject) => {
143
143
  new Upload(stream, {
144
144
  endpoint: `${serverEnv.FILE_BASE_URL}/v1/upload`,
@@ -146,7 +146,7 @@ const uploadFile = createServerOnlyFn(async ({ data }) => {
146
146
  uploadSize: input.file.size,
147
147
  chunkSize: 1048576,
148
148
  metadata: {
149
- id,
149
+ id: input.id,
150
150
  appName: input.appName,
151
151
  subId: input.subId,
152
152
  filename: input.file.name,
@@ -158,7 +158,7 @@ const uploadFile = createServerOnlyFn(async ({ data }) => {
158
158
  }).start();
159
159
  });
160
160
  return {
161
- id,
161
+ id: input.id,
162
162
  appName: input.appName,
163
163
  subId: input.subId,
164
164
  fileName: input.file.name
@@ -167,4 +167,4 @@ const uploadFile = createServerOnlyFn(async ({ data }) => {
167
167
  //#endregion
168
168
  export { batchDeleteFiles as a, getFile as c, updateFileMeta as d, uploadFile as f, UploadFileMetaSchema as i, getFileMetas as l, GetFileMetasSchema as n, deleteFile as o, createApi as p, UpdateFileMetaSchema as r, downloadFile as s, FileSchema as t, getFileThumbnail as u };
169
169
 
170
- //# sourceMappingURL=file-BTFDDalH.mjs.map
170
+ //# sourceMappingURL=file-BWcNzq55.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-BWcNzq55.mjs","names":[],"sources":["../src/lib/createApi.ts","../src/data/server/file.ts"],"sourcesContent":["import { createServerOnlyFn } from \"@tanstack/react-start\";\nimport axios, { AxiosError, type AxiosInstance } from \"axios\";\nimport https from \"node:https\";\nimport type { serverEnv } from \"virtual:wcz-layout\";\nimport { scopes as definedScopes } from \"virtual:wcz-layout\";\nimport { getAppToken } from \"~/lib/auth/msalServer\";\nimport { getAccessToken, getSessionUser } from \"~/lib/auth/user\";\n\nexport interface ApiOptions {\n baseURL: keyof typeof serverEnv & `${string}BASE_URL${string}`;\n scopeKey: keyof typeof definedScopes;\n}\n\nconst httpsAgent = new https.Agent({\n rejectUnauthorized: false,\n});\n\nexport const createApi = createServerOnlyFn(\n async ({ baseURL, scopeKey }: ApiOptions): Promise<AxiosInstance> => {\n const resolvedBaseURL = process.env[baseURL];\n if (!resolvedBaseURL) throw new Error(`\"${baseURL}\" env variable is not set.`);\n\n const accessToken = (await getSessionUser())\n ? await getAccessToken(scopeKey)\n : await getAppToken(scopeKey);\n\n const api = axios.create({\n baseURL: resolvedBaseURL,\n httpsAgent,\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n\n api.interceptors.response.use(undefined, (error: unknown) => {\n if (error instanceof AxiosError)\n throw new Error(error.response?.data?.message ?? error.message);\n throw error;\n });\n\n return api;\n },\n);\n","import { createServerOnlyFn } from \"@tanstack/react-start\";\r\nimport type { AxiosResponse } from \"axios\";\r\nimport https from \"node:https\";\r\nimport { Readable } from \"node:stream\";\r\nimport { DefaultHttpStack, Upload } from \"tus-js-client\";\r\nimport { z } from \"zod\";\r\nimport { serverEnv } from \"~/env\";\r\nimport { uuidv7 } from \"~/exports/utils\";\r\nimport { getAppToken } from \"~/lib/auth/msalServer\";\r\nimport { getAccessToken, getSessionUser } from \"~/lib/auth/user\";\r\nimport { createApi } from \"~/lib/createApi\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { FileMetaSchema } from \"~/models/file/FileMeta\";\r\n\r\nexport const GetFileMetasSchema = z.object({\r\n appName: z.string().min(1).max(255),\r\n subId: z.uuid(),\r\n});\r\n\r\nexport const FileSchema = z.object({\r\n appName: z.string().min(1).max(255),\r\n id: z.uuid(),\r\n});\r\n\r\nexport const UpdateFileMetaSchema = FileMetaSchema.extend({\r\n fileName: z.string().min(1).max(255),\r\n});\r\n\r\nconst DeleteFileSchema = FileSchema;\r\n\r\nconst BatchDeleteFilesSchema = GetFileMetasSchema;\r\n\r\nexport interface UploadFileResult {\r\n id: string;\r\n appName: string;\r\n subId: string;\r\n fileName: string;\r\n}\r\n\r\nexport const UploadFileMetaSchema = z.object({\r\n id: z.uuid().default(uuidv7),\r\n appName: z.string().min(1).max(255),\r\n subId: z.uuid(),\r\n file: z.instanceof(File),\r\n});\r\n\r\nconst fileApi = () => createApi({ baseURL: \"FILE_BASE_URL\", scopeKey: \"file\" });\r\n\r\nfunction toFileResponse(response: AxiosResponse<Readable>, disposition?: string): Response {\r\n const headers = new Headers({\r\n \"Cache-Control\": \"private, max-age=3600, immutable\",\r\n \"Content-Type\": String(response.headers[\"content-type\"] ?? \"application/octet-stream\"),\r\n });\r\n const contentLength = response.headers[\"content-length\"];\r\n if (contentLength) headers.set(\"Content-Length\", String(contentLength));\r\n if (disposition) headers.set(\"Content-Disposition\", disposition);\r\n\r\n return new Response(Readable.toWeb(response.data) as ReadableStream, { headers });\r\n}\r\n\r\nexport const getFileMetas = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof GetFileMetasSchema> }): Promise<Array<FileMeta>> => {\r\n const input = GetFileMetasSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"subId\", input.subId);\r\n\r\n const api = await fileApi();\r\n const { data: fileMetas } = await api.request<Array<FileMeta>>({\r\n url: `/v1/meta?${queryParams.toString()}`,\r\n method: \"GET\",\r\n });\r\n return fileMetas;\r\n },\r\n);\r\n\r\nexport const getFileThumbnail = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof FileSchema> }): Promise<Response> => {\r\n const input = FileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n const response = await api.request<Readable>({\r\n url: `/v1/thumbnail?${queryParams.toString()}`,\r\n method: \"GET\",\r\n responseType: \"stream\",\r\n });\r\n\r\n return toFileResponse(response);\r\n },\r\n);\r\n\r\nexport const getFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof FileSchema> }): Promise<Response> => {\r\n const input = FileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n const response = await api.request<Readable>({\r\n url: `/v1?${queryParams.toString()}`,\r\n method: \"GET\",\r\n responseType: \"stream\",\r\n });\r\n\r\n return toFileResponse(response, \"inline\");\r\n },\r\n);\r\n\r\nexport const downloadFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof FileSchema> }): Promise<Response> => {\r\n const input = FileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n const response = await api.request<Readable>({\r\n url: `/v1/download?${queryParams.toString()}`,\r\n method: \"GET\",\r\n responseType: \"stream\",\r\n });\r\n\r\n return toFileResponse(response);\r\n },\r\n);\r\n\r\nexport const updateFileMeta = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof UpdateFileMetaSchema> }): Promise<void> => {\r\n const input = UpdateFileMetaSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n await api.request({ url: `/v1/meta?${queryParams.toString()}`, method: \"PUT\", data: input });\r\n },\r\n);\r\n\r\nexport const deleteFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof DeleteFileSchema> }): Promise<void> => {\r\n const input = DeleteFileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n await api.request({ url: `/v1?${queryParams.toString()}`, method: \"DELETE\" });\r\n },\r\n);\r\n\r\nexport const batchDeleteFiles = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof BatchDeleteFilesSchema> }): Promise<void> => {\r\n const input = BatchDeleteFilesSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"subId\", input.subId);\r\n\r\n const api = await fileApi();\r\n await api.request({ url: `/v1?${queryParams.toString()}`, method: \"DELETE\" });\r\n },\r\n);\r\n\r\nconst insecureHttpsAgent = new https.Agent({ rejectUnauthorized: false });\r\n\r\nexport const uploadFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof UploadFileMetaSchema> }): Promise<UploadFileResult> => {\r\n const input = UploadFileMetaSchema.parse(data);\r\n const accessToken = (await getSessionUser())\r\n ? await getAccessToken(\"file\")\r\n : await getAppToken(\"file\");\r\n const stream = Readable.fromWeb(\r\n input.file.stream() as import(\"node:stream/web\").ReadableStream,\r\n );\r\n\r\n await new Promise<void>((resolve, reject) => {\r\n const upload = new Upload(stream, {\r\n endpoint: `${serverEnv.FILE_BASE_URL}/v1/upload`,\r\n httpStack: new DefaultHttpStack({ agent: insecureHttpsAgent }),\r\n uploadSize: input.file.size,\r\n chunkSize: 1_048_576,\r\n metadata: {\r\n id: input.id,\r\n appName: input.appName,\r\n subId: input.subId,\r\n filename: input.file.name,\r\n filetype: input.file.type,\r\n },\r\n headers: { Authorization: `Bearer ${accessToken}` },\r\n onError: reject,\r\n onSuccess: () => resolve(),\r\n });\r\n upload.start();\r\n });\r\n\r\n return {\r\n id: input.id,\r\n appName: input.appName,\r\n subId: input.subId,\r\n fileName: input.file.name,\r\n };\r\n },\r\n);\r\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,aAAa,IAAI,MAAM,MAAM,EACjC,oBAAoB,MACtB,CAAC;AAED,MAAa,YAAY,mBACvB,OAAO,EAAE,SAAS,eAAmD;CACnE,MAAM,kBAAkB,QAAQ,IAAI;CACpC,IAAI,CAAC,iBAAiB,MAAM,IAAI,MAAM,IAAI,QAAO,2BAA4B;CAE7E,MAAM,cAAe,MAAM,eAAe,IACtC,MAAM,eAAe,QAAQ,IAC7B,MAAM,YAAY,QAAQ;CAE9B,MAAM,MAAM,MAAM,OAAO;EACvB,SAAS;EACT;EACA,SAAS,EAAE,eAAe,UAAU,cAAc;CACpD,CAAC;CAED,IAAI,aAAa,SAAS,IAAI,KAAA,IAAY,UAAmB;EAC3D,IAAI,iBAAiB,YACnB,MAAM,IAAI,MAAM,MAAM,UAAU,MAAM,WAAW,MAAM,OAAO;EAChE,MAAM;CACR,CAAC;CAED,OAAO;AACT,CACF;;;AC1BA,MAAa,qBAAqB,IAAE,OAAO;CACzC,SAAS,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CAClC,OAAO,IAAE,KAAK;AAChB,CAAC;AAED,MAAa,aAAa,IAAE,OA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AM;IACf,OAAO,MAAM;IACb,UAAU,MAAM,KAAK;IACrB,UAAU,MAAM,KAAK;GACvB;GACA,SAAS,EAAE,eAAe,UAAU,cAAc;GAClD,SAAS;GACT,iBAAiB,QAAQ;EAC3B,CACA,CAAM,CAAC,MAAM;CACf,CAAC;CAED,OAAO;EACL,IAAI,MAAM;EACV,SAAS,MAAM;EACf,OAAO,MAAM;EACb,UAAU,MAAM,KAAK;CACvB;AACF,CACF"}
@@ -1,6 +1,6 @@
1
1
  import { l as getAccessToken, m as serverEnv } from "./utils-DjdexspV.mjs";
2
2
  import { t as getAppToken } from "./msalServer-DLwA7_ta.mjs";
3
- import { a as batchDeleteFiles, c as getFile, d as updateFileMeta, l as getFileMetas, n as GetFileMetasSchema, o as deleteFile, r as UpdateFileMetaSchema, s as downloadFile, t as FileSchema, u as getFileThumbnail } from "./file-BTFDDalH.mjs";
3
+ import { a as batchDeleteFiles, c as getFile, d as updateFileMeta, l as getFileMetas, n as GetFileMetasSchema, o as deleteFile, r as UpdateFileMetaSchema, s as downloadFile, t as FileSchema, u as getFileThumbnail } from "./file-BWcNzq55.mjs";
4
4
  import { t as authenticationMiddleware } from "./authMiddleware-DPly0b_T.mjs";
5
5
  import { mutationOptions, queryOptions } from "@tanstack/react-query";
6
6
  import { createServerFn } from "@tanstack/react-start";
@@ -110,9 +110,8 @@ const batchDeleteFilesMutationOptions = ({ queryClient }) => mutationOptions({
110
110
  })
111
111
  });
112
112
  const uploadFileMutationOptions = ({ queryClient }) => mutationOptions({
113
- mutationFn: async ({ appName, subId, file, setProgress }) => {
113
+ mutationFn: async ({ id = uuidv7(), appName, subId, file, setProgress }) => {
114
114
  const { token, endpoint } = await getFileUploadToken();
115
- const id = uuidv7();
116
115
  await new Promise((resolve, reject) => {
117
116
  new Upload(file, {
118
117
  endpoint,
@@ -150,4 +149,4 @@ const uploadFileMutationOptions = ({ queryClient }) => mutationOptions({
150
149
  //#endregion
151
150
  export { fileQueryOptions as a, updateFileMetaMutationOptions as c, fileMetasQueryOptions as i, uploadFileMutationOptions as l, deleteFileMutationOptions as n, fileThumbnailQueryOptions as o, downloadFileMutationOptions as r, openFileMutationOptions as s, batchDeleteFilesMutationOptions as t };
152
151
 
153
- //# sourceMappingURL=file-CuvAmdJW.mjs.map
152
+ //# sourceMappingURL=file-DimNsRly.mjs.map