diff --git a/packages/twenty-server/.eslintrc.cjs b/packages/twenty-server/.eslintrc.cjs new file mode 100644 index 0000000000..daad469206 --- /dev/null +++ b/packages/twenty-server/.eslintrc.cjs @@ -0,0 +1,91 @@ +module.exports = { + plugins: ['@stylistic'], + extends: ['../../.eslintrc.cjs'], + ignorePatterns: ['src/engine/workspace-manager/demo-objects-prefill-data/**'], + overrides: [ + { + files: ['*.ts'], + parserOptions: { + project: ['packages/twenty-server/tsconfig.json'], + }, + rules: { + 'no-restricted-imports': [ + 'error', + { + patterns: [ + { + group: ['**../'], + message: 'Relative imports are not allowed.', + }, + ], + }, + ], + + '@stylistic/linebreak-style': ['error', 'unix'], + '@stylistic/lines-between-class-members': [ + 'error', + { + enforce: [{ blankLine: 'always', prev: 'method', next: 'method' }], + }, + ], + '@stylistic/padding-line-between-statements': [ + 'error', + { blankLine: 'always', prev: '*', next: 'return' }, + { blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' }, + { + blankLine: 'any', + prev: ['const', 'let', 'var'], + next: ['const', 'let', 'var'], + }, + { blankLine: 'always', prev: '*', next: ['interface', 'type'] }, + ], + + 'import/order': [ + 'error', + { + 'newlines-between': 'always', + groups: [ + 'builtin', + 'external', + 'internal', + 'type', + 'parent', + 'sibling', + 'object', + 'index', + ], + pathGroups: [ + { + pattern: '@nestjs/**', + group: 'builtin', + position: 'before', + }, + { + pattern: '**/interfaces/**', + group: 'type', + position: 'before', + }, + { + pattern: 'src/**', + group: 'parent', + position: 'before', + }, + { + pattern: './*', + group: 'sibling', + position: 'before', + }, + ], + distinctGroup: true, + warnOnUnassignedImports: true, + pathGroupsExcludedImportTypes: ['@nestjs/**'], + }, + ], + 'simple-import-sort/imports': 'off', + 'unicorn/filename-case': 'off', + 'prefer-arrow/prefer-arrow-functions': 'off', + '@nx/workspace-max-consts-per-file': 'off', + }, + }, + ], +}; diff --git a/packages/twenty-server/.eslintrc.js b/packages/twenty-server/.eslintrc.js deleted file mode 100644 index 46d638c589..0000000000 --- a/packages/twenty-server/.eslintrc.js +++ /dev/null @@ -1,92 +0,0 @@ -module.exports = { - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.json', - tsconfigRootDir : __dirname, - sourceType: 'module', - }, - plugins: ['@typescript-eslint/eslint-plugin', 'import', 'unused-imports', '@stylistic'], - extends: [ - 'plugin:@typescript-eslint/recommended', - 'plugin:prettier/recommended', - ], - root: true, - env: { - node: true, - jest: true, - }, - ignorePatterns: ['.eslintrc.js', 'src/core/@generated/**'], - rules: { - '@typescript-eslint/interface-name-prefix': 'off', - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-explicit-any': 'off', - 'func-style':['error', 'declaration', { 'allowArrowFunctions': true }], - 'no-restricted-imports': [ - 'error', - { - 'patterns': [ - { - 'group': ['**../'], - 'message': 'Relative imports are not allowed.', - }, - ], - }, - ], - 'import/order': [ - 'error', - { - 'newlines-between': 'always', - groups: [ - 'builtin', - 'external', - 'internal', - 'type', - 'parent', - 'sibling', - 'object', - 'index', - ], - pathGroups: [ - { - pattern: '@nestjs/**', - group: 'builtin', - position: 'before', - }, - { - pattern: '**/interfaces/**', - group: 'type', - position: 'before', - }, - { - pattern: 'src/**', - group: 'parent', - position: 'before', - }, - { - pattern: './*', - group: 'sibling', - position: 'before', - }, - ], - distinctGroup: true, - warnOnUnassignedImports: true, - pathGroupsExcludedImportTypes: ['@nestjs/**'], - }, - ], - 'import/no-duplicates': ["error", {"considerQueryString": true}], - 'unused-imports/no-unused-imports': 'warn', - "@typescript-eslint/consistent-type-imports": ["error", { "prefer": "no-type-imports" }], - "@stylistic/linebreak-style": ["error", "unix"], - "@stylistic/lines-between-class-members": ["error", { "enforce": [ - { blankLine: "always", prev: "method", next: "method" } - ]}], - "@stylistic/padding-line-between-statements": [ - "error", - { blankLine: "always", prev: "*", next: "return" }, - { blankLine: "always", prev: ["const", "let", "var"], next: "*"}, - { blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"] }, - { blankLine: "always", prev: "*", next: ["interface", "type"] } - ] - }, -}; diff --git a/packages/twenty-server/project.json b/packages/twenty-server/project.json index 40ab2b70e3..2d99857cd6 100644 --- a/packages/twenty-server/project.json +++ b/packages/twenty-server/project.json @@ -9,7 +9,7 @@ "cwd": "packages/twenty-server", "commands": ["rimraf dist", "nest build --path ./tsconfig.build.json"] } - }, + }, "build:packageJson": { "executor": "@nx/js:tsc", "options": { @@ -81,10 +81,15 @@ } }, "lint": { - "executor": "nx:run-commands", + "executor": "@nx/eslint:lint", "options": { - "cwd": "packages/twenty-server", - "command": "eslint \"src/**/*.ts\" --fix" + "eslintConfig": "{projectRoot}/.eslintrc.cjs", + "ignorePath": "{workspaceRoot}/.gitignore", + "lintFilePatterns": ["{projectRoot}/src/**/*.{ts,json}"] + }, + "configurations": { + "ci": { "lintFilePatterns": ["{projectRoot}/**/*.{ts,json}"] }, + "fix": { "fix": true } } }, "test:unit": { diff --git a/packages/twenty-server/src/command/command-logger.ts b/packages/twenty-server/src/command/command-logger.ts index b78d3b66d7..88c90a3f4b 100644 --- a/packages/twenty-server/src/command/command-logger.ts +++ b/packages/twenty-server/src/command/command-logger.ts @@ -22,7 +22,7 @@ export class CommandLogger { async writeLog( fileName: string, data: unknown, - append: boolean = false, + append = false, ): Promise { const path = `./logs/${kebabCase(this.className)}`; diff --git a/packages/twenty-server/src/database/commands/data-seed-dev-workspace.command.ts b/packages/twenty-server/src/database/commands/data-seed-dev-workspace.command.ts index ac4f248639..e2fa521c3e 100644 --- a/packages/twenty-server/src/database/commands/data-seed-dev-workspace.command.ts +++ b/packages/twenty-server/src/database/commands/data-seed-dev-workspace.command.ts @@ -175,11 +175,6 @@ export class DataSeedWorkspaceCommand extends CommandRunner { console.error(error); } - try { - } catch (error) { - console.error(error); - } - await this.typeORMService.disconnectFromDataSource(dataSourceMetadata.id); } } diff --git a/packages/twenty-server/src/database/typeorm-seeds/core/demo/users.ts b/packages/twenty-server/src/database/typeorm-seeds/core/demo/users.ts index 2a809eb191..5b8760f075 100644 --- a/packages/twenty-server/src/database/typeorm-seeds/core/demo/users.ts +++ b/packages/twenty-server/src/database/typeorm-seeds/core/demo/users.ts @@ -46,7 +46,6 @@ export const seedUsers = async ( '$2b$10$66d.6DuQExxnrfI9rMqOg.U1XIYpagr6Lv05uoWLYbYmtK0HDIvS6', // Applecar2025 defaultWorkspaceId: workspaceId, }, - , { id: DEMO_SEED_USER_IDS.JULIA, firstName: 'Julia', diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-query-builder/factories/__tests__/find-duplicates-query.factory.spec.ts b/packages/twenty-server/src/engine/api/graphql/workspace-query-builder/factories/__tests__/find-duplicates-query.factory.spec.ts index 27610b802f..b2423c9207 100644 --- a/packages/twenty-server/src/engine/api/graphql/workspace-query-builder/factories/__tests__/find-duplicates-query.factory.spec.ts +++ b/packages/twenty-server/src/engine/api/graphql/workspace-query-builder/factories/__tests__/find-duplicates-query.factory.spec.ts @@ -84,7 +84,7 @@ describe('FindDuplicatesQueryFactory', () => { }); expect(query.trim()).toEqual(`query { - personCollection(filter: {or:[{nameFirstName:{eq:\"John\"},nameLastName:{eq:\"Doe\"}}]}) { + personCollection(filter: {or:[{nameFirstName:{eq:"John"},nameLastName:{eq:"Doe"}}]}) { fieldsString } }`); @@ -171,7 +171,7 @@ describe('FindDuplicatesQueryFactory', () => { ); expect(query.trim()).toEqual(`query { - personCollection(filter: {id:{neq:\"uuid\"},or:[{nameFirstName:{eq:\"Peter\"},nameLastName:{eq:\"Parker\"}}]}) { + personCollection(filter: {id:{neq:"uuid"},or:[{nameFirstName:{eq:"Peter"},nameLastName:{eq:"Parker"}}]}) { fieldsString } }`); @@ -189,7 +189,7 @@ describe('FindDuplicatesQueryFactory', () => { }); expect(query.trim()).toEqual(`query { - personCollection(filter: { id: { eq: \"uuid\" }}){ + personCollection(filter: { id: { eq: "uuid" }}){ edges { node { __typename diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-query-builder/factories/find-duplicates-query.factory.ts b/packages/twenty-server/src/engine/api/graphql/workspace-query-builder/factories/find-duplicates-query.factory.ts index 5da08ed1a9..8b8c70f506 100644 --- a/packages/twenty-server/src/engine/api/graphql/workspace-query-builder/factories/find-duplicates-query.factory.ts +++ b/packages/twenty-server/src/engine/api/graphql/workspace-query-builder/factories/find-duplicates-query.factory.ts @@ -10,7 +10,7 @@ import { ObjectMetadataInterface } from 'src/engine/metadata-modules/field-metad import { computeObjectTargetTable } from 'src/engine/utils/compute-object-target-table.util'; import { stringifyWithoutKeyQuote } from 'src/engine/api/graphql/workspace-query-builder/utils/stringify-without-key-quote.util'; import { ArgsAliasFactory } from 'src/engine/api/graphql/workspace-query-builder/factories/args-alias.factory'; -import { duplicateCriteriaCollection } from 'src/engine/api/graphql/workspace-resolver-builder/constants/duplicate-criteria.constants'; +import { DUPLICATE_CRITERIA_COLLECTION } from 'src/engine/api/graphql/workspace-resolver-builder/constants/duplicate-criteria.constants'; import { settings } from 'src/engine/constants/settings'; import { FieldsStringFactory } from './fields-string.factory'; @@ -145,7 +145,7 @@ export class FindDuplicatesQueryFactory { private getApplicableDuplicateCriteriaCollection( objectMetadataItem: ObjectMetadataInterface, ) { - return duplicateCriteriaCollection.filter( + return DUPLICATE_CRITERIA_COLLECTION.filter( (duplicateCriteria) => duplicateCriteria.objectName === objectMetadataItem.nameSingular, ); diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/utils/parse-result.util.ts b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/utils/parse-result.util.ts index b8ad1383e1..677850ba13 100644 --- a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/utils/parse-result.util.ts +++ b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/utils/parse-result.util.ts @@ -34,6 +34,7 @@ export const parseResult = (obj: any): any => { const result: any = {}; for (const key in obj) { + // eslint-disable-next-line no-prototype-builtins if (obj.hasOwnProperty(key)) { if (typeof obj[key] === 'object' && obj[key] !== null) { result[key] = parseResult(obj[key]); diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/constants/duplicate-criteria.constants.ts b/packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/constants/duplicate-criteria.constants.ts index 1ca7d55dcc..7a0e6e7de0 100644 --- a/packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/constants/duplicate-criteria.constants.ts +++ b/packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/constants/duplicate-criteria.constants.ts @@ -6,7 +6,7 @@ import { RecordDuplicateCriteria } from 'src/engine/api/graphql/workspace-query- * So if we need to reference a custom field, we should directly add the column name like `_customColumn`. * If we need to terence a composite field, we should add all children of the composite like `nameFirstName` and `nameLastName` */ -export const duplicateCriteriaCollection: RecordDuplicateCriteria[] = [ +export const DUPLICATE_CRITERIA_COLLECTION: RecordDuplicateCriteria[] = [ { objectName: 'company', columnNames: ['domainName'], diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-schema-builder/factories/args.factory.ts b/packages/twenty-server/src/engine/api/graphql/workspace-schema-builder/factories/args.factory.ts index 7f316119cc..56a384a47d 100644 --- a/packages/twenty-server/src/engine/api/graphql/workspace-schema-builder/factories/args.factory.ts +++ b/packages/twenty-server/src/engine/api/graphql/workspace-schema-builder/factories/args.factory.ts @@ -24,6 +24,7 @@ export class ArgsFactory { const fieldConfigMap: GraphQLFieldConfigArgumentMap = {}; for (const key in args) { + // eslint-disable-next-line no-prototype-builtins if (!args.hasOwnProperty(key)) { continue; } diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-schema-builder/graphql-types/input/index.ts b/packages/twenty-server/src/engine/api/graphql/workspace-schema-builder/graphql-types/input/index.ts index b362a0a118..48909d728e 100644 --- a/packages/twenty-server/src/engine/api/graphql/workspace-schema-builder/graphql-types/input/index.ts +++ b/packages/twenty-server/src/engine/api/graphql/workspace-schema-builder/graphql-types/input/index.ts @@ -1,11 +1,11 @@ export * from './big-float-filter.input-type'; export * from './big-int-filter.input-type'; +export * from './boolean-filter.input-type'; export * from './date-filter.input-type'; export * from './date-time-filter.input-type'; export * from './float-filter.input-type'; export * from './int-filter.input-type'; +export * from './raw-json-filter.input-type'; export * from './string-filter.input-type'; export * from './time-filter.input-type'; export * from './uuid-filter.input-type'; -export * from './boolean-filter.input-type'; -export * from './raw-json-filter.input-type'; diff --git a/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts b/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts index 0992f2d1d6..c8105bb00b 100644 --- a/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts +++ b/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@nestjs/common'; +import { Injectable, Logger } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; import { Request } from 'express'; @@ -12,6 +12,8 @@ import { CreateAnalyticsInput } from './dto/create-analytics.input'; @Injectable() export class AnalyticsService { + private readonly logger = new Logger(AnalyticsService.name); + constructor( private readonly environmentService: EnvironmentService, private readonly httpService: HttpService, @@ -53,7 +55,11 @@ export class AnalyticsService { try { await this.httpService.axiosRef.post('/v1', data); - } catch {} + } catch { + this.logger.error('Failed to send analytics event'); + + return { success: false }; + } return { success: true }; } diff --git a/packages/twenty-server/src/engine/core-modules/auth/guards/google-apis-oauth.guard.ts b/packages/twenty-server/src/engine/core-modules/auth/guards/google-apis-oauth.guard.ts index 804776e21b..b28ad06f0d 100644 --- a/packages/twenty-server/src/engine/core-modules/auth/guards/google-apis-oauth.guard.ts +++ b/packages/twenty-server/src/engine/core-modules/auth/guards/google-apis-oauth.guard.ts @@ -10,18 +10,14 @@ export class GoogleAPIsOauthGuard extends AuthGuard('google-apis') { } async canActivate(context: ExecutionContext) { - try { - const request = context.switchToHttp().getRequest(); - const transientToken = request.query.transientToken; + const request = context.switchToHttp().getRequest(); + const transientToken = request.query.transientToken; - if (transientToken && typeof transientToken === 'string') { - request.params.transientToken = transientToken; - } - const activate = (await super.canActivate(context)) as boolean; - - return activate; - } catch (ex) { - throw ex; + if (transientToken && typeof transientToken === 'string') { + request.params.transientToken = transientToken; } + const activate = (await super.canActivate(context)) as boolean; + + return activate; } } diff --git a/packages/twenty-server/src/engine/core-modules/auth/guards/google-oauth.guard.ts b/packages/twenty-server/src/engine/core-modules/auth/guards/google-oauth.guard.ts index 4cdde71759..c7edba6126 100644 --- a/packages/twenty-server/src/engine/core-modules/auth/guards/google-oauth.guard.ts +++ b/packages/twenty-server/src/engine/core-modules/auth/guards/google-oauth.guard.ts @@ -10,18 +10,14 @@ export class GoogleOauthGuard extends AuthGuard('google') { } async canActivate(context: ExecutionContext) { - try { - const request = context.switchToHttp().getRequest(); - const workspaceInviteHash = request.query.inviteHash; + const request = context.switchToHttp().getRequest(); + const workspaceInviteHash = request.query.inviteHash; - if (workspaceInviteHash && typeof workspaceInviteHash === 'string') { - request.params.workspaceInviteHash = workspaceInviteHash; - } - const activate = (await super.canActivate(context)) as boolean; - - return activate; - } catch (ex) { - throw ex; + if (workspaceInviteHash && typeof workspaceInviteHash === 'string') { + request.params.workspaceInviteHash = workspaceInviteHash; } + const activate = (await super.canActivate(context)) as boolean; + + return activate; } } diff --git a/packages/twenty-server/src/engine/core-modules/billing/billing.service.ts b/packages/twenty-server/src/engine/core-modules/billing/billing.service.ts index 722c9f8c23..0a5a195368 100644 --- a/packages/twenty-server/src/engine/core-modules/billing/billing.service.ts +++ b/packages/twenty-server/src/engine/core-modules/billing/billing.service.ts @@ -202,7 +202,11 @@ export class BillingService { quantity = await this.userWorkspaceService.getWorkspaceMemberCount( user.defaultWorkspaceId, ); - } catch (e) {} + } catch (e) { + this.logger.error( + `Failed to get workspace member count for workspace ${user.defaultWorkspaceId}`, + ); + } const session = await this.stripeService.createCheckoutSession( user, diff --git a/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts b/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts index 283fd3325c..763952b8de 100644 --- a/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts +++ b/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts @@ -32,7 +32,7 @@ export class TimelineCalendarEventService { workspaceMemberId: string, workspaceId: string, personIds: string[], - page: number = 1, + page = 1, pageSize: number = TIMELINE_CALENDAR_EVENTS_DEFAULT_PAGE_SIZE, ): Promise { const offset = (page - 1) * pageSize; @@ -234,7 +234,7 @@ export class TimelineCalendarEventService { workspaceMemberId: string, workspaceId: string, companyId: string, - page: number = 1, + page = 1, pageSize: number = TIMELINE_CALENDAR_EVENTS_DEFAULT_PAGE_SIZE, ): Promise { const dataSourceSchema = diff --git a/packages/twenty-server/src/engine/core-modules/messaging/timeline-messaging.service.ts b/packages/twenty-server/src/engine/core-modules/messaging/timeline-messaging.service.ts index 3a186d6c07..3eb0b48dfc 100644 --- a/packages/twenty-server/src/engine/core-modules/messaging/timeline-messaging.service.ts +++ b/packages/twenty-server/src/engine/core-modules/messaging/timeline-messaging.service.ts @@ -24,7 +24,7 @@ export class TimelineMessagingService { workspaceMemberId: string, workspaceId: string, personIds: string[], - page: number = 1, + page = 1, pageSize: number = TIMELINE_THREADS_DEFAULT_PAGE_SIZE, ): Promise { const offset = (page - 1) * pageSize; @@ -478,7 +478,7 @@ export class TimelineMessagingService { workspaceMemberId: string, workspaceId: string, companyId: string, - page: number = 1, + page = 1, pageSize: number = TIMELINE_THREADS_DEFAULT_PAGE_SIZE, ): Promise { const dataSourceSchema = diff --git a/packages/twenty-server/src/engine/decorators/metadata/is-valid-metadata-name.decorator.ts b/packages/twenty-server/src/engine/decorators/metadata/is-valid-metadata-name.decorator.ts index d58663db3d..feb618f9a9 100644 --- a/packages/twenty-server/src/engine/decorators/metadata/is-valid-metadata-name.decorator.ts +++ b/packages/twenty-server/src/engine/decorators/metadata/is-valid-metadata-name.decorator.ts @@ -13,7 +13,7 @@ export function IsValidMetadataName(validationOptions?: ValidationOptions) { options: validationOptions, validator: { validate(value: any) { - return /^(?!(?:not|or|and|Int|Float|Boolean|String|ID)$)[^'\"\\;.=*/]+$/.test( + return /^(?!(?:not|or|and|Int|Float|Boolean|String|ID)$)[^'"\\;.=*/]+$/.test( value, ); }, diff --git a/packages/twenty-server/src/engine/integrations/cache-storage/cache-storage.service.ts b/packages/twenty-server/src/engine/integrations/cache-storage/cache-storage.service.ts index 5290250123..e9191c450d 100644 --- a/packages/twenty-server/src/engine/integrations/cache-storage/cache-storage.service.ts +++ b/packages/twenty-server/src/engine/integrations/cache-storage/cache-storage.service.ts @@ -44,7 +44,7 @@ export class CacheStorageService { }); } - async setPop(key: string, size: number = 1) { + async setPop(key: string, size = 1) { if (this.isRedisCache()) { return (this.cache as RedisCache).store.client.sPop( `${this.namespace}:${key}`, diff --git a/packages/twenty-server/src/engine/integrations/environment/environment-variables.ts b/packages/twenty-server/src/engine/integrations/environment/environment-variables.ts index dc2df8ed3d..3b05ca058d 100644 --- a/packages/twenty-server/src/engine/integrations/environment/environment-variables.ts +++ b/packages/twenty-server/src/engine/integrations/environment/environment-variables.ts @@ -38,24 +38,24 @@ export class EnvironmentVariables { @CastToBoolean() @IsOptional() @IsBoolean() - DEBUG_MODE: boolean = false; + DEBUG_MODE = false; @CastToPositiveNumber() @IsOptional() @IsNumber() @Min(0) @Max(65535) - DEBUG_PORT: number = 9000; + DEBUG_PORT = 9000; @CastToBoolean() @IsOptional() @IsBoolean() - SIGN_IN_PREFILLED: boolean = false; + SIGN_IN_PREFILLED = false; @CastToBoolean() @IsOptional() @IsBoolean() - IS_BILLING_ENABLED: boolean = false; + IS_BILLING_ENABLED = false; @IsString() @ValidateIf((env) => env.IS_BILLING_ENABLED === true) @@ -69,7 +69,7 @@ export class EnvironmentVariables { @CastToPositiveNumber() @IsOptional() @ValidateIf((env) => env.IS_BILLING_ENABLED === true) - BILLING_FREE_TRIAL_DURATION_IN_DAYS: number = 7; + BILLING_FREE_TRIAL_DURATION_IN_DAYS = 7; @IsString() @ValidateIf((env) => env.IS_BILLING_ENABLED === true) @@ -82,17 +82,17 @@ export class EnvironmentVariables { @CastToBoolean() @IsOptional() @IsBoolean() - TELEMETRY_ENABLED: boolean = true; + TELEMETRY_ENABLED = true; @CastToBoolean() @IsOptional() @IsBoolean() - TELEMETRY_ANONYMIZATION_ENABLED: boolean = true; + TELEMETRY_ANONYMIZATION_ENABLED = true; @CastToPositiveNumber() @IsNumber() @IsOptional() - PORT: number = 3000; + PORT = 3000; // Database @IsDefined() @@ -118,33 +118,33 @@ export class EnvironmentVariables { @IsDuration() @IsOptional() - ACCESS_TOKEN_EXPIRES_IN: string = '30m'; + ACCESS_TOKEN_EXPIRES_IN = '30m'; @IsString() REFRESH_TOKEN_SECRET: string; @IsDuration() @IsOptional() - REFRESH_TOKEN_EXPIRES_IN: string = '30m'; + REFRESH_TOKEN_EXPIRES_IN = '30m'; @IsDuration() @IsOptional() - REFRESH_TOKEN_COOL_DOWN: string = '1m'; + REFRESH_TOKEN_COOL_DOWN = '1m'; @IsString() - LOGIN_TOKEN_SECRET: string = '30m'; + LOGIN_TOKEN_SECRET = '30m'; @IsDuration() @IsOptional() - LOGIN_TOKEN_EXPIRES_IN: string = '15m'; + LOGIN_TOKEN_EXPIRES_IN = '15m'; @IsString() @IsOptional() - FILE_TOKEN_SECRET: string = 'random_string'; + FILE_TOKEN_SECRET = 'random_string'; @IsDuration() @IsOptional() - FILE_TOKEN_EXPIRES_IN: string = '1d'; + FILE_TOKEN_EXPIRES_IN = '1d'; // Auth @IsUrl({ require_tld: false }) @@ -154,7 +154,7 @@ export class EnvironmentVariables { @CastToBoolean() @IsOptional() @IsBoolean() - AUTH_GOOGLE_ENABLED: boolean = false; + AUTH_GOOGLE_ENABLED = false; @IsString() @ValidateIf((env) => env.AUTH_GOOGLE_ENABLED === true) @@ -188,7 +188,7 @@ export class EnvironmentVariables { @IsString() @ValidateIf((env) => env.STORAGE_TYPE === StorageDriverType.Local) - STORAGE_LOCAL_PATH: string = '.local-storage'; + STORAGE_LOCAL_PATH = '.local-storage'; // Support @IsEnum(SupportDriver) @@ -210,7 +210,7 @@ export class EnvironmentVariables { @CastToBoolean() @IsBoolean() @IsOptional() - LOGGER_IS_BUFFER_ENABLED: boolean = true; + LOGGER_IS_BUFFER_ENABLED = true; @IsEnum(ExceptionHandlerDriver) @IsOptional() @@ -253,7 +253,7 @@ export class EnvironmentVariables { @IsDuration() @IsOptional() - PASSWORD_RESET_TOKEN_EXPIRES_IN: string = '5m'; + PASSWORD_RESET_TOKEN_EXPIRES_IN = '5m'; @CastToPositiveNumber() @IsNumber() @@ -263,49 +263,49 @@ export class EnvironmentVariables { '"WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION" should be strictly lower that "WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION"', }) @ValidateIf((env) => env.WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION > 0) - WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION: number = 30; + WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION = 30; @CastToPositiveNumber() @IsNumber() @ValidateIf((env) => env.WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION > 0) - WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION: number = 60; + WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION = 60; @CastToBoolean() @IsOptional() @IsBoolean() - IS_SIGN_UP_DISABLED: boolean = false; + IS_SIGN_UP_DISABLED = false; @CastToPositiveNumber() @IsOptional() @IsNumber() - MUTATION_MAXIMUM_RECORD_AFFECTED: number = 100; + MUTATION_MAXIMUM_RECORD_AFFECTED = 100; - REDIS_HOST: string = '127.0.0.1'; + REDIS_HOST = '127.0.0.1'; @CastToPositiveNumber() - REDIS_PORT: number = 6379; + REDIS_PORT = 6379; - API_TOKEN_EXPIRES_IN: string = '100y'; + API_TOKEN_EXPIRES_IN = '100y'; - SHORT_TERM_TOKEN_EXPIRES_IN: string = '5m'; + SHORT_TERM_TOKEN_EXPIRES_IN = '5m'; @CastToBoolean() - MESSAGING_PROVIDER_GMAIL_ENABLED: boolean = false; + MESSAGING_PROVIDER_GMAIL_ENABLED = false; MESSAGE_QUEUE_TYPE: string = MessageQueueDriverType.Sync; - EMAIL_FROM_ADDRESS: string = 'noreply@yourdomain.com'; + EMAIL_FROM_ADDRESS = 'noreply@yourdomain.com'; - EMAIL_SYSTEM_ADDRESS: string = 'system@yourdomain.com'; + EMAIL_SYSTEM_ADDRESS = 'system@yourdomain.com'; - EMAIL_FROM_NAME: string = 'Felix from Twenty'; + EMAIL_FROM_NAME = 'Felix from Twenty'; EMAIL_DRIVER: EmailDriver = EmailDriver.Logger; EMAIL_SMTP_HOST: string; @CastToPositiveNumber() - EMAIL_SMTP_PORT: number = 587; + EMAIL_SMTP_PORT = 587; EMAIL_SMTP_USER: string; @@ -314,18 +314,18 @@ export class EnvironmentVariables { OPENROUTER_API_KEY: string; @CastToPositiveNumber() - API_RATE_LIMITING_TTL: number = 100; + API_RATE_LIMITING_TTL = 100; @CastToPositiveNumber() - API_RATE_LIMITING_LIMIT: number = 500; + API_RATE_LIMITING_LIMIT = 500; - CACHE_STORAGE_TYPE: string = 'memory'; + CACHE_STORAGE_TYPE = 'memory'; @CastToPositiveNumber() CACHE_STORAGE_TTL: number = 3600 * 24 * 7; @CastToBoolean() - CALENDAR_PROVIDER_GOOGLE_ENABLED: boolean = false; + CALENDAR_PROVIDER_GOOGLE_ENABLED = false; AUTH_GOOGLE_APIS_CALLBACK_URL: string; diff --git a/packages/twenty-server/src/engine/integrations/message-queue/message-queue.module.ts b/packages/twenty-server/src/engine/integrations/message-queue/message-queue.module.ts index 7381c0ee96..1f7cebba3e 100644 --- a/packages/twenty-server/src/engine/integrations/message-queue/message-queue.module.ts +++ b/packages/twenty-server/src/engine/integrations/message-queue/message-queue.module.ts @@ -33,18 +33,19 @@ export class MessageQueueModule { const config = await options.useFactory(...args); switch (config.type) { - case MessageQueueDriverType.PgBoss: + case MessageQueueDriverType.PgBoss: { const boss = new PgBossDriver(config.options); await boss.init(); return boss; - - case MessageQueueDriverType.BullMQ: + } + case MessageQueueDriverType.BullMQ: { return new BullMQDriver(config.options); - - default: + } + default: { return new SyncDriver(JobsModule.moduleRef); + } } }, inject: options.inject || [], diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/hooks/before-update-one-object.hook.ts b/packages/twenty-server/src/engine/metadata-modules/object-metadata/hooks/before-update-one-object.hook.ts index 5301878621..831637c200 100644 --- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/hooks/before-update-one-object.hook.ts +++ b/packages/twenty-server/src/engine/metadata-modules/object-metadata/hooks/before-update-one-object.hook.ts @@ -52,6 +52,7 @@ export class BeforeUpdateOneObject if (!objectMetadata.isCustom) { if ( Object.keys(instance.update).length === 1 && + // eslint-disable-next-line no-prototype-builtins instance.update.hasOwnProperty('isActive') && instance.update.isActive !== undefined ) { diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts b/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts index c83b72b3ae..153a9d9081 100644 --- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts +++ b/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts @@ -40,12 +40,12 @@ import { DeleteOneObjectInput } from 'src/engine/metadata-modules/object-metadat import { RelationToDelete } from 'src/engine/metadata-modules/relation-metadata/types/relation-to-delete'; import { generateMigrationName } from 'src/engine/metadata-modules/workspace-migration/utils/generate-migration-name.util'; import { - activityTargetStandardFieldIds, - attachmentStandardFieldIds, - baseObjectStandardFieldIds, - customObjectStandardFieldIds, - favoriteStandardFieldIds, - timelineActivityStandardFieldIds, + ACTIVITY_TARGET_STANDARD_FIELD_IDS, + ATTACHMENT_STANDARD_FIELD_IDS, + BASE_OBJECT_STANDARD_FIELD_IDS, + CUSTOM_OBJECT_STANDARD_FIELD_IDS, + FAVORITE_STANDARD_FIELD_IDS, + TIMELINE_ACTIVITY_STANDARD_FIELD_IDS, } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; import { createForeignKeyDeterministicUuid, @@ -262,7 +262,7 @@ export class ObjectMetadataService extends TypeOrmQueryService @@ -55,7 +55,7 @@ export class CustomObjectMetadata extends BaseObjectMetadata { activityTargets: ActivityTargetObjectMetadata[]; @FieldMetadata({ - standardId: customObjectStandardFieldIds.favorites, + standardId: CUSTOM_OBJECT_STANDARD_FIELD_IDS.favorites, type: FieldMetadataType.RELATION, label: 'Favorites', description: (objectMetadata) => @@ -72,7 +72,7 @@ export class CustomObjectMetadata extends BaseObjectMetadata { favorites: FavoriteObjectMetadata[]; @FieldMetadata({ - standardId: customObjectStandardFieldIds.attachments, + standardId: CUSTOM_OBJECT_STANDARD_FIELD_IDS.attachments, type: FieldMetadataType.RELATION, label: 'Attachments', description: (objectMetadata) => @@ -88,7 +88,7 @@ export class CustomObjectMetadata extends BaseObjectMetadata { attachments: AttachmentObjectMetadata[]; @FieldMetadata({ - standardId: customObjectStandardFieldIds.timelineActivities, + standardId: CUSTOM_OBJECT_STANDARD_FIELD_IDS.timelineActivities, type: FieldMetadataType.RELATION, label: 'Timeline Activities', description: (objectMetadata) => diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/factories/standard-object.factory.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/factories/standard-object.factory.ts index b68fd2393a..c58e6c749b 100644 --- a/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/factories/standard-object.factory.ts +++ b/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/factories/standard-object.factory.ts @@ -35,7 +35,7 @@ export class StandardObjectFactory { if (!objectMetadata) { throw new Error( - `Object metadata decorator not found, can\'t parse ${metadata.name}`, + `Object metadata decorator not found, can't parse ${metadata.name}`, ); } diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/factories/standard-relation.factory.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/factories/standard-relation.factory.ts index 01b1e561ae..a20a7d752f 100644 --- a/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/factories/standard-relation.factory.ts +++ b/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/factories/standard-relation.factory.ts @@ -83,7 +83,7 @@ export class StandardRelationFactory { if (!objectMetadata) { throw new Error( - `Object metadata decorator not found, can\'t parse ${standardObjectMetadata.name}`, + `Object metadata decorator not found, can't parse ${standardObjectMetadata.name}`, ); } diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata.ts index 533431ffa5..423addf809 100644 --- a/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata.ts +++ b/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata.ts @@ -1,11 +1,11 @@ import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { baseObjectStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { BASE_OBJECT_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; export abstract class BaseObjectMetadata { @FieldMetadata({ - standardId: baseObjectStandardFieldIds.id, + standardId: BASE_OBJECT_STANDARD_FIELD_IDS.id, type: FieldMetadataType.UUID, label: 'Id', description: 'Id', @@ -16,7 +16,7 @@ export abstract class BaseObjectMetadata { id: string; @FieldMetadata({ - standardId: baseObjectStandardFieldIds.createdAt, + standardId: BASE_OBJECT_STANDARD_FIELD_IDS.createdAt, type: FieldMetadataType.DATE_TIME, label: 'Creation date', description: 'Creation date', @@ -26,7 +26,7 @@ export abstract class BaseObjectMetadata { createdAt: Date; @FieldMetadata({ - standardId: baseObjectStandardFieldIds.updatedAt, + standardId: BASE_OBJECT_STANDARD_FIELD_IDS.updatedAt, type: FieldMetadataType.DATE_TIME, label: 'Update date', description: 'Update date', diff --git a/packages/twenty-server/src/modules/activity/standard-objects/activity-target.object-metadata.ts b/packages/twenty-server/src/modules/activity/standard-objects/activity-target.object-metadata.ts index f1b827d2e1..28c1827cca 100644 --- a/packages/twenty-server/src/modules/activity/standard-objects/activity-target.object-metadata.ts +++ b/packages/twenty-server/src/modules/activity/standard-objects/activity-target.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { activityTargetStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { ACTIVITY_TARGET_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { CustomObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/custom-objects/custom.object-metadata'; import { DynamicRelationFieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/dynamic-field-metadata.interface'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; @@ -17,7 +17,7 @@ import { PersonObjectMetadata } from 'src/modules/person/standard-objects/person import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.activityTarget, + standardId: STANDARD_OBJECT_IDS.activityTarget, namePlural: 'activityTargets', labelSingular: 'Activity Target', labelPlural: 'Activity Targets', @@ -28,7 +28,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsNotAuditLogged() export class ActivityTargetObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: activityTargetStandardFieldIds.activity, + standardId: ACTIVITY_TARGET_STANDARD_FIELD_IDS.activity, type: FieldMetadataType.RELATION, label: 'Activity', description: 'ActivityTarget activity', @@ -39,7 +39,7 @@ export class ActivityTargetObjectMetadata extends BaseObjectMetadata { activity: Relation; @FieldMetadata({ - standardId: activityTargetStandardFieldIds.person, + standardId: ACTIVITY_TARGET_STANDARD_FIELD_IDS.person, type: FieldMetadataType.RELATION, label: 'Person', description: 'ActivityTarget person', @@ -50,7 +50,7 @@ export class ActivityTargetObjectMetadata extends BaseObjectMetadata { person: Relation; @FieldMetadata({ - standardId: activityTargetStandardFieldIds.company, + standardId: ACTIVITY_TARGET_STANDARD_FIELD_IDS.company, type: FieldMetadataType.RELATION, label: 'Company', description: 'ActivityTarget company', @@ -61,7 +61,7 @@ export class ActivityTargetObjectMetadata extends BaseObjectMetadata { company: Relation; @FieldMetadata({ - standardId: activityTargetStandardFieldIds.opportunity, + standardId: ACTIVITY_TARGET_STANDARD_FIELD_IDS.opportunity, type: FieldMetadataType.RELATION, label: 'Opportunity', description: 'ActivityTarget opportunity', @@ -72,7 +72,7 @@ export class ActivityTargetObjectMetadata extends BaseObjectMetadata { opportunity: Relation; @DynamicRelationFieldMetadata((oppositeObjectMetadata) => ({ - standardId: activityTargetStandardFieldIds.custom, + standardId: ACTIVITY_TARGET_STANDARD_FIELD_IDS.custom, name: oppositeObjectMetadata.nameSingular, label: oppositeObjectMetadata.labelSingular, description: `ActivityTarget ${oppositeObjectMetadata.labelSingular}`, diff --git a/packages/twenty-server/src/modules/activity/standard-objects/activity.object-metadata.ts b/packages/twenty-server/src/modules/activity/standard-objects/activity.object-metadata.ts index 097b79b2a2..7dbad1edef 100644 --- a/packages/twenty-server/src/modules/activity/standard-objects/activity.object-metadata.ts +++ b/packages/twenty-server/src/modules/activity/standard-objects/activity.object-metadata.ts @@ -5,8 +5,8 @@ import { RelationMetadataType, RelationOnDeleteAction, } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; -import { activityStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { ACTIVITY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -20,7 +20,7 @@ import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/stan import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.activity, + standardId: STANDARD_OBJECT_IDS.activity, namePlural: 'activities', labelSingular: 'Activity', labelPlural: 'Activities', @@ -31,7 +31,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsSystem() export class ActivityObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: activityStandardFieldIds.title, + standardId: ACTIVITY_STANDARD_FIELD_IDS.title, type: FieldMetadataType.TEXT, label: 'Title', description: 'Activity title', @@ -40,7 +40,7 @@ export class ActivityObjectMetadata extends BaseObjectMetadata { title: string; @FieldMetadata({ - standardId: activityStandardFieldIds.body, + standardId: ACTIVITY_STANDARD_FIELD_IDS.body, type: FieldMetadataType.TEXT, label: 'Body', description: 'Activity body', @@ -49,7 +49,7 @@ export class ActivityObjectMetadata extends BaseObjectMetadata { body: string; @FieldMetadata({ - standardId: activityStandardFieldIds.type, + standardId: ACTIVITY_STANDARD_FIELD_IDS.type, type: FieldMetadataType.TEXT, label: 'Type', description: 'Activity type', @@ -59,7 +59,7 @@ export class ActivityObjectMetadata extends BaseObjectMetadata { type: string; @FieldMetadata({ - standardId: activityStandardFieldIds.reminderAt, + standardId: ACTIVITY_STANDARD_FIELD_IDS.reminderAt, type: FieldMetadataType.DATE_TIME, label: 'Reminder Date', description: 'Activity reminder date', @@ -69,7 +69,7 @@ export class ActivityObjectMetadata extends BaseObjectMetadata { reminderAt: Date; @FieldMetadata({ - standardId: activityStandardFieldIds.dueAt, + standardId: ACTIVITY_STANDARD_FIELD_IDS.dueAt, type: FieldMetadataType.DATE_TIME, label: 'Due Date', description: 'Activity due date', @@ -79,7 +79,7 @@ export class ActivityObjectMetadata extends BaseObjectMetadata { dueAt: Date; @FieldMetadata({ - standardId: activityStandardFieldIds.completedAt, + standardId: ACTIVITY_STANDARD_FIELD_IDS.completedAt, type: FieldMetadataType.DATE_TIME, label: 'Completion Date', description: 'Activity completion date', @@ -89,7 +89,7 @@ export class ActivityObjectMetadata extends BaseObjectMetadata { completedAt: Date; @FieldMetadata({ - standardId: activityStandardFieldIds.activityTargets, + standardId: ACTIVITY_STANDARD_FIELD_IDS.activityTargets, type: FieldMetadataType.RELATION, label: 'Targets', description: 'Activity targets', @@ -104,7 +104,7 @@ export class ActivityObjectMetadata extends BaseObjectMetadata { activityTargets: Relation; @FieldMetadata({ - standardId: activityStandardFieldIds.attachments, + standardId: ACTIVITY_STANDARD_FIELD_IDS.attachments, type: FieldMetadataType.RELATION, label: 'Attachments', description: 'Activity attachments', @@ -119,7 +119,7 @@ export class ActivityObjectMetadata extends BaseObjectMetadata { attachments: Relation; @FieldMetadata({ - standardId: activityStandardFieldIds.comments, + standardId: ACTIVITY_STANDARD_FIELD_IDS.comments, type: FieldMetadataType.RELATION, label: 'Comments', description: 'Activity comments', @@ -134,7 +134,7 @@ export class ActivityObjectMetadata extends BaseObjectMetadata { comments: Relation; @FieldMetadata({ - standardId: activityStandardFieldIds.author, + standardId: ACTIVITY_STANDARD_FIELD_IDS.author, type: FieldMetadataType.RELATION, label: 'Author', description: 'Activity author', @@ -145,7 +145,7 @@ export class ActivityObjectMetadata extends BaseObjectMetadata { author: Relation; @FieldMetadata({ - standardId: activityStandardFieldIds.assignee, + standardId: ACTIVITY_STANDARD_FIELD_IDS.assignee, type: FieldMetadataType.RELATION, label: 'Assignee', description: 'Activity assignee', diff --git a/packages/twenty-server/src/modules/activity/standard-objects/comment.object-metadata.ts b/packages/twenty-server/src/modules/activity/standard-objects/comment.object-metadata.ts index 28b65cb29f..1d389122ec 100644 --- a/packages/twenty-server/src/modules/activity/standard-objects/comment.object-metadata.ts +++ b/packages/twenty-server/src/modules/activity/standard-objects/comment.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { commentStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { COMMENT_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator'; @@ -12,7 +12,7 @@ import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/stan import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.comment, + standardId: STANDARD_OBJECT_IDS.comment, namePlural: 'comments', labelSingular: 'Comment', labelPlural: 'Comments', @@ -23,7 +23,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsNotAuditLogged() export class CommentObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: commentStandardFieldIds.body, + standardId: COMMENT_STANDARD_FIELD_IDS.body, type: FieldMetadataType.TEXT, label: 'Body', description: 'Comment body', @@ -32,7 +32,7 @@ export class CommentObjectMetadata extends BaseObjectMetadata { body: string; @FieldMetadata({ - standardId: commentStandardFieldIds.author, + standardId: COMMENT_STANDARD_FIELD_IDS.author, type: FieldMetadataType.RELATION, label: 'Author', description: 'Comment author', @@ -42,7 +42,7 @@ export class CommentObjectMetadata extends BaseObjectMetadata { author: Relation; @FieldMetadata({ - standardId: commentStandardFieldIds.activity, + standardId: COMMENT_STANDARD_FIELD_IDS.activity, type: FieldMetadataType.RELATION, label: 'Activity', description: 'Comment activity', diff --git a/packages/twenty-server/src/modules/api-key/standard-objects/api-key.object-metadata.ts b/packages/twenty-server/src/modules/api-key/standard-objects/api-key.object-metadata.ts index 232fefad3e..51e77a0e3e 100644 --- a/packages/twenty-server/src/modules/api-key/standard-objects/api-key.object-metadata.ts +++ b/packages/twenty-server/src/modules/api-key/standard-objects/api-key.object-metadata.ts @@ -1,6 +1,6 @@ import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { apiKeyStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { API_KEY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; @@ -9,7 +9,7 @@ import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-meta import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata'; @ObjectMetadata({ - standardId: standardObjectIds.apiKey, + standardId: STANDARD_OBJECT_IDS.apiKey, namePlural: 'apiKeys', labelSingular: 'Api Key', labelPlural: 'Api Keys', @@ -20,7 +20,7 @@ import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync- @IsNotAuditLogged() export class ApiKeyObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: apiKeyStandardFieldIds.name, + standardId: API_KEY_STANDARD_FIELD_IDS.name, type: FieldMetadataType.TEXT, label: 'Name', description: 'ApiKey name', @@ -29,7 +29,7 @@ export class ApiKeyObjectMetadata extends BaseObjectMetadata { name: string; @FieldMetadata({ - standardId: apiKeyStandardFieldIds.expiresAt, + standardId: API_KEY_STANDARD_FIELD_IDS.expiresAt, type: FieldMetadataType.DATE_TIME, label: 'Expiration date', description: 'ApiKey expiration date', @@ -38,7 +38,7 @@ export class ApiKeyObjectMetadata extends BaseObjectMetadata { expiresAt: Date; @FieldMetadata({ - standardId: apiKeyStandardFieldIds.revokedAt, + standardId: API_KEY_STANDARD_FIELD_IDS.revokedAt, type: FieldMetadataType.DATE_TIME, label: 'Revocation date', description: 'ApiKey revocation date', diff --git a/packages/twenty-server/src/modules/attachment/standard-objects/attachment.object-metadata.ts b/packages/twenty-server/src/modules/attachment/standard-objects/attachment.object-metadata.ts index a014b270c6..f9b5fb9ffe 100644 --- a/packages/twenty-server/src/modules/attachment/standard-objects/attachment.object-metadata.ts +++ b/packages/twenty-server/src/modules/attachment/standard-objects/attachment.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { attachmentStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { ATTACHMENT_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { CustomObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/custom-objects/custom.object-metadata'; import { DynamicRelationFieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/dynamic-field-metadata.interface'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; @@ -18,7 +18,7 @@ import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/stan import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.attachment, + standardId: STANDARD_OBJECT_IDS.attachment, namePlural: 'attachments', labelSingular: 'Attachment', labelPlural: 'Attachments', @@ -29,7 +29,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsNotAuditLogged() export class AttachmentObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: attachmentStandardFieldIds.name, + standardId: ATTACHMENT_STANDARD_FIELD_IDS.name, type: FieldMetadataType.TEXT, label: 'Name', description: 'Attachment name', @@ -38,7 +38,7 @@ export class AttachmentObjectMetadata extends BaseObjectMetadata { name: string; @FieldMetadata({ - standardId: attachmentStandardFieldIds.fullPath, + standardId: ATTACHMENT_STANDARD_FIELD_IDS.fullPath, type: FieldMetadataType.TEXT, label: 'Full path', description: 'Attachment full path', @@ -47,7 +47,7 @@ export class AttachmentObjectMetadata extends BaseObjectMetadata { fullPath: string; @FieldMetadata({ - standardId: attachmentStandardFieldIds.type, + standardId: ATTACHMENT_STANDARD_FIELD_IDS.type, type: FieldMetadataType.TEXT, label: 'Type', description: 'Attachment type', @@ -56,7 +56,7 @@ export class AttachmentObjectMetadata extends BaseObjectMetadata { type: string; @FieldMetadata({ - standardId: attachmentStandardFieldIds.author, + standardId: ATTACHMENT_STANDARD_FIELD_IDS.author, type: FieldMetadataType.RELATION, label: 'Author', description: 'Attachment author', @@ -66,7 +66,7 @@ export class AttachmentObjectMetadata extends BaseObjectMetadata { author: Relation; @FieldMetadata({ - standardId: attachmentStandardFieldIds.activity, + standardId: ATTACHMENT_STANDARD_FIELD_IDS.activity, type: FieldMetadataType.RELATION, label: 'Activity', description: 'Attachment activity', @@ -77,7 +77,7 @@ export class AttachmentObjectMetadata extends BaseObjectMetadata { activity: Relation; @FieldMetadata({ - standardId: attachmentStandardFieldIds.person, + standardId: ATTACHMENT_STANDARD_FIELD_IDS.person, type: FieldMetadataType.RELATION, label: 'Person', description: 'Attachment person', @@ -88,7 +88,7 @@ export class AttachmentObjectMetadata extends BaseObjectMetadata { person: Relation; @FieldMetadata({ - standardId: attachmentStandardFieldIds.company, + standardId: ATTACHMENT_STANDARD_FIELD_IDS.company, type: FieldMetadataType.RELATION, label: 'Company', description: 'Attachment company', @@ -99,7 +99,7 @@ export class AttachmentObjectMetadata extends BaseObjectMetadata { company: Relation; @FieldMetadata({ - standardId: attachmentStandardFieldIds.opportunity, + standardId: ATTACHMENT_STANDARD_FIELD_IDS.opportunity, type: FieldMetadataType.RELATION, label: 'Opportunity', description: 'Attachment opportunity', @@ -110,7 +110,7 @@ export class AttachmentObjectMetadata extends BaseObjectMetadata { opportunity: Relation; @DynamicRelationFieldMetadata((oppositeObjectMetadata) => ({ - standardId: attachmentStandardFieldIds.custom, + standardId: ATTACHMENT_STANDARD_FIELD_IDS.custom, name: oppositeObjectMetadata.nameSingular, label: oppositeObjectMetadata.labelSingular, description: `Attachment ${oppositeObjectMetadata.labelSingular}`, diff --git a/packages/twenty-server/src/modules/calendar/services/google-calendar-sync/google-calendar-sync.service.ts b/packages/twenty-server/src/modules/calendar/services/google-calendar-sync/google-calendar-sync.service.ts index c1c1f01a01..6fb9bb90b6 100644 --- a/packages/twenty-server/src/modules/calendar/services/google-calendar-sync/google-calendar-sync.service.ts +++ b/packages/twenty-server/src/modules/calendar/services/google-calendar-sync/google-calendar-sync.service.ts @@ -124,7 +124,9 @@ export class GoogleCalendarSyncService { let nextPageToken: string | undefined; const events: calendarV3.Schema$Event[] = []; - while (true) { + let hasMoreEvents = true; + + while (hasMoreEvents) { const googleCalendarEvents = await googleCalendarClient.events.list({ calendarId: 'primary', maxResults: 500, @@ -146,7 +148,7 @@ export class GoogleCalendarSyncService { events.push(...items); if (!nextPageToken) { - break; + hasMoreEvents = false; } } diff --git a/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel-event-association.object-metadata.ts b/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel-event-association.object-metadata.ts index 488959a65c..05e3f87f66 100644 --- a/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel-event-association.object-metadata.ts +++ b/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel-event-association.object-metadata.ts @@ -2,8 +2,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/i import { FeatureFlagKeys } from 'src/engine/core-modules/feature-flag/feature-flag.entity'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { calendarChannelEventAssociationStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { CALENDAR_CHANNEL_EVENT_ASSOCIATION_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -13,7 +13,7 @@ import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objec import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.calendarChannelEventAssociation, + standardId: STANDARD_OBJECT_IDS.calendarChannelEventAssociation, namePlural: 'calendarChannelEventAssociations', labelSingular: 'Calendar Channel Event Association', labelPlural: 'Calendar Channel Event Associations', @@ -27,7 +27,8 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me }) export class CalendarChannelEventAssociationObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: calendarChannelEventAssociationStandardFieldIds.calendarChannel, + standardId: + CALENDAR_CHANNEL_EVENT_ASSOCIATION_STANDARD_FIELD_IDS.calendarChannel, type: FieldMetadataType.RELATION, label: 'Channel ID', description: 'Channel ID', @@ -37,7 +38,8 @@ export class CalendarChannelEventAssociationObjectMetadata extends BaseObjectMet calendarChannel: Relation; @FieldMetadata({ - standardId: calendarChannelEventAssociationStandardFieldIds.calendarEvent, + standardId: + CALENDAR_CHANNEL_EVENT_ASSOCIATION_STANDARD_FIELD_IDS.calendarEvent, type: FieldMetadataType.RELATION, label: 'Event ID', description: 'Event ID', @@ -47,7 +49,8 @@ export class CalendarChannelEventAssociationObjectMetadata extends BaseObjectMet calendarEvent: Relation; @FieldMetadata({ - standardId: calendarChannelEventAssociationStandardFieldIds.eventExternalId, + standardId: + CALENDAR_CHANNEL_EVENT_ASSOCIATION_STANDARD_FIELD_IDS.eventExternalId, type: FieldMetadataType.TEXT, label: 'Event external ID', description: 'Event external ID', diff --git a/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel.object-metadata.ts b/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel.object-metadata.ts index 2e36803b8e..927d973b94 100644 --- a/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel.object-metadata.ts +++ b/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel.object-metadata.ts @@ -6,8 +6,8 @@ import { } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; import { FeatureFlagKeys } from 'src/engine/core-modules/feature-flag/feature-flag.entity'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { calendarChannelStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { CALENDAR_CHANNEL_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -24,7 +24,7 @@ export enum CalendarChannelVisibility { } @ObjectMetadata({ - standardId: standardObjectIds.calendarChannel, + standardId: STANDARD_OBJECT_IDS.calendarChannel, namePlural: 'calendarChannels', labelSingular: 'Calendar Channel', labelPlural: 'Calendar Channels', @@ -38,7 +38,7 @@ export enum CalendarChannelVisibility { }) export class CalendarChannelObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: calendarChannelStandardFieldIds.connectedAccount, + standardId: CALENDAR_CHANNEL_STANDARD_FIELD_IDS.connectedAccount, type: FieldMetadataType.RELATION, label: 'Connected Account', description: 'Connected Account', @@ -48,7 +48,7 @@ export class CalendarChannelObjectMetadata extends BaseObjectMetadata { connectedAccount: Relation; @FieldMetadata({ - standardId: calendarChannelStandardFieldIds.handle, + standardId: CALENDAR_CHANNEL_STANDARD_FIELD_IDS.handle, type: FieldMetadataType.TEXT, label: 'Handle', description: 'Handle', @@ -57,7 +57,7 @@ export class CalendarChannelObjectMetadata extends BaseObjectMetadata { handle: string; @FieldMetadata({ - standardId: calendarChannelStandardFieldIds.visibility, + standardId: CALENDAR_CHANNEL_STANDARD_FIELD_IDS.visibility, type: FieldMetadataType.SELECT, label: 'Visibility', description: 'Visibility', @@ -81,7 +81,8 @@ export class CalendarChannelObjectMetadata extends BaseObjectMetadata { visibility: string; @FieldMetadata({ - standardId: calendarChannelStandardFieldIds.isContactAutoCreationEnabled, + standardId: + CALENDAR_CHANNEL_STANDARD_FIELD_IDS.isContactAutoCreationEnabled, type: FieldMetadataType.BOOLEAN, label: 'Is Contact Auto Creation Enabled', description: 'Is Contact Auto Creation Enabled', @@ -91,7 +92,7 @@ export class CalendarChannelObjectMetadata extends BaseObjectMetadata { isContactAutoCreationEnabled: boolean; @FieldMetadata({ - standardId: calendarChannelStandardFieldIds.isSyncEnabled, + standardId: CALENDAR_CHANNEL_STANDARD_FIELD_IDS.isSyncEnabled, type: FieldMetadataType.BOOLEAN, label: 'Is Sync Enabled', description: 'Is Sync Enabled', @@ -101,7 +102,7 @@ export class CalendarChannelObjectMetadata extends BaseObjectMetadata { isSyncEnabled: boolean; @FieldMetadata({ - standardId: calendarChannelStandardFieldIds.syncCursor, + standardId: CALENDAR_CHANNEL_STANDARD_FIELD_IDS.syncCursor, type: FieldMetadataType.TEXT, label: 'Sync Cursor', description: @@ -112,7 +113,7 @@ export class CalendarChannelObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ standardId: - calendarChannelStandardFieldIds.calendarChannelEventAssociations, + CALENDAR_CHANNEL_STANDARD_FIELD_IDS.calendarChannelEventAssociations, type: FieldMetadataType.RELATION, label: 'Calendar Channel Event Associations', description: 'Calendar Channel Event Associations', diff --git a/packages/twenty-server/src/modules/calendar/standard-objects/calendar-event-participant.object-metadata.ts b/packages/twenty-server/src/modules/calendar/standard-objects/calendar-event-participant.object-metadata.ts index 46c4934773..d5d9b895ce 100644 --- a/packages/twenty-server/src/modules/calendar/standard-objects/calendar-event-participant.object-metadata.ts +++ b/packages/twenty-server/src/modules/calendar/standard-objects/calendar-event-participant.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { calendarEventParticipantStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { CALENDAR_EVENT_PARTICIPANT_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; @@ -22,7 +22,7 @@ export enum CalendarEventParticipantResponseStatus { } @ObjectMetadata({ - standardId: standardObjectIds.calendarEventParticipant, + standardId: STANDARD_OBJECT_IDS.calendarEventParticipant, namePlural: 'calendarEventParticipants', labelSingular: 'Calendar event participant', labelPlural: 'Calendar event participants', @@ -36,7 +36,7 @@ export enum CalendarEventParticipantResponseStatus { }) export class CalendarEventParticipantObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: calendarEventParticipantStandardFieldIds.calendarEvent, + standardId: CALENDAR_EVENT_PARTICIPANT_STANDARD_FIELD_IDS.calendarEvent, type: FieldMetadataType.RELATION, label: 'Event ID', description: 'Event ID', @@ -46,7 +46,7 @@ export class CalendarEventParticipantObjectMetadata extends BaseObjectMetadata { calendarEvent: Relation; @FieldMetadata({ - standardId: calendarEventParticipantStandardFieldIds.handle, + standardId: CALENDAR_EVENT_PARTICIPANT_STANDARD_FIELD_IDS.handle, type: FieldMetadataType.TEXT, label: 'Handle', description: 'Handle', @@ -55,7 +55,7 @@ export class CalendarEventParticipantObjectMetadata extends BaseObjectMetadata { handle: string; @FieldMetadata({ - standardId: calendarEventParticipantStandardFieldIds.displayName, + standardId: CALENDAR_EVENT_PARTICIPANT_STANDARD_FIELD_IDS.displayName, type: FieldMetadataType.TEXT, label: 'Display Name', description: 'Display Name', @@ -64,7 +64,7 @@ export class CalendarEventParticipantObjectMetadata extends BaseObjectMetadata { displayName: string; @FieldMetadata({ - standardId: calendarEventParticipantStandardFieldIds.isOrganizer, + standardId: CALENDAR_EVENT_PARTICIPANT_STANDARD_FIELD_IDS.isOrganizer, type: FieldMetadataType.BOOLEAN, label: 'Is Organizer', description: 'Is Organizer', @@ -74,7 +74,7 @@ export class CalendarEventParticipantObjectMetadata extends BaseObjectMetadata { isOrganizer: boolean; @FieldMetadata({ - standardId: calendarEventParticipantStandardFieldIds.responseStatus, + standardId: CALENDAR_EVENT_PARTICIPANT_STANDARD_FIELD_IDS.responseStatus, type: FieldMetadataType.SELECT, label: 'Response Status', description: 'Response Status', @@ -110,7 +110,7 @@ export class CalendarEventParticipantObjectMetadata extends BaseObjectMetadata { responseStatus: string; @FieldMetadata({ - standardId: calendarEventParticipantStandardFieldIds.person, + standardId: CALENDAR_EVENT_PARTICIPANT_STANDARD_FIELD_IDS.person, type: FieldMetadataType.RELATION, label: 'Person', description: 'Person', @@ -121,7 +121,7 @@ export class CalendarEventParticipantObjectMetadata extends BaseObjectMetadata { person: Relation; @FieldMetadata({ - standardId: calendarEventParticipantStandardFieldIds.workspaceMember, + standardId: CALENDAR_EVENT_PARTICIPANT_STANDARD_FIELD_IDS.workspaceMember, type: FieldMetadataType.RELATION, label: 'Workspace Member', description: 'Workspace Member', diff --git a/packages/twenty-server/src/modules/calendar/standard-objects/calendar-event.object-metadata.ts b/packages/twenty-server/src/modules/calendar/standard-objects/calendar-event.object-metadata.ts index 8dce1ed533..e1647beb36 100644 --- a/packages/twenty-server/src/modules/calendar/standard-objects/calendar-event.object-metadata.ts +++ b/packages/twenty-server/src/modules/calendar/standard-objects/calendar-event.object-metadata.ts @@ -15,13 +15,13 @@ import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync- import { CalendarChannelEventAssociationObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel-event-association.object-metadata'; import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; -import { calendarEventStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { CALENDAR_EVENT_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; import { LinkMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/link.composite-type'; import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.calendarEvent, + standardId: STANDARD_OBJECT_IDS.calendarEvent, namePlural: 'calendarEvents', labelSingular: 'Calendar event', labelPlural: 'Calendar events', @@ -35,7 +35,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me }) export class CalendarEventObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: calendarEventStandardFieldIds.title, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.title, type: FieldMetadataType.TEXT, label: 'Title', description: 'Title', @@ -44,7 +44,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { title: string; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.isCanceled, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.isCanceled, type: FieldMetadataType.BOOLEAN, label: 'Is canceled', description: 'Is canceled', @@ -53,7 +53,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { isCanceled: boolean; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.isFullDay, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.isFullDay, type: FieldMetadataType.BOOLEAN, label: 'Is Full Day', description: 'Is Full Day', @@ -62,7 +62,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { isFullDay: boolean; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.startsAt, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.startsAt, type: FieldMetadataType.DATE_TIME, label: 'Start Date', description: 'Start Date', @@ -72,7 +72,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { startsAt: string | null; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.endsAt, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.endsAt, type: FieldMetadataType.DATE_TIME, label: 'End Date', description: 'End Date', @@ -82,7 +82,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { endsAt: string | null; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.externalCreatedAt, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.externalCreatedAt, type: FieldMetadataType.DATE_TIME, label: 'Creation DateTime', description: 'Creation DateTime', @@ -92,7 +92,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { externalCreatedAt: string | null; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.externalUpdatedAt, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.externalUpdatedAt, type: FieldMetadataType.DATE_TIME, label: 'Update DateTime', description: 'Update DateTime', @@ -102,7 +102,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { externalUpdatedAt: string | null; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.description, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.description, type: FieldMetadataType.TEXT, label: 'Description', description: 'Description', @@ -111,7 +111,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { description: string; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.location, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.location, type: FieldMetadataType.TEXT, label: 'Location', description: 'Location', @@ -120,7 +120,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { location: string; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.iCalUID, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.iCalUID, type: FieldMetadataType.TEXT, label: 'iCal UID', description: 'iCal UID', @@ -129,7 +129,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { iCalUID: string; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.conferenceSolution, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.conferenceSolution, type: FieldMetadataType.TEXT, label: 'Conference Solution', description: 'Conference Solution', @@ -138,7 +138,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { conferenceSolution: string; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.conferenceLink, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.conferenceLink, type: FieldMetadataType.LINK, label: 'Meet Link', description: 'Meet Link', @@ -148,7 +148,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { conferenceLink: LinkMetadata; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.recurringEventExternalId, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.recurringEventExternalId, type: FieldMetadataType.TEXT, label: 'Recurring Event ID', description: 'Recurring Event ID', @@ -157,7 +157,8 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { recurringEventExternalId: string; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.calendarChannelEventAssociations, + standardId: + CALENDAR_EVENT_STANDARD_FIELD_IDS.calendarChannelEventAssociations, type: FieldMetadataType.RELATION, label: 'Calendar Channel Event Associations', description: 'Calendar Channel Event Associations', @@ -177,7 +178,7 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata { >; @FieldMetadata({ - standardId: calendarEventStandardFieldIds.calendarEventParticipants, + standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.calendarEventParticipants, type: FieldMetadataType.RELATION, label: 'Event Participants', description: 'Event Participants', diff --git a/packages/twenty-server/src/modules/company/standard-objects/company.object-metadata.ts b/packages/twenty-server/src/modules/company/standard-objects/company.object-metadata.ts index faff568623..c0f9e2f17a 100644 --- a/packages/twenty-server/src/modules/company/standard-objects/company.object-metadata.ts +++ b/packages/twenty-server/src/modules/company/standard-objects/company.object-metadata.ts @@ -7,8 +7,8 @@ import { RelationMetadataType, RelationOnDeleteAction, } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; -import { companyStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { COMPANY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -24,7 +24,7 @@ import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/stan import { TimelineActivityObjectMetadata } from 'src/modules/timeline/standard-objects/timeline-activity.object-metadata'; @ObjectMetadata({ - standardId: standardObjectIds.company, + standardId: STANDARD_OBJECT_IDS.company, namePlural: 'companies', labelSingular: 'Company', labelPlural: 'Companies', @@ -33,7 +33,7 @@ import { TimelineActivityObjectMetadata } from 'src/modules/timeline/standard-ob }) export class CompanyObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: companyStandardFieldIds.name, + standardId: COMPANY_STANDARD_FIELD_IDS.name, type: FieldMetadataType.TEXT, label: 'Name', description: 'The company name', @@ -42,7 +42,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { name: string; @FieldMetadata({ - standardId: companyStandardFieldIds.domainName, + standardId: COMPANY_STANDARD_FIELD_IDS.domainName, type: FieldMetadataType.TEXT, label: 'Domain Name', description: @@ -52,7 +52,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { domainName?: string; @FieldMetadata({ - standardId: companyStandardFieldIds.address, + standardId: COMPANY_STANDARD_FIELD_IDS.address, type: FieldMetadataType.TEXT, label: 'Address', description: 'The company address', @@ -61,7 +61,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { address: string; @FieldMetadata({ - standardId: companyStandardFieldIds.employees, + standardId: COMPANY_STANDARD_FIELD_IDS.employees, type: FieldMetadataType.NUMBER, label: 'Employees', description: 'Number of employees in the company', @@ -71,7 +71,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { employees: number; @FieldMetadata({ - standardId: companyStandardFieldIds.linkedinLink, + standardId: COMPANY_STANDARD_FIELD_IDS.linkedinLink, type: FieldMetadataType.LINK, label: 'Linkedin', description: 'The company Linkedin account', @@ -81,7 +81,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { linkedinLink: LinkMetadata; @FieldMetadata({ - standardId: companyStandardFieldIds.xLink, + standardId: COMPANY_STANDARD_FIELD_IDS.xLink, type: FieldMetadataType.LINK, label: 'X', description: 'The company Twitter/X account', @@ -91,7 +91,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { xLink: LinkMetadata; @FieldMetadata({ - standardId: companyStandardFieldIds.annualRecurringRevenue, + standardId: COMPANY_STANDARD_FIELD_IDS.annualRecurringRevenue, type: FieldMetadataType.CURRENCY, label: 'ARR', description: @@ -102,7 +102,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { annualRecurringRevenue: CurrencyMetadata; @FieldMetadata({ - standardId: companyStandardFieldIds.idealCustomerProfile, + standardId: COMPANY_STANDARD_FIELD_IDS.idealCustomerProfile, type: FieldMetadataType.BOOLEAN, label: 'ICP', description: @@ -113,7 +113,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { idealCustomerProfile: boolean; @FieldMetadata({ - standardId: companyStandardFieldIds.position, + standardId: COMPANY_STANDARD_FIELD_IDS.position, type: FieldMetadataType.POSITION, label: 'Position', description: 'Company record position', @@ -125,7 +125,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { // Relations @FieldMetadata({ - standardId: companyStandardFieldIds.people, + standardId: COMPANY_STANDARD_FIELD_IDS.people, type: FieldMetadataType.RELATION, label: 'People', description: 'People linked to the company.', @@ -140,7 +140,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { people: Relation; @FieldMetadata({ - standardId: companyStandardFieldIds.accountOwner, + standardId: COMPANY_STANDARD_FIELD_IDS.accountOwner, type: FieldMetadataType.RELATION, label: 'Account Owner', description: @@ -152,7 +152,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { accountOwner: WorkspaceMemberObjectMetadata; @FieldMetadata({ - standardId: companyStandardFieldIds.activityTargets, + standardId: COMPANY_STANDARD_FIELD_IDS.activityTargets, type: FieldMetadataType.RELATION, label: 'Activities', description: 'Activities tied to the company', @@ -167,7 +167,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { activityTargets: Relation; @FieldMetadata({ - standardId: companyStandardFieldIds.opportunities, + standardId: COMPANY_STANDARD_FIELD_IDS.opportunities, type: FieldMetadataType.RELATION, label: 'Opportunities', description: 'Opportunities linked to the company.', @@ -182,7 +182,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { opportunities: Relation; @FieldMetadata({ - standardId: companyStandardFieldIds.favorites, + standardId: COMPANY_STANDARD_FIELD_IDS.favorites, type: FieldMetadataType.RELATION, label: 'Favorites', description: 'Favorites linked to the company', @@ -198,7 +198,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { favorites: Relation; @FieldMetadata({ - standardId: companyStandardFieldIds.attachments, + standardId: COMPANY_STANDARD_FIELD_IDS.attachments, type: FieldMetadataType.RELATION, label: 'Attachments', description: 'Attachments linked to the company.', @@ -213,7 +213,7 @@ export class CompanyObjectMetadata extends BaseObjectMetadata { attachments: Relation; @FieldMetadata({ - standardId: companyStandardFieldIds.timelineActivities, + standardId: COMPANY_STANDARD_FIELD_IDS.timelineActivities, type: FieldMetadataType.RELATION, label: 'Timeline Activities', description: 'Timeline Activities linked to the company', diff --git a/packages/twenty-server/src/modules/connected-account/standard-objects/blocklist.object-metadata.ts b/packages/twenty-server/src/modules/connected-account/standard-objects/blocklist.object-metadata.ts index 991d13e7f7..eceb97b7b6 100644 --- a/packages/twenty-server/src/modules/connected-account/standard-objects/blocklist.object-metadata.ts +++ b/packages/twenty-server/src/modules/connected-account/standard-objects/blocklist.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { blocklistStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { BLOCKLIST_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator'; @@ -11,7 +11,7 @@ import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/stan import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.blocklist, + standardId: STANDARD_OBJECT_IDS.blocklist, namePlural: 'blocklists', labelSingular: 'Blocklist', labelPlural: 'Blocklists', @@ -22,7 +22,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsNotAuditLogged() export class BlocklistObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: blocklistStandardFieldIds.handle, + standardId: BLOCKLIST_STANDARD_FIELD_IDS.handle, type: FieldMetadataType.TEXT, label: 'Handle', description: 'Handle', @@ -31,7 +31,7 @@ export class BlocklistObjectMetadata extends BaseObjectMetadata { handle: string; @FieldMetadata({ - standardId: blocklistStandardFieldIds.workspaceMember, + standardId: BLOCKLIST_STANDARD_FIELD_IDS.workspaceMember, type: FieldMetadataType.RELATION, label: 'WorkspaceMember', description: 'WorkspaceMember', diff --git a/packages/twenty-server/src/modules/connected-account/standard-objects/connected-account.object-metadata.ts b/packages/twenty-server/src/modules/connected-account/standard-objects/connected-account.object-metadata.ts index 9b77c589ff..3336b5f09e 100644 --- a/packages/twenty-server/src/modules/connected-account/standard-objects/connected-account.object-metadata.ts +++ b/packages/twenty-server/src/modules/connected-account/standard-objects/connected-account.object-metadata.ts @@ -6,8 +6,8 @@ import { RelationMetadataType, RelationOnDeleteAction, } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; -import { connectedAccountStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { CONNECTED_ACCOUNT_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; @@ -25,7 +25,7 @@ export enum ConnectedAccountProvider { } @ObjectMetadata({ - standardId: standardObjectIds.connectedAccount, + standardId: STANDARD_OBJECT_IDS.connectedAccount, namePlural: 'connectedAccounts', labelSingular: 'Connected Account', labelPlural: 'Connected Accounts', @@ -36,7 +36,7 @@ export enum ConnectedAccountProvider { @IsNotAuditLogged() export class ConnectedAccountObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: connectedAccountStandardFieldIds.handle, + standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.handle, type: FieldMetadataType.TEXT, label: 'handle', description: 'The account handle (email, username, phone number, etc.)', @@ -45,7 +45,7 @@ export class ConnectedAccountObjectMetadata extends BaseObjectMetadata { handle: string; @FieldMetadata({ - standardId: connectedAccountStandardFieldIds.provider, + standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.provider, type: FieldMetadataType.TEXT, label: 'provider', description: 'The account provider', @@ -54,7 +54,7 @@ export class ConnectedAccountObjectMetadata extends BaseObjectMetadata { provider: ConnectedAccountProvider; // field metadata should be a SELECT @FieldMetadata({ - standardId: connectedAccountStandardFieldIds.accessToken, + standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.accessToken, type: FieldMetadataType.TEXT, label: 'Access Token', description: 'Messaging provider access token', @@ -63,7 +63,7 @@ export class ConnectedAccountObjectMetadata extends BaseObjectMetadata { accessToken: string; @FieldMetadata({ - standardId: connectedAccountStandardFieldIds.refreshToken, + standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.refreshToken, type: FieldMetadataType.TEXT, label: 'Refresh Token', description: 'Messaging provider refresh token', @@ -72,7 +72,7 @@ export class ConnectedAccountObjectMetadata extends BaseObjectMetadata { refreshToken: string; @FieldMetadata({ - standardId: connectedAccountStandardFieldIds.accountOwner, + standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.accountOwner, type: FieldMetadataType.RELATION, label: 'Account Owner', description: 'Account Owner', @@ -82,7 +82,7 @@ export class ConnectedAccountObjectMetadata extends BaseObjectMetadata { accountOwner: Relation; @FieldMetadata({ - standardId: connectedAccountStandardFieldIds.lastSyncHistoryId, + standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.lastSyncHistoryId, type: FieldMetadataType.TEXT, label: 'Last sync history ID', description: 'Last sync history ID', @@ -91,7 +91,7 @@ export class ConnectedAccountObjectMetadata extends BaseObjectMetadata { lastSyncHistoryId: string; @FieldMetadata({ - standardId: connectedAccountStandardFieldIds.authFailedAt, + standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.authFailedAt, type: FieldMetadataType.DATE_TIME, label: 'Auth failed at', description: 'Auth failed at', @@ -101,7 +101,7 @@ export class ConnectedAccountObjectMetadata extends BaseObjectMetadata { authFailedAt: Date; @FieldMetadata({ - standardId: connectedAccountStandardFieldIds.messageChannels, + standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.messageChannels, type: FieldMetadataType.RELATION, label: 'Message Channel', description: 'Message Channel', @@ -115,7 +115,7 @@ export class ConnectedAccountObjectMetadata extends BaseObjectMetadata { messageChannels: Relation; @FieldMetadata({ - standardId: connectedAccountStandardFieldIds.calendarChannels, + standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.calendarChannels, type: FieldMetadataType.RELATION, label: 'Calendar Channel', description: 'Calendar Channel', diff --git a/packages/twenty-server/src/modules/favorite/standard-objects/favorite.object-metadata.ts b/packages/twenty-server/src/modules/favorite/standard-objects/favorite.object-metadata.ts index 4cb3fff278..b40cc9ddd8 100644 --- a/packages/twenty-server/src/modules/favorite/standard-objects/favorite.object-metadata.ts +++ b/packages/twenty-server/src/modules/favorite/standard-objects/favorite.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { favoriteStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { FAVORITE_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { CustomObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/custom-objects/custom.object-metadata'; import { DynamicRelationFieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/dynamic-field-metadata.interface'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; @@ -17,7 +17,7 @@ import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/stan import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.favorite, + standardId: STANDARD_OBJECT_IDS.favorite, namePlural: 'favorites', labelSingular: 'Favorite', labelPlural: 'Favorites', @@ -28,7 +28,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsSystem() export class FavoriteObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: favoriteStandardFieldIds.position, + standardId: FAVORITE_STANDARD_FIELD_IDS.position, type: FieldMetadataType.NUMBER, label: 'Position', description: 'Favorite position', @@ -39,7 +39,7 @@ export class FavoriteObjectMetadata extends BaseObjectMetadata { // Relations @FieldMetadata({ - standardId: favoriteStandardFieldIds.workspaceMember, + standardId: FAVORITE_STANDARD_FIELD_IDS.workspaceMember, type: FieldMetadataType.RELATION, label: 'Workspace Member', description: 'Favorite workspace member', @@ -49,7 +49,7 @@ export class FavoriteObjectMetadata extends BaseObjectMetadata { workspaceMember: Relation; @FieldMetadata({ - standardId: favoriteStandardFieldIds.person, + standardId: FAVORITE_STANDARD_FIELD_IDS.person, type: FieldMetadataType.RELATION, label: 'Person', description: 'Favorite person', @@ -60,7 +60,7 @@ export class FavoriteObjectMetadata extends BaseObjectMetadata { person: Relation; @FieldMetadata({ - standardId: favoriteStandardFieldIds.company, + standardId: FAVORITE_STANDARD_FIELD_IDS.company, type: FieldMetadataType.RELATION, label: 'Company', description: 'Favorite company', @@ -71,7 +71,7 @@ export class FavoriteObjectMetadata extends BaseObjectMetadata { company: Relation; @FieldMetadata({ - standardId: favoriteStandardFieldIds.opportunity, + standardId: FAVORITE_STANDARD_FIELD_IDS.opportunity, type: FieldMetadataType.RELATION, label: 'Opportunity', description: 'Favorite opportunity', @@ -82,7 +82,7 @@ export class FavoriteObjectMetadata extends BaseObjectMetadata { opportunity: Relation; @DynamicRelationFieldMetadata((oppositeObjectMetadata) => ({ - standardId: favoriteStandardFieldIds.custom, + standardId: FAVORITE_STANDARD_FIELD_IDS.custom, name: oppositeObjectMetadata.nameSingular, label: oppositeObjectMetadata.labelSingular, description: `Favorite ${oppositeObjectMetadata.labelSingular}`, diff --git a/packages/twenty-server/src/modules/messaging/standard-objects/message-channel-message-association.object-metadata.ts b/packages/twenty-server/src/modules/messaging/standard-objects/message-channel-message-association.object-metadata.ts index 7914daa851..3d9aa168b6 100644 --- a/packages/twenty-server/src/modules/messaging/standard-objects/message-channel-message-association.object-metadata.ts +++ b/packages/twenty-server/src/modules/messaging/standard-objects/message-channel-message-association.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { messageChannelMessageAssociationStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -14,7 +14,7 @@ import { MessageObjectMetadata } from 'src/modules/messaging/standard-objects/me import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.messageChannelMessageAssociation, + standardId: STANDARD_OBJECT_IDS.messageChannelMessageAssociation, namePlural: 'messageChannelMessageAssociations', labelSingular: 'Message Channel Message Association', labelPlural: 'Message Channel Message Associations', @@ -25,7 +25,8 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsSystem() export class MessageChannelMessageAssociationObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: messageChannelMessageAssociationStandardFieldIds.messageChannel, + standardId: + MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_STANDARD_FIELD_IDS.messageChannel, type: FieldMetadataType.RELATION, label: 'Message Channel Id', description: 'Message Channel Id', @@ -36,7 +37,7 @@ export class MessageChannelMessageAssociationObjectMetadata extends BaseObjectMe messageChannel: Relation; @FieldMetadata({ - standardId: messageChannelMessageAssociationStandardFieldIds.message, + standardId: MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_STANDARD_FIELD_IDS.message, type: FieldMetadataType.RELATION, label: 'Message Id', description: 'Message Id', @@ -48,7 +49,7 @@ export class MessageChannelMessageAssociationObjectMetadata extends BaseObjectMe @FieldMetadata({ standardId: - messageChannelMessageAssociationStandardFieldIds.messageExternalId, + MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_STANDARD_FIELD_IDS.messageExternalId, type: FieldMetadataType.TEXT, label: 'Message External Id', description: 'Message id from the messaging provider', @@ -58,7 +59,8 @@ export class MessageChannelMessageAssociationObjectMetadata extends BaseObjectMe messageExternalId: string; @FieldMetadata({ - standardId: messageChannelMessageAssociationStandardFieldIds.messageThread, + standardId: + MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_STANDARD_FIELD_IDS.messageThread, type: FieldMetadataType.RELATION, label: 'Message Thread Id', description: 'Message Thread Id', @@ -70,7 +72,7 @@ export class MessageChannelMessageAssociationObjectMetadata extends BaseObjectMe @FieldMetadata({ standardId: - messageChannelMessageAssociationStandardFieldIds.messageThreadExternalId, + MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_STANDARD_FIELD_IDS.messageThreadExternalId, type: FieldMetadataType.TEXT, label: 'Thread External Id', description: 'Thread id from the messaging provider', diff --git a/packages/twenty-server/src/modules/messaging/standard-objects/message-channel.object-metadata.ts b/packages/twenty-server/src/modules/messaging/standard-objects/message-channel.object-metadata.ts index 95f4f54201..de2d3678a0 100644 --- a/packages/twenty-server/src/modules/messaging/standard-objects/message-channel.object-metadata.ts +++ b/packages/twenty-server/src/modules/messaging/standard-objects/message-channel.object-metadata.ts @@ -5,8 +5,8 @@ import { RelationMetadataType, RelationOnDeleteAction, } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; -import { messageChannelStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { MESSAGE_CHANNEL_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -36,7 +36,7 @@ export enum MessageChannelType { } @ObjectMetadata({ - standardId: standardObjectIds.messageChannel, + standardId: STANDARD_OBJECT_IDS.messageChannel, namePlural: 'messageChannels', labelSingular: 'Message Channel', labelPlural: 'Message Channels', @@ -47,7 +47,7 @@ export enum MessageChannelType { @IsSystem() export class MessageChannelObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: messageChannelStandardFieldIds.visibility, + standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.visibility, type: FieldMetadataType.SELECT, label: 'Visibility', description: 'Visibility', @@ -77,7 +77,7 @@ export class MessageChannelObjectMetadata extends BaseObjectMetadata { visibility: string; @FieldMetadata({ - standardId: messageChannelStandardFieldIds.handle, + standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.handle, type: FieldMetadataType.TEXT, label: 'Handle', description: 'Handle', @@ -86,7 +86,7 @@ export class MessageChannelObjectMetadata extends BaseObjectMetadata { handle: string; @FieldMetadata({ - standardId: messageChannelStandardFieldIds.connectedAccount, + standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.connectedAccount, type: FieldMetadataType.RELATION, label: 'Connected Account', description: 'Connected Account', @@ -96,7 +96,7 @@ export class MessageChannelObjectMetadata extends BaseObjectMetadata { connectedAccount: Relation; @FieldMetadata({ - standardId: messageChannelStandardFieldIds.type, + standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.type, type: FieldMetadataType.SELECT, label: 'Type', description: 'Channel Type', @@ -120,7 +120,7 @@ export class MessageChannelObjectMetadata extends BaseObjectMetadata { type: string; @FieldMetadata({ - standardId: messageChannelStandardFieldIds.isContactAutoCreationEnabled, + standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.isContactAutoCreationEnabled, type: FieldMetadataType.BOOLEAN, label: 'Is Contact Auto Creation Enabled', description: 'Is Contact Auto Creation Enabled', @@ -130,7 +130,7 @@ export class MessageChannelObjectMetadata extends BaseObjectMetadata { isContactAutoCreationEnabled: boolean; @FieldMetadata({ - standardId: messageChannelStandardFieldIds.isSyncEnabled, + standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.isSyncEnabled, type: FieldMetadataType.BOOLEAN, label: 'Is Sync Enabled', description: 'Is Sync Enabled', @@ -141,7 +141,7 @@ export class MessageChannelObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ standardId: - messageChannelStandardFieldIds.messageChannelMessageAssociations, + MESSAGE_CHANNEL_STANDARD_FIELD_IDS.messageChannelMessageAssociations, type: FieldMetadataType.RELATION, label: 'Message Channel Association', description: 'Messages from the channel.', @@ -158,7 +158,7 @@ export class MessageChannelObjectMetadata extends BaseObjectMetadata { >; @FieldMetadata({ - standardId: messageChannelStandardFieldIds.syncCursor, + standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.syncCursor, type: FieldMetadataType.TEXT, label: 'Last sync cursor', description: 'Last sync cursor', @@ -167,7 +167,7 @@ export class MessageChannelObjectMetadata extends BaseObjectMetadata { syncCursor: string; @FieldMetadata({ - standardId: messageChannelStandardFieldIds.syncedAt, + standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.syncedAt, type: FieldMetadataType.DATE_TIME, label: 'Last sync date', description: 'Last sync date', @@ -177,7 +177,7 @@ export class MessageChannelObjectMetadata extends BaseObjectMetadata { syncedAt: string; @FieldMetadata({ - standardId: messageChannelStandardFieldIds.syncStatus, + standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.syncStatus, type: FieldMetadataType.SELECT, label: 'Last sync status', description: 'Last sync status', @@ -213,7 +213,7 @@ export class MessageChannelObjectMetadata extends BaseObjectMetadata { syncStatus: MessageChannelSyncStatus; @FieldMetadata({ - standardId: messageChannelStandardFieldIds.ongoingSyncStartedAt, + standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.ongoingSyncStartedAt, type: FieldMetadataType.DATE_TIME, label: 'Ongoing sync started at', description: 'Ongoing sync started at', diff --git a/packages/twenty-server/src/modules/messaging/standard-objects/message-participant.object-metadata.ts b/packages/twenty-server/src/modules/messaging/standard-objects/message-participant.object-metadata.ts index 18bfd356fb..5a10ce397f 100644 --- a/packages/twenty-server/src/modules/messaging/standard-objects/message-participant.object-metadata.ts +++ b/packages/twenty-server/src/modules/messaging/standard-objects/message-participant.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { messageParticipantStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { MESSAGE_PARTICIPANT_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -14,7 +14,7 @@ import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/stan import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.messageParticipant, + standardId: STANDARD_OBJECT_IDS.messageParticipant, namePlural: 'messageParticipants', labelSingular: 'Message Participant', labelPlural: 'Message Participants', @@ -25,7 +25,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsSystem() export class MessageParticipantObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: messageParticipantStandardFieldIds.message, + standardId: MESSAGE_PARTICIPANT_STANDARD_FIELD_IDS.message, type: FieldMetadataType.RELATION, label: 'Message', description: 'Message', @@ -35,7 +35,7 @@ export class MessageParticipantObjectMetadata extends BaseObjectMetadata { message: Relation; @FieldMetadata({ - standardId: messageParticipantStandardFieldIds.role, + standardId: MESSAGE_PARTICIPANT_STANDARD_FIELD_IDS.role, type: FieldMetadataType.SELECT, label: 'Role', description: 'Role', @@ -51,7 +51,7 @@ export class MessageParticipantObjectMetadata extends BaseObjectMetadata { role: string; @FieldMetadata({ - standardId: messageParticipantStandardFieldIds.handle, + standardId: MESSAGE_PARTICIPANT_STANDARD_FIELD_IDS.handle, type: FieldMetadataType.TEXT, label: 'Handle', description: 'Handle', @@ -60,7 +60,7 @@ export class MessageParticipantObjectMetadata extends BaseObjectMetadata { handle: string; @FieldMetadata({ - standardId: messageParticipantStandardFieldIds.displayName, + standardId: MESSAGE_PARTICIPANT_STANDARD_FIELD_IDS.displayName, type: FieldMetadataType.TEXT, label: 'Display Name', description: 'Display Name', @@ -69,7 +69,7 @@ export class MessageParticipantObjectMetadata extends BaseObjectMetadata { displayName: string; @FieldMetadata({ - standardId: messageParticipantStandardFieldIds.person, + standardId: MESSAGE_PARTICIPANT_STANDARD_FIELD_IDS.person, type: FieldMetadataType.RELATION, label: 'Person', description: 'Person', @@ -80,7 +80,7 @@ export class MessageParticipantObjectMetadata extends BaseObjectMetadata { person: Relation; @FieldMetadata({ - standardId: messageParticipantStandardFieldIds.workspaceMember, + standardId: MESSAGE_PARTICIPANT_STANDARD_FIELD_IDS.workspaceMember, type: FieldMetadataType.RELATION, label: 'Workspace Member', description: 'Workspace member', diff --git a/packages/twenty-server/src/modules/messaging/standard-objects/message-thread.object-metadata.ts b/packages/twenty-server/src/modules/messaging/standard-objects/message-thread.object-metadata.ts index 6243148a32..b06f6d072c 100644 --- a/packages/twenty-server/src/modules/messaging/standard-objects/message-thread.object-metadata.ts +++ b/packages/twenty-server/src/modules/messaging/standard-objects/message-thread.object-metadata.ts @@ -5,8 +5,8 @@ import { RelationMetadataType, RelationOnDeleteAction, } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; -import { messageThreadStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { MESSAGE_THREAD_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -18,7 +18,7 @@ import { MessageObjectMetadata } from 'src/modules/messaging/standard-objects/me import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.messageThread, + standardId: STANDARD_OBJECT_IDS.messageThread, namePlural: 'messageThreads', labelSingular: 'Message Thread', labelPlural: 'Message Threads', @@ -29,7 +29,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsSystem() export class MessageThreadObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: messageThreadStandardFieldIds.messages, + standardId: MESSAGE_THREAD_STANDARD_FIELD_IDS.messages, type: FieldMetadataType.RELATION, label: 'Messages', description: 'Messages from the thread.', @@ -44,7 +44,8 @@ export class MessageThreadObjectMetadata extends BaseObjectMetadata { messages: Relation; @FieldMetadata({ - standardId: messageThreadStandardFieldIds.messageChannelMessageAssociations, + standardId: + MESSAGE_THREAD_STANDARD_FIELD_IDS.messageChannelMessageAssociations, type: FieldMetadataType.RELATION, label: 'Message Channel Association', description: 'Messages from the channel.', diff --git a/packages/twenty-server/src/modules/messaging/standard-objects/message.object-metadata.ts b/packages/twenty-server/src/modules/messaging/standard-objects/message.object-metadata.ts index afd388e623..8319e2618a 100644 --- a/packages/twenty-server/src/modules/messaging/standard-objects/message.object-metadata.ts +++ b/packages/twenty-server/src/modules/messaging/standard-objects/message.object-metadata.ts @@ -5,8 +5,8 @@ import { RelationMetadataType, RelationOnDeleteAction, } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; -import { messageStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { MESSAGE_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -19,7 +19,7 @@ import { MessageThreadObjectMetadata } from 'src/modules/messaging/standard-obje import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.message, + standardId: STANDARD_OBJECT_IDS.message, namePlural: 'messages', labelSingular: 'Message', labelPlural: 'Messages', @@ -30,7 +30,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsSystem() export class MessageObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: messageStandardFieldIds.headerMessageId, + standardId: MESSAGE_STANDARD_FIELD_IDS.headerMessageId, type: FieldMetadataType.TEXT, label: 'Header message Id', description: 'Message id from the message header', @@ -39,7 +39,7 @@ export class MessageObjectMetadata extends BaseObjectMetadata { headerMessageId: string; @FieldMetadata({ - standardId: messageStandardFieldIds.messageThread, + standardId: MESSAGE_STANDARD_FIELD_IDS.messageThread, type: FieldMetadataType.RELATION, label: 'Message Thread Id', description: 'Message Thread Id', @@ -50,7 +50,7 @@ export class MessageObjectMetadata extends BaseObjectMetadata { messageThread: Relation; @FieldMetadata({ - standardId: messageStandardFieldIds.direction, + standardId: MESSAGE_STANDARD_FIELD_IDS.direction, type: FieldMetadataType.SELECT, label: 'Direction', description: 'Message Direction', @@ -64,7 +64,7 @@ export class MessageObjectMetadata extends BaseObjectMetadata { direction: string; @FieldMetadata({ - standardId: messageStandardFieldIds.subject, + standardId: MESSAGE_STANDARD_FIELD_IDS.subject, type: FieldMetadataType.TEXT, label: 'Subject', description: 'Subject', @@ -73,7 +73,7 @@ export class MessageObjectMetadata extends BaseObjectMetadata { subject: string; @FieldMetadata({ - standardId: messageStandardFieldIds.text, + standardId: MESSAGE_STANDARD_FIELD_IDS.text, type: FieldMetadataType.TEXT, label: 'Text', description: 'Text', @@ -82,7 +82,7 @@ export class MessageObjectMetadata extends BaseObjectMetadata { text: string; @FieldMetadata({ - standardId: messageStandardFieldIds.receivedAt, + standardId: MESSAGE_STANDARD_FIELD_IDS.receivedAt, type: FieldMetadataType.DATE_TIME, label: 'Received At', description: 'The date the message was received', @@ -92,7 +92,7 @@ export class MessageObjectMetadata extends BaseObjectMetadata { receivedAt: string; @FieldMetadata({ - standardId: messageStandardFieldIds.messageParticipants, + standardId: MESSAGE_STANDARD_FIELD_IDS.messageParticipants, type: FieldMetadataType.RELATION, label: 'Message Participants', description: 'Message Participants', @@ -108,7 +108,7 @@ export class MessageObjectMetadata extends BaseObjectMetadata { messageParticipants: Relation; @FieldMetadata({ - standardId: messageStandardFieldIds.messageChannelMessageAssociations, + standardId: MESSAGE_STANDARD_FIELD_IDS.messageChannelMessageAssociations, type: FieldMetadataType.RELATION, label: 'Message Channel Association', description: 'Messages from the channel.', diff --git a/packages/twenty-server/src/modules/opportunity/standard-objects/opportunity.object-metadata.ts b/packages/twenty-server/src/modules/opportunity/standard-objects/opportunity.object-metadata.ts index cebedb83f2..e94897a484 100644 --- a/packages/twenty-server/src/modules/opportunity/standard-objects/opportunity.object-metadata.ts +++ b/packages/twenty-server/src/modules/opportunity/standard-objects/opportunity.object-metadata.ts @@ -6,8 +6,8 @@ import { RelationMetadataType, RelationOnDeleteAction, } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; -import { opportunityStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { OPPORTUNITY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -23,7 +23,7 @@ import { TimelineActivityObjectMetadata } from 'src/modules/timeline/standard-ob import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.opportunity, + standardId: STANDARD_OBJECT_IDS.opportunity, namePlural: 'opportunities', labelSingular: 'Opportunity', labelPlural: 'Opportunities', @@ -33,7 +33,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsNotAuditLogged() export class OpportunityObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: opportunityStandardFieldIds.name, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.name, type: FieldMetadataType.TEXT, label: 'Name', description: 'The opportunity name', @@ -42,7 +42,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata { name: string; @FieldMetadata({ - standardId: opportunityStandardFieldIds.amount, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.amount, type: FieldMetadataType.CURRENCY, label: 'Amount', description: 'Opportunity amount', @@ -52,7 +52,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata { amount: CurrencyMetadata; @FieldMetadata({ - standardId: opportunityStandardFieldIds.closeDate, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.closeDate, type: FieldMetadataType.DATE_TIME, label: 'Close date', description: 'Opportunity close date', @@ -62,7 +62,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata { closeDate: Date; @FieldMetadata({ - standardId: opportunityStandardFieldIds.probability, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.probability, type: FieldMetadataType.TEXT, label: 'Probability', description: 'Opportunity probability', @@ -72,7 +72,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata { probability: string; @FieldMetadata({ - standardId: opportunityStandardFieldIds.stage, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.stage, type: FieldMetadataType.SELECT, label: 'Stage', description: 'Opportunity stage', @@ -94,7 +94,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata { stage: string; @FieldMetadata({ - standardId: opportunityStandardFieldIds.position, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.position, type: FieldMetadataType.POSITION, label: 'Position', description: 'Opportunity record position', @@ -105,7 +105,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata { position: number; @FieldMetadata({ - standardId: opportunityStandardFieldIds.pointOfContact, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.pointOfContact, type: FieldMetadataType.RELATION, label: 'Point of Contact', description: 'Opportunity point of contact', @@ -116,7 +116,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata { pointOfContact: Relation; @FieldMetadata({ - standardId: opportunityStandardFieldIds.company, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.company, type: FieldMetadataType.RELATION, label: 'Company', description: 'Opportunity company', @@ -127,7 +127,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata { company: Relation; @FieldMetadata({ - standardId: opportunityStandardFieldIds.favorites, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.favorites, type: FieldMetadataType.RELATION, label: 'Favorites', description: 'Favorites linked to the opportunity', @@ -143,7 +143,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata { favorites: Relation; @FieldMetadata({ - standardId: opportunityStandardFieldIds.activityTargets, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.activityTargets, type: FieldMetadataType.RELATION, label: 'Activities', description: 'Activities tied to the opportunity', @@ -158,7 +158,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata { activityTargets: Relation; @FieldMetadata({ - standardId: opportunityStandardFieldIds.attachments, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.attachments, type: FieldMetadataType.RELATION, label: 'Attachments', description: 'Attachments linked to the opportunity.', @@ -173,7 +173,7 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata { attachments: Relation; @FieldMetadata({ - standardId: opportunityStandardFieldIds.timelineActivities, + standardId: OPPORTUNITY_STANDARD_FIELD_IDS.timelineActivities, type: FieldMetadataType.RELATION, label: 'Timeline Activities', description: 'Timeline Activities linked to the opportunity.', diff --git a/packages/twenty-server/src/modules/person/standard-objects/person.object-metadata.ts b/packages/twenty-server/src/modules/person/standard-objects/person.object-metadata.ts index 33c9fad19e..c5f18b5397 100644 --- a/packages/twenty-server/src/modules/person/standard-objects/person.object-metadata.ts +++ b/packages/twenty-server/src/modules/person/standard-objects/person.object-metadata.ts @@ -7,8 +7,8 @@ import { RelationMetadataType, RelationOnDeleteAction, } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; -import { personStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { PERSON_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; @@ -26,7 +26,7 @@ import { OpportunityObjectMetadata } from 'src/modules/opportunity/standard-obje import { TimelineActivityObjectMetadata } from 'src/modules/timeline/standard-objects/timeline-activity.object-metadata'; @ObjectMetadata({ - standardId: standardObjectIds.person, + standardId: STANDARD_OBJECT_IDS.person, namePlural: 'people', labelSingular: 'Person', labelPlural: 'People', @@ -35,7 +35,7 @@ import { TimelineActivityObjectMetadata } from 'src/modules/timeline/standard-ob }) export class PersonObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: personStandardFieldIds.name, + standardId: PERSON_STANDARD_FIELD_IDS.name, type: FieldMetadataType.FULL_NAME, label: 'Name', description: 'Contact’s name', @@ -45,7 +45,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { name: FullNameMetadata; @FieldMetadata({ - standardId: personStandardFieldIds.email, + standardId: PERSON_STANDARD_FIELD_IDS.email, type: FieldMetadataType.EMAIL, label: 'Email', description: 'Contact’s Email', @@ -54,7 +54,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { email: string; @FieldMetadata({ - standardId: personStandardFieldIds.linkedinLink, + standardId: PERSON_STANDARD_FIELD_IDS.linkedinLink, type: FieldMetadataType.LINK, label: 'Linkedin', description: 'Contact’s Linkedin account', @@ -64,7 +64,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { linkedinLink: LinkMetadata; @FieldMetadata({ - standardId: personStandardFieldIds.xLink, + standardId: PERSON_STANDARD_FIELD_IDS.xLink, type: FieldMetadataType.LINK, label: 'X', description: 'Contact’s X/Twitter account', @@ -74,7 +74,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { xLink: LinkMetadata; @FieldMetadata({ - standardId: personStandardFieldIds.jobTitle, + standardId: PERSON_STANDARD_FIELD_IDS.jobTitle, type: FieldMetadataType.TEXT, label: 'Job Title', description: 'Contact’s job title', @@ -83,7 +83,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { jobTitle: string; @FieldMetadata({ - standardId: personStandardFieldIds.phone, + standardId: PERSON_STANDARD_FIELD_IDS.phone, type: FieldMetadataType.TEXT, label: 'Phone', description: 'Contact’s phone number', @@ -92,7 +92,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { phone: string; @FieldMetadata({ - standardId: personStandardFieldIds.city, + standardId: PERSON_STANDARD_FIELD_IDS.city, type: FieldMetadataType.TEXT, label: 'City', description: 'Contact’s city', @@ -101,7 +101,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { city: string; @FieldMetadata({ - standardId: personStandardFieldIds.avatarUrl, + standardId: PERSON_STANDARD_FIELD_IDS.avatarUrl, type: FieldMetadataType.TEXT, label: 'Avatar', description: 'Contact’s avatar', @@ -111,7 +111,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { avatarUrl: string; @FieldMetadata({ - standardId: personStandardFieldIds.position, + standardId: PERSON_STANDARD_FIELD_IDS.position, type: FieldMetadataType.POSITION, label: 'Position', description: 'Person record Position', @@ -123,7 +123,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { // Relations @FieldMetadata({ - standardId: personStandardFieldIds.company, + standardId: PERSON_STANDARD_FIELD_IDS.company, type: FieldMetadataType.RELATION, label: 'Company', description: 'Contact’s company', @@ -134,7 +134,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { company: Relation; @FieldMetadata({ - standardId: personStandardFieldIds.pointOfContactForOpportunities, + standardId: PERSON_STANDARD_FIELD_IDS.pointOfContactForOpportunities, type: FieldMetadataType.RELATION, label: 'POC for Opportunities', description: 'Point of Contact for Opportunities', @@ -149,7 +149,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { pointOfContactForOpportunities: Relation; @FieldMetadata({ - standardId: personStandardFieldIds.activityTargets, + standardId: PERSON_STANDARD_FIELD_IDS.activityTargets, type: FieldMetadataType.RELATION, label: 'Activities', description: 'Activities tied to the contact', @@ -163,7 +163,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { activityTargets: Relation; @FieldMetadata({ - standardId: personStandardFieldIds.favorites, + standardId: PERSON_STANDARD_FIELD_IDS.favorites, type: FieldMetadataType.RELATION, label: 'Favorites', description: 'Favorites linked to the contact', @@ -178,7 +178,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { favorites: Relation; @FieldMetadata({ - standardId: personStandardFieldIds.attachments, + standardId: PERSON_STANDARD_FIELD_IDS.attachments, type: FieldMetadataType.RELATION, label: 'Attachments', description: 'Attachments linked to the contact.', @@ -192,7 +192,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { attachments: Relation; @FieldMetadata({ - standardId: personStandardFieldIds.messageParticipants, + standardId: PERSON_STANDARD_FIELD_IDS.messageParticipants, type: FieldMetadataType.RELATION, label: 'Message Participants', description: 'Message Participants', @@ -208,7 +208,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { messageParticipants: Relation; @FieldMetadata({ - standardId: personStandardFieldIds.calendarEventParticipants, + standardId: PERSON_STANDARD_FIELD_IDS.calendarEventParticipants, type: FieldMetadataType.RELATION, label: 'Calendar Event Participants', description: 'Calendar Event Participants', @@ -226,7 +226,7 @@ export class PersonObjectMetadata extends BaseObjectMetadata { calendarEventParticipants: Relation; @FieldMetadata({ - standardId: personStandardFieldIds.timelineActivities, + standardId: PERSON_STANDARD_FIELD_IDS.timelineActivities, type: FieldMetadataType.RELATION, label: 'Events', description: 'Events linked to the company', diff --git a/packages/twenty-server/src/modules/timeline/standard-objects/audit-log.object-metadata.ts b/packages/twenty-server/src/modules/timeline/standard-objects/audit-log.object-metadata.ts index 1aba7b2c27..71f76d9663 100644 --- a/packages/twenty-server/src/modules/timeline/standard-objects/audit-log.object-metadata.ts +++ b/packages/twenty-server/src/modules/timeline/standard-objects/audit-log.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { auditLogStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { AUDIT_LOGS_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -11,7 +11,7 @@ import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync- import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/standard-objects/workspace-member.object-metadata'; @ObjectMetadata({ - standardId: standardObjectIds.auditLog, + standardId: STANDARD_OBJECT_IDS.auditLog, namePlural: 'auditLogs', labelSingular: 'Audit Log', labelPlural: 'Audit Logs', @@ -21,7 +21,7 @@ import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/stan @IsSystem() export class AuditLogObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: auditLogStandardFieldIds.name, + standardId: AUDIT_LOGS_STANDARD_FIELD_IDS.name, type: FieldMetadataType.TEXT, label: 'Event name', description: 'Event name/type', @@ -30,7 +30,7 @@ export class AuditLogObjectMetadata extends BaseObjectMetadata { name: string; @FieldMetadata({ - standardId: auditLogStandardFieldIds.properties, + standardId: AUDIT_LOGS_STANDARD_FIELD_IDS.properties, type: FieldMetadataType.RAW_JSON, label: 'Event details', description: 'Json value for event details', @@ -40,7 +40,7 @@ export class AuditLogObjectMetadata extends BaseObjectMetadata { properties: JSON; @FieldMetadata({ - standardId: auditLogStandardFieldIds.context, + standardId: AUDIT_LOGS_STANDARD_FIELD_IDS.context, type: FieldMetadataType.RAW_JSON, label: 'Event context', description: @@ -51,7 +51,7 @@ export class AuditLogObjectMetadata extends BaseObjectMetadata { context: JSON; @FieldMetadata({ - standardId: auditLogStandardFieldIds.objectName, + standardId: AUDIT_LOGS_STANDARD_FIELD_IDS.objectName, type: FieldMetadataType.TEXT, label: 'Object name', description: 'If the event is related to a particular object', @@ -60,7 +60,7 @@ export class AuditLogObjectMetadata extends BaseObjectMetadata { objectName: string; @FieldMetadata({ - standardId: auditLogStandardFieldIds.objectName, + standardId: AUDIT_LOGS_STANDARD_FIELD_IDS.objectName, type: FieldMetadataType.TEXT, label: 'Object name', description: 'If the event is related to a particular object', @@ -69,7 +69,7 @@ export class AuditLogObjectMetadata extends BaseObjectMetadata { objectMetadataId: string; @FieldMetadata({ - standardId: auditLogStandardFieldIds.recordId, + standardId: AUDIT_LOGS_STANDARD_FIELD_IDS.recordId, type: FieldMetadataType.UUID, label: 'Object id', description: 'Event name/type', @@ -79,7 +79,7 @@ export class AuditLogObjectMetadata extends BaseObjectMetadata { recordId: string; @FieldMetadata({ - standardId: auditLogStandardFieldIds.workspaceMember, + standardId: AUDIT_LOGS_STANDARD_FIELD_IDS.workspaceMember, type: FieldMetadataType.RELATION, label: 'Workspace Member', description: 'Event workspace member', diff --git a/packages/twenty-server/src/modules/timeline/standard-objects/behavioral-event.object-metadata.ts b/packages/twenty-server/src/modules/timeline/standard-objects/behavioral-event.object-metadata.ts index b39938886d..4f1643727d 100644 --- a/packages/twenty-server/src/modules/timeline/standard-objects/behavioral-event.object-metadata.ts +++ b/packages/twenty-server/src/modules/timeline/standard-objects/behavioral-event.object-metadata.ts @@ -1,7 +1,7 @@ import { FeatureFlagKeys } from 'src/engine/core-modules/feature-flag/feature-flag.entity'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { behavioralEventStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { BEHAVIORAL_EVENT_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; @@ -10,7 +10,7 @@ import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-meta import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata'; @ObjectMetadata({ - standardId: standardObjectIds.behavioralEvent, + standardId: STANDARD_OBJECT_IDS.behavioralEvent, namePlural: 'behavioralEvents', labelSingular: 'Behavioral Event', labelPlural: 'Behavioral Events', @@ -40,7 +40,7 @@ export class BehavioralEventObjectMetadata extends BaseObjectMetadata { */ @FieldMetadata({ - standardId: behavioralEventStandardFieldIds.name, + standardId: BEHAVIORAL_EVENT_STANDARD_FIELD_IDS.name, type: FieldMetadataType.TEXT, label: 'Event name', description: 'Event name', @@ -49,7 +49,7 @@ export class BehavioralEventObjectMetadata extends BaseObjectMetadata { name: string; @FieldMetadata({ - standardId: behavioralEventStandardFieldIds.properties, + standardId: BEHAVIORAL_EVENT_STANDARD_FIELD_IDS.properties, type: FieldMetadataType.RAW_JSON, label: 'Event details', description: 'Json value for event details', @@ -59,7 +59,7 @@ export class BehavioralEventObjectMetadata extends BaseObjectMetadata { properties: JSON; @FieldMetadata({ - standardId: behavioralEventStandardFieldIds.context, + standardId: BEHAVIORAL_EVENT_STANDARD_FIELD_IDS.context, type: FieldMetadataType.RAW_JSON, label: 'Event context', description: @@ -70,7 +70,7 @@ export class BehavioralEventObjectMetadata extends BaseObjectMetadata { context: JSON; @FieldMetadata({ - standardId: behavioralEventStandardFieldIds.objectName, + standardId: BEHAVIORAL_EVENT_STANDARD_FIELD_IDS.objectName, type: FieldMetadataType.TEXT, label: 'Object name', description: 'If the event is related to a particular object', @@ -79,7 +79,7 @@ export class BehavioralEventObjectMetadata extends BaseObjectMetadata { objectName: string; @FieldMetadata({ - standardId: behavioralEventStandardFieldIds.recordId, + standardId: BEHAVIORAL_EVENT_STANDARD_FIELD_IDS.recordId, type: FieldMetadataType.UUID, label: 'Object id', description: 'Event name/type', diff --git a/packages/twenty-server/src/modules/timeline/standard-objects/timeline-activity.object-metadata.ts b/packages/twenty-server/src/modules/timeline/standard-objects/timeline-activity.object-metadata.ts index 1bf1ea9f80..257b13b827 100644 --- a/packages/twenty-server/src/modules/timeline/standard-objects/timeline-activity.object-metadata.ts +++ b/packages/twenty-server/src/modules/timeline/standard-objects/timeline-activity.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { timelineActivityStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { TIMELINE_ACTIVITY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { DynamicRelationFieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/dynamic-field-metadata.interface'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @@ -17,7 +17,7 @@ import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/stan import { CustomObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/custom-objects/custom.object-metadata'; @ObjectMetadata({ - standardId: standardObjectIds.timelineActivity, + standardId: STANDARD_OBJECT_IDS.timelineActivity, namePlural: 'timelineActivities', labelSingular: 'Timeline Activity', labelPlural: 'Timeline Activities', @@ -28,7 +28,7 @@ import { CustomObjectMetadata } from 'src/engine/workspace-manager/workspace-syn @IsNotAuditLogged() export class TimelineActivityObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: timelineActivityStandardFieldIds.happensAt, + standardId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.happensAt, type: FieldMetadataType.DATE_TIME, label: 'Creation date', description: 'Creation date', @@ -38,7 +38,7 @@ export class TimelineActivityObjectMetadata extends BaseObjectMetadata { happensAt: Date; @FieldMetadata({ - standardId: timelineActivityStandardFieldIds.name, + standardId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.name, type: FieldMetadataType.TEXT, label: 'Event name', description: 'Event name', @@ -47,7 +47,7 @@ export class TimelineActivityObjectMetadata extends BaseObjectMetadata { name: string; @FieldMetadata({ - standardId: timelineActivityStandardFieldIds.properties, + standardId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.properties, type: FieldMetadataType.RAW_JSON, label: 'Event details', description: 'Json value for event details', @@ -58,7 +58,7 @@ export class TimelineActivityObjectMetadata extends BaseObjectMetadata { // Who made the action @FieldMetadata({ - standardId: timelineActivityStandardFieldIds.workspaceMember, + standardId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.workspaceMember, type: FieldMetadataType.RELATION, label: 'Workspace Member', description: 'Event workspace member', @@ -69,7 +69,7 @@ export class TimelineActivityObjectMetadata extends BaseObjectMetadata { workspaceMember: Relation; @FieldMetadata({ - standardId: timelineActivityStandardFieldIds.person, + standardId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.person, type: FieldMetadataType.RELATION, label: 'Person', description: 'Event person', @@ -80,7 +80,7 @@ export class TimelineActivityObjectMetadata extends BaseObjectMetadata { person: Relation; @FieldMetadata({ - standardId: timelineActivityStandardFieldIds.company, + standardId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.company, type: FieldMetadataType.RELATION, label: 'Company', description: 'Event company', @@ -91,7 +91,7 @@ export class TimelineActivityObjectMetadata extends BaseObjectMetadata { company: Relation; @FieldMetadata({ - standardId: timelineActivityStandardFieldIds.opportunity, + standardId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.opportunity, type: FieldMetadataType.RELATION, label: 'Opportunity', description: 'Events opportunity', @@ -102,7 +102,7 @@ export class TimelineActivityObjectMetadata extends BaseObjectMetadata { opportunity: Relation; @DynamicRelationFieldMetadata((oppositeObjectMetadata) => ({ - standardId: timelineActivityStandardFieldIds.custom, + standardId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.custom, name: oppositeObjectMetadata.nameSingular, label: oppositeObjectMetadata.labelSingular, description: `Event ${oppositeObjectMetadata.labelSingular}`, @@ -113,7 +113,7 @@ export class TimelineActivityObjectMetadata extends BaseObjectMetadata { // Special objects that don't have their own timeline and are 'link' to the main object @FieldMetadata({ - standardId: timelineActivityStandardFieldIds.linkedRecordCachedName, + standardId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.linkedRecordCachedName, type: FieldMetadataType.TEXT, label: 'Linked Record cached name', description: 'Cached record name', @@ -122,7 +122,7 @@ export class TimelineActivityObjectMetadata extends BaseObjectMetadata { linkedRecordCachedName: string; @FieldMetadata({ - standardId: timelineActivityStandardFieldIds.linkedRecordId, + standardId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.linkedRecordId, type: FieldMetadataType.UUID, label: 'Linked Record id', description: 'Linked Record id', @@ -132,7 +132,7 @@ export class TimelineActivityObjectMetadata extends BaseObjectMetadata { linkedRecordId: string; @FieldMetadata({ - standardId: timelineActivityStandardFieldIds.linkedObjectMetadataId, + standardId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.linkedObjectMetadataId, type: FieldMetadataType.UUID, label: 'Linked Object Metadata Id', description: 'inked Object Metadata Id', diff --git a/packages/twenty-server/src/modules/view/standard-objects/view-field.object-metadata.ts b/packages/twenty-server/src/modules/view/standard-objects/view-field.object-metadata.ts index 40b8c326ea..835349be25 100644 --- a/packages/twenty-server/src/modules/view/standard-objects/view-field.object-metadata.ts +++ b/packages/twenty-server/src/modules/view/standard-objects/view-field.object-metadata.ts @@ -1,6 +1,6 @@ import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { viewFieldStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { VIEW_FIELD_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; @@ -10,7 +10,7 @@ import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync- import { ViewObjectMetadata } from 'src/modules/view/standard-objects/view.object-metadata'; @ObjectMetadata({ - standardId: standardObjectIds.viewField, + standardId: STANDARD_OBJECT_IDS.viewField, namePlural: 'viewFields', labelSingular: 'View Field', labelPlural: 'View Fields', @@ -21,7 +21,7 @@ import { ViewObjectMetadata } from 'src/modules/view/standard-objects/view.objec @IsSystem() export class ViewFieldObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: viewFieldStandardFieldIds.fieldMetadataId, + standardId: VIEW_FIELD_STANDARD_FIELD_IDS.fieldMetadataId, type: FieldMetadataType.UUID, label: 'Field Metadata Id', description: 'View Field target field', @@ -30,7 +30,7 @@ export class ViewFieldObjectMetadata extends BaseObjectMetadata { fieldMetadataId: string; @FieldMetadata({ - standardId: viewFieldStandardFieldIds.isVisible, + standardId: VIEW_FIELD_STANDARD_FIELD_IDS.isVisible, type: FieldMetadataType.BOOLEAN, label: 'Visible', description: 'View Field visibility', @@ -40,7 +40,7 @@ export class ViewFieldObjectMetadata extends BaseObjectMetadata { isVisible: boolean; @FieldMetadata({ - standardId: viewFieldStandardFieldIds.size, + standardId: VIEW_FIELD_STANDARD_FIELD_IDS.size, type: FieldMetadataType.NUMBER, label: 'Size', description: 'View Field size', @@ -50,7 +50,7 @@ export class ViewFieldObjectMetadata extends BaseObjectMetadata { size: number; @FieldMetadata({ - standardId: viewFieldStandardFieldIds.position, + standardId: VIEW_FIELD_STANDARD_FIELD_IDS.position, type: FieldMetadataType.NUMBER, label: 'Position', description: 'View Field position', @@ -60,7 +60,7 @@ export class ViewFieldObjectMetadata extends BaseObjectMetadata { position: number; @FieldMetadata({ - standardId: viewFieldStandardFieldIds.view, + standardId: VIEW_FIELD_STANDARD_FIELD_IDS.view, type: FieldMetadataType.RELATION, label: 'View', description: 'View Field related view', diff --git a/packages/twenty-server/src/modules/view/standard-objects/view-filter.object-metadata.ts b/packages/twenty-server/src/modules/view/standard-objects/view-filter.object-metadata.ts index ca88670e47..6ac6663d4f 100644 --- a/packages/twenty-server/src/modules/view/standard-objects/view-filter.object-metadata.ts +++ b/packages/twenty-server/src/modules/view/standard-objects/view-filter.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { viewFilterStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { VIEW_FILTER_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -12,7 +12,7 @@ import { ViewObjectMetadata } from 'src/modules/view/standard-objects/view.objec import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.viewFilter, + standardId: STANDARD_OBJECT_IDS.viewFilter, namePlural: 'viewFilters', labelSingular: 'View Filter', labelPlural: 'View Filters', @@ -23,7 +23,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsSystem() export class ViewFilterObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: viewFilterStandardFieldIds.fieldMetadataId, + standardId: VIEW_FILTER_STANDARD_FIELD_IDS.fieldMetadataId, type: FieldMetadataType.UUID, label: 'Field Metadata Id', description: 'View Filter target field', @@ -31,7 +31,7 @@ export class ViewFilterObjectMetadata extends BaseObjectMetadata { fieldMetadataId: string; @FieldMetadata({ - standardId: viewFilterStandardFieldIds.operand, + standardId: VIEW_FILTER_STANDARD_FIELD_IDS.operand, type: FieldMetadataType.TEXT, label: 'Operand', description: 'View Filter operand', @@ -40,7 +40,7 @@ export class ViewFilterObjectMetadata extends BaseObjectMetadata { operand: string; @FieldMetadata({ - standardId: viewFilterStandardFieldIds.value, + standardId: VIEW_FILTER_STANDARD_FIELD_IDS.value, type: FieldMetadataType.TEXT, label: 'Value', description: 'View Filter value', @@ -48,7 +48,7 @@ export class ViewFilterObjectMetadata extends BaseObjectMetadata { value: string; @FieldMetadata({ - standardId: viewFilterStandardFieldIds.displayValue, + standardId: VIEW_FILTER_STANDARD_FIELD_IDS.displayValue, type: FieldMetadataType.TEXT, label: 'Display Value', description: 'View Filter Display Value', @@ -56,7 +56,7 @@ export class ViewFilterObjectMetadata extends BaseObjectMetadata { displayValue: string; @FieldMetadata({ - standardId: viewFilterStandardFieldIds.view, + standardId: VIEW_FILTER_STANDARD_FIELD_IDS.view, type: FieldMetadataType.RELATION, label: 'View', description: 'View Filter related view', diff --git a/packages/twenty-server/src/modules/view/standard-objects/view-sort.object-metadata.ts b/packages/twenty-server/src/modules/view/standard-objects/view-sort.object-metadata.ts index a4817b508d..b28eb87c0d 100644 --- a/packages/twenty-server/src/modules/view/standard-objects/view-sort.object-metadata.ts +++ b/packages/twenty-server/src/modules/view/standard-objects/view-sort.object-metadata.ts @@ -1,8 +1,8 @@ import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface'; import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { viewSortStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { VIEW_SORT_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -12,7 +12,7 @@ import { ViewObjectMetadata } from 'src/modules/view/standard-objects/view.objec import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.viewSort, + standardId: STANDARD_OBJECT_IDS.viewSort, namePlural: 'viewSorts', labelSingular: 'View Sort', labelPlural: 'View Sorts', @@ -23,7 +23,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsSystem() export class ViewSortObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: viewSortStandardFieldIds.fieldMetadataId, + standardId: VIEW_SORT_STANDARD_FIELD_IDS.fieldMetadataId, type: FieldMetadataType.UUID, label: 'Field Metadata Id', description: 'View Sort target field', @@ -32,7 +32,7 @@ export class ViewSortObjectMetadata extends BaseObjectMetadata { fieldMetadataId: string; @FieldMetadata({ - standardId: viewSortStandardFieldIds.direction, + standardId: VIEW_SORT_STANDARD_FIELD_IDS.direction, type: FieldMetadataType.TEXT, label: 'Direction', description: 'View Sort direction', @@ -41,7 +41,7 @@ export class ViewSortObjectMetadata extends BaseObjectMetadata { direction: string; @FieldMetadata({ - standardId: viewSortStandardFieldIds.view, + standardId: VIEW_SORT_STANDARD_FIELD_IDS.view, type: FieldMetadataType.RELATION, label: 'View', description: 'View Sort related view', diff --git a/packages/twenty-server/src/modules/view/standard-objects/view.object-metadata.ts b/packages/twenty-server/src/modules/view/standard-objects/view.object-metadata.ts index dbb9d1523e..b113db5409 100644 --- a/packages/twenty-server/src/modules/view/standard-objects/view.object-metadata.ts +++ b/packages/twenty-server/src/modules/view/standard-objects/view.object-metadata.ts @@ -5,8 +5,8 @@ import { RelationMetadataType, RelationOnDeleteAction, } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; -import { viewStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { VIEW_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -19,7 +19,7 @@ import { ViewSortObjectMetadata } from 'src/modules/view/standard-objects/view-s import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.view, + standardId: STANDARD_OBJECT_IDS.view, namePlural: 'views', labelSingular: 'View', labelPlural: 'Views', @@ -30,7 +30,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsSystem() export class ViewObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: viewStandardFieldIds.name, + standardId: VIEW_STANDARD_FIELD_IDS.name, type: FieldMetadataType.TEXT, label: 'Name', description: 'View name', @@ -38,7 +38,7 @@ export class ViewObjectMetadata extends BaseObjectMetadata { name: string; @FieldMetadata({ - standardId: viewStandardFieldIds.objectMetadataId, + standardId: VIEW_STANDARD_FIELD_IDS.objectMetadataId, type: FieldMetadataType.UUID, label: 'Object Metadata Id', description: 'View target object', @@ -46,7 +46,7 @@ export class ViewObjectMetadata extends BaseObjectMetadata { objectMetadataId: string; @FieldMetadata({ - standardId: viewStandardFieldIds.type, + standardId: VIEW_STANDARD_FIELD_IDS.type, type: FieldMetadataType.TEXT, label: 'Type', description: 'View type', @@ -55,7 +55,7 @@ export class ViewObjectMetadata extends BaseObjectMetadata { type: string; @FieldMetadata({ - standardId: viewStandardFieldIds.key, + standardId: VIEW_STANDARD_FIELD_IDS.key, type: FieldMetadataType.SELECT, label: 'Key', description: 'View key', @@ -66,7 +66,7 @@ export class ViewObjectMetadata extends BaseObjectMetadata { key: string; @FieldMetadata({ - standardId: viewStandardFieldIds.icon, + standardId: VIEW_STANDARD_FIELD_IDS.icon, type: FieldMetadataType.TEXT, label: 'Icon', description: 'View icon', @@ -74,7 +74,7 @@ export class ViewObjectMetadata extends BaseObjectMetadata { icon: string; @FieldMetadata({ - standardId: viewStandardFieldIds.kanbanFieldMetadataId, + standardId: VIEW_STANDARD_FIELD_IDS.kanbanFieldMetadataId, type: FieldMetadataType.TEXT, label: 'kanbanfieldMetadataId', description: 'View Kanban column field', @@ -82,7 +82,7 @@ export class ViewObjectMetadata extends BaseObjectMetadata { kanbanFieldMetadataId: string; @FieldMetadata({ - standardId: viewStandardFieldIds.position, + standardId: VIEW_STANDARD_FIELD_IDS.position, type: FieldMetadataType.POSITION, label: 'Position', description: 'View position', @@ -91,7 +91,7 @@ export class ViewObjectMetadata extends BaseObjectMetadata { position: number; @FieldMetadata({ - standardId: viewStandardFieldIds.isCompact, + standardId: VIEW_STANDARD_FIELD_IDS.isCompact, type: FieldMetadataType.BOOLEAN, label: 'Compact View', description: 'Describes if the view is in compact mode', @@ -100,7 +100,7 @@ export class ViewObjectMetadata extends BaseObjectMetadata { isCompact: boolean; @FieldMetadata({ - standardId: viewStandardFieldIds.viewFields, + standardId: VIEW_STANDARD_FIELD_IDS.viewFields, type: FieldMetadataType.RELATION, label: 'View Fields', description: 'View Fields', @@ -115,7 +115,7 @@ export class ViewObjectMetadata extends BaseObjectMetadata { viewFields: Relation; @FieldMetadata({ - standardId: viewStandardFieldIds.viewFilters, + standardId: VIEW_STANDARD_FIELD_IDS.viewFilters, type: FieldMetadataType.RELATION, label: 'View Filters', description: 'View Filters', @@ -130,7 +130,7 @@ export class ViewObjectMetadata extends BaseObjectMetadata { viewFilters: Relation; @FieldMetadata({ - standardId: viewStandardFieldIds.viewSorts, + standardId: VIEW_STANDARD_FIELD_IDS.viewSorts, type: FieldMetadataType.RELATION, label: 'View Sorts', description: 'View Sorts', diff --git a/packages/twenty-server/src/modules/webhook/standard-objects/webhook.object-metadata.ts b/packages/twenty-server/src/modules/webhook/standard-objects/webhook.object-metadata.ts index cfa9e13eca..64de4a7d82 100644 --- a/packages/twenty-server/src/modules/webhook/standard-objects/webhook.object-metadata.ts +++ b/packages/twenty-server/src/modules/webhook/standard-objects/webhook.object-metadata.ts @@ -1,6 +1,6 @@ import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity'; -import { webhookStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { WEBHOOK_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -8,7 +8,7 @@ import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-meta import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata'; @ObjectMetadata({ - standardId: standardObjectIds.webhook, + standardId: STANDARD_OBJECT_IDS.webhook, namePlural: 'webhooks', labelSingular: 'Webhook', labelPlural: 'Webhooks', @@ -19,7 +19,7 @@ import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync- @IsSystem() export class WebhookObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: webhookStandardFieldIds.targetUrl, + standardId: WEBHOOK_STANDARD_FIELD_IDS.targetUrl, type: FieldMetadataType.TEXT, label: 'Target Url', description: 'Webhook target url', @@ -28,7 +28,7 @@ export class WebhookObjectMetadata extends BaseObjectMetadata { targetUrl: string; @FieldMetadata({ - standardId: webhookStandardFieldIds.operation, + standardId: WEBHOOK_STANDARD_FIELD_IDS.operation, type: FieldMetadataType.TEXT, label: 'Operation', description: 'Webhook operation', diff --git a/packages/twenty-server/src/modules/workspace-member/standard-objects/workspace-member.object-metadata.ts b/packages/twenty-server/src/modules/workspace-member/standard-objects/workspace-member.object-metadata.ts index bbb976c854..42696154ca 100644 --- a/packages/twenty-server/src/modules/workspace-member/standard-objects/workspace-member.object-metadata.ts +++ b/packages/twenty-server/src/modules/workspace-member/standard-objects/workspace-member.object-metadata.ts @@ -6,8 +6,8 @@ import { RelationMetadataType, RelationOnDeleteAction, } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity'; -import { workspaceMemberStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; -import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; +import { WORKSPACE_MEMBER_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; +import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator'; import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator'; import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-system.decorator'; @@ -29,7 +29,7 @@ import { AuditLogObjectMetadata } from 'src/modules/timeline/standard-objects/au import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-not-audit-logged.decorator'; @ObjectMetadata({ - standardId: standardObjectIds.workspaceMember, + standardId: STANDARD_OBJECT_IDS.workspaceMember, namePlural: 'workspaceMembers', labelSingular: 'Workspace Member', labelPlural: 'Workspace Members', @@ -40,7 +40,7 @@ import { IsNotAuditLogged } from 'src/engine/workspace-manager/workspace-sync-me @IsNotAuditLogged() export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.name, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.name, type: FieldMetadataType.FULL_NAME, label: 'Name', description: 'Workspace member name', @@ -49,7 +49,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { name: FullNameMetadata; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.colorScheme, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.colorScheme, type: FieldMetadataType.TEXT, label: 'Color Scheme', description: 'Preferred color scheme', @@ -59,7 +59,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { colorScheme: string; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.locale, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.locale, type: FieldMetadataType.TEXT, label: 'Language', description: 'Preferred language', @@ -69,7 +69,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { locale: string; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.avatarUrl, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.avatarUrl, type: FieldMetadataType.TEXT, label: 'Avatar Url', description: 'Workspace member avatar', @@ -78,7 +78,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { avatarUrl: string; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.userEmail, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.userEmail, type: FieldMetadataType.TEXT, label: 'User Email', description: 'Related user email address', @@ -87,7 +87,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { userEmail: string; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.userId, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.userId, type: FieldMetadataType.UUID, label: 'User Id', description: 'Associated User Id', @@ -97,7 +97,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { // Relations @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.authoredActivities, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.authoredActivities, type: FieldMetadataType.RELATION, label: 'Authored activities', description: 'Activities created by the workspace member', @@ -112,7 +112,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { authoredActivities: Relation; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.assignedActivities, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.assignedActivities, type: FieldMetadataType.RELATION, label: 'Assigned activities', description: 'Activities assigned to the workspace member', @@ -127,7 +127,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { assignedActivities: Relation; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.favorites, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.favorites, type: FieldMetadataType.RELATION, label: 'Favorites', description: 'Favorites linked to the workspace member', @@ -141,7 +141,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { favorites: Relation; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.accountOwnerForCompanies, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.accountOwnerForCompanies, type: FieldMetadataType.RELATION, label: 'Account Owner For Companies', description: 'Account owner for companies', @@ -156,7 +156,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { accountOwnerForCompanies: Relation; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.authoredAttachments, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.authoredAttachments, type: FieldMetadataType.RELATION, label: 'Authored attachments', description: 'Attachments created by the workspace member', @@ -171,7 +171,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { authoredAttachments: Relation; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.authoredComments, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.authoredComments, type: FieldMetadataType.RELATION, label: 'Authored comments', description: 'Authored comments', @@ -186,7 +186,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { authoredComments: Relation; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.connectedAccounts, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.connectedAccounts, type: FieldMetadataType.RELATION, label: 'Connected accounts', description: 'Connected accounts', @@ -201,7 +201,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { connectedAccounts: Relation; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.messageParticipants, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.messageParticipants, type: FieldMetadataType.RELATION, label: 'Message Participants', description: 'Message Participants', @@ -216,7 +216,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { messageParticipants: Relation; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.blocklist, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.blocklist, type: FieldMetadataType.RELATION, label: 'Blocklist', description: 'Blocklisted handles', @@ -231,7 +231,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { blocklist: Relation; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.calendarEventParticipants, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.calendarEventParticipants, type: FieldMetadataType.RELATION, label: 'Calendar Event Participants', description: 'Calendar Event Participants', @@ -249,7 +249,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { calendarEventParticipants: Relation; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.timelineActivities, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.timelineActivities, type: FieldMetadataType.RELATION, label: 'Events', description: 'Events linked to the workspace member', @@ -265,7 +265,7 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata { timelineActivities: Relation; @FieldMetadata({ - standardId: workspaceMemberStandardFieldIds.auditLogs, + standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.auditLogs, type: FieldMetadataType.RELATION, label: 'Aud tLogs', description: 'Audit Logs linked to the workspace member',