[AUDIT] Run knip over twenty-server (#21159)
# Introduction Run [knip](https://knip.dev/) over twenty-server Used config: ```json { "$schema": "https://unpkg.com/knip@5/schema.json", "workspaces": { "packages/twenty-server": { "entry": [ "src/main.ts", "src/command/command.ts", "src/queue-worker/queue-worker.ts", "src/database/scripts/setup-db.ts", "src/database/scripts/truncate-db.ts", "src/database/clickHouse/migrations/run-migrations.ts", "src/database/clickHouse/seeds/run-seeds.ts", "src/instrument.ts", "lingui.config.ts", "test/integration/graphql/codegen/index.ts", "test/integration/utils/setup-test.ts", "test/integration/utils/teardown-test.ts", "scripts/**/*.ts", "**/*.spec.ts", "**/*.integration-spec.ts" ], "project": ["src/**/*.ts", "test/**/*.ts", "scripts/**/*.ts"], "ignore": [ "src/database/typeorm/**/migrations/**", "src/database/typeorm/**/*.entity.ts", "**/*.workspace-entity.ts", "**/logic-function-resource/constants/seed-project/**" ], "ignoreDependencies": ["@types/psl", "@types/aws-lambda"], "ignoreBinaries": ["nest", "lingui", "typeorm"] } } } ```
This commit is contained in:
-1
@@ -1 +0,0 @@
|
||||
export type CompositeFieldGroupByDefinition = Record<string, boolean>;
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
import { type CompositeFieldGroupByDefinition } from 'src/engine/api/common/common-args-processors/group-by-arg-processor/types/composite-field-group-by-definition.type';
|
||||
import { type DateFieldGroupByDefinition } from 'src/engine/api/common/common-args-processors/group-by-arg-processor/types/date-field-group-by-definition.type';
|
||||
|
||||
export type FieldGroupByDefinition =
|
||||
| boolean
|
||||
| CompositeFieldGroupByDefinition
|
||||
| DateFieldGroupByDefinition
|
||||
| undefined;
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
import { MAX_DEPTH } from 'src/engine/api/rest/input-request-parsers/constants/max-depth.constant';
|
||||
import { type Depth } from 'src/engine/api/rest/input-request-parsers/types/depth.type';
|
||||
import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
|
||||
|
||||
export const getShouldRecurseIntoRelation = ({
|
||||
depth,
|
||||
flatField,
|
||||
}: {
|
||||
depth: Depth | undefined;
|
||||
flatField: FlatFieldMetadata;
|
||||
}): boolean => {
|
||||
const flatFieldIsJoinColumn =
|
||||
isDefined(flatField.settings) &&
|
||||
'junctionTargetFieldId' in flatField.settings;
|
||||
|
||||
// TODO: refactor this when we remove hard-coded activity relations
|
||||
const flatFieldIsActivityTarget =
|
||||
flatField.name === 'noteTargets' || flatField.name === 'taskTargets';
|
||||
|
||||
const shouldGoOneLevelDeeper =
|
||||
depth === MAX_DEPTH && isDefined(flatField.relationTargetObjectMetadataId);
|
||||
|
||||
const shouldRecurseIntoRelation =
|
||||
shouldGoOneLevelDeeper ||
|
||||
flatFieldIsActivityTarget ||
|
||||
flatFieldIsJoinColumn;
|
||||
|
||||
return shouldRecurseIntoRelation;
|
||||
};
|
||||
Reference in New Issue
Block a user