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(references): show comments on documents, projects, CRM records, and calls (#8480)

gbirman602334e6c228
diff --git a/.sqlx/query-53e13a07c91e04ef71e9daf6dd95344f1a5c6f76a356da034642c093e7437daa.json b/.sqlx/query-53e13a07c91e04ef71e9daf6dd95344f1a5c6f76a356da034642c093e7437daa.json
deleted file mode 100644
index 3e854badb1..0000000000
--- a/.sqlx/query-53e13a07c91e04ef71e9daf6dd95344f1a5c6f76a356da034642c093e7437daa.json
+++ /dev/null
@@ -1,66 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \n m.parent_entity_id::uuid AS \"channel_id!: uuid::Uuid\",\n c.name AS \"channel_name?\", -- Option<String>\n m.id AS \"message_id: uuid::Uuid\",\n m.thread_id AS \"thread_id?: uuid::Uuid\",\n m.sender_id AS \"sender_id!\", -- String\n m.content AS \"message_content!\", -- String\n m.created_at AS \"message_created_at!: chrono::DateTime<chrono::Utc>\",\n em.created_at AS \"attachment_created_at!: chrono::DateTime<chrono::Utc>\"\n FROM comms_entity_mentions em\n JOIN comms_messages m ON (em.source_entity_id = m.id::text AND em.source_entity_type = 'message')\n JOIN comms_channels c ON m.parent_entity_type = 'channel' AND m.parent_entity_id = c.id::text\n JOIN comms_channel_participants cp ON cp.channel_id = c.id\n WHERE em.entity_type = $1\n AND em.entity_id = $2\n AND cp.user_id = $3\n AND cp.left_at IS NULL\n AND m.deleted_at IS NULL\n ORDER BY em.created_at DESC\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "channel_id!: uuid::Uuid",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "channel_name?",
- "type_info": "Varchar"
- },
- {
- "ordinal": 2,
- "name": "message_id: uuid::Uuid",
- "type_info": "Uuid"
- },
- {
- "ordinal": 3,
- "name": "thread_id?: uuid::Uuid",
- "type_info": "Uuid"
- },
- {
- "ordinal": 4,
- "name": "sender_id!",
- "type_info": "Text"
- },
- {
- "ordinal": 5,
- "name": "message_content!",
- "type_info": "Text"
- },
- {
- "ordinal": 6,
- "name": "message_created_at!: chrono::DateTime<chrono::Utc>",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 7,
- "name": "attachment_created_at!: chrono::DateTime<chrono::Utc>",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": [
- null,
- true,
- false,
- true,
- false,
- false,
- false,
- false
- ]
- },
- "hash": "53e13a07c91e04ef71e9daf6dd95344f1a5c6f76a356da034642c093e7437daa"
-}
diff --git a/.sqlx/query-6ddfc76d4a95ab81c18c930d8c08c51813d41f72f734271c538bd3e5377e2a4c.json b/.sqlx/query-6ddfc76d4a95ab81c18c930d8c08c51813d41f72f734271c538bd3e5377e2a4c.json
deleted file mode 100644
index 6cf849fd5c..0000000000
--- a/.sqlx/query-6ddfc76d4a95ab81c18c930d8c08c51813d41f72f734271c538bd3e5377e2a4c.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \n em.source_entity_type,\n em.source_entity_id,\n em.entity_type,\n em.entity_id,\n em.user_id,\n em.created_at\n FROM comms_entity_mentions em\n WHERE em.entity_type = $1\n AND em.entity_id = $2\n AND em.source_entity_type != 'message'\n ORDER BY em.created_at DESC\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "source_entity_type",
- "type_info": "Varchar"
- },
- {
- "ordinal": 1,
- "name": "source_entity_id",
- "type_info": "Varchar"
- },
- {
- "ordinal": 2,
- "name": "entity_type",
- "type_info": "Varchar"
- },
- {
- "ordinal": 3,
- "name": "entity_id",
- "type_info": "Varchar"
- },
- {
- "ordinal": 4,
- "name": "user_id",
- "type_info": "Varchar"
- },
- {
- "ordinal": 5,
- "name": "created_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- true,
- false
- ]
- },
- "hash": "6ddfc76d4a95ab81c18c930d8c08c51813d41f72f734271c538bd3e5377e2a4c"
-}
diff --git a/.sqlx/query-8f5015cb22c06c61a396bdd620f30a63ace46f3b0044f5f4c032a1cbf77559eb.json b/.sqlx/query-8f5015cb22c06c61a396bdd620f30a63ace46f3b0044f5f4c032a1cbf77559eb.json
new file mode 100644
index 0000000000..18e30199f7
--- /dev/null
+++ b/.sqlx/query-8f5015cb22c06c61a396bdd620f30a63ace46f3b0044f5f4c032a1cbf77559eb.json
@@ -0,0 +1,65 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT\n m.parent_entity_type AS \"parent_entity_type!\",\n m.parent_entity_id AS \"parent_entity_id!\",\n m.id AS \"message_id!: uuid::Uuid\",\n m.thread_id AS \"thread_id?: uuid::Uuid\",\n m.sender_id AS \"sender_id!\",\n m.content AS \"message_content!\",\n m.created_at AS \"message_created_at!: chrono::DateTime<chrono::Utc>\",\n r.created_at AS \"attachment_created_at!: chrono::DateTime<chrono::Utc>\"\n FROM (\n -- The CASE keeps non-message source ids out of the uuid cast.\n SELECT CASE WHEN em.source_entity_type = 'message' THEN em.source_entity_id::uuid END AS message_id,\n em.created_at\n FROM comms_entity_mentions em\n WHERE em.source_entity_type = 'message'\n AND em.entity_type = ANY($1)\n AND em.entity_id = $2\n UNION ALL\n SELECT a.message_id, a.created_at\n FROM comms_attachments a\n WHERE a.entity_type = ANY($1)\n AND a.entity_id = $2\n ) r\n JOIN comms_messages m ON m.id = r.message_id\n WHERE m.parent_entity_type <> 'channel'\n AND m.deleted_at IS NULL\n ORDER BY r.created_at DESC\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "parent_entity_type!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 1,
+ "name": "parent_entity_id!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "message_id!: uuid::Uuid",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 3,
+ "name": "thread_id?: uuid::Uuid",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 4,
+ "name": "sender_id!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 5,
+ "name": "message_content!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 6,
+ "name": "message_created_at!: chrono::DateTime<chrono::Utc>",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 7,
+ "name": "attachment_created_at!: chrono::DateTime<chrono::Utc>",
+ "type_info": "Timestamptz"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "TextArray",
+ "Text"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ null
+ ]
+ },
+ "hash": "8f5015cb22c06c61a396bdd620f30a63ace46f3b0044f5f4c032a1cbf77559eb"
+}
diff --git a/.sqlx/query-bf4f1342d2e9d702d0377276bddff36ce7e5b93d32f5d47284233114e4abb14f.json b/.sqlx/query-bf4f1342d2e9d702d0377276bddff36ce7e5b93d32f5d47284233114e4abb14f.json
deleted file mode 100644
index d1f46634db..0000000000
--- a/.sqlx/query-bf4f1342d2e9d702d0377276bddff36ce7e5b93d32f5d47284233114e4abb14f.json
+++ /dev/null
@@ -1,66 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \n m.parent_entity_id::uuid AS \"channel_id!: uuid::Uuid\",\n c.name AS \"channel_name?\", -- Option<String>\n a.message_id AS \"message_id: uuid::Uuid\",\n m.thread_id AS \"thread_id?: uuid::Uuid\",\n m.sender_id AS \"sender_id!\", -- String\n m.content AS \"message_content!\", -- String\n m.created_at AS \"message_created_at!: chrono::DateTime<chrono::Utc>\",\n a.created_at AS \"attachment_created_at!: chrono::DateTime<chrono::Utc>\"\n FROM comms_attachments a\n JOIN comms_messages m ON a.message_id = m.id\n JOIN comms_channels c ON m.parent_entity_type = 'channel' AND m.parent_entity_id = c.id::text\n JOIN comms_channel_participants cp ON cp.channel_id = c.id\n WHERE a.entity_type = $1\n AND a.entity_id = $2\n AND cp.user_id = $3\n AND cp.left_at IS NULL\n AND m.deleted_at IS NULL\n ORDER BY a.created_at DESC\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "channel_id!: uuid::Uuid",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "channel_name?",
- "type_info": "Varchar"
- },
- {
- "ordinal": 2,
- "name": "message_id: uuid::Uuid",
- "type_info": "Uuid"
- },
- {
- "ordinal": 3,
- "name": "thread_id?: uuid::Uuid",
- "type_info": "Uuid"
- },
- {
- "ordinal": 4,
- "name": "sender_id!",
- "type_info": "Text"
- },
- {
- "ordinal": 5,
- "name": "message_content!",
- "type_info": "Text"
- },
- {
- "ordinal": 6,
- "name": "message_created_at!: chrono::DateTime<chrono::Utc>",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 7,
- "name": "attachment_created_at!: chrono::DateTime<chrono::Utc>",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": [
- null,
- true,
- false,
- true,
- false,
- false,
- false,
- false
- ]
- },
- "hash": "bf4f1342d2e9d702d0377276bddff36ce7e5b93d32f5d47284233114e4abb14f"
-}
diff --git a/apps/web/src/lib/core/component/References.tsx b/apps/web/src/lib/core/component/References.tsx
index 9132a33d54..a8440ca9ba 100644
--- a/apps/web/src/lib/core/component/References.tsx
+++ b/apps/web/src/lib/core/component/References.tsx
@@ -1,9 +1,16 @@
+import { documentCommentLocation } from '@app/features/notifications/document-comment-location';
+import { openProject } from '@app/features/projects/open-project';
+import {
+ callDetailSearch,
+ callDetailSearchCodec,
+} from '@block-call/call-route';
import { navigateToChannelMessage } from '@block-channel/utils/link';
import { useGlobalBlockOrchestrator } from '@components/app/GlobalAppState';
import { useSplitLayout } from '@components/app/split-layout/layout';
import type { BlockAlias, BlockName } from '@core/block';
import { toast } from '@core/component/Toast/Toast';
import { fileTypeToBlockName } from '@core/constant/allBlocks';
+import { COMMENT_LINK_PARAM } from '@core/messages/comment-link';
import { getDisplayNameParts, tryMacroId } from '@core/user';
import { compareDateDesc, type DateValue } from '@core/util/date';
import { useSplitNavigationHandler } from '@core/util/useSplitNavigationHandler';
@@ -16,11 +23,15 @@ import {
} from '@queries/preview';
import { useAttachmentReferencesQuery } from '@queries/storage/attachment-references';
import type { ItemType } from '@service-storage/client';
+import type { ApiAttachmentCommentReference as CommentReference } from '@service-storage/generated/schemas/apiAttachmentCommentReference';
import type { ApiAttachmentEntityReference as EntityReference } from '@service-storage/generated/schemas/apiAttachmentEntityReference';
import type { ApiAttachmentGenericReference as GenericReference } from '@service-storage/generated/schemas/apiAttachmentGenericReference';
import { stringToItemType } from '@service-storage/itemType';
+import { createCallback } from '@solid-primitives/rootless';
import { createMemo, For, type JSX, Show } from 'solid-js';
+import { match } from 'ts-pattern';
import { InlineItemPreview } from './ItemPreview';
+import { openDocument } from './LexicalMarkdown/component/core/BlockLink';
import { StaticMarkdown } from './LexicalMarkdown/component/core/StaticMarkdown';
import { twoLineClampMarkdownTheme } from './LexicalMarkdown/theme';
import { UserIcon } from './UserIcon';
@@ -39,6 +50,9 @@ type ChannelRef = EntityReference & {
message_content?: string;
};
+type CommentRef = EntityReference &
+ CommentReference & { reference_type: 'comment' };
+
type GenericRef = EntityReference &
GenericReference & { reference_type: 'generic' };
@@ -51,6 +65,16 @@ function isChannelReference(ref: EntityReference): ref is ChannelRef {
);
}
+function isCommentReference(ref: EntityReference): ref is CommentRef {
+ return (
+ 'parent_entity_type' in ref &&
+ 'parent_entity_id' in ref &&
+ 'message_id' in ref &&
+ 'sender_id' in ref &&
+ 'attachment_created_at' in ref
+ );
+}
+
function isGenericReference(ref: EntityReference): ref is GenericRef {
return (
'reference_type' in ref &&
@@ -62,7 +86,7 @@ function isGenericReference(ref: EntityReference): ref is GenericRef {
}
const getReferenceCreatedAt = (ref: EntityReference) => {
- if (isChannelReference(ref)) {
+ if (isChannelReference(ref) || isCommentReference(ref)) {
return ref.attachment_created_at;
} else if (isGenericReference(ref)) {
return ref.created_at;
@@ -134,30 +158,32 @@ function isOnlyMentions(markdown: string): boolean {
return markdown.replace(MENTION_TAG_RE, '').trim().length === 0;
}
-function ChannelReferenceRow(props: {
- reference: ChannelRef;
+/** A channel message or a comment: the sender, where it was said, and its text. */
+function MessageReferenceRow(props: {
+ source: JSX.Element;
+ senderId: string;
+ createdAt: string;
+ content?: string;
onOpen: (e: KeyboardEvent | MouseEvent) => void;
}) {
const senderName = () => {
- const parts = getDisplayNameParts(tryMacroId(props.reference.sender_id), {
+ const parts = getDisplayNameParts(tryMacroId(props.senderId), {
emailFallback: 'local-part',
});
return parts.firstName || parts.fullName;
};
const hasContent = () => {
- const content = props.reference.message_content?.trim();
+ const content = props.content?.trim();
if (!content) return false;
return !isOnlyMentions(content);
};
return (
<ReferenceRow
- source={
- <InlineItemPreview id={props.reference.channel_id} type="channel" />
- }
+ source={props.source}
senderAvatar={
<UserIcon
- id={props.reference.sender_id}
+ id={props.senderId}
size="sm"
isDeleted={false}
suppressClick
@@ -165,12 +191,12 @@ function ChannelReferenceRow(props: {
/>
}
senderName={senderName()}
- timestamp={props.reference.attachment_created_at}
+ timestamp={props.createdAt}
onClick={props.onOpen}
body={
hasContent() ? (
<StaticMarkdown
- markdown={props.reference.message_content || ''}
+ markdown={props.content || ''}
theme={twoLineClampMarkdownTheme}
/>
) : undefined
@@ -179,6 +205,49 @@ function ChannelReferenceRow(props: {
);
}
+function ChannelReferenceRow(props: {
+ reference: ChannelRef;
+ onOpen: (e: KeyboardEvent | MouseEvent) => void;
+}) {
+ return (
+ <MessageReferenceRow
+ source={
+ <InlineItemPreview id={props.reference.channel_id} type="channel" />
+ }
+ senderId={props.reference.sender_id}
+ createdAt={props.reference.attachment_created_at}
+ content={props.reference.message_content}
+ onOpen={props.onOpen}
+ />
+ );
+}
+
+function CommentReferenceRow(props: {
+ reference: CommentRef;
+ onOpen: (parent: PreviewItem, e: KeyboardEvent | MouseEvent) => void;
+}) {
+ const parentType = () => stringToItemType(props.reference.parent_entity_type);
+ const [parent] = useItemPreview(() => ({
+ id: props.reference.parent_entity_id,
+ type: parentType(),
+ }));
+
+ return (
+ <MessageReferenceRow
+ source={
+ <InlineItemPreview
+ id={props.reference.parent_entity_id}
+ type={parentType()}
+ />
+ }
+ senderId={props.reference.sender_id}
+ createdAt={props.reference.attachment_created_at}
+ content={props.reference.message_content}
+ onOpen={(e) => props.onOpen(parent(), e)}
+ />
+ );
+}
+
function GenericReferenceRow(props: {
reference: GenericRef;
onOpen: (item: PreviewItem, e?: KeyboardEvent | MouseEvent) => void;
@@ -226,7 +295,7 @@ export function References(props: ReferenceProps) {
() => props.documentId,
() => props.entityType ?? 'document'
);
- const { openWithSplit } = useSplitLayout();
+ const layout = useSplitLayout();
const blockOrchestrator = useGlobalBlockOrchestrator();
const navigateToItem = ({
@@ -237,9 +306,63 @@ export function References(props: ReferenceProps) {
blockName: BlockName | BlockAlias;
blockId: string;
}) => {
- openWithSplit({ type: blockName, id: blockId }, { preferNewSplit: true });
+ layout.openWithSplit(
+ { type: blockName, id: blockId },
+ { preferNewSplit: true }
+ );
};
+ // Opens the commented entity at the comment, the same way a reply target or
+ // a comment notification does for each parent kind.
+ const navigateToComment = createCallback(
+ (reference: CommentRef, parent: PreviewItem) => {
+ const parentId = reference.parent_entity_id;
+ const messageId = reference.message_id;
+ match(reference.parent_entity_type)
+ .with('initiative', () =>
+ openProject(layout, parentId, {
+ discussionId: messageId,
+ newSplit: true,
+ })
+ )
+ .with('document', () => {
+ if (!isAccessiblePreviewItem(parent) || parent.type !== 'document') {
+ toast.failure('Failed to open reference');
+ return;
+ }
+ const location = documentCommentLocation(messageId, {
+ fileType: parent.fileType,
+ subType: parent.subType,
+ });
+ openDocument(location.blockName, parentId, location.params, true);
+ })
+ .with('crm_company', 'crm_contact', (type) =>
+ openDocument(
+ type === 'crm_company' ? 'company' : 'contact',
+ parentId,
+ { [COMMENT_LINK_PARAM]: messageId },
+ true
+ )
+ )
+ .with('call', () =>
+ layout.openWithSplit(
+ { type: 'call', id: parentId },
+ {
+ preferNewSplit: true,
+ search: {
+ [callDetailSearch.namespace]: callDetailSearchCodec.serialize({
+ ...callDetailSearch.defaults,
+ messageId,
+ seek: crypto.randomUUID(),
+ }),
+ },
+ }
+ )
+ )
+ .otherwise(() => toast.failure('Failed to open reference'));
+ }
+ );
+
const navigateToMessage = ({
channelId,
messageId,
@@ -312,6 +435,14 @@ export function References(props: ReferenceProps) {
/>
);
}
+ if (isCommentReference(ref)) {
+ return (
+ <CommentReferenceRow
+ reference={ref}
+ onOpen={(parent) => navigateToComment(ref, parent)}
+ />
+ );
+ }
if (isGenericReference(ref)) {
return (
<GenericReferenceRow
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentCommentReference.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentCommentReference.ts
new file mode 100644
index 0000000000..cd4cfa46be
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentCommentReference.ts
@@ -0,0 +1,30 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { ApiAttachmentCommentReferenceThreadId } from './apiAttachmentCommentReferenceThreadId';
+
+/**
+ * A reference to an attachment entity from a comment on a non-channel entity.
+ */
+export interface ApiAttachmentCommentReference {
+ /** When the mention or attachment row was created. */
+ attachment_created_at: string;
+ /** Full message content (might be used for preview/snippet). */
+ message_content: string;
+ /** When the message itself was created. */
+ message_created_at: string;
+ /** Message that contains the reference. */
+ message_id: string;
+ /** Id of the entity the comment belongs to. */
+ parent_entity_id: string;
+ /** Stored type of the entity the comment belongs to
+(`document`, `initiative`, `crm_company`, `crm_contact`, or `call`). */
+ parent_entity_type: string;
+ /** Sender of the message. */
+ sender_id: string;
+ /** If the message belongs to a thread this is the parent id. */
+ thread_id?: ApiAttachmentCommentReferenceThreadId;
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentCommentReferenceThreadId.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentCommentReferenceThreadId.ts
new file mode 100644
index 0000000000..ffb200ce3d
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentCommentReferenceThreadId.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * If the message belongs to a thread this is the parent id.
+ */
+export type ApiAttachmentCommentReferenceThreadId = string | null;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReference.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReference.ts
index 0ed041db5b..21f643a360 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReference.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReference.ts
@@ -6,10 +6,12 @@
*/
import type { ApiAttachmentEntityReferenceOneOf } from './apiAttachmentEntityReferenceOneOf';
import type { ApiAttachmentEntityReferenceOneOfFour } from './apiAttachmentEntityReferenceOneOfFour';
+import type { ApiAttachmentEntityReferenceOneOfSeven } from './apiAttachmentEntityReferenceOneOfSeven';
/**
* An attachment reference, tagged by source kind.
*/
export type ApiAttachmentEntityReference =
| ApiAttachmentEntityReferenceOneOf
- | ApiAttachmentEntityReferenceOneOfFour;
+ | ApiAttachmentEntityReferenceOneOfFour
+ | ApiAttachmentEntityReferenceOneOfSeven;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfFour.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfFour.ts
index 7f88641688..8fd07e03ca 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfFour.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfFour.ts
@@ -4,12 +4,11 @@
* document_storage_service
* OpenAPI spec version: 0.1.0
*/
-
+import type { ApiAttachmentCommentReference } from './apiAttachmentCommentReference';
import type { ApiAttachmentEntityReferenceOneOfFourAllOf } from './apiAttachmentEntityReferenceOneOfFourAllOf';
-import type { ApiAttachmentGenericReference } from './apiAttachmentGenericReference';
/**
- * Referenced from any non-message source entity.
+ * Referenced from a comment on a document, initiative, CRM record, or call.
*/
export type ApiAttachmentEntityReferenceOneOfFour =
- ApiAttachmentGenericReference & ApiAttachmentEntityReferenceOneOfFourAllOf;
+ ApiAttachmentCommentReference & ApiAttachmentEntityReferenceOneOfFourAllOf;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfFourAllOfReferenceType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfFourAllOfReferenceType.ts
index 23d8a7e85c..4278c84eef 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfFourAllOfReferenceType.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfFourAllOfReferenceType.ts
@@ -10,5 +10,5 @@ export type ApiAttachmentEntityReferenceOneOfFourAllOfReferenceType =
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ApiAttachmentEntityReferenceOneOfFourAllOfReferenceType = {
- generic: 'generic',
+ comment: 'comment',
} as const;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfSeven.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfSeven.ts
new file mode 100644
index 0000000000..d113e84ff3
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfSeven.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+import type { ApiAttachmentEntityReferenceOneOfSevenAllOf } from './apiAttachmentEntityReferenceOneOfSevenAllOf';
+import type { ApiAttachmentGenericReference } from './apiAttachmentGenericReference';
+
+/**
+ * Referenced from any non-message source entity.
+ */
+export type ApiAttachmentEntityReferenceOneOfSeven =
+ ApiAttachmentGenericReference & ApiAttachmentEntityReferenceOneOfSevenAllOf;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfSevenAllOf.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfSevenAllOf.ts
new file mode 100644
index 0000000000..c6da2d8ff7
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfSevenAllOf.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { ApiAttachmentEntityReferenceOneOfSevenAllOfReferenceType } from './apiAttachmentEntityReferenceOneOfSevenAllOfReferenceType';
+
+export type ApiAttachmentEntityReferenceOneOfSevenAllOf = {
+ reference_type: ApiAttachmentEntityReferenceOneOfSevenAllOfReferenceType;
+};
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfSevenAllOfReferenceType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfSevenAllOfReferenceType.ts
new file mode 100644
index 0000000000..6c9a47ce32
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/apiAttachmentEntityReferenceOneOfSevenAllOfReferenceType.ts
@@ -0,0 +1,14 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type ApiAttachmentEntityReferenceOneOfSevenAllOfReferenceType =
+ (typeof ApiAttachmentEntityReferenceOneOfSevenAllOfReferenceType)[keyof typeof ApiAttachmentEntityReferenceOneOfSevenAllOfReferenceType];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const ApiAttachmentEntityReferenceOneOfSevenAllOfReferenceType = {
+ generic: 'generic',
+} as const;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
index 51f33be4e8..0d7eb6b53e 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
@@ -92,6 +92,8 @@ export * from './apiActivityViewedAt';
export * from './apiAttachmentChannelReference';
export * from './apiAttachmentChannelReferenceChannelName';
export * from './apiAttachmentChannelReferenceThreadId';
+export * from './apiAttachmentCommentReference';
+export * from './apiAttachmentCommentReferenceThreadId';
export * from './apiAttachmentEntityReference';
export * from './apiAttachmentEntityReferenceOneOf';
export * from './apiAttachmentEntityReferenceOneOfAllOf';
@@ -99,6 +101,9 @@ export * from './apiAttachmentEntityReferenceOneOfAllOfReferenceType';
export * from './apiAttachmentEntityReferenceOneOfFour';
export * from './apiAttachmentEntityReferenceOneOfFourAllOf';
export * from './apiAttachmentEntityReferenceOneOfFourAllOfReferenceType';
+export * from './apiAttachmentEntityReferenceOneOfSeven';
+export * from './apiAttachmentEntityReferenceOneOfSevenAllOf';
+export * from './apiAttachmentEntityReferenceOneOfSevenAllOfReferenceType';
export * from './apiAttachmentGenericReference';
export * from './apiAttachmentGenericReferenceUserId';
export * from './apiChannelAttachment';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
index d73597296f..a52be58622 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
@@ -3407,6 +3407,49 @@ export const getAttachmentReferencesResponse = zod
})
)
.describe('Referenced from a channel message.'),
+ zod
+ .object({
+ attachment_created_at: zod.iso
+ .datetime({})
+ .describe('When the mention or attachment row was created.'),
+ message_content: zod
+ .string()
+ .describe(
+ 'Full message content (might be used for preview\/snippet).'
+ ),
+ message_created_at: zod.iso
+ .datetime({})
+ .describe('When the message itself was created.'),
+ message_id: zod
+ .uuid()
+ .describe('Message that contains the reference.'),
+ parent_entity_id: zod
+ .string()
+ .describe('Id of the entity the comment belongs to.'),
+ parent_entity_type: zod
+ .string()
+ .describe(
+ 'Stored type of the entity the comment belongs to\n(`document`, `initiative`, `crm_company`, `crm_contact`, or `call`).'
+ ),
+ sender_id: zod.string().describe('Sender of the message.'),
+ thread_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'If the message belongs to a thread this is the parent id.'
+ ),
+ })
+ .describe(
+ 'A reference to an attachment entity from a comment on a non-channel entity.'
+ )
+ .and(
+ zod.object({
+ reference_type: zod.enum(['comment']),
+ })
+ )
+ .describe(
+ 'Referenced from a comment on a document, initiative, CRM record, or call.'
+ ),
zod
.object({
created_at: zod.iso
diff --git a/apps/web/src/lib/service-clients/service-storage/itemType.test.ts b/apps/web/src/lib/service-clients/service-storage/itemType.test.ts
index 9c5cd6807b..632385009d 100644
--- a/apps/web/src/lib/service-clients/service-storage/itemType.test.ts
+++ b/apps/web/src/lib/service-clients/service-storage/itemType.test.ts
@@ -58,6 +58,7 @@ describe('stringToItemType', () => {
'project',
'channel',
'crm_company',
+ 'crm_contact',
'crm_pipeline',
'initiative',
])('parses %s as itself', (raw) => {
@@ -71,12 +72,9 @@ describe('stringToItemType', () => {
}
);
- test.each(['crm_contact', 'channel_message', 'bogus'])(
- 'rejects %s',
- (raw) => {
- expect(stringToItemType(raw)).toBeUndefined();
- }
- );
+ test.each(['channel_message', 'bogus'])('rejects %s', (raw) => {
+ expect(stringToItemType(raw)).toBeUndefined();
+ });
});
describe('blockNameToItemType', () => {
diff --git a/apps/web/src/lib/service-clients/service-storage/itemType.ts b/apps/web/src/lib/service-clients/service-storage/itemType.ts
index 128a912f74..e28985d991 100644
--- a/apps/web/src/lib/service-clients/service-storage/itemType.ts
+++ b/apps/web/src/lib/service-clients/service-storage/itemType.ts
@@ -59,6 +59,7 @@ export function stringToItemType(str: string): ItemType | undefined {
'project',
'channel',
'crm_company',
+ 'crm_contact',
'crm_pipeline',
'initiative',
(itemType) => itemType
diff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.json
index 970d02dd66..13bb5f6323 100644
--- a/apps/web/src/lib/service-clients/service-storage/openapi.json
+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json
@@ -19481,6 +19481,57 @@
}
}
},
+ "ApiAttachmentCommentReference": {
+ "type": "object",
+ "description": "A reference to an attachment entity from a comment on a non-channel entity.",
+ "required": [
+ "parent_entity_type",
+ "parent_entity_id",
+ "message_id",
+ "sender_id",
+ "message_content",
+ "message_created_at",
+ "attachment_created_at"
+ ],
+ "properties": {
+ "attachment_created_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the mention or attachment row was created."
+ },
+ "message_content": {
+ "type": "string",
+ "description": "Full message content (might be used for preview/snippet)."
+ },
+ "message_created_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the message itself was created."
+ },
+ "message_id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Message that contains the reference."
+ },
+ "parent_entity_id": {
+ "type": "string",
+ "description": "Id of the entity the comment belongs to."
+ },
+ "parent_entity_type": {
+ "type": "string",
+ "description": "Stored type of the entity the comment belongs to\n(`document`, `initiative`, `crm_company`, `crm_contact`, or `call`)."
+ },
+ "sender_id": {
+ "type": "string",
+ "description": "Sender of the message."
+ },
+ "thread_id": {
+ "type": ["string", "null"],
+ "format": "uuid",
+ "description": "If the message belongs to a thread this is the parent id."
+ }
+ }
+ },
"ApiAttachmentEntityReference": {
"oneOf": [
{
@@ -19502,6 +19553,25 @@
],
"description": "Referenced from a channel message."
},
+ {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ApiAttachmentCommentReference",
+ "description": "Referenced from a comment on a document, initiative, CRM record, or call."
+ },
+ {
+ "type": "object",
+ "required": ["reference_type"],
+ "properties": {
+ "reference_type": {
+ "type": "string",
+ "enum": ["comment"]
+ }
+ }
+ }
+ ],
+ "description": "Referenced from a comment on a document, initiative, CRM record, or call."
+ },
{
"allOf": [
{
diff --git a/crates/channels/AGENTS.md b/crates/channels/AGENTS.md
index c081b37436..19d3826e75 100644
--- a/crates/channels/AGENTS.md
+++ b/crates/channels/AGENTS.md
@@ -56,6 +56,10 @@ DMs, and the shared message store other domains discuss things on.
don't collapse the two email templates.
- Legacy document/CRM/channel message paths were removed (#6732); don't
reintroduce a parallel message path outside this crate's domain service.
+- Attachment references from comments (messages on documents, initiatives, CRM
+ records, calls) are authorized in `ChannelServiceImpl::get_attachment_references`
+ through the `CommentParentAccess` port; the repo returns every parent. A
+ service built without `with_comment_parent_access` withholds them.
## Related
diff --git a/crates/channels/fixtures/channels_repo.sql b/crates/channels/fixtures/channels_repo.sql
index 88487cf2ad..8db5d0cb03 100644
--- a/crates/channels/fixtures/channels_repo.sql
+++ b/crates/channels/fixtures/channels_repo.sql
@@ -269,3 +269,28 @@ INSERT INTO comms_entity_mentions (id, source_entity_type, source_entity_id, ent
'document', 'doc-generic', 'macro|[email protected]', '2024-01-03 00:00:00+00'),
('00000000-0000-0000-0000-00000000e003', 'doc', 'src-doc-2',
'document', 'doc-2', 'macro|[email protected]', '2024-01-04 00:00:00+00');
+
+-- comments: messages on non-channel parents (used by attachment-references tests)
+-- c0a1: an initiative discussion comment mentioning doc-comment
+-- c0a2: a document discussion comment attaching doc-comment
+-- c0a3: a soft-deleted reply under c0a1 that also mentions doc-comment → excluded
+INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, thread_id, sender_id, content, created_at, updated_at, edited_at, deleted_at) VALUES
+ ('00000000-0000-0000-0000-00000000c0a1', 'initiative', '00000000-0000-0000-0000-0000000000a1', NULL,
+ 'macro|[email protected]', 'see <m-document-mention>doc-comment</m-document-mention>',
+ '2024-01-05 10:00:00+00', '2024-01-05 10:00:00+00', NULL, NULL),
+ ('00000000-0000-0000-0000-00000000c0a2', 'document', 'doc-parent', NULL,
+ 'macro|[email protected]', 'attached here',
+ '2024-01-05 11:00:00+00', '2024-01-05 11:00:00+00', NULL, NULL),
+ ('00000000-0000-0000-0000-00000000c0a3', 'initiative', '00000000-0000-0000-0000-0000000000a1',
+ '00000000-0000-0000-0000-00000000c0a1', 'macro|[email protected]', 'deleted reply',
+ '2024-01-05 12:00:00+00', '2024-01-05 12:00:00+00', NULL, '2024-01-06 00:00:00');
+
+INSERT INTO comms_entity_mentions (id, source_entity_type, source_entity_id, entity_type, entity_id, user_id, created_at) VALUES
+ ('00000000-0000-0000-0000-00000000e0c1', 'message', '00000000-0000-0000-0000-00000000c0a1',
+ 'document', 'doc-comment', 'macro|[email protected]', '2024-01-05 10:00:00+00'),
+ ('00000000-0000-0000-0000-00000000e0c3', 'message', '00000000-0000-0000-0000-00000000c0a3',
+ 'document', 'doc-comment', 'macro|[email protected]', '2024-01-05 12:00:00+00');
+
+INSERT INTO comms_attachments (id, message_id, entity_type, entity_id, width, height, created_at) VALUES
+ ('00000000-0000-0000-0000-00000000a0c2', '00000000-0000-0000-0000-00000000c0a2',
+ 'document', 'doc-comment', NULL, NULL, '2024-01-05 11:00:00+00');
diff --git a/crates/channels/src/domain/models.rs b/crates/channels/src/domain/models.rs
index c96afc7097..fa66b6d81f 100644
--- a/crates/channels/src/domain/models.rs
+++ b/crates/channels/src/domain/models.rs
@@ -292,6 +292,28 @@ pub struct AttachmentChannelReference {
pub attachment_created_at: DateTime<Utc>,
}
+/// A reference to an attachment entity from a comment: a message on a
+/// document, initiative, CRM record, or call rather than on a channel.
+#[derive(Debug, Clone, PartialEq)]
+pub struct AttachmentCommentReference {
+ /// Stored type of the entity the comment belongs to.
+ pub parent_entity_type: String,
+ /// Id of the entity the comment belongs to.
+ pub parent_entity_id: String,
+ /// Message that contains the reference.
+ pub message_id: Uuid,
+ /// If the message belongs to a thread this is the parent id.
+ pub thread_id: Option<Uuid>,
+ /// Sender of the message.
+ pub sender_id: String,
+ /// Full message content (might be used for preview/snippet).
+ pub message_content: String,
+ /// When the message itself was created.
+ pub message_created_at: DateTime<Utc>,
+ /// When the mention or attachment row was created.
+ pub attachment_created_at: DateTime<Utc>,
+}
+
/// A reference to an attachment entity from any non-message source entity.
#[derive(Debug, Clone, PartialEq)]
pub struct AttachmentGenericReference {
@@ -314,6 +336,8 @@ pub struct AttachmentGenericReference {
pub enum AttachmentEntityReference {
/// Referenced from a channel message.
Channel(AttachmentChannelReference),
+ /// Referenced from a comment on a non-channel entity.
+ Comment(AttachmentCommentReference),
/// Referenced from any non-message source entity.
Generic(AttachmentGenericReference),
}
diff --git a/crates/channels/src/domain/ports.rs b/crates/channels/src/domain/ports.rs
index 683b5d4c41..8ee3b7889c 100644
--- a/crates/channels/src/domain/ports.rs
+++ b/crates/channels/src/domain/ports.rs
@@ -795,6 +795,23 @@ pub enum ChannelMessagesErr {
MessageNotFound(Uuid),
}
+/// Decides whether a viewer may see the entity a comment belongs to, so comment
+/// references are authorized by the parent's own permissions rather than by
+/// channel participation.
+///
+/// Object-safe (`async_trait`) because the service holds it as `Arc<dyn _>`.
+#[async_trait::async_trait]
+pub trait CommentParentAccess: Send + Sync + 'static {
+ /// Whether `viewer` may view the stored parent entity; unknown parent types
+ /// and unparseable viewers are not viewable.
+ async fn can_view_parent(
+ &self,
+ viewer: &str,
+ parent_entity_type: &str,
+ parent_entity_id: &str,
+ ) -> anyhow::Result<bool>;
+}
+
/// Publisher for realtime channel side-effect commands.
pub trait ChannelRealtimePublisher: Send + Sync + 'static {
/// Error type for publishing operations.
diff --git a/crates/channels/src/domain/service.rs b/crates/channels/src/domain/service.rs
index 2e09557d65..0bdd0a08c0 100644
--- a/crates/channels/src/domain/service.rs
+++ b/crates/channels/src/domain/service.rs
@@ -12,7 +12,7 @@ use crate::domain::{
ports::{
ChannelAttachmentsPage, ChannelEventDispatcher, ChannelMessagesErr, ChannelMutationErr,
ChannelPictureAccess, ChannelPictureFile, ChannelPictureFiles,
- ChannelReferenceSharePermissions, ChannelRepo, ChannelService,
+ ChannelReferenceSharePermissions, ChannelRepo, ChannelService, CommentParentAccess,
},
};
use bot_id::{BotId, cowlike::CowLike};
@@ -22,6 +22,7 @@ use entity_access::domain::models::{
};
use macro_user_id::user_id::MacroUserIdStr;
use models_pagination::{CreatedAt, PaginateOn, Query};
+use std::collections::HashSet;
use std::sync::Arc;
use uuid::Uuid;
@@ -43,6 +44,8 @@ pub struct ChannelServiceImpl<
reference_share_permissions: P,
picture_files: F,
agent_direct_messages: Option<Arc<dyn super::agent_dm::AgentDirectMessages>>,
+ /// Fail-closed when unset: comment references are withheld.
+ comment_parent_access: Option<Arc<dyn CommentParentAccess>>,
}
/// Fail-closed picture metadata source for contexts that do not wire uploads.
@@ -99,6 +102,7 @@ where
reference_share_permissions: NoopChannelReferenceSharePermissions,
picture_files: UnavailableChannelPictureFiles,
agent_direct_messages: None,
+ comment_parent_access: None,
}
}
}
@@ -112,6 +116,7 @@ impl<R, E, P> ChannelServiceImpl<R, E, P> {
reference_share_permissions,
picture_files: UnavailableChannelPictureFiles,
agent_direct_messages: None,
+ comment_parent_access: None,
}
}
}
@@ -126,6 +131,12 @@ impl<R, E, P, F> ChannelServiceImpl<R, E, P, F> {
self
}
+ /// Authorize comment references through the commented entity's permissions.
+ pub fn with_comment_parent_access(mut self, access: Arc<dyn CommentParentAccess>) -> Self {
+ self.comment_parent_access = Some(access);
+ self
+ }
+
/// Wire the static-file metadata source used to authorize channel pictures.
pub fn with_picture_files<F2: ChannelPictureFiles>(
self,
@@ -137,6 +148,7 @@ impl<R, E, P, F> ChannelServiceImpl<R, E, P, F> {
reference_share_permissions: self.reference_share_permissions,
picture_files,
agent_direct_messages: self.agent_direct_messages,
+ comment_parent_access: self.comment_parent_access,
}
}
}
@@ -1047,18 +1059,61 @@ where
Ok(activity)
}
- #[tracing::instrument(err, skip(self, user_id))]
+ #[tracing::instrument(
+ err,
+ skip(self, user_id),
+ fields(comment_parents = tracing::field::Empty, references = tracing::field::Empty)
+ )]
async fn get_attachment_references(
&self,
entity_type: String,
entity_id: String,
user_id: String,
) -> Result<Vec<AttachmentEntityReference>, ChannelMessagesErr> {
- self.repo
+ let mut references = self
+ .repo
.get_attachment_references(&entity_type, &entity_id, &user_id)
.await
.map_err(anyhow::Error::from)
- .map_err(ChannelMessagesErr::Repo)
+ .map_err(ChannelMessagesErr::Repo)?;
+
+ // Channel rows are scoped to the viewer's channels in the repo; comment
+ // rows come back for every parent and are authorized here.
+ let parents: HashSet<(String, String)> = references
+ .iter()
+ .filter_map(|reference| match reference {
+ AttachmentEntityReference::Comment(comment) => Some((
+ comment.parent_entity_type.clone(),
+ comment.parent_entity_id.clone(),
+ )),
+ _ => None,
+ })
+ .collect();
+ let span = tracing::Span::current();
+ span.record("comment_parents", parents.len());
+
+ let mut viewable_parents = HashSet::new();
+ if let Some(access) = &self.comment_parent_access {
+ for (parent_type, parent_id) in parents {
+ if access
+ .can_view_parent(&user_id, &parent_type, &parent_id)
+ .await
+ .map_err(ChannelMessagesErr::Repo)?
+ {
+ viewable_parents.insert((parent_type, parent_id));
+ }
+ }
+ }
+ references.retain(|reference| match reference {
+ AttachmentEntityReference::Comment(comment) => viewable_parents.contains(&(
+ comment.parent_entity_type.clone(),
+ comment.parent_entity_id.clone(),
+ )),
+ _ => true,
+ });
+ span.record("references", references.len());
+
+ Ok(references)
}
async fn create_channel(
diff --git a/crates/channels/src/domain/service/test.rs b/crates/channels/src/domain/service/test.rs
index 531ce292c5..59bf57c9cb 100644
--- a/crates/channels/src/domain/service/test.rs
+++ b/crates/channels/src/domain/service/test.rs
@@ -9,7 +9,8 @@ use crate::domain::{
ParticipantRole, PatchChannelRequest, ReferencedShareItem, Sender,
},
ports::{
- ChannelEventDispatcher, ChannelReferenceSharePermissions, ChannelRepo, MockChannelRepo,
+ ChannelEventDispatcher, ChannelReferenceSharePermissions, ChannelRepo, CommentParentAccess,
+ MockChannelRepo,
},
};
use chrono::Utc;
@@ -558,6 +559,115 @@ async fn returns_empty_participants_list() {
assert!(participants.is_empty());
}
+/// Grants parent access to an explicit list of `(parent type, parent id)` pairs.
+struct FakeCommentParentAccess(Vec<(&'static str, &'static str)>);
+
+#[async_trait::async_trait]
+impl CommentParentAccess for FakeCommentParentAccess {
+ async fn can_view_parent(
+ &self,
+ _viewer: &str,
+ parent_entity_type: &str,
+ parent_entity_id: &str,
+ ) -> anyhow::Result<bool> {
+ Ok(self.0.contains(&(parent_entity_type, parent_entity_id)))
+ }
+}
+
+fn comment_reference(
+ parent_entity_type: &str,
+ parent_entity_id: &str,
+) -> AttachmentEntityReference {
+ AttachmentEntityReference::Comment(crate::domain::models::AttachmentCommentReference {
+ parent_entity_type: parent_entity_type.to_string(),
+ parent_entity_id: parent_entity_id.to_string(),
+ message_id: Uuid::nil(),
+ thread_id: None,
+ sender_id: "macro|[email protected]".to_string(),
+ message_content: "see the doc".to_string(),
+ message_created_at: Utc::now(),
+ attachment_created_at: Utc::now(),
+ })
+}
+
+fn references_repo() -> MockChannelRepo {
+ let mut repo = empty_repo();
+ repo.expect_get_attachment_references()
+ .returning(|_, _, _| {
+ Box::pin(async {
+ Ok(vec![
+ AttachmentEntityReference::Channel(
+ crate::domain::models::AttachmentChannelReference {
+ channel_id: Uuid::nil(),
+ channel_name: None,
+ message_id: Uuid::nil(),
+ thread_id: None,
+ sender_id: "macro|[email protected]".to_string(),
+ message_content: "in a channel".to_string(),
+ message_created_at: Utc::now(),
+ attachment_created_at: Utc::now(),
+ },
+ ),
+ comment_reference("initiative", "init-1"),
+ comment_reference("document", "doc-1"),
+ AttachmentEntityReference::Generic(
+ crate::domain::models::AttachmentGenericReference {
+ source_entity_type: "document".to_string(),
+ source_entity_id: "src-doc".to_string(),
+ entity_type: "document".to_string(),
+ entity_id: "target".to_string(),
+ user_id: None,
+ created_at: Utc::now(),
+ },
+ ),
+ ])
+ })
+ });
+ repo
+}
+
+#[tokio::test]
+async fn attachment_references_keep_comments_only_on_viewable_parents() {
+ let svc = ChannelServiceImpl::new(references_repo()).with_comment_parent_access(Arc::new(
+ FakeCommentParentAccess(vec![("initiative", "init-1")]),
+ ));
+ let refs = svc
+ .get_attachment_references(
+ "document".to_string(),
+ "target".to_string(),
+ "macro|[email protected]".to_string(),
+ )
+ .await
+ .unwrap();
+
+ assert_eq!(refs.len(), 3);
+ assert!(matches!(refs[0], AttachmentEntityReference::Channel(_)));
+ assert!(matches!(
+ &refs[1],
+ AttachmentEntityReference::Comment(comment) if comment.parent_entity_id == "init-1"
+ ));
+ assert!(matches!(refs[2], AttachmentEntityReference::Generic(_)));
+}
+
+#[tokio::test]
+async fn attachment_references_withhold_comments_without_parent_access() {
+ let svc = ChannelServiceImpl::new(references_repo());
+ let refs = svc
+ .get_attachment_references(
+ "document".to_string(),
+ "target".to_string(),
+ "macro|[email protected]".to_string(),
+ )
+ .await
+ .unwrap();
+
+ assert_eq!(refs.len(), 2);
+ assert!(
+ refs.iter()
+ .all(|r| !matches!(r, AttachmentEntityReference::Comment(_)))
+ );
+}
+
// --- center_window tests ---
// --- get_channel_messages_around tests ---
diff --git a/crates/channels/src/inbound/axum_router.rs b/crates/channels/src/inbound/axum_router.rs
index 0ce893aa4e..ce19bb131a 100644
--- a/crates/channels/src/inbound/axum_router.rs
+++ b/crates/channels/src/inbound/axum_router.rs
@@ -6,9 +6,10 @@ pub mod profile_picture;
pub use profile_picture::{SetChannelPictureRequest, set_channel_picture_handler};
use crate::domain::models::{
- Activity, ActivityType, AttachmentChannelReference, AttachmentEntityReference,
- AttachmentGenericReference, ChannelAttachment, ChannelAttachmentType, ChannelParticipant,
- ChannelType, CreateEntityMentionOptions, ParticipantRole, Sender,
+ Activity, ActivityType, AttachmentChannelReference, AttachmentCommentReference,
+ AttachmentEntityReference, AttachmentGenericReference, ChannelAttachment,
+ ChannelAttachmentType, ChannelParticipant, ChannelType, CreateEntityMentionOptions,
+ ParticipantRole, Sender,
};
pub use crate::domain::models::{
AddParticipantsRequest, ChannelJoinCodeResponse, ChannelPreview, ChannelPreviewData,
@@ -1146,6 +1147,8 @@ pub struct GetAttachmentReferencesResponse {
pub enum ApiAttachmentEntityReference {
/// Referenced from a channel message.
Channel(ApiAttachmentChannelReference),
+ /// Referenced from a comment on a document, initiative, CRM record, or call.
+ Comment(ApiAttachmentCommentReference),
/// Referenced from any non-message source entity.
Generic(ApiAttachmentGenericReference),
}
@@ -1156,6 +1159,9 @@ impl From<AttachmentEntityReference> for ApiAttachmentEntityReference {
AttachmentEntityReference::Channel(c) => {
Self::Channel(ApiAttachmentChannelReference::from(c))
}
+ AttachmentEntityReference::Comment(c) => {
+ Self::Comment(ApiAttachmentCommentReference::from(c))
+ }
AttachmentEntityReference::Generic(g) => {
Self::Generic(ApiAttachmentGenericReference::from(g))
}
@@ -1163,6 +1169,43 @@ impl From<AttachmentEntityReference> for ApiAttachmentEntityReference {
}
}
+/// A reference to an attachment entity from a comment on a non-channel entity.
+#[derive(Debug, Serialize, utoipa::ToSchema)]
+pub struct ApiAttachmentCommentReference {
+ /// Stored type of the entity the comment belongs to
+ /// (`document`, `initiative`, `crm_company`, `crm_contact`, or `call`).
+ pub parent_entity_type: String,
+ /// Id of the entity the comment belongs to.
+ pub parent_entity_id: String,
+ /// Message that contains the reference.
+ pub message_id: Uuid,
+ /// If the message belongs to a thread this is the parent id.
+ pub thread_id: Option<Uuid>,
+ /// Sender of the message.
+ pub sender_id: String,
+ /// Full message content (might be used for preview/snippet).
+ pub message_content: String,
+ /// When the message itself was created.
+ pub message_created_at: DateTime<Utc>,
+ /// When the mention or attachment row was created.
+ pub attachment_created_at: DateTime<Utc>,
+}
+
+impl From<AttachmentCommentReference> for ApiAttachmentCommentReference {
+ fn from(r: AttachmentCommentReference) -> Self {
+ Self {
+ parent_entity_type: r.parent_entity_type,
+ parent_entity_id: r.parent_entity_id,
+ message_id: r.message_id,
+ thread_id: r.thread_id,
+ sender_id: r.sender_id,
+ message_content: r.message_content,
+ message_created_at: r.message_created_at,
+ attachment_created_at: r.attachment_created_at,
+ }
+ }
+}
+
/// A reference to an attachment entity from a channel message.
#[derive(Debug, Serialize, utoipa::ToSchema)]
pub struct ApiAttachmentChannelReference {
diff --git a/crates/channels/src/inbound/axum_router/test.rs b/crates/channels/src/inbound/axum_router/test.rs
index eee523f461..6881af8279 100644
--- a/crates/channels/src/inbound/axum_router/test.rs
+++ b/crates/channels/src/inbound/axum_router/test.rs
@@ -314,6 +314,18 @@ impl ChannelService for MockService {
attachment_created_at: now,
},
),
+ crate::domain::models::AttachmentEntityReference::Comment(
+ crate::domain::models::AttachmentCommentReference {
+ parent_entity_type: "initiative".to_string(),
+ parent_entity_id: "00000000-0000-0000-0000-0000000000a1".to_string(),
+ message_id: Uuid::new_v4(),
+ thread_id: None,
+ sender_id: "macro|[email protected]".to_string(),
+ message_content: "discussed here".to_string(),
+ message_created_at: now,
+ attachment_created_at: now,
+ },
+ ),
crate::domain::models::AttachmentEntityReference::Generic(
crate::domain::models::AttachmentGenericReference {
source_entity_type: "doc".to_string(),
@@ -1298,12 +1310,19 @@ async fn attachment_references_returns_tagged_references() {
let bytes = res.into_body().collect().await.unwrap().to_bytes();
let json: serde_json::Value = serde_json::from_slice(&bytes).unwrap();
let references = json["references"].as_array().unwrap();
- assert_eq!(references.len(), 2);
+ assert_eq!(references.len(), 3);
assert_eq!(references[0]["reference_type"], "channel");
assert_eq!(references[0]["message_content"], "look at this");
- assert_eq!(references[1]["reference_type"], "generic");
- assert_eq!(references[1]["entity_id"], "doc1");
- assert_eq!(references[1]["source_entity_type"], "doc");
+ assert_eq!(references[1]["reference_type"], "comment");
+ assert_eq!(references[1]["parent_entity_type"], "initiative");
+ assert_eq!(
+ references[1]["parent_entity_id"],
+ "00000000-0000-0000-0000-0000000000a1"
+ );
+ assert_eq!(references[1]["message_content"], "discussed here");
+ assert_eq!(references[2]["reference_type"], "generic");
+ assert_eq!(references[2]["entity_id"], "doc1");
+ assert_eq!(references[2]["source_entity_type"], "doc");
}
// --- Access control tests ---
diff --git a/crates/channels/src/outbound/entity_access_comment_parents.rs b/crates/channels/src/outbound/entity_access_comment_parents.rs
new file mode 100644
index 0000000000..727dc23351
--- /dev/null
+++ b/crates/channels/src/outbound/entity_access_comment_parents.rs
@@ -0,0 +1,78 @@
+//! Authorizes comment references through the commented entity's permissions.
+
+use std::sync::Arc;
+
+use entity_access::domain::{
+ models::{AccessError, AccessLevel, EntityType},
+ ports::EntityAccessService,
+};
+use macro_user_id::user_id::MacroUserIdStr;
+
+use crate::domain::ports::CommentParentAccess;
+
+/// Comment-parent access backed by the entity access service.
+#[derive(Clone)]
+pub struct EntityAccessCommentParents<E> {
+ entity_access_service: Arc<E>,
+}
+
+impl<E> EntityAccessCommentParents<E> {
+ /// Authorize comment parents through `entity_access_service`.
+ pub fn new(entity_access_service: Arc<E>) -> Self {
+ Self {
+ entity_access_service,
+ }
+ }
+}
+
+/// Stored message parent types that carry comments, and the entity whose
+/// permissions govern them.
+fn parent_entity_type(stored: &str) -> Option<EntityType> {
+ Some(match stored {
+ "document" => EntityType::Document,
+ "initiative" => EntityType::Initiative,
+ "crm_company" => EntityType::CrmCompany,
+ "crm_contact" => EntityType::CrmContact,
+ "call" => EntityType::Call,
+ _ => return None,
+ })
+}
+
+#[async_trait::async_trait]
+impl<E: EntityAccessService> CommentParentAccess for EntityAccessCommentParents<E> {
+ #[tracing::instrument(err, skip(self, viewer))]
+ async fn can_view_parent(
+ &self,
+ viewer: &str,
+ parent_entity_type: &str,
+ parent_entity_id: &str,
+ ) -> anyhow::Result<bool> {
+ let Some(entity_type) = self::parent_entity_type(parent_entity_type) else {
+ return Ok(false);
+ };
+ let Ok(viewer) = MacroUserIdStr::try_from(viewer.to_string()) else {
+ return Ok(false);
+ };
+ match self
+ .entity_access_service
+ .check_access(
+ Some(&viewer.0),
+ parent_entity_id,
+ entity_type,
+ AccessLevel::View,
+ )
+ .await
+ {
+ Ok(_) => Ok(true),
+ Err(
+ AccessError::Unauthorized
+ | AccessError::UnauthorizedWithMessage(_)
+ | AccessError::BadRequest(_)
+ | AccessError::NotFound(_),
+ ) => Ok(false),
+ Err(AccessError::Unavailable(report) | AccessError::Internal(report)) => {
+ Err(anyhow::Error::from(report))
+ }
+ }
+ }
+}
diff --git a/crates/channels/src/outbound/mod.rs b/crates/channels/src/outbound/mod.rs
index 61041d9f01..56a8c3d2bf 100644
--- a/crates/channels/src/outbound/mod.rs
+++ b/crates/channels/src/outbound/mod.rs
@@ -4,6 +4,8 @@ pub mod channel_name;
pub mod connection_gateway_realtime;
/// Contacts adapter for channel side effects.
pub mod contacts_dispatcher;
+/// Entity-access adapter authorizing comment references by their parent.
+pub mod entity_access_comment_parents;
/// Notification adapter for channel notification side effects.
pub mod notification_sender;
/// Postgres adapter for channel reference share-permission side effects.
diff --git a/crates/channels/src/outbound/pg_channels_repo.rs b/crates/channels/src/outbound/pg_channels_repo.rs
index 9e9cc088b9..d18d7e58b3 100644
--- a/crates/channels/src/outbound/pg_channels_repo.rs
+++ b/crates/channels/src/outbound/pg_channels_repo.rs
@@ -15,12 +15,12 @@ use crate::domain::ports::ChannelAttachmentRepo;
use crate::domain::ports::{ChannelListRepo, ChannelListUserRepo};
use crate::domain::{
models::{
- Activity, ActivityType, AttachmentChannelReference, AttachmentEntityReference,
- AttachmentGenericReference, BotId, BotSenderProfile, ChannelAttachment,
- ChannelAttachmentType, ChannelInfo, ChannelListItem, ChannelMessage, ChannelMetadata,
- ChannelParticipant, ChannelPreviewRow, ChannelType, ChannelWithParticipants,
- CountedReaction, CreateChannelRequest, CreateEntityMentionOptions, CreatedChannel,
- EntityMention, GetChannelsParams, GetThreadReplyRowsParams, LatestMessage,
+ Activity, ActivityType, AttachmentChannelReference, AttachmentCommentReference,
+ AttachmentEntityReference, AttachmentGenericReference, BotId, BotSenderProfile,
+ ChannelAttachment, ChannelAttachmentType, ChannelInfo, ChannelListItem, ChannelMessage,
+ ChannelMetadata, ChannelParticipant, ChannelPreviewRow, ChannelType,
+ ChannelWithParticipants, CountedReaction, CreateChannelRequest, CreateEntityMentionOptions,
+ CreatedChannel, EntityMention, GetChannelsParams, GetThreadReplyRowsParams, LatestMessage,
MessageAttachment, NameLookup, ParticipantRole, PatchChannelRequest, RecentChannelMessage,
ReferencedShareItemType, ThreadData, ThreadInfo, ThreadReply, ThreadReplyRow,
TopLevelMessageRow, UserName, fallback_user_name,
@@ -1867,9 +1867,53 @@ impl ChannelRepo for PgChannelsRepo {
.context("failed to get generic entity references")
};
- let (attachment_references, mention_references, generic_rows) = tokio::try_join!(
+ // Comments on documents, initiatives, CRM records, and calls: every
+ // parent is returned and the domain service authorizes it, since a
+ // comment's visibility follows its parent rather than channel membership.
+ let comment_references_fut = async {
+ sqlx::query_as!(
+ AttachmentCommentReference,
+ r#"
+ SELECT
+ m.parent_entity_type AS "parent_entity_type!",
+ m.parent_entity_id AS "parent_entity_id!",
+ m.id AS "message_id!: uuid::Uuid",
+ m.thread_id AS "thread_id?: uuid::Uuid",
+ m.sender_id AS "sender_id!",
+ m.content AS "message_content!",
+ m.created_at AS "message_created_at!: chrono::DateTime<chrono::Utc>",
+ r.created_at AS "attachment_created_at!: chrono::DateTime<chrono::Utc>"
+ FROM (
+ -- The CASE keeps non-message source ids out of the uuid cast.
+ SELECT CASE WHEN em.source_entity_type = 'message' THEN em.source_entity_id::uuid END AS message_id,
+ em.created_at
+ FROM comms_entity_mentions em
+ WHERE em.source_entity_type = 'message'
+ AND em.entity_type = ANY($1)
+ AND em.entity_id = $2
+ UNION ALL
+ SELECT a.message_id, a.created_at
+ FROM comms_attachments a
+ WHERE a.entity_type = ANY($1)
+ AND a.entity_id = $2
+ ) r
+ JOIN comms_messages m ON m.id = r.message_id
+ WHERE m.parent_entity_type <> 'channel'
+ AND m.deleted_at IS NULL
+ ORDER BY r.created_at DESC
+ "#,
+ &entity_types,
+ entity_id,
+ )
+ .fetch_all(&self.pool)
+ .await
+ .context("failed to get comment references")
+ };
+
+ let (attachment_references, mention_references, comment_references, generic_rows) = tokio::try_join!(
attachment_references_fut,
mention_references_fut,
+ comment_references_fut,
generic_references_fut,
)?;
@@ -1894,23 +1938,23 @@ impl ChannelRepo for PgChannelsRepo {
.into_iter()
.map(AttachmentEntityReference::Channel),
);
+ references.extend(
+ comment_references
+ .into_iter()
+ .map(AttachmentEntityReference::Comment),
+ );
references.extend(
generic_references
.into_iter()
.map(AttachmentEntityReference::Generic),
);
- references.sort_by(|a, b| {
- let a_time = match a {
- AttachmentEntityReference::Channel(c) => c.attachment_created_at,
- AttachmentEntityReference::Generic(g) => g.created_at,
- };
- let b_time = match b {
- AttachmentEntityReference::Channel(c) => c.attachment_created_at,
- AttachmentEntityReference::Generic(g) => g.created_at,
- };
- b_time.cmp(&a_time)
- });
+ let created_at = |reference: &AttachmentEntityReference| match reference {
+ AttachmentEntityReference::Channel(c) => c.attachment_created_at,
+ AttachmentEntityReference::Comment(c) => c.attachment_created_at,
+ AttachmentEntityReference::Generic(g) => g.created_at,
+ };
+ references.sort_by_key(|reference| std::cmp::Reverse(created_at(reference)));
Ok(references)
}
diff --git a/crates/channels/src/outbound/pg_channels_repo/tests.rs b/crates/channels/src/outbound/pg_channels_repo/tests.rs
index bd4f71c852..71741fa90d 100644
--- a/crates/channels/src/outbound/pg_channels_repo/tests.rs
+++ b/crates/channels/src/outbound/pg_channels_repo/tests.rs
@@ -39,6 +39,9 @@ const REPLY1: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_00000000b001);
const REPLY2: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_00000000b002);
const REPLY3: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_00000000b003);
const DELETED_MSG_ATTACHMENT: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_00000000a004);
+const INITIATIVE_A: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_0000000000a1);
+const COMMENT_ON_INITIATIVE: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_00000000c0a1);
+const COMMENT_ON_DOCUMENT: Uuid = Uuid::from_u128(0x00000000_0000_0000_0000_00000000c0a2);
const USER_A: &str = "macro|[email protected]";
const USER_B: &str = "macro|[email protected]";
const USER_C: &str = "macro|[email protected]";
@@ -2070,10 +2073,9 @@ async fn delete_entity_mention_by_id_returns_none_when_missing(
// --- get_attachment_references ---
//
-// The query is a byte-identical port of comms_db_client::get_attachment_references;
-// these cover the three source paths (direct attachment, message mention, generic
-// mention), participation gating, deleted-message exclusion, and the merged sort —
-// rather than re-porting the full original suite.
+// These cover the four source paths (direct attachment, message mention, comment
+// on a non-channel parent, generic mention), participation gating,
+// deleted-message exclusion, and the merged sort.
fn channel_refs(
refs: &[AttachmentEntityReference],
@@ -2081,7 +2083,7 @@ fn channel_refs(
refs.iter()
.filter_map(|r| match r {
AttachmentEntityReference::Channel(c) => Some(c),
- AttachmentEntityReference::Generic(_) => None,
+ AttachmentEntityReference::Comment(_) | AttachmentEntityReference::Generic(_) => None,
})
.collect()
}
@@ -2335,6 +2337,46 @@ async fn attachment_references_treats_email_alias_as_thread(
Ok(())
}
+#[sqlx::test(
+ fixtures(path = "../../../fixtures", scripts("channels_repo")),
+ migrator = "MACRO_DB_MIGRATIONS"
+)]
+async fn attachment_references_returns_comments_on_every_parent(
+ pool: Pool<Postgres>,
+) -> anyhow::Result<()> {
+ // doc-comment is mentioned in an initiative comment (10:00), attached in a
+ // document comment (11:00), and mentioned in a deleted initiative reply.
+ // Comment rows are not gated by channel participation: the service
+ // authorizes them by parent, so the repo returns them to any viewer.
+ let refs = repo(pool)
+ .get_attachment_references("document", "doc-comment", NON_MEMBER)
+ .await?;
+
+ assert_eq!(refs.len(), 2);
+ let AttachmentEntityReference::Comment(document_comment) = &refs[0] else {
+ anyhow::bail!("expected the newer document comment first");
+ };
+ assert_eq!(document_comment.parent_entity_type, "document");
+ assert_eq!(document_comment.parent_entity_id, "doc-parent");
+ assert_eq!(document_comment.message_id, COMMENT_ON_DOCUMENT);
+ assert_eq!(document_comment.sender_id, USER_B);
+ let AttachmentEntityReference::Comment(initiative_comment) = &refs[1] else {
+ anyhow::bail!("expected the initiative comment second");
+ };
+ assert_eq!(initiative_comment.parent_entity_type, "initiative");
+ assert_eq!(
+ initiative_comment.parent_entity_id,
+ INITIATIVE_A.to_string()
+ );
+ assert_eq!(initiative_comment.message_id, COMMENT_ON_INITIATIVE);
+ assert_eq!(initiative_comment.thread_id, None);
+ assert_eq!(
+ initiative_comment.message_content,
+ "see <m-document-mention>doc-comment</m-document-mention>"
+ );
+ Ok(())
+}
+
#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
async fn bot_profiles_includes_soft_deleted_bots(pool: Pool<Postgres>) -> anyhow::Result<()> {
let active = Uuid::new_v4();
diff --git a/crates/comms_db_client/AGENTS.md b/crates/comms_db_client/AGENTS.md
index 355648cfa3..2fdcbc0ce5 100644
--- a/crates/comms_db_client/AGENTS.md
+++ b/crates/comms_db_client/AGENTS.md
@@ -3,13 +3,13 @@
## What it is
Part of Chat's shared infrastructure: the query layer for channel messages,
-participants, mentions, activity, and attachment references — the shared
-tables behind channel/document conversations.
+participants, mentions, and activity — the shared tables behind
+channel/document conversations.
## Start here
- `src/lib.rs`: module list — one module per table area (`messages`,
- `channels`, `participants`, `entity_mentions`, `activity`, `attachments`).
+ `channels`, `participants`, `entity_mentions`, `activity`).
- `src/model.rs`: the shared row types (`Message`, etc.) returned by queries.
- `src/messages/create_message.rs`: a representative `sqlx::query!` call site.
diff --git a/crates/comms_db_client/src/attachments/get_attachment_references.rs b/crates/comms_db_client/src/attachments/get_attachment_references.rs
deleted file mode 100644
index f0ba2f1f2d..0000000000
--- a/crates/comms_db_client/src/attachments/get_attachment_references.rs
+++ /dev/null
@@ -1,576 +0,0 @@
-/// A reference is a link to one entity from another entity
-///
-/// Currently, there are three types of references:
-/// - Attaching an entity in a channel is a reference [`ChannelReference`]
-/// - Mentioning an entity in a channel is a reference [`ChannelReference`]
-/// - Mentioning an entity in a document is a reference [`GenericReference`]
-use anyhow::{Context, Result};
-use futures::try_join;
-use sqlx::{Pool, Postgres};
-
-/// Representation of a reference from a channel/message
-#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, utoipa::ToSchema)]
-pub struct ChannelReference {
- /// Channel that contains the message
- pub channel_id: uuid::Uuid,
- /// Optional channel name (DMs do not have a name)
- pub channel_name: Option<String>,
- /// Message that contains the attachment reference
- pub message_id: uuid::Uuid,
- /// If the message belongs to a thread this is the parent id
- pub thread_id: Option<uuid::Uuid>,
- /// Sender of the message
- pub sender_id: String,
- /// Full message content (might be used for preview/snippet)
- pub message_content: String,
- /// When the message itself was created
- pub message_created_at: chrono::DateTime<chrono::Utc>,
- /// When the attachment row was created (normally identical to message
- /// creation, but stored separately just in case)
- pub attachment_created_at: chrono::DateTime<chrono::Utc>,
-}
-
-/// Representation of a reference from any entity type
-#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, utoipa::ToSchema)]
-pub struct GenericReference {
- /// Type of the source entity (e.g., "document", "chat", etc.)
- pub source_entity_type: String,
- /// ID of the source entity
- pub source_entity_id: String,
- /// Type of the referenced entity
- pub entity_type: String,
- /// ID of the referenced entity
- pub entity_id: String,
- /// User who created this reference (optional for non-user sources like channels)
- pub user_id: Option<String>,
- /// When this reference was created
- pub created_at: chrono::DateTime<chrono::Utc>,
- /// Optional metadata specific to the source type
- pub metadata: Option<serde_json::Value>,
-}
-
-#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, utoipa::ToSchema)]
-#[serde(tag = "reference_type", rename_all = "snake_case")]
-pub enum EntityReference {
- /// An entity was referenced from a channel
- Channel(ChannelReference),
- /// An entity was referenced from anything but a channel
- Generic(GenericReference),
-}
-
-#[tracing::instrument(skip(db))]
-pub async fn get_attachment_references(
- db: &Pool<Postgres>,
- entity_type: &str,
- entity_id: &str,
- user_id: &str,
-) -> Result<Vec<EntityReference>> {
- let (attachment_references, mention_references, generic_references) = try_join!(
- // Get attachment references
- async {
- sqlx::query_as!(
- ChannelReference,
- r#"
- SELECT
- m.parent_entity_id::uuid AS "channel_id!: uuid::Uuid",
- c.name AS "channel_name?", -- Option<String>
- a.message_id AS "message_id: uuid::Uuid",
- m.thread_id AS "thread_id?: uuid::Uuid",
- m.sender_id AS "sender_id!", -- String
- m.content AS "message_content!", -- String
- m.created_at AS "message_created_at!: chrono::DateTime<chrono::Utc>",
- a.created_at AS "attachment_created_at!: chrono::DateTime<chrono::Utc>"
- FROM comms_attachments a
- JOIN comms_messages m ON a.message_id = m.id
- JOIN comms_channels c ON m.parent_entity_type = 'channel' AND m.parent_entity_id = c.id::text
- JOIN comms_channel_participants cp ON cp.channel_id = c.id
- WHERE a.entity_type = $1
- AND a.entity_id = $2
- AND cp.user_id = $3
- AND cp.left_at IS NULL
- AND m.deleted_at IS NULL
- ORDER BY a.created_at DESC
- "#,
- entity_type,
- entity_id,
- user_id,
- )
- .fetch_all(db)
- .await
- .context("failed to get attachment references")
- },
- // Get mention references from messages
- async {
- sqlx::query_as!(
- ChannelReference,
- r#"
- SELECT
- m.parent_entity_id::uuid AS "channel_id!: uuid::Uuid",
- c.name AS "channel_name?", -- Option<String>
- m.id AS "message_id: uuid::Uuid",
- m.thread_id AS "thread_id?: uuid::Uuid",
- m.sender_id AS "sender_id!", -- String
- m.content AS "message_content!", -- String
- m.created_at AS "message_created_at!: chrono::DateTime<chrono::Utc>",
- em.created_at AS "attachment_created_at!: chrono::DateTime<chrono::Utc>"
- FROM comms_entity_mentions em
- JOIN comms_messages m ON (em.source_entity_id = m.id::text AND em.source_entity_type = 'message')
- JOIN comms_channels c ON m.parent_entity_type = 'channel' AND m.parent_entity_id = c.id::text
- JOIN comms_channel_participants cp ON cp.channel_id = c.id
- WHERE em.entity_type = $1
- AND em.entity_id = $2
- AND cp.user_id = $3
- AND cp.left_at IS NULL
- AND m.deleted_at IS NULL
- ORDER BY em.created_at DESC
- "#,
- entity_type,
- entity_id,
- user_id,
- )
- .fetch_all(db)
- .await
- .context("failed to get mention references")
- },
- // Get generic entity mentions (non-message sources)
- async {
- sqlx::query!(
- r#"
- SELECT
- em.source_entity_type,
- em.source_entity_id,
- em.entity_type,
- em.entity_id,
- em.user_id,
- em.created_at
- FROM comms_entity_mentions em
- WHERE em.entity_type = $1
- AND em.entity_id = $2
- AND em.source_entity_type != 'message'
- ORDER BY em.created_at DESC
- "#,
- entity_type,
- entity_id,
- )
- .fetch_all(db)
- .await
- .context("failed to get generic entity references")
- .map(|rows| {
- rows.into_iter()
- .map(|row| GenericReference {
- source_entity_type: row.source_entity_type,
- source_entity_id: row.source_entity_id,
- entity_type: row.entity_type,
- entity_id: row.entity_id,
- user_id: row.user_id,
- created_at: row.created_at,
- metadata: None,
- })
- .collect::<Vec<_>>()
- })
- }
- )?;
-
- let mut references: Vec<EntityReference> = attachment_references
- .into_iter()
- .map(EntityReference::Channel)
- .collect();
-
- references.extend(mention_references.into_iter().map(EntityReference::Channel));
-
- references.extend(generic_references.into_iter().map(EntityReference::Generic));
-
- references.sort_by(|a, b| {
- let a_time = match a {
- EntityReference::Channel(c) => c.attachment_created_at,
- EntityReference::Generic(g) => g.created_at,
- };
- let b_time = match b {
- EntityReference::Channel(c) => c.attachment_created_at,
- EntityReference::Generic(g) => g.created_at,
- };
- b_time.cmp(&a_time)
- });
-
- Ok(references)
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use macro_db_migrator::MACRO_DB_MIGRATIONS;
-
- // Helper function to extract channel references from entity references for testing
- fn extract_channel_refs(refs: Vec<EntityReference>) -> Vec<ChannelReference> {
- refs.into_iter()
- .filter_map(|r| match r {
- EntityReference::Channel(c) => Some(c),
- _ => None,
- })
- .collect()
- }
-
- // Helper function to extract generic references from entity references for testing
- fn extract_generic_refs(refs: Vec<EntityReference>) -> Vec<GenericReference> {
- refs.into_iter()
- .filter_map(|r| match r {
- EntityReference::Generic(g) => Some(g),
- _ => None,
- })
- .collect()
- }
-
- // user1 owns "private 1" and there is a single doc1 attachment
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_private_channel_access(pool: Pool<Postgres>) {
- const _: &sqlx::migrate::Migrator = &MACRO_DB_MIGRATIONS; // Dummy reference for IDE
- let refs = get_attachment_references(&pool, "doc", "doc1", "user1")
- .await
- .unwrap();
- assert_eq!(refs.len(), 1);
-
- let channel_refs = extract_channel_refs(refs);
- assert_eq!(channel_refs.len(), 1);
- assert_eq!(channel_refs[0].channel_name, Some("private 1".into()));
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_no_access(pool: Pool<Postgres>) {
- // user4 is not a participant in channel 1111
- let refs = get_attachment_references(&pool, "doc", "doc1", "user4")
- .await
- .unwrap();
- assert!(refs.is_empty());
- }
-
- // deleted_doc lives in a channel where user2 has no membership
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_deleted_message(pool: Pool<Postgres>) {
- let refs = get_attachment_references(&pool, "doc", "deleted_doc", "user2")
- .await
- .unwrap();
- assert!(refs.is_empty());
- }
-
- // thread_doc is in the public channel; only user5 is a participant there
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_thread_message(pool: Pool<Postgres>) {
- let refs = get_attachment_references(&pool, "doc", "thread_doc", "user5")
- .await
- .unwrap();
- assert_eq!(refs.len(), 1);
-
- let channel_refs = extract_channel_refs(refs);
- assert_eq!(channel_refs.len(), 1);
- assert_eq!(channel_refs[0].thread_id, None);
- }
-
- // leftuser_doc exists, but user7 is no longer in the channel
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_left_channel(pool: Pool<Postgres>) {
- let refs = get_attachment_references(&pool, "doc", "leftuser_doc", "user7")
- .await
- .unwrap();
- assert!(refs.is_empty());
- }
-
- // public-channel access check for a valid participant (user5)
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_public_channel(pool: Pool<Postgres>) {
- let refs = get_attachment_references(&pool, "doc", "thread_doc", "user5")
- .await
- .unwrap();
- assert_eq!(refs.len(), 1);
-
- let channel_refs = extract_channel_refs(refs);
- assert_eq!(channel_refs.len(), 1);
- assert_eq!(channel_refs[0].channel_name, Some("public channel".into()));
- }
-
- // Test document mentions functionality
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_document_mention_access(pool: Pool<Postgres>) {
- // user1 should see doc_mention1 which is mentioned in their private channel
- let refs = get_attachment_references(&pool, "doc", "doc_mention1", "user1")
- .await
- .unwrap();
- assert_eq!(refs.len(), 1);
-
- let channel_refs = extract_channel_refs(refs);
- assert_eq!(channel_refs.len(), 1);
- assert_eq!(channel_refs[0].channel_name, Some("private 1".into()));
- assert_eq!(channel_refs[0].message_content, "message 2 content");
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_document_mention_public_channel(pool: Pool<Postgres>) {
- // user5 should see doc_mention2 which is mentioned in the public channel
- let refs = get_attachment_references(&pool, "doc", "doc_mention2", "user5")
- .await
- .unwrap();
- assert_eq!(refs.len(), 1);
-
- let channel_refs = extract_channel_refs(refs);
- assert_eq!(channel_refs.len(), 1);
- assert_eq!(channel_refs[0].channel_name, Some("public channel".into()));
- assert_eq!(
- channel_refs[0].message_content,
- "I found another version of that doc"
- );
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_document_mention_org_channel(pool: Pool<Postgres>) {
- // user1 should see doc_mention3 which is mentioned in their org channel
- let refs = get_attachment_references(&pool, "doc", "doc_mention3", "user1")
- .await
- .unwrap();
- assert_eq!(refs.len(), 1);
-
- let channel_refs = extract_channel_refs(refs);
- assert_eq!(channel_refs.len(), 1);
- assert_eq!(channel_refs[0].channel_name, Some("org channel".into()));
- assert_eq!(
- channel_refs[0].message_content,
- "Here are multiple docs to review"
- );
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_document_mention_thread(pool: Pool<Postgres>) {
- // user5 should see doc_mention4 which is mentioned in a thread message
- let refs = get_attachment_references(&pool, "doc", "doc_mention4", "user5")
- .await
- .unwrap();
- assert_eq!(refs.len(), 1);
-
- let channel_refs = extract_channel_refs(refs);
- assert_eq!(channel_refs.len(), 1);
- assert_eq!(channel_refs[0].channel_name, Some("public channel".into()));
- assert_eq!(
- channel_refs[0].message_content,
- "Here are my thoughts on the doc"
- );
- assert_eq!(
- channel_refs[0].thread_id,
- Some(uuid::uuid!("85905168-b64d-492d-bad8-91761c0fd860"))
- );
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_document_mention_no_access(pool: Pool<Postgres>) {
- // user1 should NOT see doc_mention_no_access which is mentioned in user2's private channel
- let refs = get_attachment_references(&pool, "doc", "doc_mention_no_access", "user1")
- .await
- .unwrap();
- assert!(refs.is_empty());
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_document_mention_deleted_message(pool: Pool<Postgres>) {
- // doc_mention_deleted is mentioned in a deleted message, should not appear
- let refs = get_attachment_references(&pool, "doc", "doc_mention_deleted", "user5")
- .await
- .unwrap();
- assert!(refs.is_empty());
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_user_mention_not_returned(pool: Pool<Postgres>) {
- // user123 is mentioned but we're searching for docs, should not return anything
- let refs = get_attachment_references(&pool, "doc", "user123", "user1")
- .await
- .unwrap();
- assert!(refs.is_empty());
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_combined_attachment_and_mention(pool: Pool<Postgres>) {
- // Test a scenario where the same document has both direct attachments and mentions
- // First add a mention for an existing attached document
- sqlx::query!(
- "INSERT INTO comms_entity_mentions (id, source_entity_type, source_entity_id, entity_type, entity_id, user_id) VALUES (gen_random_uuid(), 'message', $1, 'doc', 'doc1', NULL)",
- uuid::uuid!("3f91f184-7803-44e2-9a43-7c027b23ff03").to_string()
- )
- .execute(&pool)
- .await
- .unwrap();
-
- let refs = get_attachment_references(&pool, "doc", "doc1", "user1")
- .await
- .unwrap();
-
- // Should get 2 references: 1 from attachment, 1 from mention
- assert_eq!(refs.len(), 2);
-
- let channel_refs = extract_channel_refs(refs);
- assert_eq!(channel_refs.len(), 2);
-
- // Both should be in the same channel (private 1)
- assert!(
- channel_refs
- .iter()
- .all(|r| r.channel_name == Some("private 1".into()))
- );
-
- // Should have different message contents
- let contents: Vec<&str> = channel_refs
- .iter()
- .map(|r| r.message_content.as_str())
- .collect();
- assert!(contents.contains(&"message 1 content"));
- assert!(contents.contains(&"message 2 content"));
- }
-
- // Test generic entity mention functionality
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_generic_doc_mention(pool: Pool<Postgres>) {
- // Test doc_generic1 which is mentioned by doc_source1
- let refs = get_attachment_references(&pool, "doc", "doc_generic1", "user1")
- .await
- .unwrap();
- assert_eq!(refs.len(), 1);
-
- let generic_refs = extract_generic_refs(refs);
- assert_eq!(generic_refs.len(), 1);
- assert_eq!(generic_refs[0].source_entity_type, "doc");
- assert_eq!(generic_refs[0].source_entity_id, "doc_source1");
- assert_eq!(generic_refs[0].entity_type, "doc");
- assert_eq!(generic_refs[0].entity_id, "doc_generic1");
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_generic_user_mention(pool: Pool<Postgres>) {
- // Test doc_generic2 which is mentioned by user_source1
- let refs = get_attachment_references(&pool, "doc", "doc_generic2", "user5")
- .await
- .unwrap();
- assert_eq!(refs.len(), 1);
-
- let generic_refs = extract_generic_refs(refs);
- assert_eq!(generic_refs.len(), 1);
- assert_eq!(generic_refs[0].source_entity_type, "user");
- assert_eq!(generic_refs[0].source_entity_id, "user_source1");
- assert_eq!(generic_refs[0].entity_type, "doc");
- assert_eq!(generic_refs[0].entity_id, "doc_generic2");
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_generic_chat_mention(pool: Pool<Postgres>) {
- // Test doc_generic3 which is mentioned by chat_source1
- let refs = get_attachment_references(&pool, "doc", "doc_generic3", "user2")
- .await
- .unwrap();
- assert_eq!(refs.len(), 1);
-
- let generic_refs = extract_generic_refs(refs);
- assert_eq!(generic_refs.len(), 1);
- assert_eq!(generic_refs[0].source_entity_type, "chat");
- assert_eq!(generic_refs[0].source_entity_id, "chat_source1");
- assert_eq!(generic_refs[0].entity_type, "doc");
- assert_eq!(generic_refs[0].entity_id, "doc_generic3");
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_generic_project_mention(pool: Pool<Postgres>) {
- // Test doc_generic4 which is mentioned by project_source1
- let refs = get_attachment_references(&pool, "doc", "doc_generic4", "user3")
- .await
- .unwrap();
- assert_eq!(refs.len(), 1);
-
- let generic_refs = extract_generic_refs(refs);
- assert_eq!(generic_refs.len(), 1);
- assert_eq!(generic_refs[0].source_entity_type, "project");
- assert_eq!(generic_refs[0].source_entity_id, "project_source1");
- assert_eq!(generic_refs[0].entity_type, "doc");
- assert_eq!(generic_refs[0].entity_id, "doc_generic4");
- }
-
- #[sqlx::test(
- migrator = "MACRO_DB_MIGRATIONS",
- fixtures(path = "../../fixtures", scripts("attachments"))
- )]
- async fn test_get_attachment_references_mixed_channel_and_generic(pool: Pool<Postgres>) {
- // Test a document that has both channel references and generic references
- // First add a generic mention for an existing document that also has channel references
- sqlx::query!(
- "INSERT INTO comms_entity_mentions (id, source_entity_type, source_entity_id, entity_type, entity_id, user_id) VALUES (gen_random_uuid(), 'doc', 'doc_source_mixed', 'doc', 'doc1', NULL)"
- )
- .execute(&pool)
- .await
- .unwrap();
-
- let refs = get_attachment_references(&pool, "doc", "doc1", "user1")
- .await
- .unwrap();
-
- // Should get references from both channels and generic sources
- assert!(refs.len() >= 2); // At least the attachment + generic mention
-
- let channel_refs = extract_channel_refs(refs.clone());
- let generic_refs = extract_generic_refs(refs);
-
- // Should have at least one channel reference (from attachment)
- assert!(!channel_refs.is_empty());
-
- // Should have at least one generic reference
- assert!(!generic_refs.is_empty());
- assert_eq!(generic_refs[0].source_entity_type, "doc");
- assert_eq!(generic_refs[0].source_entity_id, "doc_source_mixed");
- }
-}
diff --git a/crates/comms_db_client/src/attachments/mod.rs b/crates/comms_db_client/src/attachments/mod.rs
deleted file mode 100644
index 8bb77ca8be..0000000000
--- a/crates/comms_db_client/src/attachments/mod.rs
+++ /dev/null
@@ -1 +0,0 @@
-pub mod get_attachment_references;
diff --git a/crates/comms_db_client/src/lib.rs b/crates/comms_db_client/src/lib.rs
index a9e4232dec..0783536379 100644
--- a/crates/comms_db_client/src/lib.rs
+++ b/crates/comms_db_client/src/lib.rs
@@ -1,5 +1,4 @@
pub mod activity;
-pub mod attachments;
pub mod channels;
pub mod entity_mentions;
pub mod messages;
diff --git a/docs/agent-guide/ai-chat.md b/docs/agent-guide/ai-chat.md
index 135ea05c21..465cf89b45 100644
--- a/docs/agent-guide/ai-chat.md
+++ b/docs/agent-guide/ai-chat.md
@@ -1382,9 +1382,12 @@ Details lists Status, Agent, Model, and dates for every session; the Runtime
row appears only for coding runtimes, never for in-memory chat agents.
`References` is the same section documents show: one row per channel message that
`@`-mentioned or shared the session (sender, channel chip, time, and a two-line
-message excerpt) and per document that mentions it (author and document chip).
-Click a row to open that message or document in a split. The section is hidden
-until at least one reference exists, and only lists channels you belong to.
+message excerpt), per comment on a document, project, CRM record, or call that
+mentions it (sender, parent chip, time, excerpt), and per document that mentions
+it (author and document chip). Click a row to open that message, comment, or
+document in a split; a comment row opens its parent at the comment. The section
+is hidden until at least one reference exists, lists channels you belong to, and
+lists comments only on parents you can view.
New conversation pages have no disabled session action buttons. Older chats
also have one header row, and empty chats show a simple conversation prompt
instead of the standalone recent-sessions and tips surface.
diff --git a/docs/design/crm-references-scope.md b/docs/design/crm-references-scope.md
index 0c5626da00..0151f4cca7 100644
--- a/docs/design/crm-references-scope.md
+++ b/docs/design/crm-references-scope.md
@@ -40,7 +40,7 @@ for the task's property/reference union.
| Files and Calls | `features/crm/queries/record-items.ts` matches the current record's one system property; Files also includes email attachments. There is no company-contact expansion or incoming-reference predicate. |
| Tasks | `features/crm/record-tasks-adapter.tsx` passes a single `TaskReferenceScope`. `features/tasks-view/queries/use-tasks-query.ts` filters fetched, local-search, continuation, and optimistic rows through property-only membership. A server-only fix would still lose mention-only tasks. `task-query.ts` and `task-search.ts` also encode the single property constraint. |
| References UI | `lib/core/component/References.tsx` reads an unpaginated attachment-reference endpoint. Its generic-reference navigation only opens documents. It cannot represent the complete associated-item contract as-is. |
-| Existing reference reads | `crates/channels/src/outbound/pg_channels_repo.rs::get_attachment_references` reads `comms_attachments` and `comms_entity_mentions`. Channel rows check active membership and deleted messages. The generic-source SQL has no viewer/source ACL predicate; the service currently forwards its results. Do not expose that raw result as an authorized CRM feed. |
+| Existing reference reads | `crates/channels/src/outbound/pg_channels_repo.rs::get_attachment_references` reads `comms_attachments` and `comms_entity_mentions`. Channel rows check active membership and deleted messages; comment rows (messages on documents, initiatives, CRM records, and calls) are authorized per parent in the domain service through `CommentParentAccess`. The generic-source SQL has no viewer/source ACL predicate; the service forwards those results. Do not expose that raw result as an authorized CRM feed. |
| CRM mention vocabulary | `packages/lexical-core/utils/mentions.ts`, the editor mention plugin, and `crates/messages/src/domain/mentions.rs` already recognize `crm_company` and `crm_contact`. The reference lookup passes unknown type strings through, so a blanket claim that the backend cannot accept CRM targets is inaccurate. |
| Document mention recording | In `MentionsMenu/utils/mentionHandlers.ts`, CRM contacts return after inserting a chip without calling `trackMention`; company selection falls through to tracking the target as `document`. These are concrete gaps in this insertion path. The backend document-creation tracker can separately extract canonical CRM types, so audit creation, editing, paste, and removal instead of assuming every path fails identically. |
| Soup architecture | `crates/item_filters/src/ast.rs` has property filters but no cross-entity incoming-reference/CRM-association selector. Soup fans out to other domain services; its SQL is not the only candidate source. Property-based pruning can skip sources that have references but no matching property rows. |
diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/README.md b/packages/sdk-docs/reference/generated/storage/types.gen/README.md
index 6a56a65511..fa25219223 100644
--- a/packages/sdk-docs/reference/generated/storage/types.gen/README.md
+++ b/packages/sdk-docs/reference/generated/storage/types.gen/README.md
@@ -71,6 +71,7 @@
- [Answer](type-aliases/Answer.md)
- [ApiActivity](type-aliases/ApiActivity.md)
- [ApiAttachmentChannelReference](type-aliases/ApiAttachmentChannelReference.md)
+- [ApiAttachmentCommentReference](type-aliases/ApiAttachmentCommentReference.md)
- [ApiAttachmentEntityReference](type-aliases/ApiAttachmentEntityReference.md)
- [ApiAttachmentGenericReference](type-aliases/ApiAttachmentGenericReference.md)
- [ApiChannelAttachment](type-aliases/ApiChannelAttachment.md)
diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiAttachmentCommentReference.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiAttachmentCommentReference.md
new file mode 100644
index 0000000000..b9e74ecb51
--- /dev/null
+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiAttachmentCommentReference.md
@@ -0,0 +1,18 @@
+# Type Alias: ApiAttachmentCommentReference
+
+> **ApiAttachmentCommentReference** = \{ `attachment_created_at`: `string`; `message_content`: `string`; `message_created_at`: `string`; `message_id`: `string`; `parent_entity_id`: `string`; `parent_entity_type`: `string`; `sender_id`: `string`; `thread_id?`: `string` \| `null`; \}
+
+A reference to an attachment entity from a comment on a non-channel entity.
+
+## Properties
+
+| Property | Type | Description |
+| ------ | ------ | ------ |
+| <a id="property-attachment_created_at"></a> `attachment_created_at` | `string` | When the mention or attachment row was created. |
+| <a id="property-message_content"></a> `message_content` | `string` | Full message content (might be used for preview/snippet). |
+| <a id="property-message_created_at"></a> `message_created_at` | `string` | When the message itself was created. |
+| <a id="property-message_id"></a> `message_id` | `string` | Message that contains the reference. |
+| <a id="property-parent_entity_id"></a> `parent_entity_id` | `string` | Id of the entity the comment belongs to. |
+| <a id="property-parent_entity_type"></a> `parent_entity_type` | `string` | Stored type of the entity the comment belongs to (`document`, `initiative`, `crm_company`, `crm_contact`, or `call`). |
+| <a id="property-sender_id"></a> `sender_id` | `string` | Sender of the message. |
+| <a id="property-thread_id"></a> `thread_id?` | `string` \| `null` | If the message belongs to a thread this is the parent id. |
diff --git a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiAttachmentEntityReference.md b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiAttachmentEntityReference.md
index d8c90c1dd0..efe4f433ef 100644
--- a/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiAttachmentEntityReference.md
+++ b/packages/sdk-docs/reference/generated/storage/types.gen/type-aliases/ApiAttachmentEntityReference.md
@@ -1,5 +1,5 @@
# Type Alias: ApiAttachmentEntityReference
-> **ApiAttachmentEntityReference** = [`ApiAttachmentChannelReference`](ApiAttachmentChannelReference.md) & \{ `reference_type`: `"channel"`; \} \| [`ApiAttachmentGenericReference`](ApiAttachmentGenericReference.md) & \{ `reference_type`: `"generic"`; \}
+> **ApiAttachmentEntityReference** = [`ApiAttachmentChannelReference`](ApiAttachmentChannelReference.md) & \{ `reference_type`: `"channel"`; \} \| [`ApiAttachmentCommentReference`](ApiAttachmentCommentReference.md) & \{ `reference_type`: `"comment"`; \} \| [`ApiAttachmentGenericReference`](ApiAttachmentGenericReference.md) & \{ `reference_type`: `"generic"`; \}
An attachment reference, tagged by source kind.
diff --git a/packages/sdk/generated/storage/index.ts b/packages/sdk/generated/storage/index.ts
index b1ca644505..edf291720d 100644
--- a/packages/sdk/generated/storage/index.ts
+++ b/packages/sdk/generated/storage/index.ts
@@ -1,4 +1,4 @@
// This file is auto-generated by @hey-api/openapi-ts
export { type Options, Sdk } from './sdk.gen';
-export type { AccessiblePipeline, AccessLevel, AccessRequest, AccessRequestsCancelData, AccessRequestsCancelErrors, AccessRequestsCancelResponses, AccessRequestsDirectData, AccessRequestsDirectErrors, AccessRequestsDirectResponse, AccessRequestsDirectResponses, AccessRequestsRemoveDirectData, AccessRequestsRemoveDirectErrors, AccessRequestsRemoveDirectResponses, AccessRequestsResolveData, AccessRequestsResolveErrors, AccessRequestsResolveResponse, AccessRequestsResolveResponses, AccessRequestsSetDirectData, AccessRequestsSetDirectErrors, AccessRequestsSetDirectResponses, AccessRequestsStateData, AccessRequestsStateErrors, AccessRequestsStateResponse, AccessRequestsStateResponses, AccessRequestsSubmitData, AccessRequestsSubmitErrors, AccessRequestsSubmitResponse, AccessRequestsSubmitResponses, AccessRequestState, ActiveCallsResponse, ActiveCallSummary, ActiveMeeting, ActiveMeetingsResponse, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentActionId, AgentChannelScope, AgentDmProfile, AgentMcpServer, AgentMcpServers, AgentPullRequestState, AgentSessionFilters, AgentSessionLifecycleEvent, AgentTyping, AgentTypingPhase, Anchor, AnchorId, AnchorResponse, AnnotationIncrementalUpdate, Answer, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelParticipant, ApiChannelWithLatest, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, AppliedOps, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponse, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsError, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponse, ApplyDatabaseOpsResponses, ApplyOpsRequest, ApplyOpsResponse, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AttachmentChange, AttendeeResponseStatus, Audience, Awareness, AwarenessRelay, BasicDocument, BasicDocumentSubType, BomPart, BookingTarget, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotOwnerProfile, BotSenderProfile, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarEventSourceContent, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallProvider, CallRecord, CallRecordGuest, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordSource, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponse, CancelSlackImportResponses, CardPosition, CastVerdict, CellValue, CellWrite, ChangedFileDto, ChangesetDto, ChangesetSourceDto, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelFilters, ChannelJoinCodeResponse, ChannelLabel, ChannelLabelRule, ChannelLabelsList, ChannelMessage, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPictureChangedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollaborateFormData, CollaborateFormError, CollaborateFormErrors, CollaborateFormResponse, CollaborateFormResponses, CollabSurfaceResponse, CollabSurfaceTokenResponse, Column, ColumnCast, ColumnChange, ColumnChangeKind, ColumnConfig, ColumnConversion, ColumnConversionRequest, ColumnDetail, ColumnId, ColumnKind, ColumnProtection, ColumnResult, CommandFailure, CommandRejectedMetadata, CommittedChange, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponse, CompleteSlackImportUploadsResponses, CompleteUploads, ConferenceProvider, Conjunction, ConversationId, ConversationKind, ConversationMetadata, ConversationProgress, ConversationSeal, ConversationStatus, ConvertDatabaseColumnData, ConvertDatabaseColumnError, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponse, ConvertDatabaseColumnResponses, ConvertedCell, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CountedReaction, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelError, CreateChannelLabelErrors, CreateChannelLabelRequest, CreateChannelLabelResponse, CreateChannelLabelResponses, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponse, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseError, CreateDatabaseErrors, CreateDatabaseRequest, CreateDatabaseResponse, CreateDatabaseResponses, CreateDatabaseWebhookData, CreateDatabaseWebhookError, CreateDatabaseWebhookErrors, CreateDatabaseWebhookRequest, CreateDatabaseWebhookResponse, CreateDatabaseWebhookResponses, CreatedDatabaseWebhookResponse, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateForm, CreateFormData, CreateFormError, CreateFormErrors, CreateFormResponse, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateImport, CreateInitiativeData, CreateInitiativeError, CreateInitiativeErrors, CreateInitiativeRequest, CreateInitiativeResponse, CreateInitiativeResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateMeetingRequest, CreatePairingRequest, CreatePipeline, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponse, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateToken, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmAssociation, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmStageInput, CrmStageResponse, CrmStagesResponse, CrmTeamSettingsResponse, CustomSpeakerAssignment, Database, DatabaseDetail, DatabaseId, DatabaseOp, DatabaseQueryRequest, DatabaseView, DatabaseWebhookDeliveryResponse, DatabaseWebhookPayloadProblem, DatabaseWebhookResponse, DataType, DateOperator, DeclineCallData, DeclineCallError, DeclineCallErrors, DeclineCallResponse, DeclineCallResponses, DeclineRingData, DeclineRingError, DeclineRingErrors, DeclineRingResponse, DeclineRingResponses, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelError, DeleteChannelLabelErrors, DeleteChannelLabelResponse, DeleteChannelLabelResponses, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteDatabaseWebhookData, DeleteDatabaseWebhookError, DeleteDatabaseWebhookErrors, DeleteDatabaseWebhookResponse, DeleteDatabaseWebhookResponses, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeError, DeleteInitiativeErrors, DeleteInitiativeResponse, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessError, DeleteSelfHarnessErrors, DeleteSelfHarnessResponse, DeleteSelfHarnessResponses, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DeliverDatabaseWebhookData, DeliverDatabaseWebhookError, DeliverDatabaseWebhookErrors, DeliverDatabaseWebhookResponse, DeliverDatabaseWebhookResponses, DirectAccess, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentId, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentSyncEditor, DocumentTeamShareResponse, DocumentTextContent, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditMyFormResponseData, EditMyFormResponseError, EditMyFormResponseErrors, EditMyFormResponseResponse, EditMyFormResponseResponses, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmailFollowup, EmailFollowupCommand, EmailFollowupResponse, EmailReminderCondition, EmailReminderPage, EmailReminderSummary, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponse, EnsureStarterHandlerResponses, EntityFilters, EntityKind, EntityMessageCreateData, EntityMessageCreateResponse, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponse, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponse, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponse, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponse, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponse, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponse, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponse, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponse, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponse, EntityMessageTypingResponses, EntityPermission, EntityPermissionResponse, EntityRef, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileChangeKindDto, FileSystemNodeWithIds, FileType, FileTypeUpdate, FilterCondition, FilterGroup, FilterNode, FilterTest, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponse, FinalizeSlackImportResponses, FolderItem, FollowupState, ForeignEntity, ForeignEntityFilters, Form, FormAccess, FormCollaboration, FormDetail, FormErrorCode, FormErrorResponse, FormLayout, FormPublicationProblem, FormQuestionDetail, FormResponse, FormSection, FormSectionDetail, FormSource, FormStatus, FormTally, Formula, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesError, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponse, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmPipelineData, GetCrmPipelinePermissionsData, GetCrmPipelinePermissionsResponse, GetCrmPipelinePermissionsResponses, GetCrmPipelineResponse, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponse, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponse, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseError, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsError, GetDatabasePermissionsErrors, GetDatabasePermissionsResponse, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryError, GetDatabaseQueryErrors, GetDatabaseQueryResponse, GetDatabaseQueryResponses, GetDatabaseResponse, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryError, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponse, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesError, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponse, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsError, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponse, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentTextContentData, GetDocumentTextContentErrors, GetDocumentTextContentResponse, GetDocumentTextContentResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupError, GetEmailFollowupErrors, GetEmailFollowupResponse, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceError, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponse, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetFormData, GetFormError, GetFormErrors, GetFormPermissionsData, GetFormPermissionsError, GetFormPermissionsErrors, GetFormPermissionsResponse, GetFormPermissionsResponses, GetFormResponse, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryError, GetFormResponseSummaryErrors, GetFormResponseSummaryResponse, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyError, GetFormTallyErrors, GetFormTallyResponse, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesError, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchError, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponse, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponse, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestError, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsError, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponse, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponse, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksError, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponse, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeError, GetInitiativeErrors, GetInitiativeResponse, GetInitiativeResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseError, GetMyFormResponseErrors, GetMyFormResponseResponse, GetMyFormResponseResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessError, GetSelfHarnessErrors, GetSelfHarnessResponse, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponse, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubLabelFacet, GithubPullRequest, GithubPullRequestChangesPatchResponse, GithubPullRequestChangesResponse, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestFacets, GithubPullRequestLabel, GithubPullRequestReview, GithubPullRequestReviewDecision, GithubPullRequestReviewState, GithubPullRequestsResponse, GithubPullRequestTasks, GithubPullRequestTasksRequest, GithubPullRequestTasksResponse, GithubPullRequestUser, GithubRepositoryFacet, GithubUserFacet, GitRefDto, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, GuestCallChatPostData, GuestCallChatPostErrors, GuestCallChatPostResponse, GuestCallChatPostResponses, GuestCallChatReadData, GuestCallChatReadErrors, GuestCallChatReadResponse, GuestCallChatReadResponses, GuestChatMessage, GuestChatPage, GuestChatPost, GuestId, GuestJoinRequest, GuestPolicy, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HarnessSession, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, ImportCounters, ImportDatabaseTableData, ImportDatabaseTableError, ImportDatabaseTableErrors, ImportDatabaseTableResponse, ImportDatabaseTableResponses, ImportedAuthor, ImportError, ImportLimits, ImportPage, ImportProgress, ImportTable, ImportWarning, InferColumnTypeOutcome, InferColumnTypeRequest, InferDatabaseColumnTypeData, InferDatabaseColumnTypeError, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponse, InferDatabaseColumnTypeResponses, InFlightTurnSummary, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InitialPropertyValue, InitiativeDetail, InitiativeFilters, InitiativeId, InitiativeList, InitiativeSummary, InputReceivedMetadata, InstallSyncData, InstallSyncErrors, InteractionReason, InvalidDatabaseWebhookPayloadResponse, InviteMeetingRequest, InviteMeetingUsersRequest, Item, ItemWithUserAccessLevel, JobId, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JobStatus, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, KeySegment, Lane, LaneKey, LatestMessage, LayoutProblem, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAccessibleFormsData, ListAccessibleFormsError, ListAccessibleFormsErrors, ListAccessibleFormsResponse, ListAccessibleFormsResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsError, ListChannelLabelsErrors, ListChannelLabelsResponse, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponse, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsError, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponse, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListDatabaseWebhooksData, ListDatabaseWebhooksError, ListDatabaseWebhooksErrors, ListDatabaseWebhooksResponse, ListDatabaseWebhooksResponse2, ListDatabaseWebhooksResponses, ListedDatabase, ListedForm, ListEmailRemindersData, ListEmailRemindersError, ListEmailRemindersErrors, ListEmailRemindersResponse, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListFormsData, ListFormsError, ListFormsErrors, ListFormsResponse, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsError, ListHarnessSessionsErrors, ListHarnessSessionsResponse, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesError, ListInitiativesErrors, ListInitiativesResponse, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponse, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponse, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponse, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Meeting, MeetingCancelData, MeetingCancelError, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationError, MeetingCancelPreparationErrors, MeetingCancelPreparationResponse, MeetingCancelPreparationResponses, MeetingCancelResponse, MeetingCancelResponses, MeetingCreateData, MeetingCreateError, MeetingCreateErrors, MeetingCreateResponse, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinError, MeetingGuestJoinErrors, MeetingGuestJoinResponse, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsError, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponse, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteError, MeetingInviteErrors, MeetingInvitePermissions, MeetingInvitePermissionsData, MeetingInvitePermissionsError, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponse, MeetingInvitePermissionsResponses, MeetingInviteResponse, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersError, MeetingInviteUsersErrors, MeetingInviteUsersResponse, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinError, MeetingJoinErrors, MeetingJoinResponse, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveError, MeetingLeaveErrors, MeetingLeaveResponse, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveError, MeetingListActiveErrors, MeetingListActiveResponse, MeetingListActiveResponses, MeetingListData, MeetingListError, MeetingListErrors, MeetingListResponse, MeetingListResponses, MeetingLookupData, MeetingLookupError, MeetingLookupErrors, MeetingLookupResponse, MeetingLookupResponses, MeetingParticipant, MeetingParticipants, MeetingParticipantsData, MeetingParticipantsError, MeetingParticipantsErrors, MeetingParticipantsResponse, MeetingParticipantsResponses, MeetingPreparation, MeetingPrepareData, MeetingPrepareError, MeetingPrepareErrors, MeetingPrepareResponse, MeetingPrepareResponses, MeetingShareData, MeetingShareError, MeetingShareErrors, MeetingShareResponse, MeetingShareResponses, MeetingsResponse, MeetingToken, MeetingUpdateData, MeetingUpdateError, MeetingUpdateErrors, MeetingUpdateResponse, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Message, MessageAttachment, MessageAttachmentCreatedMetadata, MessageAttachmentRemovedMetadata, MessageChange, MessageCursor, MessageDeletedMetadata, MessageDirection, MessageEvent, MessageEventAttachment, MessageListItem, MessageMentionedMetadata, MessagePage, MessageParent, MessagePatch, MessagePatchedMetadata, MessagePostedMetadata, MessageThread, MessageThreadPreview, MessageTimelineData, MessageTimelineEntriesData, MessageTimelineEntriesResponse, MessageTimelineEntriesResponses, MessageTimelineEntry, MessageTimelinePage, MessageTimelineQuery, MessageTimelineResponse, MessageTimelineResponses, MessageTopicEvent, MyResponse, NewAttachment, NewColumn, NewOption, NewThreadAnchor, NewView, NotificationFilters, NotificationState, NumberOperator, OpBatch, Operator, OpRefusalResponse, OpResult, OptionId, OptionRef, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageNotificationPolicy, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, Pipeline, PipelineRecordType, PipelineSharing, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessage, PostMessageNotificationPolicy, PostSoupAstRequest, PostSoupRequest, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresenceOperator, PresignedUrl, PreviewSmartTagData, PreviewSmartTagError, PreviewSmartTagErrors, PreviewSmartTagResponse, PreviewSmartTagResponses, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyDefinitionWithOptions, PropertyFilter, PropertyInput, PropertyOption, PropertyOptionValue, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesError, PutCrmTeamStagesErrors, PutCrmTeamStagesResponse, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutError, PutFormLayoutErrors, PutFormLayoutResponse, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponse, QueryCrmPipelineRowsResponses, QueryDatabasesData, QueryDatabasesError, QueryDatabasesErrors, QueryDatabasesResponse, QueryDatabasesResponses, QueryDefinition, QuestionLayout, QuestionOption, QuestionTally, ReactionInput, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponse, RegisterSlackImportUploadsResponses, RegisterUploads, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelError, RenameChannelLabelErrors, RenameChannelLabelRequest, RenameChannelLabelResponse, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponse, RenameCrmPipelineResponses, RenamePipeline, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ReplaceCrmStagesRequest, RequestAccess, RequestedHarnessScope, RequestedLayout, RequestStatus, ResetCrmTeamStagesData, ResetCrmTeamStagesError, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponse, ResetCrmTeamStagesResponses, ResolveRequest, ResponseStatus, ResponseSummary, ResultColumn, ResultSet, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, RowChange, RowChangeKind, RowChanges, RowHistoryEntry, RowHistoryResponse, RowId, RowsChange, RowsResult, S3ObjectInfo, SaveBomPart, SaveDatabaseQueryData, SaveDatabaseQueryError, SaveDatabaseQueryErrors, SaveDatabaseQueryResponse, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SavedQuery, SaveQueryRequest, SearchContactsData, SearchContactsError, SearchContactsErrors, SearchContactsResponse, SearchContactsResponse2, SearchContactsResponses, SearchState, SectionCount, SessionDeletedMetadata, SessionIdentity, SessionMentionedMetadata, SessionOpenedMetadata, SessionRenamedMetadata, SessionSettledMetadata, SessionStoppedMetadata, SetChannelLabelData, SetChannelLabelError, SetChannelLabelErrors, SetChannelLabelRequest, SetChannelLabelResponse, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureError, SetChannelPictureErrors, SetChannelPictureRequest, SetChannelPictureResponse, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDirectAccess, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupError, SetEmailFollowupErrors, SetEmailFollowupResponse, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetOperator, SetPropertyValue, Sha256Digest, ShareCrmPipelineData, ShareCrmPipelineResponse, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessError, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponse, ShareDatabaseAwarenessResponses, SharedEmailFilter, ShareEntity, ShareEntityType, SharePermissionV2, SharePipeline, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SkippedCell, SlackCompleteRequest, SlackCreateRequest, SlackRegisterRequest, SlackTimestamp, SlackUserId, SmartTagChannelMatch, SmartTagPreview, SortDirection, SortKey, SoupAgentSessionSoupPropertiesField, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordGuest, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmContactSoupPropertiesField, SoupCrmDomain, SoupDatabaseRowSoupPropertiesField, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupInitiativeSoupPropertiesField, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupThreadInfo, SoupThreadReply, SourceBinding, SourceId, SourceIdentity, SqlCell, SqlEntityKind, SqlOutcome, SqlOutcomeKind, SqlSelectOption, SqlStatement, StarterDatabase, StarterDocumentsResponse, StorageRow, StorageRows, StorageRowsQuery, StoredGithubPullRequest, StreamEventsData, StreamEventsError, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, String, Submission, SubmissionOutcome, SubmitFormResponseData, SubmitFormResponseError, SubmitFormResponseErrors, SubmitFormResponseResponse, SubmitFormResponseResponses, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, Table, TableChange, TableChanged, TableChanges, TableDetail, TableId, TableResult, TableVersion, TagFilterMode, TakenId, TallyBucket, TallyValue, TaskFilters, TeamCalendarContent, TeamCalendarCoverage, TeamCalendarDetails, TeamCalendarItem, TeamCalendarMember, TeamCalendarPage, TeamCalendarSharing, TeamOutOfOfficeItem, TeamOutOfOfficeResponse, TeamRole, TextOperator, ThreadAnchor, ThreadOrigin, ThreadPatch, ThreadState, TimelineActivity, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TouchedColumn, TouchedRow, TranscribeDictationData, TranscribeDictationError, TranscribeDictationErrors, TranscribeDictationResponse, TranscribeDictationResponses, TranscribeResponse, TranscriptSegmentRequest, TrashCrmPipelineData, TrashCrmPipelineResponse, TrashCrmPipelineResponses, TrashPipeline, TurnEndedMetadata, TurnStartedMetadata, TurnSummary, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingInput, UndoChangeResponse, UndoDatabaseChangeData, UndoDatabaseChangeError, UndoDatabaseChangeErrors, UndoDatabaseChangeResponse, UndoDatabaseChangeResponses, UndoOutcome, UndoRefusal, UnlockedBooking, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmPipelinePermissionsData, UpdateCrmPipelinePermissionsResponse, UpdateCrmPipelinePermissionsResponses, UpdateCrmTeamSettingsRequest, UpdateDatabasePermissionsData, UpdateDatabasePermissionsError, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponse, UpdateDatabasePermissionsResponses, UpdateForm, UpdateFormData, UpdateFormError, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsError, UpdateFormPermissionsErrors, UpdateFormPermissionsResponse, UpdateFormPermissionsResponses, UpdateFormResponse, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeError, UpdateInitiativeErrors, UpdateInitiativeRequest, UpdateInitiativeResponse, UpdateInitiativeResponses, UpdateMeetingRequest, UpdateOperation, UpdateSharePermissionRequestV2, UploadDescriptor, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UploadGrant, UploadId, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, VersionedTable, View, ViewChange, ViewColumn, ViewerCapabilities, ViewLayout, ViewPatch, ViewPosition, ViewPositionsResponse, ViewQuery, ViewResult, ViewsResponse, WaitingForInputMetadata, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, Widget, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';
+export type { AccessiblePipeline, AccessLevel, AccessRequest, AccessRequestsCancelData, AccessRequestsCancelErrors, AccessRequestsCancelResponses, AccessRequestsDirectData, AccessRequestsDirectErrors, AccessRequestsDirectResponse, AccessRequestsDirectResponses, AccessRequestsRemoveDirectData, AccessRequestsRemoveDirectErrors, AccessRequestsRemoveDirectResponses, AccessRequestsResolveData, AccessRequestsResolveErrors, AccessRequestsResolveResponse, AccessRequestsResolveResponses, AccessRequestsSetDirectData, AccessRequestsSetDirectErrors, AccessRequestsSetDirectResponses, AccessRequestsStateData, AccessRequestsStateErrors, AccessRequestsStateResponse, AccessRequestsStateResponses, AccessRequestsSubmitData, AccessRequestsSubmitErrors, AccessRequestsSubmitResponse, AccessRequestsSubmitResponses, AccessRequestState, ActiveCallsResponse, ActiveCallSummary, ActiveMeeting, ActiveMeetingsResponse, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentActionId, AgentChannelScope, AgentDmProfile, AgentMcpServer, AgentMcpServers, AgentPullRequestState, AgentSessionFilters, AgentSessionLifecycleEvent, AgentTyping, AgentTypingPhase, Anchor, AnchorId, AnchorResponse, AnnotationIncrementalUpdate, Answer, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentCommentReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelParticipant, ApiChannelWithLatest, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, AppliedOps, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponse, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsError, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponse, ApplyDatabaseOpsResponses, ApplyOpsRequest, ApplyOpsResponse, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AttachmentChange, AttendeeResponseStatus, Audience, Awareness, AwarenessRelay, BasicDocument, BasicDocumentSubType, BomPart, BookingTarget, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotOwnerProfile, BotSenderProfile, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarEventSourceContent, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallProvider, CallRecord, CallRecordGuest, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordSource, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponse, CancelSlackImportResponses, CardPosition, CastVerdict, CellValue, CellWrite, ChangedFileDto, ChangesetDto, ChangesetSourceDto, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelFilters, ChannelJoinCodeResponse, ChannelLabel, ChannelLabelRule, ChannelLabelsList, ChannelMessage, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPictureChangedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollaborateFormData, CollaborateFormError, CollaborateFormErrors, CollaborateFormResponse, CollaborateFormResponses, CollabSurfaceResponse, CollabSurfaceTokenResponse, Column, ColumnCast, ColumnChange, ColumnChangeKind, ColumnConfig, ColumnConversion, ColumnConversionRequest, ColumnDetail, ColumnId, ColumnKind, ColumnProtection, ColumnResult, CommandFailure, CommandRejectedMetadata, CommittedChange, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponse, CompleteSlackImportUploadsResponses, CompleteUploads, ConferenceProvider, Conjunction, ConversationId, ConversationKind, ConversationMetadata, ConversationProgress, ConversationSeal, ConversationStatus, ConvertDatabaseColumnData, ConvertDatabaseColumnError, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponse, ConvertDatabaseColumnResponses, ConvertedCell, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CountedReaction, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelError, CreateChannelLabelErrors, CreateChannelLabelRequest, CreateChannelLabelResponse, CreateChannelLabelResponses, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponse, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseError, CreateDatabaseErrors, CreateDatabaseRequest, CreateDatabaseResponse, CreateDatabaseResponses, CreateDatabaseWebhookData, CreateDatabaseWebhookError, CreateDatabaseWebhookErrors, CreateDatabaseWebhookRequest, CreateDatabaseWebhookResponse, CreateDatabaseWebhookResponses, CreatedDatabaseWebhookResponse, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateForm, CreateFormData, CreateFormError, CreateFormErrors, CreateFormResponse, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateImport, CreateInitiativeData, CreateInitiativeError, CreateInitiativeErrors, CreateInitiativeRequest, CreateInitiativeResponse, CreateInitiativeResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateMeetingRequest, CreatePairingRequest, CreatePipeline, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponse, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateToken, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmAssociation, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmStageInput, CrmStageResponse, CrmStagesResponse, CrmTeamSettingsResponse, CustomSpeakerAssignment, Database, DatabaseDetail, DatabaseId, DatabaseOp, DatabaseQueryRequest, DatabaseView, DatabaseWebhookDeliveryResponse, DatabaseWebhookPayloadProblem, DatabaseWebhookResponse, DataType, DateOperator, DeclineCallData, DeclineCallError, DeclineCallErrors, DeclineCallResponse, DeclineCallResponses, DeclineRingData, DeclineRingError, DeclineRingErrors, DeclineRingResponse, DeclineRingResponses, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelError, DeleteChannelLabelErrors, DeleteChannelLabelResponse, DeleteChannelLabelResponses, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteDatabaseWebhookData, DeleteDatabaseWebhookError, DeleteDatabaseWebhookErrors, DeleteDatabaseWebhookResponse, DeleteDatabaseWebhookResponses, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeError, DeleteInitiativeErrors, DeleteInitiativeResponse, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessError, DeleteSelfHarnessErrors, DeleteSelfHarnessResponse, DeleteSelfHarnessResponses, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DeliverDatabaseWebhookData, DeliverDatabaseWebhookError, DeliverDatabaseWebhookErrors, DeliverDatabaseWebhookResponse, DeliverDatabaseWebhookResponses, DirectAccess, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentId, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentSyncEditor, DocumentTeamShareResponse, DocumentTextContent, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditMyFormResponseData, EditMyFormResponseError, EditMyFormResponseErrors, EditMyFormResponseResponse, EditMyFormResponseResponses, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmailFollowup, EmailFollowupCommand, EmailFollowupResponse, EmailReminderCondition, EmailReminderPage, EmailReminderSummary, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponse, EnsureStarterHandlerResponses, EntityFilters, EntityKind, EntityMessageCreateData, EntityMessageCreateResponse, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponse, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponse, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponse, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponse, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponse, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponse, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponse, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponse, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponse, EntityMessageTypingResponses, EntityPermission, EntityPermissionResponse, EntityRef, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileChangeKindDto, FileSystemNodeWithIds, FileType, FileTypeUpdate, FilterCondition, FilterGroup, FilterNode, FilterTest, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponse, FinalizeSlackImportResponses, FolderItem, FollowupState, ForeignEntity, ForeignEntityFilters, Form, FormAccess, FormCollaboration, FormDetail, FormErrorCode, FormErrorResponse, FormLayout, FormPublicationProblem, FormQuestionDetail, FormResponse, FormSection, FormSectionDetail, FormSource, FormStatus, FormTally, Formula, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesError, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponse, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmPipelineData, GetCrmPipelinePermissionsData, GetCrmPipelinePermissionsResponse, GetCrmPipelinePermissionsResponses, GetCrmPipelineResponse, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponse, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponse, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseError, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsError, GetDatabasePermissionsErrors, GetDatabasePermissionsResponse, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryError, GetDatabaseQueryErrors, GetDatabaseQueryResponse, GetDatabaseQueryResponses, GetDatabaseResponse, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryError, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponse, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesError, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponse, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsError, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponse, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentTextContentData, GetDocumentTextContentErrors, GetDocumentTextContentResponse, GetDocumentTextContentResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupError, GetEmailFollowupErrors, GetEmailFollowupResponse, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceError, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponse, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetFormData, GetFormError, GetFormErrors, GetFormPermissionsData, GetFormPermissionsError, GetFormPermissionsErrors, GetFormPermissionsResponse, GetFormPermissionsResponses, GetFormResponse, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryError, GetFormResponseSummaryErrors, GetFormResponseSummaryResponse, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyError, GetFormTallyErrors, GetFormTallyResponse, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesError, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchError, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponse, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponse, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestError, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsError, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponse, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponse, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksError, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponse, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeError, GetInitiativeErrors, GetInitiativeResponse, GetInitiativeResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseError, GetMyFormResponseErrors, GetMyFormResponseResponse, GetMyFormResponseResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessError, GetSelfHarnessErrors, GetSelfHarnessResponse, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponse, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubLabelFacet, GithubPullRequest, GithubPullRequestChangesPatchResponse, GithubPullRequestChangesResponse, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestFacets, GithubPullRequestLabel, GithubPullRequestReview, GithubPullRequestReviewDecision, GithubPullRequestReviewState, GithubPullRequestsResponse, GithubPullRequestTasks, GithubPullRequestTasksRequest, GithubPullRequestTasksResponse, GithubPullRequestUser, GithubRepositoryFacet, GithubUserFacet, GitRefDto, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, GuestCallChatPostData, GuestCallChatPostErrors, GuestCallChatPostResponse, GuestCallChatPostResponses, GuestCallChatReadData, GuestCallChatReadErrors, GuestCallChatReadResponse, GuestCallChatReadResponses, GuestChatMessage, GuestChatPage, GuestChatPost, GuestId, GuestJoinRequest, GuestPolicy, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HarnessSession, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, ImportCounters, ImportDatabaseTableData, ImportDatabaseTableError, ImportDatabaseTableErrors, ImportDatabaseTableResponse, ImportDatabaseTableResponses, ImportedAuthor, ImportError, ImportLimits, ImportPage, ImportProgress, ImportTable, ImportWarning, InferColumnTypeOutcome, InferColumnTypeRequest, InferDatabaseColumnTypeData, InferDatabaseColumnTypeError, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponse, InferDatabaseColumnTypeResponses, InFlightTurnSummary, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InitialPropertyValue, InitiativeDetail, InitiativeFilters, InitiativeId, InitiativeList, InitiativeSummary, InputReceivedMetadata, InstallSyncData, InstallSyncErrors, InteractionReason, InvalidDatabaseWebhookPayloadResponse, InviteMeetingRequest, InviteMeetingUsersRequest, Item, ItemWithUserAccessLevel, JobId, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JobStatus, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, KeySegment, Lane, LaneKey, LatestMessage, LayoutProblem, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAccessibleFormsData, ListAccessibleFormsError, ListAccessibleFormsErrors, ListAccessibleFormsResponse, ListAccessibleFormsResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsError, ListChannelLabelsErrors, ListChannelLabelsResponse, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponse, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsError, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponse, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListDatabaseWebhooksData, ListDatabaseWebhooksError, ListDatabaseWebhooksErrors, ListDatabaseWebhooksResponse, ListDatabaseWebhooksResponse2, ListDatabaseWebhooksResponses, ListedDatabase, ListedForm, ListEmailRemindersData, ListEmailRemindersError, ListEmailRemindersErrors, ListEmailRemindersResponse, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListFormsData, ListFormsError, ListFormsErrors, ListFormsResponse, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsError, ListHarnessSessionsErrors, ListHarnessSessionsResponse, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesError, ListInitiativesErrors, ListInitiativesResponse, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponse, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponse, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponse, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Meeting, MeetingCancelData, MeetingCancelError, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationError, MeetingCancelPreparationErrors, MeetingCancelPreparationResponse, MeetingCancelPreparationResponses, MeetingCancelResponse, MeetingCancelResponses, MeetingCreateData, MeetingCreateError, MeetingCreateErrors, MeetingCreateResponse, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinError, MeetingGuestJoinErrors, MeetingGuestJoinResponse, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsError, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponse, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteError, MeetingInviteErrors, MeetingInvitePermissions, MeetingInvitePermissionsData, MeetingInvitePermissionsError, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponse, MeetingInvitePermissionsResponses, MeetingInviteResponse, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersError, MeetingInviteUsersErrors, MeetingInviteUsersResponse, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinError, MeetingJoinErrors, MeetingJoinResponse, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveError, MeetingLeaveErrors, MeetingLeaveResponse, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveError, MeetingListActiveErrors, MeetingListActiveResponse, MeetingListActiveResponses, MeetingListData, MeetingListError, MeetingListErrors, MeetingListResponse, MeetingListResponses, MeetingLookupData, MeetingLookupError, MeetingLookupErrors, MeetingLookupResponse, MeetingLookupResponses, MeetingParticipant, MeetingParticipants, MeetingParticipantsData, MeetingParticipantsError, MeetingParticipantsErrors, MeetingParticipantsResponse, MeetingParticipantsResponses, MeetingPreparation, MeetingPrepareData, MeetingPrepareError, MeetingPrepareErrors, MeetingPrepareResponse, MeetingPrepareResponses, MeetingShareData, MeetingShareError, MeetingShareErrors, MeetingShareResponse, MeetingShareResponses, MeetingsResponse, MeetingToken, MeetingUpdateData, MeetingUpdateError, MeetingUpdateErrors, MeetingUpdateResponse, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Message, MessageAttachment, MessageAttachmentCreatedMetadata, MessageAttachmentRemovedMetadata, MessageChange, MessageCursor, MessageDeletedMetadata, MessageDirection, MessageEvent, MessageEventAttachment, MessageListItem, MessageMentionedMetadata, MessagePage, MessageParent, MessagePatch, MessagePatchedMetadata, MessagePostedMetadata, MessageThread, MessageThreadPreview, MessageTimelineData, MessageTimelineEntriesData, MessageTimelineEntriesResponse, MessageTimelineEntriesResponses, MessageTimelineEntry, MessageTimelinePage, MessageTimelineQuery, MessageTimelineResponse, MessageTimelineResponses, MessageTopicEvent, MyResponse, NewAttachment, NewColumn, NewOption, NewThreadAnchor, NewView, NotificationFilters, NotificationState, NumberOperator, OpBatch, Operator, OpRefusalResponse, OpResult, OptionId, OptionRef, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageNotificationPolicy, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, Pipeline, PipelineRecordType, PipelineSharing, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessage, PostMessageNotificationPolicy, PostSoupAstRequest, PostSoupRequest, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresenceOperator, PresignedUrl, PreviewSmartTagData, PreviewSmartTagError, PreviewSmartTagErrors, PreviewSmartTagResponse, PreviewSmartTagResponses, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyDefinitionWithOptions, PropertyFilter, PropertyInput, PropertyOption, PropertyOptionValue, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesError, PutCrmTeamStagesErrors, PutCrmTeamStagesResponse, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutError, PutFormLayoutErrors, PutFormLayoutResponse, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponse, QueryCrmPipelineRowsResponses, QueryDatabasesData, QueryDatabasesError, QueryDatabasesErrors, QueryDatabasesResponse, QueryDatabasesResponses, QueryDefinition, QuestionLayout, QuestionOption, QuestionTally, ReactionInput, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponse, RegisterSlackImportUploadsResponses, RegisterUploads, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelError, RenameChannelLabelErrors, RenameChannelLabelRequest, RenameChannelLabelResponse, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponse, RenameCrmPipelineResponses, RenamePipeline, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ReplaceCrmStagesRequest, RequestAccess, RequestedHarnessScope, RequestedLayout, RequestStatus, ResetCrmTeamStagesData, ResetCrmTeamStagesError, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponse, ResetCrmTeamStagesResponses, ResolveRequest, ResponseStatus, ResponseSummary, ResultColumn, ResultSet, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, RowChange, RowChangeKind, RowChanges, RowHistoryEntry, RowHistoryResponse, RowId, RowsChange, RowsResult, S3ObjectInfo, SaveBomPart, SaveDatabaseQueryData, SaveDatabaseQueryError, SaveDatabaseQueryErrors, SaveDatabaseQueryResponse, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SavedQuery, SaveQueryRequest, SearchContactsData, SearchContactsError, SearchContactsErrors, SearchContactsResponse, SearchContactsResponse2, SearchContactsResponses, SearchState, SectionCount, SessionDeletedMetadata, SessionIdentity, SessionMentionedMetadata, SessionOpenedMetadata, SessionRenamedMetadata, SessionSettledMetadata, SessionStoppedMetadata, SetChannelLabelData, SetChannelLabelError, SetChannelLabelErrors, SetChannelLabelRequest, SetChannelLabelResponse, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureError, SetChannelPictureErrors, SetChannelPictureRequest, SetChannelPictureResponse, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDirectAccess, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupError, SetEmailFollowupErrors, SetEmailFollowupResponse, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetOperator, SetPropertyValue, Sha256Digest, ShareCrmPipelineData, ShareCrmPipelineResponse, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessError, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponse, ShareDatabaseAwarenessResponses, SharedEmailFilter, ShareEntity, ShareEntityType, SharePermissionV2, SharePipeline, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SkippedCell, SlackCompleteRequest, SlackCreateRequest, SlackRegisterRequest, SlackTimestamp, SlackUserId, SmartTagChannelMatch, SmartTagPreview, SortDirection, SortKey, SoupAgentSessionSoupPropertiesField, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordGuest, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmContactSoupPropertiesField, SoupCrmDomain, SoupDatabaseRowSoupPropertiesField, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupInitiativeSoupPropertiesField, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupThreadInfo, SoupThreadReply, SourceBinding, SourceId, SourceIdentity, SqlCell, SqlEntityKind, SqlOutcome, SqlOutcomeKind, SqlSelectOption, SqlStatement, StarterDatabase, StarterDocumentsResponse, StorageRow, StorageRows, StorageRowsQuery, StoredGithubPullRequest, StreamEventsData, StreamEventsError, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, String, Submission, SubmissionOutcome, SubmitFormResponseData, SubmitFormResponseError, SubmitFormResponseErrors, SubmitFormResponseResponse, SubmitFormResponseResponses, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, Table, TableChange, TableChanged, TableChanges, TableDetail, TableId, TableResult, TableVersion, TagFilterMode, TakenId, TallyBucket, TallyValue, TaskFilters, TeamCalendarContent, TeamCalendarCoverage, TeamCalendarDetails, TeamCalendarItem, TeamCalendarMember, TeamCalendarPage, TeamCalendarSharing, TeamOutOfOfficeItem, TeamOutOfOfficeResponse, TeamRole, TextOperator, ThreadAnchor, ThreadOrigin, ThreadPatch, ThreadState, TimelineActivity, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TouchedColumn, TouchedRow, TranscribeDictationData, TranscribeDictationError, TranscribeDictationErrors, TranscribeDictationResponse, TranscribeDictationResponses, TranscribeResponse, TranscriptSegmentRequest, TrashCrmPipelineData, TrashCrmPipelineResponse, TrashCrmPipelineResponses, TrashPipeline, TurnEndedMetadata, TurnStartedMetadata, TurnSummary, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingInput, UndoChangeResponse, UndoDatabaseChangeData, UndoDatabaseChangeError, UndoDatabaseChangeErrors, UndoDatabaseChangeResponse, UndoDatabaseChangeResponses, UndoOutcome, UndoRefusal, UnlockedBooking, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmPipelinePermissionsData, UpdateCrmPipelinePermissionsResponse, UpdateCrmPipelinePermissionsResponses, UpdateCrmTeamSettingsRequest, UpdateDatabasePermissionsData, UpdateDatabasePermissionsError, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponse, UpdateDatabasePermissionsResponses, UpdateForm, UpdateFormData, UpdateFormError, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsError, UpdateFormPermissionsErrors, UpdateFormPermissionsResponse, UpdateFormPermissionsResponses, UpdateFormResponse, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeError, UpdateInitiativeErrors, UpdateInitiativeRequest, UpdateInitiativeResponse, UpdateInitiativeResponses, UpdateMeetingRequest, UpdateOperation, UpdateSharePermissionRequestV2, UploadDescriptor, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UploadGrant, UploadId, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, VersionedTable, View, ViewChange, ViewColumn, ViewerCapabilities, ViewLayout, ViewPatch, ViewPosition, ViewPositionsResponse, ViewQuery, ViewResult, ViewsResponse, WaitingForInputMetadata, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, Widget, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';
diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.ts
index 8a8d8feafa..756c80233f 100644
--- a/packages/sdk/generated/storage/types.gen.ts
+++ b/packages/sdk/generated/storage/types.gen.ts
@@ -555,11 +555,52 @@ export type ApiAttachmentChannelReference = {
thread_id?: string | null;
};
+/**
+ * A reference to an attachment entity from a comment on a non-channel entity.
+ */
+export type ApiAttachmentCommentReference = {
+ /**
+ * When the mention or attachment row was created.
+ */
+ attachment_created_at: string;
+ /**
+ * Full message content (might be used for preview/snippet).
+ */
+ message_content: string;
+ /**
+ * When the message itself was created.
+ */
+ message_created_at: string;
+ /**
+ * Message that contains the reference.
+ */
+ message_id: string;
+ /**
+ * Id of the entity the comment belongs to.
+ */
+ parent_entity_id: string;
+ /**
+ * Stored type of the entity the comment belongs to
+ * (`document`, `initiative`, `crm_company`, `crm_contact`, or `call`).
+ */
+ parent_entity_type: string;
+ /**
+ * Sender of the message.
+ */
+ sender_id: string;
+ /**
+ * If the message belongs to a thread this is the parent id.
+ */
+ thread_id?: string | null;
+};
+
/**
* An attachment reference, tagged by source kind.
*/
export type ApiAttachmentEntityReference = (ApiAttachmentChannelReference & {
reference_type: 'channel';
+}) | (ApiAttachmentCommentReference & {
+ reference_type: 'comment';
}) | (ApiAttachmentGenericReference & {
reference_type: 'generic';
});
diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.json
index 970d02dd66..13bb5f6323 100644
--- a/packages/sdk/specs/storage.json
+++ b/packages/sdk/specs/storage.json
@@ -19481,6 +19481,57 @@
}
}
},
+ "ApiAttachmentCommentReference": {
+ "type": "object",
+ "description": "A reference to an attachment entity from a comment on a non-channel entity.",
+ "required": [
+ "parent_entity_type",
+ "parent_entity_id",
+ "message_id",
+ "sender_id",
+ "message_content",
+ "message_created_at",
+ "attachment_created_at"
+ ],
+ "properties": {
+ "attachment_created_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the mention or attachment row was created."
+ },
+ "message_content": {
+ "type": "string",
+ "description": "Full message content (might be used for preview/snippet)."
+ },
+ "message_created_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "When the message itself was created."
+ },
+ "message_id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Message that contains the reference."
+ },
+ "parent_entity_id": {
+ "type": "string",
+ "description": "Id of the entity the comment belongs to."
+ },
+ "parent_entity_type": {
+ "type": "string",
+ "description": "Stored type of the entity the comment belongs to\n(`document`, `initiative`, `crm_company`, `crm_contact`, or `call`)."
+ },
+ "sender_id": {
+ "type": "string",
+ "description": "Sender of the message."
+ },
+ "thread_id": {
+ "type": ["string", "null"],
+ "format": "uuid",
+ "description": "If the message belongs to a thread this is the parent id."
+ }
+ }
+ },
"ApiAttachmentEntityReference": {
"oneOf": [
{
@@ -19502,6 +19553,25 @@
],
"description": "Referenced from a channel message."
},
+ {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/ApiAttachmentCommentReference",
+ "description": "Referenced from a comment on a document, initiative, CRM record, or call."
+ },
+ {
+ "type": "object",
+ "required": ["reference_type"],
+ "properties": {
+ "reference_type": {
+ "type": "string",
+ "enum": ["comment"]
+ }
+ }
+ }
+ ],
+ "description": "Referenced from a comment on a document, initiative, CRM record, or call."
+ },
{
"allOf": [
{
diff --git a/services/document_storage_service/src/api/swagger.rs b/services/document_storage_service/src/api/swagger.rs
index 60fe5b6a7b..32942d3837 100644
--- a/services/document_storage_service/src/api/swagger.rs
+++ b/services/document_storage_service/src/api/swagger.rs
@@ -64,11 +64,11 @@ use channel_labels::inbound::axum_router::{
CreateChannelLabelRequest, RenameChannelLabelRequest, SetChannelLabelRequest,
};
use channels::inbound::axum_router::{
- ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference,
- ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage,
- ApiChannelDetail, ApiChannelParticipant, ApiParticipantRole, CreateEntityMentionRequest,
- CreateEntityMentionResponse, DeleteEntityMentionResponse, GetAttachmentReferencesResponse,
- PostActivityRequest,
+ ApiActivity, ApiAttachmentChannelReference, ApiAttachmentCommentReference,
+ ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment,
+ ApiChannelAttachmentsPage, ApiChannelDetail, ApiChannelParticipant, ApiParticipantRole,
+ CreateEntityMentionRequest, CreateEntityMentionResponse, DeleteEntityMentionResponse,
+ GetAttachmentReferencesResponse, PostActivityRequest,
};
use collab_surface::domain::models::SurfaceState;
use collab_surface::inbound::axum_router::{
@@ -833,6 +833,7 @@ use utoipa::OpenApi;
GetAttachmentReferencesResponse,
ApiAttachmentEntityReference,
ApiAttachmentChannelReference,
+ ApiAttachmentCommentReference,
ApiAttachmentGenericReference,
channels::domain::models::ChannelType,
channels::domain::models::GetOrCreateAction,
diff --git a/services/document_storage_service/src/server.rs b/services/document_storage_service/src/server.rs
index a1ad04c9e3..1661d4806e 100644
--- a/services/document_storage_service/src/server.rs
+++ b/services/document_storage_service/src/server.rs
@@ -1217,6 +1217,11 @@ pub async fn run() -> anyhow::Result<()> {
outbound::agent_dm_authorizer::BotServiceDmAuthorizer(bots_service.clone()),
SpawnedChannelEventDispatcher::new(channel_side_effects.clone()),
)))
+ .with_comment_parent_access(Arc::new(
+ channels::outbound::entity_access_comment_parents::EntityAccessCommentParents::new(
+ entity_access_service.clone(),
+ ),
+ ))
.with_picture_files(
channels::outbound::static_file_pictures::StaticFileChannelPictures::new(
static_file_service_client::StaticFileServiceClient::new(