Twenty standard backfill non searchable object search field metadata (#22063)
# Introduction This PR https://github.com/twentyhq/twenty/pull/21964 introduces a search field metadata workspace command backfill that will recompute all the standard search field metadata but only for the searchable object Whereas the non searchable object still have a search vector as they can still be searched but internally Preserving their search vector by computing their search field metadata <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/22063?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ import { WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspa
|
||||
@Command({
|
||||
name: 'upgrade:2-16:backfill-search-field-metadata',
|
||||
description:
|
||||
'Backfill searchFieldMetadata rows for each searchable object. Standard objects mirror their SEARCH_FIELDS_FOR_* set; custom objects get their label-identifier field. Idempotent: existing rows are skipped.',
|
||||
'Backfill searchFieldMetadata rows for every object whose searchVector indexes a meaningful field (not only the globally searchable ones). Standard objects mirror their SEARCH_FIELDS_FOR_* set; custom objects get their label-identifier field. Idempotent: existing rows are skipped.',
|
||||
})
|
||||
export class BackfillSearchFieldMetadataCommand extends ActiveOrSuspendedWorkspaceCommandRunner {
|
||||
constructor(
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type';
|
||||
|
||||
export const SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME = {
|
||||
attachment: [{ name: 'name', type: FieldMetadataType.TEXT }],
|
||||
blocklist: [{ name: 'handle', type: FieldMetadataType.TEXT }],
|
||||
calendarChannelEventAssociation: [
|
||||
{ name: 'eventExternalId', type: FieldMetadataType.TEXT },
|
||||
],
|
||||
calendarEvent: [{ name: 'title', type: FieldMetadataType.TEXT }],
|
||||
calendarEventParticipant: [{ name: 'handle', type: FieldMetadataType.TEXT }],
|
||||
callRecording: [{ name: 'title', type: FieldMetadataType.TEXT }],
|
||||
company: [
|
||||
{ name: 'name', type: FieldMetadataType.TEXT },
|
||||
{ name: 'domainName', type: FieldMetadataType.LINKS },
|
||||
],
|
||||
dashboard: [{ name: 'title', type: FieldMetadataType.TEXT }],
|
||||
message: [{ name: 'subject', type: FieldMetadataType.TEXT }],
|
||||
messageCampaign: [{ name: 'subject', type: FieldMetadataType.TEXT }],
|
||||
messageChannelMessageAssociation: [
|
||||
{ name: 'messageExternalId', type: FieldMetadataType.TEXT },
|
||||
],
|
||||
messageChannelMessageAssociationMessageFolder: [],
|
||||
messageList: [{ name: 'name', type: FieldMetadataType.TEXT }],
|
||||
messageListMember: [{ name: 'id', type: FieldMetadataType.UUID }],
|
||||
messageParticipant: [{ name: 'handle', type: FieldMetadataType.TEXT }],
|
||||
messageThread: [{ name: 'subject', type: FieldMetadataType.TEXT }],
|
||||
note: [
|
||||
{ name: 'title', type: FieldMetadataType.TEXT },
|
||||
{ name: 'bodyV2', type: FieldMetadataType.RICH_TEXT },
|
||||
],
|
||||
noteTarget: [{ name: 'id', type: FieldMetadataType.UUID }],
|
||||
opportunity: [{ name: 'name', type: FieldMetadataType.TEXT }],
|
||||
person: [
|
||||
{ name: 'name', type: FieldMetadataType.FULL_NAME },
|
||||
{ name: 'emails', type: FieldMetadataType.EMAILS },
|
||||
{ name: 'phones', type: FieldMetadataType.PHONES },
|
||||
{ name: 'jobTitle', type: FieldMetadataType.TEXT },
|
||||
],
|
||||
task: [
|
||||
{ name: 'title', type: FieldMetadataType.TEXT },
|
||||
{ name: 'bodyV2', type: FieldMetadataType.RICH_TEXT },
|
||||
],
|
||||
taskTarget: [{ name: 'id', type: FieldMetadataType.UUID }],
|
||||
timelineActivity: [{ name: 'name', type: FieldMetadataType.TEXT }],
|
||||
workflow: [{ name: 'name', type: FieldMetadataType.TEXT }],
|
||||
workflowAutomatedTrigger: [{ name: 'id', type: FieldMetadataType.UUID }],
|
||||
workflowRun: [{ name: 'name', type: FieldMetadataType.TEXT }],
|
||||
workflowVersion: [{ name: 'name', type: FieldMetadataType.TEXT }],
|
||||
workspaceMember: [
|
||||
{ name: 'name', type: FieldMetadataType.FULL_NAME },
|
||||
{ name: 'userEmail', type: FieldMetadataType.TEXT },
|
||||
],
|
||||
} satisfies {
|
||||
[ObjectName in AllStandardObjectName]: {
|
||||
name: AllStandardObjectFieldName<ObjectName>;
|
||||
type: FieldMetadataType;
|
||||
}[];
|
||||
};
|
||||
+2
-2
@@ -16,7 +16,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_ATTACHMENT } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -330,7 +330,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_ATTACHMENT,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_BLOCKLIST } from 'src/modules/blocklist/standard-objects/blocklist.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildBlocklistStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -193,7 +193,7 @@ export const buildBlocklistStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_BLOCKLIST,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_CALENDAR_CHANNEL_EVENT_ASSOCIATION } from 'src/modules/calendar/common/standard-objects/calendar-channel-event-association.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -191,7 +191,7 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_CALENDAR_CHANNEL_EVENT_ASSOCIATION,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_CALENDAR_EVENT_PARTICIPANT } from 'src/modules/calendar/common/standard-objects/calendar-event-participant.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -189,7 +189,7 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_CALENDAR_EVENT_PARTICIPANT,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_CALENDAR_EVENT } from 'src/modules/calendar/common/standard-objects/calendar-event.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildCalendarEventStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -185,7 +185,7 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_CALENDAR_EVENT,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+4
-3
@@ -17,6 +17,7 @@ import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-ma
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { CallRecordingRequestStatus } from 'src/modules/call-recording/common/enums/call-recording-request-status.enum';
|
||||
import { CallRecordingStatus } from 'src/modules/call-recording/common/enums/call-recording-status.enum';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildCallRecordingStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -487,9 +488,9 @@ export const buildCallRecordingStandardFlatFieldMetadatas = ({
|
||||
isNullable: true,
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields([
|
||||
{ name: 'title', type: FieldMetadataType.TEXT },
|
||||
]),
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_COMPANY } from 'src/modules/company/standard-objects/company.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -282,7 +282,7 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_COMPANY,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_DASHBOARD } from 'src/modules/dashboard/standard-objects/dashboard.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildDashboardStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -222,7 +222,7 @@ export const buildDashboardStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_DASHBOARD,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_MESSAGE_CAMPAIGN } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildMessageCampaignStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -163,7 +163,7 @@ export const buildMessageCampaignStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_MESSAGE_CAMPAIGN,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER } from 'src/modules/messaging/common/standard-objects/message-channel-message-association-message-folder.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildMessageChannelMessageAssociationMessageFolderStandardFlatFieldMetadatas =
|
||||
({
|
||||
@@ -195,7 +195,7 @@ export const buildMessageChannelMessageAssociationMessageFolderStandardFlatField
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION } from 'src/modules/messaging/common/standard-objects/message-channel-message-association.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
import { MessageDirection } from 'src/modules/messaging/common/enums/message-direction.enum';
|
||||
|
||||
export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas =
|
||||
@@ -196,7 +196,7 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas =
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+4
-3
@@ -15,6 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildMessageListMemberStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -235,9 +236,9 @@ export const buildMessageListMemberStandardFlatFieldMetadatas = ({
|
||||
isNullable: true,
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields([
|
||||
{ name: 'id', type: FieldMetadataType.UUID },
|
||||
]),
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_MESSAGE_LIST } from 'src/modules/emailing/standard-objects/message-list.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildMessageListStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -272,7 +272,7 @@ export const buildMessageListStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_MESSAGE_LIST,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_MESSAGE_PARTICIPANT } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildMessageParticipantStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -190,7 +190,7 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_MESSAGE_PARTICIPANT,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_MESSAGE } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildMessageStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -186,7 +186,7 @@ export const buildMessageStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_MESSAGE,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_MESSAGE_THREAD } from 'src/modules/messaging/common/standard-objects/message-thread.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildMessageThreadStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -185,7 +185,7 @@ export const buildMessageThreadStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_MESSAGE_THREAD,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_NOTES } from 'src/modules/note/standard-objects/note.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildNoteStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -227,7 +227,7 @@ export const buildNoteStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_NOTES,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+4
-3
@@ -16,6 +16,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildNoteTargetStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -192,9 +193,9 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({
|
||||
isNullable: true,
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields([
|
||||
{ name: 'id', type: FieldMetadataType.UUID },
|
||||
]),
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_OPPORTUNITY } from 'src/modules/opportunity/standard-objects/opportunity.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildOpportunityStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -298,7 +298,7 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_OPPORTUNITY,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_PERSON } from 'src/modules/person/standard-objects/person.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -541,7 +541,7 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_PERSON,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_TASKS } from 'src/modules/task/standard-objects/task.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildTaskStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -284,7 +284,7 @@ export const buildTaskStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_TASKS,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+4
-3
@@ -16,6 +16,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildTaskTargetStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -192,9 +193,9 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({
|
||||
isNullable: true,
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields([
|
||||
{ name: 'id', type: FieldMetadataType.UUID },
|
||||
]),
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_TIMELINE_ACTIVITY } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -600,7 +600,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_TIMELINE_ACTIVITY,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+4
-3
@@ -15,6 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildWorkflowAutomatedTriggerStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -187,9 +188,9 @@ export const buildWorkflowAutomatedTriggerStandardFlatFieldMetadatas = ({
|
||||
isNullable: true,
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields([
|
||||
{ name: 'id', type: FieldMetadataType.UUID },
|
||||
]),
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_WORKFLOW_RUNS } from 'src/modules/workflow/common/standard-objects/workflow-run.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildWorkflowRunStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -363,7 +363,7 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_WORKFLOW_RUNS,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_WORKFLOWS } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildWorkflowStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -261,7 +261,7 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_WORKFLOWS,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_WORKFLOW_VERSIONS } from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
|
||||
export const buildWorkflowVersionStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -291,7 +291,7 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_WORKFLOW_VERSIONS,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+3
-5
@@ -15,10 +15,8 @@ import {
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import {
|
||||
SEARCH_FIELDS_FOR_WORKSPACE_MEMBER,
|
||||
WorkspaceMemberNumberFormatEnum,
|
||||
} from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
import { WorkspaceMemberNumberFormatEnum } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -444,7 +442,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_WORKSPACE_MEMBER,
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
+9
-39
@@ -2,54 +2,24 @@ import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-enti
|
||||
import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
|
||||
import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util';
|
||||
import { type FlatSearchFieldMetadata } from 'src/engine/metadata-modules/flat-search-field-metadata/types/flat-search-field-metadata.type';
|
||||
import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type';
|
||||
import { buildCompanyStandardFlatSearchFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/compute-company-standard-flat-search-field-metadata.util';
|
||||
import { buildDashboardStandardFlatSearchFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/compute-dashboard-standard-flat-search-field-metadata.util';
|
||||
import { buildMessageListStandardFlatSearchFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/compute-message-list-standard-flat-search-field-metadata.util';
|
||||
import { buildNoteStandardFlatSearchFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/compute-note-standard-flat-search-field-metadata.util';
|
||||
import { buildOpportunityStandardFlatSearchFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/compute-opportunity-standard-flat-search-field-metadata.util';
|
||||
import { buildPersonStandardFlatSearchFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/compute-person-standard-flat-search-field-metadata.util';
|
||||
import { buildTaskStandardFlatSearchFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/compute-task-standard-flat-search-field-metadata.util';
|
||||
import { buildWorkflowStandardFlatSearchFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/compute-workflow-standard-flat-search-field-metadata.util';
|
||||
import { buildWorkspaceMemberStandardFlatSearchFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/compute-workspace-member-standard-flat-search-field-metadata.util';
|
||||
import { SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/constants/search-fields-by-standard-object-name.constant';
|
||||
import { buildStandardFlatSearchFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/build-standard-flat-search-field-metadatas.util';
|
||||
import { type CreateStandardSearchFieldArgs } from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/create-standard-search-field-flat-metadata.util';
|
||||
|
||||
type StandardSearchFieldBuilder<P extends AllStandardObjectName> = (
|
||||
args: Omit<CreateStandardSearchFieldArgs<P>, 'context'>,
|
||||
) => FlatSearchFieldMetadata[];
|
||||
|
||||
// Only isSearchable objects get rows; each object's field set mirrors its searchVector
|
||||
// asExpression, built from the same SEARCH_FIELDS_FOR_* constant.
|
||||
const STANDARD_FLAT_SEARCH_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
company: buildCompanyStandardFlatSearchFieldMetadatas,
|
||||
dashboard: buildDashboardStandardFlatSearchFieldMetadatas,
|
||||
messageList: buildMessageListStandardFlatSearchFieldMetadatas,
|
||||
note: buildNoteStandardFlatSearchFieldMetadatas,
|
||||
opportunity: buildOpportunityStandardFlatSearchFieldMetadatas,
|
||||
person: buildPersonStandardFlatSearchFieldMetadatas,
|
||||
task: buildTaskStandardFlatSearchFieldMetadatas,
|
||||
workflow: buildWorkflowStandardFlatSearchFieldMetadatas,
|
||||
workspaceMember: buildWorkspaceMemberStandardFlatSearchFieldMetadatas,
|
||||
} satisfies {
|
||||
[P in AllStandardObjectName]?: StandardSearchFieldBuilder<P>;
|
||||
};
|
||||
|
||||
export const buildStandardFlatSearchFieldMetadataMaps = (
|
||||
args: Omit<CreateStandardSearchFieldArgs, 'context' | 'objectName'>,
|
||||
): FlatEntityMaps<FlatSearchFieldMetadata> => {
|
||||
const allSearchFieldMetadatas: FlatSearchFieldMetadata[] = (
|
||||
Object.keys(
|
||||
STANDARD_FLAT_SEARCH_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME,
|
||||
) as (keyof typeof STANDARD_FLAT_SEARCH_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME)[]
|
||||
).flatMap((objectName) => {
|
||||
const builder: StandardSearchFieldBuilder<typeof objectName> =
|
||||
STANDARD_FLAT_SEARCH_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME[objectName];
|
||||
|
||||
return builder({
|
||||
SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME,
|
||||
) as (keyof typeof SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME)[]
|
||||
).flatMap((objectName) =>
|
||||
buildStandardFlatSearchFieldMetadatas({
|
||||
...args,
|
||||
objectName,
|
||||
});
|
||||
});
|
||||
searchFields: SEARCH_FIELDS_BY_STANDARD_OBJECT_NAME[objectName],
|
||||
}),
|
||||
);
|
||||
|
||||
let flatSearchFieldMetadataMaps = createEmptyFlatEntityMaps();
|
||||
|
||||
|
||||
+11
-9
@@ -1,29 +1,31 @@
|
||||
import { SEARCH_FIELDS_FOR_COMPANY } from 'src/modules/company/standard-objects/company.workspace-entity';
|
||||
|
||||
import { type FlatSearchFieldMetadata } from 'src/engine/metadata-modules/flat-search-field-metadata/types/flat-search-field-metadata.type';
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type';
|
||||
import {
|
||||
type CreateStandardSearchFieldArgs,
|
||||
createStandardSearchFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/create-standard-search-field-flat-metadata.util';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
|
||||
export const buildCompanyStandardFlatSearchFieldMetadatas = ({
|
||||
export const buildStandardFlatSearchFieldMetadatas = <
|
||||
O extends AllStandardObjectName,
|
||||
>({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
searchFields,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<
|
||||
CreateStandardSearchFieldArgs<'company'>,
|
||||
'context'
|
||||
>): FlatSearchFieldMetadata[] =>
|
||||
SEARCH_FIELDS_FOR_COMPANY.map((searchField, position) =>
|
||||
}: Omit<CreateStandardSearchFieldArgs<O>, 'context'> & {
|
||||
searchFields: FieldTypeAndNameMetadata[];
|
||||
}): FlatSearchFieldMetadata[] =>
|
||||
searchFields.map((searchField, position) =>
|
||||
createStandardSearchFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: searchField.name as AllStandardObjectFieldName<'company'>,
|
||||
fieldName: searchField.name as AllStandardObjectFieldName<O>,
|
||||
position,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
import { SEARCH_FIELDS_FOR_DASHBOARD } from 'src/modules/dashboard/standard-objects/dashboard.workspace-entity';
|
||||
|
||||
import { type FlatSearchFieldMetadata } from 'src/engine/metadata-modules/flat-search-field-metadata/types/flat-search-field-metadata.type';
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import {
|
||||
type CreateStandardSearchFieldArgs,
|
||||
createStandardSearchFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/create-standard-search-field-flat-metadata.util';
|
||||
|
||||
export const buildDashboardStandardFlatSearchFieldMetadatas = ({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<
|
||||
CreateStandardSearchFieldArgs<'dashboard'>,
|
||||
'context'
|
||||
>): FlatSearchFieldMetadata[] =>
|
||||
SEARCH_FIELDS_FOR_DASHBOARD.map((searchField, position) =>
|
||||
createStandardSearchFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: searchField.name as AllStandardObjectFieldName<'dashboard'>,
|
||||
position,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
);
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
import { SEARCH_FIELDS_FOR_MESSAGE_LIST } from 'src/modules/emailing/standard-objects/message-list.workspace-entity';
|
||||
|
||||
import { type FlatSearchFieldMetadata } from 'src/engine/metadata-modules/flat-search-field-metadata/types/flat-search-field-metadata.type';
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import {
|
||||
type CreateStandardSearchFieldArgs,
|
||||
createStandardSearchFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/create-standard-search-field-flat-metadata.util';
|
||||
|
||||
export const buildMessageListStandardFlatSearchFieldMetadatas = ({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<
|
||||
CreateStandardSearchFieldArgs<'messageList'>,
|
||||
'context'
|
||||
>): FlatSearchFieldMetadata[] =>
|
||||
SEARCH_FIELDS_FOR_MESSAGE_LIST.map((searchField, position) =>
|
||||
createStandardSearchFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName:
|
||||
searchField.name as AllStandardObjectFieldName<'messageList'>,
|
||||
position,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
);
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
import { SEARCH_FIELDS_FOR_NOTES } from 'src/modules/note/standard-objects/note.workspace-entity';
|
||||
|
||||
import { type FlatSearchFieldMetadata } from 'src/engine/metadata-modules/flat-search-field-metadata/types/flat-search-field-metadata.type';
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import {
|
||||
type CreateStandardSearchFieldArgs,
|
||||
createStandardSearchFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/create-standard-search-field-flat-metadata.util';
|
||||
|
||||
export const buildNoteStandardFlatSearchFieldMetadatas = ({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<
|
||||
CreateStandardSearchFieldArgs<'note'>,
|
||||
'context'
|
||||
>): FlatSearchFieldMetadata[] =>
|
||||
SEARCH_FIELDS_FOR_NOTES.map((searchField, position) =>
|
||||
createStandardSearchFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: searchField.name as AllStandardObjectFieldName<'note'>,
|
||||
position,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
);
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
import { SEARCH_FIELDS_FOR_OPPORTUNITY } from 'src/modules/opportunity/standard-objects/opportunity.workspace-entity';
|
||||
|
||||
import { type FlatSearchFieldMetadata } from 'src/engine/metadata-modules/flat-search-field-metadata/types/flat-search-field-metadata.type';
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import {
|
||||
type CreateStandardSearchFieldArgs,
|
||||
createStandardSearchFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/create-standard-search-field-flat-metadata.util';
|
||||
|
||||
export const buildOpportunityStandardFlatSearchFieldMetadatas = ({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<
|
||||
CreateStandardSearchFieldArgs<'opportunity'>,
|
||||
'context'
|
||||
>): FlatSearchFieldMetadata[] =>
|
||||
SEARCH_FIELDS_FOR_OPPORTUNITY.map((searchField, position) =>
|
||||
createStandardSearchFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName:
|
||||
searchField.name as AllStandardObjectFieldName<'opportunity'>,
|
||||
position,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
);
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
import { SEARCH_FIELDS_FOR_PERSON } from 'src/modules/person/standard-objects/person.workspace-entity';
|
||||
|
||||
import { type FlatSearchFieldMetadata } from 'src/engine/metadata-modules/flat-search-field-metadata/types/flat-search-field-metadata.type';
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import {
|
||||
type CreateStandardSearchFieldArgs,
|
||||
createStandardSearchFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/create-standard-search-field-flat-metadata.util';
|
||||
|
||||
export const buildPersonStandardFlatSearchFieldMetadatas = ({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<
|
||||
CreateStandardSearchFieldArgs<'person'>,
|
||||
'context'
|
||||
>): FlatSearchFieldMetadata[] =>
|
||||
SEARCH_FIELDS_FOR_PERSON.map((searchField, position) =>
|
||||
createStandardSearchFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: searchField.name as AllStandardObjectFieldName<'person'>,
|
||||
position,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
);
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
import { SEARCH_FIELDS_FOR_TASKS } from 'src/modules/task/standard-objects/task.workspace-entity';
|
||||
|
||||
import { type FlatSearchFieldMetadata } from 'src/engine/metadata-modules/flat-search-field-metadata/types/flat-search-field-metadata.type';
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import {
|
||||
type CreateStandardSearchFieldArgs,
|
||||
createStandardSearchFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/create-standard-search-field-flat-metadata.util';
|
||||
|
||||
export const buildTaskStandardFlatSearchFieldMetadatas = ({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<
|
||||
CreateStandardSearchFieldArgs<'task'>,
|
||||
'context'
|
||||
>): FlatSearchFieldMetadata[] =>
|
||||
SEARCH_FIELDS_FOR_TASKS.map((searchField, position) =>
|
||||
createStandardSearchFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: searchField.name as AllStandardObjectFieldName<'task'>,
|
||||
position,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
);
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
import { SEARCH_FIELDS_FOR_WORKFLOWS } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
|
||||
|
||||
import { type FlatSearchFieldMetadata } from 'src/engine/metadata-modules/flat-search-field-metadata/types/flat-search-field-metadata.type';
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import {
|
||||
type CreateStandardSearchFieldArgs,
|
||||
createStandardSearchFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/create-standard-search-field-flat-metadata.util';
|
||||
|
||||
export const buildWorkflowStandardFlatSearchFieldMetadatas = ({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<
|
||||
CreateStandardSearchFieldArgs<'workflow'>,
|
||||
'context'
|
||||
>): FlatSearchFieldMetadata[] =>
|
||||
SEARCH_FIELDS_FOR_WORKFLOWS.map((searchField, position) =>
|
||||
createStandardSearchFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: searchField.name as AllStandardObjectFieldName<'workflow'>,
|
||||
position,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
);
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
import { SEARCH_FIELDS_FOR_WORKSPACE_MEMBER } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
import { type FlatSearchFieldMetadata } from 'src/engine/metadata-modules/flat-search-field-metadata/types/flat-search-field-metadata.type';
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import {
|
||||
type CreateStandardSearchFieldArgs,
|
||||
createStandardSearchFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/search-field-metadata/create-standard-search-field-flat-metadata.util';
|
||||
|
||||
export const buildWorkspaceMemberStandardFlatSearchFieldMetadatas = ({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<
|
||||
CreateStandardSearchFieldArgs<'workspaceMember'>,
|
||||
'context'
|
||||
>): FlatSearchFieldMetadata[] =>
|
||||
SEARCH_FIELDS_FOR_WORKSPACE_MEMBER.map((searchField, position) =>
|
||||
createStandardSearchFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName:
|
||||
searchField.name as AllStandardObjectFieldName<'workspaceMember'>,
|
||||
position,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
);
|
||||
+1
-8
@@ -1,9 +1,8 @@
|
||||
import { type ActorMetadata, FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type ActorMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { type FileOutput } from 'src/engine/api/common/common-args-processors/data-arg-processor/types/file-item.type';
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type CustomWorkspaceEntity } from 'src/engine/twenty-orm/custom.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CompanyWorkspaceEntity } from 'src/modules/company/standard-objects/company.workspace-entity';
|
||||
import { type DashboardWorkspaceEntity } from 'src/modules/dashboard/standard-objects/dashboard.workspace-entity';
|
||||
@@ -14,12 +13,6 @@ import { type TaskWorkspaceEntity } from 'src/modules/task/standard-objects/task
|
||||
import { type WorkflowWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_ATTACHMENT: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class AttachmentWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
/** @deprecated Use `file[0].label` field instead */
|
||||
name: string | null;
|
||||
|
||||
-9
@@ -1,16 +1,7 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const HANDLE_FIELD_NAME = 'handle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_BLOCKLIST: FieldTypeAndNameMetadata[] = [
|
||||
{ name: HANDLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class BlocklistWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
handle: string | null;
|
||||
workspaceMember: EntityRelation<WorkspaceMemberWorkspaceEntity>;
|
||||
|
||||
-8
@@ -1,15 +1,7 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CalendarEventWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event.workspace-entity';
|
||||
|
||||
const EVENT_EXTERNAL_ID_FIELD_NAME = 'eventExternalId';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_CALENDAR_CHANNEL_EVENT_ASSOCIATION: FieldTypeAndNameMetadata[] =
|
||||
[{ name: EVENT_EXTERNAL_ID_FIELD_NAME, type: FieldMetadataType.TEXT }];
|
||||
|
||||
export class CalendarChannelEventAssociationWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
eventExternalId: string | null;
|
||||
recurringEventExternalId: string | null;
|
||||
|
||||
-8
@@ -5,11 +5,9 @@ import {
|
||||
CalendarChannelSyncStage,
|
||||
CalendarChannelSyncStatus,
|
||||
CalendarChannelVisibility,
|
||||
FieldMetadataType,
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CalendarChannelEventAssociationWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-channel-event-association.workspace-entity';
|
||||
|
||||
@@ -36,12 +34,6 @@ registerEnumType(CalendarChannelContactAutoCreationPolicy, {
|
||||
name: 'CalendarChannelContactAutoCreationPolicy',
|
||||
});
|
||||
|
||||
const HANDLE_FIELD_NAME = 'handle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_CALENDAR_CHANNEL: FieldTypeAndNameMetadata[] = [
|
||||
{ name: HANDLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class CalendarChannelWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
handle: string | null;
|
||||
syncStatus: CalendarChannelSyncStatus | null;
|
||||
|
||||
-8
@@ -1,17 +1,9 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CalendarEventWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event.workspace-entity';
|
||||
import { type PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const HANDLE_FIELD_NAME = 'handle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_CALENDAR_EVENT_PARTICIPANT: FieldTypeAndNameMetadata[] =
|
||||
[{ name: HANDLE_FIELD_NAME, type: FieldMetadataType.TEXT }];
|
||||
|
||||
export enum CalendarEventParticipantResponseStatus {
|
||||
NEEDS_ACTION = 'NEEDS_ACTION',
|
||||
DECLINED = 'DECLINED',
|
||||
|
||||
+1
-8
@@ -1,17 +1,10 @@
|
||||
import { FieldMetadataType, type LinksMetadata } from 'twenty-shared/types';
|
||||
import { type LinksMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CalendarChannelEventAssociationWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-channel-event-association.workspace-entity';
|
||||
import { type CalendarEventParticipantWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event-participant.workspace-entity';
|
||||
|
||||
const TITLE_FIELD_NAME = 'title';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_CALENDAR_EVENT: FieldTypeAndNameMetadata[] = [
|
||||
{ name: TITLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class CalendarEventWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
title: string | null;
|
||||
isCanceled: boolean;
|
||||
|
||||
-10
@@ -1,12 +1,10 @@
|
||||
import {
|
||||
FieldMetadataType,
|
||||
type ActorMetadata,
|
||||
type AddressMetadata,
|
||||
type CurrencyMetadata,
|
||||
type LinksMetadata,
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type NoteTargetWorkspaceEntity } from 'src/modules/note/standard-objects/note-target.workspace-entity';
|
||||
@@ -16,14 +14,6 @@ import { type TaskTargetWorkspaceEntity } from 'src/modules/task/standard-object
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
const DOMAIN_NAME_FIELD_NAME = 'domainName';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_COMPANY: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
{ name: DOMAIN_NAME_FIELD_NAME, type: FieldMetadataType.LINKS },
|
||||
];
|
||||
|
||||
export class CompanyWorkspaceEntity {
|
||||
// Base fields
|
||||
id: string;
|
||||
|
||||
+1
-8
@@ -1,17 +1,10 @@
|
||||
import { type ActorMetadata, FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type ActorMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
|
||||
const TITLE_FIELD_NAME = 'title';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_DASHBOARD: FieldTypeAndNameMetadata[] = [
|
||||
{ name: TITLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class DashboardWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
title: string | null;
|
||||
pageLayoutId: string | null;
|
||||
|
||||
+1
-8
@@ -1,18 +1,11 @@
|
||||
import { type EmailsMetadata, FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type EmailsMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageListWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-list.workspace-entity';
|
||||
import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
|
||||
import { type MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
|
||||
|
||||
const SUBJECT_FIELD_NAME = 'subject';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_CAMPAIGN: FieldTypeAndNameMetadata[] = [
|
||||
{ name: SUBJECT_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageCampaignWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
subject: string | null;
|
||||
bodyTemplate: string | null;
|
||||
|
||||
-9
@@ -1,17 +1,8 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageCampaignWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
|
||||
import { type MessageListMemberWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-list-member.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_LIST: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageListWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string | null;
|
||||
members: EntityRelation<MessageListMemberWorkspaceEntity[]>;
|
||||
|
||||
-4
@@ -1,12 +1,8 @@
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageChannelMessageAssociationWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association.workspace-entity';
|
||||
import { type MessageFolderWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-folder.workspace-entity';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER: FieldTypeAndNameMetadata[] =
|
||||
[];
|
||||
|
||||
export class MessageChannelMessageAssociationMessageFolderWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
messageChannelMessageAssociation: EntityRelation<MessageChannelMessageAssociationWorkspaceEntity>;
|
||||
messageChannelMessageAssociationId: string;
|
||||
|
||||
-8
@@ -1,17 +1,9 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageDirection } from 'src/modules/messaging/common/enums/message-direction.enum';
|
||||
import { type MessageChannelMessageAssociationMessageFolderWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association-message-folder.workspace-entity';
|
||||
import { type MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
|
||||
|
||||
const MESSAGE_EXTERNAL_ID_FIELD_NAME = 'messageExternalId';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION: FieldTypeAndNameMetadata[] =
|
||||
[{ name: MESSAGE_EXTERNAL_ID_FIELD_NAME, type: FieldMetadataType.TEXT }];
|
||||
|
||||
export class MessageChannelMessageAssociationWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
messageExternalId: string | null;
|
||||
messageThreadExternalId: string | null;
|
||||
|
||||
-8
@@ -1,7 +1,6 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import {
|
||||
FieldMetadataType,
|
||||
MessageChannelContactAutoCreationPolicy,
|
||||
MessageChannelPendingGroupEmailsAction,
|
||||
MessageChannelSyncStage,
|
||||
@@ -12,7 +11,6 @@ import {
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageChannelMessageAssociationWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association.workspace-entity';
|
||||
import { type MessageFolderWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-folder.workspace-entity';
|
||||
@@ -55,12 +53,6 @@ registerEnumType(MessageChannelPendingGroupEmailsAction, {
|
||||
name: 'MessageChannelPendingGroupEmailsAction',
|
||||
});
|
||||
|
||||
const HANDLE_FIELD_NAME = 'handle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_CHANNEL: FieldTypeAndNameMetadata[] = [
|
||||
{ name: HANDLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageChannelWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
visibility: string;
|
||||
handle: string | null;
|
||||
|
||||
+1
-11
@@ -1,12 +1,8 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import {
|
||||
FieldMetadataType,
|
||||
MessageFolderPendingSyncAction,
|
||||
} from 'twenty-shared/types';
|
||||
import { MessageFolderPendingSyncAction } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageChannelMessageAssociationMessageFolderWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association-message-folder.workspace-entity';
|
||||
|
||||
@@ -16,12 +12,6 @@ registerEnumType(MessageFolderPendingSyncAction, {
|
||||
name: 'MessageFolderPendingSyncAction',
|
||||
});
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_FOLDER: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageFolderWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string | null;
|
||||
syncCursor: string | null;
|
||||
|
||||
+1
-10
@@ -1,21 +1,12 @@
|
||||
import {
|
||||
FieldMetadataType,
|
||||
type MessageParticipantRole,
|
||||
} from 'twenty-shared/types';
|
||||
import { type MessageParticipantRole } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type MessageCampaignWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
|
||||
import { type PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const HANDLE_FIELD_NAME = 'handle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_PARTICIPANT: FieldTypeAndNameMetadata[] =
|
||||
[{ name: HANDLE_FIELD_NAME, type: FieldMetadataType.TEXT }];
|
||||
|
||||
export class MessageParticipantWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
role: MessageParticipantRole;
|
||||
handle: string | null;
|
||||
|
||||
-9
@@ -1,16 +1,7 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
|
||||
|
||||
const SUBJECT_FIELD_NAME = 'subject';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_THREAD: FieldTypeAndNameMetadata[] = [
|
||||
{ name: SUBJECT_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageThreadWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
subject: string | null;
|
||||
messages: EntityRelation<MessageWorkspaceEntity[]>;
|
||||
|
||||
-9
@@ -1,19 +1,10 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageCampaignWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
|
||||
import { type MessageChannelMessageAssociationWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association.workspace-entity';
|
||||
import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
|
||||
import { type MessageThreadWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-thread.workspace-entity';
|
||||
|
||||
const SUBJECT_FIELD_NAME = 'subject';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE: FieldTypeAndNameMetadata[] = [
|
||||
{ name: SUBJECT_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
headerMessageId: string | null;
|
||||
subject: string | null;
|
||||
|
||||
@@ -1,24 +1,11 @@
|
||||
import {
|
||||
type ActorMetadata,
|
||||
FieldMetadataType,
|
||||
type RichTextMetadata,
|
||||
} from 'twenty-shared/types';
|
||||
import { type ActorMetadata, type RichTextMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type NoteTargetWorkspaceEntity } from 'src/modules/note/standard-objects/note-target.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
|
||||
const TITLE_FIELD_NAME = 'title';
|
||||
const BODY_V2_FIELD_NAME = 'bodyV2';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_NOTES: FieldTypeAndNameMetadata[] = [
|
||||
{ name: TITLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
{ name: BODY_V2_FIELD_NAME, type: FieldMetadataType.RICH_TEXT },
|
||||
];
|
||||
|
||||
export class NoteWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
position: number;
|
||||
title: string;
|
||||
|
||||
+1
-12
@@ -1,11 +1,6 @@
|
||||
import {
|
||||
type ActorMetadata,
|
||||
type CurrencyMetadata,
|
||||
FieldMetadataType,
|
||||
} from 'twenty-shared/types';
|
||||
import { type ActorMetadata, type CurrencyMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type CompanyWorkspaceEntity } from 'src/modules/company/standard-objects/company.workspace-entity';
|
||||
@@ -15,12 +10,6 @@ import { type TaskTargetWorkspaceEntity } from 'src/modules/task/standard-object
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_OPPORTUNITY: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class OpportunityWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string;
|
||||
amount: CurrencyMetadata | null;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
type ActorMetadata,
|
||||
type EmailsMetadata,
|
||||
FieldMetadataType,
|
||||
type FullNameMetadata,
|
||||
type LinksMetadata,
|
||||
type PhonesMetadata,
|
||||
@@ -9,7 +8,6 @@ import {
|
||||
|
||||
import { type FileOutput } from 'src/engine/api/common/common-args-processors/data-arg-processor/types/file-item.type';
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type CalendarEventParticipantWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event-participant.workspace-entity';
|
||||
@@ -21,18 +19,6 @@ import { type OpportunityWorkspaceEntity } from 'src/modules/opportunity/standar
|
||||
import { type TaskTargetWorkspaceEntity } from 'src/modules/task/standard-objects/task-target.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
const EMAILS_FIELD_NAME = 'emails';
|
||||
const PHONES_FIELD_NAME = 'phones';
|
||||
const JOB_TITLE_FIELD_NAME = 'jobTitle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_PERSON: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.FULL_NAME },
|
||||
{ name: EMAILS_FIELD_NAME, type: FieldMetadataType.EMAILS },
|
||||
{ name: PHONES_FIELD_NAME, type: FieldMetadataType.PHONES },
|
||||
{ name: JOB_TITLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class PersonWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: FullNameMetadata | null;
|
||||
emails: EmailsMetadata;
|
||||
|
||||
@@ -1,25 +1,12 @@
|
||||
import {
|
||||
type ActorMetadata,
|
||||
FieldMetadataType,
|
||||
type RichTextMetadata,
|
||||
} from 'twenty-shared/types';
|
||||
import { type ActorMetadata, type RichTextMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type TaskTargetWorkspaceEntity } from 'src/modules/task/standard-objects/task-target.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const TITLE_FIELD_NAME = 'title';
|
||||
const BODY_V2_FIELD_NAME = 'bodyV2';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_TASKS: FieldTypeAndNameMetadata[] = [
|
||||
{ name: TITLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
{ name: BODY_V2_FIELD_NAME, type: FieldMetadataType.RICH_TEXT },
|
||||
];
|
||||
|
||||
export class TaskWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
position: number;
|
||||
title: string | null;
|
||||
|
||||
-9
@@ -1,8 +1,5 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type CustomWorkspaceEntity } from 'src/engine/twenty-orm/custom.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CompanyWorkspaceEntity } from 'src/modules/company/standard-objects/company.workspace-entity';
|
||||
import { type DashboardWorkspaceEntity } from 'src/modules/dashboard/standard-objects/dashboard.workspace-entity';
|
||||
@@ -17,12 +14,6 @@ import { type WorkflowVersionWorkspaceEntity } from 'src/modules/workflow/common
|
||||
import { type WorkflowWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_TIMELINE_ACTIVITY: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class TimelineActivityWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
happensAt: Date;
|
||||
name: string | null;
|
||||
|
||||
+1
-8
@@ -1,13 +1,12 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import { type ActorMetadata, FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type ActorMetadata } from 'twenty-shared/types';
|
||||
import {
|
||||
type WorkflowRunStepInfos,
|
||||
type WorkflowRunStepLogs,
|
||||
} from 'twenty-shared/workflow';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
import { type WorkflowVersionWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
|
||||
@@ -54,12 +53,6 @@ export type WorkflowRunState = {
|
||||
workflowRunError?: string;
|
||||
};
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_WORKFLOW_RUNS: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class WorkflowRunWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string | null;
|
||||
enqueuedAt: Date | null;
|
||||
|
||||
-9
@@ -1,7 +1,4 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
import { type WorkflowRunWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-run.workspace-entity';
|
||||
@@ -16,12 +13,6 @@ export enum WorkflowVersionStatus {
|
||||
ARCHIVED = 'ARCHIVED',
|
||||
}
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_WORKFLOW_VERSIONS: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class WorkflowVersionWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string | null;
|
||||
trigger: WorkflowTrigger | null;
|
||||
|
||||
+1
-8
@@ -1,7 +1,6 @@
|
||||
import { type ActorMetadata, FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type ActorMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
@@ -15,12 +14,6 @@ export enum WorkflowStatus {
|
||||
DEACTIVATED = 'DEACTIVATED',
|
||||
}
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_WORKFLOWS: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class WorkflowWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string | null;
|
||||
lastPublishedVersionId: string | null;
|
||||
|
||||
+1
-10
@@ -1,11 +1,10 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import { type APP_LOCALES } from 'twenty-shared/translations';
|
||||
import { FieldMetadataType, type FullNameMetadata } from 'twenty-shared/types';
|
||||
import { type FullNameMetadata } from 'twenty-shared/types';
|
||||
import { type Relation } from 'typeorm';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type BlocklistWorkspaceEntity } from 'src/modules/blocklist/standard-objects/blocklist.workspace-entity';
|
||||
import { type CalendarEventParticipantWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event-participant.workspace-entity';
|
||||
@@ -52,14 +51,6 @@ registerEnumType(WorkspaceMemberDateFormatEnum, {
|
||||
'Date format as Month first, Day first, Year first or system as default',
|
||||
});
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
const USER_EMAIL_FIELD_NAME = 'userEmail';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_WORKSPACE_MEMBER: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.FULL_NAME },
|
||||
{ name: USER_EMAIL_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class WorkspaceMemberWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
position: number;
|
||||
name: FullNameMetadata;
|
||||
|
||||
Reference in New Issue
Block a user