diff --git a/api/models/Share.js b/api/models/Share.js index 7f0cd231207..8834964fbdc 100644 --- a/api/models/Share.js +++ b/api/models/Share.js @@ -280,15 +280,23 @@ async function updateSharedLink(user, shareId) { } } -async function deleteSharedLink(user, { shareId }) { +async function deleteSharedLink(user, shareId) { if (!user || !shareId) { throw new ShareServiceError('Missing required parameters', 'INVALID_PARAMS'); } try { - const result = await SharedLink.findOneAndDelete({ shareId, user }).exec(); + const result = await SharedLink.findOneAndDelete({ shareId, user }).lean().exec(); - return result ? { message: 'Share deleted successfully' } : { message: 'Share not found' }; + if (!result) { + return null; + } + + return { + success: true, + shareId, + message: 'Share deleted successfully', + }; } catch (error) { logger.error('[deleteSharedLink] Error deleting shared link', { error: error.message, diff --git a/api/server/routes/share.js b/api/server/routes/share.js index 8cbcf0ee86f..5a21a8e4413 100644 --- a/api/server/routes/share.js +++ b/api/server/routes/share.js @@ -123,14 +123,15 @@ router.patch('/:shareId', requireJwtAuth, async (req, res) => { router.delete('/:shareId', requireJwtAuth, async (req, res) => { try { - const deleted = await deleteSharedLink(req.user.id, req.params.shareId); - if (deleted) { - res.status(200).json(deleted); - } else { - res.status(404).end(); + const result = await deleteSharedLink(req.user.id, req.params.shareId); + + if (!result) { + return res.status(404).json({ message: 'Share not found' }); } + + return res.status(200).json(result); } catch (error) { - res.status(500).json({ message: 'Error deleting shared link' }); + return res.status(400).json({ message: error.message }); } }); diff --git a/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsx b/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsx index edb07238cca..ebf0db98afd 100644 --- a/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsx +++ b/client/src/components/Nav/SettingsTabs/Data/SharedLinks.tsx @@ -2,7 +2,7 @@ import { useCallback, useState, useMemo } from 'react'; import { Link } from 'react-router-dom'; import { TrashIcon } from 'lucide-react'; import type { SharedLinkItem, SharedLinksListParams } from 'librechat-data-provider'; -import { OGDialog, OGDialogTrigger, Checkbox, Button, TooltipAnchor, Label } from '~/components/ui'; +import { OGDialog, OGDialogTrigger, Button, TooltipAnchor, Label } from '~/components/ui'; import { useDeleteSharedLinkMutation, useSharedLinksQuery } from '~/data-provider'; import OGDialogTemplate from '~/components/ui/OGDialogTemplate'; import { useLocalize, useMediaQuery } from '~/hooks'; @@ -11,11 +11,7 @@ import { NotificationSeverity } from '~/common'; import { useToastContext } from '~/Providers'; import { formatDate } from '~/utils'; -interface TableRow extends SharedLinkItem { - id?: string; -} - -const PAGE_SIZE = 250; +const PAGE_SIZE = 25; const DEFAULT_PARAMS: SharedLinksListParams = { pageSize: PAGE_SIZE, @@ -35,20 +31,29 @@ export default function SharedLinks() { const { data, fetchNextPage, hasNextPage, isFetchingNextPage, refetch, isLoading } = useSharedLinksQuery(DEFAULT_PARAMS, { enabled: isOpen, + staleTime: 0, + cacheTime: 5 * 60 * 1000, + refetchOnWindowFocus: false, + refetchOnMount: false, }); const allLinks = useMemo(() => { if (!data?.pages) { return []; } - return data.pages.flatMap((page) => page.links); + + return data.pages.flatMap((page) => page.links.filter(Boolean)); }, [data?.pages]); const deleteMutation = useDeleteSharedLinkMutation({ - onSuccess: () => { + onSuccess: async () => { refetch(); + + setIsDeleteOpen(false); + setDeleteRow(null); }, - onError: () => { + onError: (error) => { + console.error('Delete error:', error); showToast({ message: localize('com_ui_share_delete_error'), severity: NotificationSeverity.ERROR, @@ -57,15 +62,30 @@ export default function SharedLinks() { }); const handleDelete = useCallback( - async (selectedRows: TableRow[]) => { + async (selectedRows: SharedLinkItem[]) => { const validRows = selectedRows.filter( - (row) => typeof row.id === 'string' && row.id.length > 0, + (row) => typeof row.shareId === 'string' && row.shareId.length > 0, ); + if (validRows.length === 0) { + showToast({ + message: localize('com_ui_no_valid_items'), + severity: NotificationSeverity.WARNING, + }); + return; + } + try { - await Promise.all( - validRows.map((row) => deleteMutation.mutateAsync({ shareId: row.id as string })), - ); + for (const row of validRows) { + await deleteMutation.mutateAsync({ shareId: row.shareId }); + } + + showToast({ + message: localize( + validRows.length === 1 ? 'com_ui_delete_success' : 'com_ui_bulk_delete_success', + ), + severity: NotificationSeverity.SUCCESS, + }); } catch (error) { console.error('Failed to delete shared links:', error); showToast({ @@ -84,7 +104,7 @@ export default function SharedLinks() { await fetchNextPage(); }, [fetchNextPage, hasNextPage, isFetchingNextPage]); - const [deleteRow, setDeleteRow] = useState(null); + const [deleteRow, setDeleteRow] = useState(null); const confirmDelete = useCallback(() => { if (deleteRow) { @@ -98,7 +118,7 @@ export default function SharedLinks() { { accessorKey: 'title', header: 'Name', - cell: ({ row }) => ( + cell: ({ row }) => ( ( + cell: ({ row }) => ( } /> diff --git a/client/src/components/ui/DataTable.tsx b/client/src/components/ui/DataTable.tsx index 3f98a3f8068..557aedb96c7 100644 --- a/client/src/components/ui/DataTable.tsx +++ b/client/src/components/ui/DataTable.tsx @@ -39,6 +39,32 @@ type TableColumn = ColumnDef & { }; }; +type SelectionHandler = (rowId: string, selected: boolean) => void; + +const SelectionCheckbox = memo( + ({ + checked, + onChange, + ariaLabel, + }: { + checked: boolean; + onChange: (value: boolean) => void; + ariaLabel: string; + }) => ( +
e.stopPropagation()} + className="flex h-full w-[30px] items-center justify-center" + onClick={(e) => e.stopPropagation()} + > + +
+ ), +); + +SelectionCheckbox.displayName = 'SelectionCheckbox'; + interface DataTableProps { columns: TableColumn[]; data: TData[]; @@ -52,6 +78,7 @@ interface DataTableProps { hasNextPage?: boolean; fetchNextPage?: (options?: unknown) => Promise; enableRowSelection?: boolean; + showCheckboxes?: boolean; } const TableRowComponent = ({ @@ -61,48 +88,66 @@ const TableRowComponent = ({ }: { row: Row; isSmallScreen: boolean; - onSelectionChange?: (rowId: string, selected: boolean) => void; + onSelectionChange?: SelectionHandler; }) => { - const handleRowClick = (e: React.MouseEvent) => { - if ((e.target as HTMLElement).closest('input[type="checkbox"]')) { - return; - } - if ((e.target as HTMLElement).closest('select')) { - return; - } - row.toggleSelected(); - onSelectionChange?.(row.id, !row.getIsSelected()); - }; + const handleSelection = useCallback( + (value: boolean) => { + row.toggleSelected(value); + onSelectionChange?.(row.id, value); + }, + [row, onSelectionChange], + ); return ( - {row.getVisibleCells().map((cell) => ( - , isSmallScreen)} - > - {flexRender(cell.column.columnDef.cell, cell.getContext())} - - ))} + {row.getVisibleCells().map((cell) => { + if (cell.column.id === 'select') { + return ( + + + + ); + } + + return ( + , + isSmallScreen, + )} + > + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ); + })} ); }; -const MemoizedTableRow = memo(TableRowComponent, (prev, next) => { - return ( - prev.row.id === next.row.id && - prev.isSmallScreen === next.isSmallScreen && - prev.row.getIsSelected() === next.row.getIsSelected() - ); -}); +const MemoizedTableRow = memo( + TableRowComponent as typeof TableRowComponent, + (prev, next) => { + return ( + prev.row.id === next.row.id && + prev.isSmallScreen === next.isSmallScreen && + prev.row.getIsSelected() === next.row.getIsSelected() + ); + }, +) as typeof TableRowComponent; function useVirtualizedWindow(totalItems: number, itemHeight: number, containerHeight: number) { const [scrollTop, setScrollTop] = useState(0); + const [version, setVersion] = useState(0); + const visibleItems = Math.ceil(containerHeight / itemHeight); const bufferSize = Math.ceil(visibleItems / 2); @@ -112,10 +157,16 @@ function useVirtualizedWindow(totalItems: number, itemHeight: number, containerH Math.floor(scrollTop / itemHeight) + visibleItems + bufferSize, ); + const refreshVirtualWindow = useCallback(() => { + setVersion((v) => v + 1); + }, []); + return { startIndex, endIndex, setScrollTop, + refreshVirtualWindow, + version, }; } @@ -179,11 +230,13 @@ export default function DataTable({ hasNextPage = false, fetchNextPage, enableRowSelection = true, + showCheckboxes = true, }: DataTableProps) { const localize = useLocalize(); const isSmallScreen = useMediaQuery('(max-width: 768px)'); const scrollRef = useRef(null); const [isDeleting, setIsDeleting] = useState(false); + const lastDataLength = useRef(data.length); const [rowSelection, setRowSelection] = useState>({}); const [sorting, setSorting] = useState(defaultSort); @@ -194,18 +247,22 @@ export default function DataTable({ const ROW_HEIGHT = 48; const containerHeight = scrollRef.current?.clientHeight ?? 600; - const { startIndex, endIndex, setScrollTop } = useVirtualizedWindow( - data.length, - ROW_HEIGHT, - containerHeight, - ); + const { startIndex, endIndex, setScrollTop, refreshVirtualWindow, version } = + useVirtualizedWindow(data.length, ROW_HEIGHT, containerHeight); + + useEffect(() => { + if (data.length !== lastDataLength.current) { + lastDataLength.current = data.length; + refreshVirtualWindow(); + } + }, [data.length, refreshVirtualWindow]); const handleSelectionChange = useCallback((rowId: string, selected: boolean) => { setRowSelection((prev) => ({ ...prev, [rowId]: selected })); }, []); const tableColumns = useMemo(() => { - if (!enableRowSelection) { + if (!enableRowSelection || !showCheckboxes) { return columns; } const selectColumn = { @@ -221,35 +278,29 @@ export default function DataTable({ /> ), - cell: ({ row }: { row: Row }) => { - const CheckboxCell = useMemo(() => { - return ( -
e.stopPropagation()} - className="flex h-full w-[30px] items-center justify-center" - onClick={(e) => e.stopPropagation()} - > - { - row.toggleSelected(Boolean(value)); - handleSelectionChange(row.id, Boolean(value)); - }} - aria-label="Select row" - /> -
- ); - }, [row.id, row.getIsSelected(), handleSelectionChange]); - - return CheckboxCell; - }, + cell: ({ row }: { row: Row }) => ( +
e.stopPropagation()} + className="flex h-full w-[30px] items-center justify-center" + onClick={(e) => e.stopPropagation()} + > + { + row.toggleSelected(Boolean(value)); + handleSelectionChange(row.id, Boolean(value)); + }} + aria-label="Select row" + /> +
+ ), meta: { size: '50px' }, }; return [selectColumn, ...columns]; - }, [columns, enableRowSelection, handleSelectionChange]); + }, [columns, enableRowSelection, showCheckboxes, handleSelectionChange]); const table = useReactTable({ data, @@ -279,14 +330,17 @@ export default function DataTable({ const itemsToDelete = table.getFilteredSelectedRowModel().rows.map((r) => r.original); try { await onDelete(itemsToDelete); + refreshVirtualWindow(); } finally { setRowSelection({}); setIsDeleting(false); } - }, [onDelete, table]); + }, [onDelete, table, refreshVirtualWindow]); const selectedRowsCount = table.getFilteredSelectedRowModel().rows.length; - const visibleRows = table.getRowModel().rows.slice(startIndex, endIndex); + const visibleRows = useMemo(() => { + return table.getRowModel().rows.slice(startIndex, endIndex); + }, [table, startIndex, endIndex, version]); useEffect(() => { let rafHandle: number; @@ -294,15 +348,18 @@ export default function DataTable({ if (!scrollRef.current) { return; } + rafHandle = requestAnimationFrame(() => { const el = scrollRef.current; if (!el) { return; } + const currentScrollTop = el.scrollTop; const scrollingDown = currentScrollTop > lastScrollTop.current; lastScrollTop.current = currentScrollTop; setScrollTop(currentScrollTop); + if (scrollingDown && !isFetchingNextPage && hasNextPage) { const nearBottom = el.scrollHeight - currentScrollTop <= el.clientHeight * 1.5; if (nearBottom) { @@ -311,8 +368,10 @@ export default function DataTable({ } }); }; + const div = scrollRef.current; div?.addEventListener('scroll', handleScroll, { passive: true }); + return () => { div?.removeEventListener('scroll', handleScroll); if (rafHandle) { @@ -324,13 +383,15 @@ export default function DataTable({ return (
- + {enableRowSelection && showCheckboxes && ( + + )} {typeof filterColumn === 'string' && filterColumn !== '' && table.getColumn(filterColumn) && ( @@ -363,7 +424,7 @@ export default function DataTable({ checked={col.getIsVisible()} onCheckedChange={(value) => col.toggleVisibility(Boolean(value))} > - {columnVisibilityMap[col.id] || localize('com_ui_' + col.id)} + {columnVisibilityMap[col.id] || localize(col.columnDef.header)} ))} @@ -378,7 +439,7 @@ export default function DataTable({ )} > - + {table.getHeaderGroups().map((headerGroup) => ( {headerGroup.headers.map((header) => { @@ -407,10 +468,9 @@ export default function DataTable({ {startIndex > 0 && } {visibleRows.map((row) => ( ))} {endIndex < data.length && ( @@ -418,9 +478,9 @@ export default function DataTable({ )} {(isFetchingNextPage || hasNextPage) && ( - + -
+
{isFetchingNextPage ? ( ) : ( diff --git a/client/src/data-provider/mutations.ts b/client/src/data-provider/mutations.ts index 6a4e8ea9438..ba634393874 100644 --- a/client/src/data-provider/mutations.ts +++ b/client/src/data-provider/mutations.ts @@ -1,7 +1,6 @@ import { Constants, LocalStorageKeys, - InfiniteCollections, defaultAssistantsVersion, ConversationListResponse, } from 'librechat-data-provider'; @@ -290,31 +289,76 @@ export const useUpdateSharedLinkMutation = ( export const useDeleteSharedLinkMutation = ( options?: t.DeleteSharedLinkOptions, -): UseMutationResult => { +): UseMutationResult => { const queryClient = useQueryClient(); - const { onSuccess, ..._options } = options || {}; - return useMutation(({ shareId }) => dataService.deleteSharedLink(shareId), { - onSuccess: (_data, vars, context) => { - if (!vars.shareId) { - return; - } + const { onSuccess } = options || {}; - queryClient.setQueryData([QueryKeys.sharedMessages, vars.shareId], null); - queryClient.setQueryData([QueryKeys.sharedLinks], (data) => { - if (!data) { - return data; + return useMutation( + ({ shareId }) => dataService.deleteSharedLink(shareId), + { + onMutate: async ({ shareId }) => { + await queryClient.cancelQueries({ + queryKey: ['sharedLinks'], + exact: false, + }); + + const previousQueries = new Map(); + const queryKeys = queryClient.getQueryCache().findAll(['sharedLinks']); + + queryKeys.forEach((query) => { + const previousData = queryClient.getQueryData(query.queryKey); + previousQueries.set(query.queryKey, previousData); + + queryClient.setQueryData(query.queryKey, (old) => { + if (!old?.pages) { + return old; + } + + const updatedPages = old.pages.map((page) => ({ + ...page, + links: page.links.filter((link) => link.shareId !== shareId), + })); + + const nonEmptyPages = updatedPages.filter((page) => page.links.length > 0); + + return { + ...old, + pages: nonEmptyPages, + }; + }); + }); + + return { previousQueries }; + }, + + onError: (err, variables, context) => { + if (context?.previousQueries) { + context.previousQueries.forEach((data, queryKey) => { + queryClient.setQueryData(queryKey, data); + }); } - return normalizeData( - deleteSharedLink(data, vars.shareId), - InfiniteCollections.SHARED_LINKS, - data.pages[0].pageSize as number, - ); - }); - const current = queryClient.getQueryData([QueryKeys.sharedLinks]); - onSuccess?.(_data, vars, context); + }, + + onSettled: () => { + queryClient.invalidateQueries({ + queryKey: ['sharedLinks'], + exact: false, + refetchType: 'all', + }); + }, + + onSuccess: async (data, variables) => { + if (onSuccess) { + await onSuccess(data, variables); + } + + await queryClient.refetchQueries({ + queryKey: ['sharedLinks'], + exact: false, + }); + }, }, - ..._options, - }); + ); }; // Add a tag or update tag information (tag, description, position, etc.) diff --git a/client/src/localization/languages/Eng.ts b/client/src/localization/languages/Eng.ts index ab90e3a6d42..0fb9afa7ba0 100644 --- a/client/src/localization/languages/Eng.ts +++ b/client/src/localization/languages/Eng.ts @@ -377,6 +377,8 @@ export default { com_ui_share_error: 'There was an error sharing the chat link', com_ui_share_retrieve_error: 'There was an error retrieving the shared links', com_ui_share_delete_error: 'There was an error deleting the shared link', + com_ui_bulk_delete_error: 'Failed to delete shared links', + com_ui_bulk_delete_partial_error: 'Failed to delete {0} shared links', com_ui_share_create_message: 'Your name and any messages you add after sharing stay private.', com_ui_share_created_message: 'A shared link to your chat has been created. Manage previously shared chats at any time via Settings.', @@ -443,6 +445,7 @@ export default { com_ui_refresh_link: 'Refresh link', com_ui_show_qr: 'Show QR Code', com_ui_hide_qr: 'Hide QR Code', + com_ui_title: 'Title', com_auth_error_login: 'Unable to login with the information provided. Please check your credentials and try again.', com_auth_error_login_rl: diff --git a/client/src/utils/sharedLink.fakeData.ts b/client/src/utils/sharedLink.fakeData.ts deleted file mode 100644 index fb9d579fa07..00000000000 --- a/client/src/utils/sharedLink.fakeData.ts +++ /dev/null @@ -1,857 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-nocheck -import type { SharedLinkListData } from 'librechat-data-provider'; - -const today = new Date(); -today.setDate(today.getDate() - 3); - -export const sharedLinkData: SharedLinkListData = { - pages: [ - { - sharedLinks: [ - { - conversationId: '7a327f49-0850-4741-b5da-35373e751256', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-04T04:31:04.897Z', - isPublic: true, - messages: [ - 'b3c2e29b131c464182b483c4', - '6dc217152a134ac1826fc46c', - '483658114d104691b2501fbf', - 'cfb8467cfd30438e8268cf92', - ], - shareId: '62f850ad-a0d8-48a5-b439-2d1dbaba291c', - title: 'Test Shared Link 1', - updatedAt: '2024-04-11T11:10:42.329Z', - }, - { - conversationId: '1777ad5f-5e53-4847-be49-86f66c649ac6', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-05T05:59:31.571Z', - isPublic: true, - messages: [ - 'bc53fda136ba46fb965260b8', - '138b83d659c84250904feb53', - '1c750ffab31546bd85b81360', - '7db87f183e4d489fae0b5161', - '64ee2004479644b7b5ffd2ea', - '4dd2b9a0704c4ae79688292e', - '25394c2bb2ee40feaf67836f', - '838ed537d9054780a3d9f272', - '300728390f8c4021a6c066ca', - 'ea30b637cb8f463192523919', - ], - shareId: '1f43f69f-0562-4129-b181-3c37df0df43e', - title: 'Test Shared Link 2', - updatedAt: '2024-04-16T17:52:40.250Z', - }, - { - conversationId: 'a9682067-a7c9-4375-8efb-6b8fa1c71def', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-03T08:23:35.147Z', - isPublic: true, - messages: [ - 'bb4fe223548b480eae6d64af', - '420ef02293d0470b96980e7b', - 'ae0ffbb27e13418fbd63e7c2', - '43df3ea55cfb4219b1630518', - 'c4fb3be788404058a4c9780d', - '6ee6a5833b1d4849a95be890', - '0b8a3ecf5ca5449b9bdc0ed8', - 'a3daed97f0e5432a8b6031c0', - '6a7d10c55c9a46cfbd08d6d2', - '216d40fa813a44059bd01ab6', - ], - shareId: 'e84d2642-9b3a-4e20-b92a-11a37eebe33f', - title: 'Test Shared Link 3', - updatedAt: '2024-02-06T04:21:17.065Z', - }, - { - conversationId: 'b61f9a0a-6d5d-4d0e-802b-4c1866428816', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-06T19:25:45.708Z', - isPublic: true, - messages: ['00aad718514044dda8e044ec', '8cb3b67fccd64b8c8ac0abbb'], - shareId: '9011e12a-b2fe-4003-9623-bf1b5f80396b', - title: 'Test Shared Link 4', - updatedAt: '2024-03-21T22:37:32.704Z', - }, - { - conversationId: '4ac3fd9e-437b-4988-b870-29cacf28abef', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-03T15:45:11.220Z', - isPublic: true, - messages: [ - '6b05f825ca7747f294f2ac64', - '871ee06fb6a141879ca1cb25', - '47b05821c6134a3b9f21072e', - ], - shareId: '51d3ab25-195e-47d0-a5e3-d0694ece776a', - title: 'Test Shared Link 5', - updatedAt: '2024-04-03T23:20:11.213Z', - }, - { - conversationId: '6ed26de8-3310-4abb-b561-4bdae9400aac', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-22T19:12:14.995Z', - isPublic: true, - messages: [ - 'ac2929efa82b4cd78aae02d6', - '4266450abc7b41a59887e99d', - '95df3c7c802c40e0b643bb96', - 'f21038af46074e51a2c4bd87', - '3f064bc8589c435786a92bcb', - ], - shareId: 'c3bc13ed-190a-4ffa-8a05-50f8dad3c83e', - title: 'Test Shared Link 6', - updatedAt: '2024-04-25T19:55:25.785Z', - }, - { - conversationId: 'b3c0aaca-ee76-42a2-b53b-5e85baca2f91', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-04T00:37:12.929Z', - isPublic: true, - messages: [ - '5a44ebd0bf05418e98cc9e5d', - '88b93127aef74bfb94666ac1', - 'bf654993c34743c9a5a1b76c', - '2514259bd702491e924da475', - '60dbbf91a6734aa081e082cd', - '11efabaa3a8f4df8bf85410b', - '3f5bbf38abdb42efa65a8740', - '5b9dd8246dde41ae9ebd57c4', - ], - shareId: '871d41fe-fb8a-41d4-8460-8bb93fb8aa98', - title: 'Test Shared Link 7', - updatedAt: '2024-03-13T14:34:26.790Z', - }, - { - conversationId: '2071122a-57cc-4f16-baa8-1e8af3e23522', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-01-24T03:22:58.012Z', - isPublic: true, - messages: [ - '8c94aad21caa45d6acb863c8', - 'c10e4e0bfe554a94920093ba', - '2e4c2e2238f24f63b08440bc', - '05bacd00320342298f9f439f', - 'c8b7750a7d8a4e2fbdc2630b', - 'a84573fea668476a87207979', - '6ab15a1b96c24798b1bddd6f', - 'b699d8e42324493eae95ca44', - ], - shareId: 'f90f738a-b0ac-4dba-bb39-ad3d77919a21', - title: 'Test Shared Link 8', - updatedAt: '2024-01-22T11:09:51.834Z', - }, - { - conversationId: 'ee06374d-4452-4fbe-a1c0-5dbc327638f9', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-03T19:24:21.281Z', - isPublic: true, - messages: [ - '297d0827c81a4da0a881561a', - '3131ef1b3c484542b0db1f92', - 'e8879a50340c49449e970dbc', - 'fe598327a93b4b0399055edd', - 'acc7a2a24e204325befffbcd', - '6ec3c6450e124cbf808c8839', - '714e3443f62045aaaff17f93', - '014be593aaad41cab54a1c44', - ], - shareId: '0fc91bab-083d-449f-add3-1e32146b6c4a', - title: 'Test Shared Link 9', - updatedAt: '2024-03-14T00:52:52.345Z', - }, - { - conversationId: '0d2f6880-cacf-4f7b-930e-35881df1cdea', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-02-14T03:18:45.587Z', - isPublic: true, - messages: ['1d045c1cf37742a6a979e21b'], - shareId: 'd87deb62-b993-476c-b520-104b08fd7445', - title: 'Test Shared Link 10', - updatedAt: '2024-03-26T18:38:41.222Z', - }, - { - conversationId: '1fe437fd-68f0-4e3e-81a9-ca9a0fa8220a', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-02-16T19:55:23.412Z', - isPublic: true, - messages: [ - 'a28b5f27c95e4700bcd158dc', - '6e85f0a8b6ae4107a5819317', - 'fa5b863c91224a0098aebd64', - 'b73811a510e54acebe348371', - 'f3f7f7d7b69a485da727f9c2', - '81d82df3098c4e359d29703f', - ], - shareId: '704a1a9c-5366-4f55-b69e-670a374f4326', - title: 'Test Shared Link 11', - updatedAt: '2024-04-11T05:00:25.349Z', - }, - { - conversationId: '50465c8e-102f-4f94-88c2-9cf607a6c336', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-02-05T21:57:52.289Z', - isPublic: true, - messages: [ - 'a64886199ab641c29eb6fdaf', - '9c16497010354cf385d4cc1d', - '36cdeb4d1e4f45078edfe28a', - 'a11f4ea78fa44f57bfc5bfc6', - 'dea42fcfe7a544feb5debc26', - 'ece0d630cd89420ca80ffe25', - '719165a5d80644ae8fae9498', - 'f27111921a10470982f522b2', - '10b78255f7a24b6192e67693', - ], - shareId: 'e47eaf30-c1ed-4cc2-b2b8-8cdec4b1ea2f', - title: 'Test Shared Link 12', - updatedAt: '2024-02-07T15:43:21.110Z', - }, - { - conversationId: '1834f551-0a68-4bc7-a66a-21a234462d24', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-23T02:58:52.653Z', - isPublic: true, - messages: [ - 'cb5d19d986194f779a6f47fd', - '72159d6668f347f99398aec9', - 'cbe535213d664a6280d9a19e', - '8dccceadcb3a44148962ba47', - ], - shareId: '976b55cb-d305-40f8-ae06-ae516f4e49f5', - title: 'Test Shared Link 13', - updatedAt: '2024-05-02T10:21:05.190Z', - }, - { - conversationId: 'd8175b2f-f7c0-4f61-850d-f524bf8a84df', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-09T09:04:10.576Z', - isPublic: true, - messages: [ - '0f3708fc670d46998b1294d5', - '794520b9cee84c23bff01d5a', - 'b05d2af2d37c426a970d8326', - 'bd4239e379284d01acb9aaf4', - 'e6265cfbbd88420781b27248', - '5262193aef7c426cafe2ee85', - '848569e2ca4843beaf64efc4', - '99f3b438241c4454a6784ac2', - '111d346fbeae4806bdf23490', - 'fe4bde34e1a143f1a12fa628', - ], - shareId: '928eb0a8-e0ea-470d-8b6a-92e0981d61b0', - title: 'Test Shared Link 14', - updatedAt: '2024-04-15T18:00:13.094Z', - }, - { - conversationId: '281984c0-fed0-4428-8e50-c7c93cba4ae0', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-23T23:26:41.956Z', - isPublic: true, - messages: [ - '7e781fd08408426795c243e7', - '3c6d729fd3524a65a7b2a5e3', - '53bdbec6ee6148e78795d6e1', - '46f8170f28684ccc8ee56f33', - '3350d9aa7c814c89af6d3640', - ], - shareId: '7a251af6-1ad3-4b24-830c-21b38124f325', - title: 'Test Shared Link 15', - updatedAt: '2024-03-18T16:33:35.498Z', - }, - { - conversationId: '09610b11-6087-4d15-b163-e1bc958f2e82', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-02-05T20:00:36.159Z', - isPublic: true, - messages: ['6dce61720af24c70926efe87'], - shareId: '2b389d5e-eb24-4b29-a8e1-c0545cdfa1fc', - title: 'Test Shared Link 16', - updatedAt: '2024-02-23T05:49:50.020Z', - }, - { - conversationId: '0c388322-905c-4c57-948c-1ba9614fdc2f', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-05T00:03:20.078Z', - isPublic: true, - messages: [ - 'e3755ff2cf9f403c9d20901f', - 'e32733b8da1440ec9d9dc2df', - 'e2870d0361634d4f867e1e57', - '2e504afb8675434bb9f58cb5', - 'ea38d76735c54f94bf378ed3', - '8712cda1bfc8480eba6c65aa', - '3f43a655706f4032a9e1efb4', - '3f890f8279f4436da2a7d767', - '4ca7616c04404391a7cfc94f', - 'd3e176a831ff48e49debabce', - ], - shareId: '2866400b-bcb9-43a4-8cbf-6597959f8c55', - title: 'Test Shared Link 17', - updatedAt: '2024-03-16T02:53:06.642Z', - }, - { - conversationId: '5ac2b90a-63f8-4388-919b-40a1c1fea874', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-01-21T15:30:37.893Z', - isPublic: true, - messages: [ - '734a0427c6224fca87e2a89d', - '6af13387ddf0495d9c6ebad9', - '02a93d5659f343678b12b932', - '8af2f028c5114286a3339075', - '3a8bec13fc574fb9a9f938e2', - '6f4aa482286548b7b42668e6', - 'c1d4f94a2eaf4e44b94c5834', - '442d9491b51d49fcab60366d', - '82a115a84b2a4457942ca6cf', - '152d8c2894a0454d9248c9f5', - ], - shareId: 'e76f6a90-06f3-4846-8e3d-987d37af27b5', - title: 'Test Shared Link 18', - updatedAt: '2024-01-27T06:25:27.032Z', - }, - { - conversationId: '01521fef-aa0b-4670-857d-f19bfc0ce664', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-01T21:46:40.674Z', - isPublic: true, - messages: [ - '222cf562d8e24b1b954395c2', - 'c6f299f588c24905b771e623', - 'f023f30fd4d9472c9bf60b84', - 'e4929e3f14d748a18656f1be', - 'a01f453fcb0a49b5b488a22c', - '4ceee6b365ab4386bacb4d27', - 'c2cab81da0be4c6e97f11f92', - '644c32d10f2f4e2086d5e04d', - '5225d1286db14cc6a47fdea5', - 'c821ebb220ae495b98f2e17f', - ], - shareId: '1b2d8bf5-ff90-478a-bdf6-ea622fb4875a', - title: 'Test Shared Link 19', - updatedAt: '2024-02-25T15:52:56.189Z', - }, - { - conversationId: '54f5d332-efc7-4062-9e1d-c70c3dbbc964', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-01-29T15:57:22.808Z', - isPublic: true, - messages: [ - '49771038e2dd4de0a28b19f2', - '0debd4ad13de4db9a65fe589', - 'a9c8e6e34c34486ca27b7c88', - 'd7b0ace0438146789e8b1899', - ], - shareId: '4f5eea7d-b3a8-4b72-ad1e-a4d516c582c2', - title: 'Test Shared Link 20', - updatedAt: '2024-03-18T13:12:10.828Z', - }, - { - conversationId: '99dabf25-46a5-43bb-8274-715c64e56032', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-05T03:35:11.327Z', - isPublic: true, - messages: ['965a55515727404eb70dec8f'], - shareId: '2360b7c1-20d7-46b9-919d-65576a899ab9', - title: 'Test Shared Link 21', - updatedAt: '2024-04-17T11:22:12.800Z', - }, - { - conversationId: '1e2ffc1a-3546-460e-819c-689eb88940c6', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-22T08:40:32.663Z', - isPublic: true, - messages: [ - '131f4b03ad3d4e90803a203d', - '7f55262c554f4d97a8fef0ec', - '341e8fea28e241fc8b5a2398', - ], - shareId: 'f3e370ed-420c-4579-a033-e18743b49485', - title: 'Test Shared Link 22', - updatedAt: '2024-04-07T22:06:07.162Z', - }, - { - conversationId: '14510a0c-01cc-4bfb-8336-3388573ac4d8', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-08T08:20:28.619Z', - isPublic: true, - messages: [ - '022f87b1bf0d4e4688970daa', - '42519e8f3603496faae0969c', - 'abc29ac88d66485aa11e4b58', - ], - shareId: '0f46f1fd-95d3-4a6f-a5aa-ae5338dc5337', - title: 'Test Shared Link 23', - updatedAt: '2024-03-06T12:05:33.679Z', - }, - { - conversationId: '2475594e-10dc-4d6a-aa58-5ce727a36271', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-04T07:43:46.952Z', - isPublic: true, - messages: [ - '5d0cd8bef4c241aba5d822a8', - 'a19669a364d84ab5bbafbe0c', - '336686022ea6456b9a63879d', - '3323c9b85acc4ffba35aad04', - 'bf15e8860a01474cb4744842', - '5a055eb825ed4173910fffd5', - '36a5e683ad144ec68c2a8ce0', - '8bc1d5590a594fa1afc18ee1', - 'f86444b60bea437ba0d0ef8e', - '5be768788d984723aef5c9a0', - ], - shareId: 'b742f35c-e6a3-4fa4-b35d-abab4528d7d6', - title: 'Test Shared Link 24', - updatedAt: '2024-03-27T15:31:10.930Z', - }, - { - conversationId: 'ddb5a61c-82fe-4cc7-a2b0-c34b8c393b28', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-02-15T02:06:45.901Z', - isPublic: true, - messages: [ - '059d7ae5405a42af9c52171d', - '303efd2e676e4fe7aa9fa9d0', - '9f459c2e6a23411ea4a3e153', - '6036a3785adc4b7caa7ea22b', - '65251979d0c64d1f8821b3d9', - '25fdeb5ed99d42cca3041e08', - '61baa25e4e3d42a3aefd6c16', - '91dc4578fee749aeb352b5ea', - 'd52daca5afb84e7890d5d9ad', - ], - shareId: '13106e5f-1b5f-4ed4-963d-790e61c1f4c8', - title: 'Test Shared Link 25', - updatedAt: '2024-02-05T08:39:45.847Z', - }, - { - conversationId: 'df09c89b-0b0d-429c-9c93-b5f4d51ef1ec', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-28T07:50:10.724Z', - isPublic: true, - messages: [ - '7f007af305ee4f2197c125d3', - '318b26abfe864dbf9f557bf9', - '0c4709b489ac4211b9f22874', - '8940f9ab45f44b56911819d5', - 'b47ec3aa0cf7413fa446f19b', - '3857f85f492f4e11aa0ea377', - ], - shareId: '31bbafa4-2051-4a20-883b-2f8557c46116', - title: 'Test Shared Link 26', - updatedAt: '2024-02-01T19:52:32.986Z', - }, - { - conversationId: '856a4d54-54f7-483f-9b4e-7b798920be25', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-14T08:57:03.592Z', - isPublic: true, - messages: [ - 'b5afc1f3569d44378bc7539d', - 'e54804329577443d8685d3b1', - '7b10204ad48c464aac2b752a', - '8e96d562d33b4d6b85f2269e', - 'cd844644f15d4dbdb5772a3b', - '91f5159278ca420c8a0097b2', - '5f8cf34736df4cca962635c1', - '96e2169ddcf5408fb793aeb6', - '988d96959afb4ec08cd3cec4', - '173398cdf05d4838aeb5ad9f', - ], - shareId: '88c159a0-0273-4798-9d21-f95bd650bd30', - title: 'Test Shared Link 27', - updatedAt: '2024-05-08T20:07:46.345Z', - }, - { - conversationId: '41ee3f3f-36a5-4139-993a-1c4d7d055ccb', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-02-26T10:08:29.943Z', - isPublic: true, - messages: ['883cc3286240405ba558f322', '7ca7809f471e481fa9944795'], - shareId: '97dc26aa-c909-4a9c-91be-b605d25b9cf3', - title: 'Test Shared Link 28', - updatedAt: '2024-04-06T17:36:05.767Z', - }, - { - conversationId: '79e30f91-9b87-484c-8a12-6e4c6e8973d4', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-05-07T05:28:58.595Z', - isPublic: true, - messages: [ - 'a8ac347785504b51bdad7ea7', - 'ce85321aecf64355b0362f8c', - '21a462895f37474d8d6acdfd', - '095d9104011e4534bda93294', - '503b6e27677c457289366a8d', - '1738d52a60004c9ba6f0c9ec', - 'a157fe44a67f4882a507941b', - '40e30dc275394eb4b9921db0', - 'f4ed9f2fb08640fcbacaa6a7', - 'bbac358328864dc2bfaa39da', - ], - shareId: 'aa36fc45-2a73-4fa2-a500-2a9148fca67d', - title: 'Test Shared Link 29', - updatedAt: '2024-01-26T16:45:59.269Z', - }, - { - conversationId: 'f5eaa000-3657-43d4-bc55-538108723b83', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-02-22T15:51:31.330Z', - isPublic: true, - messages: [ - 'a87cfce565844b4ba9230dc5', - '426723bc4c22425e9bdf4b7b', - '73be5795469a444b8f1eca88', - '75a87212574a4cfc80d7d4e3', - '80f982dfc3e94535aed6e7d4', - '86d036c912c142ca8ec0f45a', - 'e3435fbbd4d2443eba30e97d', - 'e451e124aa964398b596af5d', - '1a13913f55e9442e8b5d7816', - ], - shareId: 'fe0f7ea2-74d2-40ba-acb2-437e61fc3bef', - title: 'Test Shared Link 30', - updatedAt: '2024-02-27T13:29:04.060Z', - }, - { - conversationId: 'a1ad92b4-6fac-44be-bad6-7648aeeba7af', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-10T09:32:22.242Z', - isPublic: true, - messages: [ - '5931cd94fbcd4fbcbaa20b91', - '0bc5f38ccc4f4b88afa42aed', - '7b4375d65f3f4524a79cb5f0', - 'd2ce098360ce4d19b6961017', - '847f5ee8d2df49a0ba1fd8a7', - '6164a71770c745ea8142a37c', - 'e98a0f1e15c846ac9b113608', - '5297d7df09b44d088cf80da5', - '62260b3f62ba423aa5c1962c', - '21fffc89d1d54e0190819384', - ], - shareId: 'ee5ae35d-540d-4a01-a938-ee7ee97b15ce', - title: 'Test Shared Link 31', - updatedAt: '2024-02-26T03:37:24.862Z', - }, - { - conversationId: '1e502d46-c710-4848-9bf2-674c08e51d9c', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-09T08:37:01.082Z', - isPublic: true, - messages: [ - 'adb4bfb7657d4d7d92e82edf', - '70bdd81466e0408399b415d3', - 'ef99511981dc4c3baa18d372', - ], - shareId: 'b4fd8b63-7265-4825-89a4-9cebcbaadeee', - title: 'Test Shared Link 32', - updatedAt: '2024-02-27T04:32:40.654Z', - }, - { - conversationId: 'd1a43c39-f05e-4c6e-a8c2-0fcca9cb8928', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-26T15:03:25.546Z', - isPublic: true, - messages: [ - '07c070ab8a7541fea96b131c', - 'eb89cc57bcbb47ecb497cd5f', - '651999e46e734837b24c2500', - '608f9fbbbbb645e6b32d7d46', - ], - shareId: '5a4cf7d0-0abb-48c1-8e70-9f4ee3220dc4', - title: 'Test Shared Link 33', - updatedAt: '2024-04-06T21:39:51.521Z', - }, - { - conversationId: 'e549be2b-2623-42a3-8315-a8e35a7776b3', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-02-23T21:40:32.151Z', - isPublic: true, - messages: [ - 'aa4e0b65650544589afb5961', - '160841178c0944e88de83956', - '234ac16af26d48a7875ee643', - ], - shareId: 'b083f048-2803-407e-b54a-89261db87ade', - title: 'Test Shared Link 34', - updatedAt: '2024-03-14T12:16:32.984Z', - }, - { - conversationId: '39f415ea-48f2-4bb2-b6f8-c2cf2d5fe42a', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-08T19:02:27.141Z', - isPublic: true, - messages: [ - 'c77e79bb92b64d36a72d5a4d', - 'ea236310a9ba4b27a2217f09', - 'b25c46f2d23542f6b9d94de9', - ], - shareId: 'a9871169-7012-4206-b35c-7d207309a0f5', - title: 'Test Shared Link 35', - updatedAt: '2024-04-21T04:00:58.151Z', - }, - { - conversationId: 'c0d00265-12c4-45d0-a8bd-95d6e1bda769', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-14T09:50:55.476Z', - isPublic: true, - messages: [ - '63cdf78acd0449cf90237b29', - 'b93d82d7612b49fc98f0c211', - 'e56afe7e6e1e478d858a96d0', - '09344c8d22e74ce9b1d615cc', - ], - shareId: 'aa1262ab-54c9-406a-a97f-e2636266cf3e', - title: 'Test Shared Link 36', - updatedAt: '2024-03-24T15:53:36.021Z', - }, - { - conversationId: '5114b13d-8050-4e29-a2fd-85c776aec055', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-01-20T20:39:54.322Z', - isPublic: true, - messages: [ - 'd397dc5c136a4c7da44e2fb9', - 'a3cd29243629450b87852a85', - '9dd1e0e918844a37ba8dc955', - 'ec2a73f7efe344fe85709c22', - '4d4702651869476b8ae397fd', - '8447430fd4f34aab82921018', - '8d804ee086734d6192b59995', - '29d6ccba37234bb8bd280977', - '31ec4f8c28cc4c21828ecef8', - '8ea630045b5847ec92651f4a', - ], - shareId: '2021fcab-7000-4840-9a8c-f0a1cb1ce8fa', - title: 'Test Shared Link 37', - updatedAt: '2024-04-08T02:09:33.732Z', - }, - { - conversationId: 'afa796fe-c8c1-411d-98d1-a8c8c8550412', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-01-16T23:58:11.179Z', - isPublic: true, - messages: [ - '8f54ee5871494f1b9f13f314', - '7778849398db40eb950952fb', - '65977e5d9e12445cb1cd9a54', - '8dba76884b09490a91b1aff9', - '2f6cc465171742b8a529daa3', - '1775b24fe2e94cd89dd6164e', - '780d980e59274240837c0bff', - ], - shareId: '9bb78460-0a26-4df7-be54-99b904b8084a', - title: 'Test Shared Link 38', - updatedAt: '2024-04-22T00:33:47.525Z', - }, - { - conversationId: 'c70fc447-acfc-4b57-84aa-2d8abcc3c5a5', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-24T11:39:14.696Z', - isPublic: true, - messages: [ - 'b659ff86f9284ae1a40bee94', - '35bce7b6b2124db491f116c4', - 'cf0bad6c2623413babb33e65', - '26c6ce4d46614c86941d5429', - 'fba6517fc3434c188d8e1471', - '3e37398cc2ea4e50920d6271', - 'fd8584b1cf8145c88697b89d', - '8e433df0ada34e2280d4bd91', - 'fc52f80a6df24df5baccb657', - '95cdf9b05b8f4a81a70a37e9', - ], - shareId: '0664b078-8f29-41ff-8c1c-85172c659195', - title: 'Test Shared Link 39', - updatedAt: '2024-03-29T10:22:50.815Z', - }, - { - conversationId: '32ccaa36-cc46-4c84-888d-a86bf9b1d79c', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-02-04T03:13:19.399Z', - isPublic: true, - messages: [ - '8a0cfa8f5e874cf089f91b2e', - 'e9a72907ac9b4e88a8cfa737', - 'aa328aaf978944e18727a967', - '8786577a76b24415920d87a0', - 'ee05127d35ec415a85554406', - ], - shareId: 'a0018d28-52a8-4d31-8884-037cf9037eb7', - title: 'Test Shared Link 40', - updatedAt: '2024-01-30T03:26:15.920Z', - }, - { - conversationId: '2d8f1f40-b0e8-4629-937a-dee5036cb0bb', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-18T15:32:59.697Z', - isPublic: true, - messages: [ - '64475ed4f6234326a1104ca2', - 'db0db3ee92e14afaba6db75b', - '1f28a30501a94e3d896c261b', - 'de2eb08823db401d8262d3f3', - '254c32efae97476b954d8dc4', - 'dda42e4e74144cb69e395392', - '85bfe89de9e643fb8d5fa8ff', - '2f52e060a8b645928d0bf594', - ], - shareId: '9740b59b-cd84-461d-9fd7-2e1903b844b2', - title: 'Test Shared Link 41', - updatedAt: '2024-04-23T15:48:54.690Z', - }, - { - conversationId: '5180353f-23a9-48af-8ed0-b05983ef87d1', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-02-15T10:45:51.373Z', - isPublic: true, - messages: [ - '012b97e2df45475b93ad1e37', - '23d5042117a142f5a12762d5', - '8eb8cbca953d4ec18108f6d8', - 'ba506914203442339cd81d25', - '88c3b40cd0ae43d2b670ee41', - '0dd8fe241f5c4ea88730652c', - '80e3d1d7c26c489c9c8741fe', - '317a47a138c6499db73679f0', - '6497260d6a174f799cb56fd5', - ], - shareId: 'a6eaf23e-6e99-4e96-8222-82149c48803b', - title: 'Test Shared Link 42', - updatedAt: '2024-02-24T12:08:27.344Z', - }, - { - conversationId: 'cf3f2919-1840-4f6a-b350-f73f02ba6e90', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-02-14T06:20:45.439Z', - isPublic: true, - messages: [ - 'ba3b939f8a3443f99f37b296', - 'b2039c988b3841c6b4ccb436', - '89ea6e1d4b3f440bb867d740', - '270210838a724aeb87e9bbe9', - '02dd6b2f185247d9888d5be1', - '6458fe13ee1c470ba33fb931', - ], - shareId: '765042c0-144d-4f7b-9953-0553ed438717', - title: 'Test Shared Link 43', - updatedAt: '2024-04-11T05:23:05.750Z', - }, - { - conversationId: '8efb71ee-7984-409a-b27c-aeb2650d78ba', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-01-28T16:41:04.100Z', - isPublic: true, - messages: [ - 'cc60d9e2cbb7494481138833', - '1fb8d220b888475ba6c59fd3', - '5fd97817ab25451bb7ac22f5', - '9e8f7765a1bc4ab495da9081', - '4d5997d3c8744aaeb8c96964', - 'd438acb0f7704201857d6916', - 'b5106745d89f4a3fada8cd11', - '3b41562ce727411a83f44cdf', - '627f8f77feb843848145fc5f', - '6bee635eb10443ae9eef20ab', - ], - shareId: 'ed0fe440-479d-4c79-a494-0f461612c474', - title: 'Test Shared Link 44', - updatedAt: '2024-04-15T12:41:00.324Z', - }, - { - conversationId: '7cdd42a6-67bb-48c8-b8c3-bb55cbaa3905', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-24T23:13:42.892Z', - isPublic: true, - messages: [ - 'a944f461ca094d1c80bea677', - 'bd4b516b51a84285846343b4', - '442f6b4c27f647199279e49c', - 'e672974b3cf74cd3b85537f9', - ], - shareId: '9439972e-226c-4386-910a-e629eb7019c3', - title: 'Test Shared Link 45', - updatedAt: '2024-01-17T07:42:21.103Z', - }, - { - conversationId: '595bab25-e5c1-4bd0-99c1-a099391adb87', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-13T05:58:33.171Z', - isPublic: true, - messages: [ - 'c39942615fdf435cb22369b5', - '0ec24a7328424a78b7dcecaf', - '335373a769fd43a5833eac16', - '22905090a44f4bf8b6f415f8', - ], - shareId: '18501e23-3fc5-436d-a9aa-ccde7c5c9074', - title: 'Test Shared Link 46', - updatedAt: '2024-02-05T04:34:42.323Z', - }, - { - conversationId: '822a650b-2971-441a-9cb0-b2ecabf7b3ba', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-20T10:29:20.771Z', - isPublic: true, - messages: [ - 'ed566d1ffd51494e9a069f32', - '3ca9a8bbfb7c43e49e4898d7', - '6534186966784f0fba45c1ab', - '8a9e394dda8542d4a4db1140', - '002d883a1c344de0beb794b3', - '61e9e872aa854288a4ac9694', - '11e465cb875746aaa5894327', - 'ead6b00c855f4907ac5070af', - ], - shareId: 'aaaf89e4-eb3d-45f8-9e24-f370d777d8f7', - title: 'Test Shared Link 47', - updatedAt: '2024-04-29T03:11:47.109Z', - }, - { - conversationId: 'ce68ce26-07fc-4448-9239-f1925cfaaa72', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-03-15T15:04:08.691Z', - isPublic: true, - messages: [ - 'a1851d231ee748e59ed43494', - '363372c828d8443b81abffd4', - '0b2e97210bd14e229ddb6641', - ], - shareId: 'f4de7c43-c058-43f5-bdab-0854d939dfb9', - title: 'Test Shared Link 48', - updatedAt: '2024-03-05T11:43:00.177Z', - }, - { - conversationId: '3fafe417-b5f8-4cc8-ac8e-897ebef836bd', - user: '662dbe728ca96f444c6f69f4', - createdAt: '2024-04-20T05:34:57.880Z', - isPublic: true, - messages: [ - '876337c495ca40c080b65c1d', - 'b5e914ac15ff439a9836a9ea', - 'cb6379d0a9ad442291d78c14', - '529424b650a4478ba012cf40', - '99ff1ed49cb2483bbd970730', - '0f0e215e179f4cfba56c7b03', - '210940fbe4c745d183358ed1', - '99246c796c7a44c2ae85a549', - 'a2b967556867499eb437674a', - ], - shareId: '79ec3716-ea2e-4045-8a82-056d63ebc939', - title: 'Test Shared Link 49', - updatedAt: '2024-03-19T08:01:13.445Z', - }, - ], - pages: 49, - pageNumber: '1', - pageSize: 25, - }, - ], - pageParams: [null], -}; diff --git a/packages/data-provider/src/data-service.ts b/packages/data-provider/src/data-service.ts index 026606f4c57..edbd54689a3 100644 --- a/packages/data-provider/src/data-service.ts +++ b/packages/data-provider/src/data-service.ts @@ -63,7 +63,7 @@ export function updateSharedLink(shareId: string): Promise { +export function deleteSharedLink(shareId: string): Promise { return request.delete(endpoints.shareMessages(shareId)); } diff --git a/packages/data-provider/src/types.ts b/packages/data-provider/src/types.ts index ef86bf5419a..8710fc11a95 100644 --- a/packages/data-provider/src/types.ts +++ b/packages/data-provider/src/types.ts @@ -185,8 +185,6 @@ export type TSharedLinkGetResponse = TSharedLinkResponse & { success: boolean; }; -export type TDeleteSharedLinkResponse = TSharedLink; - // type for getting conversation tags export type TConversationTagsResponse = TConversationTag[]; // type for creating conversation tag diff --git a/packages/data-provider/src/types/queries.ts b/packages/data-provider/src/types/queries.ts index 4a4f3eeaf22..bf298f8d1e2 100644 --- a/packages/data-provider/src/types/queries.ts +++ b/packages/data-provider/src/types/queries.ts @@ -64,15 +64,10 @@ export interface SharedLinksResponse { hasNextPage: boolean; } -// Type for the response from the conversation list API -export type SharedLinkListResponse = { - sharedLinks: s.TSharedLink[]; - pageNumber: string; - pageSize: string | number; - pages: string | number; -}; - -export type SharedLinkListData = InfiniteData; +export interface SharedLinkQueryData { + pages: SharedLinksResponse[]; + pageParams: (string | null)[]; +} export type AllPromptGroupsFilterRequest = { category: string;