[QRQC_2] No explicit any in twenty-server (#12068)

# Introduction

Added a no-explicit-any rule to the twenty-server, not applicable to
tests and integration tests folder

Related to https://github.com/twentyhq/core-team-issues/issues/975
Discussed with Charles

## In case of conflicts
Until this is approved I won't rebased and handle conflict, just need to
drop two latest commits and re run the scripts etc

## Legacy
We decided not to handle the existing lint error occurrences and
programmatically ignored them through a disable next line rule comment

## Open question
We might wanna activate the
[no-explicit-any](https://typescript-eslint.io/rules/no-explicit-any/)
`ignoreRestArgs` for our use case ?
```
    ignoreRestArgs?: boolean;
```

---------

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
This commit is contained in:
Paul Rastoin
2025-05-15 16:26:38 +02:00
committed by GitHub
parent c95c4383b4
commit a8423e8503
213 changed files with 453 additions and 4 deletions

View File

@ -14,6 +14,7 @@ module.exports = {
project: ['packages/twenty-server/tsconfig.json'], project: ['packages/twenty-server/tsconfig.json'],
}, },
rules: { rules: {
'@typescript-eslint/no-explicit-any': 'error',
'no-restricted-imports': [ 'no-restricted-imports': [
'error', 'error',
{ {
@ -98,6 +99,18 @@ module.exports = {
'@nx/workspace-inject-workspace-repository': 'warn', '@nx/workspace-inject-workspace-repository': 'warn',
}, },
}, },
{
files: [
'**/*.spec.ts',
'**/*.integration-spec.ts',
'**/__tests__/**',
'**/test/integration/**',
'**/test/utils/**',
],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
{ {
files: ['scripts/**/*.ts'], files: ['scripts/**/*.ts'],
parserOptions: { parserOptions: {

View File

@ -133,6 +133,7 @@ export class ClickHouseService implements OnModuleInit, OnModuleDestroy {
} }
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public async insert<T extends Record<string, any>>( public async insert<T extends Record<string, any>>(
table: string, table: string,
values: T[], values: T[],
@ -164,6 +165,7 @@ export class ClickHouseService implements OnModuleInit, OnModuleDestroy {
// Method to execute a select query // Method to execute a select query
public async select<T>( public async select<T>(
query: string, query: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
params?: Record<string, any>, params?: Record<string, any>,
clientId?: string, clientId?: string,
): Promise<T[]> { ): Promise<T[]> {

View File

@ -20,6 +20,7 @@ export class CommandLogger {
this.verboseFlag = options.verbose ?? false; this.verboseFlag = options.verbose ?? false;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
log(message: string, ...optionalParams: [...any, string?]) { log(message: string, ...optionalParams: [...any, string?]) {
this.logger.log(message, ...optionalParams); this.logger.log(message, ...optionalParams);
} }
@ -28,14 +29,17 @@ export class CommandLogger {
this.logger.error(message, stack, context); this.logger.error(message, stack, context);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
warn(message: string, ...optionalParams: [...any, string?]) { warn(message: string, ...optionalParams: [...any, string?]) {
this.logger.warn(message, ...optionalParams); this.logger.warn(message, ...optionalParams);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
debug(message: string, ...optionalParams: [...any, string?]) { debug(message: string, ...optionalParams: [...any, string?]) {
this.logger.debug(message, ...optionalParams); this.logger.debug(message, ...optionalParams);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
verbose(message: string, ...optionalParams: [...any, string?]) { verbose(message: string, ...optionalParams: [...any, string?]) {
if (this.verboseFlag) { if (this.verboseFlag) {
this.logger.log(message, ...optionalParams); this.logger.log(message, ...optionalParams);

View File

@ -2,12 +2,15 @@ import { isDefined } from 'class-validator';
import { Plugin } from 'graphql-yoga'; import { Plugin } from 'graphql-yoga';
export type CacheMetadataPluginConfig = { export type CacheMetadataPluginConfig = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
cacheGetter: (key: string) => any; cacheGetter: (key: string) => any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
cacheSetter: (key: string, value: any) => void; cacheSetter: (key: string, value: any) => void;
operationsToCache: string[]; operationsToCache: string[];
}; };
export function useCachedMetadata(config: CacheMetadataPluginConfig): Plugin { export function useCachedMetadata(config: CacheMetadataPluginConfig): Plugin {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const computeCacheKey = (serverContext: any) => { const computeCacheKey = (serverContext: any) => {
const workspaceId = serverContext.req.workspace?.id ?? 'anonymous'; const workspaceId = serverContext.req.workspace?.id ?? 'anonymous';
const workspaceMetadataVersion = const workspaceMetadataVersion =
@ -21,6 +24,7 @@ export function useCachedMetadata(config: CacheMetadataPluginConfig): Plugin {
return `graphql:operations:${operationName}:${workspaceId}:${workspaceMetadataVersion}${localeCacheKey}`; return `graphql:operations:${operationName}:${workspaceId}:${workspaceMetadataVersion}${localeCacheKey}`;
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const getOperationName = (serverContext: any) => const getOperationName = (serverContext: any) =>
serverContext?.req?.body?.operationName; serverContext?.req?.body?.operationName;

View File

@ -29,9 +29,11 @@ export class GraphqlQueryFilterConditionParser {
} }
public parse( public parse(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
queryBuilder: SelectQueryBuilder<any>, queryBuilder: SelectQueryBuilder<any>,
objectNameSingular: string, objectNameSingular: string,
filter: Partial<ObjectRecordFilter>, filter: Partial<ObjectRecordFilter>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): SelectQueryBuilder<any> { ): SelectQueryBuilder<any> {
if (!filter || Object.keys(filter).length === 0) { if (!filter || Object.keys(filter).length === 0) {
return queryBuilder; return queryBuilder;
@ -50,6 +52,7 @@ export class GraphqlQueryFilterConditionParser {
queryBuilder: WhereExpressionBuilder, queryBuilder: WhereExpressionBuilder,
objectNameSingular: string, objectNameSingular: string,
key: string, key: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any, value: any,
isFirst = false, isFirst = false,
): void { ): void {

View File

@ -31,6 +31,7 @@ export class GraphqlQueryFilterFieldParser {
queryBuilder: WhereExpressionBuilder, queryBuilder: WhereExpressionBuilder,
objectNameSingular: string, objectNameSingular: string,
key: string, key: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
filterValue: any, filterValue: any,
isFirst = false, isFirst = false,
): void { ): void {
@ -81,6 +82,7 @@ export class GraphqlQueryFilterFieldParser {
queryBuilder: WhereExpressionBuilder, queryBuilder: WhereExpressionBuilder,
fieldMetadata: FieldMetadataInterface, fieldMetadata: FieldMetadataInterface,
objectNameSingular: string, objectNameSingular: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fieldValue: any, fieldValue: any,
isFirst = false, isFirst = false,
): void { ): void {
@ -108,6 +110,7 @@ export class GraphqlQueryFilterFieldParser {
const fullFieldName = `${fieldMetadata.name}${capitalize(subFieldKey)}`; const fullFieldName = `${fieldMetadata.name}${capitalize(subFieldKey)}`;
const [[operator, value]] = Object.entries( const [[operator, value]] = Object.entries(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
subFieldFilter as Record<string, any>, subFieldFilter as Record<string, any>,
); );

View File

@ -65,6 +65,7 @@ export class GraphqlQueryOrderFieldParser {
private parseCompositeFieldForOrder( private parseCompositeFieldForOrder(
fieldMetadata: FieldMetadataInterface, fieldMetadata: FieldMetadataInterface,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any, value: any,
objectNameSingular: string, objectNameSingular: string,
isForwardPagination = true, isForwardPagination = true,

View File

@ -8,6 +8,7 @@ import {
export class GraphqlQuerySelectedFieldsAggregateParser { export class GraphqlQuerySelectedFieldsAggregateParser {
parse( parse(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
graphqlSelectedFields: Partial<Record<string, any>>, graphqlSelectedFields: Partial<Record<string, any>>,
fieldMetadataMapByName: Record<string, FieldMetadataInterface>, fieldMetadataMapByName: Record<string, FieldMetadataInterface>,
accumulator: GraphqlQuerySelectedFieldsResult, accumulator: GraphqlQuerySelectedFieldsResult,

View File

@ -17,6 +17,7 @@ export class GraphqlQuerySelectedFieldsRelationParser {
parseRelationField( parseRelationField(
fieldMetadata: FieldMetadataInterface, fieldMetadata: FieldMetadataInterface,
fieldKey: string, fieldKey: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fieldValue: any, fieldValue: any,
accumulator: GraphqlQuerySelectedFieldsResult, accumulator: GraphqlQuerySelectedFieldsResult,
): void { ): void {

View File

@ -11,8 +11,11 @@ import { CompositeFieldMetadataType } from 'src/engine/metadata-modules/workspac
import { isRelationFieldMetadataType } from 'src/engine/utils/is-relation-field-metadata-type.util'; import { isRelationFieldMetadataType } from 'src/engine/utils/is-relation-field-metadata-type.util';
export type GraphqlQuerySelectedFieldsResult = { export type GraphqlQuerySelectedFieldsResult = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
select: Record<string, any>; select: Record<string, any>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
relations: Record<string, any>; relations: Record<string, any>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
aggregate: Record<string, any>; aggregate: Record<string, any>;
}; };
@ -27,6 +30,7 @@ export class GraphqlQuerySelectedFieldsParser {
} }
parse( parse(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
graphqlSelectedFields: Partial<Record<string, any>>, graphqlSelectedFields: Partial<Record<string, any>>,
fieldMetadataMapByName: Record<string, FieldMetadataInterface>, fieldMetadataMapByName: Record<string, FieldMetadataInterface>,
): GraphqlQuerySelectedFieldsResult { ): GraphqlQuerySelectedFieldsResult {
@ -62,6 +66,7 @@ export class GraphqlQuerySelectedFieldsParser {
} }
private parseRecordField( private parseRecordField(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
graphqlSelectedFields: Partial<Record<string, any>>, graphqlSelectedFields: Partial<Record<string, any>>,
fieldMetadataMapByName: Record<string, FieldMetadataInterface>, fieldMetadataMapByName: Record<string, FieldMetadataInterface>,
accumulator: GraphqlQuerySelectedFieldsResult, accumulator: GraphqlQuerySelectedFieldsResult,
@ -96,6 +101,7 @@ export class GraphqlQuerySelectedFieldsParser {
} }
private parseConnectionField( private parseConnectionField(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
graphqlSelectedFields: Partial<Record<string, any>>, graphqlSelectedFields: Partial<Record<string, any>>,
fieldMetadataMapByName: Record<string, FieldMetadataInterface>, fieldMetadataMapByName: Record<string, FieldMetadataInterface>,
accumulator: GraphqlQuerySelectedFieldsResult, accumulator: GraphqlQuerySelectedFieldsResult,
@ -112,6 +118,7 @@ export class GraphqlQuerySelectedFieldsParser {
} }
private isRootConnection( private isRootConnection(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
graphqlSelectedFields: Partial<Record<string, any>>, graphqlSelectedFields: Partial<Record<string, any>>,
): boolean { ): boolean {
return Object.keys(graphqlSelectedFields).includes('edges'); return Object.keys(graphqlSelectedFields).includes('edges');
@ -119,7 +126,9 @@ export class GraphqlQuerySelectedFieldsParser {
private parseCompositeField( private parseCompositeField(
fieldMetadata: FieldMetadataInterface, fieldMetadata: FieldMetadataInterface,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fieldValue: any, fieldValue: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Record<string, any> { ): Record<string, any> {
const compositeType = compositeTypeDefinitions.get( const compositeType = compositeTypeDefinitions.get(
fieldMetadata.type as CompositeFieldMetadataType, fieldMetadata.type as CompositeFieldMetadataType,
@ -151,6 +160,7 @@ export class GraphqlQuerySelectedFieldsParser {
return acc; return acc;
}, },
// eslint-disable-next-line @typescript-eslint/no-explicit-any
{} as Record<string, any>, {} as Record<string, any>,
); );
} }

View File

@ -50,9 +50,11 @@ export class GraphqlQueryParser {
} }
public applyFilterToBuilder( public applyFilterToBuilder(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
queryBuilder: SelectQueryBuilder<any>, queryBuilder: SelectQueryBuilder<any>,
objectNameSingular: string, objectNameSingular: string,
recordFilter: Partial<ObjectRecordFilter>, recordFilter: Partial<ObjectRecordFilter>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): SelectQueryBuilder<any> { ): SelectQueryBuilder<any> {
return this.filterConditionParser.parse( return this.filterConditionParser.parse(
queryBuilder, queryBuilder,
@ -62,8 +64,10 @@ export class GraphqlQueryParser {
} }
public applyDeletedAtToBuilder( public applyDeletedAtToBuilder(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
queryBuilder: SelectQueryBuilder<any>, queryBuilder: SelectQueryBuilder<any>,
recordFilter: Partial<ObjectRecordFilter>, recordFilter: Partial<ObjectRecordFilter>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): SelectQueryBuilder<any> { ): SelectQueryBuilder<any> {
if (this.checkForDeletedAtFilter(recordFilter)) { if (this.checkForDeletedAtFilter(recordFilter)) {
queryBuilder.withDeleted(); queryBuilder.withDeleted();
@ -99,10 +103,12 @@ export class GraphqlQueryParser {
}; };
public applyOrderToBuilder( public applyOrderToBuilder(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
queryBuilder: SelectQueryBuilder<any>, queryBuilder: SelectQueryBuilder<any>,
orderBy: ObjectRecordOrderBy, orderBy: ObjectRecordOrderBy,
objectNameSingular: string, objectNameSingular: string,
isForwardPagination = true, isForwardPagination = true,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): SelectQueryBuilder<any> { ): SelectQueryBuilder<any> {
const parsedOrderBys = this.orderFieldParser.parse( const parsedOrderBys = this.orderFieldParser.parse(
orderBy, orderBy,
@ -115,6 +121,7 @@ export class GraphqlQueryParser {
public parseSelectedFields( public parseSelectedFields(
parentObjectMetadata: ObjectMetadataItemWithFieldMaps, parentObjectMetadata: ObjectMetadataItemWithFieldMaps,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
graphqlSelectedFields: Partial<Record<string, any>>, graphqlSelectedFields: Partial<Record<string, any>>,
): GraphqlQuerySelectedFieldsResult { ): GraphqlQuerySelectedFieldsResult {
const parentFields = getObjectMetadataMapItemByNameSingular( const parentFields = getObjectMetadataMapItemByNameSingular(

View File

@ -46,7 +46,9 @@ export class ObjectRecordsToGraphqlConnectionHelper {
}: { }: {
objectRecords: T[]; objectRecords: T[];
parentObjectRecord?: T; parentObjectRecord?: T;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
objectRecordsAggregatedValues?: Record<string, any>; objectRecordsAggregatedValues?: Record<string, any>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
selectedAggregatedFields?: Record<string, any>; selectedAggregatedFields?: Record<string, any>;
objectName: string; objectName: string;
take: number; take: number;
@ -95,6 +97,7 @@ export class ObjectRecordsToGraphqlConnectionHelper {
objectRecordsAggregatedValues, objectRecordsAggregatedValues,
}: { }: {
selectedAggregatedFields: Record<string, AggregationField[]>; selectedAggregatedFields: Record<string, AggregationField[]>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
objectRecordsAggregatedValues: Record<string, any>; objectRecordsAggregatedValues: Record<string, any>;
}) => { }) => {
if (!isDefined(objectRecordsAggregatedValues)) { if (!isDefined(objectRecordsAggregatedValues)) {
@ -120,6 +123,7 @@ export class ObjectRecordsToGraphqlConnectionHelper {
); );
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public processRecord<T extends Record<string, any>>({ public processRecord<T extends Record<string, any>>({
objectRecord, objectRecord,
objectName, objectName,
@ -132,7 +136,9 @@ export class ObjectRecordsToGraphqlConnectionHelper {
}: { }: {
objectRecord: T; objectRecord: T;
objectName: string; objectName: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
objectRecordsAggregatedValues?: Record<string, any>; objectRecordsAggregatedValues?: Record<string, any>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
selectedAggregatedFields?: Record<string, any>; selectedAggregatedFields?: Record<string, any>;
take: number; take: number;
totalCount: number; totalCount: number;
@ -158,6 +164,7 @@ export class ObjectRecordsToGraphqlConnectionHelper {
); );
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const processedObjectRecord: Record<string, any> = {}; const processedObjectRecord: Record<string, any> = {};
for (const [key, value] of Object.entries(objectRecord)) { for (const [key, value] of Object.entries(objectRecord)) {
@ -229,7 +236,9 @@ export class ObjectRecordsToGraphqlConnectionHelper {
private processCompositeField( private processCompositeField(
fieldMetadata: FieldMetadataInterface, fieldMetadata: FieldMetadataInterface,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fieldValue: any, fieldValue: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Record<string, any> { ): Record<string, any> {
const compositeType = compositeTypeDefinitions.get( const compositeType = compositeTypeDefinitions.get(
fieldMetadata.type as CompositeFieldMetadataType, fieldMetadata.type as CompositeFieldMetadataType,
@ -262,10 +271,12 @@ export class ObjectRecordsToGraphqlConnectionHelper {
return acc; return acc;
}, },
// eslint-disable-next-line @typescript-eslint/no-explicit-any
{} as Record<string, any>, {} as Record<string, any>,
); );
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private formatFieldValue(value: any, fieldType: FieldMetadataType) { private formatFieldValue(value: any, fieldType: FieldMetadataType) {
switch (fieldType) { switch (fieldType) {
case FieldMetadataType.RAW_JSON: case FieldMetadataType.RAW_JSON:

View File

@ -14,6 +14,7 @@ export class ProcessAggregateHelper {
queryBuilder, queryBuilder,
}: { }: {
selectedAggregatedFields: Record<string, AggregationField>; selectedAggregatedFields: Record<string, AggregationField>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
queryBuilder: SelectQueryBuilder<any>; queryBuilder: SelectQueryBuilder<any>;
}) => { }) => {
queryBuilder.select([]); queryBuilder.select([]);

View File

@ -47,6 +47,7 @@ export class ProcessNestedRelationsV2Helper {
objectMetadataMaps: ObjectMetadataMaps; objectMetadataMaps: ObjectMetadataMaps;
parentObjectMetadataItem: ObjectMetadataItemWithFieldMaps; parentObjectMetadataItem: ObjectMetadataItemWithFieldMaps;
parentObjectRecords: T[]; parentObjectRecords: T[];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parentObjectRecordsAggregatedValues?: Record<string, any>; parentObjectRecordsAggregatedValues?: Record<string, any>;
relations: Record<string, FindOptionsRelations<ObjectLiteral>>; relations: Record<string, FindOptionsRelations<ObjectLiteral>>;
aggregate?: Record<string, AggregationField>; aggregate?: Record<string, AggregationField>;
@ -94,6 +95,7 @@ export class ProcessNestedRelationsV2Helper {
objectMetadataMaps: ObjectMetadataMaps; objectMetadataMaps: ObjectMetadataMaps;
parentObjectMetadataItem: ObjectMetadataItemWithFieldMaps; parentObjectMetadataItem: ObjectMetadataItemWithFieldMaps;
parentObjectRecords: T[]; parentObjectRecords: T[];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parentObjectRecordsAggregatedValues: Record<string, any>; parentObjectRecordsAggregatedValues: Record<string, any>;
sourceFieldName: string; sourceFieldName: string;
nestedRelations: FindOptionsRelations<ObjectLiteral>; nestedRelations: FindOptionsRelations<ObjectLiteral>;
@ -251,6 +253,7 @@ export class ProcessNestedRelationsV2Helper {
}: { }: {
records: ObjectRecord[]; records: ObjectRecord[];
idField: string; idField: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}): any[] { }): any[] {
return [...new Set(records.map((item) => item[idField]))]; return [...new Set(records.map((item) => item[idField]))];
} }
@ -265,20 +268,26 @@ export class ProcessNestedRelationsV2Helper {
aggregate, aggregate,
sourceFieldName, sourceFieldName,
}: { }: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
referenceQueryBuilder: SelectQueryBuilder<any>; referenceQueryBuilder: SelectQueryBuilder<any>;
column: string; column: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ids: any[]; ids: any[];
limit: number; limit: number;
objectMetadataMaps: ObjectMetadataMaps; objectMetadataMaps: ObjectMetadataMaps;
targetObjectMetadata: ObjectMetadataItemWithFieldMaps; targetObjectMetadata: ObjectMetadataItemWithFieldMaps;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
aggregate: Record<string, any>; aggregate: Record<string, any>;
sourceFieldName: string; sourceFieldName: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}): Promise<{ relationResults: any[]; relationAggregatedFieldsResult: any }> { }): Promise<{ relationResults: any[]; relationAggregatedFieldsResult: any }> {
if (ids.length === 0) { if (ids.length === 0) {
return { relationResults: [], relationAggregatedFieldsResult: {} }; return { relationResults: [], relationAggregatedFieldsResult: {} };
} }
const aggregateForRelation = aggregate[sourceFieldName]; const aggregateForRelation = aggregate[sourceFieldName];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let relationAggregatedFieldsResult: Record<string, any> = {}; let relationAggregatedFieldsResult: Record<string, any> = {};
if (aggregateForRelation) { if (aggregateForRelation) {
@ -339,8 +348,11 @@ export class ProcessNestedRelationsV2Helper {
relationType, relationType,
}: { }: {
parentRecords: ObjectRecord[]; parentRecords: ObjectRecord[];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parentObjectRecordsAggregatedValues: Record<string, any>; parentObjectRecordsAggregatedValues: Record<string, any>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
relationResults: any[]; relationResults: any[];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
relationAggregatedFieldsResult: Record<string, any>; relationAggregatedFieldsResult: Record<string, any>;
sourceFieldName: string; sourceFieldName: string;
joinField: string; joinField: string;

View File

@ -35,6 +35,7 @@ export class ProcessNestedRelationsHelper {
objectMetadataMaps: ObjectMetadataMaps; objectMetadataMaps: ObjectMetadataMaps;
parentObjectMetadataItem: ObjectMetadataItemWithFieldMaps; parentObjectMetadataItem: ObjectMetadataItemWithFieldMaps;
parentObjectRecords: T[]; parentObjectRecords: T[];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parentObjectRecordsAggregatedValues?: Record<string, any>; parentObjectRecordsAggregatedValues?: Record<string, any>;
relations: Record<string, FindOptionsRelations<ObjectLiteral>>; relations: Record<string, FindOptionsRelations<ObjectLiteral>>;
aggregate?: Record<string, AggregationField>; aggregate?: Record<string, AggregationField>;

View File

@ -199,6 +199,7 @@ export class GraphqlQueryCreateManyResolverService extends GraphqlQueryBaseResol
fullPath: string; fullPath: string;
column: string; column: string;
}[], }[],
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Record<string, any> { ): Record<string, any> {
const whereConditions = {}; const whereConditions = {};

View File

@ -14,6 +14,7 @@ export const computeWhereConditionParts = (
operator: string, operator: string,
objectNameSingular: string, objectNameSingular: string,
key: string, key: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any, value: any,
): WhereConditionParts => { ): WhereConditionParts => {
const uuid = Math.random().toString(36).slice(2, 7); const uuid = Math.random().toString(36).slice(2, 7);

View File

@ -10,6 +10,7 @@ import {
} from 'src/engine/api/graphql/graphql-query-runner/errors/graphql-query-runner.exception'; } from 'src/engine/api/graphql/graphql-query-runner/errors/graphql-query-runner.exception';
export interface CursorData { export interface CursorData {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any; [key: string]: any;
} }
@ -28,6 +29,7 @@ export const encodeCursor = <T extends ObjectRecord = ObjectRecord>(
objectRecord: T, objectRecord: T,
order: ObjectRecordOrderBy | undefined, order: ObjectRecordOrderBy | undefined,
): string => { ): string => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const orderByValues: Record<string, any> = {}; const orderByValues: Record<string, any> = {};
const orderBy = order?.reduce((acc, orderBy) => ({ ...acc, ...orderBy }), {}); const orderBy = order?.reduce((acc, orderBy) => ({ ...acc, ...orderBy }), {});
@ -47,7 +49,10 @@ export const encodeCursor = <T extends ObjectRecord = ObjectRecord>(
}; };
export const getCursor = ( export const getCursor = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
args: FindManyResolverArgs<any, any>, args: FindManyResolverArgs<any, any>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Record<string, any> | undefined => { ): Record<string, any> | undefined => {
if (args.after) return decodeCursor(args.after); if (args.after) return decodeCursor(args.after);
if (args.before) return decodeCursor(args.before); if (args.before) return decodeCursor(args.before);
@ -56,6 +61,7 @@ export const getCursor = (
}; };
export const getPaginationInfo = ( export const getPaginationInfo = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
objectRecords: any[], objectRecords: any[],
limit: number, limit: number,
isForwardPagination: boolean, isForwardPagination: boolean,

View File

@ -1,5 +1,6 @@
export interface ObjectRecord { export interface ObjectRecord {
id: string; id: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any; [key: string]: any;
createdAt: string; createdAt: string;
updatedAt: string; updatedAt: string;
@ -7,6 +8,7 @@ export interface ObjectRecord {
} }
export type ObjectRecordFilter = { export type ObjectRecordFilter = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[Property in keyof ObjectRecord]: any; [Property in keyof ObjectRecord]: any;
}; };

View File

@ -74,6 +74,7 @@ const parseValueNode = (
export const getFieldArgumentsByKey = ( export const getFieldArgumentsByKey = (
info: GraphQLResolveInfo, info: GraphQLResolveInfo,
fieldKey: string, fieldKey: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Record<string, any> => { ): Record<string, any> => {
// Start from the first top-level field node and search recursively // Start from the first top-level field node and search recursively
const targetField = findFieldNode(info.fieldNodes[0].selectionSet, fieldKey); const targetField = findFieldNode(info.fieldNodes[0].selectionSet, fieldKey);
@ -84,6 +85,7 @@ export const getFieldArgumentsByKey = (
} }
// Extract the arguments from the field we've found // Extract the arguments from the field we've found
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const args: Record<string, any> = {}; const args: Record<string, any> = {};
if (targetField.arguments && targetField.arguments.length) { if (targetField.arguments && targetField.arguments.length) {

View File

@ -1,3 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const stringifyWithoutKeyQuote = (obj: any) => { export const stringifyWithoutKeyQuote = (obj: any) => {
const jsonString = JSON.stringify(obj); const jsonString = JSON.stringify(obj);
const jsonWithoutQuotes = jsonString?.replace(/"(\w+)"\s*:/g, '$1:'); const jsonWithoutQuotes = jsonString?.replace(/"(\w+)"\s*:/g, '$1:');

View File

@ -5,6 +5,7 @@ import { FileService } from 'src/engine/core-modules/file/services/file.service'
import { NoteWorkspaceEntity } from 'src/modules/note/standard-objects/note.workspace-entity'; import { NoteWorkspaceEntity } from 'src/modules/note/standard-objects/note.workspace-entity';
import { TaskWorkspaceEntity } from 'src/modules/task/standard-objects/task.workspace-entity'; import { TaskWorkspaceEntity } from 'src/modules/task/standard-objects/task.workspace-entity';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type RichTextBlock = Record<string, any>; type RichTextBlock = Record<string, any>;
type RichTextBody = RichTextBlock[]; type RichTextBody = RichTextBlock[];

View File

@ -233,6 +233,7 @@ export class QueryResultGettersFactory {
objectMetadataItem: ObjectMetadataInterface, objectMetadataItem: ObjectMetadataInterface,
workspaceId: string, workspaceId: string,
objectMetadataMaps: ObjectMetadataMaps, objectMetadataMaps: ObjectMetadataMaps,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Promise<any> { ): Promise<any> {
return await this.processQueryResultField( return await this.processQueryResultField(
result, result,
@ -245,6 +246,7 @@ export class QueryResultGettersFactory {
private getHandler(objectType: string): QueryResultGetterHandlerInterface { private getHandler(objectType: string): QueryResultGetterHandlerInterface {
return ( return (
this.handlers.get(objectType) || { this.handlers.get(objectType) || {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
handle: (result: any) => result, handle: (result: any) => result,
} }
); );

View File

@ -174,8 +174,10 @@ export class QueryRunnerArgsFactory {
const workspaceId = options.authContext.workspace.id; const workspaceId = options.authContext.workspace.id;
let isFieldPositionPresent = false; let isFieldPositionPresent = false;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const createArgByArgKeyPromises: Promise<[string, any]>[] = Object.entries( const createArgByArgKeyPromises: Promise<[string, any]>[] = Object.entries(
data, data,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
).map(async ([key, value]): Promise<[string, any]> => { ).map(async ([key, value]): Promise<[string, any]> => {
const fieldMetadata = fieldMetadataMapByNameByName[key]; const fieldMetadata = fieldMetadataMapByNameByName[key];
@ -280,6 +282,7 @@ export class QueryRunnerArgsFactory {
private transformFilterValueByType( private transformFilterValueByType(
key: string, key: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any, value: any,
fieldMetadataMapByName: FieldMetadataMap, fieldMetadataMapByName: FieldMetadataMap,
) { ) {
@ -310,6 +313,7 @@ export class QueryRunnerArgsFactory {
private async overrideValueByFieldMetadata( private async overrideValueByFieldMetadata(
key: string, key: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any, value: any,
fieldMetadataMapByName: FieldMetadataMap, fieldMetadataMapByName: FieldMetadataMap,
) { ) {

View File

@ -51,6 +51,7 @@ const pgGraphQLErrorMapping: PgGraphQLErrorMapping = {
export const computePgGraphQLError = ( export const computePgGraphQLError = (
command: string, command: string,
objectName: string, objectName: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
errors: any[], errors: any[],
pgGraphqlConfig: PgGraphQLConfig, pgGraphqlConfig: PgGraphQLConfig,
) => { ) => {

View File

@ -4,8 +4,10 @@ import {
} from 'src/engine/api/graphql/workspace-query-builder/utils/composite-field-metadata.util'; } from 'src/engine/api/graphql/workspace-query-builder/utils/composite-field-metadata.util';
export const handleCompositeKey = ( export const handleCompositeKey = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
result: any, result: any,
key: string, key: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any, value: any,
): void => { ): void => {
const parsedFieldKey = parseCompositeFieldKey(key); const parsedFieldKey = parseCompositeFieldKey(key);
@ -22,6 +24,8 @@ export const handleCompositeKey = (
result[parsedFieldKey.parentFieldName][parsedFieldKey.childFieldName] = value; result[parsedFieldKey.parentFieldName][parsedFieldKey.childFieldName] = value;
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const parseResult = (obj: any): any => { export const parseResult = (obj: any): any => {
if (obj === null || typeof obj !== 'object' || typeof obj === 'function') { if (obj === null || typeof obj !== 'object' || typeof obj === 'function') {
return obj; return obj;
@ -31,6 +35,7 @@ export const parseResult = (obj: any): any => {
return obj.map((item) => parseResult(item)); return obj.map((item) => parseResult(item));
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const result: any = {}; const result: any = {};
for (const key in obj) { for (const key in obj) {

View File

@ -8,6 +8,9 @@ import {
import { workspaceResolverBuilderMethodNames } from 'src/engine/api/graphql/workspace-resolver-builder/factories/factories'; import { workspaceResolverBuilderMethodNames } from 'src/engine/api/graphql/workspace-resolver-builder/factories/factories';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type Resolver<Args = any> = GraphQLFieldResolver<any, any, Args>; export type Resolver<Args = any> = GraphQLFieldResolver<any, any, Args>;
export enum ResolverArgsType { export enum ResolverArgsType {
@ -71,6 +74,7 @@ export interface UpdateOneResolverArgs<
export interface UpdateManyResolverArgs< export interface UpdateManyResolverArgs<
Data extends Partial<ObjectRecord> = Partial<ObjectRecord>, Data extends Partial<ObjectRecord> = Partial<ObjectRecord>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Filter = any, Filter = any,
> { > {
filter: Filter; filter: Filter;
@ -81,6 +85,7 @@ export interface DeleteOneResolverArgs {
id: string; id: string;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface DeleteManyResolverArgs<Filter = any> { export interface DeleteManyResolverArgs<Filter = any> {
filter: Filter; filter: Filter;
} }
@ -89,6 +94,7 @@ export interface RestoreOneResolverArgs {
id: string; id: string;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface RestoreManyResolverArgs<Filter = any> { export interface RestoreManyResolverArgs<Filter = any> {
filter: Filter; filter: Filter;
} }
@ -97,6 +103,7 @@ export interface DestroyOneResolverArgs {
id: string; id: string;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface DestroyManyResolverArgs<Filter = any> { export interface DestroyManyResolverArgs<Filter = any> {
filter: Filter; filter: Filter;
} }

View File

@ -44,7 +44,11 @@ export class CompositeObjectTypeDefinitionFactory {
compositeType: CompositeType, compositeType: CompositeType,
kind: ObjectTypeDefinitionKind, kind: ObjectTypeDefinitionKind,
options: WorkspaceBuildSchemaOptions, options: WorkspaceBuildSchemaOptions,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): GraphQLFieldConfigMap<any, any> { ): GraphQLFieldConfigMap<any, any> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const fields: GraphQLFieldConfigMap<any, any> = {}; const fields: GraphQLFieldConfigMap<any, any> = {};
for (const property of compositeType.properties) { for (const property of compositeType.properties) {

View File

@ -46,7 +46,11 @@ export class ConnectionTypeDefinitionFactory {
private generateFields( private generateFields(
objectMetadata: ObjectMetadataInterface, objectMetadata: ObjectMetadataInterface,
options: WorkspaceBuildSchemaOptions, options: WorkspaceBuildSchemaOptions,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): GraphQLFieldConfigMap<any, any> { ): GraphQLFieldConfigMap<any, any> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const fields: GraphQLFieldConfigMap<any, any> = {}; const fields: GraphQLFieldConfigMap<any, any> = {};
const aggregatedFields = this.aggregationTypeFactory.create(objectMetadata); const aggregatedFields = this.aggregationTypeFactory.create(objectMetadata);

View File

@ -42,7 +42,11 @@ export class EdgeTypeDefinitionFactory {
private generateFields( private generateFields(
objectMetadata: ObjectMetadataInterface, objectMetadata: ObjectMetadataInterface,
options: WorkspaceBuildSchemaOptions, options: WorkspaceBuildSchemaOptions,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): GraphQLFieldConfigMap<any, any> { ): GraphQLFieldConfigMap<any, any> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const fields: GraphQLFieldConfigMap<any, any> = {}; const fields: GraphQLFieldConfigMap<any, any> = {};
fields.node = { fields.node = {

View File

@ -103,7 +103,11 @@ export class ExtendObjectTypeDefinitionV2Factory {
private generateFields( private generateFields(
objectMetadata: ObjectMetadataInterface, objectMetadata: ObjectMetadataInterface,
options: WorkspaceBuildSchemaOptions, options: WorkspaceBuildSchemaOptions,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): GraphQLFieldConfigMap<any, any> { ): GraphQLFieldConfigMap<any, any> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const fields: GraphQLFieldConfigMap<any, any> = {}; const fields: GraphQLFieldConfigMap<any, any> = {};
for (const fieldMetadata of objectMetadata.fields) { for (const fieldMetadata of objectMetadata.fields) {

View File

@ -104,7 +104,11 @@ export class ExtendObjectTypeDefinitionFactory {
private generateFields( private generateFields(
objectMetadata: ObjectMetadataInterface, objectMetadata: ObjectMetadataInterface,
options: WorkspaceBuildSchemaOptions, options: WorkspaceBuildSchemaOptions,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): GraphQLFieldConfigMap<any, any> { ): GraphQLFieldConfigMap<any, any> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const fields: GraphQLFieldConfigMap<any, any> = {}; const fields: GraphQLFieldConfigMap<any, any> = {};
for (const fieldMetadata of objectMetadata.fields) { for (const fieldMetadata of objectMetadata.fields) {

View File

@ -63,6 +63,8 @@ export class RootTypeFactory {
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private generateFields<T = any, U = any>( private generateFields<T = any, U = any>(
objectMetadataCollection: ObjectMetadataInterface[], objectMetadataCollection: ObjectMetadataInterface[],
workspaceResolverMethodNames: WorkspaceResolverBuilderMethodNames[], workspaceResolverMethodNames: WorkspaceResolverBuilderMethodNames[],

View File

@ -10,6 +10,7 @@ const isValidStringPosition = (value: string): boolean =>
const isValidNumberPosition = (value: number): boolean => const isValidNumberPosition = (value: number): boolean =>
typeof value === 'number'; typeof value === 'number';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const checkPosition = (value: any): PositionType => { const checkPosition = (value: any): PositionType => {
if (isValidNumberPosition(value) || isValidStringPosition(value)) { if (isValidNumberPosition(value) || isValidStringPosition(value)) {
return value; return value;

View File

@ -8,6 +8,7 @@ import { ValidationError } from 'src/engine/core-modules/graphql/utils/graphql-e
const parseLiteral = ( const parseLiteral = (
ast: ValueNode, ast: ValueNode,
variables?: Maybe<ObjMap<unknown>>, variables?: Maybe<ObjMap<unknown>>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): any => { ): any => {
switch (ast.kind) { switch (ast.kind) {
case Kind.STRING: case Kind.STRING:
@ -17,8 +18,10 @@ const parseLiteral = (
case Kind.FLOAT: case Kind.FLOAT:
return parseFloat(ast.value); return parseFloat(ast.value);
case Kind.OBJECT: case Kind.OBJECT:
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return parseObject(ast as any, variables); return parseObject(ast as any, variables);
case Kind.LIST: case Kind.LIST:
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (ast as any).values.map((n: ValueNode) => return (ast as any).values.map((n: ValueNode) =>
parseLiteral(n, variables), parseLiteral(n, variables),
); );
@ -40,6 +43,7 @@ const parseObject = (
const value = Object.create(null); const value = Object.create(null);
if ('fields' in ast) { if ('fields' in ast) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ast.fields?.forEach((field: any) => { ast.fields?.forEach((field: any) => {
value[field.name.value] = parseLiteral(field.value, variables); value[field.name.value] = parseLiteral(field.value, variables);
}); });
@ -48,6 +52,7 @@ const parseObject = (
return value; return value;
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const stringify = (value: any): string => { const stringify = (value: any): string => {
return JSON.stringify(value); return JSON.stringify(value);
}; };

View File

@ -3,6 +3,7 @@ import { validate as uuidValidate } from 'uuid';
import { ValidationError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util'; import { ValidationError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const checkUUID = (value: any): string => { const checkUUID = (value: any): string => {
if (typeof value !== 'string') { if (typeof value !== 'string') {
throw new ValidationError('UUID must be a string'); throw new ValidationError('UUID must be a string');

View File

@ -2,6 +2,7 @@ import { GraphQLScalarType } from 'graphql';
import { InputTypeDefinitionKind } from 'src/engine/api/graphql/workspace-schema-builder/factories/input-type-definition.factory'; import { InputTypeDefinitionKind } from 'src/engine/api/graphql/workspace-schema-builder/factories/input-type-definition.factory';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface ArgMetadata<T = any> { export interface ArgMetadata<T = any> {
kind?: InputTypeDefinitionKind; kind?: InputTypeDefinitionKind;
type?: GraphQLScalarType; type?: GraphQLScalarType;

View File

@ -40,6 +40,7 @@ import { RawJSONScalar } from 'src/engine/api/graphql/workspace-schema-builder/g
import { getNumberFilterType } from 'src/engine/api/graphql/workspace-schema-builder/utils/get-number-filter-type.util'; import { getNumberFilterType } from 'src/engine/api/graphql/workspace-schema-builder/utils/get-number-filter-type.util';
import { getNumberScalarType } from 'src/engine/api/graphql/workspace-schema-builder/utils/get-number-scalar-type.util'; import { getNumberScalarType } from 'src/engine/api/graphql/workspace-schema-builder/utils/get-number-scalar-type.util';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface TypeOptions<T = any> { export interface TypeOptions<T = any> {
nullable?: boolean; nullable?: boolean;
isArray?: boolean; isArray?: boolean;

View File

@ -24,8 +24,10 @@ type TypeFactory<T extends InputTypeDefinitionKind | ObjectTypeDefinitionKind> =
options: WorkspaceBuildSchemaOptions, options: WorkspaceBuildSchemaOptions,
additionalOptions: { additionalOptions: {
nullable?: boolean; nullable?: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
defaultValue?: any; defaultValue?: any;
isArray: boolean; isArray: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
settings: any; settings: any;
isIdField: boolean; isIdField: boolean;
}, },
@ -43,7 +45,9 @@ export const generateFields = <
typeFactory: TypeFactory<T>, typeFactory: TypeFactory<T>,
): T extends InputTypeDefinitionKind ): T extends InputTypeDefinitionKind
? GraphQLInputFieldConfigMap ? GraphQLInputFieldConfigMap
: GraphQLFieldConfigMap<any, any> => { : // eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
GraphQLFieldConfigMap<any, any> => {
const fields = {}; const fields = {};
for (const fieldMetadata of objectMetadata.fields) { for (const fieldMetadata of objectMetadata.fields) {

View File

@ -21,6 +21,7 @@ export class RestApiCreateManyHandler extends RestApiBaseHandler {
throw new BadRequestException('Input must not be empty'); throw new BadRequestException('Input must not be empty');
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const overriddenRecordsToCreate: Record<string, any>[] = []; const overriddenRecordsToCreate: Record<string, any>[] = [];
for (const recordToCreate of body) { for (const recordToCreate of body) {

View File

@ -121,6 +121,7 @@ export class RestApiFindDuplicatesHandler extends RestApiBaseHandler {
startCursor, startCursor,
endCursor, endCursor,
}: { }: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
finalRecords: any[]; finalRecords: any[];
objectMetadataNameSingular: string; objectMetadataNameSingular: string;
isForwardPagination: boolean; isForwardPagination: boolean;

View File

@ -50,6 +50,7 @@ export class RestApiFindManyHandler extends RestApiBaseHandler {
startCursor, startCursor,
endCursor, endCursor,
}: { }: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
finalRecords: any[]; finalRecords: any[];
objectMetadataNamePlural: string; objectMetadataNamePlural: string;
isForwardPagination: boolean; isForwardPagination: boolean;

View File

@ -1,11 +1,14 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const cleanGraphQLResponse = (input: any) => { export const cleanGraphQLResponse = (input: any) => {
if (!input) return null; if (!input) return null;
const output = { data: {} }; // Initialize the output with a data key at the top level const output = { data: {} }; // Initialize the output with a data key at the top level
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const isObject = (obj: any) => { const isObject = (obj: any) => {
return obj !== null && typeof obj === 'object' && !Array.isArray(obj); return obj !== null && typeof obj === 'object' && !Array.isArray(obj);
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const cleanObject = (obj: any) => { const cleanObject = (obj: any) => {
const cleanedObj = {}; const cleanedObj = {};

View File

@ -33,6 +33,7 @@ const computeOperator = (
const validateAndGetOrderBy = ( const validateAndGetOrderBy = (
key: string, key: string,
orderBy: ObjectRecordOrderBy, orderBy: ObjectRecordOrderBy,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Record<string, any> => { ): Record<string, any> => {
const keyOrderBy = orderBy.find((order) => key in order); const keyOrderBy = orderBy.find((order) => key in order);
@ -51,6 +52,7 @@ const isAscendingOrder = (direction: OrderByDirection): boolean =>
direction === OrderByDirection.AscNullsLast; direction === OrderByDirection.AscNullsLast;
export const computeCursorArgFilter = ( export const computeCursorArgFilter = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
cursor: Record<string, any>, cursor: Record<string, any>,
orderBy: ObjectRecordOrderBy, orderBy: ObjectRecordOrderBy,
fieldMetadataMapByName: FieldMetadataMap, fieldMetadataMapByName: FieldMetadataMap,
@ -99,11 +101,13 @@ export const computeCursorArgFilter = (
const buildWhereCondition = ( const buildWhereCondition = (
key: string, key: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any, value: any,
fieldMetadataMapByName: FieldMetadataMap, fieldMetadataMapByName: FieldMetadataMap,
orderBy: ObjectRecordOrderBy, orderBy: ObjectRecordOrderBy,
isForwardPagination: boolean, isForwardPagination: boolean,
operator?: string, operator?: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Record<string, any> => { ): Record<string, any> => {
const fieldMetadata = fieldMetadataMapByName[key]; const fieldMetadata = fieldMetadataMapByName[key];
@ -138,11 +142,13 @@ const buildWhereCondition = (
const buildCompositeWhereCondition = ( const buildCompositeWhereCondition = (
key: string, key: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any, value: any,
fieldType: FieldMetadataType, fieldType: FieldMetadataType,
orderBy: ObjectRecordOrderBy, orderBy: ObjectRecordOrderBy,
isForwardPagination: boolean, isForwardPagination: boolean,
operator?: string, operator?: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Record<string, any> => { ): Record<string, any> => {
const compositeType = compositeTypeDefinitions.get(fieldType); const compositeType = compositeTypeDefinitions.get(fieldType);
@ -154,6 +160,7 @@ const buildCompositeWhereCondition = (
} }
const keyOrderBy = validateAndGetOrderBy(key, orderBy); const keyOrderBy = validateAndGetOrderBy(key, orderBy);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const result: Record<string, any> = {}; const result: Record<string, any> = {};
compositeType.properties.forEach((property) => { compositeType.properties.forEach((property) => {

View File

@ -46,6 +46,7 @@ export class AdminPanelHealthService {
: AdminPanelHealthServiceStatus.OUTAGE; : AdminPanelHealthServiceStatus.OUTAGE;
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private transformServiceDetails(details: any) { private transformServiceDetails(details: any) {
if (!details) return details; if (!details) return details;

View File

@ -9,10 +9,13 @@ import { CreateAppTokenInput } from 'src/engine/core-modules/app-token/dtos/crea
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard'; import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
export const appTokenAutoResolverOpts: AutoResolverOpts< export const appTokenAutoResolverOpts: AutoResolverOpts<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
any, any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
any, any,
unknown, unknown,
unknown, unknown,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ReadResolverOpts<any>, ReadResolverOpts<any>,
PagingStrategies PagingStrategies
>[] = [ >[] = [

View File

@ -11,6 +11,7 @@ export class BeforeCreateOneAppToken<T extends AppToken>
{ {
async run( async run(
instance: CreateOneInputType<T>, instance: CreateOneInputType<T>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
context: any, context: any,
): Promise<CreateOneInputType<T>> { ): Promise<CreateOneInputType<T>> {
const userId = context?.req?.user?.id; const userId = context?.req?.user?.id;

View File

@ -25,5 +25,6 @@ export class CreateObjectEventInput {
@Field(() => GraphQLJSON, { nullable: true }) @Field(() => GraphQLJSON, { nullable: true })
@IsObject() @IsObject()
@IsOptional() @IsOptional()
// eslint-disable-next-line @typescript-eslint/no-explicit-any
properties?: Record<string, any>; properties?: Record<string, any>;
} }

View File

@ -11,6 +11,7 @@ export const genericTrackSchema = baseEventSchema.extend({
export type GenericTrackEvent<E extends string = string> = { export type GenericTrackEvent<E extends string = string> = {
type: 'track'; type: 'track';
event: E; event: E;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
properties: any; properties: any;
timestamp: string; timestamp: string;
version: string; version: string;
@ -18,8 +19,10 @@ export type GenericTrackEvent<E extends string = string> = {
workspaceId?: string; workspaceId?: string;
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const eventsRegistry = new Map<string, z.ZodSchema<any>>(); export const eventsRegistry = new Map<string, z.ZodSchema<any>>();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function registerEvent<E extends string, S extends z.ZodObject<any>>( export function registerEvent<E extends string, S extends z.ZodObject<any>>(
event: E, event: E,
schema: S, schema: S,

View File

@ -57,6 +57,7 @@ export class SSOAuthController {
@Get('saml/metadata/:identityProviderId') @Get('saml/metadata/:identityProviderId')
@UseGuards(EnterpriseFeaturesEnabledGuard) @UseGuards(EnterpriseFeaturesEnabledGuard)
@UseFilters(AuthRestApiExceptionFilter) @UseFilters(AuthRestApiExceptionFilter)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async generateMetadata(@Req() req: any): Promise<string | void> { async generateMetadata(@Req() req: any): Promise<string | void> {
return generateServiceProviderMetadata({ return generateServiceProviderMetadata({
wantAssertionsSigned: false, wantAssertionsSigned: false,

View File

@ -26,6 +26,7 @@ export class OIDCAuthGuard extends AuthGuard('openidconnect') {
super(); super();
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private getStateByRequest(request: any): { private getStateByRequest(request: any): {
identityProviderId: string; identityProviderId: string;
} { } {

View File

@ -20,6 +20,7 @@ export class GoogleAPIsOauthExchangeCodeForTokenStrategy extends GoogleAPIsOauth
request: GoogleAPIsRequest, request: GoogleAPIsRequest,
accessToken: string, accessToken: string,
refreshToken: string, refreshToken: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
profile: any, profile: any,
done: VerifyCallback, done: VerifyCallback,
): Promise<void> { ): Promise<void> {

View File

@ -14,6 +14,8 @@ export class GoogleAPIsOauthRequestCodeStrategy extends GoogleAPIsOauthCommonStr
super(twentyConfigService); super(twentyConfigService);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
authenticate(req: any, options: any) { authenticate(req: any, options: any) {
options = { options = {
...options, ...options,

View File

@ -36,6 +36,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
authenticate(req: Request, options: any) { authenticate(req: Request, options: any) {
options = { options = {
...options, ...options,
@ -54,6 +55,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
request: GoogleRequest, request: GoogleRequest,
accessToken: string, accessToken: string,
refreshToken: string, refreshToken: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
profile: any, profile: any,
done: VerifyCallback, done: VerifyCallback,
): Promise<void> { ): Promise<void> {

View File

@ -20,6 +20,7 @@ export class MicrosoftAPIsOauthExchangeCodeForTokenStrategy extends MicrosoftAPI
request: MicrosoftAPIsRequest, request: MicrosoftAPIsRequest,
accessToken: string, accessToken: string,
refreshToken: string, refreshToken: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
profile: any, profile: any,
done: VerifyCallback, done: VerifyCallback,
): Promise<void> { ): Promise<void> {

View File

@ -9,6 +9,8 @@ export class MicrosoftAPIsOauthRequestCodeStrategy extends MicrosoftAPIsOauthCom
super(twentyConfigService); super(twentyConfigService);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
authenticate(req: any, options: any) { authenticate(req: any, options: any) {
options = { options = {
...options, ...options,

View File

@ -40,6 +40,7 @@ export class MicrosoftStrategy extends PassportStrategy(Strategy, 'microsoft') {
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
authenticate(req: Request, options: any) { authenticate(req: Request, options: any) {
options = { options = {
...options, ...options,
@ -59,6 +60,7 @@ export class MicrosoftStrategy extends PassportStrategy(Strategy, 'microsoft') {
request: MicrosoftRequest, request: MicrosoftRequest,
accessToken: string, accessToken: string,
refreshToken: string, refreshToken: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
profile: any, profile: any,
done: VerifyCallback, done: VerifyCallback,
): Promise<void> { ): Promise<void> {

View File

@ -45,6 +45,7 @@ export class OIDCAuthStrategy extends PassportStrategy(
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async authenticate(req: Request, options: any) { async authenticate(req: Request, options: any) {
return super.authenticate(req, { return super.authenticate(req, {
...options, ...options,
@ -84,6 +85,7 @@ export class OIDCAuthStrategy extends PassportStrategy(
async validate( async validate(
req: Request, req: Request,
tokenset: TokenSet, tokenset: TokenSet,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
done: (err: any, user?: OIDCRequest['user']) => void, done: (err: any, user?: OIDCRequest['user']) => void,
) { ) {
try { try {

View File

@ -34,7 +34,9 @@ export class CacheStorageModule implements OnModuleDestroy {
constructor(@Inject(CACHE_MANAGER) private cacheManager: Cache) {} constructor(@Inject(CACHE_MANAGER) private cacheManager: Cache) {}
async onModuleDestroy() { async onModuleDestroy() {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((this.cacheManager.store as any)?.name === 'redis') { if ((this.cacheManager.store as any)?.name === 'redis') {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await (this.cacheManager.store as any).client.quit(); await (this.cacheManager.store as any).client.quit();
} }
} }

View File

@ -22,6 +22,7 @@ export class FlushCacheCommand extends CommandRunner {
async run( async run(
passedParams: string[], passedParams: string[],
// eslint-disable-next-line @typescript-eslint/no-explicit-any
options?: Record<string, any>, options?: Record<string, any>,
): Promise<void> { ): Promise<void> {
const pattern = options?.pattern || '*'; const pattern = options?.pattern || '*';

View File

@ -123,6 +123,7 @@ export class CacheStorageService {
} }
private isRedisCache() { private isRedisCache() {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (this.cache.store as any)?.name === 'redis'; return (this.cache.store as any)?.name === 'redis';
} }

View File

@ -14,6 +14,7 @@ export class CaptchaModule {
static forRoot(options: CaptchaModuleAsyncOptions): DynamicModule { static forRoot(options: CaptchaModuleAsyncOptions): DynamicModule {
const provider = { const provider = {
provide: CAPTCHA_DRIVER, provide: CAPTCHA_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
useFactory: async (...args: any[]) => { useFactory: async (...args: any[]) => {
const config = await options.useFactory(...args); const config = await options.useFactory(...args);

View File

@ -31,6 +31,7 @@ export type CaptchaModuleOptions =
export type CaptchaModuleAsyncOptions = { export type CaptchaModuleAsyncOptions = {
useFactory: ( useFactory: (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...args: any[] ...args: any[]
) => CaptchaModuleOptions | Promise<CaptchaModuleOptions> | undefined; ) => CaptchaModuleOptions | Promise<CaptchaModuleOptions> | undefined;
} & Pick<ModuleMetadata, 'imports'> & } & Pick<ModuleMetadata, 'imports'> &

View File

@ -2,12 +2,14 @@ import * as Sentry from '@sentry/node';
export function SentryCronMonitor(monitorSlug: string, schedule: string) { export function SentryCronMonitor(monitorSlug: string, schedule: string) {
return function ( return function (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
target: any, target: any,
propertyKey: string, propertyKey: string,
descriptor: PropertyDescriptor, descriptor: PropertyDescriptor,
) { ) {
const originalMethod = descriptor.value; const originalMethod = descriptor.value;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
descriptor.value = async function (...args: any[]) { descriptor.value = async function (...args: any[]) {
if (!Sentry.isInitialized()) { if (!Sentry.isInitialized()) {
return await originalMethod.apply(this, args); return await originalMethod.apply(this, args);

View File

@ -16,6 +16,7 @@ export class EmailModule {
static forRoot(options: EmailModuleAsyncOptions): DynamicModule { static forRoot(options: EmailModuleAsyncOptions): DynamicModule {
const provider = { const provider = {
provide: EMAIL_DRIVER, provide: EMAIL_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
useFactory: (...args: any[]) => { useFactory: (...args: any[]) => {
const config = options.useFactory(...args); const config = options.useFactory(...args);

View File

@ -16,6 +16,7 @@ export type EmailModuleOptions =
}; };
export type EmailModuleAsyncOptions = { export type EmailModuleAsyncOptions = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
useFactory: (...args: any[]) => EmailModuleOptions; useFactory: (...args: any[]) => EmailModuleOptions;
} & Pick<ModuleMetadata, 'imports'> & } & Pick<ModuleMetadata, 'imports'> &
Pick<FactoryProvider, 'inject'>; Pick<FactoryProvider, 'inject'>;

View File

@ -29,6 +29,8 @@ export const objectRecordChangedValues = (
return acc; return acc;
}, },
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
{} as Record<string, { before: any; after: any }>, {} as Record<string, { before: any; after: any }>,
); );
}; };

View File

@ -1,7 +1,11 @@
export function objectRecordDiffMerge( export function objectRecordDiffMerge(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
oldRecord: Record<string, any>, oldRecord: Record<string, any>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
newRecord: Record<string, any>, newRecord: Record<string, any>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Record<string, any> { ): Record<string, any> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const result: Record<string, any> = { diff: {} }; const result: Record<string, any> = { diff: {} };
// Iterate over the keys in the oldRecord diff // Iterate over the keys in the oldRecord diff

View File

@ -7,6 +7,7 @@ export class ExceptionHandlerConsoleDriver
implements ExceptionHandlerDriverInterface implements ExceptionHandlerDriverInterface
{ {
captureExceptions( captureExceptions(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
exceptions: ReadonlyArray<any>, exceptions: ReadonlyArray<any>,
options?: ExceptionHandlerOptions, options?: ExceptionHandlerOptions,
) { ) {

View File

@ -9,6 +9,7 @@ export class ExceptionHandlerSentryDriver
implements ExceptionHandlerDriverInterface implements ExceptionHandlerDriverInterface
{ {
captureExceptions( captureExceptions(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
exceptions: ReadonlyArray<any>, exceptions: ReadonlyArray<any>,
options?: ExceptionHandlerOptions, options?: ExceptionHandlerOptions,
) { ) {

View File

@ -37,6 +37,7 @@ export class ExceptionHandlerModule extends ConfigurableModuleClass {
static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule { static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule {
const provider = { const provider = {
provide: EXCEPTION_HANDLER_DRIVER, provide: EXCEPTION_HANDLER_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
useFactory: async (...args: any[]) => { useFactory: async (...args: any[]) => {
const config = await options?.useFactory?.(...args); const config = await options?.useFactory?.(...args);

View File

@ -13,6 +13,7 @@ export class ExceptionHandlerService {
) {} ) {}
captureExceptions( captureExceptions(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
exceptions: ReadonlyArray<any>, exceptions: ReadonlyArray<any>,
options?: ExceptionHandlerOptions, options?: ExceptionHandlerOptions,
): string[] { ): string[] {

View File

@ -22,6 +22,7 @@ export const handleException = (
interface RequestAndParams { interface RequestAndParams {
request: Request | null; request: Request | null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
params: any; params: any;
} }
@ -35,10 +36,14 @@ export class HttpExceptionHandlerService {
handleError = ( handleError = (
exception: CustomException, exception: CustomException,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
response: Response<any, Record<string, any>>, response: Response<any, Record<string, any>>,
errorCode?: number, errorCode?: number,
user?: ExceptionHandlerUser, user?: ExceptionHandlerUser,
workspace?: ExceptionHandlerWorkspace, workspace?: ExceptionHandlerWorkspace,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Response<any, Record<string, any>> | undefined => { ): Response<any, Record<string, any>> | undefined => {
const params = this.request?.params; const params = this.request?.params;

View File

@ -2,6 +2,7 @@ import { ExceptionHandlerOptions } from 'src/engine/core-modules/exception-handl
export interface ExceptionHandlerDriverInterface { export interface ExceptionHandlerDriverInterface {
captureExceptions( captureExceptions(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
exceptions: ReadonlyArray<any>, exceptions: ReadonlyArray<any>,
options?: ExceptionHandlerOptions, options?: ExceptionHandlerOptions,
): string[]; ): string[];

View File

@ -9,6 +9,7 @@ export interface ExceptionHandlerOptions {
name: string; name: string;
}; };
document?: string; document?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
additionalData?: Record<string, any>; additionalData?: Record<string, any>;
user?: ExceptionHandlerUser | null; user?: ExceptionHandlerUser | null;
workspace?: ExceptionHandlerWorkspace | null; workspace?: ExceptionHandlerWorkspace | null;

View File

@ -9,6 +9,7 @@ export class ExceptionHandlerMockService
implements ExceptionHandlerDriverInterface implements ExceptionHandlerDriverInterface
{ {
captureExceptions( captureExceptions(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
exceptions: readonly any[], exceptions: readonly any[],
_?: ExceptionHandlerOptions | undefined, _?: ExceptionHandlerOptions | undefined,
): string[] { ): string[] {

View File

@ -6,6 +6,7 @@ export class MockedUnhandledExceptionFilter
extends BaseExceptionFilter extends BaseExceptionFilter
implements ExceptionFilter implements ExceptionFilter
{ {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
catch(exception: any, _host: ArgumentsHost) { catch(exception: any, _host: ArgumentsHost) {
throw exception; throw exception;
} }

View File

@ -30,6 +30,7 @@ export class FileStorageModule {
static forRootAsync(options: FileStorageModuleAsyncOptions): DynamicModule { static forRootAsync(options: FileStorageModuleAsyncOptions): DynamicModule {
const provider = { const provider = {
provide: STORAGE_DRIVER, provide: STORAGE_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
useFactory: async (...args: any[]) => { useFactory: async (...args: any[]) => {
const config = await options.useFactory(...args); const config = await options.useFactory(...args);

View File

@ -24,6 +24,7 @@ export type FileStorageModuleOptions =
export type FileStorageModuleAsyncOptions = { export type FileStorageModuleAsyncOptions = {
useFactory: ( useFactory: (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...args: any[] ...args: any[]
) => FileStorageModuleOptions | Promise<FileStorageModuleOptions>; ) => FileStorageModuleOptions | Promise<FileStorageModuleOptions>;
} & Pick<ModuleMetadata, 'imports'> & } & Pick<ModuleMetadata, 'imports'> &

View File

@ -42,6 +42,7 @@ export class FileController {
const folderPath = checkFilePath(params[0]); const folderPath = checkFilePath(params[0]);
const filename = checkFilename(params['filename']); const filename = checkFilename(params['filename']);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const workspaceId = (req as any)?.workspaceId; const workspaceId = (req as any)?.workspaceId;
if (!workspaceId) { if (!workspaceId) {

View File

@ -27,6 +27,7 @@ export class FileService {
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
encodeFileToken(payloadToEncode: Record<string, any>) { encodeFileToken(payloadToEncode: Record<string, any>) {
const fileTokenExpiresIn = this.twentyConfigService.get( const fileTokenExpiresIn = this.twentyConfigService.get(
'FILE_TOKEN_EXPIRES_IN', 'FILE_TOKEN_EXPIRES_IN',

View File

@ -31,6 +31,7 @@ export enum ErrorCode {
} }
export class BaseGraphQLError extends GraphQLError { export class BaseGraphQLError extends GraphQLError {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public extensions: Record<string, any>; public extensions: Record<string, any>;
override readonly name!: string; override readonly name!: string;
readonly locations: ReadonlyArray<SourceLocation> | undefined; readonly locations: ReadonlyArray<SourceLocation> | undefined;
@ -40,11 +41,13 @@ export class BaseGraphQLError extends GraphQLError {
readonly nodes: ReadonlyArray<ASTNode> | undefined; readonly nodes: ReadonlyArray<ASTNode> | undefined;
public originalError: Error | undefined; public originalError: Error | undefined;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any; [key: string]: any;
constructor( constructor(
message: string, message: string,
code?: string, code?: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
extensions?: Record<string, any>, extensions?: Record<string, any>,
) { ) {
super(message); super(message);
@ -106,6 +109,7 @@ export class ValidationError extends BaseGraphQLError {
} }
export class AuthenticationError extends BaseGraphQLError { export class AuthenticationError extends BaseGraphQLError {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor(message: string, extensions?: Record<string, any>) { constructor(message: string, extensions?: Record<string, any>) {
super(message, ErrorCode.UNAUTHENTICATED, extensions); super(message, ErrorCode.UNAUTHENTICATED, extensions);
@ -114,6 +118,7 @@ export class AuthenticationError extends BaseGraphQLError {
} }
export class ForbiddenError extends BaseGraphQLError { export class ForbiddenError extends BaseGraphQLError {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor(message: string, extensions?: Record<string, any>) { constructor(message: string, extensions?: Record<string, any>) {
super(message, ErrorCode.FORBIDDEN, extensions); super(message, ErrorCode.FORBIDDEN, extensions);

View File

@ -1,9 +1,11 @@
export class HealthStateManager { export class HealthStateManager {
private lastKnownState: { private lastKnownState: {
timestamp: Date; timestamp: Date;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
details: Record<string, any>; details: Record<string, any>;
} | null = null; } | null = null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
updateState(details: Record<string, any>) { updateState(details: Record<string, any>) {
this.lastKnownState = { this.lastKnownState = {
timestamp: new Date(), timestamp: new Date(),

View File

@ -38,6 +38,7 @@ import { messages as zhHantMessages } from 'src/engine/core-modules/i18n/locales
@Injectable() @Injectable()
export class I18nService implements OnModuleInit { export class I18nService implements OnModuleInit {
async loadTranslations() { async loadTranslations() {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const messages: Record<keyof typeof APP_LOCALES, any> = { const messages: Record<keyof typeof APP_LOCALES, any> = {
en: enMessages, en: enMessages,
'pseudo-en': pseudoEnMessages, 'pseudo-en': pseudoEnMessages,
@ -72,6 +73,7 @@ export class I18nService implements OnModuleInit {
'zh-TW': zhHantMessages, 'zh-TW': zhHantMessages,
}; };
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(Object.entries(messages) as [keyof typeof APP_LOCALES, any][]).forEach( (Object.entries(messages) as [keyof typeof APP_LOCALES, any][]).forEach(
([locale, message]) => { ([locale, message]) => {
i18n.load(locale, message); i18n.load(locale, message);

View File

@ -39,10 +39,12 @@ export class JwtWrapperService {
return this.jwtService.sign(payload, options); return this.jwtService.sign(payload, options);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
verify<T extends object = any>(token: string, options?: JwtVerifyOptions): T { verify<T extends object = any>(token: string, options?: JwtVerifyOptions): T {
return this.jwtService.verify(token, options); return this.jwtService.verify(token, options);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
decode<T = any>(payload: string, options?: jwt.DecodeOptions): T { decode<T = any>(payload: string, options?: jwt.DecodeOptions): T {
return this.jwtService.decode(payload, options); return this.jwtService.decode(payload, options);
} }

View File

@ -8,6 +8,8 @@ import {
} from 'src/engine/core-modules/key-value-pair/key-value-pair.entity'; } from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
export class KeyValuePairService< export class KeyValuePairService<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
KeyValueTypesMap extends Record<string, any> = Record<string, any>, KeyValueTypesMap extends Record<string, any> = Record<string, any>,
> { > {
constructor( constructor(

View File

@ -9,6 +9,7 @@ export interface LLMChatModelModuleOptions {
} }
export type LLMChatModelModuleAsyncOptions = { export type LLMChatModelModuleAsyncOptions = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
useFactory: (...args: any[]) => LLMChatModelModuleOptions | undefined; useFactory: (...args: any[]) => LLMChatModelModuleOptions | undefined;
} & Pick<ModuleMetadata, 'imports'> & } & Pick<ModuleMetadata, 'imports'> &
Pick<FactoryProvider, 'inject'>; Pick<FactoryProvider, 'inject'>;

View File

@ -14,6 +14,7 @@ export class LLMChatModelModule {
static forRoot(options: LLMChatModelModuleAsyncOptions): DynamicModule { static forRoot(options: LLMChatModelModuleAsyncOptions): DynamicModule {
const provider = { const provider = {
provide: LLM_CHAT_MODEL_DRIVER, provide: LLM_CHAT_MODEL_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
useFactory: (...args: any[]) => { useFactory: (...args: any[]) => {
const config = options.useFactory(...args); const config = options.useFactory(...args);

View File

@ -21,6 +21,7 @@ export type LLMTracingModuleOptions =
| ConsoleDriverFactoryOptions; | ConsoleDriverFactoryOptions;
export type LLMTracingModuleAsyncOptions = { export type LLMTracingModuleAsyncOptions = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
useFactory: (...args: any[]) => LLMTracingModuleOptions; useFactory: (...args: any[]) => LLMTracingModuleOptions;
} & Pick<ModuleMetadata, 'imports'> & } & Pick<ModuleMetadata, 'imports'> &
Pick<FactoryProvider, 'inject'>; Pick<FactoryProvider, 'inject'>;

View File

@ -15,6 +15,7 @@ export class LLMTracingModule {
static forRoot(options: LLMTracingModuleAsyncOptions): DynamicModule { static forRoot(options: LLMTracingModuleAsyncOptions): DynamicModule {
const provider = { const provider = {
provide: LLM_TRACING_DRIVER, provide: LLM_TRACING_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
useFactory: (...args: any[]) => { useFactory: (...args: any[]) => {
const config = options.useFactory(...args); const config = options.useFactory(...args);

View File

@ -34,6 +34,7 @@ export class LoggerModule extends ConfigurableModuleClass {
static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule { static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule {
const provider = { const provider = {
provide: LOGGER_DRIVER, provide: LOGGER_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
useFactory: async (...args: any[]) => { useFactory: async (...args: any[]) => {
const config = await options?.useFactory?.(...args); const config = await options?.useFactory?.(...args);

View File

@ -11,10 +11,14 @@ import { LOGGER_DRIVER } from 'src/engine/core-modules/logger/logger.constants';
export class LoggerService implements LoggerServiceInterface { export class LoggerService implements LoggerServiceInterface {
constructor(@Inject(LOGGER_DRIVER) private driver: LoggerServiceInterface) {} constructor(@Inject(LOGGER_DRIVER) private driver: LoggerServiceInterface) {}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
log(message: any, category: string, ...optionalParams: any[]) { log(message: any, category: string, ...optionalParams: any[]) {
this.driver.log.apply(this.driver, [message, category, ...optionalParams]); this.driver.log.apply(this.driver, [message, category, ...optionalParams]);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
error(message: any, category: string, ...optionalParams: any[]) { error(message: any, category: string, ...optionalParams: any[]) {
this.driver.error.apply(this.driver, [ this.driver.error.apply(this.driver, [
message, message,
@ -23,10 +27,14 @@ export class LoggerService implements LoggerServiceInterface {
]); ]);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
warn(message: any, category: string, ...optionalParams: any[]) { warn(message: any, category: string, ...optionalParams: any[]) {
this.driver.warn.apply(this.driver, [message, category, ...optionalParams]); this.driver.warn.apply(this.driver, [message, category, ...optionalParams]);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
debug?(message: any, category: string, ...optionalParams: any[]) { debug?(message: any, category: string, ...optionalParams: any[]) {
this.driver.debug?.apply(this.driver, [ this.driver.debug?.apply(this.driver, [
message, message,
@ -35,6 +43,8 @@ export class LoggerService implements LoggerServiceInterface {
]); ]);
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
verbose?(message: any, category: string, ...optionalParams: any[]) { verbose?(message: any, category: string, ...optionalParams: any[]) {
this.driver.verbose?.apply(this.driver, [ this.driver.verbose?.apply(this.driver, [
message, message,

View File

@ -38,6 +38,7 @@ export class SyncDriver implements MessageQueueDriver {
id: '', id: '',
name: jobName, name: jobName,
// TODO: Fix this type issue // TODO: Fix this type issue
// eslint-disable-next-line @typescript-eslint/no-explicit-any
data: data as any, data: data as any,
}); });
} }

View File

@ -1,3 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface MessageQueueJob<T = any> { export interface MessageQueueJob<T = any> {
id: string; id: string;
name: string; name: string;
@ -11,5 +12,6 @@ export interface MessageQueueCronJobData<
} }
export interface MessageQueueJobData { export interface MessageQueueJobData {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any; [key: string]: any;
} }

View File

@ -19,6 +19,7 @@ export interface BullMQDriverFactoryOptions {
export interface SyncDriverFactoryOptions { export interface SyncDriverFactoryOptions {
type: MessageQueueDriverType.Sync; type: MessageQueueDriverType.Sync;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
options: Record<string, any>; options: Record<string, any>;
} }

View File

@ -62,6 +62,7 @@ export class MessageQueueCoreModule extends ConfigurableModuleClass {
const driverProvider: Provider = { const driverProvider: Provider = {
provide: QUEUE_DRIVER, provide: QUEUE_DRIVER,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
useFactory: async (...args: any[]) => { useFactory: async (...args: any[]) => {
if (options.useFactory) { if (options.useFactory) {
const config = await options.useFactory(...args); const config = await options.useFactory(...args);

View File

@ -8,6 +8,7 @@ import { computeTableName } from 'src/engine/utils/compute-table-name.util';
type RecordPositionQuery = string; type RecordPositionQuery = string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type RecordPositionQueryParams = any[]; type RecordPositionQueryParams = any[];
export const buildRecordPositionQuery = ( export const buildRecordPositionQuery = (

View File

@ -21,8 +21,10 @@ export class RecordInputTransformerService {
recordInput, recordInput,
objectMetadataMapItem, objectMetadataMapItem,
}: { }: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
recordInput: Record<string, any>; recordInput: Record<string, any>;
objectMetadataMapItem: ObjectMetadataItemWithFieldMaps; objectMetadataMapItem: ObjectMetadataItemWithFieldMaps;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}): Promise<Record<string, any>> { }): Promise<Record<string, any>> {
if (!recordInput) { if (!recordInput) {
return recordInput; return recordInput;
@ -63,7 +65,9 @@ export class RecordInputTransformerService {
async transformFieldValue( async transformFieldValue(
fieldType: FieldMetadataType, fieldType: FieldMetadataType,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any, value: any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Promise<any> { ): Promise<any> {
if (!isDefined(value)) { if (!isDefined(value)) {
return value; return value;
@ -90,6 +94,7 @@ export class RecordInputTransformerService {
} }
private async transformRichTextV2Value( private async transformRichTextV2Value(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
richTextValue: any, richTextValue: any,
): Promise<RichTextV2Metadata> { ): Promise<RichTextV2Metadata> {
const parsedValue = richTextV2ValueSchema.parse(richTextValue); const parsedValue = richTextV2ValueSchema.parse(richTextValue);
@ -124,6 +129,8 @@ export class RecordInputTransformerService {
}; };
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private transformLinksValue(value: any): any { private transformLinksValue(value: any): any {
if (!value) { if (!value) {
return value; return value;
@ -157,6 +164,8 @@ export class RecordInputTransformerService {
}; };
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private transformEmailsValue(value: any): any { private transformEmailsValue(value: any): any {
if (!value) { if (!value) {
return value; return value;
@ -185,6 +194,7 @@ export class RecordInputTransformerService {
}; };
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private stringifySubFields(fieldMetadataType: FieldMetadataType, value: any) { private stringifySubFields(fieldMetadataType: FieldMetadataType, value: any) {
const compositeType = compositeTypeDefinitions.get(fieldMetadataType); const compositeType = compositeTypeDefinitions.get(fieldMetadataType);
@ -213,6 +223,7 @@ export class RecordInputTransformerService {
); );
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private parseSubFields(fieldMetadataType: FieldMetadataType, value: any) { private parseSubFields(fieldMetadataType: FieldMetadataType, value: any) {
const compositeType = compositeTypeDefinitions.get(fieldMetadataType); const compositeType = compositeTypeDefinitions.get(fieldMetadataType);
@ -221,6 +232,7 @@ export class RecordInputTransformerService {
} }
return Object.entries(value).reduce( return Object.entries(value).reduce(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(acc, [subFieldName, subFieldValue]: [string, any]) => { (acc, [subFieldName, subFieldValue]: [string, any]) => {
const subFieldType = compositeType.properties.find( const subFieldType = compositeType.properties.find(
(property) => property.name === subFieldName, (property) => property.name === subFieldName,

View File

@ -28,6 +28,7 @@ export class AddPackagesCommand extends CommandRunner {
async run( async run(
passedParams: string[], passedParams: string[],
// eslint-disable-next-line @typescript-eslint/no-explicit-any
options: Record<string, any>, options: Record<string, any>,
): Promise<void> { ): Promise<void> {
this.logger.log('---------------------------------------'); this.logger.log('---------------------------------------');

View File

@ -21,6 +21,7 @@ export const copyAndBuildDependencies = async (buildDirectory: string) => {
try { try {
await execPromise('yarn', { cwd: buildDirectory }); await execPromise('yarn', { cwd: buildDirectory });
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) { } catch (error: any) {
throw new Error(error.stdout); throw new Error(error.stdout);
} }

Some files were not shown because too many files have changed in this diff Show More