[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:
@ -14,6 +14,7 @@ module.exports = {
|
||||
project: ['packages/twenty-server/tsconfig.json'],
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'error',
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
{
|
||||
@ -98,6 +99,18 @@ module.exports = {
|
||||
'@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'],
|
||||
parserOptions: {
|
||||
|
||||
@ -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>>(
|
||||
table: string,
|
||||
values: T[],
|
||||
@ -164,6 +165,7 @@ export class ClickHouseService implements OnModuleInit, OnModuleDestroy {
|
||||
// Method to execute a select query
|
||||
public async select<T>(
|
||||
query: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
params?: Record<string, any>,
|
||||
clientId?: string,
|
||||
): Promise<T[]> {
|
||||
|
||||
@ -20,6 +20,7 @@ export class CommandLogger {
|
||||
this.verboseFlag = options.verbose ?? false;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
log(message: string, ...optionalParams: [...any, string?]) {
|
||||
this.logger.log(message, ...optionalParams);
|
||||
}
|
||||
@ -28,14 +29,17 @@ export class CommandLogger {
|
||||
this.logger.error(message, stack, context);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
warn(message: string, ...optionalParams: [...any, string?]) {
|
||||
this.logger.warn(message, ...optionalParams);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
debug(message: string, ...optionalParams: [...any, string?]) {
|
||||
this.logger.debug(message, ...optionalParams);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
verbose(message: string, ...optionalParams: [...any, string?]) {
|
||||
if (this.verboseFlag) {
|
||||
this.logger.log(message, ...optionalParams);
|
||||
|
||||
@ -2,12 +2,15 @@ import { isDefined } from 'class-validator';
|
||||
import { Plugin } from 'graphql-yoga';
|
||||
|
||||
export type CacheMetadataPluginConfig = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
cacheGetter: (key: string) => any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
cacheSetter: (key: string, value: any) => void;
|
||||
operationsToCache: string[];
|
||||
};
|
||||
|
||||
export function useCachedMetadata(config: CacheMetadataPluginConfig): Plugin {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const computeCacheKey = (serverContext: any) => {
|
||||
const workspaceId = serverContext.req.workspace?.id ?? 'anonymous';
|
||||
const workspaceMetadataVersion =
|
||||
@ -21,6 +24,7 @@ export function useCachedMetadata(config: CacheMetadataPluginConfig): Plugin {
|
||||
return `graphql:operations:${operationName}:${workspaceId}:${workspaceMetadataVersion}${localeCacheKey}`;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const getOperationName = (serverContext: any) =>
|
||||
serverContext?.req?.body?.operationName;
|
||||
|
||||
|
||||
@ -29,9 +29,11 @@ export class GraphqlQueryFilterConditionParser {
|
||||
}
|
||||
|
||||
public parse(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
queryBuilder: SelectQueryBuilder<any>,
|
||||
objectNameSingular: string,
|
||||
filter: Partial<ObjectRecordFilter>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): SelectQueryBuilder<any> {
|
||||
if (!filter || Object.keys(filter).length === 0) {
|
||||
return queryBuilder;
|
||||
@ -50,6 +52,7 @@ export class GraphqlQueryFilterConditionParser {
|
||||
queryBuilder: WhereExpressionBuilder,
|
||||
objectNameSingular: string,
|
||||
key: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
value: any,
|
||||
isFirst = false,
|
||||
): void {
|
||||
|
||||
@ -31,6 +31,7 @@ export class GraphqlQueryFilterFieldParser {
|
||||
queryBuilder: WhereExpressionBuilder,
|
||||
objectNameSingular: string,
|
||||
key: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
filterValue: any,
|
||||
isFirst = false,
|
||||
): void {
|
||||
@ -81,6 +82,7 @@ export class GraphqlQueryFilterFieldParser {
|
||||
queryBuilder: WhereExpressionBuilder,
|
||||
fieldMetadata: FieldMetadataInterface,
|
||||
objectNameSingular: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
fieldValue: any,
|
||||
isFirst = false,
|
||||
): void {
|
||||
@ -108,6 +110,7 @@ export class GraphqlQueryFilterFieldParser {
|
||||
const fullFieldName = `${fieldMetadata.name}${capitalize(subFieldKey)}`;
|
||||
|
||||
const [[operator, value]] = Object.entries(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
subFieldFilter as Record<string, any>,
|
||||
);
|
||||
|
||||
|
||||
@ -65,6 +65,7 @@ export class GraphqlQueryOrderFieldParser {
|
||||
|
||||
private parseCompositeFieldForOrder(
|
||||
fieldMetadata: FieldMetadataInterface,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
value: any,
|
||||
objectNameSingular: string,
|
||||
isForwardPagination = true,
|
||||
|
||||
@ -8,6 +8,7 @@ import {
|
||||
|
||||
export class GraphqlQuerySelectedFieldsAggregateParser {
|
||||
parse(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
graphqlSelectedFields: Partial<Record<string, any>>,
|
||||
fieldMetadataMapByName: Record<string, FieldMetadataInterface>,
|
||||
accumulator: GraphqlQuerySelectedFieldsResult,
|
||||
|
||||
@ -17,6 +17,7 @@ export class GraphqlQuerySelectedFieldsRelationParser {
|
||||
parseRelationField(
|
||||
fieldMetadata: FieldMetadataInterface,
|
||||
fieldKey: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
fieldValue: any,
|
||||
accumulator: GraphqlQuerySelectedFieldsResult,
|
||||
): void {
|
||||
|
||||
@ -11,8 +11,11 @@ import { CompositeFieldMetadataType } from 'src/engine/metadata-modules/workspac
|
||||
import { isRelationFieldMetadataType } from 'src/engine/utils/is-relation-field-metadata-type.util';
|
||||
|
||||
export type GraphqlQuerySelectedFieldsResult = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
select: Record<string, any>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
relations: Record<string, any>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
aggregate: Record<string, any>;
|
||||
};
|
||||
|
||||
@ -27,6 +30,7 @@ export class GraphqlQuerySelectedFieldsParser {
|
||||
}
|
||||
|
||||
parse(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
graphqlSelectedFields: Partial<Record<string, any>>,
|
||||
fieldMetadataMapByName: Record<string, FieldMetadataInterface>,
|
||||
): GraphqlQuerySelectedFieldsResult {
|
||||
@ -62,6 +66,7 @@ export class GraphqlQuerySelectedFieldsParser {
|
||||
}
|
||||
|
||||
private parseRecordField(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
graphqlSelectedFields: Partial<Record<string, any>>,
|
||||
fieldMetadataMapByName: Record<string, FieldMetadataInterface>,
|
||||
accumulator: GraphqlQuerySelectedFieldsResult,
|
||||
@ -96,6 +101,7 @@ export class GraphqlQuerySelectedFieldsParser {
|
||||
}
|
||||
|
||||
private parseConnectionField(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
graphqlSelectedFields: Partial<Record<string, any>>,
|
||||
fieldMetadataMapByName: Record<string, FieldMetadataInterface>,
|
||||
accumulator: GraphqlQuerySelectedFieldsResult,
|
||||
@ -112,6 +118,7 @@ export class GraphqlQuerySelectedFieldsParser {
|
||||
}
|
||||
|
||||
private isRootConnection(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
graphqlSelectedFields: Partial<Record<string, any>>,
|
||||
): boolean {
|
||||
return Object.keys(graphqlSelectedFields).includes('edges');
|
||||
@ -119,7 +126,9 @@ export class GraphqlQuerySelectedFieldsParser {
|
||||
|
||||
private parseCompositeField(
|
||||
fieldMetadata: FieldMetadataInterface,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
fieldValue: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Record<string, any> {
|
||||
const compositeType = compositeTypeDefinitions.get(
|
||||
fieldMetadata.type as CompositeFieldMetadataType,
|
||||
@ -151,6 +160,7 @@ export class GraphqlQuerySelectedFieldsParser {
|
||||
|
||||
return acc;
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
{} as Record<string, any>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -50,9 +50,11 @@ export class GraphqlQueryParser {
|
||||
}
|
||||
|
||||
public applyFilterToBuilder(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
queryBuilder: SelectQueryBuilder<any>,
|
||||
objectNameSingular: string,
|
||||
recordFilter: Partial<ObjectRecordFilter>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): SelectQueryBuilder<any> {
|
||||
return this.filterConditionParser.parse(
|
||||
queryBuilder,
|
||||
@ -62,8 +64,10 @@ export class GraphqlQueryParser {
|
||||
}
|
||||
|
||||
public applyDeletedAtToBuilder(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
queryBuilder: SelectQueryBuilder<any>,
|
||||
recordFilter: Partial<ObjectRecordFilter>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): SelectQueryBuilder<any> {
|
||||
if (this.checkForDeletedAtFilter(recordFilter)) {
|
||||
queryBuilder.withDeleted();
|
||||
@ -99,10 +103,12 @@ export class GraphqlQueryParser {
|
||||
};
|
||||
|
||||
public applyOrderToBuilder(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
queryBuilder: SelectQueryBuilder<any>,
|
||||
orderBy: ObjectRecordOrderBy,
|
||||
objectNameSingular: string,
|
||||
isForwardPagination = true,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): SelectQueryBuilder<any> {
|
||||
const parsedOrderBys = this.orderFieldParser.parse(
|
||||
orderBy,
|
||||
@ -115,6 +121,7 @@ export class GraphqlQueryParser {
|
||||
|
||||
public parseSelectedFields(
|
||||
parentObjectMetadata: ObjectMetadataItemWithFieldMaps,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
graphqlSelectedFields: Partial<Record<string, any>>,
|
||||
): GraphqlQuerySelectedFieldsResult {
|
||||
const parentFields = getObjectMetadataMapItemByNameSingular(
|
||||
|
||||
@ -46,7 +46,9 @@ export class ObjectRecordsToGraphqlConnectionHelper {
|
||||
}: {
|
||||
objectRecords: T[];
|
||||
parentObjectRecord?: T;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
objectRecordsAggregatedValues?: Record<string, any>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
selectedAggregatedFields?: Record<string, any>;
|
||||
objectName: string;
|
||||
take: number;
|
||||
@ -95,6 +97,7 @@ export class ObjectRecordsToGraphqlConnectionHelper {
|
||||
objectRecordsAggregatedValues,
|
||||
}: {
|
||||
selectedAggregatedFields: Record<string, AggregationField[]>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
objectRecordsAggregatedValues: Record<string, any>;
|
||||
}) => {
|
||||
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>>({
|
||||
objectRecord,
|
||||
objectName,
|
||||
@ -132,7 +136,9 @@ export class ObjectRecordsToGraphqlConnectionHelper {
|
||||
}: {
|
||||
objectRecord: T;
|
||||
objectName: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
objectRecordsAggregatedValues?: Record<string, any>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
selectedAggregatedFields?: Record<string, any>;
|
||||
take: number;
|
||||
totalCount: number;
|
||||
@ -158,6 +164,7 @@ export class ObjectRecordsToGraphqlConnectionHelper {
|
||||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const processedObjectRecord: Record<string, any> = {};
|
||||
|
||||
for (const [key, value] of Object.entries(objectRecord)) {
|
||||
@ -229,7 +236,9 @@ export class ObjectRecordsToGraphqlConnectionHelper {
|
||||
|
||||
private processCompositeField(
|
||||
fieldMetadata: FieldMetadataInterface,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
fieldValue: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Record<string, any> {
|
||||
const compositeType = compositeTypeDefinitions.get(
|
||||
fieldMetadata.type as CompositeFieldMetadataType,
|
||||
@ -262,10 +271,12 @@ export class ObjectRecordsToGraphqlConnectionHelper {
|
||||
|
||||
return acc;
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
{} as Record<string, any>,
|
||||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private formatFieldValue(value: any, fieldType: FieldMetadataType) {
|
||||
switch (fieldType) {
|
||||
case FieldMetadataType.RAW_JSON:
|
||||
|
||||
@ -14,6 +14,7 @@ export class ProcessAggregateHelper {
|
||||
queryBuilder,
|
||||
}: {
|
||||
selectedAggregatedFields: Record<string, AggregationField>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
queryBuilder: SelectQueryBuilder<any>;
|
||||
}) => {
|
||||
queryBuilder.select([]);
|
||||
|
||||
@ -47,6 +47,7 @@ export class ProcessNestedRelationsV2Helper {
|
||||
objectMetadataMaps: ObjectMetadataMaps;
|
||||
parentObjectMetadataItem: ObjectMetadataItemWithFieldMaps;
|
||||
parentObjectRecords: T[];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parentObjectRecordsAggregatedValues?: Record<string, any>;
|
||||
relations: Record<string, FindOptionsRelations<ObjectLiteral>>;
|
||||
aggregate?: Record<string, AggregationField>;
|
||||
@ -94,6 +95,7 @@ export class ProcessNestedRelationsV2Helper {
|
||||
objectMetadataMaps: ObjectMetadataMaps;
|
||||
parentObjectMetadataItem: ObjectMetadataItemWithFieldMaps;
|
||||
parentObjectRecords: T[];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parentObjectRecordsAggregatedValues: Record<string, any>;
|
||||
sourceFieldName: string;
|
||||
nestedRelations: FindOptionsRelations<ObjectLiteral>;
|
||||
@ -251,6 +253,7 @@ export class ProcessNestedRelationsV2Helper {
|
||||
}: {
|
||||
records: ObjectRecord[];
|
||||
idField: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
}): any[] {
|
||||
return [...new Set(records.map((item) => item[idField]))];
|
||||
}
|
||||
@ -265,20 +268,26 @@ export class ProcessNestedRelationsV2Helper {
|
||||
aggregate,
|
||||
sourceFieldName,
|
||||
}: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
referenceQueryBuilder: SelectQueryBuilder<any>;
|
||||
column: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
ids: any[];
|
||||
limit: number;
|
||||
objectMetadataMaps: ObjectMetadataMaps;
|
||||
targetObjectMetadata: ObjectMetadataItemWithFieldMaps;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
aggregate: Record<string, any>;
|
||||
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 }> {
|
||||
if (ids.length === 0) {
|
||||
return { relationResults: [], relationAggregatedFieldsResult: {} };
|
||||
}
|
||||
|
||||
const aggregateForRelation = aggregate[sourceFieldName];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let relationAggregatedFieldsResult: Record<string, any> = {};
|
||||
|
||||
if (aggregateForRelation) {
|
||||
@ -339,8 +348,11 @@ export class ProcessNestedRelationsV2Helper {
|
||||
relationType,
|
||||
}: {
|
||||
parentRecords: ObjectRecord[];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parentObjectRecordsAggregatedValues: Record<string, any>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
relationResults: any[];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
relationAggregatedFieldsResult: Record<string, any>;
|
||||
sourceFieldName: string;
|
||||
joinField: string;
|
||||
|
||||
@ -35,6 +35,7 @@ export class ProcessNestedRelationsHelper {
|
||||
objectMetadataMaps: ObjectMetadataMaps;
|
||||
parentObjectMetadataItem: ObjectMetadataItemWithFieldMaps;
|
||||
parentObjectRecords: T[];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parentObjectRecordsAggregatedValues?: Record<string, any>;
|
||||
relations: Record<string, FindOptionsRelations<ObjectLiteral>>;
|
||||
aggregate?: Record<string, AggregationField>;
|
||||
|
||||
@ -199,6 +199,7 @@ export class GraphqlQueryCreateManyResolverService extends GraphqlQueryBaseResol
|
||||
fullPath: string;
|
||||
column: string;
|
||||
}[],
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Record<string, any> {
|
||||
const whereConditions = {};
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ export const computeWhereConditionParts = (
|
||||
operator: string,
|
||||
objectNameSingular: string,
|
||||
key: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
value: any,
|
||||
): WhereConditionParts => {
|
||||
const uuid = Math.random().toString(36).slice(2, 7);
|
||||
|
||||
@ -10,6 +10,7 @@ import {
|
||||
} from 'src/engine/api/graphql/graphql-query-runner/errors/graphql-query-runner.exception';
|
||||
|
||||
export interface CursorData {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@ -28,6 +29,7 @@ export const encodeCursor = <T extends ObjectRecord = ObjectRecord>(
|
||||
objectRecord: T,
|
||||
order: ObjectRecordOrderBy | undefined,
|
||||
): string => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const orderByValues: Record<string, any> = {};
|
||||
|
||||
const orderBy = order?.reduce((acc, orderBy) => ({ ...acc, ...orderBy }), {});
|
||||
@ -47,7 +49,10 @@ export const encodeCursor = <T extends ObjectRecord = ObjectRecord>(
|
||||
};
|
||||
|
||||
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>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Record<string, any> | undefined => {
|
||||
if (args.after) return decodeCursor(args.after);
|
||||
if (args.before) return decodeCursor(args.before);
|
||||
@ -56,6 +61,7 @@ export const getCursor = (
|
||||
};
|
||||
|
||||
export const getPaginationInfo = (
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
objectRecords: any[],
|
||||
limit: number,
|
||||
isForwardPagination: boolean,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
export interface ObjectRecord {
|
||||
id: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
@ -7,6 +8,7 @@ export interface ObjectRecord {
|
||||
}
|
||||
|
||||
export type ObjectRecordFilter = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[Property in keyof ObjectRecord]: any;
|
||||
};
|
||||
|
||||
|
||||
@ -74,6 +74,7 @@ const parseValueNode = (
|
||||
export const getFieldArgumentsByKey = (
|
||||
info: GraphQLResolveInfo,
|
||||
fieldKey: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Record<string, any> => {
|
||||
// Start from the first top-level field node and search recursively
|
||||
const targetField = findFieldNode(info.fieldNodes[0].selectionSet, fieldKey);
|
||||
@ -84,6 +85,7 @@ export const getFieldArgumentsByKey = (
|
||||
}
|
||||
|
||||
// Extract the arguments from the field we've found
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const args: Record<string, any> = {};
|
||||
|
||||
if (targetField.arguments && targetField.arguments.length) {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const stringifyWithoutKeyQuote = (obj: any) => {
|
||||
const jsonString = JSON.stringify(obj);
|
||||
const jsonWithoutQuotes = jsonString?.replace(/"(\w+)"\s*:/g, '$1:');
|
||||
|
||||
@ -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 { 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 RichTextBody = RichTextBlock[];
|
||||
|
||||
@ -233,6 +233,7 @@ export class QueryResultGettersFactory {
|
||||
objectMetadataItem: ObjectMetadataInterface,
|
||||
workspaceId: string,
|
||||
objectMetadataMaps: ObjectMetadataMaps,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Promise<any> {
|
||||
return await this.processQueryResultField(
|
||||
result,
|
||||
@ -245,6 +246,7 @@ export class QueryResultGettersFactory {
|
||||
private getHandler(objectType: string): QueryResultGetterHandlerInterface {
|
||||
return (
|
||||
this.handlers.get(objectType) || {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
handle: (result: any) => result,
|
||||
}
|
||||
);
|
||||
|
||||
@ -174,8 +174,10 @@ export class QueryRunnerArgsFactory {
|
||||
const workspaceId = options.authContext.workspace.id;
|
||||
let isFieldPositionPresent = false;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const createArgByArgKeyPromises: Promise<[string, any]>[] = Object.entries(
|
||||
data,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
).map(async ([key, value]): Promise<[string, any]> => {
|
||||
const fieldMetadata = fieldMetadataMapByNameByName[key];
|
||||
|
||||
@ -280,6 +282,7 @@ export class QueryRunnerArgsFactory {
|
||||
|
||||
private transformFilterValueByType(
|
||||
key: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
value: any,
|
||||
fieldMetadataMapByName: FieldMetadataMap,
|
||||
) {
|
||||
@ -310,6 +313,7 @@ export class QueryRunnerArgsFactory {
|
||||
|
||||
private async overrideValueByFieldMetadata(
|
||||
key: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
value: any,
|
||||
fieldMetadataMapByName: FieldMetadataMap,
|
||||
) {
|
||||
|
||||
@ -51,6 +51,7 @@ const pgGraphQLErrorMapping: PgGraphQLErrorMapping = {
|
||||
export const computePgGraphQLError = (
|
||||
command: string,
|
||||
objectName: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
errors: any[],
|
||||
pgGraphqlConfig: PgGraphQLConfig,
|
||||
) => {
|
||||
|
||||
@ -4,8 +4,10 @@ import {
|
||||
} from 'src/engine/api/graphql/workspace-query-builder/utils/composite-field-metadata.util';
|
||||
|
||||
export const handleCompositeKey = (
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
result: any,
|
||||
key: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
value: any,
|
||||
): void => {
|
||||
const parsedFieldKey = parseCompositeFieldKey(key);
|
||||
@ -22,6 +24,8 @@ export const handleCompositeKey = (
|
||||
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 => {
|
||||
if (obj === null || typeof obj !== 'object' || typeof obj === 'function') {
|
||||
return obj;
|
||||
@ -31,6 +35,7 @@ export const parseResult = (obj: any): any => {
|
||||
return obj.map((item) => parseResult(item));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const result: any = {};
|
||||
|
||||
for (const key in obj) {
|
||||
|
||||
@ -8,6 +8,9 @@ import {
|
||||
|
||||
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 enum ResolverArgsType {
|
||||
@ -71,6 +74,7 @@ export interface UpdateOneResolverArgs<
|
||||
|
||||
export interface UpdateManyResolverArgs<
|
||||
Data extends Partial<ObjectRecord> = Partial<ObjectRecord>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
Filter = any,
|
||||
> {
|
||||
filter: Filter;
|
||||
@ -81,6 +85,7 @@ export interface DeleteOneResolverArgs {
|
||||
id: string;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export interface DeleteManyResolverArgs<Filter = any> {
|
||||
filter: Filter;
|
||||
}
|
||||
@ -89,6 +94,7 @@ export interface RestoreOneResolverArgs {
|
||||
id: string;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export interface RestoreManyResolverArgs<Filter = any> {
|
||||
filter: Filter;
|
||||
}
|
||||
@ -97,6 +103,7 @@ export interface DestroyOneResolverArgs {
|
||||
id: string;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export interface DestroyManyResolverArgs<Filter = any> {
|
||||
filter: Filter;
|
||||
}
|
||||
|
||||
@ -44,7 +44,11 @@ export class CompositeObjectTypeDefinitionFactory {
|
||||
compositeType: CompositeType,
|
||||
kind: ObjectTypeDefinitionKind,
|
||||
options: WorkspaceBuildSchemaOptions,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-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> = {};
|
||||
|
||||
for (const property of compositeType.properties) {
|
||||
|
||||
@ -46,7 +46,11 @@ export class ConnectionTypeDefinitionFactory {
|
||||
private generateFields(
|
||||
objectMetadata: ObjectMetadataInterface,
|
||||
options: WorkspaceBuildSchemaOptions,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-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 aggregatedFields = this.aggregationTypeFactory.create(objectMetadata);
|
||||
|
||||
@ -42,7 +42,11 @@ export class EdgeTypeDefinitionFactory {
|
||||
private generateFields(
|
||||
objectMetadata: ObjectMetadataInterface,
|
||||
options: WorkspaceBuildSchemaOptions,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-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> = {};
|
||||
|
||||
fields.node = {
|
||||
|
||||
@ -103,7 +103,11 @@ export class ExtendObjectTypeDefinitionV2Factory {
|
||||
private generateFields(
|
||||
objectMetadata: ObjectMetadataInterface,
|
||||
options: WorkspaceBuildSchemaOptions,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-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> = {};
|
||||
|
||||
for (const fieldMetadata of objectMetadata.fields) {
|
||||
|
||||
@ -104,7 +104,11 @@ export class ExtendObjectTypeDefinitionFactory {
|
||||
private generateFields(
|
||||
objectMetadata: ObjectMetadataInterface,
|
||||
options: WorkspaceBuildSchemaOptions,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-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> = {};
|
||||
|
||||
for (const fieldMetadata of objectMetadata.fields) {
|
||||
|
||||
@ -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>(
|
||||
objectMetadataCollection: ObjectMetadataInterface[],
|
||||
workspaceResolverMethodNames: WorkspaceResolverBuilderMethodNames[],
|
||||
|
||||
@ -10,6 +10,7 @@ const isValidStringPosition = (value: string): boolean =>
|
||||
const isValidNumberPosition = (value: number): boolean =>
|
||||
typeof value === 'number';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const checkPosition = (value: any): PositionType => {
|
||||
if (isValidNumberPosition(value) || isValidStringPosition(value)) {
|
||||
return value;
|
||||
|
||||
@ -8,6 +8,7 @@ import { ValidationError } from 'src/engine/core-modules/graphql/utils/graphql-e
|
||||
const parseLiteral = (
|
||||
ast: ValueNode,
|
||||
variables?: Maybe<ObjMap<unknown>>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): any => {
|
||||
switch (ast.kind) {
|
||||
case Kind.STRING:
|
||||
@ -17,8 +18,10 @@ const parseLiteral = (
|
||||
case Kind.FLOAT:
|
||||
return parseFloat(ast.value);
|
||||
case Kind.OBJECT:
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return parseObject(ast as any, variables);
|
||||
case Kind.LIST:
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return (ast as any).values.map((n: ValueNode) =>
|
||||
parseLiteral(n, variables),
|
||||
);
|
||||
@ -40,6 +43,7 @@ const parseObject = (
|
||||
const value = Object.create(null);
|
||||
|
||||
if ('fields' in ast) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
ast.fields?.forEach((field: any) => {
|
||||
value[field.name.value] = parseLiteral(field.value, variables);
|
||||
});
|
||||
@ -48,6 +52,7 @@ const parseObject = (
|
||||
return value;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const stringify = (value: any): string => {
|
||||
return JSON.stringify(value);
|
||||
};
|
||||
|
||||
@ -3,6 +3,7 @@ import { validate as uuidValidate } from 'uuid';
|
||||
|
||||
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 => {
|
||||
if (typeof value !== 'string') {
|
||||
throw new ValidationError('UUID must be a string');
|
||||
|
||||
@ -2,6 +2,7 @@ import { GraphQLScalarType } from 'graphql';
|
||||
|
||||
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> {
|
||||
kind?: InputTypeDefinitionKind;
|
||||
type?: GraphQLScalarType;
|
||||
|
||||
@ -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 { 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> {
|
||||
nullable?: boolean;
|
||||
isArray?: boolean;
|
||||
|
||||
@ -24,8 +24,10 @@ type TypeFactory<T extends InputTypeDefinitionKind | ObjectTypeDefinitionKind> =
|
||||
options: WorkspaceBuildSchemaOptions,
|
||||
additionalOptions: {
|
||||
nullable?: boolean;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
defaultValue?: any;
|
||||
isArray: boolean;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
settings: any;
|
||||
isIdField: boolean;
|
||||
},
|
||||
@ -43,7 +45,9 @@ export const generateFields = <
|
||||
typeFactory: TypeFactory<T>,
|
||||
): T extends InputTypeDefinitionKind
|
||||
? 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 = {};
|
||||
|
||||
for (const fieldMetadata of objectMetadata.fields) {
|
||||
|
||||
@ -21,6 +21,7 @@ export class RestApiCreateManyHandler extends RestApiBaseHandler {
|
||||
throw new BadRequestException('Input must not be empty');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const overriddenRecordsToCreate: Record<string, any>[] = [];
|
||||
|
||||
for (const recordToCreate of body) {
|
||||
|
||||
@ -121,6 +121,7 @@ export class RestApiFindDuplicatesHandler extends RestApiBaseHandler {
|
||||
startCursor,
|
||||
endCursor,
|
||||
}: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
finalRecords: any[];
|
||||
objectMetadataNameSingular: string;
|
||||
isForwardPagination: boolean;
|
||||
|
||||
@ -50,6 +50,7 @@ export class RestApiFindManyHandler extends RestApiBaseHandler {
|
||||
startCursor,
|
||||
endCursor,
|
||||
}: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
finalRecords: any[];
|
||||
objectMetadataNamePlural: string;
|
||||
isForwardPagination: boolean;
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const cleanGraphQLResponse = (input: any) => {
|
||||
if (!input) return null;
|
||||
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) => {
|
||||
return obj !== null && typeof obj === 'object' && !Array.isArray(obj);
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const cleanObject = (obj: any) => {
|
||||
const cleanedObj = {};
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ const computeOperator = (
|
||||
const validateAndGetOrderBy = (
|
||||
key: string,
|
||||
orderBy: ObjectRecordOrderBy,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Record<string, any> => {
|
||||
const keyOrderBy = orderBy.find((order) => key in order);
|
||||
|
||||
@ -51,6 +52,7 @@ const isAscendingOrder = (direction: OrderByDirection): boolean =>
|
||||
direction === OrderByDirection.AscNullsLast;
|
||||
|
||||
export const computeCursorArgFilter = (
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
cursor: Record<string, any>,
|
||||
orderBy: ObjectRecordOrderBy,
|
||||
fieldMetadataMapByName: FieldMetadataMap,
|
||||
@ -99,11 +101,13 @@ export const computeCursorArgFilter = (
|
||||
|
||||
const buildWhereCondition = (
|
||||
key: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
value: any,
|
||||
fieldMetadataMapByName: FieldMetadataMap,
|
||||
orderBy: ObjectRecordOrderBy,
|
||||
isForwardPagination: boolean,
|
||||
operator?: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Record<string, any> => {
|
||||
const fieldMetadata = fieldMetadataMapByName[key];
|
||||
|
||||
@ -138,11 +142,13 @@ const buildWhereCondition = (
|
||||
|
||||
const buildCompositeWhereCondition = (
|
||||
key: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
value: any,
|
||||
fieldType: FieldMetadataType,
|
||||
orderBy: ObjectRecordOrderBy,
|
||||
isForwardPagination: boolean,
|
||||
operator?: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Record<string, any> => {
|
||||
const compositeType = compositeTypeDefinitions.get(fieldType);
|
||||
|
||||
@ -154,6 +160,7 @@ const buildCompositeWhereCondition = (
|
||||
}
|
||||
|
||||
const keyOrderBy = validateAndGetOrderBy(key, orderBy);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const result: Record<string, any> = {};
|
||||
|
||||
compositeType.properties.forEach((property) => {
|
||||
|
||||
@ -46,6 +46,7 @@ export class AdminPanelHealthService {
|
||||
: AdminPanelHealthServiceStatus.OUTAGE;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private transformServiceDetails(details: any) {
|
||||
if (!details) return details;
|
||||
|
||||
|
||||
@ -9,10 +9,13 @@ import { CreateAppTokenInput } from 'src/engine/core-modules/app-token/dtos/crea
|
||||
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
|
||||
|
||||
export const appTokenAutoResolverOpts: AutoResolverOpts<
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
any,
|
||||
unknown,
|
||||
unknown,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
ReadResolverOpts<any>,
|
||||
PagingStrategies
|
||||
>[] = [
|
||||
|
||||
@ -11,6 +11,7 @@ export class BeforeCreateOneAppToken<T extends AppToken>
|
||||
{
|
||||
async run(
|
||||
instance: CreateOneInputType<T>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
context: any,
|
||||
): Promise<CreateOneInputType<T>> {
|
||||
const userId = context?.req?.user?.id;
|
||||
|
||||
@ -25,5 +25,6 @@ export class CreateObjectEventInput {
|
||||
@Field(() => GraphQLJSON, { nullable: true })
|
||||
@IsObject()
|
||||
@IsOptional()
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
properties?: Record<string, any>;
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ export const genericTrackSchema = baseEventSchema.extend({
|
||||
export type GenericTrackEvent<E extends string = string> = {
|
||||
type: 'track';
|
||||
event: E;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
properties: any;
|
||||
timestamp: string;
|
||||
version: string;
|
||||
@ -18,8 +19,10 @@ export type GenericTrackEvent<E extends string = string> = {
|
||||
workspaceId?: string;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-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>>(
|
||||
event: E,
|
||||
schema: S,
|
||||
|
||||
@ -57,6 +57,7 @@ export class SSOAuthController {
|
||||
@Get('saml/metadata/:identityProviderId')
|
||||
@UseGuards(EnterpriseFeaturesEnabledGuard)
|
||||
@UseFilters(AuthRestApiExceptionFilter)
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async generateMetadata(@Req() req: any): Promise<string | void> {
|
||||
return generateServiceProviderMetadata({
|
||||
wantAssertionsSigned: false,
|
||||
|
||||
@ -26,6 +26,7 @@ export class OIDCAuthGuard extends AuthGuard('openidconnect') {
|
||||
super();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private getStateByRequest(request: any): {
|
||||
identityProviderId: string;
|
||||
} {
|
||||
|
||||
@ -20,6 +20,7 @@ export class GoogleAPIsOauthExchangeCodeForTokenStrategy extends GoogleAPIsOauth
|
||||
request: GoogleAPIsRequest,
|
||||
accessToken: string,
|
||||
refreshToken: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
profile: any,
|
||||
done: VerifyCallback,
|
||||
): Promise<void> {
|
||||
|
||||
@ -14,6 +14,8 @@ export class GoogleAPIsOauthRequestCodeStrategy extends GoogleAPIsOauthCommonStr
|
||||
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) {
|
||||
options = {
|
||||
...options,
|
||||
|
||||
@ -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) {
|
||||
options = {
|
||||
...options,
|
||||
@ -54,6 +55,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
|
||||
request: GoogleRequest,
|
||||
accessToken: string,
|
||||
refreshToken: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
profile: any,
|
||||
done: VerifyCallback,
|
||||
): Promise<void> {
|
||||
|
||||
@ -20,6 +20,7 @@ export class MicrosoftAPIsOauthExchangeCodeForTokenStrategy extends MicrosoftAPI
|
||||
request: MicrosoftAPIsRequest,
|
||||
accessToken: string,
|
||||
refreshToken: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
profile: any,
|
||||
done: VerifyCallback,
|
||||
): Promise<void> {
|
||||
|
||||
@ -9,6 +9,8 @@ export class MicrosoftAPIsOauthRequestCodeStrategy extends MicrosoftAPIsOauthCom
|
||||
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) {
|
||||
options = {
|
||||
...options,
|
||||
|
||||
@ -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) {
|
||||
options = {
|
||||
...options,
|
||||
@ -59,6 +60,7 @@ export class MicrosoftStrategy extends PassportStrategy(Strategy, 'microsoft') {
|
||||
request: MicrosoftRequest,
|
||||
accessToken: string,
|
||||
refreshToken: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
profile: any,
|
||||
done: VerifyCallback,
|
||||
): Promise<void> {
|
||||
|
||||
@ -45,6 +45,7 @@ export class OIDCAuthStrategy extends PassportStrategy(
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async authenticate(req: Request, options: any) {
|
||||
return super.authenticate(req, {
|
||||
...options,
|
||||
@ -84,6 +85,7 @@ export class OIDCAuthStrategy extends PassportStrategy(
|
||||
async validate(
|
||||
req: Request,
|
||||
tokenset: TokenSet,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
done: (err: any, user?: OIDCRequest['user']) => void,
|
||||
) {
|
||||
try {
|
||||
|
||||
@ -34,7 +34,9 @@ export class CacheStorageModule implements OnModuleDestroy {
|
||||
constructor(@Inject(CACHE_MANAGER) private cacheManager: Cache) {}
|
||||
|
||||
async onModuleDestroy() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ export class FlushCacheCommand extends CommandRunner {
|
||||
|
||||
async run(
|
||||
passedParams: string[],
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
options?: Record<string, any>,
|
||||
): Promise<void> {
|
||||
const pattern = options?.pattern || '*';
|
||||
|
||||
@ -123,6 +123,7 @@ export class CacheStorageService {
|
||||
}
|
||||
|
||||
private isRedisCache() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return (this.cache.store as any)?.name === 'redis';
|
||||
}
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ export class CaptchaModule {
|
||||
static forRoot(options: CaptchaModuleAsyncOptions): DynamicModule {
|
||||
const provider = {
|
||||
provide: CAPTCHA_DRIVER,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: async (...args: any[]) => {
|
||||
const config = await options.useFactory(...args);
|
||||
|
||||
|
||||
@ -31,6 +31,7 @@ export type CaptchaModuleOptions =
|
||||
|
||||
export type CaptchaModuleAsyncOptions = {
|
||||
useFactory: (
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
...args: any[]
|
||||
) => CaptchaModuleOptions | Promise<CaptchaModuleOptions> | undefined;
|
||||
} & Pick<ModuleMetadata, 'imports'> &
|
||||
|
||||
@ -2,12 +2,14 @@ import * as Sentry from '@sentry/node';
|
||||
|
||||
export function SentryCronMonitor(monitorSlug: string, schedule: string) {
|
||||
return function (
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
target: any,
|
||||
propertyKey: string,
|
||||
descriptor: PropertyDescriptor,
|
||||
) {
|
||||
const originalMethod = descriptor.value;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
descriptor.value = async function (...args: any[]) {
|
||||
if (!Sentry.isInitialized()) {
|
||||
return await originalMethod.apply(this, args);
|
||||
|
||||
@ -16,6 +16,7 @@ export class EmailModule {
|
||||
static forRoot(options: EmailModuleAsyncOptions): DynamicModule {
|
||||
const provider = {
|
||||
provide: EMAIL_DRIVER,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: (...args: any[]) => {
|
||||
const config = options.useFactory(...args);
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ export type EmailModuleOptions =
|
||||
};
|
||||
|
||||
export type EmailModuleAsyncOptions = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: (...args: any[]) => EmailModuleOptions;
|
||||
} & Pick<ModuleMetadata, 'imports'> &
|
||||
Pick<FactoryProvider, 'inject'>;
|
||||
|
||||
@ -29,6 +29,8 @@ export const objectRecordChangedValues = (
|
||||
|
||||
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 }>,
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
export function objectRecordDiffMerge(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
oldRecord: Record<string, any>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
newRecord: Record<string, any>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Record<string, any> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const result: Record<string, any> = { diff: {} };
|
||||
|
||||
// Iterate over the keys in the oldRecord diff
|
||||
|
||||
@ -7,6 +7,7 @@ export class ExceptionHandlerConsoleDriver
|
||||
implements ExceptionHandlerDriverInterface
|
||||
{
|
||||
captureExceptions(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
exceptions: ReadonlyArray<any>,
|
||||
options?: ExceptionHandlerOptions,
|
||||
) {
|
||||
|
||||
@ -9,6 +9,7 @@ export class ExceptionHandlerSentryDriver
|
||||
implements ExceptionHandlerDriverInterface
|
||||
{
|
||||
captureExceptions(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
exceptions: ReadonlyArray<any>,
|
||||
options?: ExceptionHandlerOptions,
|
||||
) {
|
||||
|
||||
@ -37,6 +37,7 @@ export class ExceptionHandlerModule extends ConfigurableModuleClass {
|
||||
static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule {
|
||||
const provider = {
|
||||
provide: EXCEPTION_HANDLER_DRIVER,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: async (...args: any[]) => {
|
||||
const config = await options?.useFactory?.(...args);
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@ export class ExceptionHandlerService {
|
||||
) {}
|
||||
|
||||
captureExceptions(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
exceptions: ReadonlyArray<any>,
|
||||
options?: ExceptionHandlerOptions,
|
||||
): string[] {
|
||||
|
||||
@ -22,6 +22,7 @@ export const handleException = (
|
||||
|
||||
interface RequestAndParams {
|
||||
request: Request | null;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
params: any;
|
||||
}
|
||||
|
||||
@ -35,10 +36,14 @@ export class HttpExceptionHandlerService {
|
||||
|
||||
handleError = (
|
||||
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>>,
|
||||
errorCode?: number,
|
||||
user?: ExceptionHandlerUser,
|
||||
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 => {
|
||||
const params = this.request?.params;
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ import { ExceptionHandlerOptions } from 'src/engine/core-modules/exception-handl
|
||||
|
||||
export interface ExceptionHandlerDriverInterface {
|
||||
captureExceptions(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
exceptions: ReadonlyArray<any>,
|
||||
options?: ExceptionHandlerOptions,
|
||||
): string[];
|
||||
|
||||
@ -9,6 +9,7 @@ export interface ExceptionHandlerOptions {
|
||||
name: string;
|
||||
};
|
||||
document?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
additionalData?: Record<string, any>;
|
||||
user?: ExceptionHandlerUser | null;
|
||||
workspace?: ExceptionHandlerWorkspace | null;
|
||||
|
||||
@ -9,6 +9,7 @@ export class ExceptionHandlerMockService
|
||||
implements ExceptionHandlerDriverInterface
|
||||
{
|
||||
captureExceptions(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
exceptions: readonly any[],
|
||||
_?: ExceptionHandlerOptions | undefined,
|
||||
): string[] {
|
||||
|
||||
@ -6,6 +6,7 @@ export class MockedUnhandledExceptionFilter
|
||||
extends BaseExceptionFilter
|
||||
implements ExceptionFilter
|
||||
{
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch(exception: any, _host: ArgumentsHost) {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
@ -30,6 +30,7 @@ export class FileStorageModule {
|
||||
static forRootAsync(options: FileStorageModuleAsyncOptions): DynamicModule {
|
||||
const provider = {
|
||||
provide: STORAGE_DRIVER,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: async (...args: any[]) => {
|
||||
const config = await options.useFactory(...args);
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ export type FileStorageModuleOptions =
|
||||
|
||||
export type FileStorageModuleAsyncOptions = {
|
||||
useFactory: (
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
...args: any[]
|
||||
) => FileStorageModuleOptions | Promise<FileStorageModuleOptions>;
|
||||
} & Pick<ModuleMetadata, 'imports'> &
|
||||
|
||||
@ -42,6 +42,7 @@ export class FileController {
|
||||
const folderPath = checkFilePath(params[0]);
|
||||
const filename = checkFilename(params['filename']);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const workspaceId = (req as any)?.workspaceId;
|
||||
|
||||
if (!workspaceId) {
|
||||
|
||||
@ -27,6 +27,7 @@ export class FileService {
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
encodeFileToken(payloadToEncode: Record<string, any>) {
|
||||
const fileTokenExpiresIn = this.twentyConfigService.get(
|
||||
'FILE_TOKEN_EXPIRES_IN',
|
||||
|
||||
@ -31,6 +31,7 @@ export enum ErrorCode {
|
||||
}
|
||||
|
||||
export class BaseGraphQLError extends GraphQLError {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
public extensions: Record<string, any>;
|
||||
override readonly name!: string;
|
||||
readonly locations: ReadonlyArray<SourceLocation> | undefined;
|
||||
@ -40,11 +41,13 @@ export class BaseGraphQLError extends GraphQLError {
|
||||
readonly nodes: ReadonlyArray<ASTNode> | undefined;
|
||||
public originalError: Error | undefined;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any;
|
||||
|
||||
constructor(
|
||||
message: string,
|
||||
code?: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
extensions?: Record<string, any>,
|
||||
) {
|
||||
super(message);
|
||||
@ -106,6 +109,7 @@ export class ValidationError extends BaseGraphQLError {
|
||||
}
|
||||
|
||||
export class AuthenticationError extends BaseGraphQLError {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
constructor(message: string, extensions?: Record<string, any>) {
|
||||
super(message, ErrorCode.UNAUTHENTICATED, extensions);
|
||||
|
||||
@ -114,6 +118,7 @@ export class AuthenticationError extends BaseGraphQLError {
|
||||
}
|
||||
|
||||
export class ForbiddenError extends BaseGraphQLError {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
constructor(message: string, extensions?: Record<string, any>) {
|
||||
super(message, ErrorCode.FORBIDDEN, extensions);
|
||||
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
export class HealthStateManager {
|
||||
private lastKnownState: {
|
||||
timestamp: Date;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
details: Record<string, any>;
|
||||
} | null = null;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
updateState(details: Record<string, any>) {
|
||||
this.lastKnownState = {
|
||||
timestamp: new Date(),
|
||||
|
||||
@ -38,6 +38,7 @@ import { messages as zhHantMessages } from 'src/engine/core-modules/i18n/locales
|
||||
@Injectable()
|
||||
export class I18nService implements OnModuleInit {
|
||||
async loadTranslations() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const messages: Record<keyof typeof APP_LOCALES, any> = {
|
||||
en: enMessages,
|
||||
'pseudo-en': pseudoEnMessages,
|
||||
@ -72,6 +73,7 @@ export class I18nService implements OnModuleInit {
|
||||
'zh-TW': zhHantMessages,
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(Object.entries(messages) as [keyof typeof APP_LOCALES, any][]).forEach(
|
||||
([locale, message]) => {
|
||||
i18n.load(locale, message);
|
||||
|
||||
@ -39,10 +39,12 @@ export class JwtWrapperService {
|
||||
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 {
|
||||
return this.jwtService.verify(token, options);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
decode<T = any>(payload: string, options?: jwt.DecodeOptions): T {
|
||||
return this.jwtService.decode(payload, options);
|
||||
}
|
||||
|
||||
@ -8,6 +8,8 @@ import {
|
||||
} from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
|
||||
|
||||
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>,
|
||||
> {
|
||||
constructor(
|
||||
|
||||
@ -9,6 +9,7 @@ export interface LLMChatModelModuleOptions {
|
||||
}
|
||||
|
||||
export type LLMChatModelModuleAsyncOptions = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: (...args: any[]) => LLMChatModelModuleOptions | undefined;
|
||||
} & Pick<ModuleMetadata, 'imports'> &
|
||||
Pick<FactoryProvider, 'inject'>;
|
||||
|
||||
@ -14,6 +14,7 @@ export class LLMChatModelModule {
|
||||
static forRoot(options: LLMChatModelModuleAsyncOptions): DynamicModule {
|
||||
const provider = {
|
||||
provide: LLM_CHAT_MODEL_DRIVER,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: (...args: any[]) => {
|
||||
const config = options.useFactory(...args);
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ export type LLMTracingModuleOptions =
|
||||
| ConsoleDriverFactoryOptions;
|
||||
|
||||
export type LLMTracingModuleAsyncOptions = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: (...args: any[]) => LLMTracingModuleOptions;
|
||||
} & Pick<ModuleMetadata, 'imports'> &
|
||||
Pick<FactoryProvider, 'inject'>;
|
||||
|
||||
@ -15,6 +15,7 @@ export class LLMTracingModule {
|
||||
static forRoot(options: LLMTracingModuleAsyncOptions): DynamicModule {
|
||||
const provider = {
|
||||
provide: LLM_TRACING_DRIVER,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: (...args: any[]) => {
|
||||
const config = options.useFactory(...args);
|
||||
|
||||
|
||||
@ -34,6 +34,7 @@ export class LoggerModule extends ConfigurableModuleClass {
|
||||
static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule {
|
||||
const provider = {
|
||||
provide: LOGGER_DRIVER,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: async (...args: any[]) => {
|
||||
const config = await options?.useFactory?.(...args);
|
||||
|
||||
|
||||
@ -11,10 +11,14 @@ import { LOGGER_DRIVER } from 'src/engine/core-modules/logger/logger.constants';
|
||||
export class LoggerService implements 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[]) {
|
||||
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[]) {
|
||||
this.driver.error.apply(this.driver, [
|
||||
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[]) {
|
||||
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[]) {
|
||||
this.driver.debug?.apply(this.driver, [
|
||||
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[]) {
|
||||
this.driver.verbose?.apply(this.driver, [
|
||||
message,
|
||||
|
||||
@ -38,6 +38,7 @@ export class SyncDriver implements MessageQueueDriver {
|
||||
id: '',
|
||||
name: jobName,
|
||||
// TODO: Fix this type issue
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data: data as any,
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export interface MessageQueueJob<T = any> {
|
||||
id: string;
|
||||
name: string;
|
||||
@ -11,5 +12,6 @@ export interface MessageQueueCronJobData<
|
||||
}
|
||||
|
||||
export interface MessageQueueJobData {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ export interface BullMQDriverFactoryOptions {
|
||||
|
||||
export interface SyncDriverFactoryOptions {
|
||||
type: MessageQueueDriverType.Sync;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
options: Record<string, any>;
|
||||
}
|
||||
|
||||
|
||||
@ -62,6 +62,7 @@ export class MessageQueueCoreModule extends ConfigurableModuleClass {
|
||||
|
||||
const driverProvider: Provider = {
|
||||
provide: QUEUE_DRIVER,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: async (...args: any[]) => {
|
||||
if (options.useFactory) {
|
||||
const config = await options.useFactory(...args);
|
||||
|
||||
@ -8,6 +8,7 @@ import { computeTableName } from 'src/engine/utils/compute-table-name.util';
|
||||
|
||||
type RecordPositionQuery = string;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
type RecordPositionQueryParams = any[];
|
||||
|
||||
export const buildRecordPositionQuery = (
|
||||
|
||||
@ -21,8 +21,10 @@ export class RecordInputTransformerService {
|
||||
recordInput,
|
||||
objectMetadataMapItem,
|
||||
}: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
recordInput: Record<string, any>;
|
||||
objectMetadataMapItem: ObjectMetadataItemWithFieldMaps;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
}): Promise<Record<string, any>> {
|
||||
if (!recordInput) {
|
||||
return recordInput;
|
||||
@ -63,7 +65,9 @@ export class RecordInputTransformerService {
|
||||
|
||||
async transformFieldValue(
|
||||
fieldType: FieldMetadataType,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
value: any,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Promise<any> {
|
||||
if (!isDefined(value)) {
|
||||
return value;
|
||||
@ -90,6 +94,7 @@ export class RecordInputTransformerService {
|
||||
}
|
||||
|
||||
private async transformRichTextV2Value(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
richTextValue: any,
|
||||
): Promise<RichTextV2Metadata> {
|
||||
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 {
|
||||
if (!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 {
|
||||
if (!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) {
|
||||
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) {
|
||||
const compositeType = compositeTypeDefinitions.get(fieldMetadataType);
|
||||
|
||||
@ -221,6 +232,7 @@ export class RecordInputTransformerService {
|
||||
}
|
||||
|
||||
return Object.entries(value).reduce(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(acc, [subFieldName, subFieldValue]: [string, any]) => {
|
||||
const subFieldType = compositeType.properties.find(
|
||||
(property) => property.name === subFieldName,
|
||||
|
||||
@ -28,6 +28,7 @@ export class AddPackagesCommand extends CommandRunner {
|
||||
|
||||
async run(
|
||||
passedParams: string[],
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
options: Record<string, any>,
|
||||
): Promise<void> {
|
||||
this.logger.log('---------------------------------------');
|
||||
|
||||
@ -21,6 +21,7 @@ export const copyAndBuildDependencies = async (buildDirectory: string) => {
|
||||
|
||||
try {
|
||||
await execPromise('yarn', { cwd: buildDirectory });
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} catch (error: any) {
|
||||
throw new Error(error.stdout);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user