Skip to content

The open alternative to Salesforce, designed for AI.

Accept enum string values in twenty-sdk inputs (#27193)

Paul Rastoin0639fa848ea9
diff --git a/packages/twenty-front/src/modules/settings/logic-functions/components/triggers/SettingsLogicFunctionHttpTriggerSection.tsx b/packages/twenty-front/src/modules/settings/logic-functions/components/triggers/SettingsLogicFunctionHttpTriggerSection.tsx
index ba8f58348e3..f51ff9778f2 100644
--- a/packages/twenty-front/src/modules/settings/logic-functions/components/triggers/SettingsLogicFunctionHttpTriggerSection.tsx
+++ b/packages/twenty-front/src/modules/settings/logic-functions/components/triggers/SettingsLogicFunctionHttpTriggerSection.tsx
@@ -102,7 +102,7 @@ export const SettingsLogicFunctionHttpTriggerSection = ({
label={t`Method`}
fullWidth
disabled={readonly}
- value={value.httpMethod as HTTPMethod}
+ value={value.httpMethod}
options={HTTP_METHOD_OPTIONS}
onChange={(newMethod) => updateField('httpMethod', newMethod)}
dropdownSideOffset={4}
diff --git a/packages/twenty-sdk/src/cli/__tests__/apps/minimal-app/__integration__/app-dev/expected-manifest.ts b/packages/twenty-sdk/src/cli/__tests__/apps/minimal-app/__integration__/app-dev/expected-manifest.ts
index 67e2b79d423..1f8a1374d60 100644
--- a/packages/twenty-sdk/src/cli/__tests__/apps/minimal-app/__integration__/app-dev/expected-manifest.ts
+++ b/packages/twenty-sdk/src/cli/__tests__/apps/minimal-app/__integration__/app-dev/expected-manifest.ts
@@ -1,6 +1,6 @@
import { FieldType } from '@/sdk/define';
import type { Manifest } from 'twenty-shared/application';
-import { FieldMetadataType } from 'twenty-shared/types';
+import { FieldMetadataType, HTTPMethod } from 'twenty-shared/types';
export const EXPECTED_MANIFEST: Manifest = {
commandMenuItems: [],
@@ -60,7 +60,7 @@ export const EXPECTED_MANIFEST: Manifest = {
timeoutSeconds: 5,
httpRouteTriggerSettings: {
path: '/my-function',
- httpMethod: 'GET',
+ httpMethod: HTTPMethod.GET,
isAuthRequired: false,
},
handlerName: 'default.config.handler',
diff --git a/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.ts b/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.ts
index 9e37dc507a1..a117b331792 100644
--- a/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.ts
+++ b/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.ts
@@ -5,12 +5,15 @@ import { SystemPermissionFlag } from 'twenty-shared/constants';
import {
AggregateOperations,
FieldMetadataType,
+ HTTPMethod,
NavigationMenuItemType,
PageLayoutTabLayoutMode,
+ PageLayoutWidgetVerticalListHeightBehavior,
RelationOnDeleteAction,
RelationType,
ViewCalendarLayout,
ViewType,
+ WidgetType,
} from 'twenty-shared/types';
export const EXPECTED_MANIFEST: Manifest = {
@@ -53,7 +56,7 @@ export const EXPECTED_MANIFEST: Manifest = {
{
universalIdentifier: 'b0b1b2b3-b4b5-4000-8000-000000000012',
title: 'Total Priority',
- type: 'GRAPH',
+ type: WidgetType.GRAPH,
objectUniversalIdentifier: '54b589ca-eeed-4950-a176-358418b85c05',
configuration: {
configurationType: 'AGGREGATE_CHART',
@@ -65,8 +68,9 @@ export const EXPECTED_MANIFEST: Manifest = {
{
universalIdentifier: 'b0b1b2b3-b4b5-4000-8000-000000000011',
title: 'Extra Widget',
- type: 'FRONT_COMPONENT',
- heightBehavior: 'TAB_VIEWPORT',
+ type: WidgetType.FRONT_COMPONENT,
+ heightBehavior:
+ PageLayoutWidgetVerticalListHeightBehavior.TAB_VIEWPORT,
configuration: {
configurationType: 'FRONT_COMPONENT',
frontComponentUniversalIdentifier:
@@ -83,7 +87,7 @@ export const EXPECTED_MANIFEST: Manifest = {
STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.companyRecordPage.tabs.home
.universalIdentifier,
title: 'Extra Home Widget',
- type: 'FRONT_COMPONENT',
+ type: WidgetType.FRONT_COMPONENT,
position: {
layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
index: 1000,
@@ -913,7 +917,7 @@ export const EXPECTED_MANIFEST: Manifest = {
sourceHandlerPath: 'src/root.function.ts',
timeoutSeconds: 5,
httpRouteTriggerSettings: {
- httpMethod: 'GET',
+ httpMethod: HTTPMethod.GET,
isAuthRequired: false,
path: '/root',
},
@@ -927,7 +931,7 @@ export const EXPECTED_MANIFEST: Manifest = {
sourceHandlerPath: 'src/logic-functions/greeting.function.ts',
timeoutSeconds: 5,
httpRouteTriggerSettings: {
- httpMethod: 'GET',
+ httpMethod: HTTPMethod.GET,
isAuthRequired: false,
path: '/greet',
},
@@ -1019,7 +1023,7 @@ export const EXPECTED_MANIFEST: Manifest = {
timeoutSeconds: 2,
httpRouteTriggerSettings: {
forwardedRequestHeaders: ['signature'],
- httpMethod: 'GET',
+ httpMethod: HTTPMethod.GET,
isAuthRequired: false,
path: '/post-card/create',
},
diff --git a/packages/twenty-sdk/src/cli/utilities/build/manifest/__tests__/manifest-validate.spec.ts b/packages/twenty-sdk/src/cli/utilities/build/manifest/__tests__/manifest-validate.spec.ts
index 54393a3bd5b..bb85f262cb0 100644
--- a/packages/twenty-sdk/src/cli/utilities/build/manifest/__tests__/manifest-validate.spec.ts
+++ b/packages/twenty-sdk/src/cli/utilities/build/manifest/__tests__/manifest-validate.spec.ts
@@ -9,7 +9,10 @@ import {
AggregateOperations,
FieldMetadataType,
PageLayoutTabLayoutMode,
+ PageLayoutType,
+ PageLayoutWidgetVerticalListHeightBehavior,
RelationType,
+ WidgetType,
} from 'twenty-shared/types';
import { manifestValidate } from '@/cli/utilities/build/manifest/manifest-validate';
@@ -574,7 +577,7 @@ describe('manifestValidate', () => {
{
universalIdentifier: 'b0a5f0f2-6c2e-4d1c-9d0b-2f8a4c3e1a02',
title: 'Total opportunities',
- type: 'GRAPH',
+ type: WidgetType.GRAPH,
configuration,
},
],
@@ -677,7 +680,7 @@ describe('manifestValidate', () => {
{
universalIdentifier: 'a0a1a2a3-a4a5-4000-8000-000000000010',
name: 'Record page',
- type: 'RECORD_PAGE',
+ type: PageLayoutType.RECORD_PAGE,
tabs: [legacyTab],
},
]
@@ -716,7 +719,7 @@ describe('manifestValidate', () => {
{
universalIdentifier: 'a0a1a2a3-a4a5-4000-8000-000000000013',
title: 'Timeline',
- type: 'TIMELINE',
+ type: WidgetType.TIMELINE,
configuration: { configurationType: 'TIMELINE' },
[positionKey]:
positionKey === 'position'
@@ -748,7 +751,7 @@ describe('manifestValidate', () => {
): Manifest['pageLayouts'][number] => ({
universalIdentifier: 'a0a1a2a3-a4a5-4000-8000-000000000010',
name: 'Record page',
- type: 'RECORD_PAGE',
+ type: PageLayoutType.RECORD_PAGE,
objectUniversalIdentifier: 'a0a1a2a3-a4a5-4000-8000-000000000011',
tabs: [
{
@@ -760,8 +763,8 @@ describe('manifestValidate', () => {
{
universalIdentifier: 'a0a1a2a3-a4a5-4000-8000-000000000013',
title: 'App',
- type: 'FRONT_COMPONENT',
- heightBehavior: 'TAB_VIEWPORT',
+ type: WidgetType.FRONT_COMPONENT,
+ heightBehavior: PageLayoutWidgetVerticalListHeightBehavior.TAB_VIEWPORT,
configuration: {
configurationType: 'FRONT_COMPONENT',
frontComponentUniversalIdentifier:
diff --git a/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-build.ts b/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-build.ts
index 552e8e50f81..66e7f6601e8 100644
--- a/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-build.ts
+++ b/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-build.ts
@@ -14,7 +14,8 @@ import { validateConditionalAvailabilityUsage } from '@/cli/utilities/build/mani
import { validateAgentRolesWithinApplicationRole } from '@/cli/utilities/build/manifest/utils/validate-agent-roles-within-application-role';
import { validateViewFilterOperands } from '@/cli/utilities/build/manifest/utils/validate-view-filter-operands';
import { getEngineVersionRange } from '@/cli/utilities/version/get-engine-version-range';
-import { type ApplicationConfig, type LogicFunctionConfig } from '@/sdk/define';
+import { type ApplicationConfig } from '@/sdk/define/application/application-config';
+import { type LogicFunctionConfig } from '@/sdk/define/logic-functions/logic-function-config';
import { type CommandMenuItemConfig } from '@/sdk/define/command-menu-items/command-menu-item-config';
import { type FrontComponentConfig } from '@/sdk/define/front-component/front-component-config';
import { type IndexConfig } from '@/sdk/define/indexes/index-config';
diff --git a/packages/twenty-sdk/src/cli/utilities/pull/__tests__/build-pull-entities.spec.ts b/packages/twenty-sdk/src/cli/utilities/pull/__tests__/build-pull-entities.spec.ts
index b0e0391530d..ca1afc8b34b 100644
--- a/packages/twenty-sdk/src/cli/utilities/pull/__tests__/build-pull-entities.spec.ts
+++ b/packages/twenty-sdk/src/cli/utilities/pull/__tests__/build-pull-entities.spec.ts
@@ -29,8 +29,10 @@ import {
AggregateOperations,
NavigationMenuItemType,
PageLayoutTabLayoutMode,
+ PageLayoutType,
ViewSortDirection,
ViewType,
+ WidgetType,
} from 'twenty-shared/types';
import { describe, expect, it } from 'vitest';
@@ -148,7 +150,7 @@ const buildPageLayoutManifest = (
): PageLayoutManifest => ({
universalIdentifier: PAGE_LAYOUT_UID,
name: 'Pet page',
- type: 'RECORD_PAGE',
+ type: PageLayoutType.RECORD_PAGE,
objectUniversalIdentifier: PET_UID,
tabs: [
{
@@ -160,7 +162,7 @@ const buildPageLayoutManifest = (
{
universalIdentifier: WIDGET_UID,
title: 'Notes',
- type: 'NOTES',
+ type: WidgetType.NOTES,
objectUniversalIdentifier: PET_UID,
position: {
layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
@@ -516,7 +518,10 @@ describe('buildPullEntities', () => {
const {
objectUniversalIdentifier: _objectUniversalIdentifier,
...standalonePageManifest
- } = buildPageLayoutManifest({ name: 'Pet docs', type: 'STANDALONE_PAGE' });
+ } = buildPageLayoutManifest({
+ name: 'Pet docs',
+ type: PageLayoutType.STANDALONE_PAGE,
+ });
const { entities, skipped } = buildPullEntities(
buildManifest({ pageLayouts: [standalonePageManifest] }),
);
diff --git a/packages/twenty-sdk/src/cli/utilities/pull/__tests__/plan-pull-writes.spec.ts b/packages/twenty-sdk/src/cli/utilities/pull/__tests__/plan-pull-writes.spec.ts
index dbb7df9fdd6..428b8c1b07f 100644
--- a/packages/twenty-sdk/src/cli/utilities/pull/__tests__/plan-pull-writes.spec.ts
+++ b/packages/twenty-sdk/src/cli/utilities/pull/__tests__/plan-pull-writes.spec.ts
@@ -17,7 +17,9 @@ import { STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS } from 'twenty-shared/metada
import {
NavigationMenuItemType,
PageLayoutTabLayoutMode,
+ PageLayoutType,
ViewFilterOperand,
+ WidgetType,
} from 'twenty-shared/types';
import { describe, expect, it } from 'vitest';
@@ -122,7 +124,7 @@ const buildPageLayout = (
overrides: Partial<PageLayoutManifest> & { universalIdentifier: string },
): PageLayoutManifest => ({
name: 'Overview',
- type: 'RECORD_PAGE',
+ type: PageLayoutType.RECORD_PAGE,
objectUniversalIdentifier: PET_UID,
...overrides,
});
@@ -180,7 +182,7 @@ const buildManifestWithDocsPageLayout = (url: string): Manifest => ({
{
universalIdentifier: DOCS_WIDGET_UID,
title: 'Docs',
- type: 'IFRAME',
+ type: WidgetType.IFRAME,
position: {
layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
index: 0,
diff --git a/packages/twenty-sdk/src/sdk/define/application/utils/normalize-application-assets.ts b/packages/twenty-sdk/src/sdk/define/application/utils/normalize-application-assets.ts
index f2203ae672d..96484fd345c 100644
--- a/packages/twenty-sdk/src/sdk/define/application/utils/normalize-application-assets.ts
+++ b/packages/twenty-sdk/src/sdk/define/application/utils/normalize-application-assets.ts
@@ -1,6 +1,6 @@
import { isAbsoluteUrl } from 'twenty-shared/utils';
-import { type ApplicationConfig } from '@/sdk/define/application/application-config';
+import { type ApplicationConfig } from '@/sdk/define/common/types/loose-shared-types.type';
export const normalizeApplicationAssets = (
application: ApplicationConfig,
diff --git a/packages/twenty-sdk/src/sdk/define/common/types/define-entity.type.ts b/packages/twenty-sdk/src/sdk/define/common/types/define-entity.type.ts
index 473d9c564b1..009d36618b2 100644
--- a/packages/twenty-sdk/src/sdk/define/common/types/define-entity.type.ts
+++ b/packages/twenty-sdk/src/sdk/define/common/types/define-entity.type.ts
@@ -1,5 +1,6 @@
import { type ApplicationConfig } from '@/sdk/define/application/application-config';
import { type CommandMenuItemConfig } from '@/sdk/define/command-menu-items/command-menu-item-config';
+import { type LooseEnumValues } from '@/sdk/define/common/types/loose-enum-values.type';
import { type FrontComponentConfig } from '@/sdk/define/front-component/front-component-config';
import { type IndexConfig } from '@/sdk/define/indexes/index-config';
import { type LogicFunctionConfig } from '@/sdk/define/logic-functions/logic-function-config';
@@ -55,5 +56,5 @@ export type DefinableEntity =
| SettingsMenuItemConfig;
export type DefineEntity<T extends DefinableEntity = DefinableEntity> = (
- config: T,
-) => ValidationResult<T>;
+ config: LooseEnumValues<T>,
+) => ValidationResult<LooseEnumValues<T>>;
diff --git a/packages/twenty-sdk/src/sdk/define/common/types/loose-enum-values.type.ts b/packages/twenty-sdk/src/sdk/define/common/types/loose-enum-values.type.ts
new file mode 100644
index 00000000000..18e2a352ddb
--- /dev/null
+++ b/packages/twenty-sdk/src/sdk/define/common/types/loose-enum-values.type.ts
@@ -0,0 +1,9 @@
+export type LooseEnumValues<T> = T extends string
+ ? T | `${T}`
+ : T extends
+ | ((...args: never[]) => unknown)
+ | (abstract new (...args: never[]) => unknown)
+ ? T
+ : T extends object
+ ? { [K in keyof T]: LooseEnumValues<T[K]> }
+ : T;
diff --git a/packages/twenty-sdk/src/sdk/define/common/types/loose-shared-types.type.ts b/packages/twenty-sdk/src/sdk/define/common/types/loose-shared-types.type.ts
new file mode 100644
index 00000000000..e5b9912277d
--- /dev/null
+++ b/packages/twenty-sdk/src/sdk/define/common/types/loose-shared-types.type.ts
@@ -0,0 +1,94 @@
+import type * as SharedApplication from 'twenty-shared/application';
+import type * as SharedTypes from 'twenty-shared/types';
+
+import { type ApplicationConfig as StrictApplicationConfig } from '@/sdk/define/application/application-config';
+import { type CommandMenuItemConfig as StrictCommandMenuItemConfig } from '@/sdk/define/command-menu-items/command-menu-item-config';
+import { type LooseEnumValues } from '@/sdk/define/common/types/loose-enum-values.type';
+import { type FrontComponentConfig as StrictFrontComponentConfig } from '@/sdk/define/front-component/front-component-config';
+import { type SettingsFrontComponentConfig as StrictSettingsFrontComponentConfig } from '@/sdk/define/front-component/settings-front-component-config';
+import { type IndexConfig as StrictIndexConfig } from '@/sdk/define/indexes/index-config';
+import { type HealthCheckLogicFunctionConfig as StrictHealthCheckLogicFunctionConfig } from '@/sdk/define/logic-functions/health-check-logic-function-config';
+import { type LogicFunctionConfig as StrictLogicFunctionConfig } from '@/sdk/define/logic-functions/logic-function-config';
+import { type PageLayoutConfig as StrictPageLayoutConfig } from '@/sdk/define/page-layouts/page-layout-config';
+import { type PageLayoutTabConfig as StrictPageLayoutTabConfig } from '@/sdk/define/page-layouts/page-layout-tab-config';
+import { type PermissionFlagConfig as StrictPermissionFlagConfig } from '@/sdk/define/permission-flags/permission-flag-config';
+import { type SettingsMenuItemConfig as StrictSettingsMenuItemConfig } from '@/sdk/define/settings-menu-items/settings-menu-item-config';
+import { type TimelineActivityTypeConfig as StrictTimelineActivityTypeConfig } from '@/sdk/define/timeline-activity-types/timeline-activity-type-config';
+import { type ViewConfig as StrictViewConfig } from '@/sdk/define/views/view-config';
+
+// What apps write; code building the manifest and the server keep the strict types
+export type ApplicationConfig = LooseEnumValues<StrictApplicationConfig>;
+export type CommandMenuItemConfig =
+ LooseEnumValues<StrictCommandMenuItemConfig>;
+export type CommandMenuItemManifest =
+ LooseEnumValues<SharedApplication.CommandMenuItemManifest>;
+export type FrontComponentConfig = LooseEnumValues<StrictFrontComponentConfig>;
+export type HealthCheckLogicFunctionConfig =
+ LooseEnumValues<StrictHealthCheckLogicFunctionConfig>;
+export type IndexConfig = LooseEnumValues<StrictIndexConfig>;
+export type IndexFieldManifest =
+ LooseEnumValues<SharedApplication.IndexFieldManifest>;
+export type IndexManifest = LooseEnumValues<SharedApplication.IndexManifest>;
+export type LogicFunctionConfig = LooseEnumValues<StrictLogicFunctionConfig>;
+export type MessageChannelVisibility =
+ LooseEnumValues<SharedTypes.MessageChannelVisibility>;
+export type MessageParticipantRole =
+ LooseEnumValues<SharedTypes.MessageParticipantRole>;
+export type ObjectFieldManifest =
+ LooseEnumValues<SharedApplication.ObjectFieldManifest>;
+export type PageLayoutConfig = LooseEnumValues<StrictPageLayoutConfig>;
+export type PageLayoutManifest =
+ LooseEnumValues<SharedApplication.PageLayoutManifest>;
+export type PageLayoutTabConfig = LooseEnumValues<StrictPageLayoutTabConfig>;
+export type PageLayoutTabManifest =
+ LooseEnumValues<SharedApplication.PageLayoutTabManifest>;
+export type PageLayoutWidgetCanvasPosition =
+ LooseEnumValues<SharedTypes.PageLayoutWidgetCanvasPosition>;
+export type PageLayoutWidgetConditionalDisplay =
+ LooseEnumValues<SharedTypes.PageLayoutWidgetConditionalDisplay>;
+export type PageLayoutWidgetGridPosition =
+ LooseEnumValues<SharedTypes.PageLayoutWidgetGridPosition>;
+export type PageLayoutWidgetManifest =
+ LooseEnumValues<SharedApplication.PageLayoutWidgetManifest>;
+export type PageLayoutWidgetPosition =
+ LooseEnumValues<SharedTypes.PageLayoutWidgetPosition>;
+export type PageLayoutWidgetUniversalConfiguration =
+ LooseEnumValues<SharedTypes.PageLayoutWidgetUniversalConfiguration>;
+export type PageLayoutWidgetVerticalListPosition =
+ LooseEnumValues<SharedTypes.PageLayoutWidgetVerticalListPosition>;
+export type PermissionFlagConfig = LooseEnumValues<StrictPermissionFlagConfig>;
+export type PermissionFlagManifest =
+ LooseEnumValues<SharedApplication.PermissionFlagManifest>;
+export type RowLevelPermissionPredicateGroupManifest =
+ LooseEnumValues<SharedApplication.RowLevelPermissionPredicateGroupManifest>;
+export type RowLevelPermissionPredicateManifest =
+ LooseEnumValues<SharedApplication.RowLevelPermissionPredicateManifest>;
+export type SendInboxMessageInput =
+ LooseEnumValues<SharedApplication.SendInboxMessageInput>;
+export type SettingsFrontComponentConfig =
+ LooseEnumValues<StrictSettingsFrontComponentConfig>;
+export type SettingsMenuItemConfig =
+ LooseEnumValues<StrictSettingsMenuItemConfig>;
+export type SettingsMenuItemManifest =
+ LooseEnumValues<SharedApplication.SettingsMenuItemManifest>;
+export type StandalonePageLayoutWidgetManifest =
+ LooseEnumValues<SharedApplication.StandalonePageLayoutWidgetManifest>;
+export type StandaloneViewFieldManifest =
+ LooseEnumValues<SharedApplication.StandaloneViewFieldManifest>;
+export type TimelineActivityTypeConfig =
+ LooseEnumValues<StrictTimelineActivityTypeConfig>;
+export type TimelineActivityTypeManifest =
+ LooseEnumValues<SharedApplication.TimelineActivityTypeManifest>;
+export type ViewConfig = LooseEnumValues<StrictViewConfig>;
+export type ViewFieldGroupManifest =
+ LooseEnumValues<SharedApplication.ViewFieldGroupManifest>;
+export type ViewFieldManifest =
+ LooseEnumValues<SharedApplication.ViewFieldManifest>;
+export type ViewFilterGroupManifest =
+ LooseEnumValues<SharedApplication.ViewFilterGroupManifest>;
+export type ViewFilterManifest =
+ LooseEnumValues<SharedApplication.ViewFilterManifest>;
+export type ViewGroupManifest =
+ LooseEnumValues<SharedApplication.ViewGroupManifest>;
+export type ViewSortManifest =
+ LooseEnumValues<SharedApplication.ViewSortManifest>;
diff --git a/packages/twenty-sdk/src/sdk/define/fields/__tests__/define-field.spec.ts b/packages/twenty-sdk/src/sdk/define/fields/__tests__/define-field.spec.ts
index ec44db7eda1..6eda3b94230 100644
--- a/packages/twenty-sdk/src/sdk/define/fields/__tests__/define-field.spec.ts
+++ b/packages/twenty-sdk/src/sdk/define/fields/__tests__/define-field.spec.ts
@@ -36,12 +36,13 @@ describe('defineField', () => {
});
it('should accept SELECT field with options', () => {
- const config: FieldManifest = {
+ const result = defineField({
objectUniversalIdentifier: '20202020-b374-4779-a561-80086cb2e17f',
universalIdentifier: '550e8400-e29b-41d4-a716-446655440003',
- type: FieldMetadataType.SELECT,
+ type: 'SELECT',
name: 'churnRisk',
label: 'Churn Risk',
+ writability: 'OPEN',
options: [
{ value: 'low', label: 'Low', color: 'green', position: 0 },
{
@@ -52,9 +53,7 @@ describe('defineField', () => {
},
{ value: 'high', label: 'High', color: 'red', position: 2 },
],
- };
-
- const result = defineField(config);
+ });
expect(result.success).toBe(true);
expect(result.config?.label).toBe('Churn Risk');
diff --git a/packages/twenty-sdk/src/sdk/define/fields/get-field-default-value-warnings.ts b/packages/twenty-sdk/src/sdk/define/fields/get-field-default-value-warnings.ts
index 2f94f0e5cc5..5f857a504dd 100644
--- a/packages/twenty-sdk/src/sdk/define/fields/get-field-default-value-warnings.ts
+++ b/packages/twenty-sdk/src/sdk/define/fields/get-field-default-value-warnings.ts
@@ -1,4 +1,3 @@
-import { type ObjectFieldManifest } from 'twenty-shared/application';
import { COMPOSITE_FIELD_TYPE_SUB_FIELDS_NAMES } from 'twenty-shared/constants';
import {
fieldMetadataDefaultValueFunctionName,
@@ -8,6 +7,8 @@ import {
import { isDefined, isPlainObject } from 'twenty-shared/utils';
import { isString } from '@sniptt/guards';
+import { type ObjectFieldManifest } from '@/sdk/define/common/types/loose-shared-types.type';
+
const isQuotedString = (value: string): boolean =>
value.length >= 2 && value.startsWith("'") && value.endsWith("'");
diff --git a/packages/twenty-sdk/src/sdk/define/fields/validate-fields.ts b/packages/twenty-sdk/src/sdk/define/fields/validate-fields.ts
index 084156a6b80..f3d288f40dc 100644
--- a/packages/twenty-sdk/src/sdk/define/fields/validate-fields.ts
+++ b/packages/twenty-sdk/src/sdk/define/fields/validate-fields.ts
@@ -2,7 +2,6 @@ import { FieldMetadataType } from 'twenty-shared/types';
import { isNonEmptyString } from '@sniptt/guards';
-import { type ObjectFieldManifest } from 'twenty-shared/application';
import { TAG_COLORS } from 'twenty-shared/constants';
import {
isDefined,
@@ -11,6 +10,8 @@ import {
isTagColor,
} from 'twenty-shared/utils';
+import { type ObjectFieldManifest } from '@/sdk/define/common/types/loose-shared-types.type';
+
const getSelectOptionErrors = (field: ObjectFieldManifest): string[] => {
if (!isFieldMetadataSelectKind(field.type) || !Array.isArray(field.options)) {
return [];
@@ -23,7 +24,11 @@ const getSelectOptionErrors = (field: ObjectFieldManifest): string[] => {
];
}
- if (!isDefined(option.color) || isTagColor(option.color)) {
+ if (
+ !('color' in option) ||
+ !isDefined(option.color) ||
+ isTagColor(option.color)
+ ) {
return [];
}
diff --git a/packages/twenty-sdk/src/sdk/define/index.ts b/packages/twenty-sdk/src/sdk/define/index.ts
index 8107e4c079d..93fce1f6fe0 100644
--- a/packages/twenty-sdk/src/sdk/define/index.ts
+++ b/packages/twenty-sdk/src/sdk/define/index.ts
@@ -1,6 +1,6 @@
export { defineAgent } from '@/sdk/define/agents/define-agent';
-export type { ApplicationConfig } from '@/sdk/define/application/application-config';
+export type { ApplicationConfig } from '@/sdk/define/common/types/loose-shared-types.type';
export { defineApplication } from '@/sdk/define/application/define-application';
export type {
@@ -32,19 +32,23 @@ export { RelationType } from '@/sdk/define/fields/relation-type';
export { validateFields } from '@/sdk/define/fields/validate-fields';
export { defineCommandMenuItem } from '@/sdk/define/command-menu-items/define-command-menu-item';
-export type { CommandMenuItemConfig } from '@/sdk/define/command-menu-items/command-menu-item-config';
-export type { CommandMenuItemManifest } from 'twenty-shared/application';
+export type {
+ CommandMenuItemConfig,
+ CommandMenuItemManifest,
+} from '@/sdk/define/common/types/loose-shared-types.type';
export { defineTimelineActivityType } from '@/sdk/define/timeline-activity-types/define-timeline-activity-type';
-export type { TimelineActivityTypeConfig } from '@/sdk/define/timeline-activity-types/timeline-activity-type-config';
-export type { TimelineActivityTypeManifest } from 'twenty-shared/application';
+export type {
+ TimelineActivityTypeConfig,
+ TimelineActivityTypeManifest,
+} from '@/sdk/define/common/types/loose-shared-types.type';
export { defineSettingsMenuItem } from '@/sdk/define/settings-menu-items/define-settings-menu-item';
-export type { SettingsMenuItemConfig } from '@/sdk/define/settings-menu-items/settings-menu-item-config';
export type {
+ SettingsMenuItemConfig,
SettingsMenuItemManifest,
- SettingsMenuItemScope,
-} from 'twenty-shared/application';
+} from '@/sdk/define/common/types/loose-shared-types.type';
+export type { SettingsMenuItemScope } from 'twenty-shared/application';
export {
canAccessFullAdminPanel,
@@ -82,18 +86,18 @@ export {
export { defineFrontComponent } from '@/sdk/define/front-component/define-front-component';
export { defineSettingsFrontComponent } from '@/sdk/define/front-component/define-settings-front-component';
+export type { FrontComponentType } from '@/sdk/define/front-component/front-component-config';
export type {
FrontComponentConfig,
- FrontComponentType,
-} from '@/sdk/define/front-component/front-component-config';
-export type { SettingsFrontComponentConfig } from '@/sdk/define/front-component/settings-front-component-config';
+ SettingsFrontComponentConfig,
+} from '@/sdk/define/common/types/loose-shared-types.type';
export { defineIndex } from '@/sdk/define/indexes/define-index';
-export type { IndexConfig } from '@/sdk/define/indexes/index-config';
export type {
+ IndexConfig,
IndexFieldManifest,
IndexManifest,
-} from 'twenty-shared/application';
+} from '@/sdk/define/common/types/loose-shared-types.type';
export { defineHealthCheck } from '@/sdk/define/logic-functions/define-health-check';
export { defineLogicFunction } from '@/sdk/define/logic-functions/define-logic-function';
@@ -109,14 +113,14 @@ export type {
UninstallPayload,
} from '@/sdk/define/logic-functions/uninstall-payload-type';
export type { HealthCheckHandler } from '@/sdk/define/logic-functions/health-check-handler-type';
-export type { HealthCheckLogicFunctionConfig } from '@/sdk/define/logic-functions/health-check-logic-function-config';
+export type { HealthCheckLogicFunctionConfig } from '@/sdk/define/common/types/loose-shared-types.type';
export type {
ApplicationHealthCheckAction,
ApplicationHealthCheckResult,
} from 'twenty-shared/application';
export { ApplicationHealthStatus } from 'twenty-shared/application';
+export type { LogicFunctionConfig } from '@/sdk/define/common/types/loose-shared-types.type';
export type {
- LogicFunctionConfig,
LogicFunctionHandler,
ServerRouteResolverResult,
} from '@/sdk/define/logic-functions/logic-function-config';
@@ -151,8 +155,10 @@ export type { TwentyRecord } from '@/sdk/define/objects/twenty-record.type';
export { definePageLayout } from '@/sdk/define/page-layouts/define-page-layout';
export { definePageLayoutTab } from '@/sdk/define/page-layouts/define-page-layout-tab';
export { definePageLayoutWidget } from '@/sdk/define/page-layouts/define-page-layout-widget';
-export type { PageLayoutConfig } from '@/sdk/define/page-layouts/page-layout-config';
-export type { PageLayoutTabConfig } from '@/sdk/define/page-layouts/page-layout-tab-config';
+export type {
+ PageLayoutConfig,
+ PageLayoutTabConfig,
+} from '@/sdk/define/common/types/loose-shared-types.type';
export {
STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS as STANDARD_PAGE_LAYOUT,
STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,
@@ -162,21 +168,21 @@ export type {
PageLayoutTabManifest,
PageLayoutWidgetManifest,
StandalonePageLayoutWidgetManifest,
-} from 'twenty-shared/application';
+} from '@/sdk/define/common/types/loose-shared-types.type';
export { definePermissionFlag } from '@/sdk/define/permission-flags/define-permission-flag';
-export type { PermissionFlagConfig } from '@/sdk/define/permission-flags/permission-flag-config';
export type {
+ PermissionFlagConfig,
PermissionFlagManifest,
- PermissionFlagPermissionType,
-} from 'twenty-shared/application';
+} from '@/sdk/define/common/types/loose-shared-types.type';
+export type { PermissionFlagPermissionType } from 'twenty-shared/application';
export { defineApplicationRole } from '@/sdk/define/roles/define-application-role';
export { defineRole } from '@/sdk/define/roles/define-role';
export type {
RowLevelPermissionPredicateManifest,
RowLevelPermissionPredicateGroupManifest,
-} from 'twenty-shared/application';
+} from '@/sdk/define/common/types/loose-shared-types.type';
export {
RowLevelPermissionPredicateGroupLogicalOperator,
RowLevelPermissionPredicateOperand,
@@ -195,7 +201,7 @@ export {
SYSTEM_VIEW_KEYS,
type SystemViewKey,
} from 'twenty-shared/application';
-export type { ViewConfig } from '@/sdk/define/views/view-config';
+export type { ViewConfig } from '@/sdk/define/common/types/loose-shared-types.type';
export { ViewKey } from '@/sdk/define/views/view-key';
export type {
StandaloneViewFieldManifest,
@@ -204,9 +210,9 @@ export type {
ViewFilterGroupManifest,
ViewFilterManifest,
ViewGroupManifest,
- ViewManifestFilterValue,
ViewSortManifest,
-} from 'twenty-shared/application';
+} from '@/sdk/define/common/types/loose-shared-types.type';
+export type { ViewManifestFilterValue } from 'twenty-shared/application';
export {
AggregateOperations,
@@ -241,4 +247,4 @@ export type {
PageLayoutWidgetPosition,
PageLayoutWidgetUniversalConfiguration,
PageLayoutWidgetVerticalListPosition,
-} from 'twenty-shared/types';
+} from '@/sdk/define/common/types/loose-shared-types.type';
diff --git a/packages/twenty-sdk/src/sdk/define/page-layouts/__tests__/define-page-layout-widget.spec.ts b/packages/twenty-sdk/src/sdk/define/page-layouts/__tests__/define-page-layout-widget.spec.ts
index dede82240ca..c8f40a0a976 100644
--- a/packages/twenty-sdk/src/sdk/define/page-layouts/__tests__/define-page-layout-widget.spec.ts
+++ b/packages/twenty-sdk/src/sdk/define/page-layouts/__tests__/define-page-layout-widget.spec.ts
@@ -2,7 +2,6 @@ import { describe, expect, it } from 'vitest';
import {
definePageLayoutWidget,
- PageLayoutTabLayoutMode,
type StandalonePageLayoutWidgetManifest,
} from '@/sdk/define';
@@ -11,7 +10,7 @@ const WIDGET_CONFIG: StandalonePageLayoutWidgetManifest = {
pageLayoutTabUniversalIdentifier: '22222222-2222-4222-8222-222222222222',
title: 'Docs',
type: 'IFRAME',
- position: { layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST, index: 1000 },
+ position: { layoutMode: 'VERTICAL_LIST', index: 1000 },
configuration: {
configurationType: 'IFRAME',
url: 'https://example.com/docs',
diff --git a/packages/twenty-sdk/src/sdk/define/page-layouts/validate-page-layout-widget.ts b/packages/twenty-sdk/src/sdk/define/page-layouts/validate-page-layout-widget.ts
index 11d32817cf4..14dba6535e2 100644
--- a/packages/twenty-sdk/src/sdk/define/page-layouts/validate-page-layout-widget.ts
+++ b/packages/twenty-sdk/src/sdk/define/page-layouts/validate-page-layout-widget.ts
@@ -1,6 +1,6 @@
-import { type PageLayoutWidgetManifest } from 'twenty-shared/application';
import { isDefined } from 'twenty-shared/utils';
+import { type PageLayoutWidgetManifest } from '@/sdk/define/common/types/loose-shared-types.type';
import { isValidPostgresUuid } from '@/sdk/define/common/utils/is-valid-postgres-uuid';
export const validatePageLayoutWidget = (
diff --git a/packages/twenty-sdk/src/sdk/logic-function/inbox/send-inbox-message.ts b/packages/twenty-sdk/src/sdk/logic-function/inbox/send-inbox-message.ts
index 19fddf60a80..47b1b406176 100644
--- a/packages/twenty-sdk/src/sdk/logic-function/inbox/send-inbox-message.ts
+++ b/packages/twenty-sdk/src/sdk/logic-function/inbox/send-inbox-message.ts
@@ -1,8 +1,6 @@
-import {
- type SendInboxMessageInput,
- type SendInboxMessageResult,
-} from 'twenty-shared/application';
+import { type SendInboxMessageResult } from 'twenty-shared/application';
+import { type SendInboxMessageInput } from '@/sdk/define/common/types/loose-shared-types.type';
import { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';
const SEND_INBOX_MESSAGE_MUTATION = `
diff --git a/packages/twenty-sdk/src/sdk/logic-function/index.ts b/packages/twenty-sdk/src/sdk/logic-function/index.ts
index 7c07726549b..77c0709d955 100644
--- a/packages/twenty-sdk/src/sdk/logic-function/index.ts
+++ b/packages/twenty-sdk/src/sdk/logic-function/index.ts
@@ -1,8 +1,8 @@
// Only what may reach the Lambda runtime; build-time define* factories stay in twenty-sdk/define.
// Logic functions import types from here, never directly from twenty-shared/*.
+export type { LogicFunctionConfig } from '@/sdk/define/common/types/loose-shared-types.type';
export type {
- LogicFunctionConfig,
LogicFunctionHandler,
ServerRouteResolverResult,
} from '@/sdk/define/logic-functions/logic-function-config';
@@ -69,10 +69,8 @@ export { runAgent } from '@/sdk/logic-function/agents/run-agent';
export type { RunAgentInput, RunAgentResult } from 'twenty-shared/application';
export { sendInboxMessage } from '@/sdk/logic-function/inbox/send-inbox-message';
-export type {
- SendInboxMessageInput,
- SendInboxMessageResult,
-} from 'twenty-shared/application';
+export type { SendInboxMessageInput } from '@/sdk/define/common/types/loose-shared-types.type';
+export type { SendInboxMessageResult } from 'twenty-shared/application';
export { enqueueJob } from '@/sdk/logic-function/jobs/enqueue-job';
export { enqueueJobs } from '@/sdk/logic-function/jobs/enqueue-jobs';
diff --git a/packages/twenty-sdk/src/sdk/logic-function/messaging/create-message-channel.ts b/packages/twenty-sdk/src/sdk/logic-function/messaging/create-message-channel.ts
index 09b4ed19d1e..d5a22f5cfa0 100644
--- a/packages/twenty-sdk/src/sdk/logic-function/messaging/create-message-channel.ts
+++ b/packages/twenty-sdk/src/sdk/logic-function/messaging/create-message-channel.ts
@@ -1,5 +1,4 @@
-import { type MessageChannelVisibility } from 'twenty-shared/types';
-
+import { type MessageChannelVisibility } from '@/sdk/define/common/types/loose-shared-types.type';
import { APP_MESSAGE_CHANNEL_SELECTION } from '@/sdk/logic-function/messaging/message-channel-fields.constant';
import { type AppMessageChannel } from '@/sdk/logic-function/messaging/types/app-message-channel.type';
import { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';
diff --git a/packages/twenty-sdk/src/sdk/logic-function/messaging/types/ingest-message.type.ts b/packages/twenty-sdk/src/sdk/logic-function/messaging/types/ingest-message.type.ts
index 8a84665cf82..021c67619f4 100644
--- a/packages/twenty-sdk/src/sdk/logic-function/messaging/types/ingest-message.type.ts
+++ b/packages/twenty-sdk/src/sdk/logic-function/messaging/types/ingest-message.type.ts
@@ -1,4 +1,4 @@
-import { type MessageParticipantRole } from 'twenty-shared/types';
+import { type MessageParticipantRole } from '@/sdk/define/common/types/loose-shared-types.type';
export type IngestMessageParticipant = {
// Exactly one participant must be 'FROM'; when its handle equals the channel's, the message is outgoing
diff --git a/packages/twenty-sdk/src/sdk/logic-function/messaging/update-message-channel.ts b/packages/twenty-sdk/src/sdk/logic-function/messaging/update-message-channel.ts
index 2a6c35e65d8..fe3b45fd5db 100644
--- a/packages/twenty-sdk/src/sdk/logic-function/messaging/update-message-channel.ts
+++ b/packages/twenty-sdk/src/sdk/logic-function/messaging/update-message-channel.ts
@@ -1,5 +1,4 @@
-import { type MessageChannelVisibility } from 'twenty-shared/types';
-
+import { type MessageChannelVisibility } from '@/sdk/define/common/types/loose-shared-types.type';
import { APP_MESSAGE_CHANNEL_SELECTION } from '@/sdk/logic-function/messaging/message-channel-fields.constant';
import { type AppMessageChannel } from '@/sdk/logic-function/messaging/types/app-message-channel.type';
import { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-index-metadata-to-index-manifest.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-index-metadata-to-index-manifest.util.spec.ts
index 1187ae4538b..ad3b8bbcdb5 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-index-metadata-to-index-manifest.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-index-metadata-to-index-manifest.util.spec.ts
@@ -2,7 +2,7 @@ import {
type IndexManifest,
getIndexFieldUniversalIdentifier,
} from 'twenty-shared/application';
-import { FieldMetadataType } from 'twenty-shared/types';
+import { FieldMetadataType, IndexType } from 'twenty-shared/types';
import { fromFlatIndexMetadataToIndexManifest } from 'src/engine/core-modules/application/application-manifest/converters/from-flat-index-metadata-to-index-manifest.util';
import { fromIndexManifestToUniversalFlatIndex } from 'src/engine/core-modules/application/application-manifest/converters/from-index-manifest-to-universal-flat-index.util';
@@ -46,7 +46,7 @@ const objectFlatFieldMetadatas = [
const INDEX_MANIFEST: Required<IndexManifest> = {
universalIdentifier: INDEX_UID,
objectUniversalIdentifier: OBJECT_UID,
- indexType: 'BTREE',
+ indexType: IndexType.BTREE,
isUnique: true,
fields: [
{
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-tab-to-page-layout-tab-manifest.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-tab-to-page-layout-tab-manifest.util.spec.ts
index 150189342df..8b68c2ca139 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-tab-to-page-layout-tab-manifest.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-tab-to-page-layout-tab-manifest.util.spec.ts
@@ -2,7 +2,11 @@ import {
type PageLayoutTabManifest,
type PageLayoutWidgetManifest,
} from 'twenty-shared/application';
-import { PageLayoutTabLayoutMode, PageLayoutType } from 'twenty-shared/types';
+import {
+ PageLayoutTabLayoutMode,
+ PageLayoutType,
+ WidgetType,
+} from 'twenty-shared/types';
import { fromFlatPageLayoutTabToPageLayoutTabManifest } from 'src/engine/core-modules/application/application-manifest/converters/from-flat-page-layout-tab-to-page-layout-tab-manifest.util';
import { fromFlatPageLayoutTabToStandalonePageLayoutTabManifest } from 'src/engine/core-modules/application/application-manifest/converters/from-flat-page-layout-tab-to-standalone-page-layout-tab-manifest.util';
@@ -19,7 +23,7 @@ const NOW = '2026-09-08T10:00:00.000Z';
const WIDGET_MANIFEST: PageLayoutWidgetManifest = {
universalIdentifier: WIDGET_UID,
title: 'Notes',
- type: 'NOTES',
+ type: WidgetType.NOTES,
position: { layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST, index: 0 },
configuration: { configurationType: 'NOTES' },
};
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-to-page-layout-manifest.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-to-page-layout-manifest.util.spec.ts
index 870f65017b5..343b5263b91 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-to-page-layout-manifest.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-to-page-layout-manifest.util.spec.ts
@@ -2,7 +2,7 @@ import {
type PageLayoutManifest,
type PageLayoutTabManifest,
} from 'twenty-shared/application';
-import { PageLayoutTabLayoutMode } from 'twenty-shared/types';
+import { PageLayoutTabLayoutMode, PageLayoutType } from 'twenty-shared/types';
import { fromFlatPageLayoutToPageLayoutManifest } from 'src/engine/core-modules/application/application-manifest/converters/from-flat-page-layout-to-page-layout-manifest.util';
import { fromPageLayoutManifestToUniversalFlatPageLayout } from 'src/engine/core-modules/application/application-manifest/converters/from-page-layout-manifest-to-universal-flat-page-layout.util';
@@ -24,7 +24,7 @@ const TAB_MANIFEST: PageLayoutTabManifest = {
const PAGE_LAYOUT_MANIFEST: Required<Omit<PageLayoutManifest, 'tabs'>> = {
universalIdentifier: PAGE_LAYOUT_UID,
name: 'Pet page',
- type: 'RECORD_PAGE',
+ type: PageLayoutType.RECORD_PAGE,
objectUniversalIdentifier: OBJECT_UID,
defaultTabToFocusOnMobileAndSidePanelUniversalIdentifier: TAB_UID,
};
@@ -32,7 +32,7 @@ const PAGE_LAYOUT_MANIFEST: Required<Omit<PageLayoutManifest, 'tabs'>> = {
const MINIMAL_PAGE_LAYOUT_MANIFEST: PageLayoutManifest = {
universalIdentifier: PAGE_LAYOUT_UID,
name: 'Pet board',
- type: 'STANDALONE_PAGE',
+ type: PageLayoutType.STANDALONE_PAGE,
};
const forward = (pageLayoutManifest: PageLayoutManifest) =>
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-widget-to-page-layout-widget-manifest.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-widget-to-page-layout-widget-manifest.util.spec.ts
index 061d813bd24..422a2cd4ebb 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-widget-to-page-layout-widget-manifest.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-page-layout-widget-to-page-layout-widget-manifest.util.spec.ts
@@ -1,5 +1,9 @@
import { type PageLayoutWidgetManifest } from 'twenty-shared/application';
-import { PageLayoutTabLayoutMode } from 'twenty-shared/types';
+import {
+ PageLayoutTabLayoutMode,
+ PageLayoutWidgetVerticalListHeightBehavior,
+ WidgetType,
+} from 'twenty-shared/types';
import { fromFlatPageLayoutWidgetToPageLayoutWidgetManifest } from 'src/engine/core-modules/application/application-manifest/converters/from-flat-page-layout-widget-to-page-layout-widget-manifest.util';
import { fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget } from 'src/engine/core-modules/application/application-manifest/converters/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util';
@@ -18,7 +22,7 @@ const WIDGET_MANIFEST: Required<
> = {
universalIdentifier: WIDGET_UID,
title: 'Fields',
- type: 'FIELDS',
+ type: WidgetType.FIELDS,
objectUniversalIdentifier: OBJECT_UID,
conditionalDisplay: { device: 'DESKTOP' },
position: { layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST, index: 2 },
@@ -32,7 +36,7 @@ const WIDGET_MANIFEST: Required<
const MINIMAL_WIDGET_MANIFEST: PageLayoutWidgetManifest = {
universalIdentifier: WIDGET_UID,
title: 'Notes',
- type: 'NOTES',
+ type: WidgetType.NOTES,
configuration: { configurationType: 'NOTES' },
};
@@ -93,7 +97,7 @@ describe('fromFlatPageLayoutWidgetToPageLayoutWidgetManifest', () => {
it('should leave the position out and hoist its height behavior when the order of the widgets carries it', () => {
const viewportWidgetManifest: PageLayoutWidgetManifest = {
...MINIMAL_WIDGET_MANIFEST,
- heightBehavior: 'TAB_VIEWPORT',
+ heightBehavior: PageLayoutWidgetVerticalListHeightBehavior.TAB_VIEWPORT,
};
const flatPageLayoutWidget = forward(viewportWidgetManifest);
@@ -134,7 +138,7 @@ describe('fromFlatPageLayoutWidgetToPageLayoutWidgetManifest', () => {
it('should keep an explicit null view reference inside the configuration', () => {
const viewlessFieldsWidgetManifest: PageLayoutWidgetManifest = {
...MINIMAL_WIDGET_MANIFEST,
- type: 'FIELDS',
+ type: WidgetType.FIELDS,
configuration: {
configurationType: 'FIELDS',
viewUniversalIdentifier: null,
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-index-manifest-to-universal-flat-index.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-index-manifest-to-universal-flat-index.util.spec.ts
index a4c7599a014..48bb4081180 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-index-manifest-to-universal-flat-index.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-index-manifest-to-universal-flat-index.util.spec.ts
@@ -28,7 +28,7 @@ describe('fromIndexManifestToUniversalFlatIndex', () => {
const baseManifest = {
universalIdentifier: 'idx-uuid-1',
objectUniversalIdentifier: 'obj-uuid-1',
- indexType: 'BTREE' as const,
+ indexType: IndexType.BTREE,
};
it('builds a flat index from a scalar field', () => {
@@ -221,7 +221,7 @@ describe('fromIndexManifestToUniversalFlatIndex', () => {
fromIndexManifestToUniversalFlatIndex({
indexManifest: {
...baseManifest,
- indexType: 'GIN',
+ indexType: IndexType.GIN,
fields: [
{
universalIdentifier: 'field-entry-1',
@@ -247,7 +247,7 @@ describe('fromIndexManifestToUniversalFlatIndex', () => {
const result = fromIndexManifestToUniversalFlatIndex({
indexManifest: {
...baseManifest,
- indexType: 'GIN',
+ indexType: IndexType.GIN,
fields: [
{
universalIdentifier: 'field-entry-1',
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.spec.ts
index c41f9b04ca5..f0c993b6244 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.spec.ts
@@ -56,7 +56,7 @@ describe('fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget', () => {
pageLayoutWidgetManifest: {
universalIdentifier: 'widget-uuid-2',
title: 'Iframe Widget',
- type: 'IFRAME',
+ type: WidgetType.IFRAME,
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-command-menu-item-manifest-to-universal-flat-command-menu-item.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-command-menu-item-manifest-to-universal-flat-command-menu-item.util.ts
index 68a179ea759..ea6afa48580 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-command-menu-item-manifest-to-universal-flat-command-menu-item.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-command-menu-item-manifest-to-universal-flat-command-menu-item.util.ts
@@ -21,8 +21,9 @@ export const fromCommandMenuItemManifestToUniversalFlatCommandMenuItem = ({
position: 0,
icon: commandMenuItemManifest.icon ?? null,
isPinned: commandMenuItemManifest.isPinned ?? false,
- availabilityType: (commandMenuItemManifest.availabilityType ??
- CommandMenuItemAvailabilityType.GLOBAL) as CommandMenuItemAvailabilityType,
+ availabilityType:
+ commandMenuItemManifest.availabilityType ??
+ CommandMenuItemAvailabilityType.GLOBAL,
conditionalAvailabilityExpression:
commandMenuItemManifest.conditionalAvailabilityExpression ?? null,
conditionalPinnedExpression:
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-index-manifest-to-universal-flat-index.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-index-manifest-to-universal-flat-index.util.ts
index 1f87516b1d8..fb640b9172c 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-index-manifest-to-universal-flat-index.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-index-manifest-to-universal-flat-index.util.ts
@@ -43,8 +43,7 @@ export const fromIndexManifestToUniversalFlatIndex = ({
);
}
- const resolvedIndexType = (indexManifest.indexType ??
- IndexType.BTREE) as IndexType;
+ const resolvedIndexType = indexManifest.indexType ?? IndexType.BTREE;
const resolvedFieldsForValidation: Array<{
type: FieldMetadataType;
name: string;
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-manifest-to-universal-flat-page-layout.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-manifest-to-universal-flat-page-layout.util.ts
index 4f45d74218e..2bf2de58780 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-manifest-to-universal-flat-page-layout.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-manifest-to-universal-flat-page-layout.util.ts
@@ -1,5 +1,4 @@
import { type PageLayoutManifest } from 'twenty-shared/application';
-import { type PageLayoutType } from 'twenty-shared/types';
import { type UniversalFlatPageLayout } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout.type';
@@ -16,7 +15,7 @@ export const fromPageLayoutManifestToUniversalFlatPageLayout = ({
universalIdentifier: pageLayoutManifest.universalIdentifier,
applicationUniversalIdentifier,
name: pageLayoutManifest.name,
- type: pageLayoutManifest.type as PageLayoutType,
+ type: pageLayoutManifest.type,
objectMetadataUniversalIdentifier:
pageLayoutManifest.objectUniversalIdentifier ?? null,
defaultTabToFocusOnMobileAndSidePanelUniversalIdentifier:
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.ts
index 0b22812c9bf..f4a64ffd602 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util.ts
@@ -1,5 +1,4 @@
import { type NormalizedPageLayoutWidgetManifest } from 'twenty-shared/application';
-import { type WidgetType } from 'twenty-shared/types';
import { type UniversalFlatPageLayoutWidget } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-page-layout-widget.type';
@@ -21,7 +20,7 @@ export const fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget = ({
title: pageLayoutWidgetManifest.title,
isActive: true,
isSystemSideEffect: false,
- type: pageLayoutWidgetManifest.type as WidgetType,
+ type: pageLayoutWidgetManifest.type,
objectMetadataUniversalIdentifier:
pageLayoutWidgetManifest.objectUniversalIdentifier ?? null,
conditionalDisplay: pageLayoutWidgetManifest.conditionalDisplay ?? null,
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/export-covers-compared-properties.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/export-covers-compared-properties.spec.ts
index 4993f4edcd8..e7026f7b48f 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/export-covers-compared-properties.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/export-covers-compared-properties.spec.ts
@@ -21,8 +21,9 @@ import {
import {
AggregateOperations,
FieldMetadataType,
- PageLayoutTabLayoutMode,
NavigationMenuItemType,
+ PageLayoutTabLayoutMode,
+ PageLayoutType,
RowLevelPermissionPredicateGroupLogicalOperator,
RowLevelPermissionPredicateOperand,
ViewCalendarLayout,
@@ -32,6 +33,7 @@ import {
ViewSortDirection,
ViewType,
ViewVisibility,
+ WidgetType,
} from 'twenty-shared/types';
import { fromFieldPermissionManifestToUniversalFlatFieldPermission } from 'src/engine/core-modules/application/application-manifest/converters/from-field-permission-manifest-to-universal-flat-field-permission.util';
@@ -179,7 +181,7 @@ const PAGE_LAYOUT_WIDGET_UID = 'ffffffff-ffff-4fff-8fff-ffffffffffff';
const PAGE_LAYOUT_WIDGET_MANIFEST: NormalizedPageLayoutWidgetManifest = {
universalIdentifier: PAGE_LAYOUT_WIDGET_UID,
title: 'Fields',
- type: 'FIELDS',
+ type: WidgetType.FIELDS,
objectUniversalIdentifier: OBJECT_UID,
conditionalDisplay: { device: 'DESKTOP' },
position: { layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST, index: 0 },
@@ -202,7 +204,7 @@ const PAGE_LAYOUT_TAB_MANIFEST: NormalizedPageLayoutTabManifest = {
const PAGE_LAYOUT_MANIFEST: PageLayoutManifest = {
universalIdentifier: PAGE_LAYOUT_UID,
name: 'Pet page',
- type: 'RECORD_PAGE',
+ type: PageLayoutType.RECORD_PAGE,
objectUniversalIdentifier: OBJECT_UID,
defaultTabToFocusOnMobileAndSidePanelUniversalIdentifier: PAGE_LAYOUT_TAB_UID,
tabs: [PAGE_LAYOUT_TAB_MANIFEST],
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/reconstruct-page-layouts-manifest.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/reconstruct-page-layouts-manifest.util.spec.ts
index a5965483b2e..31b0b931207 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/reconstruct-page-layouts-manifest.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/utils/__tests__/reconstruct-page-layouts-manifest.util.spec.ts
@@ -9,6 +9,7 @@ import {
FieldMetadataType,
PageLayoutTabLayoutMode,
PageLayoutType,
+ WidgetType,
} from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -262,7 +263,7 @@ const companyPage = buildFlatPageLayout({
pageLayoutManifest: {
universalIdentifier: COMPANY_PAGE_UID,
name: 'Default Company Layout',
- type: 'RECORD_PAGE',
+ type: PageLayoutType.RECORD_PAGE,
},
applicationUniversalIdentifier:
TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
@@ -327,14 +328,14 @@ const reconstruct = ({
const PET_PAGE_MANIFEST: PageLayoutManifest = {
universalIdentifier: PET_PAGE_UID,
name: 'Pet page',
- type: 'RECORD_PAGE',
+ type: PageLayoutType.RECORD_PAGE,
objectUniversalIdentifier: PET_UID,
};
const ENGINE_PAGE_MANIFEST: PageLayoutManifest = {
universalIdentifier: ENGINE_PAGE_UID,
name: 'Default Pet Layout',
- type: 'RECORD_PAGE',
+ type: PageLayoutType.RECORD_PAGE,
objectUniversalIdentifier: PET_UID,
};
@@ -358,7 +359,7 @@ const buildNotesWidgetManifest = (
): PageLayoutWidgetManifest => ({
universalIdentifier,
title: 'Notes',
- type: 'NOTES',
+ type: WidgetType.NOTES,
objectUniversalIdentifier: PET_UID,
position: { layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST, index: 0 },
configuration: { configurationType: 'NOTES' },
@@ -367,7 +368,7 @@ const buildNotesWidgetManifest = (
const FIELDS_WIDGET_MANIFEST: PageLayoutWidgetManifest = {
universalIdentifier: 'fields-widget',
title: 'Fields',
- type: 'FIELDS',
+ type: WidgetType.FIELDS,
objectUniversalIdentifier: PET_UID,
position: { layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST, index: 1 },
configuration: {
@@ -861,7 +862,7 @@ describe('reconstructPageLayoutsManifest', () => {
buildFlatPageLayoutWidget({
pageLayoutWidgetManifest: {
...buildNotesWidgetManifest('view-widget'),
- type: 'VIEW',
+ type: WidgetType.VIEW,
},
pageLayoutTabUniversalIdentifier: OVERVIEW_TAB_UID,
}),
@@ -913,7 +914,7 @@ describe('reconstructPageLayoutsManifest', () => {
buildFlatPageLayoutWidget({
pageLayoutWidgetManifest: {
...buildNotesWidgetManifest('missing-field-widget'),
- type: 'FORM_FIELD',
+ type: WidgetType.FORM_FIELD,
configuration: {
configurationType: 'FORM_FIELD',
fieldMetadataId: MISSING_UID,
@@ -924,7 +925,7 @@ describe('reconstructPageLayoutsManifest', () => {
buildFlatPageLayoutWidget({
pageLayoutWidgetManifest: {
...buildNotesWidgetManifest('chart-widget'),
- type: 'GRAPH',
+ type: WidgetType.GRAPH,
configuration: {
configurationType: 'AGGREGATE_CHART',
aggregateFieldMetadataUniversalIdentifier: null,
@@ -936,7 +937,7 @@ describe('reconstructPageLayoutsManifest', () => {
buildFlatPageLayoutWidget({
pageLayoutWidgetManifest: {
...buildNotesWidgetManifest('grouped-chart-widget'),
- type: 'GRAPH',
+ type: WidgetType.GRAPH,
configuration: {
configurationType: 'PIE_CHART',
aggregateFieldMetadataUniversalIdentifier: NAME_FIELD_UID,
@@ -956,7 +957,7 @@ describe('reconstructPageLayoutsManifest', () => {
buildFlatPageLayoutWidget({
pageLayoutWidgetManifest: {
...buildNotesWidgetManifest('owned-front-component-widget'),
- type: 'FRONT_COMPONENT',
+ type: WidgetType.FRONT_COMPONENT,
configuration: {
configurationType: 'FRONT_COMPONENT',
frontComponentUniversalIdentifier: FRONT_COMPONENT_UID,
@@ -977,7 +978,7 @@ describe('reconstructPageLayoutsManifest', () => {
buildFlatPageLayoutWidget({
pageLayoutWidgetManifest: {
...buildNotesWidgetManifest('missing-front-component-widget'),
- type: 'FRONT_COMPONENT',
+ type: WidgetType.FRONT_COMPONENT,
configuration: {
configurationType: 'FRONT_COMPONENT',
frontComponentUniversalIdentifier: MISSING_UID,
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/utils/__tests__/validate-logic-function-forwarded-request-headers.util.spec.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/utils/__tests__/validate-logic-function-forwarded-request-headers.util.spec.ts
index 6974b44c9fb..9e6e96c9959 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/utils/__tests__/validate-logic-function-forwarded-request-headers.util.spec.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/utils/__tests__/validate-logic-function-forwarded-request-headers.util.spec.ts
@@ -1,9 +1,10 @@
+import { HTTPMethod } from 'twenty-shared/types';
import { LogicFunctionExceptionCode } from 'src/engine/metadata-modules/logic-function/logic-function.exception';
import { validateLogicFunctionForwardedRequestHeaders } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/utils/validate-logic-function-forwarded-request-headers.util';
const buildHttpRouteTriggerSettings = (forwardedRequestHeaders: unknown) => ({
path: '/route',
- httpMethod: 'POST' as const,
+ httpMethod: HTTPMethod.POST,
isAuthRequired: false,
forwardedRequestHeaders: forwardedRequestHeaders as string[],
});
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/application-uninstall-retry.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/application-uninstall-retry.integration-spec.ts
index c7e9e2ba763..b00c81c26db 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/application-uninstall-retry.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/application-uninstall-retry.integration-spec.ts
@@ -1,3 +1,4 @@
+import { HTTPMethod } from 'twenty-shared/types';
import { randomUUID } from 'crypto';
import { activateWorkspace } from 'test/integration/graphql/utils/activate-workspace.util';
@@ -79,7 +80,7 @@ const buildManifestWithUninstallHook = ({
builtHandlerChecksum: 'checksum-cleanup',
httpRouteTriggerSettings: {
path: '/cleanup',
- httpMethod: 'POST',
+ httpMethod: HTTPMethod.POST,
isAuthRequired: true,
},
},
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/connected-account-deletion-runs-on-disconnect-hook.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/connected-account-deletion-runs-on-disconnect-hook.integration-spec.ts
index 64026facfc5..4160dbe40ed 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/connected-account-deletion-runs-on-disconnect-hook.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/connected-account-deletion-runs-on-disconnect-hook.integration-spec.ts
@@ -6,7 +6,7 @@ import { findConnectionProvidersByApplication } from 'test/integration/metadata/
import { getAppProviderByClassName } from 'test/integration/utils/get-app-provider-by-class-name.util';
import { deleteConnectedAccount } from 'test/integration/utils/query-messaging.util';
import { type Manifest } from 'twenty-shared/application';
-import { ConnectedAccountProvider } from 'twenty-shared/types';
+import { ConnectedAccountProvider, HTTPMethod } from 'twenty-shared/types';
import { v4 as uuidv4 } from 'uuid';
import { AppOAuthRevokeService } from 'src/engine/core-modules/application/connection-provider/refresh/services/app-oauth-revoke.service';
@@ -67,7 +67,7 @@ const buildManifestWithConnectionProvider = ({
builtHandlerChecksum: 'checksum-disconnect',
httpRouteTriggerSettings: {
path: '/disconnect',
- httpMethod: 'POST',
+ httpMethod: HTTPMethod.POST,
isAuthRequired: true,
},
},
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-record-table-view-universal-identifier.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-record-table-view-universal-identifier.integration-spec.ts
index e06b7b181a4..7a082db7336 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-record-table-view-universal-identifier.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/failing-manifest-record-table-view-universal-identifier.integration-spec.ts
@@ -5,7 +5,11 @@ import { setupApplicationForSync } from 'test/integration/metadata/suites/applic
import { syncApplication } from 'test/integration/metadata/suites/application/utils/sync-application.util';
import { type Manifest } from 'twenty-shared/application';
import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
-import { PageLayoutTabLayoutMode, PageLayoutType } from 'twenty-shared/types';
+import {
+ PageLayoutTabLayoutMode,
+ PageLayoutType,
+ WidgetType,
+} from 'twenty-shared/types';
import { v4 as uuidv4 } from 'uuid';
const TEST_APP_ID = uuidv4();
@@ -61,7 +65,7 @@ describe('Failing manifest sync - RECORD_TABLE widget with unknown view universa
{
universalIdentifier: TEST_WIDGET_ID,
title: 'RT test table',
- type: 'RECORD_TABLE',
+ type: WidgetType.RECORD_TABLE,
objectUniversalIdentifier:
PERSON_OBJECT_UNIVERSAL_IDENTIFIER,
position: {
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/logic-function-install-performance.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/logic-function-install-performance.integration-spec.ts
index 33e03a464cc..72a11550ae9 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/logic-function-install-performance.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/logic-function-install-performance.integration-spec.ts
@@ -1,3 +1,4 @@
+import { HTTPMethod } from 'twenty-shared/types';
import { buildBaseManifest } from 'test/integration/metadata/suites/application/utils/build-base-manifest.util';
import { cleanupApplicationAndAppRegistration } from 'test/integration/metadata/suites/application/utils/cleanup-application-and-app-registration.util';
import { setupApplicationForSync } from 'test/integration/metadata/suites/application/utils/setup-application-for-sync.util';
@@ -43,7 +44,7 @@ const buildManifest = ({
builtHandlerChecksum: `checksum-${i}-${checksumVersion}`,
httpRouteTriggerSettings: {
path: `/fn-${i}`,
- httpMethod: 'GET',
+ httpMethod: HTTPMethod.GET,
isAuthRequired: true,
},
}),
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/successful-export-application-data-model.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/successful-export-application-data-model.integration-spec.ts
index de5581038dd..428bb5d4f84 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/successful-export-application-data-model.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/successful-export-application-data-model.integration-spec.ts
@@ -50,6 +50,7 @@ import {
FieldMetadataType,
NavigationMenuItemType,
PageLayoutTabLayoutMode,
+ PageLayoutType,
RelationOnDeleteAction,
RelationType,
RowLevelPermissionPredicateGroupLogicalOperator,
@@ -58,6 +59,7 @@ import {
ViewFilterOperand,
ViewSortDirection,
ViewType,
+ WidgetType,
} from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { version as getUuidVersion, v4 } from 'uuid';
@@ -625,7 +627,7 @@ const projectIndexViewField: StandaloneViewFieldManifest = {
const ticketPageLayout: PageLayoutManifest = {
universalIdentifier: TICKET_PAGE_LAYOUT_ID,
name: 'Ticket page',
- type: 'RECORD_PAGE',
+ type: PageLayoutType.RECORD_PAGE,
objectUniversalIdentifier: TICKET_OBJECT_ID,
defaultTabToFocusOnMobileAndSidePanelUniversalIdentifier:
TICKET_PAGE_OVERVIEW_TAB_ID,
@@ -640,7 +642,7 @@ const ticketPageLayout: PageLayoutManifest = {
{
universalIdentifier: TICKET_PAGE_FIELDS_WIDGET_ID,
title: 'Fields',
- type: 'FIELDS',
+ type: WidgetType.FIELDS,
objectUniversalIdentifier: TICKET_OBJECT_ID,
position: {
layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
@@ -660,7 +662,7 @@ const ticketPageLayout: PageLayoutManifest = {
const ticketBoardLayout: PageLayoutManifest = {
universalIdentifier: TICKET_BOARD_LAYOUT_ID,
name: 'Ticket board',
- type: 'STANDALONE_PAGE',
+ type: PageLayoutType.STANDALONE_PAGE,
tabs: [
{
universalIdentifier: TICKET_BOARD_TAB_ID,
@@ -671,7 +673,7 @@ const ticketBoardLayout: PageLayoutManifest = {
{
universalIdentifier: TICKET_BOARD_DOCS_WIDGET_ID,
title: 'Docs',
- type: 'IFRAME',
+ type: WidgetType.IFRAME,
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
row: 0,
@@ -705,7 +707,7 @@ const ticketRecordPageExtraTab: PageLayoutTabManifest = {
{
universalIdentifier: TICKET_RECORD_PAGE_EXTRA_NOTES_WIDGET_ID,
title: 'Notes',
- type: 'NOTES',
+ type: WidgetType.NOTES,
objectUniversalIdentifier: TICKET_OBJECT_ID,
position: { layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST, index: 0 },
configuration: { configurationType: 'NOTES' },
@@ -733,7 +735,7 @@ const ticketRecordPageHomeDocsWidget: StandalonePageLayoutWidgetManifest = {
title: 'Home',
}),
title: 'Docs',
- type: 'IFRAME',
+ type: WidgetType.IFRAME,
position: { layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST, index: 1 },
configuration: {
configurationType: 'IFRAME',
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-record-table-view-universal-identifier.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-record-table-view-universal-identifier.integration-spec.ts
index 1081b25c6ca..99b2214b972 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-record-table-view-universal-identifier.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-record-table-view-universal-identifier.integration-spec.ts
@@ -8,6 +8,7 @@ import {
PageLayoutTabLayoutMode,
PageLayoutType,
ViewType,
+ WidgetType,
} from 'twenty-shared/types';
import { v4 as uuidv4 } from 'uuid';
@@ -57,7 +58,7 @@ const buildManifestWithRecordTableDashboard = () =>
{
universalIdentifier: TEST_WIDGET_ID,
title: 'RT test table',
- type: 'RECORD_TABLE',
+ type: WidgetType.RECORD_TABLE,
objectUniversalIdentifier: PERSON_OBJECT_UNIVERSAL_IDENTIFIER,
position: {
layoutMode: PageLayoutTabLayoutMode.GRID,
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-tab.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-tab.integration-spec.ts
index 9f05f103489..b7234ab9335 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-tab.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-tab.integration-spec.ts
@@ -7,7 +7,7 @@ import { findPageLayoutWidgets } from 'test/integration/metadata/suites/page-lay
import { getAppProviderByClassName } from 'test/integration/utils/get-app-provider-by-class-name.util';
import { type Manifest } from 'twenty-shared/application';
import { STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS } from 'twenty-shared/metadata';
-import { PageLayoutTabLayoutMode } from 'twenty-shared/types';
+import { PageLayoutTabLayoutMode, WidgetType } from 'twenty-shared/types';
import { v4 as uuidv4 } from 'uuid';
import { MigrateCanvasTabsToVerticalListSlowInstanceCommand } from 'src/database/commands/upgrade-version-command/2-40/2-40-instance-command-slow-1789139070588-migrate-canvas-tabs-to-vertical-list';
@@ -273,7 +273,7 @@ describe('Manifest update - page layout tabs (standalone)', () => {
{
universalIdentifier: TEST_WIDGET_ID,
title: 'Timeline',
- type: 'TIMELINE' as const,
+ type: WidgetType.TIMELINE,
configuration: {
configurationType: 'TIMELINE' as const,
},
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-widget.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-widget.integration-spec.ts
index 20aef7e063e..30a4ac0eb9d 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-widget.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/successful-manifest-update-page-layout-widget.integration-spec.ts
@@ -9,7 +9,7 @@ import {
type StandalonePageLayoutWidgetManifest,
} from 'twenty-shared/application';
import { STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS } from 'twenty-shared/metadata';
-import { PageLayoutTabLayoutMode } from 'twenty-shared/types';
+import { PageLayoutTabLayoutMode, WidgetType } from 'twenty-shared/types';
import { v4 as uuidv4 } from 'uuid';
const TEST_APP_ID = uuidv4();
@@ -59,7 +59,7 @@ const buildTimelineWidget = ({
universalIdentifier: TEST_WIDGET_ID,
pageLayoutTabUniversalIdentifier: STANDARD_PERSON_HOME_TAB_UNIVERSAL_ID,
title,
- type: 'TIMELINE',
+ type: WidgetType.TIMELINE,
position: { layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST, index },
configuration: { configurationType: 'TIMELINE' },
});
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/successful-sync-application-additive-mode.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/successful-sync-application-additive-mode.integration-spec.ts
index d63170b4ded..71fafea92ed 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/successful-sync-application-additive-mode.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/successful-sync-application-additive-mode.integration-spec.ts
@@ -1,3 +1,4 @@
+import { HTTPMethod } from 'twenty-shared/types';
import { buildBaseManifest } from 'test/integration/metadata/suites/application/utils/build-base-manifest.util';
import { buildDefaultObjectManifest } from 'test/integration/metadata/suites/application/utils/build-default-object-manifest.util';
import { cleanupApplicationAndAppRegistration } from 'test/integration/metadata/suites/application/utils/cleanup-application-and-app-registration.util';
@@ -79,7 +80,7 @@ const buildManifestWithApplicationReferences = (): Manifest => {
builtHandlerChecksum: 'checksum-cleanup',
httpRouteTriggerSettings: {
path: '/cleanup',
- httpMethod: 'POST',
+ httpMethod: HTTPMethod.POST,
isAuthRequired: true,
},
},
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/successful-uninstall-application-logic-function-hook.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/successful-uninstall-application-logic-function-hook.integration-spec.ts
index 4639421449f..b5cab24cc68 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/successful-uninstall-application-logic-function-hook.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/successful-uninstall-application-logic-function-hook.integration-spec.ts
@@ -1,3 +1,4 @@
+import { HTTPMethod } from 'twenty-shared/types';
import { buildBaseManifest } from 'test/integration/metadata/suites/application/utils/build-base-manifest.util';
import { cleanupApplicationAndAppRegistration } from 'test/integration/metadata/suites/application/utils/cleanup-application-and-app-registration.util';
import { setupApplicationForSync } from 'test/integration/metadata/suites/application/utils/setup-application-for-sync.util';
@@ -42,7 +43,7 @@ const buildManifestWithLogicFunction = ({
builtHandlerChecksum: 'checksum-cleanup',
httpRouteTriggerSettings: {
path: '/cleanup',
- httpMethod: 'POST',
+ httpMethod: HTTPMethod.POST,
isAuthRequired: true,
},
},
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/utils/setup-application-with-resources.util.ts b/packages/twenty-server/test/integration/metadata/suites/application/utils/setup-application-with-resources.util.ts
index a786f95e5fb..f6b3c0c3782 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/utils/setup-application-with-resources.util.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/utils/setup-application-with-resources.util.ts
@@ -1,3 +1,4 @@
+import { HTTPMethod } from 'twenty-shared/types';
import { buildBaseManifest } from 'test/integration/metadata/suites/application/utils/build-base-manifest.util';
import { seedBuiltFrontComponentSharedDependenciesFile } from 'test/integration/metadata/suites/application/utils/seed-built-front-component-shared-dependencies-file.util';
import { setupApplicationForSync } from 'test/integration/metadata/suites/application/utils/setup-application-for-sync.util';
@@ -135,7 +136,7 @@ export const setupApplicationWithResources = async ({
builtHandlerChecksum: 'handler-checksum',
httpRouteTriggerSettings: {
path: `/${slug}`,
- httpMethod: 'POST',
+ httpMethod: HTTPMethod.POST,
isAuthRequired: true,
},
toolTriggerSettings: {},
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/workspace-deletion-runs-uninstall-hooks.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/application/workspace-deletion-runs-uninstall-hooks.integration-spec.ts
index 15ffad7347d..53b87f3c2b8 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/workspace-deletion-runs-uninstall-hooks.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/application/workspace-deletion-runs-uninstall-hooks.integration-spec.ts
@@ -1,3 +1,4 @@
+import { HTTPMethod } from 'twenty-shared/types';
import { randomUUID } from 'crypto';
import { activateWorkspace } from 'test/integration/graphql/utils/activate-workspace.util';
@@ -51,7 +52,7 @@ const buildManifestWithUninstallHook = ({
builtHandlerChecksum: 'checksum-cleanup',
httpRouteTriggerSettings: {
path: '/cleanup',
- httpMethod: 'POST',
+ httpMethod: HTTPMethod.POST,
isAuthRequired: true,
},
},
diff --git a/packages/twenty-server/test/integration/metadata/suites/logic-function/failing-logic-function-forwarded-credential-headers.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/logic-function/failing-logic-function-forwarded-credential-headers.integration-spec.ts
index b79333cdba8..6481ebc78e7 100644
--- a/packages/twenty-server/test/integration/metadata/suites/logic-function/failing-logic-function-forwarded-credential-headers.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/logic-function/failing-logic-function-forwarded-credential-headers.integration-spec.ts
@@ -1,3 +1,4 @@
+import { HTTPMethod } from 'twenty-shared/types';
import { expectOneNotInternalServerErrorSnapshot } from 'test/integration/graphql/utils/expect-one-not-internal-server-error-snapshot.util';
import { buildBaseManifest } from 'test/integration/metadata/suites/application/utils/build-base-manifest.util';
import { cleanupApplicationAndAppRegistration } from 'test/integration/metadata/suites/application/utils/cleanup-application-and-app-registration.util';
@@ -35,7 +36,7 @@ const buildLogicFunction = (
const buildHttpRouteTriggerSettings = (forwardedRequestHeaders: string[]) => ({
path: '/forwarded-headers',
- httpMethod: 'POST' as const,
+ httpMethod: HTTPMethod.POST,
isAuthRequired: false,
forwardedRequestHeaders,
});
diff --git a/packages/twenty-server/test/integration/route-trigger/suites/route-trigger-forwarded-headers.integration-spec.ts b/packages/twenty-server/test/integration/route-trigger/suites/route-trigger-forwarded-headers.integration-spec.ts
index 1435e4ee4bc..e6c2254f15e 100644
--- a/packages/twenty-server/test/integration/route-trigger/suites/route-trigger-forwarded-headers.integration-spec.ts
+++ b/packages/twenty-server/test/integration/route-trigger/suites/route-trigger-forwarded-headers.integration-spec.ts
@@ -1,3 +1,4 @@
+import { HTTPMethod } from 'twenty-shared/types';
import request from 'supertest';
import { buildBaseManifest } from 'test/integration/metadata/suites/application/utils/build-base-manifest.util';
import { cleanupApplicationAndAppRegistration } from 'test/integration/metadata/suites/application/utils/cleanup-application-and-app-registration.util';
@@ -24,7 +25,7 @@ const ECHO_HEADERS_BUILT_HANDLER_CODE = `export const main = async (event) => ev
const echoHeadersRouteTriggerSettings = {
path: '/echo-headers-route',
- httpMethod: 'GET' as const,
+ httpMethod: HTTPMethod.GET,
isAuthRequired: true,
forwardedRequestHeaders: [CUSTOM_HEADER_NAME],
};
diff --git a/packages/twenty-server/test/integration/route-trigger/suites/route-trigger-suspended-workspace.integration-spec.ts b/packages/twenty-server/test/integration/route-trigger/suites/route-trigger-suspended-workspace.integration-spec.ts
index 2ba344d3b8e..3d8c9d85e7b 100644
--- a/packages/twenty-server/test/integration/route-trigger/suites/route-trigger-suspended-workspace.integration-spec.ts
+++ b/packages/twenty-server/test/integration/route-trigger/suites/route-trigger-suspended-workspace.integration-spec.ts
@@ -1,3 +1,4 @@
+import { HTTPMethod } from 'twenty-shared/types';
import request from 'supertest';
import { findManyApplications } from 'test/integration/graphql/utils/find-many-applications.util';
import { buildBaseManifest } from 'test/integration/metadata/suites/application/utils/build-base-manifest.util';
@@ -57,7 +58,7 @@ const routeFunctionManifest: LogicFunctionManifest = {
builtHandlerChecksum: 'checksum-suspended-workspace-route',
httpRouteTriggerSettings: {
path: '/suspended-workspace-route',
- httpMethod: 'GET',
+ httpMethod: HTTPMethod.GET,
isAuthRequired: false,
},
};
@@ -71,7 +72,7 @@ const authenticatedRouteFunctionManifest: LogicFunctionManifest = {
builtHandlerChecksum: 'checksum-authenticated-workspace-route',
httpRouteTriggerSettings: {
path: '/authenticated-workspace-route',
- httpMethod: 'GET',
+ httpMethod: HTTPMethod.GET,
isAuthRequired: true,
},
};
diff --git a/packages/twenty-server/test/integration/server-route-trigger/suites/server-route-trigger-authorization.integration-spec.ts b/packages/twenty-server/test/integration/server-route-trigger/suites/server-route-trigger-authorization.integration-spec.ts
index fce86b35b44..bc5fd0b448b 100644
--- a/packages/twenty-server/test/integration/server-route-trigger/suites/server-route-trigger-authorization.integration-spec.ts
+++ b/packages/twenty-server/test/integration/server-route-trigger/suites/server-route-trigger-authorization.integration-spec.ts
@@ -9,7 +9,10 @@ import {
type LogicFunctionManifest,
type ServerRouteTriggerSettings,
} from 'twenty-shared/application';
-import { LOGIC_FUNCTION_HTTP_RESPONSE_MARKER } from 'twenty-shared/types';
+import {
+ HTTPMethod,
+ LOGIC_FUNCTION_HTTP_RESPONSE_MARKER,
+} from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { SEED_APPLE_WORKSPACE_ID } from 'src/engine/workspace-manager/dev-seeder/core/constants/seeder-workspaces.constant';
@@ -87,7 +90,7 @@ const buildLogicFunctionManifest = ({
? {
httpRouteTriggerSettings: {
path: `/${name}`,
- httpMethod: 'POST',
+ httpMethod: HTTPMethod.POST,
isAuthRequired: true,
},
}
@@ -190,7 +193,7 @@ describe('ServerRouteTrigger authorization (integration)', () => {
name: 'get-handshake-resolver',
serverRouteExposed: true,
authRequired: false,
- httpMethods: ['GET', 'POST'],
+ httpMethods: [HTTPMethod.GET, HTTPMethod.POST],
}),
buildLogicFunctionManifest({
universalIdentifier: TARGET_FUNCTION_UNIVERSAL_IDENTIFIER,
diff --git a/packages/twenty-shared/src/application/__tests__/normalizePageLayoutTabManifest.test.ts b/packages/twenty-shared/src/application/__tests__/normalizePageLayoutTabManifest.test.ts
index 6c02df6cf7f..b3ad805d795 100644
--- a/packages/twenty-shared/src/application/__tests__/normalizePageLayoutTabManifest.test.ts
+++ b/packages/twenty-shared/src/application/__tests__/normalizePageLayoutTabManifest.test.ts
@@ -7,13 +7,14 @@ import {
PageLayoutTabLayoutMode,
PageLayoutType,
PageLayoutWidgetVerticalListHeightBehavior,
+ WidgetType,
} from '../../types';
import { DEFAULT_WIDGET_SIZE } from '../../constants';
const widget: PageLayoutWidgetManifest = {
universalIdentifier: 'widget',
title: 'App',
- type: 'FRONT_COMPONENT',
+ type: WidgetType.FRONT_COMPONENT,
configuration: {
configurationType: 'FRONT_COMPONENT',
frontComponentUniversalIdentifier: 'component',
@@ -58,11 +59,16 @@ describe('normalizePageLayoutTabManifest', () => {
const input: PageLayoutTabManifest = {
...tab,
widgets: [
- { ...widget, heightBehavior: 'FIT_CONTENT' as const },
+ {
+ ...widget,
+ heightBehavior:
+ PageLayoutWidgetVerticalListHeightBehavior.FIT_CONTENT,
+ },
{
...widget,
universalIdentifier: 'second-widget',
- heightBehavior: 'TAB_VIEWPORT' as const,
+ heightBehavior:
+ PageLayoutWidgetVerticalListHeightBehavior.TAB_VIEWPORT,
position: {
layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
index: 99,
@@ -75,7 +81,7 @@ describe('normalizePageLayoutTabManifest', () => {
const original = JSON.stringify(input);
const result = normalizePageLayoutTabManifest({
pageLayoutTabManifest: input,
- pageLayoutType: 'RECORD_PAGE',
+ pageLayoutType: PageLayoutType.RECORD_PAGE,
});
expect(result).toEqual({
@@ -194,7 +200,12 @@ describe('normalizePageLayoutTabManifest', () => {
});
describe.each<{ name: string; viewport: Partial<PageLayoutWidgetManifest> }>([
- { name: 'explicit height', viewport: { heightBehavior: 'TAB_VIEWPORT' } },
+ {
+ name: 'explicit height',
+ viewport: {
+ heightBehavior: PageLayoutWidgetVerticalListHeightBehavior.TAB_VIEWPORT,
+ },
+ },
{
name: 'legacy nested height',
viewport: {
@@ -209,7 +220,7 @@ describe('normalizePageLayoutTabManifest', () => {
{
name: 'widget type default',
viewport: {
- type: 'TIMELINE',
+ type: WidgetType.TIMELINE,
configuration: { configurationType: 'TIMELINE' },
},
},
@@ -283,14 +294,15 @@ describe('normalizePageLayoutTabManifest', () => {
widgets: [
{
...widget,
- type: 'TIMELINE',
+ type: WidgetType.TIMELINE,
configuration: { configurationType: 'TIMELINE' },
- heightBehavior: 'FIT_CONTENT',
+ heightBehavior:
+ PageLayoutWidgetVerticalListHeightBehavior.FIT_CONTENT,
},
{
...widget,
universalIdentifier: 'second-widget',
- type: 'TIMELINE',
+ type: WidgetType.TIMELINE,
configuration: { configurationType: 'TIMELINE' },
},
],
@@ -391,7 +403,7 @@ describe('normalizePageLayoutTabManifest', () => {
...tab,
layoutMode: PageLayoutTabLayoutMode.GRID,
},
- pageLayoutType: 'STANDALONE_PAGE',
+ pageLayoutType: PageLayoutType.STANDALONE_PAGE,
}),
).toMatchObject({
status: 'success',
@@ -539,7 +551,13 @@ describe('normalizePageLayoutTabManifest', () => {
pageLayoutTabManifest: {
...tab,
layoutMode,
- widgets: [{ ...widget, heightBehavior: 'TAB_VIEWPORT' }],
+ widgets: [
+ {
+ ...widget,
+ heightBehavior:
+ PageLayoutWidgetVerticalListHeightBehavior.TAB_VIEWPORT,
+ },
+ ],
},
pageLayoutType: undefined,
}),
diff --git a/packages/twenty-shared/src/application/frontComponentManifestType.ts b/packages/twenty-shared/src/application/frontComponentManifestType.ts
index 51bec4e3bde..6953970bcdf 100644
--- a/packages/twenty-shared/src/application/frontComponentManifestType.ts
+++ b/packages/twenty-shared/src/application/frontComponentManifestType.ts
@@ -7,7 +7,7 @@ export type CommandMenuItemManifest = SyncableEntityOptions & {
/** @deprecated icon will be ignored in favor of application icon */
icon?: string;
isPinned?: boolean;
- availabilityType?: `${CommandMenuItemAvailabilityType}`;
+ availabilityType?: CommandMenuItemAvailabilityType;
availabilityObjectUniversalIdentifier?: string;
frontComponentUniversalIdentifier: string;
conditionalAvailabilityExpression?: string;
diff --git a/packages/twenty-shared/src/application/indexManifestType.ts b/packages/twenty-shared/src/application/indexManifestType.ts
index 5d22b55c040..85a0016fdb2 100644
--- a/packages/twenty-shared/src/application/indexManifestType.ts
+++ b/packages/twenty-shared/src/application/indexManifestType.ts
@@ -4,7 +4,7 @@ import { type IndexType } from '@/types';
export type IndexManifest = SyncableEntityOptions & {
objectUniversalIdentifier: string;
- indexType?: `${IndexType}`;
+ indexType?: IndexType;
isUnique?: boolean;
fields: IndexFieldManifest[];
};
diff --git a/packages/twenty-shared/src/application/logicFunctionManifestType.ts b/packages/twenty-shared/src/application/logicFunctionManifestType.ts
index e6183eb9df5..a89ba64d25a 100644
--- a/packages/twenty-shared/src/application/logicFunctionManifestType.ts
+++ b/packages/twenty-shared/src/application/logicFunctionManifestType.ts
@@ -32,7 +32,7 @@ export type DatabaseEventTriggerSettings = {
export type HttpRouteTriggerSettings = {
path: string;
- httpMethod: HTTPMethod | `${HTTPMethod}`;
+ httpMethod: HTTPMethod;
isAuthRequired: boolean;
forwardedRequestHeaders?: string[];
};
diff --git a/packages/twenty-shared/src/application/normalizePageLayoutTabManifest.ts b/packages/twenty-shared/src/application/normalizePageLayoutTabManifest.ts
index c5aa5aea57e..0cda80d9b05 100644
--- a/packages/twenty-shared/src/application/normalizePageLayoutTabManifest.ts
+++ b/packages/twenty-shared/src/application/normalizePageLayoutTabManifest.ts
@@ -13,7 +13,6 @@ import {
PageLayoutTabLayoutMode,
PageLayoutType,
PageLayoutWidgetVerticalListHeightBehavior,
- WidgetType,
} from '@/types';
import { assertUnreachable } from '@/utils/assertUnreachable';
import { getPageLayoutWidgetHeightBehavior } from '@/utils/pageLayout/getPageLayoutWidgetHeightBehavior';
@@ -104,13 +103,7 @@ export const normalizePageLayoutTabManifest = ({
position:
position.layoutMode === PageLayoutTabLayoutMode.VERTICAL_LIST &&
isDefined(heightBehavior)
- ? {
- ...position,
- heightBehavior:
- PageLayoutWidgetVerticalListHeightBehavior[
- heightBehavior
- ],
- }
+ ? { ...position, heightBehavior }
: position,
};
}
@@ -143,14 +136,7 @@ export const normalizePageLayoutTabManifest = ({
position: {
layoutMode,
index,
- ...(isDefined(heightBehavior)
- ? {
- heightBehavior:
- PageLayoutWidgetVerticalListHeightBehavior[
- heightBehavior
- ],
- }
- : {}),
+ ...(isDefined(heightBehavior) ? { heightBehavior } : {}),
},
};
case PageLayoutTabLayoutMode.CANVAS:
@@ -178,7 +164,7 @@ export const normalizePageLayoutTabManifest = ({
({ type, position }) =>
position.layoutMode === PageLayoutTabLayoutMode.VERTICAL_LIST &&
getPageLayoutWidgetHeightBehavior({
- widgetType: WidgetType[type],
+ widgetType: type,
heightBehavior: position.heightBehavior,
}) === PageLayoutWidgetVerticalListHeightBehavior.TAB_VIEWPORT,
);
diff --git a/packages/twenty-shared/src/application/pageLayoutManifestType.ts b/packages/twenty-shared/src/application/pageLayoutManifestType.ts
index bd756a7f41c..16818fe16a1 100644
--- a/packages/twenty-shared/src/application/pageLayoutManifestType.ts
+++ b/packages/twenty-shared/src/application/pageLayoutManifestType.ts
@@ -11,11 +11,11 @@ import {
export type PageLayoutWidgetManifest = SyncableEntityOptions & {
title: string;
- type: `${WidgetType}`;
+ type: WidgetType;
objectUniversalIdentifier?: string;
conditionalDisplay?: PageLayoutWidgetConditionalDisplay;
position?: PageLayoutWidgetPosition;
- heightBehavior?: `${PageLayoutWidgetVerticalListHeightBehavior}`;
+ heightBehavior?: PageLayoutWidgetVerticalListHeightBehavior;
configuration: PageLayoutWidgetUniversalConfiguration;
};
@@ -35,7 +35,7 @@ export type PageLayoutTabManifest = SyncableEntityOptions & {
export type PageLayoutManifest = SyncableEntityOptions & {
name: string;
- type: `${PageLayoutType}`;
+ type: PageLayoutType;
objectUniversalIdentifier?: string;
defaultTabToFocusOnMobileAndSidePanelUniversalIdentifier?: string;
tabs?: PageLayoutTabManifest[];
diff --git a/packages/twenty-shared/src/application/serverRouteTriggerSettingsType.ts b/packages/twenty-shared/src/application/serverRouteTriggerSettingsType.ts
index f00ae6bca17..19f4d13b2dc 100644
--- a/packages/twenty-shared/src/application/serverRouteTriggerSettingsType.ts
+++ b/packages/twenty-shared/src/application/serverRouteTriggerSettingsType.ts
@@ -2,5 +2,5 @@ import { type HTTPMethod } from '@/types';
export type ServerRouteTriggerSettings = {
forwardedRequestHeaders?: string[];
- httpMethods?: (HTTPMethod | `${HTTPMethod}`)[];
+ httpMethods?: HTTPMethod[];
};
diff --git a/packages/twenty-shared/src/utils/fieldMetadata/isFieldMetadataSelectKind.ts b/packages/twenty-shared/src/utils/fieldMetadata/isFieldMetadataSelectKind.ts
index 5969acfaa02..fed78df7805 100644
--- a/packages/twenty-shared/src/utils/fieldMetadata/isFieldMetadataSelectKind.ts
+++ b/packages/twenty-shared/src/utils/fieldMetadata/isFieldMetadataSelectKind.ts
@@ -1,7 +1,7 @@
import { FieldMetadataType } from '@/types';
export const isFieldMetadataSelectKind = (
- fieldMetadataType: FieldMetadataType,
+ fieldMetadataType: `${FieldMetadataType}`,
): boolean => {
return (
fieldMetadataType === FieldMetadataType.SELECT ||