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.

fix [properties-frontend] - type check fixes (#459)

Daniel Kweon3efbfa3db50c
diff --git a/js/app/packages/block-chat/definition.ts b/js/app/packages/block-chat/definition.ts
index ff6be2a3a3..e49d767cf7 100644
--- a/js/app/packages/block-chat/definition.ts
+++ b/js/app/packages/block-chat/definition.ts
@@ -50,6 +50,7 @@ export const definition = defineBlock({
createdAt: chat.chat.createdAt,
updatedAt: chat.chat.updatedAt,
fileType: 'chat' as any,
+ isTask: false,
} satisfies DocumentMetadata,
});
}
diff --git a/js/app/packages/core/component/Properties/types.ts b/js/app/packages/core/component/Properties/types.ts
index 6df1d81f34..c11add6a13 100644
--- a/js/app/packages/core/component/Properties/types.ts
+++ b/js/app/packages/core/component/Properties/types.ts
@@ -100,14 +100,7 @@ export type PropertyDefinitionFlat = {
user_id: string;
organization_id: number;
};
- specific_entity_type?:
- | 'CHANNEL'
- | 'CHAT'
- | 'DOCUMENT'
- | 'PROJECT'
- | 'THREAD'
- | 'USER'
- | null;
+ specific_entity_type?: EntityType | null;
updated_at: string;
};
diff --git a/js/app/packages/service-properties/generated/schemas/entityType.ts b/js/app/packages/service-properties/generated/schemas/entityType.ts
index fa3db4052b..c280459a25 100644
--- a/js/app/packages/service-properties/generated/schemas/entityType.ts
+++ b/js/app/packages/service-properties/generated/schemas/entityType.ts
@@ -16,8 +16,10 @@ export type EntityType = typeof EntityType[keyof typeof EntityType];
export const EntityType = {
CHANNEL: 'CHANNEL',
CHAT: 'CHAT',
+ COMPANY: 'COMPANY',
DOCUMENT: 'DOCUMENT',
PROJECT: 'PROJECT',
+ TASK: 'TASK',
THREAD: 'THREAD',
USER: 'USER',
} as const;
diff --git a/js/app/packages/service-properties/generated/zod.ts b/js/app/packages/service-properties/generated/zod.ts
index b77bb24056..5d6e322a71 100644
--- a/js/app/packages/service-properties/generated/zod.ts
+++ b/js/app/packages/service-properties/generated/zod.ts
@@ -36,7 +36,7 @@ export const listPropertiesResponseItem = zod.union([zod.object({
"scope": zod.enum(['user_and_organization']),
"user_id": zod.string()
}).describe('Both user and organization-scoped')]).describe('Defines who owns a property - user-scoped, org-scoped, or both.'),
- "specific_entity_type": zod.union([zod.null(),zod.enum(['CHANNEL', 'CHAT', 'DOCUMENT', 'PROJECT', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')]).optional(),
+ "specific_entity_type": zod.union([zod.null(),zod.enum(['CHANNEL', 'CHAT', 'COMPANY', 'DOCUMENT', 'PROJECT', 'TASK', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')]).optional(),
"updated_at": zod.string().datetime({})
}).describe('Property definition model (service representation).'),zod.object({
"definition": zod.object({
@@ -57,7 +57,7 @@ export const listPropertiesResponseItem = zod.union([zod.object({
"scope": zod.enum(['user_and_organization']),
"user_id": zod.string()
}).describe('Both user and organization-scoped')]).describe('Defines who owns a property - user-scoped, org-scoped, or both.'),
- "specific_entity_type": zod.union([zod.null(),zod.enum(['CHANNEL', 'CHAT', 'DOCUMENT', 'PROJECT', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')]).optional(),
+ "specific_entity_type": zod.union([zod.null(),zod.enum(['CHANNEL', 'CHAT', 'COMPANY', 'DOCUMENT', 'PROJECT', 'TASK', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')]).optional(),
"updated_at": zod.string().datetime({})
}).describe('Property definition model (service representation).'),
"property_options": zod.array(zod.object({
@@ -116,7 +116,7 @@ export const createPropertyDefinitionBody = zod.union([zod.object({
"type": zod.enum(['select_string'])
}).describe('Select property with string options.'),zod.object({
"multi": zod.boolean(),
- "specific_type": zod.union([zod.null(),zod.enum(['CHANNEL', 'CHAT', 'DOCUMENT', 'PROJECT', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')]).optional(),
+ "specific_type": zod.union([zod.null(),zod.enum(['CHANNEL', 'CHAT', 'COMPANY', 'DOCUMENT', 'PROJECT', 'TASK', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')]).optional(),
"type": zod.enum(['entity'])
}).describe('Entity reference property.'),zod.object({
"multi": zod.boolean(),
@@ -193,7 +193,7 @@ export const deletePropertyOptionParams = zod.object({
* @summary Get all properties for an entity
*/
export const getEntityPropertiesParams = zod.object({
- "entity_type": zod.enum(['CHANNEL', 'CHAT', 'DOCUMENT', 'PROJECT', 'THREAD', 'USER']).describe('Entity type (user, document, channel, project, thread)'),
+ "entity_type": zod.enum(['CHANNEL', 'CHAT', 'COMPANY', 'DOCUMENT', 'PROJECT', 'TASK', 'THREAD', 'USER']).describe('Entity type (user, document, channel, project, thread)'),
"entity_id": zod.string().describe('Entity ID')
})
@@ -222,7 +222,7 @@ export const getEntityPropertiesResponse = zod.object({
"scope": zod.enum(['user_and_organization']),
"user_id": zod.string()
}).describe('Both user and organization-scoped')]).describe('Defines who owns a property - user-scoped, org-scoped, or both.'),
- "specific_entity_type": zod.union([zod.null(),zod.enum(['CHANNEL', 'CHAT', 'DOCUMENT', 'PROJECT', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')]).optional(),
+ "specific_entity_type": zod.union([zod.null(),zod.enum(['CHANNEL', 'CHAT', 'COMPANY', 'DOCUMENT', 'PROJECT', 'TASK', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')]).optional(),
"updated_at": zod.string().datetime({})
}).describe('Property definition model (service representation).'),
"options": zod.array(zod.object({
@@ -242,7 +242,7 @@ export const getEntityPropertiesResponse = zod.object({
"property": zod.object({
"created_at": zod.string().datetime({}),
"entity_id": zod.string(),
- "entity_type": zod.enum(['CHANNEL', 'CHAT', 'DOCUMENT', 'PROJECT', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.'),
+ "entity_type": zod.enum(['CHANNEL', 'CHAT', 'COMPANY', 'DOCUMENT', 'PROJECT', 'TASK', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.'),
"id": zod.string().uuid(),
"property_definition_id": zod.string().uuid(),
"updated_at": zod.string().datetime({})
@@ -266,7 +266,7 @@ export const getEntityPropertiesResponse = zod.object({
"type": zod.enum(['EntityReference']),
"value": zod.array(zod.object({
"entity_id": zod.string(),
- "entity_type": zod.enum(['CHANNEL', 'CHAT', 'DOCUMENT', 'PROJECT', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')
+ "entity_type": zod.enum(['CHANNEL', 'CHAT', 'COMPANY', 'DOCUMENT', 'PROJECT', 'TASK', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')
}).describe('Entity reference for entity-type property values.')).describe('Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)')
}).describe('Entity reference(s) - always an array (check is_multi_select to determine if single or multi)\nSingle-select: {\"type\": \"EntityReference\", \"value\": [{...}]} (length 0 or 1)\nMulti-select: {\"type\": \"EntityReference\", \"value\": [{...}, {...}, ...]} (length 0+)'),zod.object({
"type": zod.enum(['Link']),
@@ -280,7 +280,7 @@ export const getEntityPropertiesResponse = zod.object({
* @summary Set or update a property value for an entity, or attach a property without a value
*/
export const setEntityPropertyParams = zod.object({
- "entity_type": zod.enum(['CHANNEL', 'CHAT', 'DOCUMENT', 'PROJECT', 'THREAD', 'USER']).describe('Entity type (user, document, channel, project, thread)'),
+ "entity_type": zod.enum(['CHANNEL', 'CHAT', 'COMPANY', 'DOCUMENT', 'PROJECT', 'TASK', 'THREAD', 'USER']).describe('Entity type (user, document, channel, project, thread)'),
"entity_id": zod.string().describe('Entity ID'),
"property_id": zod.string().uuid().describe('Property ID')
})
@@ -307,13 +307,13 @@ export const setEntityPropertyBody = zod.object({
}).describe('Multiple select options by ID (for multi-select properties)'),zod.object({
"reference": zod.object({
"entity_id": zod.string(),
- "entity_type": zod.enum(['CHANNEL', 'CHAT', 'DOCUMENT', 'PROJECT', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')
+ "entity_type": zod.enum(['CHANNEL', 'CHAT', 'COMPANY', 'DOCUMENT', 'PROJECT', 'TASK', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')
}).describe('Entity reference for entity-type property values.'),
"type": zod.enum(['entity_reference'])
}).describe('Entity reference'),zod.object({
"references": zod.array(zod.object({
"entity_id": zod.string(),
- "entity_type": zod.enum(['CHANNEL', 'CHAT', 'DOCUMENT', 'PROJECT', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')
+ "entity_type": zod.enum(['CHANNEL', 'CHAT', 'COMPANY', 'DOCUMENT', 'PROJECT', 'TASK', 'THREAD', 'USER']).describe('Type of entity that can be referenced by entity properties.')
}).describe('Entity reference for entity-type property values.')),
"type": zod.enum(['multi_entity_reference'])
}).describe('Multiple entity references (for multi-select entity properties)'),zod.object({
diff --git a/js/app/packages/service-properties/openapi.json b/js/app/packages/service-properties/openapi.json
index 046fb2bf7d..03809148a5 100644
--- a/js/app/packages/service-properties/openapi.json
+++ b/js/app/packages/service-properties/openapi.json
@@ -508,7 +508,16 @@
"EntityType": {
"type": "string",
"description": "Type of entity that can be referenced by entity properties.",
- "enum": ["CHANNEL", "CHAT", "DOCUMENT", "PROJECT", "THREAD", "USER"]
+ "enum": [
+ "CHANNEL",
+ "CHAT",
+ "COMPANY",
+ "DOCUMENT",
+ "PROJECT",
+ "TASK",
+ "THREAD",
+ "USER"
+ ]
},
"ListPropertiesQuery": {
"type": "object",
diff --git a/js/app/packages/service-properties/service.ts b/js/app/packages/service-properties/service.ts
index 1706c3a209..9b022dd5f1 100644
--- a/js/app/packages/service-properties/service.ts
+++ b/js/app/packages/service-properties/service.ts
@@ -74,18 +74,8 @@ export const PropertiesService = new Svc(
schemas.getEntityPropertiesParams.description ||
'Get all properties for an entity',
args: {
- entity_type: z.enum([
- 'CHANNEL',
- 'CHAT',
- 'DOCUMENT',
- 'PROJECT',
- 'THREAD',
- 'USER',
- ]),
- entity_id: z.string(),
- query: z.object({
- include_metadata: z.boolean().optional(),
- }),
+ ...schemas.getEntityPropertiesParams.shape,
+ query: schemas.getEntityPropertiesQueryParams,
},
result: asRawShape(schemas.getEntityPropertiesResponse),
throws: withFetchErrors(),
@@ -96,16 +86,7 @@ export const PropertiesService = new Svc(
'Set or update a property value for an entity',
modifies: true,
args: {
- entity_type: z.enum([
- 'CHANNEL',
- 'CHAT',
- 'DOCUMENT',
- 'PROJECT',
- 'THREAD',
- 'USER',
- ]),
- entity_id: z.string(),
- property_id: z.string().uuid(),
+ ...schemas.setEntityPropertyParams.shape,
body: schemas.setEntityPropertyBody,
},
result: asRawShape(z.object({ success: z.boolean() })),
diff --git a/js/app/packages/service-storage/generated/schemas/basicDocument.ts b/js/app/packages/service-storage/generated/schemas/basicDocument.ts
index c382bd2f02..2c7f68867e 100644
--- a/js/app/packages/service-storage/generated/schemas/basicDocument.ts
+++ b/js/app/packages/service-storage/generated/schemas/basicDocument.ts
@@ -34,6 +34,9 @@ the file type */
fileType?: BasicDocumentFileType;
/** The document id */
id: string;
+ /** Whether or not the document is a task.
+This is only applicable for md documents. */
+ isTask: boolean;
/** The name of the document */
name: string;
/** The owner of the document */
diff --git a/js/app/packages/service-storage/generated/schemas/createDocumentRequest.ts b/js/app/packages/service-storage/generated/schemas/createDocumentRequest.ts
index e16ac5466f..1b562680fe 100644
--- a/js/app/packages/service-storage/generated/schemas/createDocumentRequest.ts
+++ b/js/app/packages/service-storage/generated/schemas/createDocumentRequest.ts
@@ -33,6 +33,10 @@ creating a row in the document_email table. */
fileType?: CreateDocumentRequestFileType;
/** The id of the document in the database */
id?: CreateDocumentRequestId;
+ /** Whether the document is a task.
+This is only applicable for md documents and the request will fail if the file type is not
+md. */
+ isTask?: boolean;
/** Optional job id to be used to track an upload job for the newly created document.
Will need to have a corresponding job initiated for the file beforehand. */
jobId?: CreateDocumentRequestJobId;
diff --git a/js/app/packages/service-storage/generated/schemas/documentMetadata.ts b/js/app/packages/service-storage/generated/schemas/documentMetadata.ts
index 8dcfd21886..44442c721b 100644
--- a/js/app/packages/service-storage/generated/schemas/documentMetadata.ts
+++ b/js/app/packages/service-storage/generated/schemas/documentMetadata.ts
@@ -36,6 +36,9 @@ the file type */
documentVersionId: number;
/** The file type of the document (file extension) */
fileType?: DocumentMetadataFileType;
+ /** Whether or not the document is a task.
+This is only applicable for md documents. */
+ isTask: boolean;
/** The modification data for the document instance.
This is only used for PDF documents. */
modificationData?: unknown;
diff --git a/js/app/packages/service-storage/generated/schemas/documentPreviewData.ts b/js/app/packages/service-storage/generated/schemas/documentPreviewData.ts
index f226c33a0c..e4e82b7ebf 100644
--- a/js/app/packages/service-storage/generated/schemas/documentPreviewData.ts
+++ b/js/app/packages/service-storage/generated/schemas/documentPreviewData.ts
@@ -13,6 +13,9 @@ export interface DocumentPreviewData {
document_name: string;
/** The file type of the document (e.g. pdf, docx) */
file_type?: DocumentPreviewDataFileType;
+ /** Whether or not the document is a task.
+This is only applicable for md documents. */
+ is_task: boolean;
/** The id of the owner of the document */
owner: string;
/** The time the document was last updated */
diff --git a/js/app/packages/service-storage/generated/schemas/documentResponseMetadata.ts b/js/app/packages/service-storage/generated/schemas/documentResponseMetadata.ts
index 38246f5465..53c49d4740 100644
--- a/js/app/packages/service-storage/generated/schemas/documentResponseMetadata.ts
+++ b/js/app/packages/service-storage/generated/schemas/documentResponseMetadata.ts
@@ -34,6 +34,9 @@ the file type */
documentVersionId: number;
/** The file type of the document */
fileType?: DocumentResponseMetadataFileType;
+ /** Whether or not the document is a task.
+This is only applicable for md documents. */
+ isTask: boolean;
/** The modification data for the document instance.
This is only used for PDF documents. */
modificationData?: unknown;
diff --git a/js/app/packages/service-storage/generated/schemas/index.ts b/js/app/packages/service-storage/generated/schemas/index.ts
index d036c02b72..98cab209e4 100644
--- a/js/app/packages/service-storage/generated/schemas/index.ts
+++ b/js/app/packages/service-storage/generated/schemas/index.ts
@@ -379,6 +379,7 @@ export * from './soupDocumentProjectId';
export * from './soupDocumentSha';
export * from './soupDocumentViewedAt';
export * from './soupEmailThreadPreview';
+export * from './soupEmailThreadPreviewMetadata';
export * from './soupEmailThreadPreviewName';
export * from './soupEmailThreadPreviewProviderId';
export * from './soupEmailThreadPreviewSenderEmail';
@@ -398,7 +399,11 @@ export * from './soupItemOneOfTag';
export * from './soupItemOneOfThree';
export * from './soupItemOneOfThreeTag';
export * from './soupItemType';
+export * from './soupLabel';
+export * from './soupLabelListVisibility';
+export * from './soupLabelType';
export * from './soupMacroAttachment';
+export * from './soupMessageListVisibility';
export * from './soupPage';
export * from './soupPageNextCursor';
export * from './soupProject';
diff --git a/js/app/packages/service-storage/generated/schemas/soupDocument.ts b/js/app/packages/service-storage/generated/schemas/soupDocument.ts
index 61d6837ecf..b5e90c8556 100644
--- a/js/app/packages/service-storage/generated/schemas/soupDocument.ts
+++ b/js/app/packages/service-storage/generated/schemas/soupDocument.ts
@@ -29,6 +29,9 @@ This could be the document_instance_id or document_bom_id depending on the file
fileType?: SoupDocumentFileType;
/** The document id */
id: string;
+ /** Whether or not the document is a task.
+This is only applicable for md documents. */
+ isTask: boolean;
/** The name of the document */
name: string;
/** The owner of the document */
diff --git a/js/app/packages/service-storage/generated/schemas/soupEmailThreadPreviewMetadata.ts b/js/app/packages/service-storage/generated/schemas/soupEmailThreadPreviewMetadata.ts
new file mode 100644
index 0000000000..0724efbcad
--- /dev/null
+++ b/js/app/packages/service-storage/generated/schemas/soupEmailThreadPreviewMetadata.ts
@@ -0,0 +1,17 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export interface SoupEmailThreadPreviewMetadata {
+ /** if any email contains a calendar invite */
+ calendarInvite: boolean;
+ /** if any sender is a generic email */
+ genericSender: boolean;
+ /** if user has previously emailed any sender */
+ knownSender: boolean;
+ /** if any email contains a <table> html tag */
+ tabular: boolean;
+}
diff --git a/js/app/packages/service-storage/generated/schemas/soupEnrichedEmailThreadPreviewAllOf.ts b/js/app/packages/service-storage/generated/schemas/soupEnrichedEmailThreadPreviewAllOf.ts
index e20b31b8d2..3bd61f8641 100644
--- a/js/app/packages/service-storage/generated/schemas/soupEnrichedEmailThreadPreviewAllOf.ts
+++ b/js/app/packages/service-storage/generated/schemas/soupEnrichedEmailThreadPreviewAllOf.ts
@@ -6,10 +6,14 @@
*/
import type { SoupAttachment } from './soupAttachment';
import type { SoupMacroAttachment } from './soupMacroAttachment';
+import type { SoupLabel } from './soupLabel';
+import type { SoupEmailThreadPreviewMetadata } from './soupEmailThreadPreviewMetadata';
import type { SoupContact } from './soupContact';
export type SoupEnrichedEmailThreadPreviewAllOf = {
attachments: SoupAttachment[];
attachmentsMacro: SoupMacroAttachment[];
+ labels: SoupLabel[];
+ metadata: SoupEmailThreadPreviewMetadata;
participants: SoupContact[];
};
diff --git a/js/app/packages/service-storage/generated/schemas/soupLabel.ts b/js/app/packages/service-storage/generated/schemas/soupLabel.ts
new file mode 100644
index 0000000000..0dcd63ce26
--- /dev/null
+++ b/js/app/packages/service-storage/generated/schemas/soupLabel.ts
@@ -0,0 +1,20 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SoupLabelListVisibility } from './soupLabelListVisibility';
+import type { SoupMessageListVisibility } from './soupMessageListVisibility';
+import type { SoupLabelType } from './soupLabelType';
+
+export interface SoupLabel {
+ createdAt: string;
+ id: string;
+ labelListVisibility: SoupLabelListVisibility;
+ linkId: string;
+ messageListVisibility: SoupMessageListVisibility;
+ name: string;
+ providerLabelId: string;
+ type: SoupLabelType;
+}
diff --git a/js/app/packages/service-storage/generated/schemas/soupLabelListVisibility.ts b/js/app/packages/service-storage/generated/schemas/soupLabelListVisibility.ts
new file mode 100644
index 0000000000..1ceb38898e
--- /dev/null
+++ b/js/app/packages/service-storage/generated/schemas/soupLabelListVisibility.ts
@@ -0,0 +1,16 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type SoupLabelListVisibility = typeof SoupLabelListVisibility[keyof typeof SoupLabelListVisibility];
+
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const SoupLabelListVisibility = {
+ labelShow: 'labelShow',
+ labelShowIfUnread: 'labelShowIfUnread',
+ labelHide: 'labelHide',
+} as const;
diff --git a/js/app/packages/service-storage/generated/schemas/soupLabelType.ts b/js/app/packages/service-storage/generated/schemas/soupLabelType.ts
new file mode 100644
index 0000000000..d8b35a5d11
--- /dev/null
+++ b/js/app/packages/service-storage/generated/schemas/soupLabelType.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type SoupLabelType = typeof SoupLabelType[keyof typeof SoupLabelType];
+
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const SoupLabelType = {
+ system: 'system',
+ user: 'user',
+} as const;
diff --git a/js/app/packages/service-storage/generated/schemas/soupMessageListVisibility.ts b/js/app/packages/service-storage/generated/schemas/soupMessageListVisibility.ts
new file mode 100644
index 0000000000..bf6febd6d9
--- /dev/null
+++ b/js/app/packages/service-storage/generated/schemas/soupMessageListVisibility.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type SoupMessageListVisibility = typeof SoupMessageListVisibility[keyof typeof SoupMessageListVisibility];
+
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const SoupMessageListVisibility = {
+ show: 'show',
+ hide: 'hide',
+} as const;
diff --git a/js/app/packages/service-storage/generated/zod.ts b/js/app/packages/service-storage/generated/zod.ts
index 3421f137ab..b384d37f0e 100644
--- a/js/app/packages/service-storage/generated/zod.ts
+++ b/js/app/packages/service-storage/generated/zod.ts
@@ -31,6 +31,7 @@ export const getRecentActivityHandlerResponse = zod.object({
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document (e.g. pdf, docx)'),
"id": zod.string().describe('The document id'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"name": zod.string().describe('The name of the document'),
"owner": zod.string().describe('The owner of the document'),
"projectId": zod.string().nullish().describe('The id of the project that this document belongs to'),
@@ -549,6 +550,7 @@ export const getUserDocumentsHandlerResponse = zod.object({
"documentName": zod.string().describe('The name of the document'),
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document (file extension)'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"modificationData": zod.any().optional().describe('The modification data for the document instance.\nThis is only used for PDF documents.'),
"owner": zod.string().describe('The owner of the document'),
"projectId": zod.string().nullish().describe('The id of the project that this document belongs to'),
@@ -576,6 +578,7 @@ export const createDocumentHandlerBody = zod.object({
"emailAttachmentId": zod.string().uuid().nullish().describe('Internal only field that links the document created to the specified email attachment by\ncreating a row in the document_email table.'),
"fileType": zod.string().nullish().describe('Optional file type of the document.'),
"id": zod.string().nullish().describe('The id of the document in the database'),
+ "isTask": zod.boolean().optional().describe('Whether the document is a task.\nThis is only applicable for md documents and the request will fail if the file type is not\nmd.'),
"jobId": zod.string().nullish().describe('Optional job id to be used to track an upload job for the newly created document.\nWill need to have a corresponding job initiated for the file beforehand.'),
"mimeType": zod.string().nullish().describe('The content type of the document (currently only used for logging matches against file type).'),
"projectId": zod.string().nullish(),
@@ -598,6 +601,7 @@ export const createDocumentHandlerResponse = zod.object({
"documentName": zod.string().describe('The name of the document'),
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"modificationData": zod.any().optional().describe('The modification data for the document instance.\nThis is only used for PDF documents.'),
"owner": zod.string().describe('The owner of the document'),
"sha": zod.string().nullish().describe('If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'),
@@ -703,6 +707,7 @@ export const getBatchPreviewHandlerResponse = zod.object({
"document_id": zod.string().describe('The document id'),
"document_name": zod.string().describe('The name of the document'),
"file_type": zod.string().nullish().describe('The file type of the document (e.g. pdf, docx)'),
+ "is_task": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"owner": zod.string().describe('The id of the owner of the document'),
"updated_at": zod.number().describe('The time the document was last updated')
}).and(zod.object({
@@ -742,6 +747,7 @@ export const getDocumentResponse = zod.object({
"documentName": zod.string().describe('The name of the document'),
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document (file extension)'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"modificationData": zod.any().optional().describe('The modification data for the document instance.\nThis is only used for PDF documents.'),
"owner": zod.string().describe('The owner of the document'),
"projectId": zod.string().nullish().describe('The id of the project that this document belongs to'),
@@ -788,6 +794,7 @@ export const saveDocumentHandlerResponse = zod.object({
"documentName": zod.string().describe('The name of the document'),
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"modificationData": zod.any().optional().describe('The modification data for the document instance.\nThis is only used for PDF documents.'),
"owner": zod.string().describe('The owner of the document'),
"sha": zod.string().nullish().describe('If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'),
@@ -854,6 +861,7 @@ export const copyDocumentHandlerResponse = zod.object({
"documentName": zod.string().describe('The name of the document'),
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document (file extension)'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"modificationData": zod.any().optional().describe('The modification data for the document instance.\nThis is only used for PDF documents.'),
"owner": zod.string().describe('The owner of the document'),
"projectId": zod.string().nullish().describe('The id of the project that this document belongs to'),
@@ -991,6 +999,7 @@ export const simpleSaveResponse = zod.object({
"documentName": zod.string().describe('The name of the document'),
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"modificationData": zod.any().optional().describe('The modification data for the document instance.\nThis is only used for PDF documents.'),
"owner": zod.string().describe('The owner of the document'),
"sha": zod.string().nullish().describe('If the document is a PDF, this is the SHA of the pdf\nIf the document is a DOCX, this will not be present'),
@@ -1039,6 +1048,7 @@ export const getDocumentVersionResponse = zod.object({
"documentName": zod.string().describe('The name of the document'),
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document (file extension)'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"modificationData": zod.any().optional().describe('The modification data for the document instance.\nThis is only used for PDF documents.'),
"owner": zod.string().describe('The owner of the document'),
"projectId": zod.string().nullish().describe('The id of the project that this document belongs to'),
@@ -1066,6 +1076,7 @@ export const getHistoryHandlerResponse = zod.object({
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document (e.g. pdf, docx)'),
"id": zod.string().describe('The document id'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"name": zod.string().describe('The name of the document'),
"owner": zod.string().describe('The owner of the document'),
"projectId": zod.string().nullish().describe('The id of the project that this document belongs to'),
@@ -1169,6 +1180,7 @@ export const getItemsSoupResponse = zod.object({
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'),
"fileType": zod.string().nullish().describe('The file type of the document (e.g. pdf, docx)'),
"id": zod.string().uuid().describe('The document id'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"name": zod.string().describe('The name of the document'),
"ownerId": zod.string().describe('The owner of the document'),
"projectId": zod.string().uuid().nullish().describe('The id of the project that this document belongs to'),
@@ -1236,6 +1248,22 @@ export const getItemsSoupResponse = zod.object({
"messageId": zod.string().uuid(),
"threadId": zod.string().uuid()
})),
+ "labels": zod.array(zod.object({
+ "createdAt": zod.string().datetime({}),
+ "id": zod.string().uuid(),
+ "labelListVisibility": zod.enum(['labelShow', 'labelShowIfUnread', 'labelHide']),
+ "linkId": zod.string().uuid(),
+ "messageListVisibility": zod.enum(['show', 'hide']),
+ "name": zod.string(),
+ "providerLabelId": zod.string(),
+ "type": zod.enum(['system', 'user'])
+})),
+ "metadata": zod.object({
+ "calendarInvite": zod.boolean().describe('if any email contains a calendar invite'),
+ "genericSender": zod.boolean().describe('if any sender is a generic email'),
+ "knownSender": zod.boolean().describe('if user has previously emailed any sender'),
+ "tabular": zod.boolean().describe('if any email contains a <table> html tag')
+}),
"participants": zod.array(zod.object({
"emailAddress": zod.string().nullish(),
"id": zod.string().uuid(),
@@ -1308,6 +1336,7 @@ export const postItemsSoupResponse = zod.object({
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on the file type'),
"fileType": zod.string().nullish().describe('The file type of the document (e.g. pdf, docx)'),
"id": zod.string().uuid().describe('The document id'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"name": zod.string().describe('The name of the document'),
"ownerId": zod.string().describe('The owner of the document'),
"projectId": zod.string().uuid().nullish().describe('The id of the project that this document belongs to'),
@@ -1375,6 +1404,22 @@ export const postItemsSoupResponse = zod.object({
"messageId": zod.string().uuid(),
"threadId": zod.string().uuid()
})),
+ "labels": zod.array(zod.object({
+ "createdAt": zod.string().datetime({}),
+ "id": zod.string().uuid(),
+ "labelListVisibility": zod.enum(['labelShow', 'labelShowIfUnread', 'labelHide']),
+ "linkId": zod.string().uuid(),
+ "messageListVisibility": zod.enum(['show', 'hide']),
+ "name": zod.string(),
+ "providerLabelId": zod.string(),
+ "type": zod.enum(['system', 'user'])
+})),
+ "metadata": zod.object({
+ "calendarInvite": zod.boolean().describe('if any email contains a calendar invite'),
+ "genericSender": zod.boolean().describe('if any sender is a generic email'),
+ "knownSender": zod.boolean().describe('if user has previously emailed any sender'),
+ "tabular": zod.boolean().describe('if any email contains a <table> html tag')
+}),
"participants": zod.array(zod.object({
"emailAddress": zod.string().nullish(),
"id": zod.string().uuid(),
@@ -1420,6 +1465,7 @@ export const getPinsHandlerResponse = zod.object({
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document (e.g. pdf, docx)'),
"id": zod.string().describe('The document id'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"name": zod.string().describe('The name of the document'),
"owner": zod.string().describe('The owner of the document'),
"projectId": zod.string().nullish().describe('The id of the project that this document belongs to'),
@@ -1457,6 +1503,7 @@ export const getPinsHandlerResponse = zod.object({
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document (e.g. pdf, docx)'),
"id": zod.string().describe('The document id'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"name": zod.string().describe('The name of the document'),
"owner": zod.string().describe('The owner of the document'),
"projectId": zod.string().nullish().describe('The id of the project that this document belongs to'),
@@ -1778,6 +1825,7 @@ export const getProjectContentHandlerResponse = zod.object({
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document (e.g. pdf, docx)'),
"id": zod.string().describe('The document id'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"name": zod.string().describe('The name of the document'),
"owner": zod.string().describe('The owner of the document'),
"projectId": zod.string().nullish().describe('The id of the project that this document belongs to'),
@@ -1876,6 +1924,7 @@ export const recentlyDeletedResponse = zod.object({
"documentVersionId": zod.number().describe('The version of the document\nThis could be the document_instance_id or document_bom_id depending on\nthe file type'),
"fileType": zod.string().nullish().describe('The file type of the document (e.g. pdf, docx)'),
"id": zod.string().describe('The document id'),
+ "isTask": zod.boolean().describe('Whether or not the document is a task.\nThis is only applicable for md documents.'),
"name": zod.string().describe('The name of the document'),
"owner": zod.string().describe('The owner of the document'),
"projectId": zod.string().nullish().describe('The id of the project that this document belongs to'),
diff --git a/js/app/packages/service-storage/openapi.json b/js/app/packages/service-storage/openapi.json
index 0f94f8e992..ac9539c3a7 100644
--- a/js/app/packages/service-storage/openapi.json
+++ b/js/app/packages/service-storage/openapi.json
@@ -4056,7 +4056,8 @@
"owner",
"name",
"createdAt",
- "updatedAt"
+ "updatedAt",
+ "isTask"
],
"properties": {
"branchedFromId": {
@@ -4093,6 +4094,10 @@
"description": "The file type of the document (e.g. pdf, docx)"
},
"id": { "type": "string", "description": "The document id" },
+ "isTask": {
+ "type": "boolean",
+ "description": "Whether or not the document is a task.\nThis is only applicable for md documents."
+ },
"name": {
"type": "string",
"description": "The name of the document"
@@ -4428,6 +4433,10 @@
"type": ["string", "null"],
"description": "The id of the document in the database"
},
+ "isTask": {
+ "type": "boolean",
+ "description": "Whether the document is a task.\nThis is only applicable for md documents and the request will fail if the file type is not\nmd."
+ },
"jobId": {
"type": ["string", "null"],
"description": "Optional job id to be used to track an upload job for the newly created document.\nWill need to have a corresponding job initiated for the file beforehand."
@@ -4660,7 +4669,8 @@
"owner",
"documentName",
"createdAt",
- "updatedAt"
+ "updatedAt",
+ "isTask"
],
"properties": {
"branchedFromId": {
@@ -4701,6 +4711,10 @@
"type": ["string", "null"],
"description": "The file type of the document (file extension)"
},
+ "isTask": {
+ "type": "boolean",
+ "description": "Whether or not the document is a task.\nThis is only applicable for md documents."
+ },
"modificationData": {
"description": "The modification data for the document instance.\nThis is only used for PDF documents."
},
@@ -4810,7 +4824,13 @@
},
"DocumentPreviewData": {
"type": "object",
- "required": ["document_id", "document_name", "owner", "updated_at"],
+ "required": [
+ "document_id",
+ "document_name",
+ "owner",
+ "updated_at",
+ "is_task"
+ ],
"properties": {
"document_id": { "type": "string", "description": "The document id" },
"document_name": {
@@ -4821,6 +4841,10 @@
"type": ["string", "null"],
"description": "The file type of the document (e.g. pdf, docx)"
},
+ "is_task": {
+ "type": "boolean",
+ "description": "Whether or not the document is a task.\nThis is only applicable for md documents."
+ },
"owner": {
"type": "string",
"description": "The id of the owner of the document"
@@ -4850,7 +4874,8 @@
"owner",
"documentName",
"createdAt",
- "updatedAt"
+ "updatedAt",
+ "isTask"
],
"properties": {
"branchedFromId": {
@@ -4891,6 +4916,10 @@
"type": ["string", "null"],
"description": "The file type of the document"
},
+ "isTask": {
+ "type": "boolean",
+ "description": "Whether or not the document is a task.\nThis is only applicable for md documents."
+ },
"modificationData": {
"description": "The modification data for the document instance.\nThis is only used for PDF documents."
},
@@ -6812,7 +6841,8 @@
"name",
"createdAt",
"updatedAt",
- "viewedAt"
+ "viewedAt",
+ "isTask"
],
"properties": {
"branchedFromId": {
@@ -6849,6 +6879,10 @@
"format": "uuid",
"description": "The document id"
},
+ "isTask": {
+ "type": "boolean",
+ "description": "Whether or not the document is a task.\nThis is only applicable for md documents."
+ },
"name": {
"type": "string",
"description": "The name of the document"
@@ -6911,12 +6945,45 @@
"viewedAt": { "type": ["integer", "null"], "format": "int64" }
}
},
+ "SoupEmailThreadPreviewMetadata": {
+ "type": "object",
+ "required": [
+ "knownSender",
+ "tabular",
+ "calendarInvite",
+ "genericSender"
+ ],
+ "properties": {
+ "calendarInvite": {
+ "type": "boolean",
+ "description": "if any email contains a calendar invite"
+ },
+ "genericSender": {
+ "type": "boolean",
+ "description": "if any sender is a generic email"
+ },
+ "knownSender": {
+ "type": "boolean",
+ "description": "if user has previously emailed any sender"
+ },
+ "tabular": {
+ "type": "boolean",
+ "description": "if any email contains a <table> html tag"
+ }
+ }
+ },
"SoupEnrichedEmailThreadPreview": {
"allOf": [
{ "$ref": "#/components/schemas/SoupEmailThreadPreview" },
{
"type": "object",
- "required": ["attachments", "attachmentsMacro", "participants"],
+ "required": [
+ "attachments",
+ "attachmentsMacro",
+ "participants",
+ "metadata",
+ "labels"
+ ],
"properties": {
"attachments": {
"type": "array",
@@ -6926,6 +6993,13 @@
"type": "array",
"items": { "$ref": "#/components/schemas/SoupMacroAttachment" }
},
+ "labels": {
+ "type": "array",
+ "items": { "$ref": "#/components/schemas/SoupLabel" }
+ },
+ "metadata": {
+ "$ref": "#/components/schemas/SoupEmailThreadPreviewMetadata"
+ },
"participants": {
"type": "array",
"items": { "$ref": "#/components/schemas/SoupContact" }
@@ -6976,6 +7050,38 @@
"type": "string",
"enum": ["document", "chat", "project", "email_thread"]
},
+ "SoupLabel": {
+ "type": "object",
+ "required": [
+ "id",
+ "linkId",
+ "providerLabelId",
+ "name",
+ "createdAt",
+ "messageListVisibility",
+ "labelListVisibility",
+ "type"
+ ],
+ "properties": {
+ "createdAt": { "type": "string", "format": "date-time" },
+ "id": { "type": "string", "format": "uuid" },
+ "labelListVisibility": {
+ "$ref": "#/components/schemas/SoupLabelListVisibility"
+ },
+ "linkId": { "type": "string", "format": "uuid" },
+ "messageListVisibility": {
+ "$ref": "#/components/schemas/SoupMessageListVisibility"
+ },
+ "name": { "type": "string" },
+ "providerLabelId": { "type": "string" },
+ "type": { "$ref": "#/components/schemas/SoupLabelType" }
+ }
+ },
+ "SoupLabelListVisibility": {
+ "type": "string",
+ "enum": ["labelShow", "labelShowIfUnread", "labelHide"]
+ },
+ "SoupLabelType": { "type": "string", "enum": ["system", "user"] },
"SoupMacroAttachment": {
"type": "object",
"required": ["threadId", "dbId", "messageId", "itemId", "itemType"],
@@ -6987,6 +7093,10 @@
"threadId": { "type": "string", "format": "uuid" }
}
},
+ "SoupMessageListVisibility": {
+ "type": "string",
+ "enum": ["show", "hide"]
+ },
"SoupPage": {
"type": "object",
"required": ["items"],