Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat: standardize date serialization and internal usage (#1449)

gbirmanfb8bed19e9f6
diff --git a/js/app/AGENTS.md b/js/app/AGENTS.md
index c35b4f33f4..94e2942809 100644
--- a/js/app/AGENTS.md
+++ b/js/app/AGENTS.md
@@ -21,6 +21,7 @@
- **Before navigating with Playwright**, always generate an access token first using `bun scripts/generate-access-token.ts` or prompt the user to authenticate. Never navigate without authentication set up.
- You can use `console.trace` to debug state and changes in the ui and logic.
- When building out UI features, use playwright to verify UI behavior.
+- Use the `bun run test` command to use the vitest test runner. For example, `bun run test -- packages/core/tests/date.test.ts -c packages/core`
### Playwright Authentication
The app uses cookie-based authentication (`credentials: 'include'`) since `ENABLE_BEARER_TOKEN_AUTH` is false. For Playwright testing, intercept requests and add the Authorization header.
diff --git a/js/app/bun.lock b/js/app/bun.lock
index 286aa0b5fd..75d12fd191 100644
--- a/js/app/bun.lock
+++ b/js/app/bun.lock
@@ -19,6 +19,7 @@
"@corvu/dialog": "^0.2.4",
"@corvu/resizable": "^0.2.5",
"@corvu/tooltip": "^0.2.2",
+ "@date-fns/tz": "^1.4.1",
"@floating-ui/dom": "^1.7.4",
"@fontsource-variable/inter": "^5.2.8",
"@inkibra/tauri-plugins": "git+https://github.com/seanaye/tauri-plugins.git#0c932ffd3202145b40645246d87a38deb72ba09c",
@@ -596,6 +597,8 @@
"@datadog/datadog-ci": ["@datadog/[email protected]", "", { "dependencies": { "@aws-sdk/client-cloudwatch-logs": "^3.709.0", "@aws-sdk/client-iam": "^3.709.0", "@aws-sdk/client-lambda": "^3.709.0", "@aws-sdk/client-sfn": "^3.709.0", "@aws-sdk/core": "^3.709.0", "@aws-sdk/credential-provider-ini": "^3.709.0", "@aws-sdk/credential-providers": "^3.709.0", "@google-cloud/logging": "^11.1.0", "@google-cloud/run": "^1.4.0", "@smithy/property-provider": "^2.0.12", "@smithy/util-retry": "^2.0.4", "@types/datadog-metrics": "0.6.1", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", "async-retry": "1.3.1", "axios": "^1.8.4", "chalk": "3.0.0", "clipanion": "^3.2.1", "datadog-metrics": "0.9.3", "deep-extend": "0.6.0", "deep-object-diff": "^1.1.9", "fast-levenshtein": "^3.0.0", "fast-xml-parser": "^4.4.1", "form-data": "4.0.0", "fuzzy": "^0.1.3", "glob": "^10.4.5", "google-auth-library": "^9.12.0", "inquirer": "^8.2.5", "inquirer-checkbox-plus-prompt": "^1.4.2", "js-yaml": "3.13.1", "jszip": "^3.10.1", "ora": "5.4.1", "packageurl-js": "^2.0.1", "proxy-agent": "^6.4.0", "semver": "^7.5.3", "simple-git": "3.16.0", "ssh2": "^1.15.0", "ssh2-streams": "0.4.10", "sshpk": "1.16.1", "terminal-link": "2.1.1", "tiny-async-pool": "^2.1.0", "typanion": "^3.14.0", "upath": "^2.0.1", "uuid": "^9.0.0", "ws": "^7.5.10", "xml2js": "0.5.0", "yamux-js": "0.1.2" }, "bin": "dist/cli.js" }, "sha512-bEWQvb3on8S0I+C77TWX+vuCXxlH7QDwFQftRuexCeJbe2UHr8uDy9Yq+jRlUdtKi/TJXb9w8PDvzAeyVpSIRA=="],
+ "@date-fns/tz": ["@date-fns/[email protected]", "", {}, "sha512-P5LUNhtbj6YfI3iJjw5EL9eUAG6OitD0W3fWQcpQjDRc/QIsL0tRNuO1PcDvPccWL1fSTXXdE1ds+l95DV/OFA=="],
+
"@dimforge/rapier3d-compat": ["@dimforge/[email protected]", "", {}, "sha512-uekIGetywIgopfD97oDL5PfeezkFpNhwlzlaEYNOA0N6ghdsOvh/HYjSMek5Q2O1PYvRSDFcqFVJl4r4ZBwOow=="],
"@dinero.js/calculator-number": ["@dinero.js/[email protected]", "", { "dependencies": { "@dinero.js/core": "2.0.0-alpha.8" } }, "sha512-/L+N7g5DjcS6wlMb2hcOXWBKW2TGiG+vZDZr9ow0nsHUTdwtMarL1bmBH9fGldHhH2XsxcrjN9H+036yeNzh3Q=="],
diff --git a/js/app/package.json b/js/app/package.json
index 1a591e2733..1c3f3c0da5 100644
--- a/js/app/package.json
+++ b/js/app/package.json
@@ -35,6 +35,7 @@
"@corvu/dialog": "^0.2.4",
"@corvu/resizable": "^0.2.5",
"@corvu/tooltip": "^0.2.2",
+ "@date-fns/tz": "^1.4.1",
"@floating-ui/dom": "^1.7.4",
"@fontsource-variable/inter": "^5.2.8",
"@inkibra/tauri-plugins": "git+https://github.com/seanaye/tauri-plugins.git#0c932ffd3202145b40645246d87a38deb72ba09c",
diff --git a/js/app/packages/app/component/command/KonsoleItem.tsx b/js/app/packages/app/component/command/KonsoleItem.tsx
index f9e142422b..6f7c5cb625 100644
--- a/js/app/packages/app/component/command/KonsoleItem.tsx
+++ b/js/app/packages/app/component/command/KonsoleItem.tsx
@@ -2,6 +2,7 @@ import { URL_PARAMS as CHANNEL_PARAMS } from '@block-channel/constants';
import { URL_PARAMS as MD_PARAMS } from '@block-md/constants';
import { URL_PARAMS as PDF_PARAMS } from '@block-pdf/signal/location';
import type { BlockAlias, BlockName } from '@core/block';
+import type { DateValue } from '@core/util/date';
import { BozzyBracket } from '@core/component/BozzyBracket';
import { Hotkey } from '@core/component/Hotkey';
import { StaticMarkdown } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
@@ -207,9 +208,8 @@ export type SearchSnippet = {
type CommandItemBase = {
snippet?: SearchSnippet;
height?: number;
- // Add an optional timestamp to pass to fresh search/sort
- updatedAt?: number | string;
- viewedAt?: number | string;
+ updatedAt?: DateValue | null;
+ viewedAt?: DateValue | null;
};
type SimpleText = {
@@ -229,7 +229,7 @@ export type EmailPreview = {
id: string;
name: string; // subject
sender: string;
- timestamp: string;
+ timestamp: DateValue;
is_read: boolean;
attachments: Attachment[];
};
@@ -694,9 +694,7 @@ export function CommandItemCard(props: CommandItemProps) {
const timestamp =
props.item.type === 'email'
? props.item.data.timestamp
- : props.item.updatedAt
- ? new Date(props.item.updatedAt).toISOString()
- : undefined;
+ : props.item.updatedAt;
return (
<Message
diff --git a/js/app/packages/app/component/command/useCommandItems.ts b/js/app/packages/app/component/command/useCommandItems.ts
index 0232950684..7814fd0392 100644
--- a/js/app/packages/app/component/command/useCommandItems.ts
+++ b/js/app/packages/app/component/command/useCommandItems.ts
@@ -2,6 +2,7 @@ import { useChannelsContext } from '@core/context/channels';
import { getActiveCommandsFromScope } from '@core/hotkey/getCommands';
import { activeScope } from '@core/hotkey/state';
import { mapFromListsByKey } from '@core/util/compareUtils';
+import type { DateValue } from '@core/util/date';
import { useHistoryQuery } from '@queries/history/history';
import type { Channel } from '@service-comms/generated/models/channel';
import type { ChannelType } from '@service-comms/generated/models/channelType';
@@ -9,7 +10,7 @@ import { ChannelTypeEnum } from '@service-comms/client';
import { createMemo } from 'solid-js';
import type { CommandItemCard } from './KonsoleItem';
-type ChannelWithViewedAt = Channel & { viewed_at?: number };
+type ChannelWithViewedAt = Channel & { viewed_at?: DateValue };
const FILTER_PERSISTENT_CHATS = false;
@@ -51,7 +52,7 @@ export function useCommandItems() {
name: description,
command: command,
},
- updatedAt: 0,
+ updatedAt: new Date(0),
};
});
diff --git a/js/app/packages/app/component/command/useSearchItems.ts b/js/app/packages/app/component/command/useSearchItems.ts
index eba7e9fdd2..26ee790929 100644
--- a/js/app/packages/app/component/command/useSearchItems.ts
+++ b/js/app/packages/app/component/command/useSearchItems.ts
@@ -12,9 +12,6 @@ import type { BasicDocumentFileType } from '@service-storage/generated/schemas/b
import { createEffect, createMemo, createSignal, on } from 'solid-js';
import type { CommandItemCard } from './KonsoleItem';
-const convertSecondsToMillis = (timestamp?: number) =>
- timestamp ? timestamp * 1000 : undefined;
-
function createDocumentItems(
doc: UnifiedSearchResponseItem
): CommandItemCard[] {
@@ -56,7 +53,7 @@ function createDocumentItems(
highlightTerms: extractSearchTerms(content),
}),
},
- updatedAt: convertSecondsToMillis(doc.metadata?.updated_at),
+ updatedAt: doc.metadata?.updated_at,
});
}
});
@@ -83,9 +80,7 @@ function createEmailItems(email: UnifiedSearchResponseItem): CommandItemCard[] {
id: email.thread_id,
name: email.name ?? '',
sender: result.sender!,
- timestamp: new Date(
- convertSecondsToMillis(result.sent_at ?? email.updated_at)!
- ).toISOString(),
+ timestamp: result.sent_at ?? email.updated_at,
is_read: !result.labels.includes('UNREAD'),
// TODO: This should be the attachments from the email, need to update the search service to return them
attachments: [],
@@ -134,7 +129,7 @@ function createChatItems(chat: UnifiedSearchResponseItem): CommandItemCard[] {
matchIndex: index,
senderId: chat.user_id,
},
- updatedAt: convertSecondsToMillis(chat.metadata?.updated_at),
+ updatedAt: chat.metadata?.updated_at,
});
});
}
@@ -170,7 +165,7 @@ function createChannelItems(
matchIndex: index,
senderId: result.sender_id!,
},
- updatedAt: convertSecondsToMillis(channel.metadata?.updated_at),
+ updatedAt: channel.metadata?.updated_at,
});
});
}
diff --git a/js/app/packages/app/component/next-soup/create-soup-state.test.ts b/js/app/packages/app/component/next-soup/create-soup-state.test.ts
index a68acc5c77..55bbf1e2cb 100644
--- a/js/app/packages/app/component/next-soup/create-soup-state.test.ts
+++ b/js/app/packages/app/component/next-soup/create-soup-state.test.ts
@@ -44,7 +44,7 @@ const createTestEntity = (id: string, name?: string): EntityData => ({
type: 'document',
name: name ?? `Entity ${id}`,
ownerId: 'test-owner',
- updatedAt: Date.now(),
+ updatedAt: new Date(),
});
describe('createSoupState', () => {
diff --git a/js/app/packages/app/component/next-soup/soup-view/sort-options.ts b/js/app/packages/app/component/next-soup/soup-view/sort-options.ts
index 16739e8e47..5434135800 100644
--- a/js/app/packages/app/component/next-soup/soup-view/sort-options.ts
+++ b/js/app/packages/app/component/next-soup/soup-view/sort-options.ts
@@ -6,6 +6,7 @@ import {
type EntityData,
type WithNotification,
} from '@entity';
+import { compareDateDesc } from '@core/util/date';
export type SystemSortOption =
| 'updated_at'
@@ -21,7 +22,7 @@ export function sortByNotifiedAt<T extends WithNotification<EntityData>>(
const bNotification = b.notifications?.()[0];
if (aNotification && bNotification) {
- return bNotification.createdAt - aNotification.createdAt;
+ return compareDateDesc(aNotification.createdAt, bNotification.createdAt);
} else if (aNotification) {
return -1;
} else if (bNotification) {
@@ -32,15 +33,15 @@ export function sortByNotifiedAt<T extends WithNotification<EntityData>>(
}
export function sortByCreatedAt<T extends EntityData>(a: T, b: T): number {
- return (b.createdAt ?? 0) - (a.createdAt ?? 0);
+ return compareDateDesc(a.createdAt, b.createdAt);
}
export function sortByUpdatedAt<T extends EntityData>(a: T, b: T) {
- return (b.updatedAt ?? 0) - (a.updatedAt ?? 0);
+ return compareDateDesc(a.updatedAt, b.updatedAt);
}
export function sortByViewedAt<T extends EntityData>(a: T, b: T) {
- return (b.viewedAt ?? 0) - (a.viewedAt ?? 0);
+ return compareDateDesc(a.viewedAt, b.viewedAt);
}
export function sortByFrecencyScore<T extends EntityData>(a: T, b: T): number {
@@ -85,13 +86,9 @@ export const sortEntitiesForSearch = <T extends EntityData>(
};
// NOTE: backend returns items in descending order of updatedAt so we match that here
- const updatedAtFirst = (a: WithSearch<T>, b: WithSearch<T>) => {
- if (a.updatedAt && b.updatedAt) return b.updatedAt - a.updatedAt;
- if (a.updatedAt) return -1;
- if (b.updatedAt) return 1;
- return 0;
- };
+ const updatedAtDesc = (a: WithSearch<T>, b: WithSearch<T>) =>
+ compareDateDesc(a.updatedAt, b.updatedAt);
// TODO: we may want to sort exact name matches first for other items too
- return channelsWithNameMatchesFirst(a, b) || updatedAtFirst(a, b);
+ return channelsWithNameMatchesFirst(a, b) || updatedAtDesc(a, b);
};
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-entity-context-menu.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-entity-context-menu.tsx
index b0af71c38d..1c658cfcb7 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-entity-context-menu.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-entity-context-menu.tsx
@@ -1,4 +1,5 @@
import { ContextMenuContent, MenuSeparator } from '@core/component/Menu';
+import type { DateValue } from '@core/util/date';
import { isMobile } from '@core/mobile/isMobile';
import { ContextMenu } from '@kobalte/core/context-menu';
import { InlineEntity, type EntityData } from '@entity';
@@ -8,7 +9,7 @@ import { SoupEntityActionsMenu } from './soup-entity-actions-menu';
interface SoupEntityContextMenuProps {
entity: EntityData;
- entityTimestamp?: number;
+ entityTimestamp?: DateValue | null;
onOpenChange?: (open: boolean) => void;
}
diff --git a/js/app/packages/app/component/next-soup/utils.ts b/js/app/packages/app/component/next-soup/utils.ts
index 321bececea..79ecb1376d 100644
--- a/js/app/packages/app/component/next-soup/utils.ts
+++ b/js/app/packages/app/component/next-soup/utils.ts
@@ -1,4 +1,5 @@
import type { BlockOrchestrator } from '@core/orchestrator';
+import type { DateValue } from '@core/util/date';
import { URL_PARAMS as CHANNEL_PARAMS } from '@block-channel/constants';
import { URL_PARAMS as EMAIL_PARAMS } from '@block-email/constants';
import { URL_PARAMS as MD_PARAMS } from '@block-md/constants';
@@ -28,6 +29,7 @@ import {
invalidateSoupEntity,
} from '@queries/soup/cache';
import { match } from 'ts-pattern';
+import { isAfter } from 'date-fns';
const mergeSearchEntities = <T extends EntityData>(
first: WithSearch<T>,
@@ -127,8 +129,8 @@ export const deduplicateEntities = <T extends EntityData>(
/**
* Gets the timestamp of an entity (updatedAt or createdAt)
*/
-const getEntityTimestamp = (entity: EntityData): number => {
- return entity.updatedAt ?? entity.createdAt ?? 0;
+const getEntityTimestamp = (entity: EntityData): DateValue => {
+ return entity.updatedAt ?? entity.createdAt ?? new Date(0);
};
/**
@@ -138,7 +140,7 @@ export const isNewerEntity = (
newEntity: EntityData,
existing: EntityData
): boolean => {
- return getEntityTimestamp(newEntity) >= getEntityTimestamp(existing);
+ return isAfter(getEntityTimestamp(newEntity), getEntityTimestamp(existing));
};
export const openEntityInNewTab = ({
diff --git a/js/app/packages/block-channel/component/AttachmentsModal.tsx b/js/app/packages/block-channel/component/AttachmentsModal.tsx
index df2dcefc0d..4377efdb9e 100644
--- a/js/app/packages/block-channel/component/AttachmentsModal.tsx
+++ b/js/app/packages/block-channel/component/AttachmentsModal.tsx
@@ -2,6 +2,7 @@ import { SplitDrawer } from '@app/component/split-layout/components/SplitDrawer'
import { useDrawerControl } from '@app/component/split-layout/components/SplitDrawerContext';
import { filterSafeAttachments } from '@block-channel/utils/attachments';
import { type BlockAlias, type BlockName, useBlockId } from '@core/block';
+import type { DateValue } from '@core/util/date';
import { InlineItemPreview } from '@core/component/ItemPreview';
import { toast } from '@core/component/Toast/Toast';
import { Tooltip } from '@core/component/Tooltip';
@@ -12,7 +13,7 @@ import { tryMacroId, useDisplayName } from '@core/user';
import BracketLeft from '@macro-icons/macro-group-bracket-left.svg';
import PaperclipIcon from '@phosphor-icons/core/regular/paperclip.svg?component-solid';
import type { MessageMention } from '@service-comms/generated/models';
-import type { Attachment } from '@service-comms/generated/models/attachment';
+import type { Attachment } from '@queries/channel/types';
import type { ItemType } from '@service-storage/client';
import { useMentionsQuery } from '@queries/channel/mentions';
import { createMemo, Show, Suspense } from 'solid-js';
@@ -187,9 +188,9 @@ function AttachmentItem(props: AttachmentItemProps) {
);
}
-const formatTimestamp = (timestamp: string) => {
- const date = new Date(timestamp);
- const datePart = date
+const formatTimestamp = (date: DateValue) => {
+ const d = date instanceof Date ? date : new Date(date);
+ const datePart = d
.toLocaleDateString('en-US', {
month: 'numeric',
day: 'numeric',
@@ -197,7 +198,7 @@ const formatTimestamp = (timestamp: string) => {
})
.replaceAll('/', '-');
- const timePart = date.toLocaleTimeString('en-US', {
+ const timePart = d.toLocaleTimeString('en-US', {
hour: 'numeric',
minute: 'numeric',
});
diff --git a/js/app/packages/block-channel/component/Channel.tsx b/js/app/packages/block-channel/component/Channel.tsx
index e59fb7323f..6a13339250 100644
--- a/js/app/packages/block-channel/component/Channel.tsx
+++ b/js/app/packages/block-channel/component/Channel.tsx
@@ -28,7 +28,7 @@ import {
invalidateChannelsActivity,
useUpdateChannelsActivityMutation,
} from '@queries/channel/activity';
-import type { Message } from '@service-comms/generated/models';
+import type { Message } from '@queries/channel/types';
import { connectionGatewayClient } from '@service-connection/client';
import { useBeforeLeave, useSearchParams } from '@solidjs/router';
import { createDroppable, useDragDropContext } from '@thisbeyond/solid-dnd';
diff --git a/js/app/packages/block-channel/component/ChannelInput.tsx b/js/app/packages/block-channel/component/ChannelInput.tsx
index 2885eb0262..5d05bb48ed 100644
--- a/js/app/packages/block-channel/component/ChannelInput.tsx
+++ b/js/app/packages/block-channel/component/ChannelInput.tsx
@@ -10,7 +10,7 @@ import type {
import type { IUser } from '@core/user';
import { channelParticipantInfo } from '@core/user/util';
import { usePostTypingUpdateMutation } from '@queries/channel/typing';
-import type { ChannelParticipant } from '@service-comms/generated/models/channelParticipant';
+import type { ChannelParticipant } from '@queries/channel/types';
import { type Accessor, createMemo, createSignal, onMount } from 'solid-js';
import type { SetStoreFunction } from 'solid-js/store';
import { BaseInput } from './BaseInput';
diff --git a/js/app/packages/block-channel/component/MarkdownArea.tsx b/js/app/packages/block-channel/component/MarkdownArea.tsx
index be67aa6c65..9a25788c51 100644
--- a/js/app/packages/block-channel/component/MarkdownArea.tsx
+++ b/js/app/packages/block-channel/component/MarkdownArea.tsx
@@ -38,7 +38,7 @@ import {
} from '@core/component/LexicalMarkdown/utils';
import type { PortalScope } from '@core/component/ScopedPortal';
import type { IUser } from '@core/user';
-import type { Item } from '@service-storage/generated/schemas/item';
+import type { HistoryItem } from '@queries/history/types';
import { onElementConnect } from '@solid-primitives/lifecycle';
import { isMobile } from '@solid-primitives/platform';
import { filePastePlugin } from 'core/component/LexicalMarkdown/plugins/file-paste/filePastePlugin';
@@ -178,7 +178,7 @@ export type ConsumableMarkdownAreaProps = {
initialValue?: string;
placeholder?: string;
users?: Accessor<IUser[]>;
- history?: Accessor<Item[]>;
+ history?: Accessor<HistoryItem[]>;
onPasteFilesAndDirs?: (
files: FileSystemFileEntry[],
directories: FileSystemDirectoryEntry[]
diff --git a/js/app/packages/block-channel/component/Message/MessageAttachments.tsx b/js/app/packages/block-channel/component/Message/MessageAttachments.tsx
index af36fff946..357f126aff 100644
--- a/js/app/packages/block-channel/component/Message/MessageAttachments.tsx
+++ b/js/app/packages/block-channel/component/Message/MessageAttachments.tsx
@@ -1,6 +1,6 @@
import { ItemPreview } from '@core/component/ItemPreview';
import { VideoPreview } from '@core/component/VideoPreview';
-import type { Attachment } from '@service-comms/generated/models/attachment';
+import type { Attachment } from '@queries/channel/types';
import { stringToItemType } from '@service-storage/client';
import { type Accessor, For, Show } from 'solid-js';
import { DynamicImageList } from './DynamicImageList';
diff --git a/js/app/packages/block-channel/component/Message/MessageContainer.tsx b/js/app/packages/block-channel/component/Message/MessageContainer.tsx
index d23e3f71a7..c66db3053e 100644
--- a/js/app/packages/block-channel/component/Message/MessageContainer.tsx
+++ b/js/app/packages/block-channel/component/Message/MessageContainer.tsx
@@ -1,10 +1,8 @@
import { useMessageListContext } from '@block-channel/component/MessageList/MessageList';
import { COLLAPSED_THREAD_INDEX_CUTOFF } from '@block-channel/constants';
import { useReactToMessage } from '@block-channel/hooks/reactions';
-import type {
- Attachment,
- GetChannelResponseReactions,
-} from '@service-comms/generated/models';
+import type { GetChannelResponseReactions } from '@service-comms/generated/models';
+import type { Attachment } from '@queries/channel/types';
import type { MessageListContext } from '@block-channel/utils/listContext';
import { StaticMarkdown } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import { channelTheme } from '@core/component/LexicalMarkdown/theme';
@@ -24,11 +22,12 @@ import {
STATIC_VIDEO,
} from '@core/store/cacheChannelInput';
import { tryMacroId, useDisplayName } from '@core/user';
+import type { DateValue } from '@core/util/date';
import { isEmojiOnly } from '@core/util/string';
import { formatRelativeDate, isSameDay } from '@core/util/time';
import { ContextMenu } from '@kobalte/core/context-menu';
import { usePatchMessageMutation } from '@queries/channel/message';
-import type { Message as MessageType } from '@service-comms/generated/models/message';
+import type { Message as MessageType } from '@queries/channel/types';
import { useUserId } from '@core/context/user';
import { activeElement } from 'app/signal/focus';
import { registerHotkey, useHotkeyDOMScope } from 'core/hotkey/hotkeys';
@@ -97,7 +96,7 @@ function NewMessageIndicator(props: { onClick?: () => void }) {
type MessageProps = {
message: MessageType;
- lastViewed: Accessor<string | null | undefined>;
+ lastViewed: Accessor<DateValue | null | undefined>;
isFocused: boolean;
index: Accessor<number>;
orderedMessages: Accessor<MessageType[]>;
@@ -269,9 +268,9 @@ export function MessageContainer(props: MessageProps) {
});
const lastReplyTimestamp = createMemo(() => {
if (collapsedThreadMessages()) {
- return collapsedThreadMessages()?.at(-1)?.created_at ?? '';
+ return collapsedThreadMessages()?.at(-1)?.created_at;
}
- return '';
+ return;
});
const threadReplyUsers = createMemo(() => {
if (collapsedThreadMessages()) {
diff --git a/js/app/packages/block-channel/component/Message/ThreadReplyIndicator.tsx b/js/app/packages/block-channel/component/Message/ThreadReplyIndicator.tsx
index e56c029889..dec5d9ecce 100644
--- a/js/app/packages/block-channel/component/Message/ThreadReplyIndicator.tsx
+++ b/js/app/packages/block-channel/component/Message/ThreadReplyIndicator.tsx
@@ -2,6 +2,7 @@ import { Tooltip } from '@core/component/Tooltip';
import { UserIcon } from '@core/component/UserIcon';
import { isMobileWidth } from '@core/mobile/mobileWidth';
import { onKeyDownClick, onKeyUpClick } from '@core/util/click';
+import type { DateValue } from '@core/util/date';
import { formatRelativeDate } from '@core/util/time';
import CaretRight from '@phosphor-icons/core/regular/caret-right.svg?component-solid';
import { cn } from '@ui/utils/classname';
@@ -9,7 +10,7 @@ import { createMemo, createSignal, For, Match, Show, Switch } from 'solid-js';
export function ThreadReplyIndicator(props: {
countCollapsedMessages: number;
- timestamp: string;
+ timestamp?: DateValue;
users: string[];
onClick: () => void;
justifyRight?: boolean;
@@ -88,10 +89,12 @@ export function ThreadReplyIndicator(props: {
{props.isThreadOpen ? 'Close thread' : 'Expand thread'}
</p>
</Match>
- <Match when={!hover()}>
- <p class="text-ink-muted">
- Last reply {formatRelativeDate(props.timestamp)}
- </p>
+ <Match when={!hover() && props.timestamp}>
+ {(timestamp) => (
+ <p class="text-ink-muted">
+ Last reply {formatRelativeDate(timestamp())}
+ </p>
+ )}
</Match>
</Switch>
</div>
diff --git a/js/app/packages/block-channel/component/MessageList/MessageList.tsx b/js/app/packages/block-channel/component/MessageList/MessageList.tsx
index aa1407df5b..1b75606c86 100644
--- a/js/app/packages/block-channel/component/MessageList/MessageList.tsx
+++ b/js/app/packages/block-channel/component/MessageList/MessageList.tsx
@@ -21,11 +21,14 @@ import type { InputAttachment } from '@core/store/cacheChannelInput';
import SunIcon from '@icon/duotone/sun-horizon-duotone.svg';
import ArrowDownIcon from '@icon/regular/arrow-down.svg';
import XIcon from '@icon/regular/x.svg';
-import type { Activity as ChannelActivity } from '@service-comms/generated/models/activity';
-import type { Attachment } from '@service-comms/generated/models/attachment';
-import type { ChannelParticipant } from '@service-comms/generated/models/channelParticipant';
-import type { Message } from '@service-comms/generated/models/message';
+import type { ApiActivity as ChannelActivity } from '@service-comms/generated/models';
+import type {
+ Attachment,
+ ChannelParticipant,
+ Message,
+} from '@queries/channel/types';
import { useUserId } from '@core/context/user';
+import type { DateValue } from '@core/util/date';
import { debounce } from '@solid-primitives/scheduled';
import {
type Accessor,
@@ -447,7 +450,7 @@ function MessageListImpl(props: MessageListProps) {
// Snapshot the lastViewed time so it reflects the pre-session value.
// Without this, the activity mutation on channel open would update
// lastViewed reactively, causing the "New" indicator to disappear.
- const lastViewed = createMemo<string | null | undefined>((prev) => {
+ const lastViewed = createMemo<DateValue | null | undefined>((prev) => {
if (prev !== undefined) return prev;
return props?.latestActivity?.viewed_at;
});
diff --git a/js/app/packages/block-channel/component/MessageList/TypingIndicator.tsx b/js/app/packages/block-channel/component/MessageList/TypingIndicator.tsx
index 54eeb29526..5dc247a9e6 100644
--- a/js/app/packages/block-channel/component/MessageList/TypingIndicator.tsx
+++ b/js/app/packages/block-channel/component/MessageList/TypingIndicator.tsx
@@ -2,7 +2,7 @@ import { useBlockId } from '@core/block';
import { Message } from '@core/component/Message';
import { idToDisplayName } from '@core/user';
import { getTypingUsersForChannel } from '@queries/channel/typing';
-import type { Message as MessageType } from '@service-comms/generated/models/message';
+import type { Message as MessageType } from '@queries/channel/types';
import { createMemo, Show } from 'solid-js';
type TypingIndicatorProps = {
diff --git a/js/app/packages/block-channel/component/ParticipantManager.tsx b/js/app/packages/block-channel/component/ParticipantManager.tsx
index e6626795aa..757cd965d0 100644
--- a/js/app/packages/block-channel/component/ParticipantManager.tsx
+++ b/js/app/packages/block-channel/component/ParticipantManager.tsx
@@ -20,7 +20,7 @@ import UsersIcon from '@icon/regular/users.svg';
import CloseIcon from '@icon/regular/x.svg';
import { Dialog } from '@kobalte/core/dialog';
import BracketLeft from '@macro-icons/macro-group-bracket-left.svg';
-import type { ChannelParticipant } from '@service-comms/generated/models/channelParticipant';
+import type { ChannelParticipant } from '@queries/channel/types';
import { ChannelType } from '@service-comms/generated/models/channelType';
import { useUserId } from '@core/context/user';
import { createMemo, createSignal, Show } from 'solid-js';
diff --git a/js/app/packages/block-channel/component/ReplyInputsPortaler.tsx b/js/app/packages/block-channel/component/ReplyInputsPortaler.tsx
index 956208ba39..3494d08fa0 100644
--- a/js/app/packages/block-channel/component/ReplyInputsPortaler.tsx
+++ b/js/app/packages/block-channel/component/ReplyInputsPortaler.tsx
@@ -13,7 +13,7 @@ import { blockElementSignal } from '@core/signal/blockElement';
import type { InputAttachment } from '@core/store/cacheChannelInput';
import { channelParticipantInfo } from '@core/user/util';
import { usePostTypingUpdateMutation } from '@queries/channel/typing';
-import type { ChannelParticipant } from '@service-comms/generated/models/channelParticipant';
+import type { ChannelParticipant } from '@queries/channel/types';
import {
createEffect,
createMemo,
diff --git a/js/app/packages/block-channel/component/TaskPreviewRow.tsx b/js/app/packages/block-channel/component/TaskPreviewRow.tsx
index d9b53aa73e..67a5a52f23 100644
--- a/js/app/packages/block-channel/component/TaskPreviewRow.tsx
+++ b/js/app/packages/block-channel/component/TaskPreviewRow.tsx
@@ -156,7 +156,7 @@ export function TaskPreviewRow(props: TaskPreviewRowProps) {
// Cast needed: Property is a discriminated union, but we build it dynamically
// from definition.data_type which TypeScript can't narrow statically
- const properties = createMemo(() => {
+ const properties = createMemo((): Property[] => {
return filterMap(PREVIEW_PROPERTIES, (id) => {
const definition = definitions().get(id);
if (!definition) return;
@@ -167,8 +167,8 @@ export function TaskPreviewRow(props: TaskPreviewRowProps) {
isMultiSelect: definition.is_multi_select,
owner: definition.owner,
specificEntityType: definition.specific_entity_type ?? null,
- updatedAt: '',
- createdAt: '',
+ updatedAt: new Date(0),
+ createdAt: new Date(0),
valueType: definition.data_type,
value: extractPropertyValue(
definition,
@@ -187,7 +187,7 @@ export function TaskPreviewRow(props: TaskPreviewRowProps) {
saveDate: async (property: Property, date: Date) => {
props.onUpdatePropertyValue(property.propertyDefinitionId, {
valueType: 'DATE',
- value: date.toISOString(),
+ value: date,
});
},
};
diff --git a/js/app/packages/block-channel/component/Top.tsx b/js/app/packages/block-channel/component/Top.tsx
index e2936550de..97faab003d 100644
--- a/js/app/packages/block-channel/component/Top.tsx
+++ b/js/app/packages/block-channel/component/Top.tsx
@@ -15,7 +15,7 @@ import { UserIcon } from '@core/component/UserIcon';
import { buildSimpleEntityUrl } from '@core/util/url';
import HashIcon from '@icon/regular/hash.svg';
import LinkIcon from '@icon/regular/link.svg';
-import type { ChannelParticipant } from '@service-comms/generated/models/channelParticipant';
+import type { ChannelParticipant } from '@queries/channel/types';
import type { ChannelType } from '@service-comms/generated/models/channelType';
import { ChannelTypeEnum } from '@service-comms/client';
import { useUserId } from '@core/context/user';
diff --git a/js/app/packages/block-channel/hooks/channel.tsx b/js/app/packages/block-channel/hooks/channel.tsx
index e8eda25108..9788449725 100644
--- a/js/app/packages/block-channel/hooks/channel.tsx
+++ b/js/app/packages/block-channel/hooks/channel.tsx
@@ -5,12 +5,14 @@ import {
getTopLevelMessages,
} from '@queries/channel/derived';
import type {
- Attachment,
ChannelType,
- GetChannelResponse,
GetChannelResponseReactions,
} from '@service-comms/generated/models';
-import type { Message } from '@service-comms/generated/models/message';
+import type {
+ Attachment,
+ GetChannelResponse,
+ Message,
+} from '@queries/channel/types';
import { createMemo, type Accessor } from 'solid-js';
export type MessageSenderLookup = Map<string, string>;
diff --git a/js/app/packages/block-channel/signal/threads.ts b/js/app/packages/block-channel/signal/threads.ts
index 8e7ee67c33..7e2a316e28 100644
--- a/js/app/packages/block-channel/signal/threads.ts
+++ b/js/app/packages/block-channel/signal/threads.ts
@@ -1,4 +1,4 @@
-import type { Message } from '@service-comms/generated/models/message';
+import type { Message } from '@queries/channel/types';
export type MessageWithThreadId = Message & {
thread_id: NonNullable<Message['thread_id']>;
diff --git a/js/app/packages/block-channel/type/typingIndicatorMessage.ts b/js/app/packages/block-channel/type/typingIndicatorMessage.ts
index 1fd8b1bc42..35e34c4b1a 100644
--- a/js/app/packages/block-channel/type/typingIndicatorMessage.ts
+++ b/js/app/packages/block-channel/type/typingIndicatorMessage.ts
@@ -1,6 +1,6 @@
-import type { Message } from '@service-comms/generated/models/message';
+import type { Message } from '@queries/channel/types';
export type TypingIndicatorMessage = Partial<Message> & {
typingUsers: string[];
- created_at: string;
+ created_at: Date;
};
diff --git a/js/app/packages/block-channel/utils/attachments.ts b/js/app/packages/block-channel/utils/attachments.ts
index 1a4c951902..9aaf0cc393 100644
--- a/js/app/packages/block-channel/utils/attachments.ts
+++ b/js/app/packages/block-channel/utils/attachments.ts
@@ -1,5 +1,5 @@
import { isStaticAttachmentType } from '@core/store/cacheChannelInput';
-import type { Attachment } from '@service-comms/generated/models/attachment';
+import type { Attachment } from '@queries/channel/types';
import { isItemType } from '@service-storage/client';
/**
diff --git a/js/app/packages/block-channel/utils/listContext.ts b/js/app/packages/block-channel/utils/listContext.ts
index b7932cf54b..d5a8156680 100644
--- a/js/app/packages/block-channel/utils/listContext.ts
+++ b/js/app/packages/block-channel/utils/listContext.ts
@@ -1,8 +1,9 @@
-import type { Message } from '@service-comms/generated/models/message';
+import type { DateValue } from '@core/util/date';
+import type { Message } from '@queries/channel/types';
export type MinimalMessage = {
id: string;
- created_at: string;
+ created_at: DateValue;
sender_id: string;
thread_id?: string | null;
};
diff --git a/js/app/packages/block-channel/utils/taskModeConversion.ts b/js/app/packages/block-channel/utils/taskModeConversion.ts
index ffd92e2f02..4369190eb8 100644
--- a/js/app/packages/block-channel/utils/taskModeConversion.ts
+++ b/js/app/packages/block-channel/utils/taskModeConversion.ts
@@ -73,7 +73,7 @@ function buildPropertyInputs(
if (task.dueDate && !task.propertyValues[SYSTEM_PROPERTY_IDS.DUE_DATE]) {
properties.push({
propertyId: SYSTEM_PROPERTY_IDS.DUE_DATE,
- value: { type: 'date', value: task.dueDate },
+ value: { type: 'date', value: task.dueDate.toISOString() },
});
}
diff --git a/js/app/packages/block-email/component/AttachMenu.tsx b/js/app/packages/block-email/component/AttachMenu.tsx
index 2aacd7125d..93f7cc290a 100644
--- a/js/app/packages/block-email/component/AttachMenu.tsx
+++ b/js/app/packages/block-email/component/AttachMenu.tsx
@@ -9,7 +9,6 @@ import LaptopIcon from '@icon/regular/laptop.svg';
import SearchIcon from '@icon/regular/magnifying-glass.svg';
import { DropdownMenu } from '@kobalte/core/dropdown-menu';
import type { DocumentMentionInfo } from '@lexical-core';
-import type { Item } from '@service-storage/generated/schemas/item';
import { useHistoryQuery, type HistoryItem } from '@queries/history/history';
import fuzzy from 'fuzzy';
import {
@@ -31,7 +30,7 @@ type AttachMenuProps = {
trigger: JSX.Element;
onAttach: (items: HistoryItem[]) => void;
onAttachDocuments?: (items: DocumentMentionInfo[]) => void;
- attachedItems?: () => Item[];
+ attachedItems?: () => HistoryItem[];
setIsPending?: Setter<boolean>;
};
@@ -141,7 +140,7 @@ export function AttachMenu(props: AttachMenuProps) {
item.blockName !== 'project'
? item.blockName
: undefined,
- })) as Item[];
+ })) as HistoryItem[];
props.onAttach(itemsToAttach);
});
diff --git a/js/app/packages/block-email/component/BaseInput.tsx b/js/app/packages/block-email/component/BaseInput.tsx
index 0534cd3a16..ae099e984f 100644
--- a/js/app/packages/block-email/component/BaseInput.tsx
+++ b/js/app/packages/block-email/component/BaseInput.tsx
@@ -528,9 +528,7 @@ export function BaseInput(props: {
// If there's an existing draft, we should send the sendTime so that the send time
// stays up to date and is not removed
- const sendTime = existingDraft
- ? form().sendTime()?.toISOString()
- : undefined;
+ const sendTime = existingDraft ? form().sendTime() : undefined;
const draftResponse = await saveDraftMutation.mutateAsync({
draft: {
@@ -723,7 +721,7 @@ export function BaseInput(props: {
const currentDraftID = savedDraftId();
if (draftSaveTimer) window.clearTimeout(draftSaveTimer);
- const sendTime = form().sendTime()?.toISOString();
+ const sendTime = form().sendTime();
if (sendTime) {
// Just in case, always get a fresh save of the draft so we don't miss any information
diff --git a/js/app/packages/block-email/component/Compose.tsx b/js/app/packages/block-email/component/Compose.tsx
index f514205a06..19da0a0f8e 100644
--- a/js/app/packages/block-email/component/Compose.tsx
+++ b/js/app/packages/block-email/component/Compose.tsx
@@ -222,7 +222,7 @@ export function EmailCompose(props: EmailComposeProps) {
// If there's an existing draft, we should send the sendTime so that the send time
// stays up to date and is not removed
- const sendTime = existingDraft ? form.sendTime()?.toISOString() : undefined;
+ const sendTime = existingDraft ? form.sendTime() : undefined;
const draftResponse = await saveDraftMutation.mutateAsync({
draft: {
@@ -525,7 +525,7 @@ export function EmailCompose(props: EmailComposeProps) {
return;
}
- const sendTime = form.sendTime()?.toISOString();
+ const sendTime = form.sendTime();
if (sendTime) {
// Just in case, always get a fresh save of the draft so we don't miss any information
diff --git a/js/app/packages/block-email/component/EmailMessageTopBar.tsx b/js/app/packages/block-email/component/EmailMessageTopBar.tsx
index ea4bc3cfa9..0f47d3c813 100644
--- a/js/app/packages/block-email/component/EmailMessageTopBar.tsx
+++ b/js/app/packages/block-email/component/EmailMessageTopBar.tsx
@@ -20,6 +20,7 @@ import {
} from '../util/emailUser';
import { useEmailContext } from './EmailContext';
import { type EmailMessageAction, MessageActions } from './MessageActions';
+import type { DateValue } from '@core/util/date';
interface EmailMessageTopBarProps {
message: MessageWithBodyReplyless;
@@ -39,8 +40,8 @@ interface Recipient {
email?: string | null;
}
-function formatFullDate(timestamp: string): string {
- return new Date(timestamp)
+function formatFullDate(date: DateValue): string {
+ return new Date(date)
.toLocaleString('en-US', {
weekday: 'long',
year: 'numeric',
@@ -53,16 +54,16 @@ function formatFullDate(timestamp: string): string {
.replace(',', '');
}
-export function formatShortDate(timestamp: string): string {
- const date = new Date(timestamp);
- if (date.getFullYear() !== new Date().getFullYear()) {
- return date.toLocaleDateString('en-US', {
+export function formatShortDate(date: DateValue): string {
+ const d = new Date(date);
+ if (d.getFullYear() !== new Date().getFullYear()) {
+ return d.toLocaleDateString('en-US', {
month: 'numeric',
day: 'numeric',
year: '2-digit',
});
}
- return date.toLocaleDateString('en-US', {
+ return d.toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
});
diff --git a/js/app/packages/block-email/signal/emailDraft.ts b/js/app/packages/block-email/signal/emailDraft.ts
index 86833bd986..215101b840 100644
--- a/js/app/packages/block-email/signal/emailDraft.ts
+++ b/js/app/packages/block-email/signal/emailDraft.ts
@@ -6,11 +6,11 @@ import type { MessageToSend } from '@service-email/generated/schemas/messageToSe
export async function saveEmailDraft(
draft: MessageToSend,
- sendTime?: string | null
+ sendTime?: Date | null
): Promise<MessageToSendDbId | false> {
const createRes = await emailClient.createDraft({
draft,
- send_time: sendTime,
+ send_time: sendTime?.toISOString() ?? null,
});
if (isErr(createRes)) {
logger.error(new Error('Failed to save draft', { cause: createRes[0] }));
diff --git a/js/app/packages/block-email/util/prepareEmailBody.ts b/js/app/packages/block-email/util/prepareEmailBody.ts
index b1131d1054..952c726867 100644
--- a/js/app/packages/block-email/util/prepareEmailBody.ts
+++ b/js/app/packages/block-email/util/prepareEmailBody.ts
@@ -51,17 +51,15 @@ function buildHeaderDescriptor(
replyingTo: MessageWithBodyReplyless,
replyType: ReplyType | undefined
): HeaderDescriptor {
+ const replyingToDate = replyingTo.internal_date_ts ?? replyingTo.created_at;
+ const formattedDate = formatEmailDate(replyingToDate);
+
if (replyType === 'forward') {
const lines: string[] = [];
lines.push('---------- Forwarded message ----------');
const fromName = replyingTo.from?.name ?? replyingTo.from?.email ?? '';
const fromEmail = replyingTo.from?.email ?? '';
lines.push(`From: ${fromName} <${fromEmail}>`);
- const epochSeconds =
- new Date(
- (replyingTo.internal_date_ts ?? replyingTo.created_at) as any
- ).getTime() / 1000;
- const formattedDate = formatEmailDate(epochSeconds);
lines.push(`Date: ${formattedDate}`);
lines.push(`Subject: ${replyingTo.subject ?? ''}`);
@@ -94,13 +92,9 @@ function buildHeaderDescriptor(
return { kind: 'forward', lines };
}
- const epochSeconds =
- new Date(
- (replyingTo.internal_date_ts ?? replyingTo.created_at) as any
- ).getTime() / 1000;
const headerText =
'On ' +
- formatEmailDate(epochSeconds) +
+ formattedDate +
' ' +
(replyingTo.from?.name ?? replyingTo.from?.email) +
' <' +
diff --git a/js/app/packages/block-md/comments/commentStore.ts b/js/app/packages/block-md/comments/commentStore.ts
index 0d35fe41f5..6373fc806f 100644
--- a/js/app/packages/block-md/comments/commentStore.ts
+++ b/js/app/packages/block-md/comments/commentStore.ts
@@ -141,7 +141,7 @@ export const highlightComments = createBlockMemo(() => {
text: '',
owner: userId,
author: userId,
- createdAt: Date.now(),
+ createdAt: new Date(),
isNew: true,
children: [],
threadId: -1,
diff --git a/js/app/packages/block-md/comments/commentsResource.ts b/js/app/packages/block-md/comments/commentsResource.ts
index b1261a765c..717a0844b4 100644
--- a/js/app/packages/block-md/comments/commentsResource.ts
+++ b/js/app/packages/block-md/comments/commentsResource.ts
@@ -5,6 +5,7 @@ import {
useBlockName,
} from '@core/block';
import { isErr } from '@core/util/maybeResult';
+import { compareDateAsc } from '@core/util/date';
import { createConnectionBlockWebsocketEffect } from '@service-connection/websocket';
import { storageServiceClient } from '@service-storage/client';
import type { AnnotationIncrementalUpdate } from '@service-storage/generated/schemas/annotationIncrementalUpdate';
@@ -33,7 +34,7 @@ export const sortComments = (a: Comment, b: Comment) => {
} else if (b.order != null) {
return 1;
}
- return a.createdAt - b.createdAt;
+ return compareDateAsc(a.createdAt, b.createdAt);
};
async function fetchComments() {
diff --git a/js/app/packages/block-md/component/ComposeTask.tsx b/js/app/packages/block-md/component/ComposeTask.tsx
index 30e14cda8e..d6adb861aa 100644
--- a/js/app/packages/block-md/component/ComposeTask.tsx
+++ b/js/app/packages/block-md/component/ComposeTask.tsx
@@ -339,7 +339,7 @@ export function ComposeTask(props: ComposeTaskProps) {
);
};
- const properties = () => {
+ const properties = (): Property[] => {
return filterMap(COMPOSER_PROPERTIES, (id) => {
const definition = definitions().get(id);
if (!definition) return;
@@ -350,8 +350,8 @@ export function ComposeTask(props: ComposeTaskProps) {
isMultiSelect: definition.is_multi_select,
owner: definition.owner,
specificEntityType: definition.specific_entity_type ?? null,
- updatedAt: '',
- createdAt: '',
+ updatedAt: new Date(0),
+ createdAt: new Date(0),
valueType: definition.data_type,
value: extractPropertyValue(definition, propertyValues, options()),
options: options().get(definition.id),
@@ -366,7 +366,7 @@ export function ComposeTask(props: ComposeTaskProps) {
saveDate: async (property: Property, date: Date) => {
setPropertyValues(property.propertyDefinitionId, {
valueType: 'DATE',
- value: date.toISOString(),
+ value: date,
});
},
};
diff --git a/js/app/packages/block-md/component/FrontMatterProperties.tsx b/js/app/packages/block-md/component/FrontMatterProperties.tsx
index faf8425fe9..9b7bc751dc 100644
--- a/js/app/packages/block-md/component/FrontMatterProperties.tsx
+++ b/js/app/packages/block-md/component/FrontMatterProperties.tsx
@@ -162,7 +162,7 @@ export function FrontMatterProperties(props: FrontMatterPropertiesProps) {
property,
apiValues: {
valueType: 'DATE',
- value: date.toISOString(),
+ value: date,
},
}),
};
diff --git a/js/app/packages/block-pdf/store/comments/freeComments.ts b/js/app/packages/block-pdf/store/comments/freeComments.ts
index 7e3cc90912..3e4813a90a 100644
--- a/js/app/packages/block-pdf/store/comments/freeComments.ts
+++ b/js/app/packages/block-pdf/store/comments/freeComments.ts
@@ -180,7 +180,7 @@ export const freeComments = createBlockMemo(() => {
text: '',
owner: userId,
author: userId,
- createdAt: Date.now(),
+ createdAt: new Date(),
isNew: true,
children: [],
threadId: -1,
diff --git a/js/app/packages/block-pdf/store/comments/highlightComments.ts b/js/app/packages/block-pdf/store/comments/highlightComments.ts
index 0e10bd2bf8..7eb8177248 100644
--- a/js/app/packages/block-pdf/store/comments/highlightComments.ts
+++ b/js/app/packages/block-pdf/store/comments/highlightComments.ts
@@ -134,7 +134,7 @@ export const highlightComments = createBlockMemo(() => {
text: '',
owner: userId,
author: userId,
- createdAt: Date.now(),
+ createdAt: new Date(),
isNew: true,
children: [],
threadId: -1,
diff --git a/js/app/packages/block-pdf/store/commentsResource.ts b/js/app/packages/block-pdf/store/commentsResource.ts
index 2845ee0c65..00630b075d 100644
--- a/js/app/packages/block-pdf/store/commentsResource.ts
+++ b/js/app/packages/block-pdf/store/commentsResource.ts
@@ -7,6 +7,7 @@ import {
useBlockName,
} from '@core/block';
import { isErr } from '@core/util/maybeResult';
+import { compareDateAsc } from '@core/util/date';
import { createConnectionBlockWebsocketEffect } from '@service-connection/websocket';
import { useUserId } from '@core/context/user';
import { storageServiceClient } from '@service-storage/client';
@@ -43,7 +44,7 @@ export const sortComments = (a: Comment, b: Comment) => {
} else if (b.order != null) {
return 1;
}
- return a.createdAt - b.createdAt;
+ return compareDateAsc(a.createdAt, b.createdAt);
};
async function fetchComments() {
diff --git a/js/app/packages/block-project/definition.ts b/js/app/packages/block-project/definition.ts
index aec9f08412..5754bf9438 100644
--- a/js/app/packages/block-project/definition.ts
+++ b/js/app/packages/block-project/definition.ts
@@ -22,8 +22,8 @@ export const definition = defineBlock({
id: 'root',
name: 'root',
parentId: '',
- createdAt: 0,
- updatedAt: 0,
+ createdAt: new Date(0).toISOString(),
+ updatedAt: new Date(0).toISOString(),
type: ProjectType.project,
userId: '',
deletedAt: null,
@@ -36,8 +36,8 @@ export const definition = defineBlock({
id: 'trash',
name: 'Trash',
parentId: '',
- createdAt: 0,
- updatedAt: 0,
+ createdAt: new Date(0).toISOString(),
+ updatedAt: new Date(0).toISOString(),
type: ProjectType.project,
userId: '',
deletedAt: null,
diff --git a/js/app/packages/core/comments/Comment.tsx b/js/app/packages/core/comments/Comment.tsx
index 0732aa6881..0b11429e92 100644
--- a/js/app/packages/core/comments/Comment.tsx
+++ b/js/app/packages/core/comments/Comment.tsx
@@ -56,7 +56,7 @@ export function Comment(
const { commentOperations, setActiveThread } = useContext(CommentsContext);
const isResolved = createMemo(() => props.comment.resolved ?? false);
- const date = createMemo(() => new Date(props.comment.createdAt));
+ const date = () => props.comment.createdAt;
const [textValue, setTextValue] = createSignal<string>(props.comment.text);
const [isEditing, setIsEditing] = createSignal<boolean>(false);
@@ -161,7 +161,7 @@ export function CommentReply(
createEffect(() => setTextValue(reply()?.text ?? ''));
const authorId = createMemo(() => reply()?.author ?? thisAuthor() ?? '');
- const date = createMemo(() => new Date(reply()?.createdAt ?? ''));
+ const date = () => reply()?.createdAt;
const isNew = createMemo(() => reply()?.isNew ?? true);
return (
diff --git a/js/app/packages/core/comments/MessageTopRow.tsx b/js/app/packages/core/comments/MessageTopRow.tsx
index 868669012a..ff4137cbf5 100644
--- a/js/app/packages/core/comments/MessageTopRow.tsx
+++ b/js/app/packages/core/comments/MessageTopRow.tsx
@@ -2,7 +2,7 @@ import { DeprecatedIconButton } from '@core/component/DeprecatedIconButton';
import { UserIcon } from '@core/component/UserIcon';
import { isMobileWidth } from '@core/mobile/mobileWidth';
import { idToDisplayName } from '@core/user';
-import { formatDate } from '@core/util/date';
+import { type DateValue, formatDate } from '@core/util/date';
import Check from '@phosphor-icons/core/regular/check.svg?component-solid';
import NotePencil from '@phosphor-icons/core/regular/note-pencil.svg?component-solid';
import Trash from '@phosphor-icons/core/regular/trash.svg?component-solid';
@@ -36,7 +36,7 @@ export enum Color {
export function MessageRow(
props: ParentProps<{
authorId: string | null;
- date: Date;
+ date?: DateValue | null;
hideBottomMargin?: boolean;
nameSlot?: any;
isActive: boolean;
@@ -57,7 +57,7 @@ export function MessageRow(
export function MessageRowUI(
props: ParentProps<{
authorId: string;
- date: Date;
+ date?: DateValue | null;
hideBottomMargin?: boolean;
nameSlot?: any;
hideBubble?: boolean;
@@ -92,9 +92,9 @@ export function MessageRowUI(
</div>
)}
<div class="text-xs text-ink truncate grow-1">{displayName()}</div>
- <div class="text-xs text-ink-muted">
- {formatDate(props.date.valueOf())}
- </div>
+ <Show when={props.date}>
+ <div class="text-xs text-ink-muted">{formatDate(props.date)}</div>
+ </Show>
</div>
<Show when={props.children}>
<div
@@ -109,7 +109,7 @@ export function MessageRowUI(
export function MessageTopRow(props: {
authorId: string | null;
- date: Date;
+ date?: DateValue | null;
deleteMessage?: () => void;
enableEditing?: () => void;
hideBottomMargin?: boolean;
diff --git a/js/app/packages/core/comments/commentType.ts b/js/app/packages/core/comments/commentType.ts
index 0bc3a09fc6..d7466ede8e 100644
--- a/js/app/packages/core/comments/commentType.ts
+++ b/js/app/packages/core/comments/commentType.ts
@@ -1,3 +1,4 @@
+import type { DateValue } from '@core/util/date';
import type {
CreateCommentRequest,
EditCommentRequest,
@@ -17,7 +18,7 @@ type CommentBase = {
owner: string;
author: string;
text: string;
- createdAt: number;
+ createdAt: DateValue | null | undefined;
// TODO: deprecated, adding for type compatibility
resolved?: boolean;
};
diff --git a/js/app/packages/core/component/DocumentPreview.tsx b/js/app/packages/core/component/DocumentPreview.tsx
index a65061c55d..e6334b5690 100644
--- a/js/app/packages/core/component/DocumentPreview.tsx
+++ b/js/app/packages/core/component/DocumentPreview.tsx
@@ -48,7 +48,7 @@ import type { Component, JSX } from 'solid-js';
import { Match, Show, Switch } from 'solid-js';
import { Dynamic } from 'solid-js/web';
import { beveledCorners } from '../../block-theme/signals/themeSignals';
-import { formatDate, isoToUnixTimestamp } from '../util/date';
+import { formatDate } from '../util/date';
import NotFound from './AccessErrorViews/NotFound';
import Unauthorized from './AccessErrorViews/Unauthorized';
import { Tooltip } from './Tooltip';
@@ -557,7 +557,7 @@ export function PopupPreview(props: {
>
{(context) => (
<MetadataInfo icon={ClockIcon} align="right">
- {formatDate(isoToUnixTimestamp(context().created_at))}
+ {formatDate(context().created_at)}
</MetadataInfo>
)}
</Show>
@@ -605,7 +605,7 @@ export function PopupPreview(props: {
<ClockIcon class="size-4" />
<span class="text-xs font-medium">
Snapshot from{' '}
- {formatDate(isoToUnixTimestamp(snapshot().date), {
+ {formatDate(new Date(snapshot().date), {
showTime: true,
})}
</span>
diff --git a/js/app/packages/core/component/GlobalNotificationBell.tsx b/js/app/packages/core/component/GlobalNotificationBell.tsx
index 6d312e4da1..ca7029d717 100644
--- a/js/app/packages/core/component/GlobalNotificationBell.tsx
+++ b/js/app/packages/core/component/GlobalNotificationBell.tsx
@@ -1,6 +1,7 @@
import { useGlobalNotificationSource } from '@app/component/GlobalAppState';
import { globalSplitManager } from '@app/signal/splitLayout';
import { NotificationRenderer } from '@core/component/NotificationRenderer';
+import { compareDateDesc } from '@core/util/date';
import Bell from '@icon/regular/bell.svg';
import {
type NotificationSource,
@@ -28,7 +29,9 @@ export function GlobalNotificationBell(props: GlobalNotificationBellProps) {
const unreadCount = () => unreadNotifications().length;
const mostRecent = () =>
- unreadNotifications().sort((a, b) => b.createdAt - a.createdAt)[0];
+ unreadNotifications().sort((a, b) =>
+ compareDateDesc(a.createdAt, b.createdAt)
+ )[0];
const handleNotificationClick = async () => {
const notification = mostRecent();
diff --git a/js/app/packages/core/component/LexicalMarkdown/component/core/MarkdownTextarea.tsx b/js/app/packages/core/component/LexicalMarkdown/component/core/MarkdownTextarea.tsx
index 4f27b76be6..3bc966a351 100644
--- a/js/app/packages/core/component/LexicalMarkdown/component/core/MarkdownTextarea.tsx
+++ b/js/app/packages/core/component/LexicalMarkdown/component/core/MarkdownTextarea.tsx
@@ -1,6 +1,6 @@
import type { PortalScope } from '@core/component/ScopedPortal';
import type { EditorType } from '@lexical-core';
-import type { Item } from '@service-storage/generated/schemas/item';
+import type { HistoryItem } from '@queries/history/types';
import { onElementConnect } from '@solid-primitives/lifecycle';
import {
COMMAND_PRIORITY_CRITICAL,
@@ -85,7 +85,7 @@ export interface MarkdownTextareaProps {
onRemoveMention?: (mention: ItemMention) => void;
portalScope?: PortalScope;
useBlockBoundary?: boolean;
- onDocumentMention?: (mention: Item) => void;
+ onDocumentMention?: (mention: HistoryItem) => void;
onEscape?: (e: KeyboardEvent) => boolean;
onTab?: (e: KeyboardEvent) => boolean;
captureEditor?: (editor: LexicalEditor) => void;
diff --git a/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/checkboxParsing.test.ts b/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/checkboxParsing.test.ts
index 60ddcef18d..ec9cd880ce 100644
--- a/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/checkboxParsing.test.ts
+++ b/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/checkboxParsing.test.ts
@@ -45,23 +45,54 @@ describe('Checkbox Parsing', () => {
it('should extract date from mention', () => {
const text =
'Due <m-date-mention>{"date":"2024-03-15T00:00:00Z","displayFormat":"March 15, 2024"}</m-date-mention>';
- expect(extractDateMention(text)).toBe('2024-03-15T00:00:00Z');
+ const result = extractDateMention(text);
+ expect(result).toBeInstanceOf(Date);
+ expect(result?.toISOString()).toBe('2024-03-15T00:00:00.000Z');
});
it('should return null when no date mention', () => {
expect(extractDateMention('No date here')).toBeNull();
});
+ it('should return null when date is not a string', () => {
+ const text =
+ '<m-date-mention>{"date":2024-03-15T00:00:00Z,"displayFormat":"March 15, 2024"}</m-date-mention>';
+ const result = extractDateMention(text);
+ expect(result).toBeNull();
+ });
+
+ it('should return null when date is not a valid date', () => {
+ const text =
+ '<m-date-mention>{"date":"2024-16-15T00:00:00Z","displayFormat":"March 15, 2024"}</m-date-mention>';
+ const result = extractDateMention(text);
+ console.log('result 4', result);
+ expect(result).toBeNull();
+ });
+
it('should return first date when multiple present', () => {
const text =
'<m-date-mention>{"date":"2024-01-01","displayFormat":"Jan 1"}</m-date-mention> to <m-date-mention>{"date":"2024-12-31","displayFormat":"Dec 31"}</m-date-mention>';
- expect(extractDateMention(text)).toBe('2024-01-01');
+ const result = extractDateMention(text);
+ expect(result).toBeInstanceOf(Date);
+ expect(result?.toISOString()).toBe('2024-01-01T00:00:00.000Z');
});
it('should handle malformed JSON gracefully', () => {
const text = '<m-date-mention>{invalid}</m-date-mention>';
expect(extractDateMention(text)).toBeNull();
});
+
+ it('should handle null date field', () => {
+ const text =
+ '<m-date-mention>{"date":null,"displayFormat":"N/A"}</m-date-mention>';
+ expect(extractDateMention(text)).toBeNull();
+ });
+
+ it('should handle missing date field', () => {
+ const text =
+ '<m-date-mention>{"displayFormat":"March 15"}</m-date-mention>';
+ expect(extractDateMention(text)).toBeNull();
+ });
});
describe('extractTitleFromMarkdown', () => {
diff --git a/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/checkboxParsing.ts b/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/checkboxParsing.ts
index d725f56727..0d59c39826 100644
--- a/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/checkboxParsing.ts
+++ b/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/checkboxParsing.ts
@@ -6,6 +6,7 @@ import {
} from '@lexical-core/utils/parsers';
import { $elementNodeToMarkdown } from '../../utils';
import type { ParsedCheckbox } from './types';
+import { isValid } from 'date-fns';
// Patterns for extracting data from mentions (not for replacement)
const USER_MENTION_PATTERN = /<m-user-mention>(.*?)<\/m-user-mention>/;
@@ -34,15 +35,19 @@ export function extractUserMentions(markdownText: string): string[] {
/**
* Extract the first date mention from markdown text.
- * Returns ISO date string or null.
+ * Returns parsed ISO date string Date object or null.
*/
-export function extractDateMention(markdownText: string): string | null {
+export function extractDateMention(markdownText: string): Date | null {
const match = DATE_MENTION_PATTERN.exec(markdownText);
if (!match) return null;
try {
const data = JSON.parse(match[1]);
- return data.date ?? null;
+ const maybeIsoString = data.date;
+ if (!maybeIsoString) return null;
+ const date = new Date(maybeIsoString);
+ if (!isValid(date)) return null;
+ return date;
} catch {
return null;
}
diff --git a/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/types.ts b/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/types.ts
index f9857d9ef0..8d205770b4 100644
--- a/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/types.ts
+++ b/js/app/packages/core/component/LexicalMarkdown/plugins/checkbox-to-task/types.ts
@@ -9,7 +9,7 @@ export type ParsedCheckbox = {
title: string;
rawMarkdown: string;
assigneeUserIds: string[];
- dueDate: string | null;
+ dueDate: Date | null;
};
/** Successful task creation */
diff --git a/js/app/packages/core/component/LexicalMarkdown/utils/mentionsUtils.ts b/js/app/packages/core/component/LexicalMarkdown/utils/mentionsUtils.ts
index 1fd1cb6c8b..e88a950294 100644
--- a/js/app/packages/core/component/LexicalMarkdown/utils/mentionsUtils.ts
+++ b/js/app/packages/core/component/LexicalMarkdown/utils/mentionsUtils.ts
@@ -6,9 +6,7 @@ import type { ParsedDate } from '@core/util/dateParser';
import type { EmailEntity } from '@entity';
import { waitBulkUploadStatus } from '@service-connection/bulkUpload';
import type { DocumentMentionMetadata } from '@service-notification/client';
-import type { BasicDocument } from '@service-storage/generated/schemas/basicDocument';
import type { HistoryItem as Item } from '@queries/history/history';
-import type { Project } from '@service-storage/generated/schemas/project';
import type { UploadSuccess } from '@service-storage/util/upload';
import type { LexicalEditor } from 'lexical';
import { v7 } from 'uuid';
@@ -243,20 +241,20 @@ export async function handleEmailMention(
* Converts a UploadSuccess to an Item. Folder UploadSuccesses contain a promise for the projectId, so we need to wait for that to resolve.
*/
export async function documentUploadToItem(upload: UploadSuccess) {
- const now = Date.now();
+ const now = new Date();
if (upload.type === 'document') {
return {
id: upload.documentId,
name: upload.name,
- type: 'document',
+ type: 'document' as const,
fileType: upload.fileType,
createdAt: now,
updatedAt: now,
deletedAt: null,
documentVersionId: 0,
owner: '',
- } satisfies BasicDocument;
+ };
}
const projectId = await waitBulkUploadStatus(upload.requestId);
@@ -265,12 +263,12 @@ export async function documentUploadToItem(upload: UploadSuccess) {
return {
id: projectId,
name: upload.name,
- type: 'project',
+ type: 'project' as const,
createdAt: now,
updatedAt: now,
deletedAt: null,
userId: '',
- } satisfies Project;
+ };
}
/**
diff --git a/js/app/packages/core/component/Message.stories.tsx b/js/app/packages/core/component/Message.stories.tsx
index e1d0fefb12..3ac7cafe98 100644
--- a/js/app/packages/core/component/Message.stories.tsx
+++ b/js/app/packages/core/component/Message.stories.tsx
@@ -1,4 +1,5 @@
import type { Meta, StoryObj } from 'storybook-solidjs-vite';
+import { applyDurationToDate } from '@core/util/dateSearch/dateParser';
import { Message } from './Message';
const meta = {
@@ -26,7 +27,7 @@ export const SingleMessage: Story = {
isLastMessage={true}
isConsecutive={false}
>
- <Message.TopBar name="John Doe" timestamp={new Date().toISOString()} />
+ <Message.TopBar name="John Doe" timestamp={new Date()} />
<Message.Body>
This is a single message with a timestamp and user name.
</Message.Body>
@@ -50,7 +51,7 @@ export const ThreadedMessages: Story = {
>
<Message.TopBar
name="Alice"
- timestamp={new Date(Date.now() - 3600000).toISOString()}
+ timestamp={applyDurationToDate(new Date(), { value: -1, unit: 'h' })}
/>
<Message.Body>
This is the root message. It has replies below.
@@ -69,7 +70,10 @@ export const ThreadedMessages: Story = {
>
<Message.TopBar
name="Bob"
- timestamp={new Date(Date.now() - 1800000).toISOString()}
+ timestamp={applyDurationToDate(new Date(), {
+ value: -30,
+ unit: 'min',
+ })}
/>
<Message.Body>This is the first reply in the thread.</Message.Body>
</Message>
@@ -84,7 +88,7 @@ export const ThreadedMessages: Story = {
threadDepth={1}
isLastInThread={true}
>
- <Message.TopBar name="Charlie" timestamp={new Date().toISOString()} />
+ <Message.TopBar name="Charlie" timestamp={new Date()} />
<Message.Body>
And this is another reply in the same thread!
</Message.Body>
@@ -104,7 +108,7 @@ export const ConsecutiveMessages: Story = {
isLastMessage={false}
isConsecutive={false}
>
- <Message.TopBar name="Alice" timestamp={new Date().toISOString()} />
+ <Message.TopBar name="Alice" timestamp={new Date()} />
<Message.Body>First message from Alice</Message.Body>
</Message>
@@ -145,10 +149,7 @@ export const FocusedMessage: Story = {
isLastMessage={true}
isConsecutive={false}
>
- <Message.TopBar
- name="Focused User"
- timestamp={new Date().toISOString()}
- />
+ <Message.TopBar name="Focused User" timestamp={new Date()} />
<Message.Body>
This message is focused (has active bracket styling).
</Message.Body>
@@ -168,10 +169,7 @@ export const DeletedMessage: Story = {
isConsecutive={false}
isDeleted={true}
>
- <Message.TopBar
- name="Deleted User"
- timestamp={new Date().toISOString()}
- />
+ <Message.TopBar name="Deleted User" timestamp={new Date()} />
<Message.Body isDeleted={true}>
This message has been deleted.
</Message.Body>
diff --git a/js/app/packages/core/component/Message.tsx b/js/app/packages/core/component/Message.tsx
index 033be281d9..ed465457c0 100644
--- a/js/app/packages/core/component/Message.tsx
+++ b/js/app/packages/core/component/Message.tsx
@@ -1,6 +1,6 @@
import { observedSize } from '@core/directive/observedSize';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
-import { formatDate } from '@core/util/date';
+import { type DateValue, formatDate } from '@core/util/date';
import IconPlus from '@icon/regular/plus.svg';
import {
type Accessor,
@@ -36,7 +36,7 @@ export type MessageRootProps = {
isFirstMessage: boolean;
isLastMessage: boolean;
isConsecutive?: boolean;
- timestamp?: string;
+ timestamp?: DateValue;
hoverActions?: () => JSX.Element;
shouldHover?: boolean;
threadDepth?: number;
@@ -80,7 +80,7 @@ export function useMessageContext(): MessageContextValue {
export type MessageTopBarSimpleProps = {
name: string;
- timestamp?: string;
+ timestamp?: DateValue | null;
tagLabel?: string;
tagIcon?: Component<JSX.SvgSVGAttributes<SVGSVGElement>> | undefined;
};
@@ -133,8 +133,7 @@ const TopBar: Component<MessageTopBarProps> = (props) => {
{/* Date - hidden when hovering since it shows above hover actions */}
<Show when={local.timestamp && !context.hover()}>
<div class="text-xs touch:mobile-width:text-sm text-ink-muted">
- {local.timestamp &&
- formatDate(new Date(local.timestamp).getTime() / 1000)}
+ {local.timestamp && formatDate(local.timestamp)}
</div>
</Show>
</div>
@@ -361,11 +360,13 @@ const Root: Component<MessageRootProps> = (props) => {
data-message-id={props.id}
>
<Show when={props.timestamp}>
- <div class="absolute top-0 translate-y-[-100%] bg-panel pl-2 pt-2 text-xs text-ink-muted font-mono mb-0.5 select-text cursor-default">
- {formatDate(new Date(props.timestamp!).getTime() / 1000, {
- showTime: true,
- })}
- </div>
+ {(timestamp) => (
+ <div class="absolute top-0 translate-y-[-100%] bg-panel pl-2 pt-2 text-xs text-ink-muted font-mono mb-0.5 select-text cursor-default">
+ {formatDate(timestamp(), {
+ showTime: true,
+ })}
+ </div>
+ )}
</Show>
<Show when={hover()}>
<div class="border border-edge bg-panel">
diff --git a/js/app/packages/core/component/NotificationRenderer.tsx b/js/app/packages/core/component/NotificationRenderer.tsx
index 618090c7e5..390d0eeb67 100644
--- a/js/app/packages/core/component/NotificationRenderer.tsx
+++ b/js/app/packages/core/component/NotificationRenderer.tsx
@@ -39,7 +39,6 @@ export function NotificationRenderer(props: NotificationRendererProps) {
if (meta.tag !== 'new_email') return null;
return { subject: meta.content.subject, snippet: meta.content.snippet };
};
-
return (
<Show when={props.notification.notificationMetadata}>
{(_metadata) => {
diff --git a/js/app/packages/core/component/Notifications.tsx b/js/app/packages/core/component/Notifications.tsx
index 5d5cfcda9a..a0a924ebfd 100644
--- a/js/app/packages/core/component/Notifications.tsx
+++ b/js/app/packages/core/component/Notifications.tsx
@@ -1,7 +1,7 @@
import { globalSplitManager } from '@app/signal/splitLayout';
import { NotificationRenderer } from '@core/component/NotificationRenderer';
import type { Entity } from '@core/types';
-import { formatDate } from '@core/util/date';
+import { compareDateDesc, formatDate } from '@core/util/date';
import { useSplitNavigationHandler } from '@core/util/useSplitNavigationHandler';
import {
NOTIFICATION_LABEL_BY_TYPE,
@@ -23,7 +23,7 @@ export function Notifications(props: NotificationsProps) {
`${props.entity.type}@${props.entity.id}`
] ?? [];
return entityNotifications.sort((a, b) => {
- return b.createdAt - a.createdAt;
+ return compareDateDesc(a.createdAt, b.createdAt);
});
});
@@ -73,7 +73,7 @@ export function Notifications(props: NotificationsProps) {
}
</div>
<div class="grow" />
- <div>{formatDate(notification.createdAt)}</div>
+ <div>{formatDate(notification.createdAt ?? new Date(0))}</div>
</div>
<div class="flex flex-col gap-2 ml-4">
diff --git a/js/app/packages/core/component/Properties/PropertiesView.tsx b/js/app/packages/core/component/Properties/PropertiesView.tsx
index ea0f4bcfc9..c38c0de5ab 100644
--- a/js/app/packages/core/component/Properties/PropertiesView.tsx
+++ b/js/app/packages/core/component/Properties/PropertiesView.tsx
@@ -64,7 +64,7 @@ export function PropertiesView(props: PropertiesPanelProps) {
property,
apiValues: {
valueType: 'DATE',
- value: date.toISOString(),
+ value: date,
},
}),
};
diff --git a/js/app/packages/core/component/Properties/api/converters.ts b/js/app/packages/core/component/Properties/api/converters.ts
index 41112a7cd2..e9c8960053 100644
--- a/js/app/packages/core/component/Properties/api/converters.ts
+++ b/js/app/packages/core/component/Properties/api/converters.ts
@@ -209,7 +209,7 @@ export function propertyValueToApi(
}
return {
type: 'date',
- value: apiValues.value,
+ value: apiValues.value.toISOString(),
};
case 'BOOLEAN':
@@ -323,10 +323,9 @@ export function propertyApiValuesToNormalized(
}
case 'DATE': {
- if (apiValues.value !== null && typeof apiValues.value === 'string') {
- const date = new Date(apiValues.value);
- if (!isNaN(date.getTime())) {
- return { type: 'DATE', value: date };
+ if (apiValues.value !== null && apiValues.value instanceof Date) {
+ if (!isNaN(apiValues.value.getTime())) {
+ return { type: 'DATE', value: apiValues.value };
}
}
return { type: 'EMPTY', value: null };
diff --git a/js/app/packages/core/component/Properties/component/modal/EditPropertyValueModal.tsx b/js/app/packages/core/component/Properties/component/modal/EditPropertyValueModal.tsx
index c2fac870a3..ef9235a8f6 100644
--- a/js/app/packages/core/component/Properties/component/modal/EditPropertyValueModal.tsx
+++ b/js/app/packages/core/component/Properties/component/modal/EditPropertyValueModal.tsx
@@ -111,7 +111,7 @@ export function EditPropertyValueModal(props: PropertyEditorProps) {
const date = selectedDate();
apiValues = {
valueType: 'DATE',
- value: date ? date.toISOString() : null,
+ value: date,
};
break;
}
diff --git a/js/app/packages/core/component/Properties/debug/PropertiesDebug.tsx b/js/app/packages/core/component/Properties/debug/PropertiesDebug.tsx
index b2dd96a09d..e85e9e2dd8 100644
--- a/js/app/packages/core/component/Properties/debug/PropertiesDebug.tsx
+++ b/js/app/packages/core/component/Properties/debug/PropertiesDebug.tsx
@@ -104,7 +104,7 @@ const PropertiesDebug: Component = () => {
};
// Build properties list (copied from ComposeTask)
- const properties = () => {
+ const properties = (): Property[] => {
return filterMap(DEBUG_SYSTEM_PROPERTIES, (id) => {
const definition = definitions().get(id);
if (!definition) return;
@@ -115,8 +115,8 @@ const PropertiesDebug: Component = () => {
isMultiSelect: definition.is_multi_select,
owner: definition.owner,
specificEntityType: definition.specific_entity_type ?? null,
- updatedAt: '',
- createdAt: '',
+ updatedAt: new Date(),
+ createdAt: new Date(),
valueType: definition.data_type,
value: extractPropertyValue(definition, propertyValues, options()),
options: options().get(definition.id),
@@ -134,8 +134,8 @@ const PropertiesDebug: Component = () => {
isMultiSelect: false,
owner: { scope: 'system' },
specificEntityType: null,
- updatedAt: new Date().toISOString(),
- createdAt: new Date().toISOString(),
+ updatedAt: new Date(),
+ createdAt: new Date(),
valueType: 'STRING',
value: (propertyValues['spoof-string-input'] as any)?.value || null,
options: [],
@@ -148,8 +148,8 @@ const PropertiesDebug: Component = () => {
isMultiSelect: false,
owner: { scope: 'system' },
specificEntityType: null,
- updatedAt: new Date().toISOString(),
- createdAt: new Date().toISOString(),
+ updatedAt: new Date(),
+ createdAt: new Date(),
valueType: 'BOOLEAN',
value:
(propertyValues['spoof-boolean-checkbox'] as any)?.value || false,
@@ -163,8 +163,8 @@ const PropertiesDebug: Component = () => {
isMultiSelect: false,
owner: { scope: 'system' },
specificEntityType: null,
- updatedAt: new Date().toISOString(),
- createdAt: new Date().toISOString(),
+ updatedAt: new Date(),
+ createdAt: new Date(),
valueType: 'LINK',
value: (propertyValues['spoof-link-url'] as any)?.value || null,
options: [],
@@ -193,7 +193,7 @@ const PropertiesDebug: Component = () => {
setPropertyValues(property.propertyDefinitionId, {
valueType: 'DATE',
- value: date.toISOString(),
+ value: date,
});
},
};
diff --git a/js/app/packages/core/component/Properties/types.ts b/js/app/packages/core/component/Properties/types.ts
index a54337e592..be3f58233b 100644
--- a/js/app/packages/core/component/Properties/types.ts
+++ b/js/app/packages/core/component/Properties/types.ts
@@ -14,6 +14,7 @@
* - Legacy compatibility during migration
*/
import type { BlockName } from '@core/block';
+import type { DateValue } from '@core/util/date';
import type { EntityReference } from '@service-properties/generated/schemas/entityReference';
import type { EntityType } from '@service-properties/generated/schemas/entityType';
import type { PropertyOption } from '@service-properties/generated/schemas/propertyOption';
@@ -52,8 +53,8 @@ export type Property = {
options?: PropertyOption[];
owner: PropertyOwner;
specificEntityType?: EntityType | null;
- createdAt: string;
- updatedAt: string;
+ createdAt: DateValue;
+ updatedAt: DateValue;
} & ( // Single-value types
| { valueType: 'STRING'; value: string | null }
| { valueType: 'NUMBER'; value: number | null }
@@ -115,8 +116,8 @@ export type PropertyDefinitionDomain = {
owner: PropertyOwner;
specificEntityType?: EntityType | null;
options?: PropertyOption[];
- createdAt: string;
- updatedAt: string;
+ createdAt: DateValue;
+ updatedAt: DateValue;
};
export type PropertiesPanelProps = {
@@ -168,7 +169,7 @@ export type { SetPropertyValue } from '@service-properties/generated/schemas/set
export type PropertyApiValues =
| { valueType: 'STRING'; value: string | null }
| { valueType: 'NUMBER'; value: number | null }
- | { valueType: 'DATE'; value: string | null }
+ | { valueType: 'DATE'; value: Date | null }
| { valueType: 'BOOLEAN'; value: boolean | null }
| { valueType: 'SELECT_STRING'; values: string[] | null }
| { valueType: 'SELECT_NUMBER'; values: string[] | null }
diff --git a/js/app/packages/core/component/Properties/utils/typeGuards.ts b/js/app/packages/core/component/Properties/utils/typeGuards.ts
index acdc300583..120b935927 100644
--- a/js/app/packages/core/component/Properties/utils/typeGuards.ts
+++ b/js/app/packages/core/component/Properties/utils/typeGuards.ts
@@ -302,10 +302,10 @@ export function toPropertyApiValue(
)
.with('DATE', () => {
if (typeof value === 'string') {
- return { valueType: 'DATE' as const, value };
+ return { valueType: 'DATE' as const, value: new Date(value) };
}
if (value instanceof Date) {
- return { valueType: 'DATE' as const, value: value.toISOString() };
+ return { valueType: 'DATE' as const, value };
}
return null;
})
diff --git a/js/app/packages/core/component/References.tsx b/js/app/packages/core/component/References.tsx
index 4f14d8015f..3bd3e727af 100644
--- a/js/app/packages/core/component/References.tsx
+++ b/js/app/packages/core/component/References.tsx
@@ -20,6 +20,7 @@ import { InlineItemPreview } from './ItemPreview';
import { StaticMarkdown } from './LexicalMarkdown/component/core/StaticMarkdown';
import { UserIcon } from './UserIcon';
import { URL_PARAMS as CHANNEL_PARAMS } from '@block-channel/constants';
+import { compareDateDesc, type DateValue } from '@core/util/date';
export type ReferenceProps = {
documentId: string;
@@ -53,6 +54,14 @@ function isGenericReference(
);
}
+const getReferenceCreatedAt = (ref: EntityReference) => {
+ if (isChannelReference(ref)) {
+ return ref.attachment_created_at;
+ } else if (isGenericReference(ref)) {
+ return ref.created_at;
+ }
+};
+
export function References(props: ReferenceProps) {
const [references] = createResource(async () => {
const entityType = props.entityType ?? 'document';
@@ -136,29 +145,14 @@ export function References(props: ReferenceProps) {
const sortedReferences = createMemo(() => {
const refs = references() ?? [];
- return refs.sort((a, b) => {
- let timeA = '0';
- let timeB = '0';
-
- if (isChannelReference(a)) {
- timeA = a.attachment_created_at;
- } else if (isGenericReference(a)) {
- timeA = a.created_at;
- }
-
- if (isChannelReference(b)) {
- timeB = b.attachment_created_at;
- } else if (isGenericReference(b)) {
- timeB = b.created_at;
- }
-
- return new Date(timeB).getTime() - new Date(timeA).getTime();
- });
+ return refs.sort((a, b) =>
+ compareDateDesc(getReferenceCreatedAt(a), getReferenceCreatedAt(b))
+ );
});
- const formatTimestamp = (timestamp: string) => {
- const date = new Date(timestamp);
- const datePart = date
+ const formatTimestamp = (input: DateValue) => {
+ const timestamp = input instanceof Date ? input : new Date(input);
+ const datePart = timestamp
.toLocaleDateString('en-US', {
month: 'numeric',
day: 'numeric',
@@ -166,7 +160,7 @@ export function References(props: ReferenceProps) {
})
.replaceAll('/', '-');
- const timePart = date.toLocaleTimeString('en-US', {
+ const timePart = timestamp.toLocaleTimeString('en-US', {
hour: 'numeric',
minute: 'numeric',
});
diff --git a/js/app/packages/core/context/channels.ts b/js/app/packages/core/context/channels.ts
index 35bc10eef5..59ca295211 100644
--- a/js/app/packages/core/context/channels.ts
+++ b/js/app/packages/core/context/channels.ts
@@ -1,4 +1,5 @@
import { createMemo, type Accessor } from 'solid-js';
+import type { DateValue } from '@core/util/date';
import type {
ApiActivity as ChannelsActivity,
ApiChannelWithLatest,
@@ -9,7 +10,6 @@ import { useChannelsActivityQuery } from '@queries/channel/activity';
import { queryReadyGate } from '@queries/gate';
import { createAssertedContextProvider } from './createContext';
import { useUserId } from './user';
-import type { LastInteractionTimestamp } from '@core/user/types';
type ChannelsContextValue = {
channels: Accessor<ApiChannelWithLatest[]>;
@@ -73,20 +73,20 @@ export function useChannelActivity(channelId: string) {
}
/**
- * Get a reactive map of userId -> Unix timestamp for the most recent DM
+ * Get a reactive map of userId -> Date for the most recent DM
* activity with that user. Useful for ranking/sorting users by recency of
* interaction.
*/
-export function useDmActivityByUserId(): Accessor<Map<string, number>> {
+export function useDmActivityByUserId(): Accessor<Map<string, DateValue>> {
const { channels } = useChannelsContext();
const currentUserId = useUserId();
return createMemo(() => {
const currentUser = currentUserId();
- if (!currentUser) return new Map<string, LastInteractionTimestamp>();
+ if (!currentUser) return new Map();
const allChannels = channels();
- const map = new Map<string, LastInteractionTimestamp>();
+ const map = new Map<string, DateValue>();
for (const channel of allChannels) {
if (channel.channel_type !== ChannelTypeEnum.DirectMessage) continue;
@@ -96,12 +96,7 @@ export function useDmActivityByUserId(): Accessor<Map<string, number>> {
);
if (!otherParticipant) continue;
- const timestamp = channel.updated_at;
- if (timestamp) {
- const date = new Date(timestamp);
- const unixTimestamp = date.getTime();
- map.set(otherParticipant.user_id, unixTimestamp);
- }
+ map.set(otherParticipant.user_id, channel.updated_at);
}
return map;
diff --git a/js/app/packages/core/signal/token.ts b/js/app/packages/core/signal/token.ts
index 50dcbf33d1..c020123352 100644
--- a/js/app/packages/core/signal/token.ts
+++ b/js/app/packages/core/signal/token.ts
@@ -5,7 +5,7 @@ import { createCallback } from '@solid-primitives/rootless';
import { createStore, type SetStoreFunction, type Store } from 'solid-js/store';
// 60 seconds
-const EXPIRATION_THRESHOLD = 60;
+const EXPIRATION_THRESHOLD_SECONDS = 60;
type Token = string;
type TokenStore = Record<CompositeKey, Token>;
@@ -32,7 +32,7 @@ function isTokenExpired(token: string) {
try {
const payload = JSON.parse(atob(token.split('.')[1]));
const currentTime = Math.floor(Date.now() / 1000);
- return payload.exp < currentTime + EXPIRATION_THRESHOLD;
+ return payload.exp < currentTime + EXPIRATION_THRESHOLD_SECONDS;
} catch (_error) {
return true;
}
diff --git a/js/app/packages/core/tests/date.test.ts b/js/app/packages/core/tests/date.test.ts
index 2ff8bcda1f..a6d7ddaf24 100644
--- a/js/app/packages/core/tests/date.test.ts
+++ b/js/app/packages/core/tests/date.test.ts
@@ -1,97 +1,95 @@
-import { describe, expect, it } from 'vitest';
-import { formatDate } from '../util/date';
+import { max } from 'date-fns';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+import {
+ compareDateAsc,
+ compareDateDesc,
+ convertIsoString,
+ formatDate,
+} from '../util/date';
-const epochTime = (str: string) => Math.floor(new Date(str).getTime() / 1000);
-
-// Use June 14, 2025 at 10:15 AM as a reference time.
-const mockNow = '2025-06-14T14:15:00.000Z';
-const mockNowEpochSeconds = epochTime(mockNow);
+// Use June 14, 2025 at 10:15 AM New York time (EDT/UTC-4) as a reference time.
+const mockNow: Date = new Date('2025-06-14T14:15:00.000Z');
+const NEW_YORK_TZ = 'America/New_York';
describe('Date Utilities (core/utils/date.ts)', () => {
+ beforeEach(() => {
+ // default system time to UTC
+ process.env.TZ = 'UTC';
+
+ vi.setSystemTime(mockNow);
+ });
+
describe('formatDate', () => {
it('should should show only time at Date.now()', () => {
- const now = epochTime(new Date().toISOString());
+ const now = new Date();
const result = formatDate(now);
expect(result).toMatch(/\d{1,2}:\d{2}\s?(AM|PM)/i);
});
- it('should show correct date with no params', () => {
- const result = formatDate(mockNowEpochSeconds);
- expect(result).toMatch('06/14/25');
+ it('should show correct time for now with default UTC system time', () => {
+ const result = formatDate(mockNow);
+ expect(result).toMatch('2:15 PM');
+ });
+
+ it('should accept ISO string input', () => {
+ const result = formatDate('2025-06-14T14:15:00.000Z');
+ expect(result).toMatch('2:15 PM');
+ });
+
+ it('should show correct time for now with no params and new york system time', () => {
+ process.env.TZ = NEW_YORK_TZ;
+ const result = formatDate(mockNow);
+ expect(result).toMatch('10:15 AM');
+ });
+
+ it('should show correct time for new york timezone param', () => {
+ const result = formatDate(mockNow, { timeZone: NEW_YORK_TZ });
+ expect(result).toMatch('10:15 AM');
});
it('should format time for today', () => {
// Today at 8:15 AM UTC
- const todayMorning = epochTime('2025-06-14T08:15:00.000Z');
- expect(
- formatDate(todayMorning, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
- })
- ).toBe('8:15 AM');
+ const todayMorning: Date = new Date('2025-06-14T08:15:00.000Z');
+ expect(formatDate(todayMorning)).toBe('8:15 AM');
});
it('should format "Yesterday at {time}" for yesterday (UTC day boundary)', () => {
// Yesterday at 11:00 PM UTC (June 13)
- const yesterdayEvening = epochTime('2025-06-13T23:00:00.000Z');
- expect(
- formatDate(yesterdayEvening, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
- })
- ).toBe('Yesterday at 11:00 PM');
+ const yesterdayEvening: Date = new Date('2025-06-13T23:00:00.000Z');
+ expect(formatDate(yesterdayEvening)).toBe('Yesterday at 11:00 PM');
});
it('should handle edge case at UTC midnight boundary', () => {
// Reference time: June 14, 2:15 PM UTC
// Yesterday at 11:59 PM UTC (June 13) - just before midnight
- const justBeforeMidnight = epochTime('2025-06-13T23:59:59.000Z');
- expect(
- formatDate(justBeforeMidnight, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
- })
- ).toBe('Yesterday at 11:59 PM');
+ const justBeforeMidnight: Date = new Date('2025-06-13T23:59:59.000Z');
+ expect(formatDate(justBeforeMidnight)).toBe('Yesterday at 11:59 PM');
});
it('should handle same day even with less than 24 hour difference', () => {
// Reference time: June 14, 2:15 PM UTC
// Same day at 1:00 AM UTC (13.25 hours earlier, but same UTC day)
- const earlyToday = epochTime('2025-06-14T01:00:00.000Z');
- expect(
- formatDate(earlyToday, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
- })
- ).toBe('1:00 AM');
+ const earlyToday: Date = new Date('2025-06-14T01:00:00.000Z');
+ expect(formatDate(earlyToday)).toBe('1:00 AM');
});
it('should handle yesterday even with more than 24 hour difference', () => {
// Reference time: June 14, 2:15 PM UTC
// Yesterday at 1:00 AM UTC (37.25 hours earlier, but still "yesterday")
- const yesterdayEarly = epochTime('2025-06-13T01:00:00.000Z');
- expect(
- formatDate(yesterdayEarly, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
- })
- ).toBe('Yesterday at 1:00 AM');
+ const yesterdayEarly: Date = new Date('2025-06-13T01:00:00.000Z');
+ expect(formatDate(yesterdayEarly)).toBe('Yesterday at 1:00 AM');
});
it('should format weekday for recent days (2-6 days ago)', () => {
// June 12 (2 days ago) - should show weekday
- const twoDaysAgo = epochTime('2025-06-12T15:00:00.000Z');
- expect(formatDate(twoDaysAgo, { epochNow: mockNowEpochSeconds })).toBe(
- 'Thursday'
- );
+ const twoDaysAgo: Date = new Date('2025-06-12T15:00:00.000Z');
+ expect(formatDate(twoDaysAgo)).toBe('Thursday');
});
it('should format date for older dates (more than 7 days)', () => {
// June 1, 2025 (13 days ago)
- const oldDate = epochTime('2025-06-01T12:00:00.000Z');
- expect(formatDate(oldDate, { epochNow: mockNowEpochSeconds })).toBe(
- '06/01/25'
- );
+ const oldDate: Date = new Date('2025-06-01T12:00:00.000Z');
+ expect(formatDate(oldDate)).toBe('06/01/25');
});
it('should handle timezone-aware day boundaries', () => {
@@ -99,21 +97,19 @@ describe('Date Utilities (core/utils/date.ts)', () => {
// Test timestamp: June 14 at 11:30 PM Eastern (3:30 AM UTC June 15)
// In Eastern timezone, this should be "Today"
- const lateEastern = epochTime('2025-06-15T03:30:00.000Z');
+ const lateEastern: Date = new Date('2025-06-15T03:30:00.000Z');
expect(
formatDate(lateEastern, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'America/New_York',
+ timeZone: NEW_YORK_TZ,
})
).toBe('11:30 PM');
// In UTC timezone, this should be "Tomorrow" (but we'll get weekday since it's >1 day diff)
// Let's test with a timestamp that's same day in Eastern but different day in UTC
- const easternToday = epochTime('2025-06-14T23:30:00.000Z');
+ const easternToday: Date = new Date('2025-06-14T23:30:00.000Z');
expect(
formatDate(easternToday, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'America/New_York',
+ timeZone: NEW_YORK_TZ,
})
).toBe('7:30 PM');
});
@@ -121,10 +117,9 @@ describe('Date Utilities (core/utils/date.ts)', () => {
it('should handle edge case where formatToParts fails gracefully', () => {
// This test ensures our fallback values prevent month=-1 or day=0 edge cases
// We can't easily mock formatToParts to fail, but we can test with extreme dates
- const extremeDate = epochTime('1900-01-01T00:00:00.000Z');
+ const extremeDate: Date = new Date('1900-01-01T00:00:00.000Z');
const result = formatDate(extremeDate, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'America/New_York',
+ timeZone: NEW_YORK_TZ,
});
// Should not throw and should return a reasonable date format (not crash due to invalid Date)
@@ -136,11 +131,9 @@ describe('Date Utilities (core/utils/date.ts)', () => {
describe('showTime parameter', () => {
it('should include time for weekday format when showTime is true', () => {
// June 12 (2 days ago) - should show "Thursday at {time}"
- const twoDaysAgo = epochTime('2025-06-12T15:30:00.000Z');
+ const twoDaysAgo: Date = new Date('2025-06-12T15:30:00.000Z');
expect(
formatDate(twoDaysAgo, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: true,
})
).toBe('Thursday at 3:30 PM');
@@ -148,11 +141,9 @@ describe('Date Utilities (core/utils/date.ts)', () => {
it('should not include time for weekday format when showTime is false', () => {
// June 12 (2 days ago) - should show only "Thursday"
- const twoDaysAgo = epochTime('2025-06-12T15:30:00.000Z');
+ const twoDaysAgo: Date = new Date('2025-06-12T15:30:00.000Z');
expect(
formatDate(twoDaysAgo, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: false,
})
).toBe('Thursday');
@@ -160,11 +151,9 @@ describe('Date Utilities (core/utils/date.ts)', () => {
it('should not include time for weekday format when showTime is undefined', () => {
// June 12 (2 days ago) - should show only "Thursday" (default behavior)
- const twoDaysAgo = epochTime('2025-06-12T15:30:00.000Z');
+ const twoDaysAgo: Date = new Date('2025-06-12T15:30:00.000Z');
expect(
formatDate(twoDaysAgo, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: undefined,
})
).toBe('Thursday');
@@ -172,11 +161,9 @@ describe('Date Utilities (core/utils/date.ts)', () => {
it('should include time for date format when showTime is true', () => {
// June 1, 2025 (13 days ago) - should show date with time
- const oldDate = epochTime('2025-06-01T16:45:00.000Z');
+ const oldDate: Date = new Date('2025-06-01T16:45:00.000Z');
expect(
formatDate(oldDate, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: true,
})
).toBe('06/01/25 at 4:45 PM');
@@ -184,11 +171,9 @@ describe('Date Utilities (core/utils/date.ts)', () => {
it('should not include time for date format when showTime is false', () => {
// June 1, 2025 (13 days ago) - should show only date
- const oldDate = epochTime('2025-06-01T16:45:00.000Z');
+ const oldDate: Date = new Date('2025-06-01T16:45:00.000Z');
expect(
formatDate(oldDate, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: false,
})
).toBe('06/01/25');
@@ -196,11 +181,9 @@ describe('Date Utilities (core/utils/date.ts)', () => {
it('should not include time for date format when showTime is undefined', () => {
// June 1, 2025 (13 days ago) - should show only date (default behavior)
- const oldDate = epochTime('2025-06-01T16:45:00.000Z');
+ const oldDate: Date = new Date('2025-06-01T16:45:00.000Z');
expect(
formatDate(oldDate, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: undefined,
})
).toBe('06/01/25');
@@ -208,18 +191,14 @@ describe('Date Utilities (core/utils/date.ts)', () => {
it('should not affect "today" format regardless of showTime (already shows time)', () => {
// Today at 8:15 AM UTC
- const todayMorning = epochTime('2025-06-14T08:15:00.000Z');
+ const todayMorning: Date = new Date('2025-06-14T08:15:00.000Z');
expect(
formatDate(todayMorning, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: true,
})
).toBe('8:15 AM');
expect(
formatDate(todayMorning, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: false,
})
).toBe('8:15 AM');
@@ -227,18 +206,14 @@ describe('Date Utilities (core/utils/date.ts)', () => {
it('should not affect "yesterday" format regardless of showTime (already shows time)', () => {
// Yesterday at 11:00 PM UTC (June 13)
- const yesterdayEvening = epochTime('2025-06-13T23:00:00.000Z');
+ const yesterdayEvening: Date = new Date('2025-06-13T23:00:00.000Z');
expect(
formatDate(yesterdayEvening, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: true,
})
).toBe('Yesterday at 11:00 PM');
expect(
formatDate(yesterdayEvening, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: false,
})
).toBe('Yesterday at 11:00 PM');
@@ -246,11 +221,10 @@ describe('Date Utilities (core/utils/date.ts)', () => {
it('should handle showTime with timezone-aware formatting', () => {
// June 12, 2025 at 11:30 PM Eastern (3:30 AM UTC June 13)
- const testDate = epochTime('2025-06-13T03:30:00.000Z');
+ const testDate: Date = new Date('2025-06-13T03:30:00.000Z');
expect(
formatDate(testDate, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'America/New_York',
+ timeZone: NEW_YORK_TZ,
showTime: true,
})
).toBe('Thursday at 11:30 PM');
@@ -258,22 +232,215 @@ describe('Date Utilities (core/utils/date.ts)', () => {
it('should handle showTime for dates at the 7-day boundary', () => {
// Exactly 7 days ago - should use date format
- const sevenDaysAgo = epochTime('2025-06-07T14:15:00.000Z');
+ const sevenDaysAgo: Date = new Date('2025-06-07T14:15:00.000Z');
expect(
formatDate(sevenDaysAgo, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: true,
})
).toBe('06/07/25 at 2:15 PM');
expect(
formatDate(sevenDaysAgo, {
- epochNow: mockNowEpochSeconds,
- timeZone: 'UTC',
showTime: false,
})
).toBe('06/07/25');
});
});
});
+
+ describe('compareDateDesc', () => {
+ it('should sort more recent dates first (descending)', () => {
+ const older = new Date('2025-01-01T00:00:00.000Z');
+ const newer = new Date('2025-12-31T23:59:59.000Z');
+
+ expect(compareDateDesc(newer, older)).toBeLessThan(0);
+ expect(compareDateDesc(older, newer)).toBeGreaterThan(0);
+ });
+
+ it('should return 0 for equal dates', () => {
+ const date1 = new Date('2025-06-15T12:00:00.000Z');
+ const date2 = new Date('2025-06-15T12:00:00.000Z');
+
+ expect(compareDateDesc(date1, date2)).toBe(0);
+ });
+
+ it('should treat null as epoch zero and sort after real dates', () => {
+ const realDate = new Date('2025-06-15T12:00:00.000Z');
+
+ expect(compareDateDesc(realDate, null)).toBeLessThan(0);
+ expect(compareDateDesc(null, realDate)).toBeGreaterThan(0);
+ });
+
+ it('should treat undefined as epoch zero and sort after real dates', () => {
+ const realDate = new Date('2025-06-15T12:00:00.000Z');
+
+ expect(compareDateDesc(realDate, undefined)).toBeLessThan(0);
+ expect(compareDateDesc(undefined, realDate)).toBeGreaterThan(0);
+ });
+
+ it('should return 0 when both dates are null', () => {
+ expect(compareDateDesc(null, null)).toBe(0);
+ });
+
+ it('should return 0 when both dates are undefined', () => {
+ expect(compareDateDesc(undefined, undefined)).toBe(0);
+ });
+
+ it('should return 0 when one is null and other is undefined', () => {
+ expect(compareDateDesc(null, undefined)).toBe(0);
+ expect(compareDateDesc(undefined, null)).toBe(0);
+ });
+
+ it('should work correctly in array sort (descending)', () => {
+ const dates = [
+ new Date('2025-03-15T00:00:00.000Z'),
+ new Date('2025-01-01T00:00:00.000Z'),
+ new Date('2025-12-31T00:00:00.000Z'),
+ ];
+
+ const sorted = [...dates].sort(compareDateDesc);
+
+ expect(sorted[0]).toEqual(new Date('2025-12-31T00:00:00.000Z'));
+ expect(sorted[1]).toEqual(new Date('2025-03-15T00:00:00.000Z'));
+ expect(sorted[2]).toEqual(new Date('2025-01-01T00:00:00.000Z'));
+ });
+
+ it('should work with ISO string inputs', () => {
+ const older = '2025-01-01T00:00:00.000Z';
+ const newer = '2025-12-31T23:59:59.000Z';
+
+ expect(compareDateDesc(newer, older)).toBeLessThan(0);
+ expect(compareDateDesc(older, newer)).toBeGreaterThan(0);
+ });
+
+ it('should work with mixed string and Date inputs', () => {
+ const olderString = '2025-01-01T00:00:00.000Z';
+ const newerDate = new Date('2025-12-31T23:59:59.000Z');
+
+ expect(compareDateDesc(newerDate, olderString)).toBeLessThan(0);
+ expect(compareDateDesc(olderString, newerDate)).toBeGreaterThan(0);
+ });
+ });
+
+ describe('compareDateAsc', () => {
+ it('should sort older dates first (ascending)', () => {
+ const older = new Date('2025-01-01T00:00:00.000Z');
+ const newer = new Date('2025-12-31T23:59:59.000Z');
+
+ expect(compareDateAsc(older, newer)).toBeLessThan(0);
+ expect(compareDateAsc(newer, older)).toBeGreaterThan(0);
+ });
+
+ it('should return 0 for equal dates', () => {
+ const date1 = new Date('2025-06-15T12:00:00.000Z');
+ const date2 = new Date('2025-06-15T12:00:00.000Z');
+
+ expect(compareDateAsc(date1, date2)).toBe(0);
+ });
+
+ it('should treat null as epoch zero and sort before real dates', () => {
+ const realDate = new Date('2025-06-15T12:00:00.000Z');
+
+ expect(compareDateAsc(null, realDate)).toBeLessThan(0);
+ expect(compareDateAsc(realDate, null)).toBeGreaterThan(0);
+ });
+
+ it('should treat undefined as epoch zero and sort before real dates', () => {
+ const realDate = new Date('2025-06-15T12:00:00.000Z');
+
+ expect(compareDateAsc(undefined, realDate)).toBeLessThan(0);
+ expect(compareDateAsc(realDate, undefined)).toBeGreaterThan(0);
+ });
+
+ it('should return 0 when both dates are null', () => {
+ expect(compareDateAsc(null, null)).toBe(0);
+ });
+
+ it('should return 0 when both dates are undefined', () => {
+ expect(compareDateAsc(undefined, undefined)).toBe(0);
+ });
+
+ it('should return 0 when one is null and other is undefined', () => {
+ expect(compareDateAsc(null, undefined)).toBe(0);
+ expect(compareDateAsc(undefined, null)).toBe(0);
+ });
+
+ it('should work with ISO string inputs', () => {
+ const older = '2025-01-01T00:00:00.000Z';
+ const newer = '2025-12-31T23:59:59.000Z';
+
+ expect(compareDateAsc(older, newer)).toBeLessThan(0);
+ expect(compareDateAsc(newer, older)).toBeGreaterThan(0);
+ });
+ });
+
+ describe('date-fns max with RFC 3339 strings', () => {
+ it('should correctly pick the latest of RFC 3339 strings', () => {
+ const earlier = '2025-06-10T08:00:00Z';
+ const later = '2025-06-14T12:00:00Z';
+
+ const result = max([earlier, later]);
+ expect(result).toEqual(new Date(later));
+ });
+
+ it('should correctly pick the latest when strings differ only by time', () => {
+ const earlier = '2025-06-14T08:00:00Z';
+ const later = '2025-06-14T20:30:00Z';
+
+ const result = max([earlier, later]);
+ expect(result).toEqual(new Date(later));
+ });
+
+ it('should handle a single string', () => {
+ const only = '2025-06-14T12:00:00Z';
+
+ const result = max([only]);
+ expect(result).toEqual(new Date(only));
+ });
+
+ it('should handle multiple strings', () => {
+ const a = '2025-01-01T00:00:00Z';
+ const b = '2025-12-31T23:59:59Z';
+ const c = '2025-06-15T12:00:00Z';
+
+ const result = max([a, b, c]);
+ expect(result).toEqual(new Date(b));
+ });
+ });
+
+ describe('convertIsoString', () => {
+ it('should convert valid ISO date string with Z suffix', () => {
+ const result = convertIsoString('2025-02-11T10:30:00Z');
+ expect(result).toBeInstanceOf(Date);
+ expect(result!.toISOString()).toBe('2025-02-11T10:30:00.000Z');
+ });
+
+ it('should convert valid ISO date string with milliseconds', () => {
+ const result = convertIsoString('2025-02-11T10:30:00.123Z');
+ expect(result).toBeInstanceOf(Date);
+ expect(result!.toISOString()).toBe('2025-02-11T10:30:00.123Z');
+ });
+
+ it('should convert valid ISO date string without Z suffix', () => {
+ const result = convertIsoString('2025-02-11T10:30:00');
+ expect(result).toBeInstanceOf(Date);
+ });
+
+ it('should return undefined for non-ISO string', () => {
+ expect(convertIsoString('hello world')).toBeUndefined();
+ });
+
+ it('should return undefined for date-only string', () => {
+ expect(convertIsoString('2025-02-11')).toBeUndefined();
+ });
+
+ it('should return undefined for empty string', () => {
+ expect(convertIsoString('')).toBeUndefined();
+ });
+
+ it('should return Date with NaN time for impossible date values', () => {
+ const result = convertIsoString('2025-13-32T10:30:00Z');
+ expect(result).toBeInstanceOf(Date);
+ expect(result!.getTime()).toBe(NaN);
+ });
+ });
});
diff --git a/js/app/packages/core/user/types.ts b/js/app/packages/core/user/types.ts
index ef88d77b3c..41f840af14 100644
--- a/js/app/packages/core/user/types.ts
+++ b/js/app/packages/core/user/types.ts
@@ -1,3 +1,4 @@
+import type { DateValue } from '@core/util/date';
import type { Accessor } from 'solid-js';
export type { ChannelWithParticipants } from '@service-comms/generated/models';
@@ -9,15 +10,11 @@ export interface IOrganizationUser {
is_it_admin: boolean;
}
-/** Timestamp of last interaction with the user (in milliseconds to match server timestamps) */
-export type LastInteractionTimestamp = number;
-
export type IUser = {
id: string;
email: string;
name: string;
- /** timestamp of last interaction with the user (in milliseconds to match server timestamps) */
- lastInteraction?: LastInteractionTimestamp;
+ lastInteraction?: DateValue;
};
type BaseUserName = {
diff --git a/js/app/packages/core/user/util.ts b/js/app/packages/core/user/util.ts
index 810e9664a2..a2d002da9e 100644
--- a/js/app/packages/core/user/util.ts
+++ b/js/app/packages/core/user/util.ts
@@ -1,4 +1,3 @@
-import type { ChannelParticipant } from '@service-comms/generated/models';
import { useDisplayName } from './displayName';
import {
emailToMacroId,
@@ -33,7 +32,9 @@ export function idToDisplayName(id: string): string {
return displayName();
}
-export function channelParticipantInfo(participant: ChannelParticipant): IUser {
+export function channelParticipantInfo(participant: {
+ user_id: string;
+}): IUser {
const id = participant.user_id;
return {
id,
diff --git a/js/app/packages/core/util/date.ts b/js/app/packages/core/util/date.ts
index b21ff8f790..85388fd9fe 100644
--- a/js/app/packages/core/util/date.ts
+++ b/js/app/packages/core/util/date.ts
@@ -1,6 +1,19 @@
+import { tz } from '@date-fns/tz';
+import {
+ compareAsc,
+ compareDesc,
+ differenceInWeeks,
+ isToday,
+ isYesterday,
+ toDate,
+} from 'date-fns';
+
+/** Represents a Date or an Api RFC3339 string response that can be parsed into a Date object. */
+export type DateValue = Date | string;
+
+const EPOCH_ZERO = new Date(0);
+
export interface FormatDateOptions {
- /** Unix timestamp in seconds. An optional reference date. */
- epochNow?: number;
/** IANA timezone string (e.g., 'America/New_York', 'UTC'). Defaults to system timezone. */
timeZone?: string;
/** If true, always include time in the output (e.g., 'Thursday at 4:53 PM' instead of 'Thursday'). */
@@ -8,107 +21,66 @@ export interface FormatDateOptions {
}
/**
- * Formats epoch date (unix timestamp seconds) to a human readable date.
- * @param epochDate - Unix timestamp in seconds. The date to format.
+ * Formats a date to a human readable string.
+ * @param date - Date object or Unix timestamp in seconds
* @param options - Optional formatting options.
* @returns Formatted date string. Like '4:53 PM' for same local day or, 'Yesterday at 8:10 AM' for
* single day offsets, 'Thursday' for a day within the week and '01/23/2025' for dates outside the week.
*/
-export const formatDate = (epochDate: number, options?: FormatDateOptions) => {
- const { epochNow, timeZone, showTime } = options ?? {};
- // handle computation in different timezones
- const getDatePartsInTimezone = (date: Date, tz?: string) => {
- if (tz) {
- const formatter = new Intl.DateTimeFormat('en-US', {
- timeZone: tz,
- year: 'numeric',
- month: 'numeric',
- day: 'numeric',
- });
- const parts = formatter.formatToParts(date);
- const year = parseInt(
- parts.find((p) => p.type === 'year')?.value || '1970'
- );
- const month = Math.max(
- 0,
- parseInt(parts.find((p) => p.type === 'month')?.value || '1') - 1
- );
- const day = Math.max(
- 1,
- parseInt(parts.find((p) => p.type === 'day')?.value || '1')
- );
- return { year, month, day };
- } else {
- return {
- year: date.getFullYear(),
- month: date.getMonth(),
- day: date.getDate(),
- };
- }
- };
-
- const now = epochNow ? new Date(epochNow * 1000) : new Date();
- const inputDate = new Date(epochDate * 1000);
+export const formatDate = (
+ date: DateValue | null | undefined,
+ options?: FormatDateOptions
+) => {
+ if (!date) return '';
+ const d = date instanceof Date ? date : toDate(date);
+ const { timeZone, showTime } = options ?? {};
+ const timeZoneOpts = timeZone ? { in: tz(timeZone) } : {};
+ const now = new Date();
- // calculate a midnight aware day boundary
- const nowParts = getDatePartsInTimezone(now, timeZone);
- const inputParts = getDatePartsInTimezone(inputDate, timeZone);
-
- const today = new Date(nowParts.year, nowParts.month, nowParts.day);
- const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);
- const inputDateStart = new Date(
- inputParts.year,
- inputParts.month,
- inputParts.day
- );
-
- const time = inputDate.toLocaleTimeString('en-US', {
+ const time = d.toLocaleTimeString('en-US', {
hour: 'numeric',
minute: '2-digit',
hour12: true,
timeZone,
});
- if (inputDateStart.getTime() === today.getTime()) {
+ if (isToday(date, timeZoneOpts)) {
return time;
}
- if (inputDateStart.getTime() === yesterday.getTime()) {
+ if (isYesterday(date, timeZoneOpts)) {
return `Yesterday at ${time}`;
}
- const diffMs = now.getTime() - inputDate.getTime();
- const days = Math.floor(diffMs / (1000 * 60 * 60 * 24));
- if (days < 7) {
- const weekday = inputDate.toLocaleDateString(undefined, {
+ if (differenceInWeeks(now, date) < 1) {
+ const weekday = d.toLocaleDateString(undefined, {
weekday: 'long',
timeZone,
});
return showTime ? `${weekday} at ${time}` : weekday;
}
- const date = inputDate.toLocaleDateString(undefined, {
+ const displayDate = d.toLocaleDateString(undefined, {
month: '2-digit',
day: '2-digit',
year: '2-digit',
timeZone,
});
- return showTime ? `${date} at ${time}` : date;
+ return showTime ? `${displayDate} at ${time}` : displayDate;
};
/**
* Formats a date in the format "Fri, Jul 4, 2025 at 12:20 AM"
- * @param epochDate - Unix timestamp in seconds
+ * @param date - Date object or Unix timestamp in seconds
* @returns Formatted date string
*/
-export const formatEmailDate = (epochDate: number) => {
- const inputDate = new Date(epochDate * 1000);
-
- const weekday = inputDate.toLocaleDateString('en-US', { weekday: 'short' });
- const month = inputDate.toLocaleDateString('en-US', { month: 'short' });
- const day = inputDate.getDate();
- const year = inputDate.getFullYear();
- const time = inputDate.toLocaleTimeString('en-US', {
+export const formatEmailDate = (date: DateValue) => {
+ const d = toDate(date);
+ const weekday = d.toLocaleDateString('en-US', { weekday: 'short' });
+ const month = d.toLocaleDateString('en-US', { month: 'short' });
+ const day = d.getDate();
+ const year = d.getFullYear();
+ const time = d.toLocaleTimeString('en-US', {
hour: 'numeric',
minute: '2-digit',
hour12: true,
@@ -118,10 +90,38 @@ export const formatEmailDate = (epochDate: number) => {
};
/**
- * Converts an ISO 8601 date string to Unix timestamp in seconds
- * @param isoString - ISO 8601 date string (e.g., "2025-08-18T18:07:54.000Z")
- * @returns Unix timestamp in seconds
+ * Compares two dates in descending order (most recent first).
+ * Handles undefined/null dates by treating them as epoch zero.
+ * @returns Positive if a > b, negative if a < b, zero if equal
*/
-export const isoToUnixTimestamp = (isoString: string): number => {
- return Math.floor(new Date(isoString).getTime() / 1000);
+export const compareDateDesc = (
+ a: DateValue | null | undefined,
+ b: DateValue | null | undefined
+): number => {
+ const dateA = a ?? EPOCH_ZERO;
+ const dateB = b ?? EPOCH_ZERO;
+ return compareDesc(dateA, dateB);
+};
+
+/**
+ * Compares two dates in ascending order (oldest first).
+ * Handles undefined/null dates by treating them as epoch zero.
+ * @returns Positive if a > b, negative if a < b, zero if equal
+ */
+export const compareDateAsc = (
+ a: DateValue | null | undefined,
+ b: DateValue | null | undefined
+): number => {
+ const dateA = a ?? EPOCH_ZERO;
+ const dateB = b ?? EPOCH_ZERO;
+ return compareAsc(dateA, dateB);
+};
+
+const ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z?$/;
+
+export const convertIsoString = (isoString: string): Date | undefined => {
+ if (ISO_DATE_REGEX.test(isoString)) {
+ return new Date(isoString);
+ }
+ return undefined;
};
diff --git a/js/app/packages/core/util/dateSearch/dateParser.test.ts b/js/app/packages/core/util/dateSearch/dateParser.test.ts
index 8a95226777..3a612f1a91 100644
--- a/js/app/packages/core/util/dateSearch/dateParser.test.ts
+++ b/js/app/packages/core/util/dateSearch/dateParser.test.ts
@@ -14,6 +14,7 @@ import {
formatDuration,
parseDateFromDuration,
parseDurationString,
+ parsedDurationToMilliseconds,
type ParsedDuration,
} from './dateParser';
@@ -63,6 +64,13 @@ describe('parseDurationString', () => {
expect(parseDurationString('0.5s')).toEqual({ value: 0.5, unit: 's' });
});
+ it('should parse milliseconds correctly', () => {
+ expect(parseDurationString('1ms')).toEqual({ value: 1, unit: 'ms' });
+ expect(parseDurationString('100ms')).toEqual({ value: 100, unit: 'ms' });
+ expect(parseDurationString('1000ms')).toEqual({ value: 1000, unit: 'ms' });
+ expect(parseDurationString('500ms')).toEqual({ value: 500, unit: 'ms' });
+ });
+
it('should handle whitespace', () => {
expect(parseDurationString(' 3d ')).toEqual({ value: 3, unit: 'd' });
expect(parseDurationString('3 d')).toEqual({ value: 3, unit: 'd' });
@@ -75,6 +83,7 @@ describe('parseDurationString', () => {
expect(parseDurationString('2H')).toEqual({ value: 2, unit: 'h' });
expect(parseDurationString('30MIN')).toEqual({ value: 30, unit: 'min' });
expect(parseDurationString('30S')).toEqual({ value: 30, unit: 's' });
+ expect(parseDurationString('100MS')).toEqual({ value: 100, unit: 'ms' });
});
it('should return null for invalid input', () => {
@@ -88,6 +97,115 @@ describe('parseDurationString', () => {
});
});
+describe('parsedDurationToMilliseconds', () => {
+ it('should convert milliseconds correctly', () => {
+ expect(parsedDurationToMilliseconds({ value: 1, unit: 'ms' })).toBe(1);
+ expect(parsedDurationToMilliseconds({ value: 100, unit: 'ms' })).toBe(100);
+ expect(parsedDurationToMilliseconds({ value: 1000, unit: 'ms' })).toBe(
+ 1000
+ );
+ });
+
+ it('should convert seconds correctly', () => {
+ expect(parsedDurationToMilliseconds({ value: 1, unit: 's' })).toBe(1000);
+ expect(parsedDurationToMilliseconds({ value: 30, unit: 's' })).toBe(30000);
+ expect(parsedDurationToMilliseconds({ value: 60, unit: 's' })).toBe(60000);
+ });
+
+ it('should convert minutes correctly', () => {
+ expect(parsedDurationToMilliseconds({ value: 1, unit: 'min' })).toBe(
+ 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 30, unit: 'min' })).toBe(
+ 30 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 90, unit: 'min' })).toBe(
+ 90 * 60 * 1000
+ );
+ });
+
+ it('should convert hours correctly', () => {
+ expect(parsedDurationToMilliseconds({ value: 1, unit: 'h' })).toBe(
+ 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 24, unit: 'h' })).toBe(
+ 24 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 0.5, unit: 'h' })).toBe(
+ 0.5 * 60 * 60 * 1000
+ );
+ });
+
+ it('should convert days correctly', () => {
+ expect(parsedDurationToMilliseconds({ value: 1, unit: 'd' })).toBe(
+ 24 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 7, unit: 'd' })).toBe(
+ 7 * 24 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 0.5, unit: 'd' })).toBe(
+ 0.5 * 24 * 60 * 60 * 1000
+ );
+ });
+
+ it('should convert weeks correctly', () => {
+ expect(parsedDurationToMilliseconds({ value: 1, unit: 'w' })).toBe(
+ 7 * 24 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 2, unit: 'w' })).toBe(
+ 2 * 7 * 24 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 4, unit: 'w' })).toBe(
+ 4 * 7 * 24 * 60 * 60 * 1000
+ );
+ });
+
+ it('should convert months correctly (approximate)', () => {
+ // Months are approximated as 30 days
+ expect(parsedDurationToMilliseconds({ value: 1, unit: 'm' })).toBe(
+ 30 * 24 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 3, unit: 'm' })).toBe(
+ 3 * 30 * 24 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 12, unit: 'm' })).toBe(
+ 12 * 30 * 24 * 60 * 60 * 1000
+ );
+ });
+
+ it('should convert years correctly (approximate)', () => {
+ // Years are approximated as 365 days
+ expect(parsedDurationToMilliseconds({ value: 1, unit: 'y' })).toBe(
+ 365 * 24 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 2, unit: 'y' })).toBe(
+ 2 * 365 * 24 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 0.5, unit: 'y' })).toBe(
+ 0.5 * 365 * 24 * 60 * 60 * 1000
+ );
+ });
+
+ it('should handle decimal values', () => {
+ expect(parsedDurationToMilliseconds({ value: 1.5, unit: 'h' })).toBe(
+ 1.5 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 2.5, unit: 'd' })).toBe(
+ 2.5 * 24 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 0.1, unit: 's' })).toBe(100);
+ });
+
+ it('should handle large values', () => {
+ expect(parsedDurationToMilliseconds({ value: 1000, unit: 'h' })).toBe(
+ 1000 * 60 * 60 * 1000
+ );
+ expect(parsedDurationToMilliseconds({ value: 365, unit: 'd' })).toBe(
+ 365 * 24 * 60 * 60 * 1000
+ );
+ });
+});
+
describe('applyDurationToDate', () => {
const baseDate = new Date('2024-01-15T10:00:00');
@@ -133,6 +251,13 @@ describe('applyDurationToDate', () => {
expect(result).toEqual(addSeconds(baseDate, 30));
});
+ it('should add milliseconds correctly', () => {
+ const duration: ParsedDuration = { value: 500, unit: 'ms' };
+ const result = applyDurationToDate(baseDate, duration);
+ const expected = new Date(baseDate.getTime() + 500);
+ expect(result).toEqual(expected);
+ });
+
it('should round decimal values', () => {
const duration: ParsedDuration = { value: 1.7, unit: 'h' };
const result = applyDurationToDate(baseDate, duration);
@@ -219,6 +344,7 @@ describe('formatDuration', () => {
expect(formatDuration({ value: 1, unit: 'y' })).toBe('1 year');
expect(formatDuration({ value: 1, unit: 'min' })).toBe('1 minute');
expect(formatDuration({ value: 1, unit: 's' })).toBe('1 second');
+ expect(formatDuration({ value: 1, unit: 'ms' })).toBe('1 millisecond');
});
it('should format plural units correctly', () => {
@@ -229,6 +355,7 @@ describe('formatDuration', () => {
expect(formatDuration({ value: 2, unit: 'y' })).toBe('2 years');
expect(formatDuration({ value: 30, unit: 'min' })).toBe('30 minutes');
expect(formatDuration({ value: 30, unit: 's' })).toBe('30 seconds');
+ expect(formatDuration({ value: 100, unit: 'ms' })).toBe('100 milliseconds');
});
it('should handle decimal values', () => {
diff --git a/js/app/packages/core/util/dateSearch/dateParser.ts b/js/app/packages/core/util/dateSearch/dateParser.ts
index b62a72a354..c74a5fd324 100644
--- a/js/app/packages/core/util/dateSearch/dateParser.ts
+++ b/js/app/packages/core/util/dateSearch/dateParser.ts
@@ -6,17 +6,18 @@ import {
addWeeks,
addYears,
addSeconds,
+ addMilliseconds,
} from 'date-fns';
import { match } from 'ts-pattern';
-export type TimeUnit = 'h' | 'd' | 'w' | 'm' | 'y' | 'min' | 's';
+export type TimeUnit = 'h' | 'd' | 'w' | 'm' | 'y' | 'min' | 's' | 'ms';
export interface ParsedDuration {
value: number;
unit: TimeUnit;
}
-const UNITS = new Set<TimeUnit>(['h', 'd', 'w', 'm', 'y', 'min', 's']);
+const UNITS = new Set<TimeUnit>(['h', 'd', 'w', 'm', 'y', 'min', 's', 'ms']);
/**
* Parses a duration string like "3d", "1w", "36h", "2m", "1y", "30min"
@@ -40,6 +41,25 @@ export function parseDurationString(input: string): ParsedDuration | null {
return { value, unit: unitPart };
}
+/**
+ * Converts a parsed duration to milliseconds
+ */
+export function parsedDurationToMilliseconds(duration: ParsedDuration): number {
+ const value = duration.value;
+ const unit = duration.unit;
+
+ return match(unit)
+ .with('ms', () => value)
+ .with('s', () => value * 1000)
+ .with('min', () => value * 60 * 1000)
+ .with('h', () => value * 60 * 60 * 1000)
+ .with('d', () => value * 24 * 60 * 60 * 1000)
+ .with('w', () => value * 7 * 24 * 60 * 60 * 1000)
+ .with('m', () => value * 30 * 24 * 60 * 60 * 1000) // Approximate: 30 days
+ .with('y', () => value * 365 * 24 * 60 * 60 * 1000) // Approximate: 365 days
+ .otherwise(() => 0);
+}
+
/**
* Converts a parsed duration to a Date object relative to a base date
*/
@@ -51,6 +71,7 @@ export function applyDurationToDate(
const unit = duration.unit;
return match(unit)
+ .with('ms', () => addMilliseconds(baseDate, value))
.with('s', () => addSeconds(baseDate, value))
.with('min', () => addMinutes(baseDate, value))
.with('h', () => addHours(baseDate, value))
@@ -103,6 +124,7 @@ export function formatDuration(duration: ParsedDuration): string {
const { value, unit } = duration;
const unitLabels: Record<TimeUnit, string> = {
+ ms: value === 1 ? 'millisecond' : 'milliseconds',
s: value === 1 ? 'second' : 'seconds',
min: value === 1 ? 'minute' : 'minutes',
h: value === 1 ? 'hour' : 'hours',
diff --git a/js/app/packages/core/util/freshSort.test.ts b/js/app/packages/core/util/freshSort.test.ts
index 878afba656..56c549f0ba 100644
--- a/js/app/packages/core/util/freshSort.test.ts
+++ b/js/app/packages/core/util/freshSort.test.ts
@@ -1,15 +1,14 @@
import { describe, expect, it } from 'vitest';
import { createFreshSearch, normalizeFuzzyScore } from './freshSort';
-import type { LastInteractionTimestamp } from '@core/user/types';
import { applyDurationToDate } from './dateSearch/dateParser';
interface MockItem {
id: string;
name: string;
type: 'item' | 'channel';
- viewedAt?: number;
- updatedAt?: number;
- lastInteraction?: LastInteractionTimestamp;
+ viewedAt?: Date;
+ updatedAt?: Date;
+ lastInteraction?: Date;
}
interface User extends MockItem {
@@ -38,7 +37,7 @@ describe('freshSort ordering', () => {
id: '1',
name: 'Meeting Notes',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 'h' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 'h' }),
},
{
id: '2',
@@ -47,13 +46,13 @@ describe('freshSort ordering', () => {
viewedAt: applyDurationToDate(now, {
value: -1,
unit: 'min',
- }).getTime(),
+ }),
},
{
id: '3',
name: 'Old Draft',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 'd' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 'd' }),
},
];
@@ -73,7 +72,7 @@ describe('freshSort ordering', () => {
viewedAt: applyDurationToDate(now, {
value: -1,
unit: 'min',
- }).getTime(),
+ }),
},
{
id: '2',
@@ -82,7 +81,7 @@ describe('freshSort ordering', () => {
viewedAt: applyDurationToDate(now, {
value: -5,
unit: 'min',
- }).getTime(),
+ }),
},
];
@@ -99,7 +98,7 @@ describe('freshSort ordering', () => {
id: '1',
name: 'Doc A',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 'h' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 'h' }),
},
{
id: '2',
@@ -108,13 +107,13 @@ describe('freshSort ordering', () => {
viewedAt: applyDurationToDate(now, {
value: -1,
unit: 'min',
- }).getTime(),
+ }),
},
{
id: '3',
name: 'Doc C',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 'd' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 'd' }),
},
];
@@ -140,7 +139,7 @@ describe('createFreshSearch with comma-separated channel matching', () => {
}
it('matches channel with comma-separated query', () => {
- const now = Date.now();
+ const now = new Date();
const items: MockItem[] = [
{ id: '1', name: 'Nick Noble,teo,hutch', type: 'channel', viewedAt: now },
{ id: '2', name: 'Alice,Bob', type: 'channel', viewedAt: now },
@@ -154,7 +153,7 @@ describe('createFreshSearch with comma-separated channel matching', () => {
});
it('matches channel regardless of query order', () => {
- const now = Date.now();
+ const now = new Date();
const items: MockItem[] = [
{ id: '1', name: 'Nick Noble,teo,hutch', type: 'channel', viewedAt: now },
];
@@ -167,7 +166,7 @@ describe('createFreshSearch with comma-separated channel matching', () => {
});
it('uses regular fuzzy search when query has no commas', () => {
- const now = Date.now();
+ const now = new Date();
const items: MockItem[] = [
{ id: '1', name: 'Nick Noble,teo,hutch', type: 'channel', viewedAt: now },
{ id: '2', name: 'Design Doc', type: 'item', viewedAt: now },
@@ -181,7 +180,7 @@ describe('createFreshSearch with comma-separated channel matching', () => {
});
it('still matches non-channel items with comma queries', () => {
- const now = Date.now();
+ const now = new Date();
const items: MockItem[] = [
{ id: '1', name: 'Nick Noble,teo,hutch', type: 'channel', viewedAt: now },
{
@@ -200,7 +199,7 @@ describe('createFreshSearch with comma-separated channel matching', () => {
});
it('matches channel with space-separated query in any order', () => {
- const now = Date.now();
+ const now = new Date();
const items: MockItem[] = [
{
id: '1',
@@ -267,7 +266,7 @@ describe('freshSort with all exact matches', () => {
id: '1',
name: 'Design',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 'h' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 'h' }),
},
{
id: '2',
@@ -276,15 +275,15 @@ describe('freshSort with all exact matches', () => {
viewedAt: applyDurationToDate(now, {
value: -1,
unit: 'min',
- }).getTime(),
+ }),
},
{
id: '3',
name: 'Design',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 'd' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 'd' }),
},
- { id: '4', name: 'Design', type: 'item', viewedAt: now.getTime() },
+ { id: '4', name: 'Design', type: 'item', viewedAt: now },
];
const search = createFreshSearch<MockItem>(
@@ -319,13 +318,13 @@ describe('freshSort with all exact matches', () => {
id: '1',
name: 'Design',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }),
},
{
id: '2',
name: 'Design',
type: 'channel',
- viewedAt: applyDurationToDate(now, { value: -5, unit: 's' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -5, unit: 's' }),
},
];
@@ -361,21 +360,21 @@ describe('boostFn functionality', () => {
name: 'Alice Johnson',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }),
},
{
id: '2',
name: 'Bob Smith',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -5, unit: 's' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -5, unit: 's' }),
},
{
id: '3',
name: 'Charlie Brown',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -3, unit: 's' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -3, unit: 's' }),
},
];
@@ -408,14 +407,14 @@ describe('boostFn functionality', () => {
name: 'Alice Johnson',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }),
},
{
id: '2',
name: 'Alicia Smith',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }),
},
];
@@ -451,7 +450,7 @@ describe('boostFn functionality', () => {
viewedAt: applyDurationToDate(now, {
value: -1,
unit: 'min',
- }).getTime(),
+ }),
},
{
id: '2',
@@ -460,7 +459,7 @@ describe('boostFn functionality', () => {
viewedAt: applyDurationToDate(now, {
value: -2,
unit: 'min',
- }).getTime(),
+ }),
},
];
@@ -489,14 +488,14 @@ describe('boostFn functionality', () => {
name: 'Design Doc',
type: 'item',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }),
},
{
id: '2',
name: 'Design Channel',
type: 'channel',
- viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }).getTime(),
+ viewedAt: applyDurationToDate(now, { value: -1, unit: 's' }),
},
];
@@ -531,7 +530,7 @@ describe('boostFn functionality', () => {
viewedAt: applyDurationToDate(now, {
value: -1,
unit: 'min',
- }).getTime(),
+ }),
},
{
id: '2',
@@ -540,7 +539,7 @@ describe('boostFn functionality', () => {
viewedAt: applyDurationToDate(now, {
value: -2,
unit: 'min',
- }).getTime(),
+ }),
},
];
@@ -574,7 +573,7 @@ describe('DM activity timestamps for user ranking', () => {
lastInteraction: applyDurationToDate(now, {
value: -1,
unit: 'd',
- }).getTime(),
+ }),
},
{
id: '2',
@@ -584,7 +583,7 @@ describe('DM activity timestamps for user ranking', () => {
lastInteraction: applyDurationToDate(now, {
value: -1,
unit: 'h',
- }).getTime(),
+ }),
},
{
id: '3',
@@ -627,7 +626,7 @@ describe('DM activity timestamps for user ranking', () => {
lastInteraction: applyDurationToDate(now, {
value: -1,
unit: 'd',
- }).getTime(),
+ }),
},
{
id: '2',
@@ -637,7 +636,7 @@ describe('DM activity timestamps for user ranking', () => {
lastInteraction: applyDurationToDate(now, {
value: -1,
unit: 'h',
- }).getTime(),
+ }),
},
{
id: '3',
@@ -647,7 +646,7 @@ describe('DM activity timestamps for user ranking', () => {
lastInteraction: applyDurationToDate(now, {
value: -1,
unit: 'min',
- }).getTime(),
+ }),
},
];
diff --git a/js/app/packages/core/util/freshSort.ts b/js/app/packages/core/util/freshSort.ts
index 93ea1396a9..a953c8e56a 100644
--- a/js/app/packages/core/util/freshSort.ts
+++ b/js/app/packages/core/util/freshSort.ts
@@ -5,8 +5,13 @@
import type { Accessor } from 'solid-js';
import type { FilterResult } from 'fuzzy';
import fuzzy from 'fuzzy';
+import { differenceInMilliseconds } from 'date-fns';
+import type { DateValue } from './date';
import { fuzzyScoreCommaSpaceSeparated } from './fuzzy';
-import type { LastInteractionTimestamp } from '@core/user';
+import {
+ type ParsedDuration,
+ parsedDurationToMilliseconds,
+} from './dateSearch/dateParser';
type BoostFn<T> = (item: T) => number;
@@ -27,8 +32,8 @@ export interface FreshSortConfig<T> {
brevityWeight?: number;
/** Time decay factor. Higher values make older items decay faster. Default: 0.5 */
timeDecayFactor?: number;
- /** Maximum age in milliseconds to consider for scoring. Items older than this get minimum time score. Default: 30 days */
- maxAgeMs?: number;
+ /** Maximum age to consider for scoring. Items older than this get minimum time score. Default: 30 days */
+ maxAge?: ParsedDuration;
/** Minimum fuzzy score threshold (0-1). Items below this are heavily penalized. Default: 0.1 */
minFuzzyThreshold?: number;
/** Use viewedAt instead of updatedAt for time scoring. Default: false */
@@ -44,9 +49,9 @@ export interface FreshSortConfig<T> {
type FreshSortConfigWithDefaults = Required<FreshSortConfig<unknown>>;
export interface TimestampedItem {
- updatedAt?: number | string;
- viewedAt?: number | string;
- lastInteraction?: LastInteractionTimestamp | string;
+ updatedAt?: DateValue | null;
+ viewedAt?: DateValue | null;
+ lastInteraction?: DateValue | null;
}
export interface FreshSortResult<T> {
@@ -63,7 +68,7 @@ const DEFAULT_CONFIG = {
timeWeight: 0.3,
brevityWeight: 0.0,
timeDecayFactor: 0.5,
- maxAgeMs: 30 * 24 * 60 * 60 * 1000, // 30 days
+ maxAge: { value: 30, unit: 'd' },
minFuzzyThreshold: 0.1,
useViewedAt: false,
channelBoost: 1.0,
@@ -74,50 +79,30 @@ const DEFAULT_CONFIG = {
function extractTimestamp(
item: TimestampedItem,
useViewedAt: boolean = false
-): number {
- let timestamp: number | string | undefined;
-
+): DateValue | null {
if (useViewedAt) {
- timestamp = item.viewedAt ?? item.updatedAt ?? item.lastInteraction;
- } else {
- timestamp = item.updatedAt ?? item.lastInteraction;
- }
-
- if (timestamp === undefined || timestamp === null) return 0;
-
- if (typeof timestamp === 'number') {
- return timestamp;
- }
-
- if (typeof timestamp === 'string') {
- const isoDate = new Date(timestamp);
- const isoDateTime = isoDate.getTime();
- if (!isNaN(isoDateTime)) {
- return isoDateTime;
- }
-
- const parsed = parseInt(timestamp, 10);
- if (!isNaN(parsed)) {
- return parsed;
- }
+ return item.viewedAt ?? item.updatedAt ?? item.lastInteraction ?? null;
}
- return 0;
+ return item.updatedAt ?? item.lastInteraction ?? null;
}
function calculateTimeScore(
- timestamp: number,
+ timestamp: DateValue | null,
config: FreshSortConfigWithDefaults
): number {
- const now = Date.now();
- const itemTime = timestamp;
- const age = Math.max(0, now - itemTime);
- if (age >= config.maxAgeMs) {
+ if (!timestamp) return 0;
+
+ const now = new Date();
+ const ageMs = Math.max(0, differenceInMilliseconds(now, timestamp));
+ const maxAgeMs = parsedDurationToMilliseconds(config.maxAge);
+
+ if (ageMs >= maxAgeMs) {
return 0;
}
// exponential decay: e^(-decay * normalizedAge)
- const normalizedAge = age / config.maxAgeMs;
+ const normalizedAge = ageMs / maxAgeMs;
return Math.exp(-config.timeDecayFactor * normalizedAge);
}
diff --git a/js/app/packages/core/util/taskCreation.ts b/js/app/packages/core/util/taskCreation.ts
index a386087200..2796cd0841 100644
--- a/js/app/packages/core/util/taskCreation.ts
+++ b/js/app/packages/core/util/taskCreation.ts
@@ -5,7 +5,7 @@ import { createTask } from './create';
export type TaskData = {
title: string;
assigneeUserIds: string[];
- dueDate: string | null;
+ dueDate: Date | null;
};
export type TaskCreationOptions = {
@@ -42,7 +42,7 @@ function buildPropertyInputs(
if (task.dueDate) {
properties.push({
propertyId: SYSTEM_PROPERTY_IDS.DUE_DATE,
- value: { type: 'date', value: task.dueDate },
+ value: { type: 'date', value: task.dueDate.toISOString() },
});
}
diff --git a/js/app/packages/core/util/taskExtraction.test.ts b/js/app/packages/core/util/taskExtraction.test.ts
index c02ba2c9fd..c2b11206b5 100644
--- a/js/app/packages/core/util/taskExtraction.test.ts
+++ b/js/app/packages/core/util/taskExtraction.test.ts
@@ -144,7 +144,8 @@ Regular bullet point
const result = extractCheckboxesFromMarkdown(markdown);
expect(result).toHaveLength(1);
- expect(result[0].dueDate).toBe('2024-03-15T00:00:00Z');
+ expect(result[0].dueDate).toBeInstanceOf(Date);
+ expect(result[0].dueDate?.toISOString()).toBe('2024-03-15T00:00:00.000Z');
expect(result[0].title).toBe('Submit report');
});
@@ -154,11 +155,10 @@ Regular bullet point
const result = extractCheckboxesFromMarkdown(markdown);
expect(result).toHaveLength(1);
- expect(result[0]).toMatchObject({
- title: 'Complete task by',
- assigneeUserIds: ['u1'],
- dueDate: '2024-12-31',
- });
+ expect(result[0].title).toBe('Complete task by');
+ expect(result[0].assigneeUserIds).toEqual(['u1']);
+ expect(result[0].dueDate).toBeInstanceOf(Date);
+ expect(result[0].dueDate?.toISOString()).toBe('2024-12-31T00:00:00.000Z');
});
it('should return empty array for markdown without checkboxes', () => {
diff --git a/js/app/packages/core/util/taskExtraction.ts b/js/app/packages/core/util/taskExtraction.ts
index e88817407e..11c6ac31bf 100644
--- a/js/app/packages/core/util/taskExtraction.ts
+++ b/js/app/packages/core/util/taskExtraction.ts
@@ -26,7 +26,7 @@ export type PotentialTask = {
/** User IDs extracted from @mentions */
assigneeUserIds: string[];
/** ISO date string from date mention, or null */
- dueDate: string | null;
+ dueDate: Date | null;
/** Whether the checkbox is checked [x] or unchecked [ ] */
isChecked: boolean;
};
diff --git a/js/app/packages/core/util/time.ts b/js/app/packages/core/util/time.ts
index e5743418ab..03b83694e8 100644
--- a/js/app/packages/core/util/time.ts
+++ b/js/app/packages/core/util/time.ts
@@ -1,3 +1,5 @@
+import type { DateValue } from './date';
+
/**
* Formats a date string according to relative time rules, eg:
* - Same day: "Today"
@@ -5,11 +7,11 @@
* - Same year: "Mar 5"
* - Different year: "Mar 5, 1992"
*
- * @param isoString - ISO date string to format
+ * @param value - Date object or ISO date string to format
* @returns Formatted date string
*/
-export function formatRelativeDate(isoString: string): string {
- const date = new Date(isoString);
+export function formatRelativeDate(value: DateValue): string {
+ const date = value instanceof Date ? value : new Date(value);
const now = new Date();
// Same day
@@ -35,10 +37,11 @@ export function formatRelativeDate(isoString: string): string {
/**
* Formats a time string in 12-hour format with am/pm
- * @param date Date object to format
+ * @param value Date object or ISO date string to format
* @returns Time string like "4:26 PM" or "12:30 PM"
*/
-export function formatTime(date: Date): string {
+export function formatTime(value: DateValue): string {
+ const date = value instanceof Date ? value : new Date(value);
return date.toLocaleTimeString('en-US', {
hour: 'numeric',
minute: '2-digit',
diff --git a/js/app/packages/entity/mocks/mockEntityData.ts b/js/app/packages/entity/mocks/mockEntityData.ts
index bab7dcbe68..289e8ee671 100644
--- a/js/app/packages/entity/mocks/mockEntityData.ts
+++ b/js/app/packages/entity/mocks/mockEntityData.ts
@@ -1,4 +1,5 @@
import type { Property } from '@core/component/Properties/types';
+import { applyDurationToDate } from '@core/util/dateSearch/dateParser';
import type {
ChannelEntity,
ChatEntity,
@@ -26,13 +27,14 @@ export const MOCK_USERS = [
{ id: MOCK_USER_IDS.currentUser, firstName: 'Current', lastName: 'User' },
] as const;
+const now = new Date();
export const MOCK_TIMESTAMPS = {
- now: Date.now(),
- today: Date.now() - 1000 * 60 * 30, // 30 minutes ago
- yesterday: Date.now() - 1000 * 60 * 60 * 24, // 1 day ago
- lastWeek: Date.now() - 1000 * 60 * 60 * 24 * 7, // 7 days ago
- lastMonth: Date.now() - 1000 * 60 * 60 * 24 * 30, // 30 days ago
- lastYear: Date.now() - 1000 * 60 * 60 * 24 * 365, // 365 days ago
+ now,
+ today: applyDurationToDate(now, { value: -30, unit: 'min' }),
+ yesterday: applyDurationToDate(now, { value: -1, unit: 'd' }),
+ lastWeek: applyDurationToDate(now, { value: -7, unit: 'd' }),
+ lastMonth: applyDurationToDate(now, { value: -30, unit: 'd' }),
+ lastYear: applyDurationToDate(now, { value: -365, unit: 'd' }),
} as const;
export const MOCK_PROPERTIES: Property[] = [
@@ -47,31 +49,31 @@ export const MOCK_PROPERTIES: Property[] = [
{
id: 'opt_high',
value: { type: 'string', value: 'High' },
- created_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
- updated_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
+ created_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
+ updated_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
property_definition_id: 'def_priority',
display_order: 0,
},
{
id: 'opt_medium',
value: { type: 'string', value: 'Medium' },
- created_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
- updated_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
+ created_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
+ updated_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
property_definition_id: 'def_priority',
display_order: 1,
},
{
id: 'opt_low',
value: { type: 'string', value: 'Low' },
- created_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
- updated_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
+ created_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
+ updated_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
property_definition_id: 'def_priority',
display_order: 2,
},
],
owner: { scope: 'organization', organization_id: 1 },
- createdAt: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
- updatedAt: new Date(MOCK_TIMESTAMPS.today).toISOString(),
+ createdAt: MOCK_TIMESTAMPS.lastMonth,
+ updatedAt: MOCK_TIMESTAMPS.today,
},
{
propertyId: 'prop_status_1',
@@ -84,31 +86,31 @@ export const MOCK_PROPERTIES: Property[] = [
{
id: 'opt_todo',
value: { type: 'string', value: 'To Do' },
- created_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
- updated_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
+ created_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
+ updated_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
property_definition_id: 'def_status',
display_order: 0,
},
{
id: 'opt_in_progress',
value: { type: 'string', value: 'In Progress' },
- created_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
- updated_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
+ created_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
+ updated_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
property_definition_id: 'def_status',
display_order: 1,
},
{
id: 'opt_done',
value: { type: 'string', value: 'Done' },
- created_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
- updated_at: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
+ created_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
+ updated_at: MOCK_TIMESTAMPS.lastMonth.toISOString(),
property_definition_id: 'def_status',
display_order: 2,
},
],
owner: { scope: 'organization', organization_id: 1 },
- createdAt: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
- updatedAt: new Date(MOCK_TIMESTAMPS.today).toISOString(),
+ createdAt: MOCK_TIMESTAMPS.lastMonth,
+ updatedAt: MOCK_TIMESTAMPS.today,
},
{
propertyId: 'prop_due_date_1',
@@ -116,10 +118,10 @@ export const MOCK_PROPERTIES: Property[] = [
displayName: 'Due Date',
isMultiSelect: false,
valueType: 'DATE',
- value: new Date(MOCK_TIMESTAMPS.now + 1000 * 60 * 60 * 24 * 7), // 7 days from now
+ value: applyDurationToDate(MOCK_TIMESTAMPS.now, { value: 7, unit: 'd' }), // 7 days from now
owner: { scope: 'organization', organization_id: 1 },
- createdAt: new Date(MOCK_TIMESTAMPS.lastMonth).toISOString(),
- updatedAt: new Date(MOCK_TIMESTAMPS.today).toISOString(),
+ createdAt: MOCK_TIMESTAMPS.lastMonth,
+ updatedAt: MOCK_TIMESTAMPS.today,
},
];
@@ -133,8 +135,8 @@ export const createMockNotification = (
notificationEventType: 'document_mention',
entity_id: 'doc_123',
entity_type: 'document',
- createdAt: MOCK_TIMESTAMPS.today,
- updatedAt: MOCK_TIMESTAMPS.today,
+ createdAt: MOCK_TIMESTAMPS.today.toISOString(),
+ updatedAt: MOCK_TIMESTAMPS.today.toISOString(),
deletedAt: null,
viewedAt: null,
notificationMetadata: {
@@ -149,19 +151,19 @@ export const MOCK_NOTIFICATIONS: Notification[] = [
id: 'notif_mention_1',
notificationEventType: 'document_mention',
senderId: MOCK_USER_IDS.teamMember1,
- createdAt: MOCK_TIMESTAMPS.today,
+ createdAt: MOCK_TIMESTAMPS.today.toISOString(),
}),
createMockNotification({
id: 'notif_task_1',
notificationEventType: 'task_assigned',
senderId: MOCK_USER_IDS.teamMember2,
- createdAt: MOCK_TIMESTAMPS.yesterday,
+ createdAt: MOCK_TIMESTAMPS.yesterday.toISOString(),
}),
createMockNotification({
id: 'notif_channel_1',
notificationEventType: 'channel_message_send',
senderId: MOCK_USER_IDS.sharedUser,
- createdAt: MOCK_TIMESTAMPS.lastWeek,
+ createdAt: MOCK_TIMESTAMPS.lastWeek.toISOString(),
entity_type: 'channel',
}),
];
@@ -659,8 +661,8 @@ export const MOCK_ENTITY_VERY_OLD: DocumentEntity = {
name: 'Archive Document 2020',
ownerId: MOCK_USER_IDS.owner,
fileType: 'md',
- createdAt: new Date('2020-01-01').getTime(),
- updatedAt: new Date('2020-06-15').getTime(),
+ createdAt: new Date('2020-01-01').toISOString(),
+ updatedAt: new Date('2020-06-15').toISOString(),
frecencyScore: 0.12,
};
diff --git a/js/app/packages/entity/src/composed/ListEntity.tsx b/js/app/packages/entity/src/composed/ListEntity.tsx
index 0f9aa06259..94a54c9e15 100644
--- a/js/app/packages/entity/src/composed/ListEntity.tsx
+++ b/js/app/packages/entity/src/composed/ListEntity.tsx
@@ -1,3 +1,4 @@
+import type { DateValue } from '@core/util/date';
import { Entity } from '../entity';
import {
isChannelEntity,
@@ -35,7 +36,7 @@ import { mergeRefs } from '@solid-primitives/refs';
interface ListEntityProps {
entity: WithNotification<EntityData>;
onClick?: (event: MouseEvent) => void;
- timestamp?: number;
+ timestamp?: DateValue | null;
ref?: Ref<HTMLDivElement>;
checked?: boolean;
highlighted?: boolean;
diff --git a/js/app/packages/entity/src/extractors-property/entity-key-properties.tsx b/js/app/packages/entity/src/extractors-property/entity-key-properties.tsx
index f907f13fbe..ec387f5aac 100644
--- a/js/app/packages/entity/src/extractors-property/entity-key-properties.tsx
+++ b/js/app/packages/entity/src/extractors-property/entity-key-properties.tsx
@@ -104,7 +104,7 @@ export function EntityKeyProperties(props: EntityKeyPropertiesProps) {
property,
apiValues: {
valueType: 'DATE',
- value: date.toISOString(),
+ value: date,
},
}),
};
diff --git a/js/app/packages/entity/src/extractors-property/property-helpers.ts b/js/app/packages/entity/src/extractors-property/property-helpers.ts
index 1be47a32ed..76ff095b2b 100644
--- a/js/app/packages/entity/src/extractors-property/property-helpers.ts
+++ b/js/app/packages/entity/src/extractors-property/property-helpers.ts
@@ -11,6 +11,8 @@ import {
} from '@core/component/Properties/constants';
import { nanoid } from 'nanoid';
+const EPOCH_ZERO = new Date(0);
+
/**
* Sort order for key properties (status, priority, assignees)
*/
@@ -32,40 +34,41 @@ const SYSTEM_PROPERTY_OPTIONS: Record<string, PropertyOption[]> = {
property_definition_id: SYSTEM_PROPERTY_IDS.STATUS,
value: { type: 'string', value: 'Not Started' },
display_order: 0,
- created_at: '',
- updated_at: '',
+ // TODO: need to properly handle dates. does not seem like these are even used/upserted anywhere?
+ created_at: EPOCH_ZERO.toISOString(),
+ updated_at: EPOCH_ZERO.toISOString(),
},
{
id: PROPERTY_OPTION_IDS.STATUS.IN_PROGRESS,
property_definition_id: SYSTEM_PROPERTY_IDS.STATUS,
value: { type: 'string', value: 'In Progress' },
display_order: 1,
- created_at: '',
- updated_at: '',
+ created_at: EPOCH_ZERO.toISOString(),
+ updated_at: EPOCH_ZERO.toISOString(),
},
{
id: PROPERTY_OPTION_IDS.STATUS.IN_REVIEW,
property_definition_id: SYSTEM_PROPERTY_IDS.STATUS,
value: { type: 'string', value: 'In Review' },
display_order: 2,
- created_at: '',
- updated_at: '',
+ created_at: EPOCH_ZERO.toISOString(),
+ updated_at: EPOCH_ZERO.toISOString(),
},
{
id: PROPERTY_OPTION_IDS.STATUS.COMPLETED,
property_definition_id: SYSTEM_PROPERTY_IDS.STATUS,
value: { type: 'string', value: 'Completed' },
display_order: 3,
- created_at: '',
- updated_at: '',
+ created_at: EPOCH_ZERO.toISOString(),
+ updated_at: EPOCH_ZERO.toISOString(),
},
{
id: PROPERTY_OPTION_IDS.STATUS.CANCELED,
property_definition_id: SYSTEM_PROPERTY_IDS.STATUS,
value: { type: 'string', value: 'Canceled' },
display_order: 4,
- created_at: '',
- updated_at: '',
+ created_at: EPOCH_ZERO.toISOString(),
+ updated_at: EPOCH_ZERO.toISOString(),
},
],
[SYSTEM_PROPERTY_IDS.PRIORITY]: [
@@ -74,32 +77,32 @@ const SYSTEM_PROPERTY_OPTIONS: Record<string, PropertyOption[]> = {
property_definition_id: SYSTEM_PROPERTY_IDS.PRIORITY,
value: { type: 'string', value: 'Low' },
display_order: 0,
- created_at: '',
- updated_at: '',
+ created_at: EPOCH_ZERO.toISOString(),
+ updated_at: EPOCH_ZERO.toISOString(),
},
{
id: PROPERTY_OPTION_IDS.PRIORITY.MEDIUM,
property_definition_id: SYSTEM_PROPERTY_IDS.PRIORITY,
value: { type: 'string', value: 'Medium' },
display_order: 1,
- created_at: '',
- updated_at: '',
+ created_at: EPOCH_ZERO.toISOString(),
+ updated_at: EPOCH_ZERO.toISOString(),
},
{
id: PROPERTY_OPTION_IDS.PRIORITY.HIGH,
property_definition_id: SYSTEM_PROPERTY_IDS.PRIORITY,
value: { type: 'string', value: 'High' },
display_order: 2,
- created_at: '',
- updated_at: '',
+ created_at: EPOCH_ZERO.toISOString(),
+ updated_at: EPOCH_ZERO.toISOString(),
},
{
id: PROPERTY_OPTION_IDS.PRIORITY.URGENT,
property_definition_id: SYSTEM_PROPERTY_IDS.PRIORITY,
value: { type: 'string', value: 'Urgent' },
display_order: 3,
- created_at: '',
- updated_at: '',
+ created_at: EPOCH_ZERO.toISOString(),
+ updated_at: EPOCH_ZERO.toISOString(),
},
],
};
diff --git a/js/app/packages/entity/src/extractors-search/search-timestamp.tsx b/js/app/packages/entity/src/extractors-search/search-timestamp.tsx
index 82fb89d9e3..1a99642d5d 100644
--- a/js/app/packages/entity/src/extractors-search/search-timestamp.tsx
+++ b/js/app/packages/entity/src/extractors-search/search-timestamp.tsx
@@ -1,8 +1,5 @@
-import type {
- ContentHitData,
- ChannelContentHitData,
- EmailContentHitData,
-} from '../types/search';
+import type { DateValue } from '@core/util/date';
+import type { ContentHitData } from '../types/search';
import { formatRelativeTimestamp } from '../utils/timestamp';
interface SearchTimestampProps {
@@ -12,12 +9,11 @@ interface SearchTimestampProps {
/**
* Gets timestamp from content hit if available
*/
-function getTimestamp(hit: ContentHitData): number | undefined {
- if (hit.type === 'channel') {
- return (hit as ChannelContentHitData).sentAt;
- }
- if (hit.type === 'email') {
- return (hit as EmailContentHitData).sentAt;
+function getTimestamp(hit: ContentHitData): DateValue | undefined {
+ switch (hit.type) {
+ case 'email':
+ case 'channel':
+ return hit.sentAt;
}
return undefined;
}
diff --git a/js/app/packages/entity/src/extractors/entity-timestamp.tsx b/js/app/packages/entity/src/extractors/entity-timestamp.tsx
index 30c489632c..94c1c5844e 100644
--- a/js/app/packages/entity/src/extractors/entity-timestamp.tsx
+++ b/js/app/packages/entity/src/extractors/entity-timestamp.tsx
@@ -1,11 +1,15 @@
+import type { DateValue } from '@core/util/date';
import type { EntityData } from '../types/entity';
import { formatTimestamp } from '../utils/timestamp';
export function EntityTimestamp(props: {
entity: EntityData;
- overrideTimeStamp?: number;
+ overrideTimeStamp?: DateValue;
}) {
- const timestamp = () =>
- props.overrideTimeStamp ?? props.entity.updatedAt ?? Date.now();
+ const timestamp = () => {
+ if (props.overrideTimeStamp) return props.overrideTimeStamp;
+ if (props.entity.updatedAt) return props.entity.updatedAt;
+ return new Date();
+ };
return <>{formatTimestamp(timestamp())}</>;
}
diff --git a/js/app/packages/entity/src/types/entity.ts b/js/app/packages/entity/src/types/entity.ts
index 37084db05a..6d1645ac01 100644
--- a/js/app/packages/entity/src/types/entity.ts
+++ b/js/app/packages/entity/src/types/entity.ts
@@ -1,4 +1,5 @@
import { isEntityType } from '@core/types/utils';
+import type { DateValue } from '@core/util/date';
import type { ApiLabel } from '@service-email/generated/schemas';
import type {
SoupLabel,
@@ -11,20 +12,20 @@ export type EntityBase = {
name: string;
ownerId: string;
frecencyScore?: number;
- createdAt?: number;
- updatedAt?: number;
- viewedAt?: number;
+ createdAt?: DateValue | null;
+ updatedAt?: DateValue | null;
+ viewedAt?: DateValue | null;
};
export type ChannelEntity = EntityBase & {
type: 'channel';
channelType: 'direct_message' | 'private' | 'organization' | 'public';
- interactedAt?: number;
+ interactedAt?: DateValue | null;
participantIds?: string[];
latestMessage?: {
content: string;
senderId: string;
- createdAt: number;
+ createdAt: DateValue;
};
};
diff --git a/js/app/packages/entity/src/types/notification.ts b/js/app/packages/entity/src/types/notification.ts
index 2653868373..3385812bf6 100644
--- a/js/app/packages/entity/src/types/notification.ts
+++ b/js/app/packages/entity/src/types/notification.ts
@@ -1,4 +1,3 @@
-// Temporarily use the generated types for now
import type { ApiUserNotification } from '@service-notification/generated/schemas/apiUserNotification';
import type { Accessor } from 'solid-js';
diff --git a/js/app/packages/entity/src/types/search.ts b/js/app/packages/entity/src/types/search.ts
index d47672f09d..c8cd08bf82 100644
--- a/js/app/packages/entity/src/types/search.ts
+++ b/js/app/packages/entity/src/types/search.ts
@@ -1,3 +1,4 @@
+import type { DateValue } from '@core/util/date';
import type { EntityData } from './entity';
type MarkdownHighlightLocation = {
@@ -35,7 +36,7 @@ export type ChannelContentHitData = {
id: string;
content: string;
senderId: string;
- sentAt: number;
+ sentAt: DateValue;
location: ChannelMessageHighlightLocation;
};
@@ -62,7 +63,7 @@ export type EmailContentHitData = {
content: string;
sender: string;
senderId: string;
- sentAt: number;
+ sentAt: DateValue;
location: EmailMessageHighlightLocation;
};
diff --git a/js/app/packages/entity/src/utils/timestamp.ts b/js/app/packages/entity/src/utils/timestamp.ts
index a00722924d..1463672e04 100644
--- a/js/app/packages/entity/src/utils/timestamp.ts
+++ b/js/app/packages/entity/src/utils/timestamp.ts
@@ -1,9 +1,9 @@
+import type { DateValue } from '@core/util/date';
import {
format,
isToday,
isYesterday,
isSameYear,
- fromUnixTime,
differenceInMinutes,
differenceInHours,
} from 'date-fns';
@@ -14,9 +14,7 @@ import {
* - Same year: Shows month and day (e.g., "Jan 27")
* - Older: Shows full date (e.g., "1/27/24")
*/
-export function formatTimestamp(timestamp: number): string {
- const date = timestamp < 1e12 ? fromUnixTime(timestamp) : new Date(timestamp);
-
+export function formatTimestamp(date: DateValue): string {
if (isToday(date)) {
return format(date, 'h:mm a');
}
@@ -35,8 +33,7 @@ export function formatTimestamp(timestamp: number): string {
* - Yesterday: "3:45pm yesterday"
* - Older: Shows date (e.g., "Jan 27" or "1/27/24")
*/
-export function formatRelativeTimestamp(timestamp: number): string {
- const date = timestamp < 1e12 ? fromUnixTime(timestamp) : new Date(timestamp);
+export function formatRelativeTimestamp(date: DateValue): string {
const now = new Date();
const minutesAgo = differenceInMinutes(now, date);
diff --git a/js/app/packages/entity/tests/notification.test.ts b/js/app/packages/entity/tests/notification.test.ts
index 6a796a6bc5..3bda0f3e2b 100644
--- a/js/app/packages/entity/tests/notification.test.ts
+++ b/js/app/packages/entity/tests/notification.test.ts
@@ -374,7 +374,7 @@ describe('notification utils', () => {
it('returns false for viewed notification', () => {
const notification = {
- viewedAt: 1234567890,
+ viewedAt: new Date(1234567890).toISOString(),
done: false,
} as Notification;
@@ -392,7 +392,7 @@ describe('notification utils', () => {
it('returns false for viewed and done notification', () => {
const notification = {
- viewedAt: 1234567890,
+ viewedAt: new Date(1234567890).toISOString(),
done: true,
} as Notification;
@@ -404,9 +404,15 @@ describe('notification utils', () => {
it('returns true if any notification in stack is unread', () => {
const stack = {
notifications: [
- { viewedAt: 1234567890, done: false } as Notification,
+ {
+ viewedAt: new Date(1234567890).toISOString(),
+ done: false,
+ } as Notification,
{ viewedAt: null, done: false } as Notification,
- { viewedAt: 1234567890, done: false } as Notification,
+ {
+ viewedAt: new Date(1234567890).toISOString(),
+ done: false,
+ } as Notification,
],
} as any;
@@ -416,8 +422,14 @@ describe('notification utils', () => {
it('returns false if all notifications are viewed', () => {
const stack = {
notifications: [
- { viewedAt: 1234567890, done: false } as Notification,
- { viewedAt: 1234567890, done: false } as Notification,
+ {
+ viewedAt: new Date(1234567890).toISOString(),
+ done: false,
+ } as Notification,
+ {
+ viewedAt: new Date(1234567890).toISOString(),
+ done: false,
+ } as Notification,
],
} as any;
diff --git a/js/app/packages/entity/tests/timestamp.test.ts b/js/app/packages/entity/tests/timestamp.test.ts
index 2e2d5d7625..a0d6079f44 100644
--- a/js/app/packages/entity/tests/timestamp.test.ts
+++ b/js/app/packages/entity/tests/timestamp.test.ts
@@ -3,30 +3,23 @@ import {
formatTimestamp,
formatRelativeTimestamp,
} from '../src/utils/timestamp';
+import { applyDurationToDate } from '@core/util/dateSearch/dateParser';
describe('formatTimestamp', () => {
- describe('timestamp format handling', () => {
- it('handles Unix timestamp (seconds)', () => {
+ describe('Date object handling', () => {
+ it('handles Date object', () => {
// January 1, 2025 at 12:00 PM
- const unixSeconds = 1735732800;
- const result = formatTimestamp(unixSeconds);
+ const date = new Date('2025-01-01T12:00:00.000Z');
+ const result = formatTimestamp(date);
// Should format based on when test runs, but should not throw
expect(typeof result).toBe('string');
expect(result.length).toBeGreaterThan(0);
});
-
- it('handles millisecond timestamp', () => {
- // January 1, 2025 at 12:00 PM
- const milliseconds = 1735732800000;
- const result = formatTimestamp(milliseconds);
- expect(typeof result).toBe('string');
- expect(result.length).toBeGreaterThan(0);
- });
});
describe('time formatting for today', () => {
it("formats today's timestamp with time only", () => {
- const now = Date.now();
+ const now = new Date();
const result = formatTimestamp(now);
// Should be in format like "2:30 PM"
expect(result).toMatch(/\d{1,2}:\d{2}\s?(AM|PM)/i);
@@ -38,7 +31,7 @@ describe('formatTimestamp', () => {
// Create a date in the current year but not today
const currentYear = new Date().getFullYear();
const date = new Date(currentYear, 0, 15); // January 15
- const result = formatTimestamp(date.getTime());
+ const result = formatTimestamp(date);
// Should be format like "Jan 15"
expect(result).toMatch(/^[A-Z][a-z]{2}\s\d{1,2}$/);
@@ -49,7 +42,7 @@ describe('formatTimestamp', () => {
it('formats old dates with full date', () => {
// January 15, 2020
const oldDate = new Date(2020, 0, 15);
- const result = formatTimestamp(oldDate.getTime());
+ const result = formatTimestamp(oldDate);
// Should be format like "1/15/20"
expect(result).toMatch(/^\d{1,2}\/\d{1,2}\/\d{2}$/);
@@ -58,41 +51,52 @@ describe('formatTimestamp', () => {
});
describe('formatRelativeTimestamp', () => {
- describe('timestamp format handling', () => {
- it('handles Unix timestamp (seconds)', () => {
- const unixSeconds = Math.floor(Date.now() / 1000) - 300; // 5 minutes ago
- const result = formatRelativeTimestamp(unixSeconds);
- expect(result).toContain('minute');
- });
-
- it('handles millisecond timestamp', () => {
- const milliseconds = Date.now() - 300000; // 5 minutes ago
- const result = formatRelativeTimestamp(milliseconds);
+ describe('Date object handling', () => {
+ it('handles Date object for recent time', () => {
+ const fiveMinutesAgo = applyDurationToDate(new Date(), {
+ value: -5,
+ unit: 'min',
+ });
+ const result = formatRelativeTimestamp(fiveMinutesAgo);
expect(result).toContain('minute');
});
});
describe('just now', () => {
it('returns "just now" for very recent timestamps', () => {
- const now = Date.now();
+ const now = new Date();
expect(formatRelativeTimestamp(now)).toBe('just now');
- expect(formatRelativeTimestamp(now - 30000)).toBe('just now'); // 30 seconds ago
+
+ const thirtySecondsAgo = applyDurationToDate(new Date(), {
+ value: -30,
+ unit: 's',
+ });
+ expect(formatRelativeTimestamp(thirtySecondsAgo)).toBe('just now');
});
});
describe('minutes ago', () => {
it('formats timestamps within last hour as minutes', () => {
- const oneMinuteAgo = Date.now() - 60000;
+ const oneMinuteAgo = applyDurationToDate(new Date(), {
+ value: -1,
+ unit: 'min',
+ });
expect(formatRelativeTimestamp(oneMinuteAgo)).toBe('1 minute ago');
});
it('uses plural for multiple minutes', () => {
- const fiveMinutesAgo = Date.now() - 300000;
+ const fiveMinutesAgo = applyDurationToDate(new Date(), {
+ value: -5,
+ unit: 'min',
+ });
expect(formatRelativeTimestamp(fiveMinutesAgo)).toBe('5 minutes ago');
});
it('handles 59 minutes correctly', () => {
- const fiftyNineMinutesAgo = Date.now() - 59 * 60000;
+ const fiftyNineMinutesAgo = applyDurationToDate(new Date(), {
+ value: -59,
+ unit: 'min',
+ });
expect(formatRelativeTimestamp(fiftyNineMinutesAgo)).toBe(
'59 minutes ago'
);
@@ -101,17 +105,26 @@ describe('formatRelativeTimestamp', () => {
describe('hours ago', () => {
it('formats timestamps within 24 hours as hours', () => {
- const oneHourAgo = Date.now() - 3600000;
+ const oneHourAgo = applyDurationToDate(new Date(), {
+ value: -1,
+ unit: 'h',
+ });
expect(formatRelativeTimestamp(oneHourAgo)).toBe('1 hour ago');
});
it('uses plural for multiple hours', () => {
- const threeHoursAgo = Date.now() - 3 * 3600000;
+ const threeHoursAgo = applyDurationToDate(new Date(), {
+ value: -3,
+ unit: 'h',
+ });
expect(formatRelativeTimestamp(threeHoursAgo)).toBe('3 hours ago');
});
it('handles 23 hours correctly', () => {
- const twentyThreeHoursAgo = Date.now() - 23 * 3600000;
+ const twentyThreeHoursAgo = applyDurationToDate(new Date(), {
+ value: -23,
+ unit: 'h',
+ });
expect(formatRelativeTimestamp(twentyThreeHoursAgo)).toBe('23 hours ago');
});
});
@@ -123,7 +136,7 @@ describe('formatRelativeTimestamp', () => {
yesterday.setDate(yesterday.getDate() - 1);
yesterday.setHours(14, 30, 0, 0); // 2:30 PM
- const result = formatRelativeTimestamp(yesterday.getTime());
+ const result = formatRelativeTimestamp(yesterday);
expect(result).toContain('yesterday');
expect(result).toMatch(/\d{1,2}:\d{2}(am|pm)/i);
});
@@ -132,10 +145,9 @@ describe('formatRelativeTimestamp', () => {
describe('same year older dates', () => {
it('formats dates in same year as "MMM d"', () => {
// Create a date 30 days ago in current year
- const date = new Date();
- date.setDate(date.getDate() - 30);
+ const date = applyDurationToDate(new Date(), { value: -30, unit: 'd' });
- const result = formatRelativeTimestamp(date.getTime());
+ const result = formatRelativeTimestamp(date);
// Should be format like "Jan 15"
expect(result).toMatch(/^[A-Z][a-z]{2}\s\d{1,2}$/);
});
@@ -145,7 +157,7 @@ describe('formatRelativeTimestamp', () => {
it('formats old dates with full date', () => {
// January 15, 2020
const oldDate = new Date(2020, 0, 15);
- const result = formatRelativeTimestamp(oldDate.getTime());
+ const result = formatRelativeTimestamp(oldDate);
// Should be format like "1/15/20"
expect(result).toMatch(/^\d{1,2}\/\d{1,2}\/\d{2}$/);
@@ -154,14 +166,14 @@ describe('formatRelativeTimestamp', () => {
describe('edge cases', () => {
it('handles future timestamps gracefully', () => {
- const future = Date.now() + 3600000; // 1 hour in future
+ const future = applyDurationToDate(new Date(), { value: 1, unit: 'h' }); // 1 hour in future
const result = formatRelativeTimestamp(future);
// Should return "just now" since difference is < 1 minute
expect(result).toBe('just now');
});
it('handles very old timestamps', () => {
- const veryOld = new Date(1990, 0, 1).getTime();
+ const veryOld = new Date(1990, 0, 1);
const result = formatRelativeTimestamp(veryOld);
expect(typeof result).toBe('string');
expect(result.length).toBeGreaterThan(0);
diff --git a/js/app/packages/macro-entity/src/queries/auth.ts b/js/app/packages/macro-entity/src/queries/auth.ts
index 18d7f65c38..c2690a176f 100644
--- a/js/app/packages/macro-entity/src/queries/auth.ts
+++ b/js/app/packages/macro-entity/src/queries/auth.ts
@@ -26,19 +26,6 @@ class FetchDocumentsError extends Error {
}
}
-export async function handleFetchResponse(
- response: Response,
- errorMessage: string
-): Promise<void> {
- if (!response.ok) {
- const errorData =
- response.status === 401
- ? await response.json().catch(() => undefined)
- : undefined;
- throw new FetchDocumentsError(errorMessage, response, errorData);
- }
-}
-
export async function withApiTokenRetry<T>(
authQuery: ReturnType<typeof createApiTokenQuery>,
fetchFn: (apiToken: string) => Promise<T>
diff --git a/js/app/packages/macro-entity/src/queries/email.ts b/js/app/packages/macro-entity/src/queries/email.ts
index 574b791622..ff1e42be4d 100644
--- a/js/app/packages/macro-entity/src/queries/email.ts
+++ b/js/app/packages/macro-entity/src/queries/email.ts
@@ -1,17 +1,13 @@
import type { PreviewViewStandardLabel } from '@service-email/generated/schemas';
-import type { ApiPaginatedThreadCursor } from '@service-email/generated/schemas/apiPaginatedThreadCursor';
import type { PreviewsInboxCursorParams } from '@service-email/generated/schemas/previewsInboxCursorParams';
+import { emailClient } from '@service-email/client';
import { useInfiniteQuery } from '@tanstack/solid-query';
-import { SERVER_HOSTS } from 'core/constant/servers';
-import { platformFetch } from 'core/util/platformFetch';
+import { isErr } from 'core/util/maybeResult';
import { type Accessor, createMemo } from 'solid-js';
import type { EmailEntity } from '@entity';
-import {
- createApiTokenQuery,
- handleFetchResponse,
- withApiTokenRetry,
-} from './auth';
+import { createApiTokenQuery, withApiTokenRetry } from './auth';
import { queryKeys } from './key';
+import type { SafeFetchInit } from '@core/util/safeFetch';
type FetchPaginatedEmailsParams = PreviewsInboxCursorParams & {
// path parameter
@@ -22,27 +18,27 @@ const fetchPaginatedEmails = async ({
apiToken,
view,
...params
-}: FetchPaginatedEmailsParams & {
- apiToken?: string;
-}) => {
- if (!apiToken) throw new Error('No API token provided');
+}: FetchPaginatedEmailsParams & { apiToken: string }) => {
const Authorization = `Bearer ${apiToken}`;
+ const init: SafeFetchInit = {
+ headers: { Authorization },
+ };
- const url = new URL(
- `${SERVER_HOSTS['email-service']}/email/threads/previews/cursor/${view}`
+ const result = await emailClient.getPreviews(
+ {
+ view,
+ limit: params.limit,
+ sort_method: params.sort_method,
+ cursor: params.cursor,
+ },
+ init
);
- Object.entries(params).forEach(([key, value]) => {
- if (value) url.searchParams.set(key, value.toString());
- });
- const response = await platformFetch(url.toString(), {
- headers: { Authorization },
- });
-
- await handleFetchResponse(response, 'Failed to fetch email');
+ if (isErr(result)) {
+ throw new Error('Failed to fetch email');
+ }
- const previews: ApiPaginatedThreadCursor = await response.json();
- return previews;
+ return result[1];
};
export function createEmailsInfiniteQuery(
@@ -92,8 +88,10 @@ export function createEmailsInfiniteQuery(
...email,
type: 'email',
name: email.name || 'No Subject',
+ createdAt: email.createdAt,
+ updatedAt: email.updatedAt,
frecencyScore: email.frecencyScore ?? undefined,
- viewedAt: email.viewedAt ?? undefined,
+ viewedAt: email.viewedAt,
snippet: email.snippet ?? undefined,
isImportant: email.isImportant ?? false,
done: !email.inboxVisible,
diff --git a/js/app/packages/notifications/components/Playground.tsx b/js/app/packages/notifications/components/Playground.tsx
index d865d07a42..2194d11a63 100644
--- a/js/app/packages/notifications/components/Playground.tsx
+++ b/js/app/packages/notifications/components/Playground.tsx
@@ -481,7 +481,7 @@ function PlaygroundContent() {
/** @ts-ignore */
return {
id: `custom-${Date.now()}`,
- createdAt: Math.floor(Date.now() / 1000),
+ createdAt: new Date().toISOString(),
eventItemId: 'channel-custom',
eventItemType: 'channel',
senderId: 'user-custom',
diff --git a/js/app/packages/notifications/notification-helpers.ts b/js/app/packages/notifications/notification-helpers.ts
index c45bd475c4..2930721c15 100644
--- a/js/app/packages/notifications/notification-helpers.ts
+++ b/js/app/packages/notifications/notification-helpers.ts
@@ -1,8 +1,7 @@
import type { Entity, EntityType } from '@core/types';
-import type { UnifiedNotification } from '@service-notification/client';
import { type Accessor, createEffect, createMemo, onCleanup } from 'solid-js';
import type { NotificationSource } from './notification-source';
-import { compositeEntity } from './types';
+import { type UnifiedNotification, compositeEntity } from './types';
/**
* Returns a reactive accessor to all notifications for a given entity
diff --git a/js/app/packages/notifications/notification-metadata.ts b/js/app/packages/notifications/notification-metadata.ts
index 13eaf37f76..3299c1f740 100644
--- a/js/app/packages/notifications/notification-metadata.ts
+++ b/js/app/packages/notifications/notification-metadata.ts
@@ -1,4 +1,4 @@
-import type { UnifiedNotification } from '@service-notification/client';
+import type { UnifiedNotification } from './types';
import { match } from 'ts-pattern';
// Helper functions for derived notification data
diff --git a/js/app/packages/notifications/notification-navigation.ts b/js/app/packages/notifications/notification-navigation.ts
index af5e4dc1e2..dab4130142 100644
--- a/js/app/packages/notifications/notification-navigation.ts
+++ b/js/app/packages/notifications/notification-navigation.ts
@@ -3,7 +3,7 @@ import { URL_PARAMS as CHANNEL_URL_PARAMS } from '@block-channel/constants';
import type { BlockAlias, BlockName } from '@core/block';
import { fileTypeToBlockName } from '@core/constant/allBlocks';
import type { NotificationType } from '@core/types';
-import type { UnifiedNotification } from '@service-notification/client';
+import type { UnifiedNotification } from './types';
import { getNotificationById } from '@queries/notification/user-notifications';
import { errAsync, ResultAsync } from 'neverthrow';
import { match, P } from 'ts-pattern';
diff --git a/js/app/packages/notifications/notification-platform.ts b/js/app/packages/notifications/notification-platform.ts
index a26155e0e8..d8c198b1d0 100644
--- a/js/app/packages/notifications/notification-platform.ts
+++ b/js/app/packages/notifications/notification-platform.ts
@@ -1,7 +1,7 @@
import type { SplitManager } from '@app/component/split-layout/layoutManager';
import { getFaviconUrl } from '@app/util/favicon';
import { markdownToPlainText } from '@lexical-core';
-import type { UnifiedNotification } from '@service-notification/client';
+import type { UnifiedNotification } from './types';
import { themeReactive } from '../block-theme/signals/themeReactive';
import type { PlatformNotificationState } from './components/PlatformNotificationProvider';
import {
diff --git a/js/app/packages/notifications/notification-stacking.ts b/js/app/packages/notifications/notification-stacking.ts
index 07334c17e8..9193a5ff7f 100644
--- a/js/app/packages/notifications/notification-stacking.ts
+++ b/js/app/packages/notifications/notification-stacking.ts
@@ -1,3 +1,4 @@
+import { compareDateDesc } from '@core/util/date';
import type { UnifiedNotification } from './types';
import type { NotificationType } from '@core/types';
@@ -97,12 +98,15 @@ export function stackNotifications(
if ((a.type === 'channel_mention') !== (b.type === 'channel_mention')) {
return a.type === 'channel_mention' ? -1 : 1;
}
- return b.notifications[0].createdAt - a.notifications[0].createdAt;
+ return compareDateDesc(
+ a.notifications[0].createdAt,
+ b.notifications[0].createdAt
+ );
});
}
-function sortByRecency<T extends { createdAt: number }>(items: T[]): T[] {
- return [...items].sort((a, b) => b.createdAt - a.createdAt);
+function sortByRecency(items: UnifiedNotification[]): UnifiedNotification[] {
+ return [...items].sort((a, b) => compareDateDesc(a.createdAt, b.createdAt));
}
const groupBy: <T, K>(items: T[], keyFn: (item: T) => K) => Map<K, T[]> =
diff --git a/js/app/packages/notifications/tests/notification-preview.test.ts b/js/app/packages/notifications/tests/notification-preview.test.ts
index 7f44878a6f..cdcccaca79 100644
--- a/js/app/packages/notifications/tests/notification-preview.test.ts
+++ b/js/app/packages/notifications/tests/notification-preview.test.ts
@@ -9,10 +9,10 @@ function createEmailNotification(
id: 'notif-1',
entity_id: 'thread-1',
entity_type: 'email',
- createdAt: Date.now(),
- updatedAt: 0,
- viewedAt: 0,
- deletedAt: 0,
+ createdAt: new Date().toISOString(),
+ updatedAt: null,
+ viewedAt: null,
+ deletedAt: null,
done: false,
sent: true,
senderId,
diff --git a/js/app/packages/notifications/tests/notification-stacking.test.ts b/js/app/packages/notifications/tests/notification-stacking.test.ts
index ab1d72faf4..e3b3de45e2 100644
--- a/js/app/packages/notifications/tests/notification-stacking.test.ts
+++ b/js/app/packages/notifications/tests/notification-stacking.test.ts
@@ -18,10 +18,10 @@ function createBaseNotification(
id,
entity_id: 'channel-1',
entity_type: 'channel',
- createdAt,
- updatedAt: 0,
- viewedAt: 0,
- deletedAt: 0,
+ createdAt: new Date(createdAt).toISOString(),
+ updatedAt: null,
+ viewedAt: null,
+ deletedAt: null,
done: false,
sent: true,
senderId: 'user-1',
diff --git a/js/app/packages/queries/channel/channel.ts b/js/app/packages/queries/channel/channel.ts
index 1e0618944b..5377513667 100644
--- a/js/app/packages/queries/channel/channel.ts
+++ b/js/app/packages/queries/channel/channel.ts
@@ -1,3 +1,4 @@
+import type { DateValue } from '@core/util/date';
import {
catchToResult,
isErr,
@@ -7,10 +8,8 @@ import {
} from '@core/util/maybeResult';
import { commsServiceClient } from '@service-comms/client';
import type { getChannelResponseError } from '@service-comms/generated/client';
-import type {
- ApiChannelWithLatest,
- GetChannelResponse,
-} from '@service-comms/generated/models';
+import type { ApiChannelWithLatest } from '@service-comms/generated/models';
+import type { GetChannelResponse } from './types';
import {
type QueryClient,
type UseBaseQueryOptions,
@@ -75,14 +74,14 @@ type WithChannelId<T> = T & { channelId: string };
export type UpdateChannelNameContext = {
previousName: string | null | undefined;
- previousUpdatedAt: string;
+ previousUpdatedAt: DateValue;
};
/** Helper to update channel name in both single channel and list queries. */
function updateChannelNameInQueries(
channelId: string,
name: string | null | undefined,
- updatedAt: string
+ updatedAt: DateValue
): void {
const queryKey = channelKeys.withID(channelId).queryKey;
const listQueryKey = channelKeys.listChannels.queryKey;
diff --git a/js/app/packages/queries/channel/derived.ts b/js/app/packages/queries/channel/derived.ts
index 43a61e8118..999d41dd69 100644
--- a/js/app/packages/queries/channel/derived.ts
+++ b/js/app/packages/queries/channel/derived.ts
@@ -1,9 +1,5 @@
-import type {
- Attachment,
- GetChannelResponse,
- GetChannelResponseReactions,
- Message,
-} from '@service-comms/generated/models';
+import type { GetChannelResponseReactions } from '@service-comms/generated/models';
+import type { Attachment, GetChannelResponse, Message } from './types';
export type MessageWithThreadId = Message & {
thread_id: NonNullable<Message['thread_id']>;
diff --git a/js/app/packages/queries/channel/message.ts b/js/app/packages/queries/channel/message.ts
index fd6a69e326..b101f54ea3 100644
--- a/js/app/packages/queries/channel/message.ts
+++ b/js/app/packages/queries/channel/message.ts
@@ -1,5 +1,6 @@
import { TrackingEvents, withAnalytics } from '@coparse/analytics';
import { toast } from '@core/component/Toast/Toast';
+import type { DateValue } from '@core/util/date';
import { throwOnErr } from '@core/util/maybeResult';
import { softInvalidateChannelWithID } from '@queries/channel/channel';
import { type MutationCallbacks, withCallbacks } from '@queries/utils';
@@ -9,13 +10,11 @@ import {
type MessageResponse,
} from '@service-comms/client';
import type {
- Attachment,
ChannelMessage,
CountedReaction,
- GetChannelResponse,
- Message,
PostMessageRequest,
} from '@service-comms/generated/models';
+import type { Attachment, GetChannelResponse, Message } from './types';
import { useMutation } from '@tanstack/solid-query';
import { queryClient } from '../client';
import { channelKeys, ChannelNonceKeys } from './keys';
@@ -52,8 +51,8 @@ export type DeleteMessageContext = {
export type UpdateMessageContext = {
messageId: string;
previousContent: string;
- previousEditedAt: string | null | undefined;
- previousUpdatedAt: string;
+ previousEditedAt: DateValue | null | undefined;
+ previousUpdatedAt: DateValue;
};
/**
@@ -91,7 +90,7 @@ export function optimisticInsertChannelMessage(
const newAttachments: Attachment[] = vars.attachments.map((a) => ({
id: crypto.randomUUID(),
channel_id: vars.channelId,
- created_at: String(Date.now()),
+ created_at: new Date().toISOString(),
message_id: vars.optimisticId,
...a,
}));
diff --git a/js/app/packages/queries/channel/participants.ts b/js/app/packages/queries/channel/participants.ts
index d53006f35a..bebb83a923 100644
--- a/js/app/packages/queries/channel/participants.ts
+++ b/js/app/packages/queries/channel/participants.ts
@@ -5,10 +5,7 @@ import {
commsServiceClient,
type MessageResponse,
} from '@service-comms/client';
-import type {
- ChannelParticipant,
- GetChannelResponse,
-} from '@service-comms/generated/models';
+import type { ChannelParticipant, GetChannelResponse } from './types';
import { useMutation } from '@tanstack/solid-query';
import { queryClient } from '../client';
import { softInvalidateChannelWithID } from './channel';
diff --git a/js/app/packages/queries/channel/reaction.ts b/js/app/packages/queries/channel/reaction.ts
index 1d163f6028..522c7d5440 100644
--- a/js/app/packages/queries/channel/reaction.ts
+++ b/js/app/packages/queries/channel/reaction.ts
@@ -5,10 +5,8 @@ import {
commsServiceClient,
type MessageResponse,
} from '@service-comms/client';
-import type {
- GetChannelResponse,
- PostReactionRequest,
-} from '@service-comms/generated/models';
+import type { PostReactionRequest } from '@service-comms/generated/models';
+import type { GetChannelResponse } from './types';
import { useMutation } from '@tanstack/solid-query';
import { queryClient } from '../client';
import { softInvalidateChannelWithID } from './channel';
diff --git a/js/app/packages/queries/channel/sync.ts b/js/app/packages/queries/channel/sync.ts
index 71252c7128..614c6e05bd 100644
--- a/js/app/packages/queries/channel/sync.ts
+++ b/js/app/packages/queries/channel/sync.ts
@@ -1,9 +1,9 @@
import type {
- Attachment,
+ Attachment as ApiAttachment,
CountedReaction,
- GetChannelResponse,
- Message,
+ Message as ApiMessage,
} from '@service-comms/generated/models';
+import type { GetChannelResponse } from './types';
import { queryClient } from '../client';
import { softInvalidateChannelWithID } from './channel';
import { channelKeys, ChannelNonceKeys } from './keys';
@@ -12,7 +12,7 @@ import { consumeNonce } from '../nonce';
/**
* Websocket payload types
*/
-type CommsMessagePayload = Message & { channel_id: string; nonce: string };
+type CommsMessagePayload = ApiMessage & { channel_id: string; nonce: string };
type CommsReactionPayload = {
channel_id: string;
@@ -24,7 +24,7 @@ type CommsReactionPayload = {
type CommsAttachmentPayload = {
channel_id: string;
message_id: string;
- attachments: Attachment[];
+ attachments: ApiAttachment[];
nonce: string;
};
diff --git a/js/app/packages/queries/channel/tests/channel-optimistic.test.ts b/js/app/packages/queries/channel/tests/channel-optimistic.test.ts
index 19b386d5e2..d8b72ec546 100644
--- a/js/app/packages/queries/channel/tests/channel-optimistic.test.ts
+++ b/js/app/packages/queries/channel/tests/channel-optimistic.test.ts
@@ -2,12 +2,8 @@
* @vitest-environment jsdom
*/
-import type {
- Attachment,
- CountedReaction,
- GetChannelResponse,
- Message,
-} from '@service-comms/generated/models';
+import type { CountedReaction } from '@service-comms/generated/models';
+import type { Attachment, GetChannelResponse, Message } from '../types';
import { QueryClient } from '@tanstack/solid-query';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
@@ -758,13 +754,12 @@ describe('optimisticUpdateChannelName', () => {
const cached = getChannelFromCache('channel-1');
expect(cached?.channel.name).toBe('New Channel Name');
- expect(cached?.channel.updated_at).not.toBe(originalUpdatedAt);
+ expect(cached?.channel.updated_at).not.toEqual(originalUpdatedAt);
// Context should contain previous name for rollback
expect(context?.previousName).toBe('Test Channel');
});
it('should rollback correctly using returned context', () => {
- const originalUpdatedAt = '2024-01-01T00:00:00.000Z';
seedQueryCache('channel-1', createMockChannelResponse());
const context = optimisticUpdateChannelName({
@@ -785,6 +780,6 @@ describe('optimisticUpdateChannelName', () => {
// Verify rollback restored original state
const cached = getChannelFromCache('channel-1');
expect(cached?.channel.name).toBe('Test Channel');
- expect(cached?.channel.updated_at).toBe(originalUpdatedAt);
+ expect(cached?.channel.updated_at).toEqual('2024-01-01T00:00:00.000Z');
});
});
diff --git a/js/app/packages/queries/channel/types.ts b/js/app/packages/queries/channel/types.ts
new file mode 100644
index 0000000000..b87169fd5d
--- /dev/null
+++ b/js/app/packages/queries/channel/types.ts
@@ -0,0 +1,29 @@
+import type {
+ Activity as ApiActivity,
+ Attachment as ApiAttachment,
+ Channel as ApiChannel,
+ ChannelParticipant as ApiChannelParticipant,
+ GetChannelResponse as ApiGetChannelResponse,
+ Message as ApiMessage,
+} from '@service-comms/generated/models';
+
+export type Message = ApiMessage;
+
+export type Attachment = ApiAttachment;
+
+export type ChannelParticipant = ApiChannelParticipant;
+
+export type Channel = ApiChannel;
+
+export type Activity = ApiActivity;
+
+export type GetChannelResponse = Omit<
+ ApiGetChannelResponse,
+ 'channel' | 'messages' | 'attachments' | 'participants' | 'activity'
+> & {
+ channel: Channel;
+ messages: Message[];
+ attachments: Attachment[];
+ participants: ChannelParticipant[];
+ activity?: Activity | null;
+};
diff --git a/js/app/packages/queries/client.ts b/js/app/packages/queries/client.ts
index 9bbe547d01..ff94856c2b 100644
--- a/js/app/packages/queries/client.ts
+++ b/js/app/packages/queries/client.ts
@@ -16,7 +16,6 @@ export const queryClient = new QueryClient({
});
const buster = import.meta.env.__APP_VERSION__ ?? 'dev';
-const SEVEN_DAYS_MS = 1000 * 60 * 60 * 24 * 7;
// Clean up orphaned v0 databases from the old whole-cache persistence format
try {
@@ -31,7 +30,7 @@ setupQueryPersistence({
store: createPerQueryIDBStore({
dbName: createPersistenceKey('channels', 1),
}),
- maxAgeMs: SEVEN_DAYS_MS,
+ maxAge: { value: 7, unit: 'd' },
buster,
shouldPersist: (key) => partialMatchKey(key, ['channel']),
},
@@ -39,7 +38,7 @@ setupQueryPersistence({
store: createPerQueryIDBStore({
dbName: createPersistenceKey('email-threads', 1),
}),
- maxAgeMs: SEVEN_DAYS_MS,
+ maxAge: { value: 7, unit: 'd' },
buster,
shouldPersist: (key) => partialMatchKey(key, ['email', 'threadMessages']),
},
diff --git a/js/app/packages/queries/email/draft.ts b/js/app/packages/queries/email/draft.ts
index 1af72e4db1..dfe6c18452 100644
--- a/js/app/packages/queries/email/draft.ts
+++ b/js/app/packages/queries/email/draft.ts
@@ -13,7 +13,7 @@ import { invalidateSoupEntity, invalidateAllSoup } from '@queries/soup/cache';
type CreateDraftParams = {
draft: MessageToSend;
- sendTime?: string | null;
+ sendTime?: Date | null;
};
/**
@@ -28,7 +28,7 @@ export function useSaveDraftMutation(
async () =>
await emailClient.createDraft({
draft: vars.draft,
- send_time: vars.sendTime,
+ send_time: vars.sendTime?.toISOString() ?? null,
})
);
},
diff --git a/js/app/packages/queries/email/thread.ts b/js/app/packages/queries/email/thread.ts
index f441663039..75b865b862 100644
--- a/js/app/packages/queries/email/thread.ts
+++ b/js/app/packages/queries/email/thread.ts
@@ -293,7 +293,7 @@ export function useSendMessageMutation(
}));
}
-type ScheduleMessageParams = { draftID: string; sendTime: string };
+type ScheduleMessageParams = { draftID: string; sendTime: Date };
/**
* Mutation to send an email message.
@@ -311,7 +311,7 @@ export function useScheduleMessageMutation(
async () =>
await emailClient.scheduleMessage({
draftID: vars.draftID,
- send_time: vars.sendTime,
+ send_time: vars.sendTime.toISOString(),
})
),
...withCallbacks<UpsertScheduledResponse, Error, ScheduleMessageParams>(
diff --git a/js/app/packages/queries/history/history.ts b/js/app/packages/queries/history/history.ts
index 72a272fedc..1ba923f0df 100644
--- a/js/app/packages/queries/history/history.ts
+++ b/js/app/packages/queries/history/history.ts
@@ -14,6 +14,7 @@ import { createEffect, type Accessor, type Setter } from 'solid-js';
import { queryClient } from '../client';
import { historyKeys } from './keys';
import {
+ transformHistoryItem,
transformHistoryResponse,
updateViewedAtAndMoveItemToFront,
} from './transforms';
@@ -115,7 +116,7 @@ export function refetchHistory() {
// @ts-ignore
// biome-ignore lint/correctness/noUnusedVariables: we may use this eventually
function optimisticUpdateViewedAt(itemId: string) {
- const now = Date.now();
+ const now = new Date();
setHistoryData((old) => {
return updateViewedAtAndMoveItemToFront(old, itemId, now);
@@ -285,7 +286,9 @@ export async function insertProjectIntoHistory(projectId: string) {
return acc;
}, [])
);
- newData.push(...projectContent[1].data.map(({ item }) => item));
+ newData.push(
+ ...projectContent[1].data.map(({ item }) => transformHistoryItem(item))
+ );
}
}
diff --git a/js/app/packages/queries/history/tests/history.test.tsx b/js/app/packages/queries/history/tests/history.test.tsx
index bb0c06096e..50cfdab650 100644
--- a/js/app/packages/queries/history/tests/history.test.tsx
+++ b/js/app/packages/queries/history/tests/history.test.tsx
@@ -1,6 +1,7 @@
import { describe, expect, it, vi } from 'vitest';
import type { Item } from '@service-storage/generated/schemas/item';
import {
+ transformHistoryItem,
transformHistoryResponse,
updateViewedAtAndMoveItemToFront,
} from '../transforms';
@@ -15,12 +16,16 @@ function createItem(overrides: Partial<Item> = {}): Item {
name: 'Test Item',
type: 'document',
userId: 'user-1',
- createdAt: Date.now() / 1000,
- updatedAt: Date.now() / 1000,
+ createdAt: new Date().toISOString(),
+ updatedAt: new Date().toISOString(),
...overrides,
} as Item;
}
+function createHistoryItem(overrides: Partial<Item> = {}) {
+ return transformHistoryItem(createItem(overrides));
+}
+
describe('history transforms', () => {
it('transforms response', () => {
const data = {
@@ -51,12 +56,12 @@ describe('history transforms', () => {
describe('updateViewedAtAndMoveItemToFront', () => {
it('moves item to front and updates viewedAt', () => {
- const items: Item[] = [
- createItem({ id: 'item-1' }),
- createItem({ id: 'item-2' }),
- createItem({ id: 'item-3' }),
+ const items = [
+ createHistoryItem({ id: 'item-1' }),
+ createHistoryItem({ id: 'item-2' }),
+ createHistoryItem({ id: 'item-3' }),
];
- const timestamp = Date.now();
+ const timestamp = new Date();
const result = updateViewedAtAndMoveItemToFront(
items,
@@ -71,15 +76,15 @@ describe('history transforms', () => {
});
it('returns original array if item not found', () => {
- const items: Item[] = [
- createItem({ id: 'item-1' }),
- createItem({ id: 'item-2' }),
+ const items = [
+ createHistoryItem({ id: 'item-1' }),
+ createHistoryItem({ id: 'item-2' }),
];
const result = updateViewedAtAndMoveItemToFront(
items,
'nonexistent',
- Date.now()
+ new Date()
);
expect(result).toBe(items);
@@ -87,11 +92,11 @@ describe('history transforms', () => {
});
it('keeps item at front if already first', () => {
- const items: Item[] = [
- createItem({ id: 'item-1' }),
- createItem({ id: 'item-2' }),
+ const items = [
+ createHistoryItem({ id: 'item-1' }),
+ createHistoryItem({ id: 'item-2' }),
];
- const timestamp = Date.now();
+ const timestamp = new Date();
const result = updateViewedAtAndMoveItemToFront(
items,
@@ -105,13 +110,13 @@ describe('history transforms', () => {
});
it('does not mutate original array', () => {
- const items: Item[] = [
- createItem({ id: 'item-1' }),
- createItem({ id: 'item-2' }),
+ const items = [
+ createHistoryItem({ id: 'item-1' }),
+ createHistoryItem({ id: 'item-2' }),
];
const originalLength = items.length;
- updateViewedAtAndMoveItemToFront(items, 'item-2', Date.now());
+ updateViewedAtAndMoveItemToFront(items, 'item-2', new Date());
expect(items.length).toBe(originalLength);
expect(items[0].id).toBe('item-1');
diff --git a/js/app/packages/queries/history/transforms.ts b/js/app/packages/queries/history/transforms.ts
index 9c11a596d4..c0a92c7788 100644
--- a/js/app/packages/queries/history/transforms.ts
+++ b/js/app/packages/queries/history/transforms.ts
@@ -1,14 +1,15 @@
import { itemToSafeName } from '@core/constant/allBlocks';
+import type { DateValue } from '@core/util/date';
+import type { Item } from '@service-storage/generated/schemas/item';
import type { HistoryItem, HistoryQueryResponse } from './types';
-export function transformHistoryItem(item: HistoryItem): HistoryItem {
+export function transformHistoryItem(item: Item): HistoryItem {
const base = {
id: item.id,
name: itemToSafeName(item),
createdAt: item.createdAt,
updatedAt: item.updatedAt,
deletedAt: item.deletedAt,
- viewedAt: item.viewedAt,
rawName: item.name,
};
@@ -49,7 +50,7 @@ export function transformHistoryResponse(
export function updateViewedAtAndMoveItemToFront(
items: HistoryItem[],
itemId: string,
- timestamp: number
+ timestamp: DateValue
): HistoryItem[] {
const itemIndex = items.findIndex((item) => item.id === itemId);
diff --git a/js/app/packages/queries/history/types.ts b/js/app/packages/queries/history/types.ts
index 8e8093fc33..f03379356b 100644
--- a/js/app/packages/queries/history/types.ts
+++ b/js/app/packages/queries/history/types.ts
@@ -1,12 +1,13 @@
+import type { DateValue } from '@core/util/date';
import type { Item } from '@service-storage/generated/schemas/item';
-type BaseHistoryItem = Pick<
- Item,
- 'id' | 'name' | 'createdAt' | 'updatedAt' | 'deletedAt'
-> & {
+type BaseHistoryItem = Pick<Item, 'id' | 'name'> & {
+ createdAt?: DateValue | null;
+ updatedAt?: DateValue | null;
+ deletedAt?: DateValue | null;
// NOTE: the history endpoint does not return this field so this
// is a placeholder for now
- viewedAt?: number;
+ viewedAt?: DateValue;
// TODO: item name without safe name transform
rawName?: string;
};
@@ -27,5 +28,5 @@ export type HistoryItem =
| ProjectHistoryItem;
export type HistoryQueryResponse = {
- data: HistoryItem[];
+ data: Item[];
};
diff --git a/js/app/packages/queries/notification/tests/user-notifications.test.tsx b/js/app/packages/queries/notification/tests/user-notifications.test.tsx
index 99a4e17576..afd9b509a4 100644
--- a/js/app/packages/queries/notification/tests/user-notifications.test.tsx
+++ b/js/app/packages/queries/notification/tests/user-notifications.test.tsx
@@ -3,6 +3,7 @@
*/
import { err, ok } from '@core/util/maybeResult';
+import type { UnifiedNotification } from '@notifications/types';
import type { ApiUserNotification } from '@service-notification/generated/schemas/apiUserNotification';
import type { GetAllUserNotificationsResponse } from '@service-notification/generated/schemas/getAllUserNotificationsResponse';
import { QueryClient, QueryClientProvider } from '@tanstack/solid-query';
@@ -47,19 +48,18 @@ vi.mock('../../client', () => ({
type UserNotificationsPageParam = { limit: number; cursor?: string };
function createMockNotification(
- overrides: Partial<ApiUserNotification> = {}
-): ApiUserNotification {
+ overrides: Partial<UnifiedNotification> = {}
+): UnifiedNotification {
return {
id: `notification-${Math.random().toString(36).slice(2)}`,
entity_id: 'entity-1',
entity_type: 'document',
- createdAt: Date.now(),
- updatedAt: 0,
- viewedAt: 0,
- deletedAt: 0,
+ createdAt: new Date().toISOString(),
+ updatedAt: null,
+ viewedAt: null,
+ deletedAt: null,
done: false,
sent: true,
- ownerId: 'owner-1',
notificationEventType: 'item_shared_user',
notificationMetadata: {
tag: 'item_shared_user',
@@ -69,15 +69,15 @@ function createMockNotification(
},
},
...overrides,
- } as ApiUserNotification;
+ } as UnifiedNotification;
}
function createMockNotificationPage(
- notifications: ApiUserNotification[],
+ notifications: UnifiedNotification[],
nextCursor?: string
): GetAllUserNotificationsResponse {
return {
- items: notifications,
+ items: notifications as unknown as ApiUserNotification[],
next_cursor: nextCursor,
};
}
@@ -148,8 +148,8 @@ describe('notification mutations', () => {
describe('useMarkNotificationsAsSeenMutation', () => {
it('should optimistically update viewedAt when marking as seen', async () => {
- const n1 = createMockNotification({ id: 'n1', viewedAt: 0 });
- const n2 = createMockNotification({ id: 'n2', viewedAt: 0 });
+ const n1 = createMockNotification({ id: 'n1', viewedAt: null });
+ const n2 = createMockNotification({ id: 'n2', viewedAt: null });
seedQueryCache([createMockNotificationPage([n1, n2])]);
mockBulkMarkNotificationAsSeen.mockResolvedValue(ok({ success: true }));
@@ -167,14 +167,14 @@ describe('notification mutations', () => {
await mutatePromise;
const notifications = getNotificationsFromCache();
- expect(notifications[0].viewedAt).toBeGreaterThan(0);
- expect(notifications[1].viewedAt).toBe(0);
+ expect(typeof notifications[0].viewedAt).toBe('string');
+ expect(notifications[1].viewedAt).toBe(null);
cleanup();
});
it('should rollback optimistic update on error', async () => {
- const n1 = createMockNotification({ id: 'n1', viewedAt: 0 });
+ const n1 = createMockNotification({ id: 'n1', viewedAt: null });
seedQueryCache([createMockNotificationPage([n1])]);
mockBulkMarkNotificationAsSeen.mockResolvedValue(
@@ -198,14 +198,14 @@ describe('notification mutations', () => {
await new Promise((r) => setTimeout(r, 10));
const notifications = getNotificationsFromCache();
- expect(notifications[0].viewedAt).toBe(0);
+ expect(notifications[0].viewedAt).toBe(null);
cleanup();
});
it('should handle marking notifications across multiple pages', async () => {
- const n1 = createMockNotification({ id: 'n1', viewedAt: 0 });
- const n2 = createMockNotification({ id: 'n2', viewedAt: 0 });
+ const n1 = createMockNotification({ id: 'n1', viewedAt: null });
+ const n2 = createMockNotification({ id: 'n2', viewedAt: null });
seedQueryCache([
createMockNotificationPage([n1]),
createMockNotificationPage([n2]),
@@ -226,8 +226,8 @@ describe('notification mutations', () => {
await mutatePromise;
const notifications = getNotificationsFromCache();
- expect(notifications[0].viewedAt).toBe(0); // n1 unchanged
- expect(notifications[1].viewedAt).toBeGreaterThan(0); // n2 updated
+ expect(notifications[0].viewedAt).toBe(null); // n1 unchanged
+ expect(typeof notifications[1].viewedAt).toBe('string'); // n2 updated
cleanup();
});
diff --git a/js/app/packages/queries/notification/user-notifications.ts b/js/app/packages/queries/notification/user-notifications.ts
index ea10d21d0e..5eef69a866 100644
--- a/js/app/packages/queries/notification/user-notifications.ts
+++ b/js/app/packages/queries/notification/user-notifications.ts
@@ -2,6 +2,7 @@ import type { Maybe } from '@core/types';
import { type MaybeResult, throwOnErr } from '@core/util/maybeResult';
import { type MutationCallbacks, withCallbacks } from '@queries/utils';
import { notificationServiceClient } from '@service-notification/client';
+import type { ApiUserNotification } from '@service-notification/generated/schemas/apiUserNotification';
import type { GetAllUserNotificationsResponse } from '@service-notification/generated/schemas/getAllUserNotificationsResponse';
import {
type InfiniteData,
@@ -11,6 +12,14 @@ import {
} from '@tanstack/solid-query';
import { queryClient } from '../client';
import { notificationKeys } from './keys';
+import type { UnifiedNotification } from '@notifications/types';
+
+function stripOwnerId({
+ ownerId: _,
+ ...rest
+}: ApiUserNotification): UnifiedNotification {
+ return rest;
+}
export { notificationKeys } from './keys';
@@ -61,7 +70,7 @@ export function useUserNotificationsQuery(args?: { limit?: number }) {
GetAllUserNotificationsResponse,
UserNotificationsPageParam
>
- ) => data.pages.flatMap(({ items }) => items),
+ ) => data.pages.flatMap(({ items }) => items.map(stripOwnerId)),
}));
}
@@ -113,7 +122,7 @@ export function useEntityNotificationsQuery(args: {
GetAllUserNotificationsResponse,
EntityNotificationsPageParam
>
- ) => data.pages.flatMap(({ items }) => items),
+ ) => data.pages.flatMap(({ items }) => items.map(stripOwnerId)),
}));
}
@@ -167,7 +176,7 @@ export function useEntitiesNotificationsQuery(args: {
GetAllUserNotificationsResponse,
EntitiesNotificationsPageParam
>
- ) => data.pages.flatMap(({ items }) => items),
+ ) => data.pages.flatMap(({ items }) => items.map(stripOwnerId)),
enabled: args.eventItemIds().length > 0,
}));
}
@@ -313,7 +322,7 @@ const mapNotificationsAsSeen = (
...page,
items: page.items.map((n) =>
params.notificationIds.includes(n.id)
- ? { ...n, viewedAt: Date.now() }
+ ? { ...n, viewedAt: new Date().toISOString() }
: n
),
})),
@@ -367,18 +376,19 @@ type NotificationItem = GetAllUserNotificationsResponse['items'][number];
*/
export async function getNotificationById(
notificationId: string
-): Promise<NotificationItem | undefined> {
+): Promise<UnifiedNotification | undefined> {
const res = await throwOnErr(async () => {
return await notificationServiceClient.getUserNotificationById(
notificationId
);
});
- return res as NotificationItem;
+ if (!res) return undefined;
+ return stripOwnerId(res as NotificationItem);
}
export function optimisticInsertNotification(
- notification: Omit<NotificationItem, 'ownerId'>
+ notification: UnifiedNotification
) {
const item = notification as NotificationItem;
diff --git a/js/app/packages/queries/persistence.test.ts b/js/app/packages/queries/persistence.test.ts
index da4d2249c9..71d4881cd2 100644
--- a/js/app/packages/queries/persistence.test.ts
+++ b/js/app/packages/queries/persistence.test.ts
@@ -35,7 +35,7 @@ function createScope(
): PersistScope {
return {
store,
- maxAgeMs: 1000 * 60 * 60 * 24 * 7,
+ maxAge: { value: 7, unit: 'd' },
buster: 'test',
shouldPersist: (key) => partialMatchKey(key, prefix),
...overrides,
@@ -192,7 +192,9 @@ describe('setupQueryPersistence', () => {
buster: 'test',
});
- const scope = createScope(['channel'], store, { maxAgeMs });
+ const scope = createScope(['channel'], store, {
+ maxAge: { value: maxAgeMs, unit: 'ms' },
+ });
setupQueryPersistence({ queryClient, scopes: [scope] });
void queryClient.prefetchQuery({
diff --git a/js/app/packages/queries/persistence.ts b/js/app/packages/queries/persistence.ts
index 353adb8056..0c34d879b6 100644
--- a/js/app/packages/queries/persistence.ts
+++ b/js/app/packages/queries/persistence.ts
@@ -7,6 +7,10 @@ import type {
PerQueryPersistence,
PersistedQueryEntry,
} from './persistence/per-query-idb';
+import {
+ type ParsedDuration,
+ parsedDurationToMilliseconds,
+} from '@core/util/dateSearch/dateParser';
type PersistenceKey = `${string}-persist-v${number}`;
@@ -20,7 +24,7 @@ export function createPersistenceKey(
export type PersistScope = Readonly<{
store: PerQueryPersistence;
- maxAgeMs: number;
+ maxAge: ParsedDuration;
buster: string;
shouldPersist: (queryKey: QueryKey) => boolean;
}>;
@@ -44,7 +48,7 @@ type QueryClientLike = {
* Returns 'valid' if the entry can be restored, or a reason string
* explaining why it should be discarded.
*/
-export function validatePersistedEntry(
+function validatePersistedEntry(
entry: PersistedQueryEntry,
buster: string,
maxAgeMs: number
@@ -77,7 +81,8 @@ async function handleRestore(
if (!entry) return;
- if (validatePersistedEntry(entry, scope.buster, scope.maxAgeMs) !== 'valid') {
+ const maxAgeMs = parsedDurationToMilliseconds(scope.maxAge);
+ if (validatePersistedEntry(entry, scope.buster, maxAgeMs) !== 'valid') {
scope.store.remove(query.queryHash);
return;
}
diff --git a/js/app/packages/queries/preview/fetchers.ts b/js/app/packages/queries/preview/fetchers.ts
index 5a19f22eed..f9af323b62 100644
--- a/js/app/packages/queries/preview/fetchers.ts
+++ b/js/app/packages/queries/preview/fetchers.ts
@@ -167,11 +167,18 @@ async function fetchProjectPreviews(
return [];
}
- return result[1].previews.map((preview) => ({
- type: 'project',
- loading: false,
- ...preview,
- }));
+ return result[1].previews.map((preview) => {
+ const { updatedAt, ...rest } = preview as Extract<
+ typeof preview,
+ { updatedAt?: unknown }
+ >;
+ return {
+ type: 'project' as const,
+ loading: false as const,
+ ...rest,
+ updatedAt,
+ };
+ });
}
async function fetchEmailPreviews(threadIds: string[]): Promise<PreviewItem[]> {
@@ -208,7 +215,7 @@ async function fetchEmailPreviews(threadIds: string[]): Promise<PreviewItem[]> {
loading: false as const,
name: subject,
owner: sender as string | undefined,
- updatedAt: new Date(data.thread.updated_at).getTime(),
+ updatedAt: data.thread.updated_at,
};
})
);
diff --git a/js/app/packages/queries/preview/types.ts b/js/app/packages/queries/preview/types.ts
index ceb9147a65..891617c3ab 100644
--- a/js/app/packages/queries/preview/types.ts
+++ b/js/app/packages/queries/preview/types.ts
@@ -1,4 +1,5 @@
import type { SubType } from '@entity';
+import type { DateValue } from '@core/util/date';
import type { ChannelType } from '@service-cognition/generated/schemas/channelType';
import type { Message } from '@service-comms/generated/models';
import type { ItemType } from '@service-storage/client';
@@ -17,7 +18,7 @@ type BasePreviewItem<T extends ItemType = ItemType> = {
id: string;
type: T;
owner?: string;
- updatedAt?: number;
+ updatedAt?: DateValue | null;
};
/** this is a catch-all type for access items that do not have a more specific type */
diff --git a/js/app/packages/queries/properties/entity.ts b/js/app/packages/queries/properties/entity.ts
index 25a3dddce4..f973b4a9e2 100644
--- a/js/app/packages/queries/properties/entity.ts
+++ b/js/app/packages/queries/properties/entity.ts
@@ -118,7 +118,7 @@ function apiValuesToSoupPropertyValue(
: null;
case 'DATE':
return apiValues.value != null
- ? { type: 'Date', value: apiValues.value }
+ ? { type: 'Date', value: apiValues.value.toISOString() }
: null;
case 'SELECT_STRING':
case 'SELECT_NUMBER':
diff --git a/js/app/packages/queries/soup/normalized-cache/operations.ts b/js/app/packages/queries/soup/normalized-cache/operations.ts
index 41a95e6d5d..67cf09ddd7 100644
--- a/js/app/packages/queries/soup/normalized-cache/operations.ts
+++ b/js/app/packages/queries/soup/normalized-cache/operations.ts
@@ -285,7 +285,7 @@ export function optimisticUpdateSoupItemViewedAt(itemId: string) {
} else {
optimisticUpdateSoupEntity({
tag: current.tag,
- data: { id: itemId, viewedAt: now.getTime() },
+ data: { id: itemId, viewedAt: now.toISOString() },
frecency_score: current.frecency_score,
});
}
diff --git a/js/app/packages/queries/soup/transform-utils.ts b/js/app/packages/queries/soup/transform-utils.ts
index 1426872ca8..ffd55b11a5 100644
--- a/js/app/packages/queries/soup/transform-utils.ts
+++ b/js/app/packages/queries/soup/transform-utils.ts
@@ -36,6 +36,7 @@ import type {
SoupPage,
} from '@service-storage/generated/schemas';
import type { UseQueryResult } from '@tanstack/solid-query';
+import { max } from 'date-fns';
const SEARCH_MATCH_LENGTH = 60;
@@ -239,7 +240,7 @@ export const useSearchResponseItemMapper = () => {
.map((m) => m.sent_at)
.filter((m) => m != null);
const latestMessageSentAt =
- messagesSentAt.length > 0 ? Math.max(...messagesSentAt) : null;
+ messagesSentAt.length > 0 ? max(messagesSentAt) : null;
return {
type: 'email',
@@ -248,7 +249,7 @@ export const useSearchResponseItemMapper = () => {
ownerId: result.owner_id,
createdAt: latestMessageSentAt ?? result.created_at,
updatedAt: latestMessageSentAt ?? result.updated_at,
- viewedAt: result.viewed_at ?? undefined,
+ viewedAt: result.viewed_at,
isRead: singleMessage
? !messageHits[0].labels.includes('UNREAD')
: false,
@@ -308,7 +309,7 @@ export const useSearchResponseItemMapper = () => {
createdAt: result.metadata?.created_at,
updatedAt: result.metadata?.updated_at,
channelType: result.channel_type as ChannelType,
- interactedAt: result.metadata?.interacted_at ?? undefined,
+ interactedAt: result.metadata?.interacted_at,
participantIds: channelWithLatest?.participants?.map(
(p) => p.user_id
),
@@ -385,10 +386,12 @@ export const mapSoupPageToEntityList: (
if (item.tag === 'chat') {
return {
...item.data,
+ createdAt: item.data.createdAt,
+ updatedAt: item.data.updatedAt,
type: item.tag,
name: item.data.name || 'New Chat',
frecencyScore: item.frecency_score,
- viewedAt: item.data.viewedAt ?? undefined,
+ viewedAt: item.data.viewedAt,
projectId: item.data.projectId ?? undefined,
};
}
@@ -400,7 +403,7 @@ export const mapSoupPageToEntityList: (
id: item.data.id,
ownerId: item.data.ownerId,
frecencyScore: item.frecency_score,
- viewedAt: item.data.viewedAt ?? undefined,
+ viewedAt: item.data.viewedAt,
projectId: item.data.parentId ?? undefined,
type: item.tag,
name: item.data.name || 'New Project',
@@ -415,6 +418,8 @@ export const mapSoupPageToEntityList: (
return {
...item.data,
+ createdAt: item.data.createdAt,
+ updatedAt: item.data.updatedAt,
senderEmail: item.data.senderEmail ?? undefined,
senderName: item.data.senderName ?? undefined,
snippet: item.data.snippet ?? undefined,
@@ -422,7 +427,7 @@ export const mapSoupPageToEntityList: (
type: 'email',
name: item.data.name || 'Email Thread',
frecencyScore: item.frecency_score,
- viewedAt: item.data.viewedAt ?? undefined,
+ viewedAt: item.data.viewedAt,
participants,
};
}
@@ -435,21 +440,15 @@ export const mapSoupPageToEntityList: (
channelType: item.data.channel.channel_type,
ownerId: item.data.channel.owner_id,
frecencyScore: item.frecency_score ?? 0,
- updatedAt: Date.parse(item.data.channel.updated_at),
- createdAt: Date.parse(item.data.channel.created_at),
+ updatedAt: item.data.channel.updated_at,
+ createdAt: item.data.channel.created_at,
participantIds: item.data.participants.map((p) => p.user_id),
- viewedAt: item.data.viewed_at
- ? Date.parse(item.data.viewed_at)
- : item.data.interacted_at
- ? Date.parse(item.data.interacted_at)
- : undefined,
+ viewedAt: item.data.viewed_at ?? item.data.interacted_at,
latestMessage: item.data.latest_non_thread_message
? {
content: item.data.latest_non_thread_message.content,
senderId: item.data.latest_non_thread_message.sender_id,
- createdAt: Date.parse(
- item.data.latest_non_thread_message.created_at
- ),
+ createdAt: item.data.latest_non_thread_message.created_at,
}
: undefined,
};
@@ -458,9 +457,11 @@ export const mapSoupPageToEntityList: (
return {
...item.data,
+ createdAt: item.data.createdAt,
+ updatedAt: item.data.updatedAt,
type: item.tag,
frecencyScore: item.frecency_score,
- viewedAt: item.data.viewedAt ?? undefined,
+ viewedAt: item.data.viewedAt,
fileType: item.data.fileType ?? undefined,
projectId: item.data.projectId ?? undefined,
subType:
diff --git a/js/app/packages/queries/storage/project-preview.ts b/js/app/packages/queries/storage/project-preview.ts
index 87aee1aa67..2cdcd91685 100644
--- a/js/app/packages/queries/storage/project-preview.ts
+++ b/js/app/packages/queries/storage/project-preview.ts
@@ -1,14 +1,11 @@
-import { SERVER_HOSTS } from '@core/constant/servers';
import {
catchToResult,
isErr,
ok,
type MaybeResult,
} from '@core/util/maybeResult';
-import type {
- GetBatchProjectPreviewResponse,
- ProjectPreviewData,
-} from '@service-storage/generated/schemas';
+import type { ProjectPreviewData } from '@service-storage/generated/schemas';
+import { storageServiceClient } from '@service-storage/client';
import { useQuery } from '@tanstack/solid-query';
import type { Accessor } from 'solid-js';
import { queryClient } from '../client';
@@ -23,28 +20,15 @@ const PROJECT_PREVIEW_GC_TIME = 10 * 60 * 1000; // 10 minutes
async function fetchProjectPreview(
projectId: string
): Promise<ProjectPreviewData> {
- const dssHost = SERVER_HOSTS['document-storage-service'];
- const apiVersion = 'v2';
- const url = `${dssHost}/${apiVersion}/projects/preview`;
-
- const response = await fetch(url, {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- credentials: 'include',
- body: JSON.stringify({
- projectIds: [projectId],
- }),
+ const result = await storageServiceClient.projects.getPreview({
+ projectIds: [projectId],
});
- if (!response.ok) {
- throw new Error(`Failed to fetch project preview: ${response.statusText}`);
+ if (isErr(result)) {
+ throw new Error(`Failed to fetch project preview`);
}
- const json = (await response.json()) as GetBatchProjectPreviewResponse;
-
- const projectPreview = json.previews.find(
+ const projectPreview = result[1].previews.find(
(preview) => preview.id === projectId
);
diff --git a/js/app/packages/queries/storage/projects.ts b/js/app/packages/queries/storage/projects.ts
index a5fd2be917..4c107434b4 100644
--- a/js/app/packages/queries/storage/projects.ts
+++ b/js/app/packages/queries/storage/projects.ts
@@ -1,5 +1,6 @@
import { ENABLE_PROJECT_SHARING } from '@core/constant/featureFlags';
import { useUserId } from '@core/context/user';
+import { compareDateDesc } from '@core/util/date';
import { isOk } from '@core/util/maybeResult';
import { type MutationCallbacks, withCallbacks } from '@queries/utils';
import { storageServiceClient } from '@service-storage/client';
@@ -43,7 +44,9 @@ function projectsQueryOptions() {
}
function sortProjects(projects: Project[]): Project[] {
- return [...projects].sort((a, b) => b.createdAt - a.createdAt);
+ return [...projects].sort((a, b) =>
+ compareDateDesc(a.createdAt, b.createdAt)
+ );
}
function filterByUserId(
@@ -161,13 +164,13 @@ export function useCreateProjectMutation(
const tempProjectId = uuidv4();
const tempProject: Project = {
- createdAt: Date.now(),
+ createdAt: new Date().toISOString(),
id: tempProjectId,
name: params.name,
parentId: params.parentId,
type: 'project',
userId: '',
- updatedAt: Date.now(),
+ updatedAt: new Date().toISOString(),
deletedAt: null,
};
diff --git a/js/app/packages/service-clients/orval.config.ts b/js/app/packages/service-clients/orval.config.ts
index 3df95d3e13..9bca18a376 100644
--- a/js/app/packages/service-clients/orval.config.ts
+++ b/js/app/packages/service-clients/orval.config.ts
@@ -6,6 +6,9 @@ export default defineConfig({
client: 'fetch',
target: './service-auth/generated/client.ts',
schemas: './service-auth/generated/schemas',
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-auth/openapi.json',
@@ -16,6 +19,9 @@ export default defineConfig({
client: 'fetch',
target: './service-cognition/generated/client.ts',
schemas: './service-cognition/generated/schemas',
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-cognition/openapi.json',
@@ -26,6 +32,9 @@ export default defineConfig({
client: 'fetch',
target: './service-comms/generated/client.ts',
schemas: './service-comms/generated/models',
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-comms/openapi.json',
@@ -36,6 +45,9 @@ export default defineConfig({
client: 'fetch',
target: './service-connection/generated/client.ts',
schemas: './service-connection/generated/schemas',
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-connection/openapi.json',
@@ -46,6 +58,9 @@ export default defineConfig({
client: 'fetch',
target: './service-contacts/generated/client.ts',
schemas: './service-contacts/generated/schemas',
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-contacts/openapi.json',
@@ -56,6 +71,9 @@ export default defineConfig({
client: 'fetch',
target: './service-email/generated/client.ts',
schemas: './service-email/generated/schemas',
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-email/openapi.json',
@@ -67,6 +85,9 @@ export default defineConfig({
client: 'fetch',
target: './service-notification/generated/client.ts',
schemas: './service-notification/generated/schemas',
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-notification/openapi.json',
@@ -79,6 +100,9 @@ export default defineConfig({
target: './service-organization/generated/zod.ts',
schemas: './service-organization/generated/schemas',
biome: true,
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-organization/openapi.json',
@@ -92,6 +116,9 @@ export default defineConfig({
schemas: './service-properties/generated/schemas',
indexFiles: false,
biome: true,
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-properties/openapi.json',
@@ -102,6 +129,9 @@ export default defineConfig({
client: 'fetch',
target: './service-search/generated/client.ts',
schemas: './service-search/generated/models',
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-search/openapi.json',
@@ -112,6 +142,9 @@ export default defineConfig({
client: 'fetch',
target: './service-static-files/generated/client.ts',
schemas: './service-static-files/generated/schemas',
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-static-files/openapi.json',
@@ -124,6 +157,9 @@ export default defineConfig({
target: './service-storage/generated/zod.ts',
schemas: './service-storage/generated/schemas',
biome: true,
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-storage/openapi.json',
@@ -134,6 +170,9 @@ export default defineConfig({
client: 'fetch',
target: './service-unfurl/generated/client.ts',
schemas: './service-unfurl/generated/schemas',
+ override: {
+ useDates: false,
+ },
},
input: {
target: './service-unfurl/openapi.json',
diff --git a/js/app/packages/service-clients/service-auth/client.ts b/js/app/packages/service-clients/service-auth/client.ts
index d3649b3aa5..af53b2389e 100644
--- a/js/app/packages/service-clients/service-auth/client.ts
+++ b/js/app/packages/service-clients/service-auth/client.ts
@@ -202,11 +202,15 @@ export const authServiceClient = {
},
});
},
- async postProfilePictures(args: GetProfilePicturesRequestBody) {
+ async postProfilePictures(
+ args: GetProfilePicturesRequestBody,
+ init?: SafeFetchInit
+ ) {
return mapOk(
await fetchWithAuth<ProfilePictures>(
`${authHost}/user/profile_pictures`,
{
+ ...init,
method: 'POST',
body: JSON.stringify(args),
}
diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/chat.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/chat.ts
index 0253ec8581..d5745afbd2 100644
--- a/js/app/packages/service-clients/service-cognition/generated/schemas/chat.ts
+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/chat.ts
@@ -4,16 +4,18 @@
* Document Cognition Service
* OpenAPI spec version: 1.0.0
*/
+import type { ChatCreatedAt } from './chatCreatedAt';
import type { ChatDeletedAt } from './chatDeletedAt';
import type { ChatModel } from './chatModel';
import type { ChatProjectId } from './chatProjectId';
import type { ChatTokenCount } from './chatTokenCount';
+import type { ChatUpdatedAt } from './chatUpdatedAt';
export interface Chat {
/** The time the chat was created */
- createdAt: number;
+ createdAt?: ChatCreatedAt;
/** The time the chat was deleted */
- deletedAt: ChatDeletedAt;
+ deletedAt?: ChatDeletedAt;
/** The chat uuid */
id: string;
isPersistent: boolean;
@@ -25,7 +27,7 @@ export interface Chat {
projectId?: ChatProjectId;
tokenCount?: ChatTokenCount;
/** The time the chat was last updated */
- updatedAt: number;
+ updatedAt?: ChatUpdatedAt;
/** Who the chat belongs to */
userId: string;
}
diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/chatCreatedAt.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/chatCreatedAt.ts
new file mode 100644
index 0000000000..73cf37833b
--- /dev/null
+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/chatCreatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * Document Cognition Service
+ * OpenAPI spec version: 1.0.0
+ */
+
+/**
+ * The time the chat was created
+ */
+export type ChatCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/chatDeletedAt.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/chatDeletedAt.ts
index fe9c7a7bce..943ff21de4 100644
--- a/js/app/packages/service-clients/service-cognition/generated/schemas/chatDeletedAt.ts
+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/chatDeletedAt.ts
@@ -8,4 +8,4 @@
/**
* The time the chat was deleted
*/
-export type ChatDeletedAt = number | null;
+export type ChatDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/chatPreviewData.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/chatPreviewData.ts
index 8a9e7fd661..7ba7ddcc13 100644
--- a/js/app/packages/service-clients/service-cognition/generated/schemas/chatPreviewData.ts
+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/chatPreviewData.ts
@@ -4,10 +4,11 @@
* Document Cognition Service
* OpenAPI spec version: 1.0.0
*/
+import type { ChatPreviewDataUpdatedAt } from './chatPreviewDataUpdatedAt';
export interface ChatPreviewData {
chat_id: string;
chat_name: string;
owner: string;
- updated_at: number;
+ updated_at?: ChatPreviewDataUpdatedAt;
}
diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/chatPreviewDataUpdatedAt.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/chatPreviewDataUpdatedAt.ts
new file mode 100644
index 0000000000..b758d92354
--- /dev/null
+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/chatPreviewDataUpdatedAt.ts
@@ -0,0 +1,8 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * Document Cognition Service
+ * OpenAPI spec version: 1.0.0
+ */
+
+export type ChatPreviewDataUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/chatResponse.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/chatResponse.ts
index 98bcf7fb28..581533c87d 100644
--- a/js/app/packages/service-clients/service-cognition/generated/schemas/chatResponse.ts
+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/chatResponse.ts
@@ -6,9 +6,11 @@
*/
import type { ChatAttachmentWithName } from './chatAttachmentWithName';
import type { ChatMessageWithAttachments } from './chatMessageWithAttachments';
+import type { ChatResponseCreatedAt } from './chatResponseCreatedAt';
import type { ChatResponseModel } from './chatResponseModel';
import type { ChatResponseProjectId } from './chatResponseProjectId';
import type { ChatResponseTokenCount } from './chatResponseTokenCount';
+import type { ChatResponseUpdatedAt } from './chatResponseUpdatedAt';
import type { ChatResponseWebCitationsItemItem1Item } from './chatResponseWebCitationsItemItem1Item';
import type { Model } from './model';
@@ -21,7 +23,7 @@ export interface ChatResponse {
/** Available models for the chat */
availableModels: Model[];
/** The time the chat was created */
- createdAt: number;
+ createdAt?: ChatResponseCreatedAt;
/** The chat uuid */
id: string;
/** whether the chat is persistent or not */
@@ -36,7 +38,7 @@ export interface ChatResponse {
/** Current number of tokens in the chat */
tokenCount?: ChatResponseTokenCount;
/** The time the chat was last updated */
- updatedAt: number;
+ updatedAt?: ChatResponseUpdatedAt;
/** Who the chat belongs to */
userId: string;
/** message_id - web citation list */
diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/chatResponseCreatedAt.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/chatResponseCreatedAt.ts
new file mode 100644
index 0000000000..c96b24539e
--- /dev/null
+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/chatResponseCreatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * Document Cognition Service
+ * OpenAPI spec version: 1.0.0
+ */
+
+/**
+ * The time the chat was created
+ */
+export type ChatResponseCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/chatResponseUpdatedAt.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/chatResponseUpdatedAt.ts
new file mode 100644
index 0000000000..c6bd1cd090
--- /dev/null
+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/chatResponseUpdatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * Document Cognition Service
+ * OpenAPI spec version: 1.0.0
+ */
+
+/**
+ * The time the chat was last updated
+ */
+export type ChatResponseUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/chatUpdatedAt.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/chatUpdatedAt.ts
new file mode 100644
index 0000000000..aa6a169ce1
--- /dev/null
+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/chatUpdatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * Document Cognition Service
+ * OpenAPI spec version: 1.0.0
+ */
+
+/**
+ * The time the chat was last updated
+ */
+export type ChatUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/index.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/index.ts
index 025322e257..249c9848c4 100644
--- a/js/app/packages/service-clients/service-cognition/generated/schemas/index.ts
+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/index.ts
@@ -36,6 +36,7 @@ export * from './chatAttachmentChatId';
export * from './chatAttachmentMessageId';
export * from './chatAttachmentWithName';
export * from './chatAttachmentWithNameMetadata';
+export * from './chatCreatedAt';
export * from './chatDeletedAt';
export * from './chatHistory';
export * from './chatHistoryBatchMessagesRequest';
@@ -47,6 +48,7 @@ export * from './chatMessageWithAttachmentsModel';
export * from './chatModel';
export * from './chatPreview';
export * from './chatPreviewData';
+export * from './chatPreviewDataUpdatedAt';
export * from './chatPreviewOneOf';
export * from './chatPreviewOneOfAllOf';
export * from './chatPreviewOneOfAllOfType';
@@ -58,15 +60,18 @@ export * from './chatPreviewOneOfSevenAllOf';
export * from './chatPreviewOneOfSevenAllOfType';
export * from './chatProjectId';
export * from './chatResponse';
+export * from './chatResponseCreatedAt';
export * from './chatResponseModel';
export * from './chatResponseProjectId';
export * from './chatResponseTokenCount';
+export * from './chatResponseUpdatedAt';
export * from './chatResponseWebCitationsItemItem1Item';
export * from './chatResponseWebCitationsItemItem1ItemDescription';
export * from './chatResponseWebCitationsItemItem1ItemFaviconUrl';
export * from './chatResponseWebCitationsItemItem1ItemImageUrl';
export * from './chatsResponse';
export * from './chatTokenCount';
+export * from './chatUpdatedAt';
export * from './conversationRecord';
export * from './copyChatRequest';
export * from './createChatRequest';
diff --git a/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts b/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts
index 520a933443..f49f6a8234 100644
--- a/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts
+++ b/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts
@@ -109,11 +109,15 @@ export const SearchToolResponse = z.object({
metadata: z
.union([
z.object({
- created_at: z.number().int(),
- deleted_at: z.union([z.number().int(), z.null()]).optional(),
+ created_at: z.string().datetime({ offset: true }),
+ deleted_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
project_id: z.union([z.string(), z.null()]).optional(),
- updated_at: z.number().int(),
- viewed_at: z.union([z.number().int(), z.null()]).optional(),
+ updated_at: z.string().datetime({ offset: true }),
+ viewed_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
}),
z.null(),
])
@@ -147,11 +151,15 @@ export const SearchToolResponse = z.object({
metadata: z
.union([
z.object({
- created_at: z.number().int(),
- deleted_at: z.union([z.number().int(), z.null()]).optional(),
+ created_at: z.string().datetime({ offset: true }),
+ deleted_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
project_id: z.union([z.string(), z.null()]).optional(),
- updated_at: z.number().int(),
- viewed_at: z.union([z.number().int(), z.null()]).optional(),
+ updated_at: z.string().datetime({ offset: true }),
+ viewed_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
}),
z.null(),
])
@@ -162,7 +170,7 @@ export const SearchToolResponse = z.object({
user_id: z.string(),
}),
z.object({
- created_at: z.number().int(),
+ created_at: z.string().datetime({ offset: true }),
email_message_search_results: z.array(
z.object({
bcc: z.array(z.string()),
@@ -182,7 +190,9 @@ export const SearchToolResponse = z.object({
recipients: z.array(z.string()),
score: z.union([z.number(), z.null()]).optional(),
sender: z.string(),
- sent_at: z.union([z.number().int(), z.null()]).optional(),
+ sent_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
})
),
id: z.string().uuid(),
@@ -192,15 +202,19 @@ export const SearchToolResponse = z.object({
subject: z.union([z.string(), z.null()]).optional(),
thread_id: z.string().uuid(),
type: z.literal('email'),
- updated_at: z.number().int(),
+ updated_at: z.string().datetime({ offset: true }),
user_id: z.string(),
- viewed_at: z.union([z.number().int(), z.null()]).optional(),
+ viewed_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
}),
z.object({
channel_id: z.string().uuid(),
channel_message_search_results: z.array(
z.object({
- created_at: z.union([z.number().int(), z.null()]).optional(),
+ created_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
highlight: z.object({
bcc: z.array(z.string()).optional(),
cc: z.array(z.string()).optional(),
@@ -214,7 +228,9 @@ export const SearchToolResponse = z.object({
score: z.union([z.number(), z.null()]).optional(),
sender_id: z.union([z.string(), z.null()]).optional(),
thread_id: z.union([z.string().uuid(), z.null()]).optional(),
- updated_at: z.union([z.number().int(), z.null()]).optional(),
+ updated_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
})
),
channel_type: z.string(),
@@ -222,10 +238,14 @@ export const SearchToolResponse = z.object({
metadata: z
.union([
z.object({
- created_at: z.number().int(),
- interacted_at: z.union([z.number().int(), z.null()]).optional(),
- updated_at: z.number().int(),
- viewed_at: z.union([z.number().int(), z.null()]).optional(),
+ created_at: z.string().datetime({ offset: true }),
+ interacted_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
+ updated_at: z.string().datetime({ offset: true }),
+ viewed_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
}),
z.null(),
])
@@ -234,16 +254,20 @@ export const SearchToolResponse = z.object({
type: z.literal('channel'),
}),
z.object({
- created_at: z.number().int(),
+ created_at: z.string().datetime({ offset: true }),
id: z.string().uuid(),
metadata: z
.union([
z.object({
- created_at: z.number().int(),
- deleted_at: z.union([z.number().int(), z.null()]).optional(),
+ created_at: z.string().datetime({ offset: true }),
+ deleted_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
parent_project_id: z.union([z.string(), z.null()]).optional(),
- updated_at: z.number().int(),
- viewed_at: z.union([z.number().int(), z.null()]).optional(),
+ updated_at: z.string().datetime({ offset: true }),
+ viewed_at: z
+ .union([z.string().datetime({ offset: true }), z.null()])
+ .optional(),
}),
z.null(),
])
@@ -265,7 +289,7 @@ export const SearchToolResponse = z.object({
})
),
type: z.literal('project'),
- updated_at: z.number().int(),
+ updated_at: z.string().datetime({ offset: true }),
}),
];
const errors = schemas.reduce<z.ZodError[]>(
diff --git a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts b/js/app/packages/service-clients/service-cognition/generated/tools/types.ts
index dea91ce3b1..fd212d5d40 100644
--- a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts
+++ b/js/app/packages/service-clients/service-cognition/generated/tools/types.ts
@@ -199,11 +199,11 @@ export interface SearchToolResponse {
* Metadata from the database. None if the document doesn't exist in the database.
*/
metadata?: {
- created_at: number;
- deleted_at?: number | null;
+ created_at: string;
+ deleted_at?: string | null;
project_id?: string | null;
- updated_at: number;
- viewed_at?: number | null;
+ updated_at: string;
+ viewed_at?: string | null;
} | null;
name: string;
owner_id: string;
@@ -281,11 +281,11 @@ export interface SearchToolResponse {
* Metadata from the database. None if the chat doesn't exist in the database.
*/
metadata?: {
- created_at: number;
- deleted_at?: number | null;
+ created_at: string;
+ deleted_at?: string | null;
project_id?: string | null;
- updated_at: number;
- viewed_at?: number | null;
+ updated_at: string;
+ viewed_at?: string | null;
} | null;
name: string;
owner_id: string;
@@ -296,7 +296,7 @@ export interface SearchToolResponse {
user_id: string;
}
| {
- created_at: number;
+ created_at: string;
/**
* The search results for the document
* This may be empty if the search result match was on the email subject only
@@ -375,7 +375,7 @@ export interface SearchToolResponse {
* When the email message was sent
* This is only present if the search result is on the message content
*/
- sent_at?: number | null;
+ sent_at?: string | null;
}[];
/**
* Standardized fields that all item types will share.
@@ -399,12 +399,12 @@ export interface SearchToolResponse {
*/
thread_id: string;
type: 'email';
- updated_at: number;
+ updated_at: string;
/**
* The id of the owner of the email thread
*/
user_id: string;
- viewed_at?: number | null;
+ viewed_at?: string | null;
}
| {
/**
@@ -420,7 +420,7 @@ export interface SearchToolResponse {
* When the channel message was created
* This is only prsent if the search result is on the message content
*/
- created_at?: number | null;
+ created_at?: string | null;
/**
* The highlights for the channel message
*/
@@ -476,7 +476,7 @@ export interface SearchToolResponse {
* When the channel message was last updated
* This is only prsent if the search result is on the message content
*/
- updated_at?: number | null;
+ updated_at?: string | null;
}[];
/**
* The type of channel
@@ -492,10 +492,10 @@ export interface SearchToolResponse {
* Metadata from the database. None if the channel doesn't exist in the database.
*/
metadata?: {
- created_at: number;
- interacted_at?: number | null;
- updated_at: number;
- viewed_at?: number | null;
+ created_at: string;
+ interacted_at?: string | null;
+ updated_at: string;
+ viewed_at?: string | null;
} | null;
/**
* we don't store this for channels atm but keeping it here for consistency
@@ -504,7 +504,7 @@ export interface SearchToolResponse {
type: 'channel';
}
| {
- created_at: number;
+ created_at: string;
/**
* Standardized fields that all item types will share.
* These field names are being aligned across all item types
@@ -515,11 +515,11 @@ export interface SearchToolResponse {
* Metadata from the database. None if the project doesn't exist in the database.
*/
metadata?: {
- created_at: number;
- deleted_at?: number | null;
+ created_at: string;
+ deleted_at?: string | null;
parent_project_id?: string | null;
- updated_at: number;
- viewed_at?: number | null;
+ updated_at: string;
+ viewed_at?: string | null;
} | null;
name: string;
owner_id: string;
@@ -560,7 +560,7 @@ export interface SearchToolResponse {
score?: number | null;
}[];
type: 'project';
- updated_at: number;
+ updated_at: string;
}
)[];
}
diff --git a/js/app/packages/service-clients/service-cognition/openapi.json b/js/app/packages/service-clients/service-cognition/openapi.json
index 19e631c481..cae214ff4a 100644
--- a/js/app/packages/service-clients/service-cognition/openapi.json
+++ b/js/app/packages/service-clients/service-cognition/openapi.json
@@ -1292,24 +1292,16 @@
},
"Chat": {
"type": "object",
- "required": [
- "id",
- "name",
- "userId",
- "createdAt",
- "updatedAt",
- "isPersistent",
- "deletedAt"
- ],
+ "required": ["id", "name", "userId", "isPersistent"],
"properties": {
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the chat was created"
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the chat was deleted"
},
"id": {
@@ -1336,8 +1328,8 @@
"format": "int64"
},
"updatedAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the chat was last updated"
},
"userId": {
@@ -1546,7 +1538,7 @@
},
"ChatPreviewData": {
"type": "object",
- "required": ["chat_id", "chat_name", "owner", "updated_at"],
+ "required": ["chat_id", "chat_name", "owner"],
"properties": {
"chat_id": {
"type": "string"
@@ -1558,8 +1550,8 @@
"type": "string"
},
"updated_at": {
- "type": "integer",
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
},
@@ -1570,8 +1562,6 @@
"userId",
"name",
"messages",
- "createdAt",
- "updatedAt",
"attachments",
"availableModels",
"webCitations",
@@ -1594,8 +1584,8 @@
"description": "Available models for the chat"
},
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the chat was created"
},
"id": {
@@ -1638,8 +1628,8 @@
"description": "Current number of tokens in the chat"
},
"updatedAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the chat was last updated"
},
"userId": {
diff --git a/js/app/packages/service-clients/service-email/client.ts b/js/app/packages/service-clients/service-email/client.ts
index fbe920e2fc..0805f67af1 100644
--- a/js/app/packages/service-clients/service-email/client.ts
+++ b/js/app/packages/service-clients/service-email/client.ts
@@ -83,23 +83,28 @@ export const emailClient = {
(result) => result
);
},
- async getPreviews(args: {
- view: string;
- limit: number;
- sort_method: string;
- cursor?: string;
- }) {
+ async getPreviews(
+ args: {
+ view: string;
+ limit?: number;
+ sort_method?: string;
+ cursor?: string;
+ },
+ init?: SafeFetchInit
+ ) {
const { view, ...params } = args;
const p = Object.entries(params)
+ .filter(([, v]) => v != null)
.map(([k, v]) => `${k}=${v}`)
.join('&');
- const qp = p.length > 0 ? '?' + p : p;
+ const qp = p.length > 0 ? '?' + p : '';
return mapOk(
await emailFetch<ApiPaginatedThreadCursor>(
`/email/threads/previews/cursor/${view}${qp}`,
{
method: 'GET',
+ ...init,
}
),
(result) => result
diff --git a/js/app/packages/service-clients/service-email/generated/schemas/apiAttachment.ts b/js/app/packages/service-clients/service-email/generated/schemas/apiAttachment.ts
index ec2c5606fa..9dce9ae843 100644
--- a/js/app/packages/service-clients/service-email/generated/schemas/apiAttachment.ts
+++ b/js/app/packages/service-clients/service-email/generated/schemas/apiAttachment.ts
@@ -12,7 +12,7 @@ import type { ApiAttachmentSizeBytes } from './apiAttachmentSizeBytes';
export interface ApiAttachment {
contentId?: ApiAttachmentContentId;
- createdAt: number;
+ createdAt: string;
filename?: ApiAttachmentFilename;
id: string;
messageId: string;
diff --git a/js/app/packages/service-clients/service-email/generated/schemas/apiThreadPreviewCursorInner.ts b/js/app/packages/service-clients/service-email/generated/schemas/apiThreadPreviewCursorInner.ts
index ce107475fb..4ecef98173 100644
--- a/js/app/packages/service-clients/service-email/generated/schemas/apiThreadPreviewCursorInner.ts
+++ b/js/app/packages/service-clients/service-email/generated/schemas/apiThreadPreviewCursorInner.ts
@@ -13,7 +13,7 @@ import type { ApiThreadPreviewCursorInnerSnippet } from './apiThreadPreviewCurso
import type { ApiThreadPreviewCursorInnerViewedAt } from './apiThreadPreviewCursorInnerViewedAt';
export interface ApiThreadPreviewCursorInner {
- createdAt: number;
+ createdAt: string;
id: string;
inboxVisible: boolean;
isDraft: boolean;
@@ -26,7 +26,7 @@ export interface ApiThreadPreviewCursorInner {
senderName?: ApiThreadPreviewCursorInnerSenderName;
senderPhotoUrl?: ApiThreadPreviewCursorInnerSenderPhotoUrl;
snippet?: ApiThreadPreviewCursorInnerSnippet;
- sortTs: number;
- updatedAt: number;
- viewedAt: ApiThreadPreviewCursorInnerViewedAt;
+ sortTs: string;
+ updatedAt: string;
+ viewedAt?: ApiThreadPreviewCursorInnerViewedAt;
}
diff --git a/js/app/packages/service-clients/service-email/generated/schemas/apiThreadPreviewCursorInnerViewedAt.ts b/js/app/packages/service-clients/service-email/generated/schemas/apiThreadPreviewCursorInnerViewedAt.ts
index 1a0cd13a80..1ecc38bb3b 100644
--- a/js/app/packages/service-clients/service-email/generated/schemas/apiThreadPreviewCursorInnerViewedAt.ts
+++ b/js/app/packages/service-clients/service-email/generated/schemas/apiThreadPreviewCursorInnerViewedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type ApiThreadPreviewCursorInnerViewedAt = number | null;
+export type ApiThreadPreviewCursorInnerViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-email/generated/schemas/threadPreviewCursor.ts b/js/app/packages/service-clients/service-email/generated/schemas/threadPreviewCursor.ts
index 4dcdca88f9..1f9b2ce8c8 100644
--- a/js/app/packages/service-clients/service-email/generated/schemas/threadPreviewCursor.ts
+++ b/js/app/packages/service-clients/service-email/generated/schemas/threadPreviewCursor.ts
@@ -19,7 +19,7 @@ import type { ThreadPreviewCursorViewedAt } from './threadPreviewCursorViewedAt'
*/
export interface ThreadPreviewCursor {
attachments: Attachment[];
- createdAt: number;
+ createdAt: string;
id: string;
inboxVisible: boolean;
isDraft: boolean;
@@ -33,7 +33,7 @@ export interface ThreadPreviewCursor {
senderName?: ThreadPreviewCursorSenderName;
senderPhotoUrl?: ThreadPreviewCursorSenderPhotoUrl;
snippet?: ThreadPreviewCursorSnippet;
- sortTs: number;
- updatedAt: number;
- viewedAt: ThreadPreviewCursorViewedAt;
+ sortTs: string;
+ updatedAt: string;
+ viewedAt?: ThreadPreviewCursorViewedAt;
}
diff --git a/js/app/packages/service-clients/service-email/generated/schemas/threadPreviewCursorViewedAt.ts b/js/app/packages/service-clients/service-email/generated/schemas/threadPreviewCursorViewedAt.ts
index 550208f2d7..70c6927f93 100644
--- a/js/app/packages/service-clients/service-email/generated/schemas/threadPreviewCursorViewedAt.ts
+++ b/js/app/packages/service-clients/service-email/generated/schemas/threadPreviewCursorViewedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type ThreadPreviewCursorViewedAt = number | null;
+export type ThreadPreviewCursorViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-email/openapi.json b/js/app/packages/service-clients/service-email/openapi.json
index 1844f4cfc7..ad44270ed0 100644
--- a/js/app/packages/service-clients/service-email/openapi.json
+++ b/js/app/packages/service-clients/service-email/openapi.json
@@ -2086,8 +2086,8 @@
"type": ["string", "null"]
},
"createdAt": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"filename": {
"type": ["string", "null"]
@@ -2255,13 +2255,12 @@
"isImportant",
"sortTs",
"createdAt",
- "updatedAt",
- "viewedAt"
+ "updatedAt"
],
"properties": {
"createdAt": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"id": {
"type": "string",
@@ -2301,16 +2300,16 @@
"type": ["string", "null"]
},
"sortTs": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"updatedAt": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"viewedAt": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
},
@@ -3386,8 +3385,7 @@
"participants",
"sortTs",
"createdAt",
- "updatedAt",
- "viewedAt"
+ "updatedAt"
],
"properties": {
"attachments": {
@@ -3397,8 +3395,8 @@
}
},
"createdAt": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"id": {
"type": "string",
@@ -3444,16 +3442,16 @@
"type": ["string", "null"]
},
"sortTs": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"updatedAt": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"viewedAt": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
},
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOf.ts b/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOf.ts
index 45c12a25bf..f499e3ab90 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOf.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOf.ts
@@ -4,6 +4,7 @@
* notification_service
* OpenAPI spec version: 0.1.0
*/
+import type { ApiUserNotificationAllOfCreatedAt } from './apiUserNotificationAllOfCreatedAt';
import type { ApiUserNotificationAllOfDeletedAt } from './apiUserNotificationAllOfDeletedAt';
import type { ApiUserNotificationAllOfSenderId } from './apiUserNotificationAllOfSenderId';
import type { ApiUserNotificationAllOfUpdatedAt } from './apiUserNotificationAllOfUpdatedAt';
@@ -12,9 +13,9 @@ import type { NotifEvent } from './notifEvent';
export type ApiUserNotificationAllOf = {
/** When the notification was created. */
- createdAt: number;
+ createdAt?: ApiUserNotificationAllOfCreatedAt;
/** When the notification was deleted. */
- deletedAt: ApiUserNotificationAllOfDeletedAt;
+ deletedAt?: ApiUserNotificationAllOfDeletedAt;
/** Whether the notification is marked as done. */
done: boolean;
/** The notification ID. */
@@ -31,7 +32,7 @@ TODO make this a new type */
/** Whether the notification has been sent. */
sent: boolean;
/** When the notification was last updated. */
- updatedAt: ApiUserNotificationAllOfUpdatedAt;
+ updatedAt?: ApiUserNotificationAllOfUpdatedAt;
/** When the notification was viewed/seen. */
- viewedAt: ApiUserNotificationAllOfViewedAt;
+ viewedAt?: ApiUserNotificationAllOfViewedAt;
};
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfCreatedAt.ts b/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfCreatedAt.ts
new file mode 100644
index 0000000000..1f0670268f
--- /dev/null
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfCreatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * notification_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * When the notification was created.
+ */
+export type ApiUserNotificationAllOfCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfDeletedAt.ts b/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfDeletedAt.ts
index 2f728764f2..a098c4f9ac 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfDeletedAt.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfDeletedAt.ts
@@ -8,4 +8,4 @@
/**
* When the notification was deleted.
*/
-export type ApiUserNotificationAllOfDeletedAt = number | null;
+export type ApiUserNotificationAllOfDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfUpdatedAt.ts b/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfUpdatedAt.ts
index 0183f78fd8..ac65670963 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfUpdatedAt.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfUpdatedAt.ts
@@ -8,4 +8,4 @@
/**
* When the notification was last updated.
*/
-export type ApiUserNotificationAllOfUpdatedAt = number | null;
+export type ApiUserNotificationAllOfUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfViewedAt.ts b/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfViewedAt.ts
index 03b083b422..6fdb81e59d 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfViewedAt.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/apiUserNotificationAllOfViewedAt.ts
@@ -8,4 +8,4 @@
/**
* When the notification was viewed/seen.
*/
-export type ApiUserNotificationAllOfViewedAt = number | null;
+export type ApiUserNotificationAllOfViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/index.ts b/js/app/packages/service-clients/service-notification/generated/schemas/index.ts
index 080727249f..e6a6ac2275 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/index.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/index.ts
@@ -7,6 +7,7 @@
export * from './apiUserNotification';
export * from './apiUserNotificationAllOf';
+export * from './apiUserNotificationAllOfCreatedAt';
export * from './apiUserNotificationAllOfDeletedAt';
export * from './apiUserNotificationAllOfSenderId';
export * from './apiUserNotificationAllOfUpdatedAt';
diff --git a/js/app/packages/service-clients/service-notification/openapi.json b/js/app/packages/service-clients/service-notification/openapi.json
index b9b92285b4..6a7bcfad06 100644
--- a/js/app/packages/service-clients/service-notification/openapi.json
+++ b/js/app/packages/service-clients/service-notification/openapi.json
@@ -965,21 +965,17 @@
"notificationEventType",
"sent",
"done",
- "createdAt",
- "viewedAt",
- "updatedAt",
- "deletedAt",
"notificationMetadata"
],
"properties": {
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "When the notification was created."
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "When the notification was deleted."
},
"done": {
@@ -1012,13 +1008,13 @@
"description": "Whether the notification has been sent."
},
"updatedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "When the notification was last updated."
},
"viewedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "When the notification was viewed/seen."
}
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/channelMetadata.ts b/js/app/packages/service-clients/service-search/generated/models/channelMetadata.ts
index 399b09969b..65d2dcc8f6 100644
--- a/js/app/packages/service-clients/service-search/generated/models/channelMetadata.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/channelMetadata.ts
@@ -11,8 +11,8 @@ import type { ChannelMetadataViewedAt } from './channelMetadataViewedAt';
* Metadata for a channel fetched from the database
*/
export interface ChannelMetadata {
- created_at: number;
+ created_at: string;
interacted_at?: ChannelMetadataInteractedAt;
- updated_at: number;
+ updated_at: string;
viewed_at?: ChannelMetadataViewedAt;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/channelMetadataInteractedAt.ts b/js/app/packages/service-clients/service-search/generated/models/channelMetadataInteractedAt.ts
index 42473f93bc..198b8b8dfe 100644
--- a/js/app/packages/service-clients/service-search/generated/models/channelMetadataInteractedAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/channelMetadataInteractedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type ChannelMetadataInteractedAt = number | null;
+export type ChannelMetadataInteractedAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/channelMetadataViewedAt.ts b/js/app/packages/service-clients/service-search/generated/models/channelMetadataViewedAt.ts
index 7ee78689d8..80708001fa 100644
--- a/js/app/packages/service-clients/service-search/generated/models/channelMetadataViewedAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/channelMetadataViewedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type ChannelMetadataViewedAt = number | null;
+export type ChannelMetadataViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/channelSearchResultCreatedAt.ts b/js/app/packages/service-clients/service-search/generated/models/channelSearchResultCreatedAt.ts
index 71d62a1cbe..5358851235 100644
--- a/js/app/packages/service-clients/service-search/generated/models/channelSearchResultCreatedAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/channelSearchResultCreatedAt.ts
@@ -9,4 +9,4 @@
* When the channel message was created
This is only prsent if the search result is on the message content
*/
-export type ChannelSearchResultCreatedAt = number | null;
+export type ChannelSearchResultCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/channelSearchResultUpdatedAt.ts b/js/app/packages/service-clients/service-search/generated/models/channelSearchResultUpdatedAt.ts
index 18a2c20bdd..d64aa40db1 100644
--- a/js/app/packages/service-clients/service-search/generated/models/channelSearchResultUpdatedAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/channelSearchResultUpdatedAt.ts
@@ -9,4 +9,4 @@
* When the channel message was last updated
This is only prsent if the search result is on the message content
*/
-export type ChannelSearchResultUpdatedAt = number | null;
+export type ChannelSearchResultUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/chatMetadata.ts b/js/app/packages/service-clients/service-search/generated/models/chatMetadata.ts
index ae745470e6..9172db6e30 100644
--- a/js/app/packages/service-clients/service-search/generated/models/chatMetadata.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/chatMetadata.ts
@@ -12,9 +12,9 @@ import type { ChatMetadataViewedAt } from './chatMetadataViewedAt';
* Metadata for a chat fetched from the database
*/
export interface ChatMetadata {
- created_at: number;
+ created_at: string;
deleted_at?: ChatMetadataDeletedAt;
project_id?: ChatMetadataProjectId;
- updated_at: number;
+ updated_at: string;
viewed_at?: ChatMetadataViewedAt;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/chatMetadataDeletedAt.ts b/js/app/packages/service-clients/service-search/generated/models/chatMetadataDeletedAt.ts
index e3b6fe01fe..efc1f314cb 100644
--- a/js/app/packages/service-clients/service-search/generated/models/chatMetadataDeletedAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/chatMetadataDeletedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type ChatMetadataDeletedAt = number | null;
+export type ChatMetadataDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/chatMetadataViewedAt.ts b/js/app/packages/service-clients/service-search/generated/models/chatMetadataViewedAt.ts
index edc874b134..52d719e719 100644
--- a/js/app/packages/service-clients/service-search/generated/models/chatMetadataViewedAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/chatMetadataViewedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type ChatMetadataViewedAt = number | null;
+export type ChatMetadataViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/documentMetadata.ts b/js/app/packages/service-clients/service-search/generated/models/documentMetadata.ts
index fe7c82a827..5bbb694fd1 100644
--- a/js/app/packages/service-clients/service-search/generated/models/documentMetadata.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/documentMetadata.ts
@@ -12,9 +12,9 @@ import type { DocumentMetadataViewedAt } from './documentMetadataViewedAt';
* Metadata for a document fetched from the database
*/
export interface DocumentMetadata {
- created_at: number;
+ created_at: string;
deleted_at?: DocumentMetadataDeletedAt;
project_id?: DocumentMetadataProjectId;
- updated_at: number;
+ updated_at: string;
viewed_at?: DocumentMetadataViewedAt;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/documentMetadataDeletedAt.ts b/js/app/packages/service-clients/service-search/generated/models/documentMetadataDeletedAt.ts
index 9ba6373429..62e02b16f7 100644
--- a/js/app/packages/service-clients/service-search/generated/models/documentMetadataDeletedAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/documentMetadataDeletedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type DocumentMetadataDeletedAt = number | null;
+export type DocumentMetadataDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/documentMetadataViewedAt.ts b/js/app/packages/service-clients/service-search/generated/models/documentMetadataViewedAt.ts
index ff31b7a0d3..a255974e6f 100644
--- a/js/app/packages/service-clients/service-search/generated/models/documentMetadataViewedAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/documentMetadataViewedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type DocumentMetadataViewedAt = number | null;
+export type DocumentMetadataViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/emailSearchResponseItemWithMetadataAllOf.ts b/js/app/packages/service-clients/service-search/generated/models/emailSearchResponseItemWithMetadataAllOf.ts
index edc7e39daf..90eac765b4 100644
--- a/js/app/packages/service-clients/service-search/generated/models/emailSearchResponseItemWithMetadataAllOf.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/emailSearchResponseItemWithMetadataAllOf.ts
@@ -8,8 +8,8 @@ import type { EmailSearchResponseItemWithMetadataAllOfSnippet } from './emailSea
import type { EmailSearchResponseItemWithMetadataAllOfViewedAt } from './emailSearchResponseItemWithMetadataAllOfViewedAt';
export type EmailSearchResponseItemWithMetadataAllOf = {
- created_at: number;
+ created_at: string;
snippet?: EmailSearchResponseItemWithMetadataAllOfSnippet;
- updated_at: number;
+ updated_at: string;
viewed_at?: EmailSearchResponseItemWithMetadataAllOfViewedAt;
};
diff --git a/js/app/packages/service-clients/service-search/generated/models/emailSearchResponseItemWithMetadataAllOfViewedAt.ts b/js/app/packages/service-clients/service-search/generated/models/emailSearchResponseItemWithMetadataAllOfViewedAt.ts
index ec847d397b..cc98c6c3b3 100644
--- a/js/app/packages/service-clients/service-search/generated/models/emailSearchResponseItemWithMetadataAllOfViewedAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/emailSearchResponseItemWithMetadataAllOfViewedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type EmailSearchResponseItemWithMetadataAllOfViewedAt = number | null;
+export type EmailSearchResponseItemWithMetadataAllOfViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/emailSearchResultSentAt.ts b/js/app/packages/service-clients/service-search/generated/models/emailSearchResultSentAt.ts
index d257ebd79d..5c0e98de7f 100644
--- a/js/app/packages/service-clients/service-search/generated/models/emailSearchResultSentAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/emailSearchResultSentAt.ts
@@ -9,4 +9,4 @@
* When the email message was sent
This is only present if the search result is on the message content
*/
-export type EmailSearchResultSentAt = number | null;
+export type EmailSearchResultSentAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/index.ts b/js/app/packages/service-clients/service-search/generated/models/index.ts
index dbb3861f98..c0f2c7ec97 100644
--- a/js/app/packages/service-clients/service-search/generated/models/index.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/index.ts
@@ -125,33 +125,49 @@ export * from './searchHighlightUserId';
export * from './searchOn';
export * from './searchResponse';
export * from './simpleChannelSearchReponseBaseItem';
+export * from './simpleChannelSearchReponseBaseItemHumanReadableTimestamp';
+export * from './simpleChannelSearchReponseBaseItemHumanReadableTimestampOrgId';
+export * from './simpleChannelSearchReponseBaseItemHumanReadableTimestampThreadId';
export * from './simpleChannelSearchReponseBaseItemOrgId';
export * from './simpleChannelSearchReponseBaseItemThreadId';
-export * from './simpleChannelSearchReponseBaseItemTimestampSeconds';
-export * from './simpleChannelSearchReponseBaseItemTimestampSecondsOrgId';
-export * from './simpleChannelSearchReponseBaseItemTimestampSecondsThreadId';
export * from './simpleChannelSearchResponse';
export * from './simpleChatSearchResponse';
export * from './simpleChatSearchResponseBaseItem';
-export * from './simpleChatSearchResponseBaseItemTimestampSeconds';
+export * from './simpleChatSearchResponseBaseItemHumanReadableTimestamp';
export * from './simpleDocumentSearchResponse';
export * from './simpleDocumentSearchResponseBaseItem';
+export * from './simpleDocumentSearchResponseBaseItemHumanReadableTimestamp';
+export * from './simpleDocumentSearchResponseBaseItemHumanReadableTimestampRawContent';
export * from './simpleDocumentSearchResponseBaseItemRawContent';
-export * from './simpleDocumentSearchResponseBaseItemTimestampSeconds';
-export * from './simpleDocumentSearchResponseBaseItemTimestampSecondsRawContent';
export * from './simpleEmailSearchResponse';
export * from './simpleEmailSearchResponseBaseItem';
+export * from './simpleEmailSearchResponseBaseItemHumanReadableTimestamp';
+export * from './simpleEmailSearchResponseBaseItemHumanReadableTimestampSentAt';
+export * from './simpleEmailSearchResponseBaseItemHumanReadableTimestampSubject';
export * from './simpleEmailSearchResponseBaseItemSentAt';
export * from './simpleEmailSearchResponseBaseItemSubject';
-export * from './simpleEmailSearchResponseBaseItemTimestampSeconds';
-export * from './simpleEmailSearchResponseBaseItemTimestampSecondsSentAt';
-export * from './simpleEmailSearchResponseBaseItemTimestampSecondsSubject';
export * from './simpleProjectSearchResponse';
export * from './simpleProjectSearchResponseBaseItem';
-export * from './simpleProjectSearchResponseBaseItemTimestampSeconds';
+export * from './simpleProjectSearchResponseBaseItemHumanReadableTimestamp';
export * from './simpleUnifiedSearchBaseResponse';
export * from './simpleUnifiedSearchParams';
export * from './simpleUnifiedSearchResponseBaseItem';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestamp';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOf';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOf';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOfType';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFour';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOf';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOfType';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethree';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOf';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOfType';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezero';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOf';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOfType';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSeven';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOf';
+export * from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOfType';
export * from './simpleUnifiedSearchResponseBaseItemOneOf';
export * from './simpleUnifiedSearchResponseBaseItemOneOfAllOf';
export * from './simpleUnifiedSearchResponseBaseItemOneOfAllOfType';
@@ -167,22 +183,6 @@ export * from './simpleUnifiedSearchResponseBaseItemOneOfOnezeroAllOfType';
export * from './simpleUnifiedSearchResponseBaseItemOneOfSeven';
export * from './simpleUnifiedSearchResponseBaseItemOneOfSevenAllOf';
export * from './simpleUnifiedSearchResponseBaseItemOneOfSevenAllOfType';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSeconds';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOf';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOf';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOfType';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFour';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOf';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOfType';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethree';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOf';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOfType';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezero';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOf';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOfType';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSeven';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOf';
-export * from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOfType';
export * from './unifiedSearchFilters';
export * from './unifiedSearchFiltersChannel';
export * from './unifiedSearchFiltersChat';
diff --git a/js/app/packages/service-clients/service-search/generated/models/projectMetadata.ts b/js/app/packages/service-clients/service-search/generated/models/projectMetadata.ts
index f073f70f1b..e4393e157e 100644
--- a/js/app/packages/service-clients/service-search/generated/models/projectMetadata.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/projectMetadata.ts
@@ -12,9 +12,9 @@ import type { ProjectMetadataViewedAt } from './projectMetadataViewedAt';
* Metadata for a project fetched from the database
*/
export interface ProjectMetadata {
- created_at: number;
+ created_at: string;
deleted_at?: ProjectMetadataDeletedAt;
parent_project_id?: ProjectMetadataParentProjectId;
- updated_at: number;
+ updated_at: string;
viewed_at?: ProjectMetadataViewedAt;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/projectMetadataDeletedAt.ts b/js/app/packages/service-clients/service-search/generated/models/projectMetadataDeletedAt.ts
index b0284361f4..e2a164014a 100644
--- a/js/app/packages/service-clients/service-search/generated/models/projectMetadataDeletedAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/projectMetadataDeletedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type ProjectMetadataDeletedAt = number | null;
+export type ProjectMetadataDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/projectMetadataViewedAt.ts b/js/app/packages/service-clients/service-search/generated/models/projectMetadataViewedAt.ts
index 44532d121a..1ba3f9da11 100644
--- a/js/app/packages/service-clients/service-search/generated/models/projectMetadataViewedAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/projectMetadataViewedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type ProjectMetadataViewedAt = number | null;
+export type ProjectMetadataViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/projectSearchMetadata.ts b/js/app/packages/service-clients/service-search/generated/models/projectSearchMetadata.ts
index 800dd20beb..7cbb203cb3 100644
--- a/js/app/packages/service-clients/service-search/generated/models/projectSearchMetadata.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/projectSearchMetadata.ts
@@ -9,9 +9,9 @@
* Metadata associated with Project Search, to be used with SearchResponseItem
*/
export interface ProjectSearchMetadata {
- created_at: number;
+ created_at: string;
owner_id: string;
project_id: string;
project_name: string;
- updated_at: number;
+ updated_at: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/projectSearchResponseItem.ts b/js/app/packages/service-clients/service-search/generated/models/projectSearchResponseItem.ts
index 53fdc5d2dc..a3151ccdea 100644
--- a/js/app/packages/service-clients/service-search/generated/models/projectSearchResponseItem.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/projectSearchResponseItem.ts
@@ -10,7 +10,7 @@ import type { ProjectSearchResult } from './projectSearchResult';
* A single response item, part of the ProjectSearchResponse object
*/
export interface ProjectSearchResponseItem {
- created_at: number;
+ created_at: string;
/** Standardized fields that all item types will share.
These field names are being aligned across all item types
for consistency in our data model. */
@@ -18,5 +18,5 @@ for consistency in our data model. */
name: string;
owner_id: string;
project_search_results: ProjectSearchResult[];
- updated_at: number;
+ updated_at: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItem.ts b/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItem.ts
index 0add782326..6ef78e7439 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItem.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItem.ts
@@ -14,7 +14,7 @@ export interface SimpleChannelSearchReponseBaseItem {
/** The channel type */
channel_type: string;
/** The time the channel message was created */
- created_at: number;
+ created_at: string;
/** The highlights on the channel message */
highlight: SearchHighlight;
/** The mentions */
@@ -28,5 +28,5 @@ export interface SimpleChannelSearchReponseBaseItem {
/** The thread id */
thread_id?: SimpleChannelSearchReponseBaseItemThreadId;
/** The time the channel message was last updated */
- updated_at: number;
+ updated_at: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSeconds.ts b/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemHumanReadableTimestamp.ts
similarity index 52%
rename from js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSeconds.ts
rename to js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemHumanReadableTimestamp.ts
index 51ffd93ccc..affb85f9f7 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSeconds.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemHumanReadableTimestamp.ts
@@ -5,16 +5,16 @@
* OpenAPI spec version: 0.1.0
*/
import type { SearchHighlight } from './searchHighlight';
-import type { SimpleChannelSearchReponseBaseItemTimestampSecondsOrgId } from './simpleChannelSearchReponseBaseItemTimestampSecondsOrgId';
-import type { SimpleChannelSearchReponseBaseItemTimestampSecondsThreadId } from './simpleChannelSearchReponseBaseItemTimestampSecondsThreadId';
+import type { SimpleChannelSearchReponseBaseItemHumanReadableTimestampOrgId } from './simpleChannelSearchReponseBaseItemHumanReadableTimestampOrgId';
+import type { SimpleChannelSearchReponseBaseItemHumanReadableTimestampThreadId } from './simpleChannelSearchReponseBaseItemHumanReadableTimestampThreadId';
-export interface SimpleChannelSearchReponseBaseItemTimestampSeconds {
+export interface SimpleChannelSearchReponseBaseItemHumanReadableTimestamp {
/** The channel id */
channel_id: string;
/** The channel type */
channel_type: string;
/** The time the channel message was created */
- created_at: number;
+ created_at: string;
/** The highlights on the channel message */
highlight: SearchHighlight;
/** The mentions */
@@ -22,11 +22,11 @@ export interface SimpleChannelSearchReponseBaseItemTimestampSeconds {
/** The message id */
message_id: string;
/** The org id */
- org_id?: SimpleChannelSearchReponseBaseItemTimestampSecondsOrgId;
+ org_id?: SimpleChannelSearchReponseBaseItemHumanReadableTimestampOrgId;
/** The sender id */
sender_id: string;
/** The thread id */
- thread_id?: SimpleChannelSearchReponseBaseItemTimestampSecondsThreadId;
+ thread_id?: SimpleChannelSearchReponseBaseItemHumanReadableTimestampThreadId;
/** The time the channel message was last updated */
- updated_at: number;
+ updated_at: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSecondsOrgId.ts b/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemHumanReadableTimestampOrgId.ts
similarity index 67%
rename from js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSecondsOrgId.ts
rename to js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemHumanReadableTimestampOrgId.ts
index 1bb6ba55bb..bd64ee3466 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSecondsOrgId.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemHumanReadableTimestampOrgId.ts
@@ -8,6 +8,6 @@
/**
* The org id
*/
-export type SimpleChannelSearchReponseBaseItemTimestampSecondsOrgId =
+export type SimpleChannelSearchReponseBaseItemHumanReadableTimestampOrgId =
| number
| null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSecondsThreadId.ts b/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemHumanReadableTimestampThreadId.ts
similarity index 67%
rename from js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSecondsThreadId.ts
rename to js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemHumanReadableTimestampThreadId.ts
index 470dc287aa..c80108aae2 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSecondsThreadId.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleChannelSearchReponseBaseItemHumanReadableTimestampThreadId.ts
@@ -8,6 +8,6 @@
/**
* The thread id
*/
-export type SimpleChannelSearchReponseBaseItemTimestampSecondsThreadId =
+export type SimpleChannelSearchReponseBaseItemHumanReadableTimestampThreadId =
| string
| null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleChatSearchResponseBaseItem.ts b/js/app/packages/service-clients/service-search/generated/models/simpleChatSearchResponseBaseItem.ts
index aaba38f641..a1e185752e 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleChatSearchResponseBaseItem.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleChatSearchResponseBaseItem.ts
@@ -18,7 +18,7 @@ export interface SimpleChatSearchResponseBaseItem {
/** The title */
title: string;
/** The time the chat was last updated */
- updated_at: number;
+ updated_at: string;
/** The user id */
user_id: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleChatSearchResponseBaseItemTimestampSeconds.ts b/js/app/packages/service-clients/service-search/generated/models/simpleChatSearchResponseBaseItemHumanReadableTimestamp.ts
similarity index 83%
rename from js/app/packages/service-clients/service-search/generated/models/simpleChatSearchResponseBaseItemTimestampSeconds.ts
rename to js/app/packages/service-clients/service-search/generated/models/simpleChatSearchResponseBaseItemHumanReadableTimestamp.ts
index 99d7d27cb3..6e03935777 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleChatSearchResponseBaseItemTimestampSeconds.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleChatSearchResponseBaseItemHumanReadableTimestamp.ts
@@ -6,7 +6,7 @@
*/
import type { SearchHighlight } from './searchHighlight';
-export interface SimpleChatSearchResponseBaseItemTimestampSeconds {
+export interface SimpleChatSearchResponseBaseItemHumanReadableTimestamp {
/** The chat id */
chat_id: string;
/** The chat message id */
@@ -18,7 +18,7 @@ export interface SimpleChatSearchResponseBaseItemTimestampSeconds {
/** The title */
title: string;
/** The time the chat was last updated */
- updated_at: number;
+ updated_at: string;
/** The user id */
user_id: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItem.ts b/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItem.ts
index 4c36096016..400ce9b813 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItem.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItem.ts
@@ -23,5 +23,5 @@ export interface SimpleDocumentSearchResponseBaseItem {
/** The raw content of the document */
raw_content?: SimpleDocumentSearchResponseBaseItemRawContent;
/** The time the document was last updated */
- updated_at: number;
+ updated_at: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSeconds.ts b/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemHumanReadableTimestamp.ts
similarity index 61%
rename from js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSeconds.ts
rename to js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemHumanReadableTimestamp.ts
index b39fda458e..30143aec7f 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSeconds.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemHumanReadableTimestamp.ts
@@ -5,9 +5,9 @@
* OpenAPI spec version: 0.1.0
*/
import type { SearchHighlight } from './searchHighlight';
-import type { SimpleDocumentSearchResponseBaseItemTimestampSecondsRawContent } from './simpleDocumentSearchResponseBaseItemTimestampSecondsRawContent';
+import type { SimpleDocumentSearchResponseBaseItemHumanReadableTimestampRawContent } from './simpleDocumentSearchResponseBaseItemHumanReadableTimestampRawContent';
-export interface SimpleDocumentSearchResponseBaseItemTimestampSeconds {
+export interface SimpleDocumentSearchResponseBaseItemHumanReadableTimestamp {
/** The document id */
document_id: string;
/** The document name */
@@ -21,7 +21,7 @@ export interface SimpleDocumentSearchResponseBaseItemTimestampSeconds {
/** The owner id */
owner_id: string;
/** The raw content of the document */
- raw_content?: SimpleDocumentSearchResponseBaseItemTimestampSecondsRawContent;
+ raw_content?: SimpleDocumentSearchResponseBaseItemHumanReadableTimestampRawContent;
/** The time the document was last updated */
- updated_at: number;
+ updated_at: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSecondsRawContent.ts b/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemHumanReadableTimestampRawContent.ts
similarity index 68%
rename from js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSecondsRawContent.ts
rename to js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemHumanReadableTimestampRawContent.ts
index e86291b91c..d7c0cbc6cd 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSecondsRawContent.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleDocumentSearchResponseBaseItemHumanReadableTimestampRawContent.ts
@@ -8,6 +8,6 @@
/**
* The raw content of the document
*/
-export type SimpleDocumentSearchResponseBaseItemTimestampSecondsRawContent =
+export type SimpleDocumentSearchResponseBaseItemHumanReadableTimestampRawContent =
| string
| null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItem.ts b/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItem.ts
index bfbd390f31..63ae7b4ee7 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItem.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItem.ts
@@ -32,7 +32,7 @@ export interface SimpleEmailSearchResponseBaseItem {
/** The thread id */
thread_id: string;
/** The time the email was last updated */
- updated_at: number;
+ updated_at: string;
/** The user id */
user_id: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSeconds.ts b/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemHumanReadableTimestamp.ts
similarity index 56%
rename from js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSeconds.ts
rename to js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemHumanReadableTimestamp.ts
index 220fa3632b..1d868e2003 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSeconds.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemHumanReadableTimestamp.ts
@@ -5,10 +5,10 @@
* OpenAPI spec version: 0.1.0
*/
import type { SearchHighlight } from './searchHighlight';
-import type { SimpleEmailSearchResponseBaseItemTimestampSecondsSentAt } from './simpleEmailSearchResponseBaseItemTimestampSecondsSentAt';
-import type { SimpleEmailSearchResponseBaseItemTimestampSecondsSubject } from './simpleEmailSearchResponseBaseItemTimestampSecondsSubject';
+import type { SimpleEmailSearchResponseBaseItemHumanReadableTimestampSentAt } from './simpleEmailSearchResponseBaseItemHumanReadableTimestampSentAt';
+import type { SimpleEmailSearchResponseBaseItemHumanReadableTimestampSubject } from './simpleEmailSearchResponseBaseItemHumanReadableTimestampSubject';
-export interface SimpleEmailSearchResponseBaseItemTimestampSeconds {
+export interface SimpleEmailSearchResponseBaseItemHumanReadableTimestamp {
/** The bcc */
bcc: string[];
/** The cc */
@@ -26,13 +26,13 @@ export interface SimpleEmailSearchResponseBaseItemTimestampSeconds {
/** The sender */
sender: string;
/** The time the email was sent */
- sent_at?: SimpleEmailSearchResponseBaseItemTimestampSecondsSentAt;
+ sent_at?: SimpleEmailSearchResponseBaseItemHumanReadableTimestampSentAt;
/** The subject */
- subject?: SimpleEmailSearchResponseBaseItemTimestampSecondsSubject;
+ subject?: SimpleEmailSearchResponseBaseItemHumanReadableTimestampSubject;
/** The thread id */
thread_id: string;
/** The time the email was last updated */
- updated_at: number;
+ updated_at: string;
/** The user id */
user_id: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSecondsSentAt.ts b/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemHumanReadableTimestampSentAt.ts
similarity index 65%
rename from js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSecondsSentAt.ts
rename to js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemHumanReadableTimestampSentAt.ts
index 4ed942fbbf..cea8bf9ab8 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSecondsSentAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemHumanReadableTimestampSentAt.ts
@@ -8,6 +8,6 @@
/**
* The time the email was sent
*/
-export type SimpleEmailSearchResponseBaseItemTimestampSecondsSentAt =
+export type SimpleEmailSearchResponseBaseItemHumanReadableTimestampSentAt =
| null
- | number;
+ | string;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSecondsSubject.ts b/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemHumanReadableTimestampSubject.ts
similarity index 67%
rename from js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSecondsSubject.ts
rename to js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemHumanReadableTimestampSubject.ts
index b9e72fee51..2b756cc45b 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSecondsSubject.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemHumanReadableTimestampSubject.ts
@@ -8,6 +8,6 @@
/**
* The subject
*/
-export type SimpleEmailSearchResponseBaseItemTimestampSecondsSubject =
+export type SimpleEmailSearchResponseBaseItemHumanReadableTimestampSubject =
| string
| null;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemSentAt.ts b/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemSentAt.ts
index 89ea028c58..51e6f61872 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemSentAt.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleEmailSearchResponseBaseItemSentAt.ts
@@ -8,4 +8,4 @@
/**
* The time the email was sent
*/
-export type SimpleEmailSearchResponseBaseItemSentAt = null | number;
+export type SimpleEmailSearchResponseBaseItemSentAt = null | string;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleProjectSearchResponseBaseItem.ts b/js/app/packages/service-clients/service-search/generated/models/simpleProjectSearchResponseBaseItem.ts
index 13c7f68c93..d197bde899 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleProjectSearchResponseBaseItem.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleProjectSearchResponseBaseItem.ts
@@ -8,7 +8,7 @@ import type { SearchHighlight } from './searchHighlight';
export interface SimpleProjectSearchResponseBaseItem {
/** The time the project was created */
- created_at: number;
+ created_at: string;
/** The highlights on the project */
highlight: SearchHighlight;
/** The project id */
@@ -16,7 +16,7 @@ export interface SimpleProjectSearchResponseBaseItem {
/** The project name */
project_name: string;
/** The time the project was last updated */
- updated_at: number;
+ updated_at: string;
/** The id of the user who created the project */
user_id: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleProjectSearchResponseBaseItemTimestampSeconds.ts b/js/app/packages/service-clients/service-search/generated/models/simpleProjectSearchResponseBaseItemHumanReadableTimestamp.ts
similarity index 80%
rename from js/app/packages/service-clients/service-search/generated/models/simpleProjectSearchResponseBaseItemTimestampSeconds.ts
rename to js/app/packages/service-clients/service-search/generated/models/simpleProjectSearchResponseBaseItemHumanReadableTimestamp.ts
index be4ee857ab..8ccfc7e122 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleProjectSearchResponseBaseItemTimestampSeconds.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleProjectSearchResponseBaseItemHumanReadableTimestamp.ts
@@ -6,9 +6,9 @@
*/
import type { SearchHighlight } from './searchHighlight';
-export interface SimpleProjectSearchResponseBaseItemTimestampSeconds {
+export interface SimpleProjectSearchResponseBaseItemHumanReadableTimestamp {
/** The time the project was created */
- created_at: number;
+ created_at: string;
/** The highlights on the project */
highlight: SearchHighlight;
/** The project id */
@@ -16,7 +16,7 @@ export interface SimpleProjectSearchResponseBaseItemTimestampSeconds {
/** The project name */
project_name: string;
/** The time the project was last updated */
- updated_at: number;
+ updated_at: string;
/** The id of the user who created the project */
user_id: string;
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchBaseResponse.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchBaseResponse.ts
index ac09465898..7abdba34f0 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchBaseResponse.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchBaseResponse.ts
@@ -4,8 +4,8 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSeconds } from './simpleUnifiedSearchResponseBaseItemTimestampSeconds';
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestamp } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestamp';
export interface SimpleUnifiedSearchBaseResponse {
- results: SimpleUnifiedSearchResponseBaseItemTimestampSeconds[];
+ results: SimpleUnifiedSearchResponseBaseItemHumanReadableTimestamp[];
}
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestamp.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestamp.ts
new file mode 100644
index 0000000000..5a4275d800
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestamp.ts
@@ -0,0 +1,18 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOf } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOf';
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFour } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFour';
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethree } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethree';
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezero } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezero';
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSeven } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSeven';
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestamp =
+ | SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOf
+ | SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFour
+ | SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSeven
+ | SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezero
+ | SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethree;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOf.ts
new file mode 100644
index 0000000000..38a0a7a01e
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOf.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SimpleDocumentSearchResponseBaseItemHumanReadableTimestamp } from './simpleDocumentSearchResponseBaseItemHumanReadableTimestamp';
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOf } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOf';
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOf =
+ SimpleDocumentSearchResponseBaseItemHumanReadableTimestamp &
+ SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOf.ts
new file mode 100644
index 0000000000..92de394a21
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOf.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOfType } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOfType';
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOf =
+ {
+ type: SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOfType;
+ };
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOfType.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOfType.ts
new file mode 100644
index 0000000000..4b5d5df9a4
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOfType.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOfType =
+ (typeof SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOfType)[keyof typeof SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOfType];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfAllOfType =
+ {
+ document: 'document',
+ } as const;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFour.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFour.ts
new file mode 100644
index 0000000000..7f8fca1580
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFour.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SimpleChatSearchResponseBaseItemHumanReadableTimestamp } from './simpleChatSearchResponseBaseItemHumanReadableTimestamp';
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOf } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOf';
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFour =
+ SimpleChatSearchResponseBaseItemHumanReadableTimestamp &
+ SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOf.ts
new file mode 100644
index 0000000000..7191855187
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOf.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOfType } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOfType';
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOf =
+ {
+ type: SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOfType;
+ };
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOfType.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOfType.ts
new file mode 100644
index 0000000000..278f82fb70
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOfType.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOfType =
+ (typeof SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOfType)[keyof typeof SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOfType];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfFourAllOfType =
+ {
+ chat: 'chat',
+ } as const;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethree.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethree.ts
new file mode 100644
index 0000000000..30e43c842b
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethree.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SimpleProjectSearchResponseBaseItemHumanReadableTimestamp } from './simpleProjectSearchResponseBaseItemHumanReadableTimestamp';
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOf } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOf';
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethree =
+ SimpleProjectSearchResponseBaseItemHumanReadableTimestamp &
+ SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOf.ts
new file mode 100644
index 0000000000..4eb2200f81
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOf.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOfType } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOfType';
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOf =
+ {
+ type: SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOfType;
+ };
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOfType.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOfType.ts
new file mode 100644
index 0000000000..f0f7f8b47e
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOfType.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOfType =
+ (typeof SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOfType)[keyof typeof SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOfType];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnethreeAllOfType =
+ {
+ project: 'project',
+ } as const;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezero.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezero.ts
new file mode 100644
index 0000000000..d1aa85dd9c
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezero.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SimpleChannelSearchReponseBaseItemHumanReadableTimestamp } from './simpleChannelSearchReponseBaseItemHumanReadableTimestamp';
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOf } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOf';
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezero =
+ SimpleChannelSearchReponseBaseItemHumanReadableTimestamp &
+ SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOf.ts
new file mode 100644
index 0000000000..6901836bc4
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOf.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOfType } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOfType';
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOf =
+ {
+ type: SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOfType;
+ };
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOfType.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOfType.ts
new file mode 100644
index 0000000000..6bcb63d3b0
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOfType.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOfType =
+ (typeof SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOfType)[keyof typeof SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOfType];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfOnezeroAllOfType =
+ {
+ channel: 'channel',
+ } as const;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSeven.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSeven.ts
new file mode 100644
index 0000000000..becddab316
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSeven.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SimpleEmailSearchResponseBaseItemHumanReadableTimestamp } from './simpleEmailSearchResponseBaseItemHumanReadableTimestamp';
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOf } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOf';
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSeven =
+ SimpleEmailSearchResponseBaseItemHumanReadableTimestamp &
+ SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOf.ts
new file mode 100644
index 0000000000..014014b270
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOf.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOfType } from './simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOfType';
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOf =
+ {
+ type: SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOfType;
+ };
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOfType.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOfType.ts
new file mode 100644
index 0000000000..bd0be1d73d
--- /dev/null
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOfType.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOfType =
+ (typeof SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOfType)[keyof typeof SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOfType];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const SimpleUnifiedSearchResponseBaseItemHumanReadableTimestampOneOfSevenAllOfType =
+ {
+ email: 'email',
+ } as const;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOf.ts
index 8569544eab..4eb19ce1f3 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOf.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOf.ts
@@ -4,9 +4,9 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleDocumentSearchResponseBaseItemTimestampSeconds } from './simpleDocumentSearchResponseBaseItemTimestampSeconds';
+import type { SimpleDocumentSearchResponseBaseItemHumanReadableTimestamp } from './simpleDocumentSearchResponseBaseItemHumanReadableTimestamp';
import type { SimpleUnifiedSearchResponseBaseItemOneOfAllOf } from './simpleUnifiedSearchResponseBaseItemOneOfAllOf';
export type SimpleUnifiedSearchResponseBaseItemOneOf =
- SimpleDocumentSearchResponseBaseItemTimestampSeconds &
+ SimpleDocumentSearchResponseBaseItemHumanReadableTimestamp &
SimpleUnifiedSearchResponseBaseItemOneOfAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfFour.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfFour.ts
index 55d2b53a1e..777ee419e2 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfFour.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfFour.ts
@@ -4,9 +4,9 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleChatSearchResponseBaseItemTimestampSeconds } from './simpleChatSearchResponseBaseItemTimestampSeconds';
+import type { SimpleChatSearchResponseBaseItemHumanReadableTimestamp } from './simpleChatSearchResponseBaseItemHumanReadableTimestamp';
import type { SimpleUnifiedSearchResponseBaseItemOneOfFourAllOf } from './simpleUnifiedSearchResponseBaseItemOneOfFourAllOf';
export type SimpleUnifiedSearchResponseBaseItemOneOfFour =
- SimpleChatSearchResponseBaseItemTimestampSeconds &
+ SimpleChatSearchResponseBaseItemHumanReadableTimestamp &
SimpleUnifiedSearchResponseBaseItemOneOfFourAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfOnethree.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfOnethree.ts
index f1c2989bd7..f068803613 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfOnethree.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfOnethree.ts
@@ -4,9 +4,9 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleProjectSearchResponseBaseItemTimestampSeconds } from './simpleProjectSearchResponseBaseItemTimestampSeconds';
+import type { SimpleProjectSearchResponseBaseItemHumanReadableTimestamp } from './simpleProjectSearchResponseBaseItemHumanReadableTimestamp';
import type { SimpleUnifiedSearchResponseBaseItemOneOfOnethreeAllOf } from './simpleUnifiedSearchResponseBaseItemOneOfOnethreeAllOf';
export type SimpleUnifiedSearchResponseBaseItemOneOfOnethree =
- SimpleProjectSearchResponseBaseItemTimestampSeconds &
+ SimpleProjectSearchResponseBaseItemHumanReadableTimestamp &
SimpleUnifiedSearchResponseBaseItemOneOfOnethreeAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfOnezero.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfOnezero.ts
index 90377f915e..e04673a08f 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfOnezero.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfOnezero.ts
@@ -4,9 +4,9 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleChannelSearchReponseBaseItemTimestampSeconds } from './simpleChannelSearchReponseBaseItemTimestampSeconds';
+import type { SimpleChannelSearchReponseBaseItemHumanReadableTimestamp } from './simpleChannelSearchReponseBaseItemHumanReadableTimestamp';
import type { SimpleUnifiedSearchResponseBaseItemOneOfOnezeroAllOf } from './simpleUnifiedSearchResponseBaseItemOneOfOnezeroAllOf';
export type SimpleUnifiedSearchResponseBaseItemOneOfOnezero =
- SimpleChannelSearchReponseBaseItemTimestampSeconds &
+ SimpleChannelSearchReponseBaseItemHumanReadableTimestamp &
SimpleUnifiedSearchResponseBaseItemOneOfOnezeroAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfSeven.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfSeven.ts
index fe995641d7..2006963afc 100644
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfSeven.ts
+++ b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemOneOfSeven.ts
@@ -4,9 +4,9 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleEmailSearchResponseBaseItemTimestampSeconds } from './simpleEmailSearchResponseBaseItemTimestampSeconds';
+import type { SimpleEmailSearchResponseBaseItemHumanReadableTimestamp } from './simpleEmailSearchResponseBaseItemHumanReadableTimestamp';
import type { SimpleUnifiedSearchResponseBaseItemOneOfSevenAllOf } from './simpleUnifiedSearchResponseBaseItemOneOfSevenAllOf';
export type SimpleUnifiedSearchResponseBaseItemOneOfSeven =
- SimpleEmailSearchResponseBaseItemTimestampSeconds &
+ SimpleEmailSearchResponseBaseItemHumanReadableTimestamp &
SimpleUnifiedSearchResponseBaseItemOneOfSevenAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSeconds.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSeconds.ts
deleted file mode 100644
index 79ef4eb606..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSeconds.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOf } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOf';
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFour } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFour';
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethree } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethree';
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezero } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezero';
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSeven } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSeven';
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSeconds =
- | SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOf
- | SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFour
- | SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSeven
- | SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezero
- | SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethree;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOf.ts
deleted file mode 100644
index 8a3185550e..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOf.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-import type { SimpleDocumentSearchResponseBaseItemTimestampSeconds } from './simpleDocumentSearchResponseBaseItemTimestampSeconds';
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOf } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOf';
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOf =
- SimpleDocumentSearchResponseBaseItemTimestampSeconds &
- SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOf.ts
deleted file mode 100644
index 03733be36b..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOf.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOfType } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOfType';
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOf = {
- type: SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOfType;
-};
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOfType.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOfType.ts
deleted file mode 100644
index a843df56f5..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOfType.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOfType =
- (typeof SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOfType)[keyof typeof SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOfType];
-
-// eslint-disable-next-line @typescript-eslint/no-redeclare
-export const SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfAllOfType =
- {
- document: 'document',
- } as const;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFour.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFour.ts
deleted file mode 100644
index a19a9d4e23..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFour.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-import type { SimpleChatSearchResponseBaseItemTimestampSeconds } from './simpleChatSearchResponseBaseItemTimestampSeconds';
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOf } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOf';
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFour =
- SimpleChatSearchResponseBaseItemTimestampSeconds &
- SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOf.ts
deleted file mode 100644
index a49fa57433..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOf.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOfType } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOfType';
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOf =
- {
- type: SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOfType;
- };
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOfType.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOfType.ts
deleted file mode 100644
index 7ccd3fb61d..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOfType.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOfType =
- (typeof SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOfType)[keyof typeof SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOfType];
-
-// eslint-disable-next-line @typescript-eslint/no-redeclare
-export const SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfFourAllOfType =
- {
- chat: 'chat',
- } as const;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethree.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethree.ts
deleted file mode 100644
index 6a349e9ea3..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethree.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-import type { SimpleProjectSearchResponseBaseItemTimestampSeconds } from './simpleProjectSearchResponseBaseItemTimestampSeconds';
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOf } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOf';
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethree =
- SimpleProjectSearchResponseBaseItemTimestampSeconds &
- SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOf.ts
deleted file mode 100644
index 9eb5c83fb4..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOf.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOfType } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOfType';
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOf =
- {
- type: SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOfType;
- };
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOfType.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOfType.ts
deleted file mode 100644
index 016c5cab51..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOfType.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOfType =
- (typeof SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOfType)[keyof typeof SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOfType];
-
-// eslint-disable-next-line @typescript-eslint/no-redeclare
-export const SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnethreeAllOfType =
- {
- project: 'project',
- } as const;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezero.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezero.ts
deleted file mode 100644
index 73f913aec6..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezero.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-import type { SimpleChannelSearchReponseBaseItemTimestampSeconds } from './simpleChannelSearchReponseBaseItemTimestampSeconds';
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOf } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOf';
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezero =
- SimpleChannelSearchReponseBaseItemTimestampSeconds &
- SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOf.ts
deleted file mode 100644
index fd0507b76f..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOf.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOfType } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOfType';
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOf =
- {
- type: SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOfType;
- };
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOfType.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOfType.ts
deleted file mode 100644
index 71cfc68fa1..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOfType.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOfType =
- (typeof SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOfType)[keyof typeof SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOfType];
-
-// eslint-disable-next-line @typescript-eslint/no-redeclare
-export const SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfOnezeroAllOfType =
- {
- channel: 'channel',
- } as const;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSeven.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSeven.ts
deleted file mode 100644
index 3e724b287e..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSeven.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-import type { SimpleEmailSearchResponseBaseItemTimestampSeconds } from './simpleEmailSearchResponseBaseItemTimestampSeconds';
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOf } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOf';
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSeven =
- SimpleEmailSearchResponseBaseItemTimestampSeconds &
- SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOf;
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOf.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOf.ts
deleted file mode 100644
index 4a4cd856a5..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOf.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-import type { SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOfType } from './simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOfType';
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOf =
- {
- type: SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOfType;
- };
diff --git a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOfType.ts b/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOfType.ts
deleted file mode 100644
index e3b4e6f8bf..0000000000
--- a/js/app/packages/service-clients/service-search/generated/models/simpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOfType.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-export type SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOfType =
- (typeof SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOfType)[keyof typeof SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOfType];
-
-// eslint-disable-next-line @typescript-eslint/no-redeclare
-export const SimpleUnifiedSearchResponseBaseItemTimestampSecondsOneOfSevenAllOfType =
- {
- email: 'email',
- } as const;
diff --git a/js/app/packages/service-clients/service-search/openapi.json b/js/app/packages/service-clients/service-search/openapi.json
index 248420467c..aa63d79161 100644
--- a/js/app/packages/service-clients/service-search/openapi.json
+++ b/js/app/packages/service-clients/service-search/openapi.json
@@ -222,20 +222,20 @@
"required": ["created_at", "updated_at"],
"properties": {
"created_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"interacted_at": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"updated_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"viewed_at": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
},
@@ -368,8 +368,8 @@
"required": ["highlight"],
"properties": {
"created_at": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "When the channel message was created\nThis is only prsent if the search result is on the message content"
},
"highlight": {
@@ -396,8 +396,8 @@
"description": "The channel message thread id"
},
"updated_at": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "When the channel message was last updated\nThis is only prsent if the search result is on the message content"
}
}
@@ -471,23 +471,23 @@
"required": ["created_at", "updated_at"],
"properties": {
"created_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"deleted_at": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"project_id": {
"type": ["string", "null"]
},
"updated_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"viewed_at": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
},
@@ -662,23 +662,23 @@
"required": ["created_at", "updated_at"],
"properties": {
"created_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"deleted_at": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"project_id": {
"type": ["string", "null"]
},
"updated_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"viewed_at": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
},
@@ -1015,19 +1015,19 @@
"required": ["created_at", "updated_at"],
"properties": {
"created_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"snippet": {
"type": ["string", "null"]
},
"updated_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"viewed_at": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
}
@@ -1098,8 +1098,8 @@
"description": "The sender.\nIf the match is on the subject, the sender is the latest sender on the thread."
},
"sent_at": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "When the email message was sent\nThis is only present if the search result is on the message content"
}
}
@@ -1198,23 +1198,23 @@
"required": ["created_at", "updated_at"],
"properties": {
"created_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"deleted_at": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"parent_project_id": {
"type": ["string", "null"]
},
"updated_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"viewed_at": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
},
@@ -1230,8 +1230,8 @@
],
"properties": {
"created_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"owner_id": {
"type": "string"
@@ -1244,8 +1244,8 @@
"type": "string"
},
"updated_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
}
}
},
@@ -1310,8 +1310,8 @@
],
"properties": {
"created_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"id": {
"type": "string",
@@ -1331,8 +1331,8 @@
}
},
"updated_at": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
}
}
},
@@ -1460,8 +1460,9 @@
"created_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the channel message was created"
@@ -1497,15 +1498,16 @@
"updated_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the channel message was last updated"
}
}
},
- "SimpleChannelSearchReponseBaseItem_TimestampSeconds": {
+ "SimpleChannelSearchReponseBaseItem_HumanReadableTimestamp": {
"type": "object",
"required": [
"channel_id",
@@ -1529,8 +1531,9 @@
"created_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the channel message was created"
@@ -1566,8 +1569,9 @@
"updated_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the channel message was last updated"
@@ -1635,8 +1639,9 @@
"updated_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the chat was last updated"
@@ -1647,7 +1652,7 @@
}
}
},
- "SimpleChatSearchResponseBaseItem_TimestampSeconds": {
+ "SimpleChatSearchResponseBaseItem_HumanReadableTimestamp": {
"type": "object",
"required": [
"chat_id",
@@ -1682,8 +1687,9 @@
"updated_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the chat was last updated"
@@ -1750,15 +1756,16 @@
"updated_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the document was last updated"
}
}
},
- "SimpleDocumentSearchResponseBaseItem_TimestampSeconds": {
+ "SimpleDocumentSearchResponseBaseItem_HumanReadableTimestamp": {
"type": "object",
"required": [
"document_id",
@@ -1801,8 +1808,9 @@
"updated_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the document was last updated"
@@ -1888,8 +1896,9 @@
"type": "null"
},
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the email was sent"
@@ -1905,8 +1914,9 @@
"updated_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the email was last updated"
@@ -1917,7 +1927,7 @@
}
}
},
- "SimpleEmailSearchResponseBaseItem_TimestampSeconds": {
+ "SimpleEmailSearchResponseBaseItem_HumanReadableTimestamp": {
"type": "object",
"required": [
"thread_id",
@@ -1983,8 +1993,9 @@
"type": "null"
},
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the email was sent"
@@ -2000,8 +2011,9 @@
"updated_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the email was last updated"
@@ -2039,8 +2051,9 @@
"created_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the project was created"
@@ -2060,8 +2073,9 @@
"updated_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the project was last updated"
@@ -2072,7 +2086,7 @@
}
}
},
- "SimpleProjectSearchResponseBaseItem_TimestampSeconds": {
+ "SimpleProjectSearchResponseBaseItem_HumanReadableTimestamp": {
"type": "object",
"required": [
"project_id",
@@ -2086,8 +2100,9 @@
"created_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the project was created"
@@ -2107,8 +2122,9 @@
"updated_at": {
"oneOf": [
{
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time",
+ "description": "DateTime<Utc> ts_seconds deserialization + RFC3339 serialization"
}
],
"description": "The time the project was last updated"
@@ -2126,7 +2142,7 @@
"results": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/SimpleUnifiedSearchResponseBaseItem_TimestampSeconds"
+ "$ref": "#/components/schemas/SimpleUnifiedSearchResponseBaseItem_HumanReadableTimestamp"
}
}
}
@@ -2136,7 +2152,7 @@
{
"allOf": [
{
- "$ref": "#/components/schemas/SimpleDocumentSearchResponseBaseItem_TimestampSeconds"
+ "$ref": "#/components/schemas/SimpleDocumentSearchResponseBaseItem_HumanReadableTimestamp"
},
{
"type": "object",
@@ -2153,7 +2169,7 @@
{
"allOf": [
{
- "$ref": "#/components/schemas/SimpleChatSearchResponseBaseItem_TimestampSeconds"
+ "$ref": "#/components/schemas/SimpleChatSearchResponseBaseItem_HumanReadableTimestamp"
},
{
"type": "object",
@@ -2170,7 +2186,7 @@
{
"allOf": [
{
- "$ref": "#/components/schemas/SimpleEmailSearchResponseBaseItem_TimestampSeconds"
+ "$ref": "#/components/schemas/SimpleEmailSearchResponseBaseItem_HumanReadableTimestamp"
},
{
"type": "object",
@@ -2187,7 +2203,7 @@
{
"allOf": [
{
- "$ref": "#/components/schemas/SimpleChannelSearchReponseBaseItem_TimestampSeconds"
+ "$ref": "#/components/schemas/SimpleChannelSearchReponseBaseItem_HumanReadableTimestamp"
},
{
"type": "object",
@@ -2204,7 +2220,7 @@
{
"allOf": [
{
- "$ref": "#/components/schemas/SimpleProjectSearchResponseBaseItem_TimestampSeconds"
+ "$ref": "#/components/schemas/SimpleProjectSearchResponseBaseItem_HumanReadableTimestamp"
},
{
"type": "object",
@@ -2220,12 +2236,12 @@
}
]
},
- "SimpleUnifiedSearchResponseBaseItem_TimestampSeconds": {
+ "SimpleUnifiedSearchResponseBaseItem_HumanReadableTimestamp": {
"oneOf": [
{
"allOf": [
{
- "$ref": "#/components/schemas/SimpleDocumentSearchResponseBaseItem_TimestampSeconds"
+ "$ref": "#/components/schemas/SimpleDocumentSearchResponseBaseItem_HumanReadableTimestamp"
},
{
"type": "object",
@@ -2242,7 +2258,7 @@
{
"allOf": [
{
- "$ref": "#/components/schemas/SimpleChatSearchResponseBaseItem_TimestampSeconds"
+ "$ref": "#/components/schemas/SimpleChatSearchResponseBaseItem_HumanReadableTimestamp"
},
{
"type": "object",
@@ -2259,7 +2275,7 @@
{
"allOf": [
{
- "$ref": "#/components/schemas/SimpleEmailSearchResponseBaseItem_TimestampSeconds"
+ "$ref": "#/components/schemas/SimpleEmailSearchResponseBaseItem_HumanReadableTimestamp"
},
{
"type": "object",
@@ -2276,7 +2292,7 @@
{
"allOf": [
{
- "$ref": "#/components/schemas/SimpleChannelSearchReponseBaseItem_TimestampSeconds"
+ "$ref": "#/components/schemas/SimpleChannelSearchReponseBaseItem_HumanReadableTimestamp"
},
{
"type": "object",
@@ -2293,7 +2309,7 @@
{
"allOf": [
{
- "$ref": "#/components/schemas/SimpleProjectSearchResponseBaseItem_TimestampSeconds"
+ "$ref": "#/components/schemas/SimpleProjectSearchResponseBaseItem_HumanReadableTimestamp"
},
{
"type": "object",
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/basicDocument.ts b/js/app/packages/service-clients/service-storage/generated/schemas/basicDocument.ts
index 7de77c30a9..e4eb7e7442 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/basicDocument.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/basicDocument.ts
@@ -6,6 +6,7 @@
*/
import type { BasicDocumentBranchedFromId } from './basicDocumentBranchedFromId';
import type { BasicDocumentBranchedFromVersionId } from './basicDocumentBranchedFromVersionId';
+import type { BasicDocumentCreatedAt } from './basicDocumentCreatedAt';
import type { BasicDocumentDeletedAt } from './basicDocumentDeletedAt';
import type { BasicDocumentDocumentFamilyId } from './basicDocumentDocumentFamilyId';
import type { BasicDocumentFileType } from './basicDocumentFileType';
@@ -13,6 +14,7 @@ import type { BasicDocumentProjectId } from './basicDocumentProjectId';
import type { BasicDocumentSha } from './basicDocumentSha';
import type { BasicDocumentSubTypeProperty } from './basicDocumentSubTypeProperty';
import type { BasicDocumentType } from './basicDocumentType';
+import type { BasicDocumentUpdatedAt } from './basicDocumentUpdatedAt';
export interface BasicDocument {
/** The id of the document this document branched from */
@@ -22,9 +24,9 @@ This could be either DocumentInstance or DocumentBom id depending on
the file type */
branchedFromVersionId?: BasicDocumentBranchedFromVersionId;
/** The time the document was created */
- createdAt: number;
+ createdAt?: BasicDocumentCreatedAt;
/** The time the document was deleted */
- deletedAt: BasicDocumentDeletedAt;
+ deletedAt?: BasicDocumentDeletedAt;
/** The id of the document family this document belongs to */
documentFamilyId?: BasicDocumentDocumentFamilyId;
/** The version of the document
@@ -46,6 +48,6 @@ If the document is a DOCX, this will not be present */
sha?: BasicDocumentSha;
subType?: BasicDocumentSubTypeProperty;
/** The time the document instance / document BOM was updated */
- updatedAt: number;
+ updatedAt?: BasicDocumentUpdatedAt;
type: BasicDocumentType;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/basicDocumentCreatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/basicDocumentCreatedAt.ts
new file mode 100644
index 0000000000..63e838e65e
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/basicDocumentCreatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the document was created
+ */
+export type BasicDocumentCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/basicDocumentDeletedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/basicDocumentDeletedAt.ts
index f52d77f2e0..34d35b52ea 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/basicDocumentDeletedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/basicDocumentDeletedAt.ts
@@ -8,4 +8,4 @@
/**
* The time the document was deleted
*/
-export type BasicDocumentDeletedAt = number | null;
+export type BasicDocumentDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/basicDocumentUpdatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/basicDocumentUpdatedAt.ts
new file mode 100644
index 0000000000..92c3000512
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/basicDocumentUpdatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the document instance / document BOM was updated
+ */
+export type BasicDocumentUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/chat.ts b/js/app/packages/service-clients/service-storage/generated/schemas/chat.ts
index 0adf3972db..36d4d8893c 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/chat.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/chat.ts
@@ -4,17 +4,19 @@
* document_storage_service
* OpenAPI spec version: 0.1.0
*/
+import type { ChatCreatedAt } from './chatCreatedAt';
import type { ChatDeletedAt } from './chatDeletedAt';
import type { ChatModel } from './chatModel';
import type { ChatProjectId } from './chatProjectId';
import type { ChatTokenCount } from './chatTokenCount';
import type { ChatType } from './chatType';
+import type { ChatUpdatedAt } from './chatUpdatedAt';
export interface Chat {
/** The time the chat was created */
- createdAt: number;
+ createdAt?: ChatCreatedAt;
/** The time the chat was deleted */
- deletedAt: ChatDeletedAt;
+ deletedAt?: ChatDeletedAt;
/** The chat uuid */
id: string;
isPersistent: boolean;
@@ -26,7 +28,7 @@ export interface Chat {
projectId?: ChatProjectId;
tokenCount?: ChatTokenCount;
/** The time the chat was last updated */
- updatedAt: number;
+ updatedAt?: ChatUpdatedAt;
/** Who the chat belongs to */
userId: string;
type: ChatType;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/chatCreatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/chatCreatedAt.ts
new file mode 100644
index 0000000000..a11b0bf674
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/chatCreatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the chat was created
+ */
+export type ChatCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/chatDeletedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/chatDeletedAt.ts
index c44447ed98..7fc31e5675 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/chatDeletedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/chatDeletedAt.ts
@@ -8,4 +8,4 @@
/**
* The time the chat was deleted
*/
-export type ChatDeletedAt = number | null;
+export type ChatDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/chatUpdatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/chatUpdatedAt.ts
new file mode 100644
index 0000000000..01960ccf77
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/chatUpdatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the chat was last updated
+ */
+export type ChatUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/comment.ts b/js/app/packages/service-clients/service-storage/generated/schemas/comment.ts
index 26f283c57b..9cd997d3fe 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/comment.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/comment.ts
@@ -4,19 +4,21 @@
* document_storage_service
* OpenAPI spec version: 0.1.0
*/
+import type { CommentCreatedAt } from './commentCreatedAt';
import type { CommentDeletedAt } from './commentDeletedAt';
import type { CommentOrder } from './commentOrder';
import type { CommentSender } from './commentSender';
+import type { CommentUpdatedAt } from './commentUpdatedAt';
export interface Comment {
commentId: number;
- createdAt: number;
- deletedAt: CommentDeletedAt;
+ createdAt?: CommentCreatedAt;
+ deletedAt?: CommentDeletedAt;
metadata?: unknown;
order?: CommentOrder;
owner: string;
sender?: CommentSender;
text: string;
threadId: number;
- updatedAt: number;
+ updatedAt?: CommentUpdatedAt;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/commentCreatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/commentCreatedAt.ts
new file mode 100644
index 0000000000..81a1f104ea
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/commentCreatedAt.ts
@@ -0,0 +1,8 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type CommentCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/commentDeletedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/commentDeletedAt.ts
index 78887ebfc5..80c12d1ac2 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/commentDeletedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/commentDeletedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type CommentDeletedAt = number | null;
+export type CommentDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/commentUpdatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/commentUpdatedAt.ts
new file mode 100644
index 0000000000..1acdec3da7
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/commentUpdatedAt.ts
@@ -0,0 +1,8 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type CommentUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadata.ts b/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadata.ts
index 7add1147a0..56adc254d8 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadata.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadata.ts
@@ -6,6 +6,7 @@
*/
import type { DocumentMetadataBranchedFromId } from './documentMetadataBranchedFromId';
import type { DocumentMetadataBranchedFromVersionId } from './documentMetadataBranchedFromVersionId';
+import type { DocumentMetadataCreatedAt } from './documentMetadataCreatedAt';
import type { DocumentMetadataDeletedAt } from './documentMetadataDeletedAt';
import type { DocumentMetadataDocumentBom } from './documentMetadataDocumentBom';
import type { DocumentMetadataDocumentFamilyId } from './documentMetadataDocumentFamilyId';
@@ -14,6 +15,7 @@ import type { DocumentMetadataProjectId } from './documentMetadataProjectId';
import type { DocumentMetadataProjectName } from './documentMetadataProjectName';
import type { DocumentMetadataSha } from './documentMetadataSha';
import type { DocumentMetadataSubType } from './documentMetadataSubType';
+import type { DocumentMetadataUpdatedAt } from './documentMetadataUpdatedAt';
export interface DocumentMetadata {
/** The id of the document this document branched from */
@@ -23,9 +25,9 @@ This could be either DocumentInstance or DocumentBom id depending on
the file type */
branchedFromVersionId?: DocumentMetadataBranchedFromVersionId;
/** The time the document was created */
- createdAt: number;
+ createdAt?: DocumentMetadataCreatedAt;
/** The time the document was deleted */
- deletedAt: DocumentMetadataDeletedAt;
+ deletedAt?: DocumentMetadataDeletedAt;
/** If the document is a DOCX document and unzipped, the document_bom will be present */
documentBom?: DocumentMetadataDocumentBom;
/** The id of the document family this document belongs to */
@@ -54,5 +56,5 @@ If the document is a DOCX, this will not be present */
sha?: DocumentMetadataSha;
subType?: DocumentMetadataSubType;
/** The time the document instance / document BOM was updated */
- updatedAt: number;
+ updatedAt?: DocumentMetadataUpdatedAt;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadataCreatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadataCreatedAt.ts
new file mode 100644
index 0000000000..e78d6e02ef
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadataCreatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the document was created
+ */
+export type DocumentMetadataCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadataDeletedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadataDeletedAt.ts
index e04d35391d..2bcfe34c52 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadataDeletedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadataDeletedAt.ts
@@ -8,4 +8,4 @@
/**
* The time the document was deleted
*/
-export type DocumentMetadataDeletedAt = number | null;
+export type DocumentMetadataDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadataUpdatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadataUpdatedAt.ts
new file mode 100644
index 0000000000..05b573e32e
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/documentMetadataUpdatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the document instance / document BOM was updated
+ */
+export type DocumentMetadataUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/documentPreviewData.ts b/js/app/packages/service-clients/service-storage/generated/schemas/documentPreviewData.ts
index 01ccb69859..3514af7400 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/documentPreviewData.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/documentPreviewData.ts
@@ -6,6 +6,7 @@
*/
import type { DocumentPreviewDataFileType } from './documentPreviewDataFileType';
import type { DocumentPreviewDataSubTypeProperty } from './documentPreviewDataSubTypeProperty';
+import type { DocumentPreviewDataUpdatedAt } from './documentPreviewDataUpdatedAt';
export interface DocumentPreviewData {
/** The document id */
@@ -18,5 +19,5 @@ export interface DocumentPreviewData {
owner: string;
sub_type?: DocumentPreviewDataSubTypeProperty;
/** The time the document was last updated */
- updated_at: number;
+ updated_at?: DocumentPreviewDataUpdatedAt;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/documentPreviewDataUpdatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/documentPreviewDataUpdatedAt.ts
new file mode 100644
index 0000000000..e68da121c1
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/documentPreviewDataUpdatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the document was last updated
+ */
+export type DocumentPreviewDataUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/documentResponseMetadata.ts b/js/app/packages/service-clients/service-storage/generated/schemas/documentResponseMetadata.ts
index 553fc8eaca..5c2dcd95b8 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/documentResponseMetadata.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/documentResponseMetadata.ts
@@ -6,11 +6,13 @@
*/
import type { DocumentResponseMetadataBranchedFromId } from './documentResponseMetadataBranchedFromId';
import type { DocumentResponseMetadataBranchedFromVersionId } from './documentResponseMetadataBranchedFromVersionId';
+import type { DocumentResponseMetadataCreatedAt } from './documentResponseMetadataCreatedAt';
import type { DocumentResponseMetadataDocumentBom } from './documentResponseMetadataDocumentBom';
import type { DocumentResponseMetadataDocumentFamilyId } from './documentResponseMetadataDocumentFamilyId';
import type { DocumentResponseMetadataFileType } from './documentResponseMetadataFileType';
import type { DocumentResponseMetadataSha } from './documentResponseMetadataSha';
import type { DocumentResponseMetadataSubType } from './documentResponseMetadataSubType';
+import type { DocumentResponseMetadataUpdatedAt } from './documentResponseMetadataUpdatedAt';
export interface DocumentResponseMetadata {
/** The id of the document this document branched from */
@@ -20,7 +22,7 @@ This could be either DocumentInstance or DocumentBom id depending on
the file type */
branchedFromVersionId?: DocumentResponseMetadataBranchedFromVersionId;
/** The time the document was created */
- createdAt: number;
+ createdAt?: DocumentResponseMetadataCreatedAt;
/** If the document is a DOCX document, the document_bom will be present */
documentBom?: DocumentResponseMetadataDocumentBom;
/** The id of the document family this document belongs to */
@@ -45,5 +47,5 @@ If the document is a DOCX, this will not be present */
sha?: DocumentResponseMetadataSha;
subType?: DocumentResponseMetadataSubType;
/** The time the document instance / document BOM was updated */
- updatedAt: number;
+ updatedAt?: DocumentResponseMetadataUpdatedAt;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/documentResponseMetadataCreatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/documentResponseMetadataCreatedAt.ts
new file mode 100644
index 0000000000..2a8cd09247
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/documentResponseMetadataCreatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the document was created
+ */
+export type DocumentResponseMetadataCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/documentResponseMetadataUpdatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/documentResponseMetadataUpdatedAt.ts
new file mode 100644
index 0000000000..f1e3fd6f5e
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/documentResponseMetadataUpdatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the document instance / document BOM was updated
+ */
+export type DocumentResponseMetadataUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/getDocumentListResult.ts b/js/app/packages/service-clients/service-storage/generated/schemas/getDocumentListResult.ts
index ad5cf512cc..9b920bf1eb 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/getDocumentListResult.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/getDocumentListResult.ts
@@ -6,8 +6,10 @@
*/
import type { GetDocumentListResultBranchedFromId } from './getDocumentListResultBranchedFromId';
import type { GetDocumentListResultBranchedFromVersionId } from './getDocumentListResultBranchedFromVersionId';
+import type { GetDocumentListResultCreatedAt } from './getDocumentListResultCreatedAt';
import type { GetDocumentListResultDocumentFamilyId } from './getDocumentListResultDocumentFamilyId';
import type { GetDocumentListResultFileType } from './getDocumentListResultFileType';
+import type { GetDocumentListResultUpdatedAt } from './getDocumentListResultUpdatedAt';
export interface GetDocumentListResult {
/** The id of the document this document branched from */
@@ -17,7 +19,7 @@ This could be either DocumentInstance or DocumentBom id depending on
the file type */
branchedFromVersionId?: GetDocumentListResultBranchedFromVersionId;
/** The time the document was created */
- createdAt: number;
+ createdAt?: GetDocumentListResultCreatedAt;
/** The id of the document family this document belongs to */
documentFamilyId?: GetDocumentListResultDocumentFamilyId;
/** The id of the document */
@@ -29,5 +31,5 @@ the file type */
/** The file type of the document */
fileType?: GetDocumentListResultFileType;
/** The time the document instance / document BOM was updated */
- updatedAt: number;
+ updatedAt?: GetDocumentListResultUpdatedAt;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/getDocumentListResultCreatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/getDocumentListResultCreatedAt.ts
new file mode 100644
index 0000000000..1f498fa3d2
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/getDocumentListResultCreatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the document was created
+ */
+export type GetDocumentListResultCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/getDocumentListResultUpdatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/getDocumentListResultUpdatedAt.ts
new file mode 100644
index 0000000000..525bc1d181
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/getDocumentListResultUpdatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the document instance / document BOM was updated
+ */
+export type GetDocumentListResultUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/index.ts b/js/app/packages/service-clients/service-storage/generated/schemas/index.ts
index 12a2e8e29c..29a4a80b21 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/index.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/index.ts
@@ -42,6 +42,7 @@ export * from './annotationIncrementalUpdateOneOfUpdateType';
export * from './basicDocument';
export * from './basicDocumentBranchedFromId';
export * from './basicDocumentBranchedFromVersionId';
+export * from './basicDocumentCreatedAt';
export * from './basicDocumentDeletedAt';
export * from './basicDocumentDocumentFamilyId';
export * from './basicDocumentFileType';
@@ -52,6 +53,7 @@ export * from './basicDocumentSubTypeOneOf';
export * from './basicDocumentSubTypeOneOfType';
export * from './basicDocumentSubTypeProperty';
export * from './basicDocumentType';
+export * from './basicDocumentUpdatedAt';
export * from './bomPart';
export * from './channel';
export * from './channelFilters';
@@ -68,6 +70,7 @@ export * from './channelSharePermission';
export * from './channelType';
export * from './channelWithParticipants';
export * from './chat';
+export * from './chatCreatedAt';
export * from './chatDeletedAt';
export * from './chatFilters';
export * from './chatFiltersImportance';
@@ -75,12 +78,15 @@ export * from './chatModel';
export * from './chatProjectId';
export * from './chatTokenCount';
export * from './chatType';
+export * from './chatUpdatedAt';
export * from './cloudStorageItemType';
export * from './comment';
+export * from './commentCreatedAt';
export * from './commentDeletedAt';
export * from './commentOrder';
export * from './commentSender';
export * from './commentThread';
+export * from './commentUpdatedAt';
export * from './copyDocumentHandlerParams';
export * from './copyDocumentQueryParams';
export * from './copyDocumentQueryParamsVersionId';
@@ -160,6 +166,7 @@ export * from './documentFiltersImportance';
export * from './documentMetadata';
export * from './documentMetadataBranchedFromId';
export * from './documentMetadataBranchedFromVersionId';
+export * from './documentMetadataCreatedAt';
export * from './documentMetadataDeletedAt';
export * from './documentMetadataDocumentBom';
export * from './documentMetadataDocumentFamilyId';
@@ -168,6 +175,7 @@ export * from './documentMetadataProjectId';
export * from './documentMetadataProjectName';
export * from './documentMetadataSha';
export * from './documentMetadataSubType';
+export * from './documentMetadataUpdatedAt';
export * from './documentPermissionsToken';
export * from './documentPermissionsTokenRequest';
export * from './documentPermissionsTokenResponse';
@@ -179,6 +187,7 @@ export * from './documentPreviewDataSubType';
export * from './documentPreviewDataSubTypeOneOf';
export * from './documentPreviewDataSubTypeOneOfType';
export * from './documentPreviewDataSubTypeProperty';
+export * from './documentPreviewDataUpdatedAt';
export * from './documentPreviewOneOf';
export * from './documentPreviewOneOfAllOf';
export * from './documentPreviewOneOfAllOfType';
@@ -192,11 +201,13 @@ export * from './documentResponse';
export * from './documentResponseMetadata';
export * from './documentResponseMetadataBranchedFromId';
export * from './documentResponseMetadataBranchedFromVersionId';
+export * from './documentResponseMetadataCreatedAt';
export * from './documentResponseMetadataDocumentBom';
export * from './documentResponseMetadataDocumentFamilyId';
export * from './documentResponseMetadataFileType';
export * from './documentResponseMetadataSha';
export * from './documentResponseMetadataSubType';
+export * from './documentResponseMetadataUpdatedAt';
export * from './documentResponsePresignedUrl';
export * from './documentStorageServiceApiVersion';
export * from './documentSubType';
@@ -277,8 +288,10 @@ export * from './getDocumentKeyResponseData';
export * from './getDocumentListResult';
export * from './getDocumentListResultBranchedFromId';
export * from './getDocumentListResultBranchedFromVersionId';
+export * from './getDocumentListResultCreatedAt';
export * from './getDocumentListResultDocumentFamilyId';
export * from './getDocumentListResultFileType';
+export * from './getDocumentListResultUpdatedAt';
export * from './getDocumentPermissionsResponseDataV2';
export * from './getDocumentProcessingResult';
export * from './getDocumentProcessingResultResponse';
@@ -359,10 +372,12 @@ export * from './pdfAnchorRequestOneOfSeven';
export * from './pdfAnchorRequestOneOfSevenAllOf';
export * from './pdfAnchorRequestOneOfSevenAllOfAnchorType';
export * from './pdfHighlightAnchor';
+export * from './pdfHighlightAnchorCreatedAt';
export * from './pdfHighlightAnchorDeletedAt';
export * from './pdfHighlightAnchorRequest';
export * from './pdfHighlightAnchorRequestUuid';
export * from './pdfHighlightAnchorThreadId';
+export * from './pdfHighlightAnchorUpdatedAt';
export * from './pdfHighlightRect';
export * from './pdfHighlightRectAnchorRequest';
export * from './pdfPlaceableCommentAnchor';
@@ -378,6 +393,7 @@ export * from './preSaveDocumentResponse';
export * from './preSaveDocumentResponseData';
export * from './presignedUrl';
export * from './project';
+export * from './projectCreatedAt';
export * from './projectDeletedAt';
export * from './projectDeleteResponseData';
export * from './projectDocumentStatus';
@@ -386,6 +402,7 @@ export * from './projectFiltersImportance';
export * from './projectParentId';
export * from './projectPreview';
export * from './projectPreviewData';
+export * from './projectPreviewDataUpdatedAt';
export * from './projectPreviewOneOf';
export * from './projectPreviewOneOfAllOf';
export * from './projectPreviewOneOfAllOfAccess';
@@ -396,6 +413,7 @@ export * from './projectPreviewOneOfSeven';
export * from './projectPreviewOneOfSevenAllOf';
export * from './projectPreviewOneOfSevenAllOfAccess';
export * from './projectType';
+export * from './projectUpdatedAt';
export * from './propertyDefinition';
export * from './propertyDefinitionSpecificEntityType';
export * from './propertyInput';
@@ -527,8 +545,10 @@ export * from './soupPropertyValue';
export * from './successResponse';
export * from './syncServiceVersionID';
export * from './thread';
+export * from './threadCreatedAt';
export * from './threadDeletedAt';
export * from './threadResponse';
+export * from './threadUpdatedAt';
export * from './typedSuccessResponse';
export * from './typedSuccessResponseDataOneOf';
export * from './unthreadedPdfUuidRequest';
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchor.ts b/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchor.ts
index a2ce1a51e8..db136088c3 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchor.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchor.ts
@@ -6,15 +6,17 @@
*/
import type { HighlightType } from './highlightType';
+import type { PdfHighlightAnchorCreatedAt } from './pdfHighlightAnchorCreatedAt';
import type { PdfHighlightAnchorDeletedAt } from './pdfHighlightAnchorDeletedAt';
import type { PdfHighlightAnchorThreadId } from './pdfHighlightAnchorThreadId';
+import type { PdfHighlightAnchorUpdatedAt } from './pdfHighlightAnchorUpdatedAt';
import type { PdfHighlightRect } from './pdfHighlightRect';
export interface PdfHighlightAnchor {
alpha: number;
blue: number;
- createdAt: number;
- deletedAt: PdfHighlightAnchorDeletedAt;
+ createdAt?: PdfHighlightAnchorCreatedAt;
+ deletedAt?: PdfHighlightAnchorDeletedAt;
documentId: string;
green: number;
highlightRects: PdfHighlightRect[];
@@ -26,6 +28,6 @@ export interface PdfHighlightAnchor {
red: number;
text: string;
threadId?: PdfHighlightAnchorThreadId;
- updatedAt: number;
+ updatedAt?: PdfHighlightAnchorUpdatedAt;
uuid: string;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchorCreatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchorCreatedAt.ts
new file mode 100644
index 0000000000..ea1e257c4c
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchorCreatedAt.ts
@@ -0,0 +1,8 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type PdfHighlightAnchorCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchorDeletedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchorDeletedAt.ts
index 10d1aa558a..92ab77eabe 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchorDeletedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchorDeletedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type PdfHighlightAnchorDeletedAt = number | null;
+export type PdfHighlightAnchorDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchorUpdatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchorUpdatedAt.ts
new file mode 100644
index 0000000000..bcbf4fcf78
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/pdfHighlightAnchorUpdatedAt.ts
@@ -0,0 +1,8 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type PdfHighlightAnchorUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/project.ts b/js/app/packages/service-clients/service-storage/generated/schemas/project.ts
index dbcc1e50df..12715ac3af 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/project.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/project.ts
@@ -4,14 +4,16 @@
* document_storage_service
* OpenAPI spec version: 0.1.0
*/
+import type { ProjectCreatedAt } from './projectCreatedAt';
import type { ProjectDeletedAt } from './projectDeletedAt';
import type { ProjectParentId } from './projectParentId';
import type { ProjectType } from './projectType';
+import type { ProjectUpdatedAt } from './projectUpdatedAt';
export interface Project {
/** The time the project was created */
- createdAt: number;
- deletedAt: ProjectDeletedAt;
+ createdAt?: ProjectCreatedAt;
+ deletedAt?: ProjectDeletedAt;
/** The id of the project */
id: string;
/** The name of the project */
@@ -19,7 +21,7 @@ export interface Project {
/** The parent project id */
parentId?: ProjectParentId;
/** The time the project was updated */
- updatedAt: number;
+ updatedAt?: ProjectUpdatedAt;
/** The user id of who created the project */
userId: string;
type: ProjectType;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/projectCreatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/projectCreatedAt.ts
new file mode 100644
index 0000000000..12b13f34e7
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/projectCreatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the project was created
+ */
+export type ProjectCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/projectDeletedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/projectDeletedAt.ts
index b82981784b..22737079da 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/projectDeletedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/projectDeletedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type ProjectDeletedAt = number | null;
+export type ProjectDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/projectPreviewData.ts b/js/app/packages/service-clients/service-storage/generated/schemas/projectPreviewData.ts
index b26e67c5de..c7fb27321f 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/projectPreviewData.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/projectPreviewData.ts
@@ -4,11 +4,12 @@
* document_storage_service
* OpenAPI spec version: 0.1.0
*/
+import type { ProjectPreviewDataUpdatedAt } from './projectPreviewDataUpdatedAt';
export interface ProjectPreviewData {
id: string;
name: string;
owner: string;
path: string[];
- updatedAt: number;
+ updatedAt?: ProjectPreviewDataUpdatedAt;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/projectPreviewDataUpdatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/projectPreviewDataUpdatedAt.ts
new file mode 100644
index 0000000000..12d601dbc7
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/projectPreviewDataUpdatedAt.ts
@@ -0,0 +1,8 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type ProjectPreviewDataUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/projectUpdatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/projectUpdatedAt.ts
new file mode 100644
index 0000000000..80bbf3ba2c
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/projectUpdatedAt.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The time the project was updated
+ */
+export type ProjectUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachment.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachment.ts
index 3af07d5a7d..6961d0a9ff 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachment.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupAttachment.ts
@@ -12,7 +12,7 @@ import type { SoupAttachmentSizeBytes } from './soupAttachmentSizeBytes';
export interface SoupAttachment {
contentId?: SoupAttachmentContentId;
- createdAt: number;
+ createdAt: string;
filename?: SoupAttachmentFilename;
id: string;
messageId: string;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupChat.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupChat.ts
index fa86a10a5b..dc28fb1ea7 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupChat.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupChat.ts
@@ -11,9 +11,9 @@ import type { SoupProperty } from './soupProperty';
export interface SoupChat {
/** The time the chat was created */
- createdAt: number;
+ createdAt: string;
/** The time the chat was deleted */
- deletedAt: SoupChatDeletedAt;
+ deletedAt?: SoupChatDeletedAt;
/** The chat uuid */
id: string;
/** Whether the chat is persistent or not */
@@ -27,7 +27,7 @@ export interface SoupChat {
/** Properties */
properties: SoupProperty[];
/** The time the chat was last updated */
- updatedAt: number;
+ updatedAt: string;
/** The time the chat was last viewed */
- viewedAt: SoupChatViewedAt;
+ viewedAt?: SoupChatViewedAt;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupChatDeletedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupChatDeletedAt.ts
index 82adbaaab8..afe3da420d 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupChatDeletedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupChatDeletedAt.ts
@@ -8,4 +8,4 @@
/**
* The time the chat was deleted
*/
-export type SoupChatDeletedAt = number | null;
+export type SoupChatDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupChatViewedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupChatViewedAt.ts
index 5fe2552cdc..6effa9f6bd 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupChatViewedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupChatViewedAt.ts
@@ -8,4 +8,4 @@
/**
* The time the chat was last viewed
*/
-export type SoupChatViewedAt = number | null;
+export type SoupChatViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupDocument.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupDocument.ts
index cbc4f00fdc..8b14adadea 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupDocument.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupDocument.ts
@@ -22,9 +22,9 @@ export interface SoupDocument {
This could be either DocumentInstance or DocumentBom id depending on the file type */
branchedFromVersionId?: SoupDocumentBranchedFromVersionId;
/** The time the document was created */
- createdAt: number;
+ createdAt: string;
/** The time the document was deleted */
- deletedAt: SoupDocumentDeletedAt;
+ deletedAt?: SoupDocumentDeletedAt;
/** The id of the document family this document belongs to */
documentFamilyId?: SoupDocumentDocumentFamilyId;
/** The version of the document
@@ -47,7 +47,7 @@ If the document is a DOCX, this will not be present */
sha?: SoupDocumentSha;
subType?: SoupDocumentSubTypeProperty;
/** The time the document instance / document BOM was updated */
- updatedAt: number;
+ updatedAt: string;
/** The time the document was last viewed */
- viewedAt: SoupDocumentViewedAt;
+ viewedAt?: SoupDocumentViewedAt;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupDocumentDeletedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupDocumentDeletedAt.ts
index 8186255de9..653edad64d 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupDocumentDeletedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupDocumentDeletedAt.ts
@@ -8,4 +8,4 @@
/**
* The time the document was deleted
*/
-export type SoupDocumentDeletedAt = number | null;
+export type SoupDocumentDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupDocumentViewedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupDocumentViewedAt.ts
index 0c69286a51..cf4df129c7 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupDocumentViewedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupDocumentViewedAt.ts
@@ -8,4 +8,4 @@
/**
* The time the document was last viewed
*/
-export type SoupDocumentViewedAt = number | null;
+export type SoupDocumentViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreview.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreview.ts
index f30e834b43..728d6a4f6c 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreview.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreview.ts
@@ -13,7 +13,7 @@ import type { SoupEmailThreadPreviewSnippet } from './soupEmailThreadPreviewSnip
import type { SoupEmailThreadPreviewViewedAt } from './soupEmailThreadPreviewViewedAt';
export interface SoupEmailThreadPreview {
- createdAt: number;
+ createdAt: string;
id: string;
inboxVisible: boolean;
isDraft: boolean;
@@ -26,7 +26,7 @@ export interface SoupEmailThreadPreview {
senderName?: SoupEmailThreadPreviewSenderName;
senderPhotoUrl?: SoupEmailThreadPreviewSenderPhotoUrl;
snippet?: SoupEmailThreadPreviewSnippet;
- sortTs: number;
- updatedAt: number;
- viewedAt: SoupEmailThreadPreviewViewedAt;
+ sortTs: string;
+ updatedAt: string;
+ viewedAt?: SoupEmailThreadPreviewViewedAt;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewViewedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewViewedAt.ts
index 4f61f9e5ea..ad1fb84b19 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewViewedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupEmailThreadPreviewViewedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type SoupEmailThreadPreviewViewedAt = number | null;
+export type SoupEmailThreadPreviewViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupProject.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupProject.ts
index 32fc937718..2a6c494993 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupProject.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupProject.ts
@@ -11,9 +11,9 @@ import type { SoupProperty } from './soupProperty';
export interface SoupProject {
/** The time the project was created */
- createdAt: number;
+ createdAt: string;
/** The time the project was deleted */
- deletedAt: SoupProjectDeletedAt;
+ deletedAt?: SoupProjectDeletedAt;
/** The id of the project */
id: string;
/** The name of the project */
@@ -25,7 +25,7 @@ export interface SoupProject {
/** Properties */
properties: SoupProperty[];
/** The time the project was updated */
- updatedAt: number;
+ updatedAt: string;
/** The time the document was last viewed */
- viewedAt: SoupProjectViewedAt;
+ viewedAt?: SoupProjectViewedAt;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupProjectDeletedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupProjectDeletedAt.ts
index 6dba3f16cf..5a180c064f 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupProjectDeletedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupProjectDeletedAt.ts
@@ -8,4 +8,4 @@
/**
* The time the project was deleted
*/
-export type SoupProjectDeletedAt = number | null;
+export type SoupProjectDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/soupProjectViewedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/soupProjectViewedAt.ts
index 67295b462a..60eb4df1f4 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/soupProjectViewedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/soupProjectViewedAt.ts
@@ -8,4 +8,4 @@
/**
* The time the document was last viewed
*/
-export type SoupProjectViewedAt = number | null;
+export type SoupProjectViewedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/thread.ts b/js/app/packages/service-clients/service-storage/generated/schemas/thread.ts
index 0e3d0a3cab..c9e0175bc0 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/thread.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/thread.ts
@@ -4,15 +4,17 @@
* document_storage_service
* OpenAPI spec version: 0.1.0
*/
+import type { ThreadCreatedAt } from './threadCreatedAt';
import type { ThreadDeletedAt } from './threadDeletedAt';
+import type { ThreadUpdatedAt } from './threadUpdatedAt';
export interface Thread {
- createdAt: number;
- deletedAt: ThreadDeletedAt;
+ createdAt?: ThreadCreatedAt;
+ deletedAt?: ThreadDeletedAt;
documentId: string;
metadata?: unknown;
owner: string;
resolved: boolean;
threadId: number;
- updatedAt: number;
+ updatedAt?: ThreadUpdatedAt;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/threadCreatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/threadCreatedAt.ts
new file mode 100644
index 0000000000..5cf238e589
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/threadCreatedAt.ts
@@ -0,0 +1,8 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type ThreadCreatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/threadDeletedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/threadDeletedAt.ts
index 2f53638dee..ad50eaa527 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/threadDeletedAt.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/threadDeletedAt.ts
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
-export type ThreadDeletedAt = number | null;
+export type ThreadDeletedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/threadUpdatedAt.ts b/js/app/packages/service-clients/service-storage/generated/schemas/threadUpdatedAt.ts
new file mode 100644
index 0000000000..32cbae6ca9
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/threadUpdatedAt.ts
@@ -0,0 +1,8 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type ThreadUpdatedAt = string | null;
diff --git a/js/app/packages/service-clients/service-storage/generated/zod.ts b/js/app/packages/service-clients/service-storage/generated/zod.ts
index e99c8a86ed..4ddc29ac02 100644
--- a/js/app/packages/service-clients/service-storage/generated/zod.ts
+++ b/js/app/packages/service-clients/service-storage/generated/zod.ts
@@ -44,11 +44,14 @@ export const getRecentActivityHandlerResponse = zod.object({
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentFamilyId: zod
.number()
@@ -101,7 +104,9 @@ export const getRecentActivityHandlerResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe(
'The time the document instance / document BOM was updated'
),
@@ -111,11 +116,14 @@ export const getRecentActivityHandlerResponse = zod.object({
zod.object({
Chat: zod.object({
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was deleted'),
id: zod.string().describe('The chat uuid'),
isPersistent: zod.boolean(),
@@ -130,7 +138,9 @@ export const getRecentActivityHandlerResponse = zod.object({
.describe('The project id of the chat'),
tokenCount: zod.number().nullish(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was last updated'),
userId: zod.string().describe('Who the chat belongs to'),
type: zod.enum(['chat']),
@@ -246,8 +256,8 @@ export const editAnchorResponse = zod
.object({
alpha: zod.number(),
blue: zod.number(),
- createdAt: zod.number(),
- deletedAt: zod.number().nullable(),
+ createdAt: zod.string().datetime({}).nullish(),
+ deletedAt: zod.string().datetime({}).nullish(),
documentId: zod.string(),
green: zod.number(),
highlightRects: zod.array(
@@ -271,7 +281,7 @@ export const editAnchorResponse = zod
red: zod.number(),
text: zod.string(),
threadId: zod.number().nullish(),
- updatedAt: zod.number(),
+ updatedAt: zod.string().datetime({}).nullish(),
uuid: zod.string().uuid(),
})
.and(
@@ -356,8 +366,8 @@ export const createAnchorResponse = zod
.object({
alpha: zod.number(),
blue: zod.number(),
- createdAt: zod.number(),
- deletedAt: zod.number().nullable(),
+ createdAt: zod.string().datetime({}).nullish(),
+ deletedAt: zod.string().datetime({}).nullish(),
documentId: zod.string(),
green: zod.number(),
highlightRects: zod.array(
@@ -381,7 +391,7 @@ export const createAnchorResponse = zod
red: zod.number(),
text: zod.string(),
threadId: zod.number().nullish(),
- updatedAt: zod.number(),
+ updatedAt: zod.string().datetime({}).nullish(),
uuid: zod.string().uuid(),
})
.and(
@@ -434,8 +444,8 @@ export const getDocumentAnchorsResponse = zod.object({
.object({
alpha: zod.number(),
blue: zod.number(),
- createdAt: zod.number(),
- deletedAt: zod.number().nullable(),
+ createdAt: zod.string().datetime({}).nullish(),
+ deletedAt: zod.string().datetime({}).nullish(),
documentId: zod.string(),
green: zod.number(),
highlightRects: zod.array(
@@ -459,7 +469,7 @@ export const getDocumentAnchorsResponse = zod.object({
red: zod.number(),
text: zod.string(),
threadId: zod.number().nullish(),
- updatedAt: zod.number(),
+ updatedAt: zod.string().datetime({}).nullish(),
uuid: zod.string().uuid(),
})
.and(
@@ -544,15 +554,15 @@ export const editCommentBody = zod.object({
export const editCommentResponse = zod
.object({
commentId: zod.number(),
- createdAt: zod.number(),
- deletedAt: zod.number().nullable(),
+ createdAt: zod.string().datetime({}).nullish(),
+ deletedAt: zod.string().datetime({}).nullish(),
metadata: zod.any().optional(),
order: zod.number().nullish(),
owner: zod.string(),
sender: zod.string().nullish(),
text: zod.string(),
threadId: zod.number(),
- updatedAt: zod.number(),
+ updatedAt: zod.string().datetime({}).nullish(),
})
.and(
zod.object({
@@ -666,26 +676,26 @@ export const createCommentResponse = zod
comments: zod.array(
zod.object({
commentId: zod.number(),
- createdAt: zod.number(),
- deletedAt: zod.number().nullable(),
+ createdAt: zod.string().datetime({}).nullish(),
+ deletedAt: zod.string().datetime({}).nullish(),
metadata: zod.any().optional(),
order: zod.number().nullish(),
owner: zod.string(),
sender: zod.string().nullish(),
text: zod.string(),
threadId: zod.number(),
- updatedAt: zod.number(),
+ updatedAt: zod.string().datetime({}).nullish(),
})
),
thread: zod.object({
- createdAt: zod.number(),
- deletedAt: zod.number().nullable(),
+ createdAt: zod.string().datetime({}).nullish(),
+ deletedAt: zod.string().datetime({}).nullish(),
documentId: zod.string(),
metadata: zod.any().optional(),
owner: zod.string(),
resolved: zod.boolean(),
threadId: zod.number(),
- updatedAt: zod.number(),
+ updatedAt: zod.string().datetime({}).nullish(),
}),
})
.and(
@@ -722,8 +732,8 @@ export const createCommentResponse = zod
.object({
alpha: zod.number(),
blue: zod.number(),
- createdAt: zod.number(),
- deletedAt: zod.number().nullable(),
+ createdAt: zod.string().datetime({}).nullish(),
+ deletedAt: zod.string().datetime({}).nullish(),
documentId: zod.string(),
green: zod.number(),
highlightRects: zod.array(
@@ -747,7 +757,7 @@ export const createCommentResponse = zod
red: zod.number(),
text: zod.string(),
threadId: zod.number().nullish(),
- updatedAt: zod.number(),
+ updatedAt: zod.string().datetime({}).nullish(),
uuid: zod.string().uuid(),
})
.and(
@@ -775,26 +785,26 @@ export const getDocumentCommentsResponse = zod.object({
comments: zod.array(
zod.object({
commentId: zod.number(),
- createdAt: zod.number(),
- deletedAt: zod.number().nullable(),
+ createdAt: zod.string().datetime({}).nullish(),
+ deletedAt: zod.string().datetime({}).nullish(),
metadata: zod.any().optional(),
order: zod.number().nullish(),
owner: zod.string(),
sender: zod.string().nullish(),
text: zod.string(),
threadId: zod.number(),
- updatedAt: zod.number(),
+ updatedAt: zod.string().datetime({}).nullish(),
})
),
thread: zod.object({
- createdAt: zod.number(),
- deletedAt: zod.number().nullable(),
+ createdAt: zod.string().datetime({}).nullish(),
+ deletedAt: zod.string().datetime({}).nullish(),
documentId: zod.string(),
metadata: zod.any().optional(),
owner: zod.string(),
resolved: zod.boolean(),
threadId: zod.number(),
- updatedAt: zod.number(),
+ updatedAt: zod.string().datetime({}).nullish(),
}),
})
),
@@ -831,11 +841,14 @@ export const getUserDocumentsHandlerResponse = zod.object({
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentBom: zod
.array(
@@ -906,7 +919,9 @@ export const getUserDocumentsHandlerResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe(
'The time the document instance / document BOM was updated'
),
@@ -1006,7 +1021,11 @@ export const createDocumentHandlerResponse = zod.object({
.describe(
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
- createdAt: zod.number().describe('The time the document was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the document was created'),
documentBom: zod
.array(
zod.object({
@@ -1064,7 +1083,9 @@ export const createDocumentHandlerResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe(
'The time the document instance / document BOM was updated'
),
@@ -1270,7 +1291,11 @@ export const getDocumentListHandlerResponse = zod.object({
.describe(
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
- createdAt: zod.number().describe('The time the document was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the document was created'),
documentFamilyId: zod
.number()
.nullish()
@@ -1285,7 +1310,9 @@ export const getDocumentListHandlerResponse = zod.object({
.nullish()
.describe('The file type of the document'),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe(
'The time the document instance / document BOM was updated'
),
@@ -1407,7 +1434,9 @@ export const getBatchPreviewHandlerResponse = zod.object({
])
.optional(),
updated_at: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was last updated'),
})
.and(
@@ -1457,10 +1486,15 @@ export const getDocumentResponse = zod.object({
.describe(
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
- createdAt: zod.number().describe('The time the document was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentBom: zod
.array(
@@ -1527,7 +1561,9 @@ export const getDocumentResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document instance / document BOM was updated'),
}),
userAccessLevel: zod
@@ -1591,7 +1627,11 @@ export const saveDocumentHandlerResponse = zod.object({
.describe(
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
- createdAt: zod.number().describe('The time the document was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the document was created'),
documentBom: zod
.array(
zod.object({
@@ -1649,7 +1689,9 @@ export const saveDocumentHandlerResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document instance / document BOM was updated'),
}),
presignedUrl: zod
@@ -1725,10 +1767,15 @@ export const copyDocumentHandlerResponse = zod.object({
.describe(
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
- createdAt: zod.number().describe('The time the document was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentBom: zod
.array(
@@ -1795,7 +1842,9 @@ export const copyDocumentHandlerResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document instance / document BOM was updated'),
}),
userAccessLevel: zod
@@ -1954,7 +2003,11 @@ export const simpleSaveResponse = zod.object({
.describe(
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
- createdAt: zod.number().describe('The time the document was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the document was created'),
documentBom: zod
.array(
zod.object({
@@ -2012,7 +2065,9 @@ export const simpleSaveResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document instance / document BOM was updated'),
}),
presignedUrl: zod
@@ -2060,10 +2115,15 @@ export const getDocumentVersionResponse = zod.object({
.describe(
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
- createdAt: zod.number().describe('The time the document was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentBom: zod
.array(
@@ -2130,7 +2190,9 @@ export const getDocumentVersionResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document instance / document BOM was updated'),
}),
userAccessLevel: zod
@@ -2209,10 +2271,15 @@ export const getHistoryHandlerResponse = zod.object({
.describe(
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
- createdAt: zod.number().describe('The time the document was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentFamilyId: zod
.number()
@@ -2259,17 +2326,24 @@ export const getHistoryHandlerResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe(
'The time the document instance / document BOM was updated'
),
type: zod.enum(['document']),
}),
zod.object({
- createdAt: zod.number().describe('The time the chat was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the chat was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was deleted'),
id: zod.string().describe('The chat uuid'),
isPersistent: zod.boolean(),
@@ -2284,18 +2358,28 @@ export const getHistoryHandlerResponse = zod.object({
.describe('The project id of the chat'),
tokenCount: zod.number().nullish(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was last updated'),
userId: zod.string().describe('Who the chat belongs to'),
type: zod.enum(['chat']),
}),
zod.object({
- createdAt: zod.number().describe('The time the project was created'),
- deletedAt: zod.number().nullable(),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the project was created'),
+ deletedAt: zod.string().datetime({}).nullish(),
id: zod.string().describe('The id of the project'),
name: zod.string().describe('The name of the project'),
parentId: zod.string().nullish().describe('The parent project id'),
- updatedAt: zod.number().describe('The time the project was updated'),
+ updatedAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the project was updated'),
userId: zod
.string()
.describe('The user id of who created the project'),
@@ -2401,11 +2485,13 @@ export const getItemsSoupResponse = zod.object({
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'
),
createdAt: zod
- .number()
+ .string()
+ .datetime({})
.describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentFamilyId: zod
.number()
@@ -2676,23 +2762,29 @@ export const getItemsSoupResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
.describe(
'The time the document instance / document BOM was updated'
),
viewedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was last viewed'),
}),
tag: zod.enum(['document']),
}),
zod.object({
data: zod.object({
- createdAt: zod.number().describe('The time the chat was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .describe('The time the chat was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was deleted'),
id: zod.string().uuid().describe('The chat uuid'),
isPersistent: zod
@@ -2927,11 +3019,13 @@ export const getItemsSoupResponse = zod.object({
)
.describe('Properties'),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
.describe('The time the chat was last updated'),
viewedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was last viewed'),
}),
tag: zod.enum(['chat']),
@@ -2939,11 +3033,13 @@ export const getItemsSoupResponse = zod.object({
zod.object({
data: zod.object({
createdAt: zod
- .number()
+ .string()
+ .datetime({})
.describe('The time the project was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the project was deleted'),
id: zod.string().uuid().describe('The id of the project'),
name: zod.string().describe('The name of the project'),
@@ -3177,11 +3273,13 @@ export const getItemsSoupResponse = zod.object({
)
.describe('Properties'),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
.describe('The time the project was updated'),
viewedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was last viewed'),
}),
tag: zod.enum(['project']),
@@ -3189,7 +3287,7 @@ export const getItemsSoupResponse = zod.object({
zod.object({
data: zod
.object({
- createdAt: zod.number(),
+ createdAt: zod.string().datetime({}),
id: zod.string().uuid(),
inboxVisible: zod.boolean(),
isDraft: zod.boolean(),
@@ -3202,16 +3300,16 @@ export const getItemsSoupResponse = zod.object({
senderName: zod.string().nullish(),
senderPhotoUrl: zod.string().nullish(),
snippet: zod.string().nullish(),
- sortTs: zod.number(),
- updatedAt: zod.number(),
- viewedAt: zod.number().nullable(),
+ sortTs: zod.string().datetime({}),
+ updatedAt: zod.string().datetime({}),
+ viewedAt: zod.string().datetime({}).nullish(),
})
.and(
zod.object({
attachments: zod.array(
zod.object({
contentId: zod.string().nullish(),
- createdAt: zod.number(),
+ createdAt: zod.string().datetime({}),
filename: zod.string().nullish(),
id: zod.string().uuid(),
messageId: zod.string().uuid(),
@@ -3814,11 +3912,13 @@ export const postItemsSoupResponse = zod.object({
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type'
),
createdAt: zod
- .number()
+ .string()
+ .datetime({})
.describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentFamilyId: zod
.number()
@@ -4089,23 +4189,29 @@ export const postItemsSoupResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
.describe(
'The time the document instance / document BOM was updated'
),
viewedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was last viewed'),
}),
tag: zod.enum(['document']),
}),
zod.object({
data: zod.object({
- createdAt: zod.number().describe('The time the chat was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .describe('The time the chat was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was deleted'),
id: zod.string().uuid().describe('The chat uuid'),
isPersistent: zod
@@ -4340,11 +4446,13 @@ export const postItemsSoupResponse = zod.object({
)
.describe('Properties'),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
.describe('The time the chat was last updated'),
viewedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was last viewed'),
}),
tag: zod.enum(['chat']),
@@ -4352,11 +4460,13 @@ export const postItemsSoupResponse = zod.object({
zod.object({
data: zod.object({
createdAt: zod
- .number()
+ .string()
+ .datetime({})
.describe('The time the project was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the project was deleted'),
id: zod.string().uuid().describe('The id of the project'),
name: zod.string().describe('The name of the project'),
@@ -4590,11 +4700,13 @@ export const postItemsSoupResponse = zod.object({
)
.describe('Properties'),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
.describe('The time the project was updated'),
viewedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was last viewed'),
}),
tag: zod.enum(['project']),
@@ -4602,7 +4714,7 @@ export const postItemsSoupResponse = zod.object({
zod.object({
data: zod
.object({
- createdAt: zod.number(),
+ createdAt: zod.string().datetime({}),
id: zod.string().uuid(),
inboxVisible: zod.boolean(),
isDraft: zod.boolean(),
@@ -4615,16 +4727,16 @@ export const postItemsSoupResponse = zod.object({
senderName: zod.string().nullish(),
senderPhotoUrl: zod.string().nullish(),
snippet: zod.string().nullish(),
- sortTs: zod.number(),
- updatedAt: zod.number(),
- viewedAt: zod.number().nullable(),
+ sortTs: zod.string().datetime({}),
+ updatedAt: zod.string().datetime({}),
+ viewedAt: zod.string().datetime({}).nullish(),
})
.and(
zod.object({
attachments: zod.array(
zod.object({
contentId: zod.string().nullish(),
- createdAt: zod.number(),
+ createdAt: zod.string().datetime({}),
filename: zod.string().nullish(),
id: zod.string().uuid(),
messageId: zod.string().uuid(),
@@ -4999,11 +5111,14 @@ export const getPinsHandlerResponse = zod.object({
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentFamilyId: zod
.number()
@@ -5056,7 +5171,9 @@ export const getPinsHandlerResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe(
'The time the document instance / document BOM was updated'
),
@@ -5064,11 +5181,14 @@ export const getPinsHandlerResponse = zod.object({
}),
zod.object({
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was deleted'),
id: zod.string().describe('The chat uuid'),
isPersistent: zod.boolean(),
@@ -5083,16 +5203,20 @@ export const getPinsHandlerResponse = zod.object({
.describe('The project id of the chat'),
tokenCount: zod.number().nullish(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was last updated'),
userId: zod.string().describe('Who the chat belongs to'),
type: zod.enum(['chat']),
}),
zod.object({
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the project was created'),
- deletedAt: zod.number().nullable(),
+ deletedAt: zod.string().datetime({}).nullish(),
id: zod.string().describe('The id of the project'),
name: zod.string().describe('The name of the project'),
parentId: zod
@@ -5100,7 +5224,9 @@ export const getPinsHandlerResponse = zod.object({
.nullish()
.describe('The parent project id'),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the project was updated'),
userId: zod
.string()
@@ -5123,11 +5249,14 @@ export const getPinsHandlerResponse = zod.object({
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentFamilyId: zod
.number()
@@ -5180,7 +5309,9 @@ export const getPinsHandlerResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe(
'The time the document instance / document BOM was updated'
),
@@ -5188,11 +5319,14 @@ export const getPinsHandlerResponse = zod.object({
}),
zod.object({
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was deleted'),
id: zod.string().describe('The chat uuid'),
isPersistent: zod.boolean(),
@@ -5207,16 +5341,20 @@ export const getPinsHandlerResponse = zod.object({
.describe('The project id of the chat'),
tokenCount: zod.number().nullish(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was last updated'),
userId: zod.string().describe('Who the chat belongs to'),
type: zod.enum(['chat']),
}),
zod.object({
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the project was created'),
- deletedAt: zod.number().nullable(),
+ deletedAt: zod.string().datetime({}).nullish(),
id: zod.string().describe('The id of the project'),
name: zod.string().describe('The name of the project'),
parentId: zod
@@ -5224,7 +5362,9 @@ export const getPinsHandlerResponse = zod.object({
.nullish()
.describe('The parent project id'),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the project was updated'),
userId: zod
.string()
@@ -5303,12 +5443,20 @@ export const getProjectsHandlerResponse = zod.object({
data: zod
.array(
zod.object({
- createdAt: zod.number().describe('The time the project was created'),
- deletedAt: zod.number().nullable(),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the project was created'),
+ deletedAt: zod.string().datetime({}).nullish(),
id: zod.string().describe('The id of the project'),
name: zod.string().describe('The name of the project'),
parentId: zod.string().nullish().describe('The parent project id'),
- updatedAt: zod.number().describe('The time the project was updated'),
+ updatedAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the project was updated'),
userId: zod.string().describe('The user id of who created the project'),
type: zod.enum(['project']),
})
@@ -5331,12 +5479,20 @@ export const createProjectHandlerBody = zod.object({
export const createProjectHandlerResponse = zod.object({
data: zod.object({
- createdAt: zod.number().describe('The time the project was created'),
- deletedAt: zod.number().nullable(),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the project was created'),
+ deletedAt: zod.string().datetime({}).nullish(),
id: zod.string().describe('The id of the project'),
name: zod.string().describe('The name of the project'),
parentId: zod.string().nullish().describe('The parent project id'),
- updatedAt: zod.number().describe('The time the project was updated'),
+ updatedAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the project was updated'),
userId: zod.string().describe('The user id of who created the project'),
type: zod.enum(['project']),
}),
@@ -5351,12 +5507,20 @@ export const getPendingProjectsHandlerResponse = zod.object({
.array(
zod
.object({
- createdAt: zod.number().describe('The time the project was created'),
- deletedAt: zod.number().nullable(),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the project was created'),
+ deletedAt: zod.string().datetime({}).nullish(),
id: zod.string().describe('The id of the project'),
name: zod.string().describe('The name of the project'),
parentId: zod.string().nullish().describe('The parent project id'),
- updatedAt: zod.number().describe('The time the project was updated'),
+ updatedAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the project was updated'),
userId: zod
.string()
.describe('The user id of who created the project'),
@@ -5392,7 +5556,7 @@ export const getBatchProjectPreviewResponse = zod.object({
name: zod.string(),
owner: zod.string(),
path: zod.array(zod.string()),
- updatedAt: zod.number(),
+ updatedAt: zod.string().datetime({}).nullish(),
})
.and(
zod.object({
@@ -5644,12 +5808,20 @@ export const getProjectHandlerParams = zod.object({
export const getProjectHandlerResponse = zod.object({
data: zod.object({
projectMetadata: zod.object({
- createdAt: zod.number().describe('The time the project was created'),
- deletedAt: zod.number().nullable(),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the project was created'),
+ deletedAt: zod.string().datetime({}).nullish(),
id: zod.string().describe('The id of the project'),
name: zod.string().describe('The name of the project'),
parentId: zod.string().nullish().describe('The parent project id'),
- updatedAt: zod.number().describe('The time the project was updated'),
+ updatedAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the project was updated'),
userId: zod.string().describe('The user id of who created the project'),
type: zod.enum(['project']),
}),
@@ -5721,11 +5893,14 @@ export const getProjectContentHandlerResponse = zod.object({
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentFamilyId: zod
.number()
@@ -5774,17 +5949,24 @@ export const getProjectContentHandlerResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe(
'The time the document instance / document BOM was updated'
),
type: zod.enum(['document']),
}),
zod.object({
- createdAt: zod.number().describe('The time the chat was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the chat was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was deleted'),
id: zod.string().describe('The chat uuid'),
isPersistent: zod.boolean(),
@@ -5799,21 +5981,27 @@ export const getProjectContentHandlerResponse = zod.object({
.describe('The project id of the chat'),
tokenCount: zod.number().nullish(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was last updated'),
userId: zod.string().describe('Who the chat belongs to'),
type: zod.enum(['chat']),
}),
zod.object({
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the project was created'),
- deletedAt: zod.number().nullable(),
+ deletedAt: zod.string().datetime({}).nullish(),
id: zod.string().describe('The id of the project'),
name: zod.string().describe('The name of the project'),
parentId: zod.string().nullish().describe('The parent project id'),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the project was updated'),
userId: zod
.string()
@@ -5916,11 +6104,14 @@ export const recentlyDeletedResponse = zod.object({
'The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type'
),
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the document was deleted'),
documentFamilyId: zod
.number()
@@ -5971,17 +6162,24 @@ export const recentlyDeletedResponse = zod.object({
])
.optional(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe(
'The time the document instance / document BOM was updated'
),
type: zod.enum(['document']),
}),
zod.object({
- createdAt: zod.number().describe('The time the chat was created'),
+ createdAt: zod
+ .string()
+ .datetime({})
+ .nullish()
+ .describe('The time the chat was created'),
deletedAt: zod
- .number()
- .nullable()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was deleted'),
id: zod.string().describe('The chat uuid'),
isPersistent: zod.boolean(),
@@ -5996,16 +6194,20 @@ export const recentlyDeletedResponse = zod.object({
.describe('The project id of the chat'),
tokenCount: zod.number().nullish(),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the chat was last updated'),
userId: zod.string().describe('Who the chat belongs to'),
type: zod.enum(['chat']),
}),
zod.object({
createdAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the project was created'),
- deletedAt: zod.number().nullable(),
+ deletedAt: zod.string().datetime({}).nullish(),
id: zod.string().describe('The id of the project'),
name: zod.string().describe('The name of the project'),
parentId: zod
@@ -6013,7 +6215,9 @@ export const recentlyDeletedResponse = zod.object({
.nullish()
.describe('The parent project id'),
updatedAt: zod
- .number()
+ .string()
+ .datetime({})
+ .nullish()
.describe('The time the project was updated'),
userId: zod
.string()
diff --git a/js/app/packages/service-clients/service-storage/openapi.json b/js/app/packages/service-clients/service-storage/openapi.json
index 168f64b19d..cd4a340660 100644
--- a/js/app/packages/service-clients/service-storage/openapi.json
+++ b/js/app/packages/service-clients/service-storage/openapi.json
@@ -4521,15 +4521,7 @@
},
"BasicDocument": {
"type": "object",
- "required": [
- "id",
- "documentVersionId",
- "owner",
- "name",
- "createdAt",
- "updatedAt",
- "deletedAt"
- ],
+ "required": ["id", "documentVersionId", "owner", "name"],
"properties": {
"branchedFromId": {
"type": ["string", "null"],
@@ -4541,13 +4533,13 @@
"description": "The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type"
},
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document was created"
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document was deleted"
},
"documentFamilyId": {
@@ -4596,8 +4588,8 @@
]
},
"updatedAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document instance / document BOM was updated"
}
}
@@ -4827,24 +4819,16 @@
},
"Chat": {
"type": "object",
- "required": [
- "id",
- "name",
- "userId",
- "createdAt",
- "updatedAt",
- "isPersistent",
- "deletedAt"
- ],
+ "required": ["id", "name", "userId", "isPersistent"],
"properties": {
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the chat was created"
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the chat was deleted"
},
"id": {
@@ -4871,8 +4855,8 @@
"format": "int64"
},
"updatedAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the chat was last updated"
},
"userId": {
@@ -4925,27 +4909,19 @@
},
"Comment": {
"type": "object",
- "required": [
- "commentId",
- "threadId",
- "owner",
- "text",
- "createdAt",
- "updatedAt",
- "deletedAt"
- ],
+ "required": ["commentId", "threadId", "owner", "text"],
"properties": {
"commentId": {
"type": "integer",
"format": "int64"
},
"createdAt": {
- "type": "integer",
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"metadata": {},
"order": {
@@ -4966,8 +4942,8 @@
"format": "int64"
},
"updatedAt": {
- "type": "integer",
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
},
@@ -5531,10 +5507,7 @@
"documentId",
"documentVersionId",
"owner",
- "documentName",
- "createdAt",
- "updatedAt",
- "deletedAt"
+ "documentName"
],
"properties": {
"branchedFromId": {
@@ -5547,13 +5520,13 @@
"description": "The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type"
},
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document was created"
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document was deleted"
},
"documentBom": {
@@ -5616,8 +5589,8 @@
]
},
"updatedAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document instance / document BOM was updated"
}
}
@@ -5726,7 +5699,7 @@
},
"DocumentPreviewData": {
"type": "object",
- "required": ["document_id", "document_name", "owner", "updated_at"],
+ "required": ["document_id", "document_name", "owner"],
"properties": {
"document_id": {
"type": "string",
@@ -5756,8 +5729,8 @@
]
},
"updated_at": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document was last updated"
}
}
@@ -5800,9 +5773,7 @@
"documentId",
"documentVersionId",
"owner",
- "documentName",
- "createdAt",
- "updatedAt"
+ "documentName"
],
"properties": {
"branchedFromId": {
@@ -5815,8 +5786,8 @@
"description": "The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type"
},
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document was created"
},
"documentBom": {
@@ -5871,8 +5842,8 @@
]
},
"updatedAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document instance / document BOM was updated"
}
}
@@ -6543,13 +6514,7 @@
},
"GetDocumentListResult": {
"type": "object",
- "required": [
- "documentId",
- "documentVersionId",
- "documentName",
- "createdAt",
- "updatedAt"
- ],
+ "required": ["documentId", "documentVersionId", "documentName"],
"properties": {
"branchedFromId": {
"type": ["string", "null"],
@@ -6561,8 +6526,8 @@
"description": "The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on\nthe file type"
},
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document was created"
},
"documentFamilyId": {
@@ -6588,8 +6553,8 @@
"description": "The file type of the document"
},
"updatedAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document instance / document BOM was updated"
}
}
@@ -7196,9 +7161,6 @@
"text",
"pageViewportWidth",
"pageViewportHeight",
- "createdAt",
- "updatedAt",
- "deletedAt",
"highlightRects"
],
"properties": {
@@ -7211,12 +7173,12 @@
"format": "int32"
},
"createdAt": {
- "type": "integer",
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"documentId": {
"type": "string"
@@ -7261,8 +7223,8 @@
"format": "int64"
},
"updatedAt": {
- "type": "integer",
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"uuid": {
"type": "string",
@@ -7625,23 +7587,16 @@
},
"Project": {
"type": "object",
- "required": [
- "id",
- "name",
- "userId",
- "createdAt",
- "updatedAt",
- "deletedAt"
- ],
+ "required": ["id", "name", "userId"],
"properties": {
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the project was created"
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"id": {
"type": "string",
@@ -7656,8 +7611,8 @@
"description": "The parent project id"
},
"updatedAt": {
- "type": "integer",
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the project was updated"
},
"userId": {
@@ -7786,7 +7741,7 @@
},
"ProjectPreviewData": {
"type": "object",
- "required": ["id", "name", "owner", "path", "updatedAt"],
+ "required": ["id", "name", "owner", "path"],
"properties": {
"id": {
"type": "string"
@@ -7804,8 +7759,8 @@
}
},
"updatedAt": {
- "type": "integer",
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
},
@@ -8402,8 +8357,8 @@
"type": ["string", "null"]
},
"createdAt": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"filename": {
"type": ["string", "null"]
@@ -8460,19 +8415,17 @@
"isPersistent",
"createdAt",
"updatedAt",
- "viewedAt",
- "deletedAt",
"properties"
],
"properties": {
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": "string",
+ "format": "date-time",
"description": "The time the chat was created"
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the chat was deleted"
},
"id": {
@@ -8505,13 +8458,13 @@
"description": "Properties"
},
"updatedAt": {
- "type": "integer",
- "format": "int64",
+ "type": "string",
+ "format": "date-time",
"description": "The time the chat was last updated"
},
"viewedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the chat was last viewed"
}
}
@@ -8548,8 +8501,6 @@
"name",
"createdAt",
"updatedAt",
- "viewedAt",
- "deletedAt",
"properties"
],
"properties": {
@@ -8564,13 +8515,13 @@
"description": "The id of the version this document branched from\nThis could be either DocumentInstance or DocumentBom id depending on the file type"
},
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": "string",
+ "format": "date-time",
"description": "The time the document was created"
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document was deleted"
},
"documentFamilyId": {
@@ -8628,13 +8579,13 @@
]
},
"updatedAt": {
- "type": "integer",
- "format": "int64",
+ "type": "string",
+ "format": "date-time",
"description": "The time the document instance / document BOM was updated"
},
"viewedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document was last viewed"
}
}
@@ -8670,13 +8621,12 @@
"isImportant",
"sortTs",
"createdAt",
- "updatedAt",
- "viewedAt"
+ "updatedAt"
],
"properties": {
"createdAt": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"id": {
"type": "string",
@@ -8716,16 +8666,16 @@
"type": ["string", "null"]
},
"sortTs": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"updatedAt": {
- "type": "integer",
- "format": "int64"
+ "type": "string",
+ "format": "date-time"
},
"viewedAt": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
},
@@ -8912,19 +8862,17 @@
"ownerId",
"createdAt",
"updatedAt",
- "viewedAt",
- "deletedAt",
"properties"
],
"properties": {
"createdAt": {
- "type": "integer",
- "format": "int64",
+ "type": "string",
+ "format": "date-time",
"description": "The time the project was created"
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the project was deleted"
},
"id": {
@@ -8953,13 +8901,13 @@
"description": "Properties"
},
"updatedAt": {
- "type": "integer",
- "format": "int64",
+ "type": "string",
+ "format": "date-time",
"description": "The time the project was updated"
},
"viewedAt": {
- "type": ["integer", "null"],
- "format": "int64",
+ "type": ["string", "null"],
+ "format": "date-time",
"description": "The time the document was last viewed"
}
}
@@ -9015,23 +8963,15 @@
},
"Thread": {
"type": "object",
- "required": [
- "threadId",
- "owner",
- "resolved",
- "documentId",
- "createdAt",
- "updatedAt",
- "deletedAt"
- ],
+ "required": ["threadId", "owner", "resolved", "documentId"],
"properties": {
"createdAt": {
- "type": "integer",
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"deletedAt": {
- "type": ["integer", "null"],
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
},
"documentId": {
"type": "string"
@@ -9048,8 +8988,8 @@
"format": "int64"
},
"updatedAt": {
- "type": "integer",
- "format": "int64"
+ "type": ["string", "null"],
+ "format": "date-time"
}
}
},
diff --git a/js/app/scripts/generate-api-schema.ts b/js/app/scripts/generate-api-schema.ts
index 0f131c0aed..b18edada61 100644
--- a/js/app/scripts/generate-api-schema.ts
+++ b/js/app/scripts/generate-api-schema.ts
@@ -13,6 +13,8 @@ import { type Service, services } from './services';
// Map service names to Rust crate names
const serviceToCrate: Record<string, string> = {
'cloud-storage': 'document_storage_service',
+ 'comms-service': 'comms_service',
+ 'properties-service': 'properties_service',
'document-cognition': 'document_cognition_service',
'auth-service': 'authentication_service',
'notification-service': 'notification_service',
diff --git a/js/app/scripts/services.ts b/js/app/scripts/services.ts
index 6e6ef40e24..c5065a469d 100644
--- a/js/app/scripts/services.ts
+++ b/js/app/scripts/services.ts
@@ -16,6 +16,22 @@ export const services: Service[] = [
output: "../packages/service-clients/service-storage/",
orvalKey: "storageService",
},
+ {
+ name: "comms-service",
+ dev: "https://cloud-storage-dev.macro.com/comms/api-doc/openapi.json",
+ prod: "https://cloud-storage.macro.com/comms/api-doc/openapi.json",
+ local: "http://localhost:8086/comms/api-doc/openapi.json",
+ output: "../packages/service-clients/service-comms/",
+ orvalKey: "commsService",
+ },
+ {
+ name: "properties-service",
+ dev: "https://cloud-storage-dev.macro.com/properties/api-doc/openapi.json",
+ prod: "https://cloud-storage.macro.com/properties/api-doc/openapi.json",
+ local: "http://localhost:8086/properties/api-doc/openapi.json",
+ output: "../packages/service-clients/service-properties/",
+ orvalKey: "propertiesService",
+ },
{
name: "document-cognition",
dev: "https://document-cognition-dev.macro.com/api-doc/openapi.json",
diff --git a/rust/cloud-storage/comms_service/src/api/mod.rs b/rust/cloud-storage/comms_service/src/api/mod.rs
index 085fd3382b..04ffe65d9e 100644
--- a/rust/cloud-storage/comms_service/src/api/mod.rs
+++ b/rust/cloud-storage/comms_service/src/api/mod.rs
@@ -1,5 +1,7 @@
use crate::api::{activity::post_activity, context::AppState};
use axum::{Router, routing::post};
+use utoipa::OpenApi;
+use utoipa_swagger_ui::SwaggerUi;
pub mod activity;
pub mod attachments;
@@ -22,4 +24,5 @@ pub fn router(app_state: &AppState) -> Router<AppState> {
.nest("/preview", preview::router())
.nest("/attachments", attachments::router())
.nest("/mentions", mentions::router())
+ .merge(SwaggerUi::new("/docs").url("/api-doc/openapi.json", swagger::ApiDoc::openapi()))
}
diff --git a/rust/cloud-storage/document_cognition_service/src/model/chats.rs b/rust/cloud-storage/document_cognition_service/src/model/chats.rs
index 457ae1d6f2..3cc9edf30d 100644
--- a/rust/cloud-storage/document_cognition_service/src/model/chats.rs
+++ b/rust/cloud-storage/document_cognition_service/src/model/chats.rs
@@ -1,6 +1,5 @@
#![allow(deprecated)]
use ai::types::Model;
-use chrono::serde::ts_seconds_option;
use model::chat::{Chat, ChatAttachmentWithName, ChatMessageWithAttachments};
use serde::{Deserialize, Serialize};
use unfurl_service::GetUnfurlResponse;
@@ -22,12 +21,8 @@ pub struct ChatResponse {
/// The model used to generate the chat
pub model: Option<Model>,
/// The time the chat was created
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
/// The time the chat was last updated
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
/// attachment context - attachments not attached to messages
#[deprecated(note = "Attachments are now stateless and no longer float until message send")]
diff --git a/rust/cloud-storage/email/src/inbound/axum/api_types.rs b/rust/cloud-storage/email/src/inbound/axum/api_types.rs
index c865a8474e..b35a563a99 100644
--- a/rust/cloud-storage/email/src/inbound/axum/api_types.rs
+++ b/rust/cloud-storage/email/src/inbound/axum/api_types.rs
@@ -76,21 +76,9 @@ pub struct ApiThreadPreviewCursorInner {
sender_name: Option<String>,
sender_photo_url: Option<String>,
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[schema(value_type = i64)]
- #[cfg_attr(feature = "ai_schema", schemars(with = "i64"))]
sort_ts: DateTime<Utc>,
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[schema(value_type = i64)]
- #[cfg_attr(feature = "ai_schema", schemars(with = "i64"))]
created_at: DateTime<Utc>,
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[schema(value_type = i64)]
- #[cfg_attr(feature = "ai_schema", schemars(with = "i64"))]
updated_at: DateTime<Utc>,
- #[serde(with = "chrono::serde::ts_milliseconds_option")]
- #[schema(value_type = i64, nullable = true)]
- #[cfg_attr(feature = "ai_schema", schemars(with = "Option<i64>"))]
viewed_at: Option<DateTime<Utc>>,
}
@@ -109,9 +97,6 @@ pub struct ApiAttachment {
size_bytes: Option<i64>,
content_id: Option<String>,
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[schema(value_type = i64)]
- #[cfg_attr(feature = "ai_schema", schemars(with = "i64"))]
created_at: DateTime<Utc>,
}
diff --git a/rust/cloud-storage/model/src/annotations/mod.rs b/rust/cloud-storage/model/src/annotations/mod.rs
index 3b6e606bb2..d2fc506ecf 100644
--- a/rust/cloud-storage/model/src/annotations/mod.rs
+++ b/rust/cloud-storage/model/src/annotations/mod.rs
@@ -1,8 +1,8 @@
+use chrono::{DateTime, Utc};
pub mod create;
pub mod delete;
pub mod edit;
-use chrono::{DateTime, Utc, serde::ts_seconds_option};
use create::{CreateCommentResponse, CreateUnthreadedAnchorResponse};
use delete::{DeleteCommentResponse, DeleteUnthreadedAnchorResponse};
use edit::{EditAnchorResponse, EditCommentResponse};
@@ -23,14 +23,8 @@ pub struct Comment {
pub sender: Option<String>,
pub text: String,
pub metadata: Option<Value>,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub created_at: Option<DateTime<Utc>>,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<DateTime<Utc>>,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=true)]
pub deleted_at: Option<DateTime<Utc>>,
}
@@ -41,14 +35,8 @@ pub struct Thread {
pub owner: String,
pub resolved: bool,
pub document_id: String,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub created_at: Option<DateTime<Utc>>,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<DateTime<Utc>>,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=true)]
pub deleted_at: Option<DateTime<Utc>>,
pub metadata: Option<Value>,
}
@@ -126,14 +114,8 @@ pub struct PdfHighlightAnchor {
pub text: String,
pub page_viewport_width: f64,
pub page_viewport_height: f64,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub created_at: Option<DateTime<Utc>>,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<DateTime<Utc>>,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=true)]
pub deleted_at: Option<DateTime<Utc>>,
pub highlight_rects: Vec<PdfHighlightRect>,
}
diff --git a/rust/cloud-storage/model/src/chat/mod.rs b/rust/cloud-storage/model/src/chat/mod.rs
index df27270654..74f416935b 100644
--- a/rust/cloud-storage/model/src/chat/mod.rs
+++ b/rust/cloud-storage/model/src/chat/mod.rs
@@ -2,7 +2,6 @@ mod message;
pub mod preview;
pub mod utils;
-use chrono::serde::ts_seconds_option;
use macro_user_id::user_id::MacroUserIdStr;
pub use message::*;
use serde::{Deserialize, Serialize};
@@ -27,20 +26,14 @@ pub struct Chat {
#[serde(skip_serializing_if = "Option::is_none")]
pub project_id: Option<String>,
/// The time the chat was created
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
/// The time the chat was last updated
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
// count of tokens in the chat
pub token_count: Option<i64>,
// whether the chat is persistent or not
pub is_persistent: bool,
/// The time the chat was deleted
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=true)]
pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
}
diff --git a/rust/cloud-storage/model/src/chat/preview.rs b/rust/cloud-storage/model/src/chat/preview.rs
index 3269ad5e91..bf126017f9 100644
--- a/rust/cloud-storage/model/src/chat/preview.rs
+++ b/rust/cloud-storage/model/src/chat/preview.rs
@@ -1,4 +1,3 @@
-use chrono::serde::ts_seconds_option;
use utoipa::ToSchema;
use models_permissions::share_permission::SharePermissionV2;
@@ -34,8 +33,6 @@ pub struct ChatPreviewData {
pub chat_id: String,
pub chat_name: String,
pub owner: String,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
diff --git a/rust/cloud-storage/model/src/document/basic.rs b/rust/cloud-storage/model/src/document/basic.rs
index 3925b78e00..1db5e473f1 100644
--- a/rust/cloud-storage/model/src/document/basic.rs
+++ b/rust/cloud-storage/model/src/document/basic.rs
@@ -2,7 +2,6 @@ use std::str::FromStr;
use super::file_type::FileType;
use crate::document::FileTypeExt;
-use chrono::serde::ts_seconds_option;
use macro_user_id::user_id::MacroUserIdStr;
use utoipa::ToSchema;
@@ -32,10 +31,8 @@ pub struct Document {
#[serde(skip_serializing_if = "Option::is_none")]
pub project_id: Option<String>,
/// The time the document was created
- #[serde(with = "ts_seconds_option")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
/// The time the document was last updated
- #[serde(with = "ts_seconds_option")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
@@ -53,9 +50,7 @@ pub struct ID {
#[serde(rename_all = "snake_case")]
pub struct IDWithTimeStamps {
pub id: String,
- #[serde(with = "ts_seconds_option")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
- #[serde(with = "ts_seconds_option")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
@@ -71,9 +66,7 @@ pub struct VersionID {
pub struct VersionIDWithTimeStampsOptionalSha {
pub id: i64,
pub sha: Option<String>,
- #[serde(with = "ts_seconds_option")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
- #[serde(with = "ts_seconds_option")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
@@ -82,9 +75,7 @@ pub struct VersionIDWithTimeStampsOptionalSha {
#[serde(rename_all = "snake_case")]
pub struct VersionIDWithTimeStampsNoSha {
pub id: i64,
- #[serde(with = "ts_seconds_option")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
- #[serde(with = "ts_seconds_option")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
@@ -94,9 +85,7 @@ pub struct VersionIDWithTimeStampsNoSha {
pub struct VersionIDWithTimeStamps {
pub id: i64,
pub sha: String,
- #[serde(with = "ts_seconds_option")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
- #[serde(with = "ts_seconds_option")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
@@ -118,8 +107,6 @@ pub struct DocumentBasic {
pub document_family_id: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub project_id: Option<String>,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=true)]
pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
}
diff --git a/rust/cloud-storage/model/src/document/mod.rs b/rust/cloud-storage/model/src/document/mod.rs
index 9d18cd004f..68665440c5 100644
--- a/rust/cloud-storage/model/src/document/mod.rs
+++ b/rust/cloud-storage/model/src/document/mod.rs
@@ -1,8 +1,7 @@
-#[cfg(test)]
-mod test;
-use chrono::serde::ts_seconds_option;
pub mod list;
pub mod response;
+#[cfg(test)]
+mod test;
use document_sub_type::DocumentSubType;
use macro_user_id::user_id::MacroUserIdStr;
use utoipa::ToSchema;
@@ -103,17 +102,11 @@ pub struct BasicDocument {
#[serde(skip_serializing_if = "Option::is_none")]
pub document_family_id: Option<i64>,
/// The time the document was created
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
/// The time the document instance / document BOM was updated
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
/// The time the document was deleted
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=true)]
pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
/// The sub type of the document if present.
@@ -198,17 +191,11 @@ pub struct DocumentMetadata {
#[serde(skip_serializing_if = "Option::is_none")]
pub modification_data: Option<serde_json::Value>,
/// The time the document was created
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
/// The time the document instance / document BOM was updated
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
/// The time the document was deleted
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=true)]
pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
/// The sub type of the document if present.
@@ -344,8 +331,6 @@ pub struct DocumentPreviewData {
/// The id of the owner of the document
pub owner: String,
/// The time the document was last updated
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
/// The sub type of the document if present.
/// Task-related properties are encoded within the variant.
diff --git a/rust/cloud-storage/model/src/document/response/mod.rs b/rust/cloud-storage/model/src/document/response/mod.rs
index 62843793d8..bd479193de 100644
--- a/rust/cloud-storage/model/src/document/response/mod.rs
+++ b/rust/cloud-storage/model/src/document/response/mod.rs
@@ -8,7 +8,6 @@ use std::str::FromStr;
use crate::document::{BomPart, FileType};
use crate::response::TypedSuccessResponse;
use crate::{document::DocumentMetadata, response::PresignedUrl};
-use chrono::serde::ts_seconds_option;
use models_permissions::share_permission::access_level::AccessLevel;
use tracing::instrument;
use utoipa::ToSchema;
@@ -38,12 +37,8 @@ pub struct GetDocumentListResult {
#[serde(skip_serializing_if = "Option::is_none")]
pub document_family_id: Option<i64>,
/// The time the document was created
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
/// The time the document instance / document BOM was updated
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
@@ -123,12 +118,8 @@ pub struct DocumentResponseMetadata {
#[serde(skip_serializing_if = "Option::is_none")]
pub modification_data: Option<serde_json::Value>,
/// The time the document was created
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
/// The time the document instance / document BOM was updated
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
/// The sub type of the document if present.
#[serde(skip_serializing_if = "Option::is_none")]
diff --git a/rust/cloud-storage/model/src/document/test.rs b/rust/cloud-storage/model/src/document/test.rs
index 8b49226b6e..8fc8b094ac 100644
--- a/rust/cloud-storage/model/src/document/test.rs
+++ b/rust/cloud-storage/model/src/document/test.rs
@@ -66,9 +66,6 @@ fn test_document_basic_serde_with_deleted_at() {
assert_eq!(original.document_name, deserialized.document_name);
assert_eq!(original.owner, deserialized.owner);
assert_eq!(original.file_type, deserialized.file_type);
- // deleted_at uses ts_seconds so subsecond precision is lost
- assert_eq!(
- original.deleted_at.map(|dt| dt.timestamp()),
- deserialized.deleted_at.map(|dt| dt.timestamp())
- );
+ // DateTime serializes to ISO 8601 string, preserving microsecond precision
+ assert_eq!(original.deleted_at, deserialized.deleted_at);
}
diff --git a/rust/cloud-storage/model/src/experiment/mod.rs b/rust/cloud-storage/model/src/experiment/mod.rs
index d9a17e7f26..b0999a51c0 100644
--- a/rust/cloud-storage/model/src/experiment/mod.rs
+++ b/rust/cloud-storage/model/src/experiment/mod.rs
@@ -1,4 +1,3 @@
-use chrono::serde::ts_seconds_option;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
@@ -9,12 +8,8 @@ pub struct Experiment {
/// Whether the experiment is active
pub active: bool,
/// The date the experiment was started
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=true)]
pub started_at: Option<chrono::DateTime<chrono::Utc>>,
/// The date the experiment was ended
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=true)]
pub ended_at: Option<chrono::DateTime<chrono::Utc>>,
}
diff --git a/rust/cloud-storage/model/src/lib.rs b/rust/cloud-storage/model/src/lib.rs
index 93a6a3d796..d17ae9467a 100644
--- a/rust/cloud-storage/model/src/lib.rs
+++ b/rust/cloud-storage/model/src/lib.rs
@@ -1,4 +1,3 @@
-use chrono::serde::ts_seconds_option;
use serde::{Deserialize, Serialize};
pub mod activity;
pub mod annotations;
@@ -30,9 +29,7 @@ pub mod version;
#[serde(rename_all = "snake_case")]
pub struct IDWithTimeStamps {
pub id: String,
- #[serde(with = "ts_seconds_option")]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
- #[serde(with = "ts_seconds_option")]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
diff --git a/rust/cloud-storage/model/src/pin/mod.rs b/rust/cloud-storage/model/src/pin/mod.rs
index 5c8f933d59..26b69c046f 100644
--- a/rust/cloud-storage/model/src/pin/mod.rs
+++ b/rust/cloud-storage/model/src/pin/mod.rs
@@ -1,4 +1,3 @@
-use chrono::serde::ts_seconds_option;
use utoipa::ToSchema;
use crate::item::Item;
@@ -17,12 +16,8 @@ pub struct Pin {
/// Who the chat belongs to
pub user_id: String,
/// The time the pin was created
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
/// The time the pin was last updated
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
diff --git a/rust/cloud-storage/model/src/project/mod.rs b/rust/cloud-storage/model/src/project/mod.rs
index 01a1e33dff..b49a25fad7 100644
--- a/rust/cloud-storage/model/src/project/mod.rs
+++ b/rust/cloud-storage/model/src/project/mod.rs
@@ -1,4 +1,3 @@
-use chrono::serde::ts_seconds_option;
use macro_user_id::user_id::MacroUserIdStr;
use models_bulk_upload::ProjectDocumentStatus;
use serde::{Deserialize, Serialize};
@@ -20,16 +19,10 @@ pub struct Project {
#[serde(skip_serializing_if = "Option::is_none")]
pub parent_id: Option<String>,
/// The time the project was created
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub created_at: Option<chrono::DateTime<chrono::Utc>>,
/// The time the project was updated
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=true)]
pub deleted_at: Option<chrono::DateTime<chrono::Utc>>,
}
@@ -73,8 +66,6 @@ pub struct ProjectPreviewData {
pub name: String,
pub owner: String,
pub path: Vec<String>,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable=false)]
pub updated_at: Option<chrono::DateTime<chrono::Utc>>,
}
diff --git a/rust/cloud-storage/model_notifications/Cargo.toml b/rust/cloud-storage/model_notifications/Cargo.toml
index f1dff6e06d..039c05ef96 100644
--- a/rust/cloud-storage/model_notifications/Cargo.toml
+++ b/rust/cloud-storage/model_notifications/Cargo.toml
@@ -20,5 +20,5 @@ serde_json = { workspace = true }
sqlx = { workspace = true }
strum = { workspace = true, features = ["derive"] }
tracing = { workspace = true }
-utoipa = { workspace = true }
+utoipa = { workspace = true, features = ["chrono"] }
uuid = { workspace = true }
diff --git a/rust/cloud-storage/model_notifications/src/lib.rs b/rust/cloud-storage/model_notifications/src/lib.rs
index ef6003af3e..6e95fe9da5 100644
--- a/rust/cloud-storage/model_notifications/src/lib.rs
+++ b/rust/cloud-storage/model_notifications/src/lib.rs
@@ -1,4 +1,4 @@
-use chrono::serde::ts_seconds_option;
+use chrono::DateTime;
use serde::{Deserialize, Serialize};
use std::hash::{DefaultHasher, Hasher};
use utoipa::ToSchema;
@@ -13,23 +13,13 @@ pub use unsubscribe::*;
#[serde(transparent)]
pub struct ChannelMessageDocumentMetadata(pub DocumentMentionMetadata);
-type TimestampOption = Option<chrono::DateTime<chrono::Utc>>;
-
#[derive(Serialize, Deserialize, Debug, Clone, ToSchema, Default)]
#[serde(rename_all = "camelCase")]
pub struct NotificationTemporalData {
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable = false)]
- pub created_at: TimestampOption,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable = true)]
- pub viewed_at: TimestampOption,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable = true)]
- pub updated_at: TimestampOption,
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable = true)]
- pub deleted_at: TimestampOption,
+ pub created_at: Option<DateTime<chrono::Utc>>,
+ pub viewed_at: Option<DateTime<chrono::Utc>>,
+ pub updated_at: Option<DateTime<chrono::Utc>>,
+ pub deleted_at: Option<DateTime<chrono::Utc>>,
}
/// used to build up the data to construct a [HashedCollapseKey]
diff --git a/rust/cloud-storage/models_email/src/email/service/thread.rs b/rust/cloud-storage/models_email/src/email/service/thread.rs
index d860752a61..5f292235cb 100644
--- a/rust/cloud-storage/models_email/src/email/service/thread.rs
+++ b/rust/cloud-storage/models_email/src/email/service/thread.rs
@@ -123,21 +123,9 @@ pub struct ThreadPreviewCursor {
pub sender_photo_url: Option<String>,
pub attachments: Vec<Attachment>,
pub participants: Vec<Contact>,
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[schema(value_type = i64)]
- #[schemars(with = "i64")]
pub sort_ts: DateTime<Utc>,
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[schema(value_type = i64)]
- #[schemars(with = "i64")]
pub created_at: DateTime<Utc>,
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[schema(value_type = i64)]
- #[schemars(with = "i64")]
pub updated_at: DateTime<Utc>,
- #[serde(with = "chrono::serde::ts_milliseconds_option")]
- #[schema(value_type = i64, nullable = true)]
- #[schemars(with = "Option<i64>")]
pub viewed_at: Option<DateTime<Utc>>,
}
diff --git a/rust/cloud-storage/models_search/src/channel.rs b/rust/cloud-storage/models_search/src/channel.rs
index a9624884ba..4bb88513de 100644
--- a/rust/cloud-storage/models_search/src/channel.rs
+++ b/rust/cloud-storage/models_search/src/channel.rs
@@ -1,4 +1,5 @@
use crate::{MatchType, SearchHighlight, SearchOn, SearchResponseItem};
+use chrono::{DateTime, Utc};
use item_filters::ChannelFilters;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
@@ -17,10 +18,10 @@ pub struct ChannelSearchResult {
pub sender_id: Option<String>,
/// When the channel message was created
/// This is only prsent if the search result is on the message content
- pub created_at: Option<i64>,
+ pub created_at: Option<DateTime<Utc>>,
/// When the channel message was last updated
/// This is only prsent if the search result is on the message content
- pub updated_at: Option<i64>,
+ pub updated_at: Option<DateTime<Utc>>,
/// The highlights for the channel message
pub highlight: SearchHighlight,
/// The score of the result
@@ -50,10 +51,10 @@ pub struct ChannelSearchResponseItem {
/// Metadata for a channel fetched from the database
#[derive(Debug, Serialize, Deserialize, ToSchema, JsonSchema)]
pub struct ChannelMetadata {
- pub created_at: i64,
- pub updated_at: i64,
- pub viewed_at: Option<i64>,
- pub interacted_at: Option<i64>,
+ pub created_at: DateTime<Utc>,
+ pub updated_at: DateTime<Utc>,
+ pub viewed_at: Option<DateTime<Utc>>,
+ pub interacted_at: Option<DateTime<Utc>>,
}
/// ChannelSearchResponseItem object with channel metadata we fetch from macrodb. we don't store these
@@ -148,7 +149,7 @@ pub struct SimpleChannelSearchReponseBaseItem<T> {
}
pub type SimpleChannelSearchReponseItem =
- SimpleChannelSearchReponseBaseItem<crate::TimestampSeconds>;
+ SimpleChannelSearchReponseBaseItem<crate::HumanReadableTimestamp>;
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct SimpleChannelSearchResponse {
diff --git a/rust/cloud-storage/models_search/src/chat.rs b/rust/cloud-storage/models_search/src/chat.rs
index 6366b5b087..d0094ffaba 100644
--- a/rust/cloud-storage/models_search/src/chat.rs
+++ b/rust/cloud-storage/models_search/src/chat.rs
@@ -1,3 +1,4 @@
+use chrono::{DateTime, Utc};
use item_filters::ChatFilters;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
@@ -43,11 +44,11 @@ pub struct ChatSearchResponseItem {
/// Metadata for a chat fetched from the database
#[derive(Debug, Serialize, Deserialize, ToSchema, JsonSchema)]
pub struct ChatMetadata {
- pub created_at: i64,
- pub updated_at: i64,
- pub viewed_at: Option<i64>,
+ pub created_at: DateTime<Utc>,
+ pub updated_at: DateTime<Utc>,
+ pub viewed_at: Option<DateTime<Utc>>,
pub project_id: Option<String>,
- pub deleted_at: Option<i64>,
+ pub deleted_at: Option<DateTime<Utc>>,
}
/// ChatSearchResponse object with channel metadata we fetch from macrodb. we don't store these
@@ -136,7 +137,8 @@ pub struct SimpleChatSearchResponseBaseItem<T> {
pub highlight: SearchHighlight,
}
-pub type SimpleChatSearchResponseItem = SimpleChatSearchResponseBaseItem<crate::TimestampSeconds>;
+pub type SimpleChatSearchResponseItem =
+ SimpleChatSearchResponseBaseItem<crate::HumanReadableTimestamp>;
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct SimpleChatSearchResponse {
diff --git a/rust/cloud-storage/models_search/src/document.rs b/rust/cloud-storage/models_search/src/document.rs
index 0d9aabd2e9..437277dd04 100644
--- a/rust/cloud-storage/models_search/src/document.rs
+++ b/rust/cloud-storage/models_search/src/document.rs
@@ -1,3 +1,4 @@
+use chrono::{DateTime, Utc};
use document_sub_type::DocumentSubType;
use item_filters::DocumentFilters;
use schemars::JsonSchema;
@@ -48,11 +49,11 @@ pub struct DocumentSearchResponseItem {
/// Metadata for a document fetched from the database
#[derive(Debug, Serialize, Deserialize, ToSchema, JsonSchema)]
pub struct DocumentMetadata {
- pub created_at: i64,
- pub updated_at: i64,
- pub viewed_at: Option<i64>,
+ pub created_at: DateTime<Utc>,
+ pub updated_at: DateTime<Utc>,
+ pub viewed_at: Option<DateTime<Utc>>,
pub project_id: Option<String>,
- pub deleted_at: Option<i64>,
+ pub deleted_at: Option<DateTime<Utc>>,
}
/// DocumentSearchResponseItem object with document metadata we fetch from macrodb. we don't store these
@@ -107,7 +108,7 @@ pub struct SimpleDocumentSearchResponseBaseItem<T> {
}
pub type SimpleDocumentSearchResponseItem =
- SimpleDocumentSearchResponseBaseItem<crate::TimestampSeconds>;
+ SimpleDocumentSearchResponseBaseItem<crate::HumanReadableTimestamp>;
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct SimpleDocumentSearchResponse {
diff --git a/rust/cloud-storage/models_search/src/email.rs b/rust/cloud-storage/models_search/src/email.rs
index 37406ac2fc..12b0c64330 100644
--- a/rust/cloud-storage/models_search/src/email.rs
+++ b/rust/cloud-storage/models_search/src/email.rs
@@ -1,4 +1,5 @@
use crate::{MatchType, SearchHighlight, SearchOn};
+use chrono::{DateTime, Utc};
use item_filters::EmailFilters;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
@@ -27,7 +28,7 @@ pub struct EmailSearchResult {
pub labels: Vec<String>,
/// When the email message was sent
/// This is only present if the search result is on the message content
- pub sent_at: Option<i64>,
+ pub sent_at: Option<DateTime<Utc>>,
/// The highlights for the email message
pub highlight: SearchHighlight,
/// The score of the result
@@ -64,9 +65,9 @@ pub struct EmailSearchResponseItem {
/// every time the thread updates (specifically for updated_at and viewed_at)
#[derive(Debug, Serialize, Deserialize, ToSchema, JsonSchema)]
pub struct EmailSearchResponseItemWithMetadata {
- pub created_at: i64,
- pub updated_at: i64,
- pub viewed_at: Option<i64>,
+ pub created_at: DateTime<Utc>,
+ pub updated_at: DateTime<Utc>,
+ pub viewed_at: Option<DateTime<Utc>>,
pub snippet: Option<String>,
#[serde(flatten)]
pub extra: EmailSearchResponseItem,
@@ -143,7 +144,8 @@ pub struct SimpleEmailSearchResponseBaseItem<T> {
pub highlight: SearchHighlight,
}
-pub type SimpleEmailSearchResponseItem = SimpleEmailSearchResponseBaseItem<crate::TimestampSeconds>;
+pub type SimpleEmailSearchResponseItem =
+ SimpleEmailSearchResponseBaseItem<crate::HumanReadableTimestamp>;
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct SimpleEmailSearchResponse {
diff --git a/rust/cloud-storage/models_search/src/project.rs b/rust/cloud-storage/models_search/src/project.rs
index b5f7b105e5..7dcaa65a18 100644
--- a/rust/cloud-storage/models_search/src/project.rs
+++ b/rust/cloud-storage/models_search/src/project.rs
@@ -1,4 +1,5 @@
use crate::{MatchType, SearchHighlight, SearchOn, SearchResponse, SearchResponseItem};
+use chrono::{DateTime, Utc};
use item_filters::ProjectFilters;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
@@ -17,8 +18,8 @@ pub struct ProjectSearchResult {
pub struct ProjectSearchMetadata {
pub project_id: uuid::Uuid,
pub owner_id: String,
- pub updated_at: i64,
- pub created_at: i64,
+ pub updated_at: DateTime<Utc>,
+ pub created_at: DateTime<Utc>,
pub project_name: String,
}
@@ -32,19 +33,19 @@ pub struct ProjectSearchResponseItem {
pub name: String,
pub owner_id: String,
- pub updated_at: i64,
- pub created_at: i64,
+ pub updated_at: DateTime<Utc>,
+ pub created_at: DateTime<Utc>,
pub project_search_results: Vec<ProjectSearchResult>,
}
/// Metadata for a project fetched from the database
#[derive(Debug, Serialize, Deserialize, ToSchema, JsonSchema)]
pub struct ProjectMetadata {
- pub created_at: i64,
- pub updated_at: i64,
- pub viewed_at: Option<i64>,
+ pub created_at: DateTime<Utc>,
+ pub updated_at: DateTime<Utc>,
+ pub viewed_at: Option<DateTime<Utc>>,
pub parent_project_id: Option<String>,
- pub deleted_at: Option<i64>,
+ pub deleted_at: Option<DateTime<Utc>>,
}
/// ProjectSearchResponseItem object with project metadata we fetch from macrodb. we don't store these
@@ -117,7 +118,7 @@ pub struct SimpleProjectSearchResponseBaseItem<T> {
}
pub type SimpleProjectSearchResponseItem =
- SimpleProjectSearchResponseBaseItem<crate::TimestampSeconds>;
+ SimpleProjectSearchResponseBaseItem<crate::HumanReadableTimestamp>;
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct SimpleProjectSearchResponse {
diff --git a/rust/cloud-storage/models_search/src/simple.rs b/rust/cloud-storage/models_search/src/simple.rs
index d968099b0c..02cf6f9a9a 100644
--- a/rust/cloud-storage/models_search/src/simple.rs
+++ b/rust/cloud-storage/models_search/src/simple.rs
@@ -1,3 +1,4 @@
+use chrono::{DateTime, Utc};
use schemars::JsonSchema;
use utoipa::ToSchema;
@@ -38,7 +39,7 @@ pub struct SearchGotoEmail {
pub bcc: Vec<String>,
pub cc: Vec<String>,
pub labels: Vec<String>,
- pub sent_at: Option<i64>,
+ pub sent_at: Option<DateTime<Utc>>,
pub sender: String,
pub recipients: Vec<String>,
}
diff --git a/rust/cloud-storage/models_search/src/timestamp.rs b/rust/cloud-storage/models_search/src/timestamp.rs
index 313b402e70..c6ed589b62 100644
--- a/rust/cloud-storage/models_search/src/timestamp.rs
+++ b/rust/cloud-storage/models_search/src/timestamp.rs
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize, de::DeserializeOwned};
use utoipa::ToSchema;
/// DateTime<Utc> ts_seconds deserialization + RFC3339 serialization
-#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
+#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ToSchema)]
pub struct HumanReadableTimestamp(
#[serde(deserialize_with = "ts_seconds::deserialize")] pub DateTime<Utc>,
);
diff --git a/rust/cloud-storage/models_search/src/unified.rs b/rust/cloud-storage/models_search/src/unified.rs
index 199d00874b..e8b7d364f9 100644
--- a/rust/cloud-storage/models_search/src/unified.rs
+++ b/rust/cloud-storage/models_search/src/unified.rs
@@ -1,3 +1,4 @@
+use chrono::{DateTime, Utc};
use std::collections::HashSet;
use uuid::Uuid;
@@ -142,19 +143,11 @@ impl UnifiedSearchResponseItem {
}
}
/// Get the updated_at timestamp for each item
- pub fn updated_at(&self) -> i64 {
+ pub fn updated_at(&self) -> Option<DateTime<Utc>> {
match self {
- Self::Document(item) => item
- .metadata
- .as_ref()
- .map(|m| m.updated_at)
- .unwrap_or_default(),
- Self::Chat(item) => item
- .metadata
- .as_ref()
- .map(|m| m.updated_at)
- .unwrap_or_default(),
- Self::Email(item) => item.updated_at,
+ Self::Document(item) => item.metadata.as_ref().map(|m| m.updated_at),
+ Self::Chat(item) => item.metadata.as_ref().map(|m| m.updated_at),
+ Self::Email(item) => Some(item.updated_at),
Self::Channel(item) => {
// Get the max updated_at from channel_message_search_results
let max_result_updated_at = item
@@ -165,18 +158,9 @@ impl UnifiedSearchResponseItem {
.max();
// Use max from results, or fall back to metadata.updated_at
- max_result_updated_at.unwrap_or_else(|| {
- item.metadata
- .as_ref()
- .map(|m| m.updated_at)
- .unwrap_or_default()
- })
+ max_result_updated_at.or_else(|| item.metadata.as_ref().map(|m| m.updated_at))
}
- Self::Project(item) => item
- .metadata
- .as_ref()
- .map(|m| m.updated_at)
- .unwrap_or_default(),
+ Self::Project(item) => item.metadata.as_ref().map(|m| m.updated_at),
}
}
}
@@ -200,11 +184,12 @@ pub enum SimpleUnifiedSearchResponseBaseItem<T> {
}
pub type SimpleUnifiedSearchResponseItem =
- SimpleUnifiedSearchResponseBaseItem<crate::TimestampSeconds>;
+ SimpleUnifiedSearchResponseBaseItem<crate::HumanReadableTimestamp>;
#[derive(Debug, Serialize, Deserialize, ToSchema, Default)]
pub struct SimpleUnifiedSearchBaseResponse<T> {
pub results: Vec<SimpleUnifiedSearchResponseBaseItem<T>>,
}
-pub type SimpleUnifiedSearchResponse = SimpleUnifiedSearchBaseResponse<crate::TimestampSeconds>;
+pub type SimpleUnifiedSearchResponse =
+ SimpleUnifiedSearchBaseResponse<crate::HumanReadableTimestamp>;
diff --git a/rust/cloud-storage/models_soup/src/chat.rs b/rust/cloud-storage/models_soup/src/chat.rs
index da5553a4d4..1c4838299a 100644
--- a/rust/cloud-storage/models_soup/src/chat.rs
+++ b/rust/cloud-storage/models_soup/src/chat.rs
@@ -27,23 +27,15 @@ pub struct SoupChat {
pub is_persistent: bool,
/// The time the chat was created
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[cfg_attr(feature = "schema", schema(value_type = i64))]
pub created_at: chrono::DateTime<Utc>,
/// The time the chat was last updated
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[cfg_attr(feature = "schema", schema(value_type = i64))]
pub updated_at: chrono::DateTime<Utc>,
/// The time the chat was last viewed
- #[serde(with = "chrono::serde::ts_milliseconds_option")]
- #[cfg_attr(feature = "schema", schema(value_type = i64, nullable = true))]
pub viewed_at: Option<chrono::DateTime<Utc>>,
/// The time the chat was deleted
- #[serde(with = "chrono::serde::ts_milliseconds_option")]
- #[cfg_attr(feature = "schema", schema(value_type = i64, nullable = true))]
pub deleted_at: Option<chrono::DateTime<Utc>>,
/// Properties
diff --git a/rust/cloud-storage/models_soup/src/document.rs b/rust/cloud-storage/models_soup/src/document.rs
index 4b1e1fe8b7..0131e11067 100644
--- a/rust/cloud-storage/models_soup/src/document.rs
+++ b/rust/cloud-storage/models_soup/src/document.rs
@@ -85,18 +85,12 @@ pub struct SoupDocument {
pub document_family_id: Option<i64>,
/// The time the document was created
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[cfg_attr(feature = "schema", schema(value_type = i64))]
pub created_at: chrono::DateTime<Utc>,
/// The time the document instance / document BOM was updated
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[cfg_attr(feature = "schema", schema(value_type = i64))]
pub updated_at: chrono::DateTime<Utc>,
/// The time the document was last viewed
- #[serde(with = "chrono::serde::ts_milliseconds_option")]
- #[cfg_attr(feature = "schema", schema(value_type = i64, nullable = true))]
pub viewed_at: Option<chrono::DateTime<Utc>>,
/// The sub type of the document if present.
@@ -105,8 +99,6 @@ pub struct SoupDocument {
pub sub_type: Option<SoupDocumentSubType>,
/// The time the document was deleted
- #[serde(with = "chrono::serde::ts_milliseconds_option")]
- #[cfg_attr(feature = "schema", schema(value_type = i64, nullable = true))]
pub deleted_at: Option<chrono::DateTime<Utc>>,
/// Properties
diff --git a/rust/cloud-storage/models_soup/src/email_thread.rs b/rust/cloud-storage/models_soup/src/email_thread.rs
index 31ad6b7c36..ad5397f278 100644
--- a/rust/cloud-storage/models_soup/src/email_thread.rs
+++ b/rust/cloud-storage/models_soup/src/email_thread.rs
@@ -79,8 +79,6 @@ pub struct SoupAttachment {
pub mime_type: Option<String>,
pub size_bytes: Option<i64>,
pub content_id: Option<String>,
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[cfg_attr(feature = "schema", schema(value_type = i64))]
pub created_at: DateTime<Utc>,
}
@@ -103,17 +101,9 @@ pub struct SoupEmailThreadPreview {
pub sender_email: Option<String>,
pub sender_name: Option<String>,
pub sender_photo_url: Option<String>,
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[cfg_attr(feature = "schema", schema(value_type = i64))]
pub sort_ts: DateTime<Utc>,
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[cfg_attr(feature = "schema", schema(value_type = i64))]
pub created_at: DateTime<Utc>,
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[cfg_attr(feature = "schema", schema(value_type = i64))]
pub updated_at: DateTime<Utc>,
- #[serde(with = "chrono::serde::ts_milliseconds_option")]
- #[cfg_attr(feature = "schema", schema(value_type = i64, nullable = true))]
pub viewed_at: Option<DateTime<Utc>>,
}
diff --git a/rust/cloud-storage/models_soup/src/project.rs b/rust/cloud-storage/models_soup/src/project.rs
index da3cf3240e..d0b1af749a 100644
--- a/rust/cloud-storage/models_soup/src/project.rs
+++ b/rust/cloud-storage/models_soup/src/project.rs
@@ -24,23 +24,15 @@ pub struct SoupProject {
pub parent_id: Option<Uuid>,
/// The time the project was created
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[cfg_attr(feature = "schema", schema(value_type = i64))]
pub created_at: chrono::DateTime<Utc>,
/// The time the project was updated
- #[serde(with = "chrono::serde::ts_milliseconds")]
- #[cfg_attr(feature = "schema", schema(value_type = i64))]
pub updated_at: chrono::DateTime<Utc>,
/// The time the document was last viewed
- #[serde(with = "chrono::serde::ts_milliseconds_option")]
- #[cfg_attr(feature = "schema", schema(value_type = i64, nullable = true))]
pub viewed_at: Option<chrono::DateTime<Utc>>,
/// The time the project was deleted
- #[serde(with = "chrono::serde::ts_milliseconds_option")]
- #[cfg_attr(feature = "schema", schema(value_type = i64, nullable = true))]
pub deleted_at: Option<chrono::DateTime<Utc>>,
/// Properties
diff --git a/rust/cloud-storage/notification_service/Cargo.toml b/rust/cloud-storage/notification_service/Cargo.toml
index 82e905bfbd..e0b1f46bac 100644
--- a/rust/cloud-storage/notification_service/Cargo.toml
+++ b/rust/cloud-storage/notification_service/Cargo.toml
@@ -67,7 +67,7 @@ tower = { workspace = true }
tower-http = { workspace = true, features = ["compression-gzip"] }
tracing = { workspace = true }
url = { workspace = true }
-utoipa = { workspace = true }
+utoipa = { workspace = true, features = ["chrono"] }
utoipa-swagger-ui = { workspace = true }
uuid = { workspace = true }
diff --git a/rust/cloud-storage/notification_service/src/api/user_notification.rs b/rust/cloud-storage/notification_service/src/api/user_notification.rs
index e1d44859ac..268fd3d279 100644
--- a/rust/cloud-storage/notification_service/src/api/user_notification.rs
+++ b/rust/cloud-storage/notification_service/src/api/user_notification.rs
@@ -1,5 +1,5 @@
use ::notification::domain::models::UserNotificationRow;
-use chrono::{DateTime, Utc, serde::ts_seconds_option};
+use chrono::{DateTime, Utc};
use macro_user_id::user_id::MacroUserIdStr;
use model_entity::Entity;
use model_error_response::ErrorResponse;
@@ -30,20 +30,12 @@ pub struct ApiUserNotification {
/// Whether the notification is marked as done.
pub done: bool,
/// When the notification was created.
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable = false)]
pub created_at: Option<DateTime<Utc>>,
/// When the notification was viewed/seen.
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable = true)]
pub viewed_at: Option<DateTime<Utc>>,
/// When the notification was last updated.
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable = true)]
pub updated_at: Option<DateTime<Utc>>,
/// When the notification was deleted.
- #[serde(with = "ts_seconds_option")]
- #[schema(value_type = i64, nullable = true)]
pub deleted_at: Option<DateTime<Utc>>,
/// Deserialized notification metadata.
pub notification_metadata: NotifEvent,
diff --git a/rust/cloud-storage/opensearch_client/src/search/channels.rs b/rust/cloud-storage/opensearch_client/src/search/channels.rs
index 2ee7655477..bcb1c3c87b 100644
--- a/rust/cloud-storage/opensearch_client/src/search/channels.rs
+++ b/rust/cloud-storage/opensearch_client/src/search/channels.rs
@@ -241,8 +241,10 @@ pub(crate) async fn search_channel_messages(
channel_message_id: a.message_id,
thread_id: a.thread_id,
sender_id: a.sender_id,
- created_at: a.created_at_seconds,
- updated_at: a.updated_at_seconds,
+ created_at: chrono::DateTime::from_timestamp(a.created_at_seconds, 0)
+ .unwrap_or_default(),
+ updated_at: chrono::DateTime::from_timestamp(a.updated_at_seconds, 0)
+ .unwrap_or_default(),
})),
updated_at: chrono::DateTime::from_timestamp(a.updated_at_seconds, 0),
},
diff --git a/rust/cloud-storage/opensearch_client/src/search/emails.rs b/rust/cloud-storage/opensearch_client/src/search/emails.rs
index 5ce01fbf6b..52771a9cbc 100644
--- a/rust/cloud-storage/opensearch_client/src/search/emails.rs
+++ b/rust/cloud-storage/opensearch_client/src/search/emails.rs
@@ -291,7 +291,9 @@ pub(crate) async fn search_emails(
bcc: a.bcc,
cc: a.cc,
labels: a.labels,
- sent_at: a.sent_at_seconds,
+ sent_at: a
+ .sent_at_seconds
+ .and_then(|ts| chrono::DateTime::from_timestamp(ts, 0)),
sender: a.sender,
recipients: a.recipients,
})),
diff --git a/rust/cloud-storage/opensearch_client/src/search/model.rs b/rust/cloud-storage/opensearch_client/src/search/model.rs
index 22cf96f8eb..567c923585 100644
--- a/rust/cloud-storage/opensearch_client/src/search/model.rs
+++ b/rust/cloud-storage/opensearch_client/src/search/model.rs
@@ -178,7 +178,7 @@ pub struct SearchGotoEmail {
/// The labels of the email
pub labels: Vec<String>,
/// The sent_at timestamp of the email
- pub sent_at: Option<i64>,
+ pub sent_at: Option<chrono::DateTime<chrono::Utc>>,
/// The sender of the email
pub sender: String,
/// The recipients of the email
@@ -191,8 +191,8 @@ pub struct SearchGotoChannel {
pub channel_message_id: uuid::Uuid,
pub thread_id: Option<uuid::Uuid>,
pub sender_id: String,
- pub created_at: i64,
- pub updated_at: i64,
+ pub created_at: chrono::DateTime<chrono::Utc>,
+ pub updated_at: chrono::DateTime<chrono::Utc>,
}
/// Enum containing structs for all data needed to handle search "goto" in the frontend
diff --git a/rust/cloud-storage/opensearch_client/src/search/unified.rs b/rust/cloud-storage/opensearch_client/src/search/unified.rs
index d17416edbd..b0b6fd5a97 100644
--- a/rust/cloud-storage/opensearch_client/src/search/unified.rs
+++ b/rust/cloud-storage/opensearch_client/src/search/unified.rs
@@ -244,8 +244,10 @@ impl From<Hit<UnifiedSearchIndex>> for SearchHit {
channel_message_id: a.message_id,
thread_id: a.thread_id,
sender_id: a.sender_id,
- created_at: a.created_at_seconds,
- updated_at: a.updated_at_seconds,
+ created_at: DateTime::from_timestamp(a.created_at_seconds, 0)
+ .unwrap_or_default(),
+ updated_at: DateTime::from_timestamp(a.updated_at_seconds, 0)
+ .unwrap_or_default(),
})),
updated_at: DateTime::from_timestamp(a.updated_at_seconds, 0),
},
@@ -294,7 +296,9 @@ impl From<Hit<UnifiedSearchIndex>> for SearchHit {
bcc: a.bcc,
cc: a.cc,
labels: a.labels,
- sent_at: a.sent_at_seconds,
+ sent_at: a
+ .sent_at_seconds
+ .and_then(|ts| DateTime::from_timestamp(ts, 0)),
sender: a.sender,
recipients: a.recipients,
})),
diff --git a/rust/cloud-storage/properties_service/src/openapi.rs b/rust/cloud-storage/properties_service/src/openapi.rs
index a66e3ad537..5e71e72524 100644
--- a/rust/cloud-storage/properties_service/src/openapi.rs
+++ b/rust/cloud-storage/properties_service/src/openapi.rs
@@ -1,13 +1,7 @@
-#![allow(unused)]
-
-mod api;
-mod constants;
-
+use properties_service::api::swagger::ApiDoc;
use utoipa::OpenApi;
fn main() {
- println!(
- "{}",
- api::swagger::ApiDoc::openapi().to_pretty_json().unwrap()
- );
+ let doc = ApiDoc::openapi();
+ println!("{}", serde_json::to_string_pretty(&doc).unwrap());
}
diff --git a/rust/cloud-storage/search_service/src/api/search/channel.rs b/rust/cloud-storage/search_service/src/api/search/channel.rs
index b4c516d3ce..ccc1af1101 100644
--- a/rust/cloud-storage/search_service/src/api/search/channel.rs
+++ b/rust/cloud-storage/search_service/src/api/search/channel.rs
@@ -89,10 +89,10 @@ pub fn construct_search_result(
if let Some(info) = channel_histories.get(&entity_id) {
let info = info.clone();
let metadata = models_search::channel::ChannelMetadata {
- created_at: info.created_at.timestamp(),
- updated_at: info.updated_at.timestamp(),
- viewed_at: info.viewed_at.map(|a| a.timestamp()),
- interacted_at: info.interacted_at.map(|a| a.timestamp()),
+ created_at: info.created_at,
+ updated_at: info.updated_at,
+ viewed_at: info.viewed_at,
+ interacted_at: info.interacted_at,
};
Some(ChannelSearchResponseItemWithMetadata {
metadata: Some(metadata),
diff --git a/rust/cloud-storage/search_service/src/api/search/channel/test.rs b/rust/cloud-storage/search_service/src/api/search/channel/test.rs
index 2655f20997..ed6690f20a 100644
--- a/rust/cloud-storage/search_service/src/api/search/channel/test.rs
+++ b/rust/cloud-storage/search_service/src/api/search/channel/test.rs
@@ -1,3 +1,4 @@
+use chrono::DateTime;
use models_opensearch::SearchEntityType;
use opensearch_client::search::model::Highlight;
@@ -20,8 +21,8 @@ fn test_construct_search_result_single_channel() {
opensearch_client::search::model::SearchGotoContent::Channels(
opensearch_client::search::model::SearchGotoChannel {
channel_message_id: "11111111-1111-1111-1111-111111111111".parse().unwrap(),
- created_at: 1234567890,
- updated_at: 1234567891,
+ created_at: DateTime::from_timestamp(1234567890, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1234567891, 0).unwrap(),
thread_id: Some("22222222-2222-2222-2222-222222222222".parse().unwrap()),
sender_id: "user1".to_string(),
},
@@ -79,8 +80,8 @@ fn test_construct_search_result_multiple_messages_same_channel() {
opensearch_client::search::model::SearchGotoContent::Channels(
opensearch_client::search::model::SearchGotoChannel {
channel_message_id: "11111111-1111-1111-1111-111111111111".parse().unwrap(),
- created_at: 1234567890,
- updated_at: 1234567891,
+ created_at: DateTime::from_timestamp(1234567890, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1234567891, 0).unwrap(),
thread_id: Some("22222222-2222-2222-2222-222222222222".parse().unwrap()),
sender_id: "user1".to_string(),
},
@@ -101,8 +102,8 @@ fn test_construct_search_result_multiple_messages_same_channel() {
opensearch_client::search::model::SearchGotoContent::Channels(
opensearch_client::search::model::SearchGotoChannel {
channel_message_id: "22222222-2222-2222-2222-222222222222".parse().unwrap(),
- created_at: 1234567892,
- updated_at: 1234567893,
+ created_at: DateTime::from_timestamp(1234567892, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1234567893, 0).unwrap(),
thread_id: Some("33333333-3333-3333-3333-333333333333".parse().unwrap()),
sender_id: "user2".to_string(),
},
@@ -161,8 +162,8 @@ fn test_construct_search_result_filters_messages_without_content() {
opensearch_client::search::model::SearchGotoContent::Channels(
opensearch_client::search::model::SearchGotoChannel {
channel_message_id: "11111111-1111-1111-1111-111111111111".parse().unwrap(),
- created_at: 1234567890,
- updated_at: 1234567891,
+ created_at: DateTime::from_timestamp(1234567890, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1234567891, 0).unwrap(),
thread_id: Some("22222222-2222-2222-2222-222222222222".parse().unwrap()),
sender_id: "user1".to_string(),
},
@@ -183,8 +184,8 @@ fn test_construct_search_result_filters_messages_without_content() {
opensearch_client::search::model::SearchGotoContent::Channels(
opensearch_client::search::model::SearchGotoChannel {
channel_message_id: "22222222-2222-2222-2222-222222222222".parse().unwrap(),
- created_at: 1234567892,
- updated_at: 1234567893,
+ created_at: DateTime::from_timestamp(1234567892, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1234567893, 0).unwrap(),
thread_id: Some("33333333-3333-3333-3333-333333333333".parse().unwrap()),
sender_id: "user2".to_string(),
},
@@ -233,8 +234,8 @@ fn create_test_channel_response(
opensearch_client::search::model::SearchGotoContent::Channels(
opensearch_client::search::model::SearchGotoChannel {
channel_message_id: message_id.parse().unwrap(),
- created_at: 1234567890,
- updated_at: 1234567891,
+ created_at: DateTime::from_timestamp(1234567890, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1234567891, 0).unwrap(),
thread_id: Some("22222222-2222-2222-2222-222222222222".parse().unwrap()),
sender_id: sender_id.to_string(),
},
@@ -298,10 +299,10 @@ fn test_channel_history_timestamps() {
assert_eq!(result.len(), 1);
assert!(result[0].metadata.is_some());
let metadata = result[0].metadata.as_ref().unwrap();
- assert_eq!(metadata.created_at, now.timestamp());
- assert_eq!(metadata.updated_at, now.timestamp());
- assert_eq!(metadata.viewed_at, Some(now.timestamp()));
- assert_eq!(metadata.interacted_at, Some(now.timestamp()));
+ assert_eq!(metadata.created_at, now);
+ assert_eq!(metadata.updated_at, now);
+ assert_eq!(metadata.viewed_at, Some(now));
+ assert_eq!(metadata.interacted_at, Some(now));
}
#[test]
@@ -373,8 +374,8 @@ fn test_channel_history_null_viewed_at() {
assert_eq!(result.len(), 1);
assert!(result[0].metadata.is_some());
let metadata = result[0].metadata.as_ref().unwrap();
- assert_eq!(metadata.created_at, now.timestamp());
- assert_eq!(metadata.updated_at, now.timestamp());
+ assert_eq!(metadata.created_at, now);
+ assert_eq!(metadata.updated_at, now);
assert!(metadata.viewed_at.is_none());
assert!(metadata.interacted_at.is_none());
}
@@ -400,8 +401,8 @@ fn test_sort_stability() {
opensearch_client::search::model::SearchGotoContent::Channels(
opensearch_client::search::model::SearchGotoChannel {
channel_message_id: "33333333-3333-3333-3333-333333333333".parse().unwrap(),
- created_at: 1234567890,
- updated_at: 1234567891,
+ created_at: DateTime::from_timestamp(1234567890, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1234567891, 0).unwrap(),
thread_id: Some("33333333-3333-3333-3333-333333333333".parse().unwrap()),
sender_id: "user1".to_string(),
},
@@ -422,8 +423,8 @@ fn test_sort_stability() {
opensearch_client::search::model::SearchGotoContent::Channels(
opensearch_client::search::model::SearchGotoChannel {
channel_message_id: "11111111-1111-1111-1111-111111111111".parse().unwrap(),
- created_at: 1234567890,
- updated_at: 1234567891,
+ created_at: DateTime::from_timestamp(1234567890, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1234567891, 0).unwrap(),
thread_id: Some("11111111-1111-1111-1111-111111111111".parse().unwrap()),
sender_id: "user1".to_string(),
},
@@ -444,8 +445,8 @@ fn test_sort_stability() {
opensearch_client::search::model::SearchGotoContent::Channels(
opensearch_client::search::model::SearchGotoChannel {
channel_message_id: "55555555-5555-5555-5555-555555555555".parse().unwrap(),
- created_at: 1234567890,
- updated_at: 1234567891,
+ created_at: DateTime::from_timestamp(1234567890, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1234567891, 0).unwrap(),
thread_id: Some("55555555-5555-5555-5555-555555555555".parse().unwrap()),
sender_id: "user1".to_string(),
},
@@ -466,8 +467,8 @@ fn test_sort_stability() {
opensearch_client::search::model::SearchGotoContent::Channels(
opensearch_client::search::model::SearchGotoChannel {
channel_message_id: "22222222-2222-2222-2222-222222222222".parse().unwrap(),
- created_at: 1234567890,
- updated_at: 1234567891,
+ created_at: DateTime::from_timestamp(1234567890, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1234567891, 0).unwrap(),
thread_id: Some("22222222-2222-2222-2222-222222222222".parse().unwrap()),
sender_id: "user1".to_string(),
},
@@ -488,8 +489,8 @@ fn test_sort_stability() {
opensearch_client::search::model::SearchGotoContent::Channels(
opensearch_client::search::model::SearchGotoChannel {
channel_message_id: "44444444-4444-4444-4444-444444444444".parse().unwrap(),
- created_at: 1234567890,
- updated_at: 1234567891,
+ created_at: DateTime::from_timestamp(1234567890, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1234567891, 0).unwrap(),
thread_id: Some("44444444-4444-4444-4444-444444444444".parse().unwrap()),
sender_id: "user1".to_string(),
},
diff --git a/rust/cloud-storage/search_service/src/api/search/chat.rs b/rust/cloud-storage/search_service/src/api/search/chat.rs
index aedc681580..82f32c0855 100644
--- a/rust/cloud-storage/search_service/src/api/search/chat.rs
+++ b/rust/cloud-storage/search_service/src/api/search/chat.rs
@@ -77,11 +77,11 @@ pub fn construct_search_result(
if let Some(info) = chat_histories.get(&entity_id.to_string()) {
let info = info.clone();
let metadata = models_search::chat::ChatMetadata {
- created_at: info.created_at.timestamp(),
- updated_at: info.updated_at.timestamp(),
- viewed_at: info.viewed_at.map(|a| a.timestamp()),
+ created_at: info.created_at,
+ updated_at: info.updated_at,
+ viewed_at: info.viewed_at,
project_id: info.project_id.clone(),
- deleted_at: info.deleted_at.map(|a| a.timestamp()),
+ deleted_at: info.deleted_at,
};
Some(ChatSearchResponseItemWithMetadata {
metadata: Some(metadata),
diff --git a/rust/cloud-storage/search_service/src/api/search/chat/test.rs b/rust/cloud-storage/search_service/src/api/search/chat/test.rs
index b785a82340..93fdf05069 100644
--- a/rust/cloud-storage/search_service/src/api/search/chat/test.rs
+++ b/rust/cloud-storage/search_service/src/api/search/chat/test.rs
@@ -325,18 +325,9 @@ fn test_chat_history_timestamps() {
// Verify that timestamps were copied from the chat history
assert_eq!(result.len(), 1);
- assert_eq!(
- result[0].metadata.as_ref().unwrap().created_at,
- now.timestamp()
- );
- assert_eq!(
- result[0].metadata.as_ref().unwrap().updated_at,
- now.timestamp()
- );
- assert_eq!(
- result[0].metadata.as_ref().unwrap().viewed_at,
- Some(now.timestamp())
- );
+ assert_eq!(result[0].metadata.as_ref().unwrap().created_at, now);
+ assert_eq!(result[0].metadata.as_ref().unwrap().updated_at, now);
+ assert_eq!(result[0].metadata.as_ref().unwrap().viewed_at, Some(now));
}
#[test]
@@ -402,7 +393,7 @@ fn test_chat_history_deleted() {
assert_eq!(result.len(), 1);
assert!(result[0].metadata.is_some());
let metadata = result[0].metadata.as_ref().unwrap();
- assert_eq!(metadata.deleted_at, Some(now.timestamp()));
+ assert_eq!(metadata.deleted_at, Some(now));
assert_eq!(metadata.project_id, Some("project_1".to_string()));
// Test 2: Chat that doesn't exist in DB (OpenSearch has stale data)
@@ -450,14 +441,8 @@ fn test_chat_history_null_viewed_at() {
// Verify that timestamps were copied correctly and viewed_at is None
assert_eq!(result.len(), 1);
- assert_eq!(
- result[0].metadata.as_ref().unwrap().created_at,
- now.timestamp()
- );
- assert_eq!(
- result[0].metadata.as_ref().unwrap().updated_at,
- now.timestamp()
- );
+ assert_eq!(result[0].metadata.as_ref().unwrap().created_at, now);
+ assert_eq!(result[0].metadata.as_ref().unwrap().updated_at, now);
assert!(result[0].metadata.as_ref().unwrap().viewed_at.is_none());
}
diff --git a/rust/cloud-storage/search_service/src/api/search/document.rs b/rust/cloud-storage/search_service/src/api/search/document.rs
index b3e754269b..76591258bd 100644
--- a/rust/cloud-storage/search_service/src/api/search/document.rs
+++ b/rust/cloud-storage/search_service/src/api/search/document.rs
@@ -86,11 +86,11 @@ pub fn construct_search_result(
if let Some(info) = document_histories.get(&entity_id.to_string()) {
let info = info.clone();
let metadata = models_search::document::DocumentMetadata {
- created_at: info.created_at.timestamp(),
- updated_at: info.updated_at.timestamp(),
- viewed_at: info.viewed_at.map(|a| a.timestamp()),
+ created_at: info.created_at,
+ updated_at: info.updated_at,
+ viewed_at: info.viewed_at,
project_id: info.project_id.clone(),
- deleted_at: info.deleted_at.map(|a| a.timestamp()),
+ deleted_at: info.deleted_at,
};
Some(DocumentSearchResponseItemWithMetadata {
metadata: Some(metadata),
diff --git a/rust/cloud-storage/search_service/src/api/search/document/test.rs b/rust/cloud-storage/search_service/src/api/search/document/test.rs
index 10696474c7..c7c26348a6 100644
--- a/rust/cloud-storage/search_service/src/api/search/document/test.rs
+++ b/rust/cloud-storage/search_service/src/api/search/document/test.rs
@@ -220,18 +220,9 @@ fn test_document_history_timestamps() {
// Verify that timestamps were copied from the document history
assert_eq!(result.len(), 1);
- assert_eq!(
- result[0].metadata.as_ref().unwrap().created_at,
- now.timestamp()
- );
- assert_eq!(
- result[0].metadata.as_ref().unwrap().updated_at,
- now.timestamp()
- );
- assert_eq!(
- result[0].metadata.as_ref().unwrap().viewed_at,
- Some(now.timestamp())
- );
+ assert_eq!(result[0].metadata.as_ref().unwrap().created_at, now);
+ assert_eq!(result[0].metadata.as_ref().unwrap().updated_at, now);
+ assert_eq!(result[0].metadata.as_ref().unwrap().viewed_at, Some(now));
}
#[test]
@@ -294,14 +285,8 @@ fn test_document_history_null_viewed_at() {
// Verify that timestamps were copied correctly and viewed_at is None
assert_eq!(result.len(), 1);
- assert_eq!(
- result[0].metadata.as_ref().unwrap().created_at,
- now.timestamp()
- );
- assert_eq!(
- result[0].metadata.as_ref().unwrap().updated_at,
- now.timestamp()
- );
+ assert_eq!(result[0].metadata.as_ref().unwrap().created_at, now);
+ assert_eq!(result[0].metadata.as_ref().unwrap().updated_at, now);
assert_eq!(result[0].metadata.as_ref().unwrap().viewed_at, None);
}
@@ -364,13 +349,13 @@ fn test_document_history_multiple_documents() {
.unwrap();
let doc1_metadata = doc1_result.metadata.as_ref().unwrap();
- assert_eq!(doc1_metadata.created_at, now.timestamp());
- assert_eq!(doc1_metadata.updated_at, now.timestamp());
- assert_eq!(doc1_metadata.viewed_at, Some(now.timestamp()));
+ assert_eq!(doc1_metadata.created_at, now);
+ assert_eq!(doc1_metadata.updated_at, now);
+ assert_eq!(doc1_metadata.viewed_at, Some(now));
let doc2_metadata = doc2_result.metadata.as_ref().unwrap();
- assert_eq!(doc2_metadata.created_at, earlier.timestamp());
- assert_eq!(doc2_metadata.updated_at, earlier.timestamp());
+ assert_eq!(doc2_metadata.created_at, earlier);
+ assert_eq!(doc2_metadata.updated_at, earlier);
assert_eq!(doc2_metadata.viewed_at, None);
}
@@ -418,9 +403,9 @@ fn test_document_history_partial_missing_entries() {
.unwrap();
assert!(existing_doc.metadata.is_some());
let metadata = existing_doc.metadata.as_ref().unwrap();
- assert_eq!(metadata.created_at, now.timestamp());
- assert_eq!(metadata.updated_at, now.timestamp());
- assert_eq!(metadata.viewed_at, Some(now.timestamp()));
+ assert_eq!(metadata.created_at, now);
+ assert_eq!(metadata.updated_at, now);
+ assert_eq!(metadata.viewed_at, Some(now));
}
#[test]
@@ -457,7 +442,7 @@ fn test_document_history_deleted() {
assert_eq!(result.len(), 1);
assert!(result[0].metadata.is_some());
let metadata = result[0].metadata.as_ref().unwrap();
- assert_eq!(metadata.deleted_at, Some(now.timestamp()));
+ assert_eq!(metadata.deleted_at, Some(now));
assert_eq!(metadata.project_id, Some("project_1".to_string()));
// Test 2: Document that doesn't exist in DB (OpenSearch has stale data)
diff --git a/rust/cloud-storage/search_service/src/api/search/email.rs b/rust/cloud-storage/search_service/src/api/search/email.rs
index 9261bf51ab..149a06c70d 100644
--- a/rust/cloud-storage/search_service/src/api/search/email.rs
+++ b/rust/cloud-storage/search_service/src/api/search/email.rs
@@ -137,9 +137,9 @@ pub fn construct_search_result(
if let Some(info) = thread_histories.get(&entity_id) {
let info = info.clone();
Some(EmailSearchResponseItemWithMetadata {
- created_at: info.created_at.timestamp(),
- updated_at: info.updated_at.timestamp(),
- viewed_at: info.viewed_at.map(|a| a.timestamp()),
+ created_at: info.created_at,
+ updated_at: info.updated_at,
+ viewed_at: info.viewed_at,
snippet: info.snippet,
extra: EmailSearchResponseItem {
id: entity_id,
diff --git a/rust/cloud-storage/search_service/src/api/search/email/test.rs b/rust/cloud-storage/search_service/src/api/search/email/test.rs
index dd68ef29b8..51ebd1d501 100644
--- a/rust/cloud-storage/search_service/src/api/search/email/test.rs
+++ b/rust/cloud-storage/search_service/src/api/search/email/test.rs
@@ -2,6 +2,7 @@ use models_opensearch::SearchEntityType;
use opensearch_client::search::model::Highlight;
use super::*;
+use chrono::DateTime;
fn create_email_history(thread_id: &str) -> models_email::service::message::ThreadHistoryInfo {
let now = chrono::Utc::now();
@@ -40,7 +41,7 @@ fn test_construct_search_result_single_thread() {
cc: vec![],
bcc: vec![],
labels: vec!["inbox".to_string()],
- sent_at: Some(1234567800),
+ sent_at: Some(DateTime::from_timestamp(1234567800, 0).unwrap()),
},
)),
score: None,
@@ -97,7 +98,7 @@ fn test_sort_stability() {
cc: vec![],
bcc: vec![],
labels: vec!["inbox".to_string()],
- sent_at: Some(1234567800),
+ sent_at: Some(DateTime::from_timestamp(1234567800, 0).unwrap()),
},
)),
score: None,
@@ -119,7 +120,7 @@ fn test_sort_stability() {
cc: vec![],
bcc: vec![],
labels: vec!["inbox".to_string()],
- sent_at: Some(1234567800),
+ sent_at: Some(DateTime::from_timestamp(1234567800, 0).unwrap()),
},
)),
score: None,
@@ -141,7 +142,7 @@ fn test_sort_stability() {
cc: vec![],
bcc: vec![],
labels: vec!["inbox".to_string()],
- sent_at: Some(1234567800),
+ sent_at: Some(DateTime::from_timestamp(1234567800, 0).unwrap()),
},
)),
score: None,
@@ -163,7 +164,7 @@ fn test_sort_stability() {
cc: vec![],
bcc: vec![],
labels: vec!["inbox".to_string()],
- sent_at: Some(1234567800),
+ sent_at: Some(DateTime::from_timestamp(1234567800, 0).unwrap()),
},
)),
score: None,
@@ -185,7 +186,7 @@ fn test_sort_stability() {
cc: vec![],
bcc: vec![],
labels: vec!["inbox".to_string()],
- sent_at: Some(1234567800),
+ sent_at: Some(DateTime::from_timestamp(1234567800, 0).unwrap()),
},
)),
score: None,
diff --git a/rust/cloud-storage/search_service/src/api/search/project.rs b/rust/cloud-storage/search_service/src/api/search/project.rs
index fabde2a3dc..f59e23c15d 100644
--- a/rust/cloud-storage/search_service/src/api/search/project.rs
+++ b/rust/cloud-storage/search_service/src/api/search/project.rs
@@ -73,11 +73,11 @@ pub fn construct_search_result(
if let Some(info) = project_histories.get(&entity_id.to_string()) {
let info = info.clone();
let metadata = models_search::project::ProjectMetadata {
- created_at: info.created_at.timestamp(),
- updated_at: info.updated_at.timestamp(),
- viewed_at: info.viewed_at.map(|a| a.timestamp()),
+ created_at: info.created_at,
+ updated_at: info.updated_at,
+ viewed_at: info.viewed_at,
parent_project_id: info.parent_project_id.clone(),
- deleted_at: info.deleted_at.map(|a| a.timestamp()),
+ deleted_at: info.deleted_at,
};
Some(ProjectSearchResponseItemWithMetadata {
metadata: Some(metadata),
@@ -86,8 +86,8 @@ pub fn construct_search_result(
owner_id: info.user_id.clone(),
name: info.name,
project_search_results: hits,
- updated_at: info.updated_at.timestamp(),
- created_at: info.created_at.timestamp(),
+ updated_at: info.updated_at,
+ created_at: info.created_at,
},
})
} else {
diff --git a/rust/cloud-storage/search_service/src/api/search/unified/test.rs b/rust/cloud-storage/search_service/src/api/search/unified/test.rs
index 3272c6f3ba..863cb5d619 100644
--- a/rust/cloud-storage/search_service/src/api/search/unified/test.rs
+++ b/rust/cloud-storage/search_service/src/api/search/unified/test.rs
@@ -1,4 +1,5 @@
use super::*;
+use chrono::DateTime;
use models_search::{
SearchHighlight,
channel::{
@@ -29,8 +30,8 @@ fn test_sort_unified_search_results() {
// Document with updated_at = 1000 (oldest)
UnifiedSearchResponseItem::Document(DocumentSearchResponseItemWithMetadata {
metadata: Some(DocumentMetadata {
- created_at: 900,
- updated_at: 1000,
+ created_at: DateTime::from_timestamp(900, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1000, 0).unwrap(),
viewed_at: None,
project_id: None,
deleted_at: None,
@@ -49,8 +50,8 @@ fn test_sort_unified_search_results() {
// Chat with updated_at = 3000 (newest)
UnifiedSearchResponseItem::Chat(ChatSearchResponseItemWithMetadata {
metadata: Some(ChatMetadata {
- created_at: 2900,
- updated_at: 3000,
+ created_at: DateTime::from_timestamp(2900, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(3000, 0).unwrap(),
viewed_at: None,
project_id: None,
deleted_at: None,
@@ -66,8 +67,8 @@ fn test_sort_unified_search_results() {
}),
// Email with updated_at = 1500 (middle)
UnifiedSearchResponseItem::Email(EmailSearchResponseItemWithMetadata {
- created_at: 1400,
- updated_at: 1500,
+ created_at: DateTime::from_timestamp(1400, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1500, 0).unwrap(),
viewed_at: None,
snippet: None,
extra: EmailSearchResponseItem {
@@ -83,8 +84,8 @@ fn test_sort_unified_search_results() {
// Project with updated_at = 2000 (second newest)
UnifiedSearchResponseItem::Project(ProjectSearchResponseItemWithMetadata {
metadata: Some(ProjectMetadata {
- created_at: 1900,
- updated_at: 2000,
+ created_at: DateTime::from_timestamp(1900, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(2000, 0).unwrap(),
viewed_at: None,
parent_project_id: None,
deleted_at: None,
@@ -93,16 +94,16 @@ fn test_sort_unified_search_results() {
id: project_id,
name: "Recent Project".to_string(),
owner_id: "owner1".to_string(),
- updated_at: 2000,
- created_at: 1900,
+ updated_at: DateTime::from_timestamp(2000, 0).unwrap(),
+ created_at: DateTime::from_timestamp(1900, 0).unwrap(),
project_search_results: vec![],
},
}),
// Another Document with updated_at = 2500 (second)
UnifiedSearchResponseItem::Document(DocumentSearchResponseItemWithMetadata {
metadata: Some(DocumentMetadata {
- created_at: 2400,
- updated_at: 2500,
+ created_at: DateTime::from_timestamp(2400, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(2500, 0).unwrap(),
viewed_at: None,
project_id: None,
deleted_at: None,
@@ -144,8 +145,8 @@ fn test_channel_updated_at_uses_max_from_message_results() {
// Channel with metadata.updated_at = 1000, but message results have higher values
let channel = UnifiedSearchResponseItem::Channel(ChannelSearchResponseItemWithMetadata {
metadata: Some(ChannelMetadata {
- created_at: 900,
- updated_at: 1000,
+ created_at: DateTime::from_timestamp(900, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1000, 0).unwrap(),
viewed_at: None,
interacted_at: None,
}),
@@ -159,8 +160,8 @@ fn test_channel_updated_at_uses_max_from_message_results() {
message_id: Some(Uuid::new_v4()),
thread_id: None,
sender_id: Some("sender1".to_string()),
- created_at: Some(1800),
- updated_at: Some(2000), // Second highest
+ created_at: Some(DateTime::from_timestamp(1800, 0).unwrap()),
+ updated_at: Some(DateTime::from_timestamp(2000, 0).unwrap()), // Second highest
highlight: SearchHighlight::default(),
score: None,
},
@@ -168,8 +169,8 @@ fn test_channel_updated_at_uses_max_from_message_results() {
message_id: Some(Uuid::new_v4()),
thread_id: None,
sender_id: Some("sender2".to_string()),
- created_at: Some(2900),
- updated_at: Some(3000), // Highest - should be used
+ created_at: Some(DateTime::from_timestamp(2900, 0).unwrap()),
+ updated_at: Some(DateTime::from_timestamp(3000, 0).unwrap()), // Highest - should be used
highlight: SearchHighlight::default(),
score: None,
},
@@ -177,8 +178,8 @@ fn test_channel_updated_at_uses_max_from_message_results() {
message_id: Some(Uuid::new_v4()),
thread_id: None,
sender_id: Some("sender3".to_string()),
- created_at: Some(1400),
- updated_at: Some(1500), // Lowest of results
+ created_at: Some(DateTime::from_timestamp(1400, 0).unwrap()),
+ updated_at: Some(DateTime::from_timestamp(1500, 0).unwrap()), // Lowest of results
highlight: SearchHighlight::default(),
score: None,
},
@@ -187,7 +188,10 @@ fn test_channel_updated_at_uses_max_from_message_results() {
});
// Should return 3000 (max from message results), not 1000 (metadata)
- assert_eq!(channel.updated_at(), 3000);
+ assert_eq!(
+ channel.updated_at(),
+ Some(DateTime::from_timestamp(3000, 0).unwrap())
+ );
}
#[test]
@@ -197,8 +201,8 @@ fn test_channel_updated_at_falls_back_to_metadata_when_no_results() {
// Channel with metadata.updated_at = 1000, but no message results
let channel = UnifiedSearchResponseItem::Channel(ChannelSearchResponseItemWithMetadata {
metadata: Some(ChannelMetadata {
- created_at: 900,
- updated_at: 1000,
+ created_at: DateTime::from_timestamp(900, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1000, 0).unwrap(),
viewed_at: None,
interacted_at: None,
}),
@@ -212,7 +216,10 @@ fn test_channel_updated_at_falls_back_to_metadata_when_no_results() {
});
// Should return 1000 (metadata) since no message results
- assert_eq!(channel.updated_at(), 1000);
+ assert_eq!(
+ channel.updated_at(),
+ Some(DateTime::from_timestamp(1000, 0).unwrap())
+ );
}
#[test]
@@ -222,8 +229,8 @@ fn test_channel_updated_at_falls_back_to_metadata_when_results_have_no_updated_a
// Channel with metadata.updated_at = 1000, message results have None for updated_at
let channel = UnifiedSearchResponseItem::Channel(ChannelSearchResponseItemWithMetadata {
metadata: Some(ChannelMetadata {
- created_at: 900,
- updated_at: 1000,
+ created_at: DateTime::from_timestamp(900, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1000, 0).unwrap(),
viewed_at: None,
interacted_at: None,
}),
@@ -237,7 +244,7 @@ fn test_channel_updated_at_falls_back_to_metadata_when_results_have_no_updated_a
message_id: Some(Uuid::new_v4()),
thread_id: None,
sender_id: Some("sender1".to_string()),
- created_at: Some(1800),
+ created_at: Some(DateTime::from_timestamp(1800, 0).unwrap()),
updated_at: None, // No updated_at
highlight: SearchHighlight::default(),
score: None,
@@ -246,7 +253,7 @@ fn test_channel_updated_at_falls_back_to_metadata_when_results_have_no_updated_a
message_id: Some(Uuid::new_v4()),
thread_id: None,
sender_id: Some("sender2".to_string()),
- created_at: Some(2900),
+ created_at: Some(DateTime::from_timestamp(2900, 0).unwrap()),
updated_at: None, // No updated_at
highlight: SearchHighlight::default(),
score: None,
@@ -256,7 +263,10 @@ fn test_channel_updated_at_falls_back_to_metadata_when_results_have_no_updated_a
});
// Should return 1000 (metadata) since all message results have None for updated_at
- assert_eq!(channel.updated_at(), 1000);
+ assert_eq!(
+ channel.updated_at(),
+ Some(DateTime::from_timestamp(1000, 0).unwrap())
+ );
}
#[test]
@@ -269,8 +279,8 @@ fn test_sort_unified_search_results_with_channel() {
// Document with updated_at = 2000
UnifiedSearchResponseItem::Document(DocumentSearchResponseItemWithMetadata {
metadata: Some(DocumentMetadata {
- created_at: 1900,
- updated_at: 2000,
+ created_at: DateTime::from_timestamp(1900, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(2000, 0).unwrap(),
viewed_at: None,
project_id: None,
deleted_at: None,
@@ -289,8 +299,8 @@ fn test_sort_unified_search_results_with_channel() {
// Channel with metadata.updated_at = 1000, but message result has updated_at = 3000
UnifiedSearchResponseItem::Channel(ChannelSearchResponseItemWithMetadata {
metadata: Some(ChannelMetadata {
- created_at: 900,
- updated_at: 1000, // Would be sorted after document if this was used
+ created_at: DateTime::from_timestamp(900, 0).unwrap(),
+ updated_at: DateTime::from_timestamp(1000, 0).unwrap(), // Would be sorted after document if this was used
viewed_at: None,
interacted_at: None,
}),
@@ -303,8 +313,8 @@ fn test_sort_unified_search_results_with_channel() {
message_id: Some(Uuid::new_v4()),
thread_id: None,
sender_id: Some("sender1".to_string()),
- created_at: Some(2900),
- updated_at: Some(3000), // Should make channel sort first
+ created_at: Some(DateTime::from_timestamp(2900, 0).unwrap()),
+ updated_at: Some(DateTime::from_timestamp(3000, 0).unwrap()), // Should make channel sort first
highlight: SearchHighlight::default(),
score: None,
}],