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.

chore: update front end to support separate highlighting result (#84)

gbirman7b11f8856bd9
diff --git a/js/app/bun.lock b/js/app/bun.lock
index c75966263b..6462a7ad7b 100644
--- a/js/app/bun.lock
+++ b/js/app/bun.lock
@@ -1,6 +1,5 @@
{
"lockfileVersion": 1,
- "configVersion": 0,
"workspaces": {
"": {
"name": "@coparse/monorepo",
diff --git a/js/app/packages/app/component/command/useChatItems.ts b/js/app/packages/app/component/command/useChatItems.ts
index b0c7528fb3..5f9d944293 100644
--- a/js/app/packages/app/component/command/useChatItems.ts
+++ b/js/app/packages/app/component/command/useChatItems.ts
@@ -13,9 +13,7 @@ export function useChatItems(fullTextSearchTerm: () => string) {
for (const chat of chatResults.results) {
if (chat.chat_search_results.length === 0) continue;
for (const result of chat.chat_search_results) {
- const contents = Array.isArray(result.content)
- ? result.content
- : [result.content || ''];
+ const contents = result.highlight.content ?? [];
contents.forEach((content, index) => {
items.push({
type: 'item',
diff --git a/js/app/packages/app/component/command/useDocumentItems.ts b/js/app/packages/app/component/command/useDocumentItems.ts
index fc0040f64e..d540c54484 100644
--- a/js/app/packages/app/component/command/useDocumentItems.ts
+++ b/js/app/packages/app/component/command/useDocumentItems.ts
@@ -15,7 +15,7 @@ export function useDocumentItems(fullTextSearchTerm: () => string) {
if (doc.document_search_results.length === 0) continue;
for (const result of doc.document_search_results) {
- const contents = Array.isArray(result.content) ? result.content : [''];
+ const contents = result.highlight.content ?? [];
contents.forEach((content, index) => {
items.push({
type: 'item',
diff --git a/js/app/packages/app/component/command/useEmailItems.ts b/js/app/packages/app/component/command/useEmailItems.ts
index d022caf9f0..b0f4afd014 100644
--- a/js/app/packages/app/component/command/useEmailItems.ts
+++ b/js/app/packages/app/component/command/useEmailItems.ts
@@ -12,7 +12,7 @@ function transformEmailResultsToItems(
if (email.email_message_search_results.length === 0) continue;
for (const result of email.email_message_search_results) {
- const contents = Array.isArray(result.content) ? result.content : [''];
+ const contents = result.highlight.content ?? [];
contents.forEach((content, index) => {
items.push({
type: 'email',
diff --git a/js/app/packages/app/component/command/useSearchItems.ts b/js/app/packages/app/component/command/useSearchItems.ts
index dc35682800..6836e96460 100644
--- a/js/app/packages/app/component/command/useSearchItems.ts
+++ b/js/app/packages/app/component/command/useSearchItems.ts
@@ -18,7 +18,7 @@ function createDocumentItems(
// TODO: de-duplicate: see logic in useDocumentItems
for (const result of doc.document_search_results) {
- const contents = Array.isArray(result.content) ? result.content : [''];
+ const contents = result.highlight.content ?? [];
contents.forEach((content, index) => {
// TODO: Canvas returns some nasty partial <m-foo> tags in plaintext
// so they are banned from search display for now.
@@ -54,7 +54,7 @@ function createEmailItems(email: UnifiedSearchResponseItem): CommandItemCard[] {
// TODO: de-duplicate: see logic in useEmailItems
for (const result of email.email_message_search_results) {
- const contents = Array.isArray(result.content) ? result.content : [''];
+ const contents = result.highlight.content ?? [];
contents.forEach((content, index) => {
items.push({
type: 'email',
@@ -89,9 +89,7 @@ function createChatItems(chat: UnifiedSearchResponseItem): CommandItemCard[] {
// TODO: de-duplicate: see logic in useChatItems
for (const result of chat.chat_search_results) {
- const contents = Array.isArray(result.content)
- ? result.content
- : [result.content || ''];
+ const contents = result.highlight.content ?? [];
contents.forEach((content, index) => {
items.push({
type: 'item',
@@ -124,9 +122,7 @@ function createChannelItems(
if (channel.channel_message_search_results.length === 0) return [];
for (const result of channel.channel_message_search_results) {
- const contents = Array.isArray(result.content)
- ? result.content
- : [result.content || ''];
+ const contents = result.highlight.content ?? [];
contents.forEach((content, index) => {
items.push({
type: 'channel',
@@ -158,9 +154,7 @@ function createProjectItems(
if (project.project_search_results.length === 0) return [];
for (const result of project.project_search_results) {
- const contents = Array.isArray(result.content)
- ? result.content
- : [result.content || ''];
+ const contents = result.highlight.content ?? [];
contents.forEach((_content, _index) => {
items.push({
type: 'item',
diff --git a/js/app/packages/macro-entity/src/queries/search.ts b/js/app/packages/macro-entity/src/queries/search.ts
index 4a95b5ad0f..f8836c586b 100644
--- a/js/app/packages/macro-entity/src/queries/search.ts
+++ b/js/app/packages/macro-entity/src/queries/search.ts
@@ -65,27 +65,29 @@ const useMapSearchResponseItem = () => {
.toSorted((a, b) => a.created_at - b.created_at)
.at(-1);
+ const channelWithLatest = channels().find(
+ (c) => c.id === result.channel_id
+ );
+ // TODO: distinguish latest message from content match
+ const contentMatch = channelResult
+ ? {
+ content: channelResult?.highlight.content?.at(0) ?? '',
+ senderId: channelResult?.sender_id,
+ createdAt: channelResult?.created_at,
+ }
+ : undefined;
+
return {
type: 'channel',
// TODO: distinguish channel name match from channel message match
id: result.channel_id,
- name:
- result.name ??
- // TODO: we will need to hydrate dynamic name from the backend
- channels().find((c) => c.id === result.channel_id)?.name ??
- '',
+ name: result.name ?? channelWithLatest?.name ?? '',
ownerId: result.owner_id ?? '',
createdAt: result.created_at,
updatedAt: result.updated_at,
channelType: result.channel_type as ChannelType,
interactedAt: result.interacted_at ?? undefined,
- latestMessage: channelResult
- ? {
- content: channelResult.content.at(0) ?? '',
- senderId: channelResult.sender_id,
- createdAt: channelResult.created_at,
- }
- : undefined,
+ latestMessage: contentMatch,
};
case 'project':
diff --git a/js/app/packages/service-search/generated/models/channelSearchResult.ts b/js/app/packages/service-search/generated/models/channelSearchResult.ts
index 7831ab6cb5..cbd9d7c662 100644
--- a/js/app/packages/service-search/generated/models/channelSearchResult.ts
+++ b/js/app/packages/service-search/generated/models/channelSearchResult.ts
@@ -4,16 +4,17 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
+import type { SearchHighlight } from './searchHighlight';
import type { ChannelSearchResultThreadId } from './channelSearchResultThreadId';
/**
* A channel message match for a given channel id
*/
export interface ChannelSearchResult {
- /** The array of content matches for the channel message */
- content: string[];
/** When the channel message was created */
created_at: number;
+ /** The highlights for the channel message */
+ highlight: SearchHighlight;
/** The channel message id */
message_id: string;
/** The sender id */
diff --git a/js/app/packages/service-search/generated/models/chatMessageSearchResult.ts b/js/app/packages/service-search/generated/models/chatMessageSearchResult.ts
index 497261a56d..85fdc8a0d8 100644
--- a/js/app/packages/service-search/generated/models/chatMessageSearchResult.ts
+++ b/js/app/packages/service-search/generated/models/chatMessageSearchResult.ts
@@ -4,6 +4,7 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
+import type { SearchHighlight } from './searchHighlight';
/**
* A chat match for a given message id
@@ -11,8 +12,8 @@
export interface ChatMessageSearchResult {
/** The chat message id for the chat */
chat_message_id: string;
- /** The array of content matches for the message */
- content: string[];
+ /** The highlights for the chat message */
+ highlight: SearchHighlight;
/** The role of the chat message */
role: string;
/** The title of the chat */
diff --git a/js/app/packages/service-search/generated/models/documentSearchResult.ts b/js/app/packages/service-search/generated/models/documentSearchResult.ts
index c7441dc29e..63cb89013d 100644
--- a/js/app/packages/service-search/generated/models/documentSearchResult.ts
+++ b/js/app/packages/service-search/generated/models/documentSearchResult.ts
@@ -4,14 +4,15 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
+import type { SearchHighlight } from './searchHighlight';
import type { DocumentSearchResultRawContent } from './documentSearchResultRawContent';
/**
* A document match for a given node
*/
export interface DocumentSearchResult {
- /** The array of content matches for the document */
- content: string[];
+ /** The highlights for the document */
+ highlight: SearchHighlight;
/** The node id for the document.
This is only useful for markdown at the moment */
node_id: string;
diff --git a/js/app/packages/service-search/generated/models/emailSearchResult.ts b/js/app/packages/service-search/generated/models/emailSearchResult.ts
index 72dd5207cf..0eea894f2a 100644
--- a/js/app/packages/service-search/generated/models/emailSearchResult.ts
+++ b/js/app/packages/service-search/generated/models/emailSearchResult.ts
@@ -4,6 +4,7 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
+import type { SearchHighlight } from './searchHighlight';
import type { EmailSearchResultSentAt } from './emailSearchResultSentAt';
import type { EmailSearchResultSubject } from './emailSearchResultSubject';
@@ -13,8 +14,8 @@ import type { EmailSearchResultSubject } from './emailSearchResultSubject';
export interface EmailSearchResult {
bcc: string[];
cc: string[];
- /** The array of content matches for the email message */
- content: string[];
+ /** The highlights for the email message */
+ highlight: SearchHighlight;
labels: string[];
/** The email message id. */
message_id: string;
diff --git a/js/app/packages/service-search/generated/models/index.ts b/js/app/packages/service-search/generated/models/index.ts
index 9891a2f1b7..0489f0995a 100644
--- a/js/app/packages/service-search/generated/models/index.ts
+++ b/js/app/packages/service-search/generated/models/index.ts
@@ -92,50 +92,42 @@ export * from './projectSearchResponseItemWithMetadataAllOf';
export * from './projectSearchResponseItemWithMetadataAllOfParentProjectId';
export * from './projectSearchResponseItemWithMetadataAllOfViewedAt';
export * from './projectSearchResult';
+export * from './searchHighlight';
+export * from './searchHighlightName';
export * from './searchOn';
export * from './searchResponse';
export * from './simpleChannelSearchParams';
export * from './simpleChannelSearchReponseBaseItem';
export * from './simpleChannelSearchReponseBaseItemChannelName';
-export * from './simpleChannelSearchReponseBaseItemContent';
export * from './simpleChannelSearchReponseBaseItemOrgId';
export * from './simpleChannelSearchReponseBaseItemThreadId';
export * from './simpleChannelSearchReponseBaseItemTimestampSeconds';
export * from './simpleChannelSearchReponseBaseItemTimestampSecondsChannelName';
-export * from './simpleChannelSearchReponseBaseItemTimestampSecondsContent';
export * from './simpleChannelSearchReponseBaseItemTimestampSecondsOrgId';
export * from './simpleChannelSearchReponseBaseItemTimestampSecondsThreadId';
export * from './simpleChannelSearchResponse';
export * from './simpleChatSearchParams';
export * from './simpleChatSearchResponse';
export * from './simpleChatSearchResponseBaseItem';
-export * from './simpleChatSearchResponseBaseItemContent';
export * from './simpleChatSearchResponseBaseItemTimestampSeconds';
-export * from './simpleChatSearchResponseBaseItemTimestampSecondsContent';
export * from './simpleDocumentSearchParams';
export * from './simpleDocumentSearchResponse';
export * from './simpleDocumentSearchResponseBaseItem';
-export * from './simpleDocumentSearchResponseBaseItemContent';
export * from './simpleDocumentSearchResponseBaseItemRawContent';
export * from './simpleDocumentSearchResponseBaseItemTimestampSeconds';
-export * from './simpleDocumentSearchResponseBaseItemTimestampSecondsContent';
export * from './simpleDocumentSearchResponseBaseItemTimestampSecondsRawContent';
export * from './simpleEmailSearchParams';
export * from './simpleEmailSearchResponse';
export * from './simpleEmailSearchResponseBaseItem';
-export * from './simpleEmailSearchResponseBaseItemContent';
export * from './simpleEmailSearchResponseBaseItemSentAt';
export * from './simpleEmailSearchResponseBaseItemSubject';
export * from './simpleEmailSearchResponseBaseItemTimestampSeconds';
-export * from './simpleEmailSearchResponseBaseItemTimestampSecondsContent';
export * from './simpleEmailSearchResponseBaseItemTimestampSecondsSentAt';
export * from './simpleEmailSearchResponseBaseItemTimestampSecondsSubject';
export * from './simpleProjectSearchParams';
export * from './simpleProjectSearchResponse';
export * from './simpleProjectSearchResponseBaseItem';
-export * from './simpleProjectSearchResponseBaseItemContent';
export * from './simpleProjectSearchResponseBaseItemTimestampSeconds';
-export * from './simpleProjectSearchResponseBaseItemTimestampSecondsContent';
export * from './simpleUnifiedSearchBaseResponse';
export * from './simpleUnifiedSearchParams';
export * from './simpleUnifiedSearchResponseBaseItem';
diff --git a/js/app/packages/service-search/generated/models/projectSearchResult.ts b/js/app/packages/service-search/generated/models/projectSearchResult.ts
index 30e35a3969..985a843a7c 100644
--- a/js/app/packages/service-search/generated/models/projectSearchResult.ts
+++ b/js/app/packages/service-search/generated/models/projectSearchResult.ts
@@ -4,8 +4,8 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
+import type { SearchHighlight } from './searchHighlight';
export interface ProjectSearchResult {
- /** array of content matches for a project */
- content: string[];
+ highlight: SearchHighlight;
}
diff --git a/js/app/packages/service-search/generated/models/searchHighlight.ts b/js/app/packages/service-search/generated/models/searchHighlight.ts
new file mode 100644
index 0000000000..918f281a61
--- /dev/null
+++ b/js/app/packages/service-search/generated/models/searchHighlight.ts
@@ -0,0 +1,14 @@
+/**
+ * Generated by orval v7.13.0 🍺
+ * Do not edit manually.
+ * search_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { SearchHighlightName } from './searchHighlightName';
+
+export interface SearchHighlight {
+ /** The highlight match on the content field */
+ content?: string[];
+ /** The highlight match on the name field */
+ name?: SearchHighlightName;
+}
diff --git a/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItemContent.ts b/js/app/packages/service-search/generated/models/searchHighlightName.ts
similarity index 53%
rename from js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItemContent.ts
rename to js/app/packages/service-search/generated/models/searchHighlightName.ts
index 31341f6254..6ce2b5c274 100644
--- a/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItemContent.ts
+++ b/js/app/packages/service-search/generated/models/searchHighlightName.ts
@@ -6,6 +6,6 @@
*/
/**
- * The opensearch matches on the chat
+ * The highlight match on the name field
*/
-export type SimpleChatSearchResponseBaseItemContent = string[] | null;
+export type SearchHighlightName = string | null;
diff --git a/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItem.ts b/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItem.ts
index 4fc498e927..d2513d0328 100644
--- a/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItem.ts
+++ b/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItem.ts
@@ -5,7 +5,7 @@
* OpenAPI spec version: 0.1.0
*/
import type { SimpleChannelSearchReponseBaseItemChannelName } from './simpleChannelSearchReponseBaseItemChannelName';
-import type { SimpleChannelSearchReponseBaseItemContent } from './simpleChannelSearchReponseBaseItemContent';
+import type { SearchHighlight } from './searchHighlight';
import type { SimpleChannelSearchReponseBaseItemOrgId } from './simpleChannelSearchReponseBaseItemOrgId';
import type { SimpleChannelSearchReponseBaseItemThreadId } from './simpleChannelSearchReponseBaseItemThreadId';
@@ -16,10 +16,10 @@ export interface SimpleChannelSearchReponseBaseItem {
channel_name?: SimpleChannelSearchReponseBaseItemChannelName;
/** The channel type */
channel_type: string;
- /** The opensearch matches on the channel message */
- content?: SimpleChannelSearchReponseBaseItemContent;
/** The time the channel message was created */
created_at: number;
+ /** The highlights on the channel message */
+ highlight: SearchHighlight;
/** The mentions */
mentions: string[];
/** The message id */
diff --git a/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItemContent.ts b/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItemContent.ts
deleted file mode 100644
index d33f760a60..0000000000
--- a/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItemContent.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-/**
- * The opensearch matches on the channel message
- */
-export type SimpleChannelSearchReponseBaseItemContent = string[] | null;
diff --git a/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSeconds.ts b/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSeconds.ts
index 0f4b6d5e33..122ca163ea 100644
--- a/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSeconds.ts
+++ b/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSeconds.ts
@@ -5,7 +5,7 @@
* OpenAPI spec version: 0.1.0
*/
import type { SimpleChannelSearchReponseBaseItemTimestampSecondsChannelName } from './simpleChannelSearchReponseBaseItemTimestampSecondsChannelName';
-import type { SimpleChannelSearchReponseBaseItemTimestampSecondsContent } from './simpleChannelSearchReponseBaseItemTimestampSecondsContent';
+import type { SearchHighlight } from './searchHighlight';
import type { SimpleChannelSearchReponseBaseItemTimestampSecondsOrgId } from './simpleChannelSearchReponseBaseItemTimestampSecondsOrgId';
import type { SimpleChannelSearchReponseBaseItemTimestampSecondsThreadId } from './simpleChannelSearchReponseBaseItemTimestampSecondsThreadId';
@@ -16,10 +16,10 @@ export interface SimpleChannelSearchReponseBaseItemTimestampSeconds {
channel_name?: SimpleChannelSearchReponseBaseItemTimestampSecondsChannelName;
/** The channel type */
channel_type: string;
- /** The opensearch matches on the channel message */
- content?: SimpleChannelSearchReponseBaseItemTimestampSecondsContent;
/** The time the channel message was created */
created_at: number;
+ /** The highlights on the channel message */
+ highlight: SearchHighlight;
/** The mentions */
mentions: string[];
/** The message id */
diff --git a/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSecondsContent.ts b/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSecondsContent.ts
deleted file mode 100644
index 698d86b5bf..0000000000
--- a/js/app/packages/service-search/generated/models/simpleChannelSearchReponseBaseItemTimestampSecondsContent.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-/**
- * The opensearch matches on the channel message
- */
-export type SimpleChannelSearchReponseBaseItemTimestampSecondsContent = string[] | null;
diff --git a/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItem.ts b/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItem.ts
index b81f0d3a7f..aaba38f641 100644
--- a/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItem.ts
+++ b/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItem.ts
@@ -4,15 +4,15 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleChatSearchResponseBaseItemContent } from './simpleChatSearchResponseBaseItemContent';
+import type { SearchHighlight } from './searchHighlight';
export interface SimpleChatSearchResponseBaseItem {
/** The chat id */
chat_id: string;
/** The chat message id */
chat_message_id: string;
- /** The opensearch matches on the chat */
- content?: SimpleChatSearchResponseBaseItemContent;
+ /** The highlights on the chat */
+ highlight: SearchHighlight;
/** The role */
role: string;
/** The title */
diff --git a/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItemTimestampSeconds.ts b/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItemTimestampSeconds.ts
index 5f45d18791..99d7d27cb3 100644
--- a/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItemTimestampSeconds.ts
+++ b/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItemTimestampSeconds.ts
@@ -4,15 +4,15 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleChatSearchResponseBaseItemTimestampSecondsContent } from './simpleChatSearchResponseBaseItemTimestampSecondsContent';
+import type { SearchHighlight } from './searchHighlight';
export interface SimpleChatSearchResponseBaseItemTimestampSeconds {
/** The chat id */
chat_id: string;
/** The chat message id */
chat_message_id: string;
- /** The opensearch matches on the chat */
- content?: SimpleChatSearchResponseBaseItemTimestampSecondsContent;
+ /** The highlights on the chat */
+ highlight: SearchHighlight;
/** The role */
role: string;
/** The title */
diff --git a/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItemTimestampSecondsContent.ts b/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItemTimestampSecondsContent.ts
deleted file mode 100644
index 3dd8878b4c..0000000000
--- a/js/app/packages/service-search/generated/models/simpleChatSearchResponseBaseItemTimestampSecondsContent.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-/**
- * The opensearch matches on the chat
- */
-export type SimpleChatSearchResponseBaseItemTimestampSecondsContent = string[] | null;
diff --git a/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItem.ts b/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItem.ts
index e70df18392..4c36096016 100644
--- a/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItem.ts
+++ b/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItem.ts
@@ -4,18 +4,18 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleDocumentSearchResponseBaseItemContent } from './simpleDocumentSearchResponseBaseItemContent';
+import type { SearchHighlight } from './searchHighlight';
import type { SimpleDocumentSearchResponseBaseItemRawContent } from './simpleDocumentSearchResponseBaseItemRawContent';
export interface SimpleDocumentSearchResponseBaseItem {
- /** The opensearch matches on the document */
- content?: SimpleDocumentSearchResponseBaseItemContent;
/** The document id */
document_id: string;
/** The document name */
document_name: string;
/** The file type */
file_type: string;
+ /** The highlights on the document */
+ highlight: SearchHighlight;
/** The node id */
node_id: string;
/** The owner id */
diff --git a/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItemContent.ts b/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItemContent.ts
deleted file mode 100644
index de1af77a9b..0000000000
--- a/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItemContent.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-/**
- * The opensearch matches on the document
- */
-export type SimpleDocumentSearchResponseBaseItemContent = string[] | null;
diff --git a/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSeconds.ts b/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSeconds.ts
index f62c749fcb..b39fda458e 100644
--- a/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSeconds.ts
+++ b/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSeconds.ts
@@ -4,18 +4,18 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleDocumentSearchResponseBaseItemTimestampSecondsContent } from './simpleDocumentSearchResponseBaseItemTimestampSecondsContent';
+import type { SearchHighlight } from './searchHighlight';
import type { SimpleDocumentSearchResponseBaseItemTimestampSecondsRawContent } from './simpleDocumentSearchResponseBaseItemTimestampSecondsRawContent';
export interface SimpleDocumentSearchResponseBaseItemTimestampSeconds {
- /** The opensearch matches on the document */
- content?: SimpleDocumentSearchResponseBaseItemTimestampSecondsContent;
/** The document id */
document_id: string;
/** The document name */
document_name: string;
/** The file type */
file_type: string;
+ /** The highlights on the document */
+ highlight: SearchHighlight;
/** The node id */
node_id: string;
/** The owner id */
diff --git a/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSecondsContent.ts b/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSecondsContent.ts
deleted file mode 100644
index 0f0177a76e..0000000000
--- a/js/app/packages/service-search/generated/models/simpleDocumentSearchResponseBaseItemTimestampSecondsContent.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-/**
- * The opensearch matches on the document
- */
-export type SimpleDocumentSearchResponseBaseItemTimestampSecondsContent = string[] | null;
diff --git a/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItem.ts b/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItem.ts
index 78d656c109..bfbd390f31 100644
--- a/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItem.ts
+++ b/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItem.ts
@@ -4,7 +4,7 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleEmailSearchResponseBaseItemContent } from './simpleEmailSearchResponseBaseItemContent';
+import type { SearchHighlight } from './searchHighlight';
import type { SimpleEmailSearchResponseBaseItemSentAt } from './simpleEmailSearchResponseBaseItemSentAt';
import type { SimpleEmailSearchResponseBaseItemSubject } from './simpleEmailSearchResponseBaseItemSubject';
@@ -13,8 +13,8 @@ export interface SimpleEmailSearchResponseBaseItem {
bcc: string[];
/** The cc */
cc: string[];
- /** The opensearch matches on the email */
- content?: SimpleEmailSearchResponseBaseItemContent;
+ /** The highlights on the email */
+ highlight: SearchHighlight;
/** The labels */
labels: string[];
/** The link id */
diff --git a/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItemContent.ts b/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItemContent.ts
deleted file mode 100644
index 16023ff1f9..0000000000
--- a/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItemContent.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-/**
- * The opensearch matches on the email
- */
-export type SimpleEmailSearchResponseBaseItemContent = string[] | null;
diff --git a/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSeconds.ts b/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSeconds.ts
index e529040b8f..220fa3632b 100644
--- a/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSeconds.ts
+++ b/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSeconds.ts
@@ -4,7 +4,7 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleEmailSearchResponseBaseItemTimestampSecondsContent } from './simpleEmailSearchResponseBaseItemTimestampSecondsContent';
+import type { SearchHighlight } from './searchHighlight';
import type { SimpleEmailSearchResponseBaseItemTimestampSecondsSentAt } from './simpleEmailSearchResponseBaseItemTimestampSecondsSentAt';
import type { SimpleEmailSearchResponseBaseItemTimestampSecondsSubject } from './simpleEmailSearchResponseBaseItemTimestampSecondsSubject';
@@ -13,8 +13,8 @@ export interface SimpleEmailSearchResponseBaseItemTimestampSeconds {
bcc: string[];
/** The cc */
cc: string[];
- /** The opensearch matches on the email */
- content?: SimpleEmailSearchResponseBaseItemTimestampSecondsContent;
+ /** The highlights on the email */
+ highlight: SearchHighlight;
/** The labels */
labels: string[];
/** The link id */
diff --git a/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSecondsContent.ts b/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSecondsContent.ts
deleted file mode 100644
index 924179763e..0000000000
--- a/js/app/packages/service-search/generated/models/simpleEmailSearchResponseBaseItemTimestampSecondsContent.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-/**
- * The opensearch matches on the email
- */
-export type SimpleEmailSearchResponseBaseItemTimestampSecondsContent = string[] | null;
diff --git a/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItem.ts b/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItem.ts
index 342e0e904c..13c7f68c93 100644
--- a/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItem.ts
+++ b/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItem.ts
@@ -4,13 +4,13 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleProjectSearchResponseBaseItemContent } from './simpleProjectSearchResponseBaseItemContent';
+import type { SearchHighlight } from './searchHighlight';
export interface SimpleProjectSearchResponseBaseItem {
- /** The opensearch matches on the project */
- content?: SimpleProjectSearchResponseBaseItemContent;
/** The time the project was created */
created_at: number;
+ /** The highlights on the project */
+ highlight: SearchHighlight;
/** The project id */
project_id: string;
/** The project name */
diff --git a/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItemContent.ts b/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItemContent.ts
deleted file mode 100644
index 5b6a139c3a..0000000000
--- a/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItemContent.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-/**
- * The opensearch matches on the project
- */
-export type SimpleProjectSearchResponseBaseItemContent = string[] | null;
diff --git a/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItemTimestampSeconds.ts b/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItemTimestampSeconds.ts
index 974a8f0765..be4ee857ab 100644
--- a/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItemTimestampSeconds.ts
+++ b/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItemTimestampSeconds.ts
@@ -4,13 +4,13 @@
* search_service
* OpenAPI spec version: 0.1.0
*/
-import type { SimpleProjectSearchResponseBaseItemTimestampSecondsContent } from './simpleProjectSearchResponseBaseItemTimestampSecondsContent';
+import type { SearchHighlight } from './searchHighlight';
export interface SimpleProjectSearchResponseBaseItemTimestampSeconds {
- /** The opensearch matches on the project */
- content?: SimpleProjectSearchResponseBaseItemTimestampSecondsContent;
/** The time the project was created */
created_at: number;
+ /** The highlights on the project */
+ highlight: SearchHighlight;
/** The project id */
project_id: string;
/** The project name */
diff --git a/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItemTimestampSecondsContent.ts b/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItemTimestampSecondsContent.ts
deleted file mode 100644
index 791da48559..0000000000
--- a/js/app/packages/service-search/generated/models/simpleProjectSearchResponseBaseItemTimestampSecondsContent.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * Generated by orval v7.13.0 🍺
- * Do not edit manually.
- * search_service
- * OpenAPI spec version: 0.1.0
- */
-
-/**
- * The opensearch matches on the project
- */
-export type SimpleProjectSearchResponseBaseItemTimestampSecondsContent = string[] | null;
diff --git a/js/app/packages/service-search/openapi.json b/js/app/packages/service-search/openapi.json
index f058f81458..15a99766a8 100644
--- a/js/app/packages/service-search/openapi.json
+++ b/js/app/packages/service-search/openapi.json
@@ -974,21 +974,20 @@
"required": [
"message_id",
"sender_id",
- "content",
+ "highlight",
"created_at",
"updated_at"
],
"properties": {
- "content": {
- "type": "array",
- "items": { "type": "string" },
- "description": "The array of content matches for the channel message"
- },
"created_at": {
"type": "integer",
"format": "int64",
"description": "When the channel message was created"
},
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights for the channel message"
+ },
"message_id": {
"type": "string",
"description": "The channel message id"
@@ -1037,7 +1036,7 @@
"required": [
"chat_message_id",
"role",
- "content",
+ "highlight",
"updated_at",
"title"
],
@@ -1046,10 +1045,9 @@
"type": "string",
"description": "The chat message id for the chat"
},
- "content": {
- "type": "array",
- "items": { "type": "string" },
- "description": "The array of content matches for the message"
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights for the chat message"
},
"role": {
"type": "string",
@@ -1300,12 +1298,11 @@
"DocumentSearchResult": {
"type": "object",
"description": "A document match for a given node",
- "required": ["node_id", "content", "updated_at"],
+ "required": ["node_id", "highlight", "updated_at"],
"properties": {
- "content": {
- "type": "array",
- "items": { "type": "string" },
- "description": "The array of content matches for the document"
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights for the document"
},
"node_id": {
"type": "string",
@@ -1462,16 +1459,15 @@
"cc",
"bcc",
"labels",
- "content",
+ "highlight",
"updated_at"
],
"properties": {
"bcc": { "type": "array", "items": { "type": "string" } },
"cc": { "type": "array", "items": { "type": "string" } },
- "content": {
- "type": "array",
- "items": { "type": "string" },
- "description": "The array of content matches for the email message"
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights for the email message"
},
"labels": { "type": "array", "items": { "type": "string" } },
"message_id": {
@@ -2057,12 +2053,22 @@
},
"ProjectSearchResult": {
"type": "object",
- "required": ["content"],
+ "required": ["highlight"],
+ "properties": {
+ "highlight": { "$ref": "#/components/schemas/SearchHighlight" }
+ }
+ },
+ "SearchHighlight": {
+ "type": "object",
"properties": {
"content": {
"type": "array",
"items": { "type": "string" },
- "description": "array of content matches for a project"
+ "description": "The highlight match on the content field"
+ },
+ "name": {
+ "type": ["string", "null"],
+ "description": "The highlight match on the name field"
}
}
},
@@ -2092,7 +2098,8 @@
"sender_id",
"mentions",
"created_at",
- "updated_at"
+ "updated_at",
+ "highlight"
],
"properties": {
"channel_id": { "type": "string", "description": "The channel id" },
@@ -2104,15 +2111,14 @@
"type": "string",
"description": "The channel type"
},
- "content": {
- "type": ["array", "null"],
- "items": { "type": "string" },
- "description": "The opensearch matches on the channel message"
- },
"created_at": {
"oneOf": [{ "type": "integer", "format": "int64" }],
"description": "The time the channel message was created"
},
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights on the channel message"
+ },
"mentions": {
"type": "array",
"items": { "type": "string" },
@@ -2144,7 +2150,8 @@
"sender_id",
"mentions",
"created_at",
- "updated_at"
+ "updated_at",
+ "highlight"
],
"properties": {
"channel_id": { "type": "string", "description": "The channel id" },
@@ -2156,15 +2163,14 @@
"type": "string",
"description": "The channel type"
},
- "content": {
- "type": ["array", "null"],
- "items": { "type": "string" },
- "description": "The opensearch matches on the channel message"
- },
"created_at": {
"oneOf": [{ "type": "integer", "format": "int64" }],
"description": "The time the channel message was created"
},
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights on the channel message"
+ },
"mentions": {
"type": "array",
"items": { "type": "string" },
@@ -2221,7 +2227,8 @@
"user_id",
"role",
"updated_at",
- "title"
+ "title",
+ "highlight"
],
"properties": {
"chat_id": { "type": "string", "description": "The chat id" },
@@ -2229,10 +2236,9 @@
"type": "string",
"description": "The chat message id"
},
- "content": {
- "type": ["array", "null"],
- "items": { "type": "string" },
- "description": "The opensearch matches on the chat"
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights on the chat"
},
"role": { "type": "string", "description": "The role" },
"title": { "type": "string", "description": "The title" },
@@ -2251,7 +2257,8 @@
"user_id",
"role",
"updated_at",
- "title"
+ "title",
+ "highlight"
],
"properties": {
"chat_id": { "type": "string", "description": "The chat id" },
@@ -2259,10 +2266,9 @@
"type": "string",
"description": "The chat message id"
},
- "content": {
- "type": ["array", "null"],
- "items": { "type": "string" },
- "description": "The opensearch matches on the chat"
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights on the chat"
},
"role": { "type": "string", "description": "The role" },
"title": { "type": "string", "description": "The title" },
@@ -2294,20 +2300,20 @@
"node_id",
"owner_id",
"file_type",
- "updated_at"
+ "updated_at",
+ "highlight"
],
"properties": {
- "content": {
- "type": ["array", "null"],
- "items": { "type": "string" },
- "description": "The opensearch matches on the document"
- },
"document_id": { "type": "string", "description": "The document id" },
"document_name": {
"type": "string",
"description": "The document name"
},
"file_type": { "type": "string", "description": "The file type" },
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights on the document"
+ },
"node_id": { "type": "string", "description": "The node id" },
"owner_id": { "type": "string", "description": "The owner id" },
"raw_content": {
@@ -2328,20 +2334,20 @@
"node_id",
"owner_id",
"file_type",
- "updated_at"
+ "updated_at",
+ "highlight"
],
"properties": {
- "content": {
- "type": ["array", "null"],
- "items": { "type": "string" },
- "description": "The opensearch matches on the document"
- },
"document_id": { "type": "string", "description": "The document id" },
"document_name": {
"type": "string",
"description": "The document name"
},
"file_type": { "type": "string", "description": "The file type" },
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights on the document"
+ },
"node_id": { "type": "string", "description": "The node id" },
"owner_id": { "type": "string", "description": "The owner id" },
"raw_content": {
@@ -2379,7 +2385,8 @@
"labels",
"link_id",
"user_id",
- "updated_at"
+ "updated_at",
+ "highlight"
],
"properties": {
"bcc": {
@@ -2392,10 +2399,9 @@
"items": { "type": "string" },
"description": "The cc"
},
- "content": {
- "type": ["array", "null"],
- "items": { "type": "string" },
- "description": "The opensearch matches on the email"
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights on the email"
},
"labels": {
"type": "array",
@@ -2441,7 +2447,8 @@
"labels",
"link_id",
"user_id",
- "updated_at"
+ "updated_at",
+ "highlight"
],
"properties": {
"bcc": {
@@ -2454,10 +2461,9 @@
"items": { "type": "string" },
"description": "The cc"
},
- "content": {
- "type": ["array", "null"],
- "items": { "type": "string" },
- "description": "The opensearch matches on the email"
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights on the email"
},
"labels": {
"type": "array",
@@ -2511,18 +2517,18 @@
"updated_at",
"created_at",
"project_name",
- "user_id"
+ "user_id",
+ "highlight"
],
"properties": {
- "content": {
- "type": ["array", "null"],
- "items": { "type": "string" },
- "description": "The opensearch matches on the project"
- },
"created_at": {
"oneOf": [{ "type": "integer", "format": "int64" }],
"description": "The time the project was created"
},
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights on the project"
+ },
"project_id": { "type": "string", "description": "The project id" },
"project_name": {
"type": "string",
@@ -2545,18 +2551,18 @@
"updated_at",
"created_at",
"project_name",
- "user_id"
+ "user_id",
+ "highlight"
],
"properties": {
- "content": {
- "type": ["array", "null"],
- "items": { "type": "string" },
- "description": "The opensearch matches on the project"
- },
"created_at": {
"oneOf": [{ "type": "integer", "format": "int64" }],
"description": "The time the project was created"
},
+ "highlight": {
+ "$ref": "#/components/schemas/SearchHighlight",
+ "description": "The highlights on the project"
+ },
"project_id": { "type": "string", "description": "The project id" },
"project_name": {
"type": "string",