[QRQC_2] No implicitAny in twenty-server (#12075)
# Introduction Following https://github.com/twentyhq/twenty/pull/12068 Related with https://github.com/twentyhq/core-team-issues/issues/975 We're enabling `noImplicitAny` handled few use case manually, added a `ts-expect-error` to the others, we should plan to handle them in the future
This commit is contained in:
@ -9,16 +9,17 @@ async function dropSchemasSequentially() {
|
|||||||
await rawDataSource.initialize();
|
await rawDataSource.initialize();
|
||||||
|
|
||||||
// Fetch all schemas excluding the ones we want to keep
|
// Fetch all schemas excluding the ones we want to keep
|
||||||
const schemas = await performQuery(
|
const schemas =
|
||||||
`
|
(await performQuery<{ schema_name: string }[]>(
|
||||||
|
`
|
||||||
SELECT n.nspname AS "schema_name"
|
SELECT n.nspname AS "schema_name"
|
||||||
FROM pg_catalog.pg_namespace n
|
FROM pg_catalog.pg_namespace n
|
||||||
WHERE n.nspname !~ '^pg_'
|
WHERE n.nspname !~ '^pg_'
|
||||||
AND n.nspname <> 'information_schema'
|
AND n.nspname <> 'information_schema'
|
||||||
AND n.nspname NOT IN ('metric_helpers', 'user_management', 'public')
|
AND n.nspname NOT IN ('metric_helpers', 'user_management', 'public')
|
||||||
`,
|
`,
|
||||||
'Fetching schemas...',
|
'Fetching schemas...',
|
||||||
);
|
)) ?? [];
|
||||||
|
|
||||||
const batchSize = 10;
|
const batchSize = 10;
|
||||||
|
|
||||||
|
|||||||
@ -2,17 +2,17 @@ import console from 'console';
|
|||||||
|
|
||||||
import { rawDataSource } from 'src/database/typeorm/raw/raw.datasource';
|
import { rawDataSource } from 'src/database/typeorm/raw/raw.datasource';
|
||||||
|
|
||||||
export const camelToSnakeCase = (str) =>
|
export const camelToSnakeCase = (str: string) =>
|
||||||
str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
|
str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
|
||||||
|
|
||||||
export const performQuery = async (
|
export const performQuery = async <T = unknown>(
|
||||||
query: string,
|
query: string,
|
||||||
consoleDescription: string,
|
consoleDescription: string,
|
||||||
withLog = true,
|
withLog = true,
|
||||||
ignoreAlreadyExistsError = false,
|
ignoreAlreadyExistsError = false,
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const result = await rawDataSource.query(query);
|
const result = await rawDataSource.query<T>(query);
|
||||||
|
|
||||||
withLog && console.log(`Performed '${consoleDescription}' successfully`);
|
withLog && console.log(`Performed '${consoleDescription}' successfully`);
|
||||||
|
|
||||||
|
|||||||
@ -187,9 +187,11 @@ describe('UpgradeCommandRunner', () => {
|
|||||||
workspaces: [higherVersionWorkspace],
|
workspaces: [higherVersionWorkspace],
|
||||||
appVersion,
|
appVersion,
|
||||||
});
|
});
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const passedParams = [];
|
const passedParams = [];
|
||||||
const options = {};
|
const options = {};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
await upgradeCommandRunner.run(passedParams, options);
|
await upgradeCommandRunner.run(passedParams, options);
|
||||||
|
|
||||||
const { fail: failReport, success: successReport } =
|
const { fail: failReport, success: successReport } =
|
||||||
@ -239,9 +241,11 @@ describe('UpgradeCommandRunner', () => {
|
|||||||
workspaces: failingWorkspaces,
|
workspaces: failingWorkspaces,
|
||||||
appVersion,
|
appVersion,
|
||||||
});
|
});
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const passedParams = [];
|
const passedParams = [];
|
||||||
const options = {};
|
const options = {};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
await upgradeCommandRunner.run(passedParams, options);
|
await upgradeCommandRunner.run(passedParams, options);
|
||||||
|
|
||||||
// Common assertions
|
// Common assertions
|
||||||
@ -287,9 +291,11 @@ describe('UpgradeCommandRunner', () => {
|
|||||||
numberOfWorkspace,
|
numberOfWorkspace,
|
||||||
appVersion,
|
appVersion,
|
||||||
});
|
});
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const passedParams = [];
|
const passedParams = [];
|
||||||
const options = {};
|
const options = {};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
await upgradeCommandRunner.run(passedParams, options);
|
await upgradeCommandRunner.run(passedParams, options);
|
||||||
|
|
||||||
[
|
[
|
||||||
@ -310,9 +316,11 @@ describe('UpgradeCommandRunner', () => {
|
|||||||
|
|
||||||
it('should run syncMetadataCommand betweensuccessful beforeSyncMetadataUpgradeCommandsToRun and afterSyncMetadataUpgradeCommandsToRun', async () => {
|
it('should run syncMetadataCommand betweensuccessful beforeSyncMetadataUpgradeCommandsToRun and afterSyncMetadataUpgradeCommandsToRun', async () => {
|
||||||
await buildModuleAndSetupSpies({});
|
await buildModuleAndSetupSpies({});
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const passedParams = [];
|
const passedParams = [];
|
||||||
const options = {};
|
const options = {};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
await upgradeCommandRunner.run(passedParams, options);
|
await upgradeCommandRunner.run(passedParams, options);
|
||||||
|
|
||||||
[
|
[
|
||||||
@ -380,9 +388,11 @@ describe('UpgradeCommandRunner', () => {
|
|||||||
async ({ context: { input } }) => {
|
async ({ context: { input } }) => {
|
||||||
await buildModuleAndSetupSpies(input);
|
await buildModuleAndSetupSpies(input);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const passedParams = [];
|
const passedParams = [];
|
||||||
const options = {};
|
const options = {};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
await upgradeCommandRunner.run(passedParams, options);
|
await upgradeCommandRunner.run(passedParams, options);
|
||||||
|
|
||||||
const { fail: failReport, success: successReport } =
|
const { fail: failReport, success: successReport } =
|
||||||
@ -461,9 +471,11 @@ describe('UpgradeCommandRunner', () => {
|
|||||||
it.each(failingTestUseCases)('$title', async ({ context: { input } }) => {
|
it.each(failingTestUseCases)('$title', async ({ context: { input } }) => {
|
||||||
await buildModuleAndSetupSpies(input);
|
await buildModuleAndSetupSpies(input);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const passedParams = [];
|
const passedParams = [];
|
||||||
const options = {};
|
const options = {};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
await upgradeCommandRunner.run(passedParams, options);
|
await upgradeCommandRunner.run(passedParams, options);
|
||||||
|
|
||||||
const { fail: failReport, success: successReport } =
|
const { fail: failReport, success: successReport } =
|
||||||
|
|||||||
@ -8,6 +8,7 @@ interface CommandLoggerOptions {
|
|||||||
export const isCommandLogger = (
|
export const isCommandLogger = (
|
||||||
logger: Logger | CommandLogger,
|
logger: Logger | CommandLogger,
|
||||||
): logger is CommandLogger => {
|
): logger is CommandLogger => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return typeof logger['setVerbose'] === 'function';
|
return typeof logger['setVerbose'] === 'function';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -64,9 +64,11 @@ export class AddTasksAssignedToMeViewCommand extends ActiveOrSuspendedWorkspaces
|
|||||||
});
|
});
|
||||||
|
|
||||||
const objectMetadataMap = objectMetadata.reduce((acc, object) => {
|
const objectMetadataMap = objectMetadata.reduce((acc, object) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[object.standardId ?? ''] = {
|
acc[object.standardId ?? ''] = {
|
||||||
id: object.id,
|
id: object.id,
|
||||||
fields: object.fields.reduce((acc, field) => {
|
fields: object.fields.reduce((acc, field) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[field.standardId ?? ''] = field.id;
|
acc[field.standardId ?? ''] = field.id;
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
|
|||||||
@ -59,6 +59,7 @@ export class CopyTypeormMigrationsCommand extends ActiveOrSuspendedWorkspacesMig
|
|||||||
);
|
);
|
||||||
|
|
||||||
const existingMigrationNames = new Set(
|
const existingMigrationNames = new Set(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
existingCoreMigrations.map((migration) => migration.name),
|
existingCoreMigrations.map((migration) => migration.name),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -300,11 +300,13 @@ export const objectMetadataMapItemMock = {
|
|||||||
namePlural: 'objectsName',
|
namePlural: 'objectsName',
|
||||||
fields,
|
fields,
|
||||||
fieldsById: fields.reduce((acc, field) => {
|
fieldsById: fields.reduce((acc, field) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[field.id] = field;
|
acc[field.id] = field;
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
}, {}),
|
}, {}),
|
||||||
fieldsByName: fields.reduce((acc, field) => {
|
fieldsByName: fields.reduce((acc, field) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[field.name] = field;
|
acc[field.name] = field;
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
|
|||||||
@ -117,6 +117,7 @@ export abstract class GraphqlQueryBaseResolverService<
|
|||||||
const computedArgs = (await this.queryRunnerArgsFactory.create(
|
const computedArgs = (await this.queryRunnerArgsFactory.create(
|
||||||
hookedArgs,
|
hookedArgs,
|
||||||
options,
|
options,
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
ResolverArgsType[capitalize(operationName)],
|
ResolverArgsType[capitalize(operationName)],
|
||||||
)) as Input;
|
)) as Input;
|
||||||
|
|
||||||
@ -195,6 +196,7 @@ export abstract class GraphqlQueryBaseResolverService<
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
const permissionRequired: SettingPermissionType =
|
const permissionRequired: SettingPermissionType =
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
SYSTEM_OBJECTS_PERMISSIONS_REQUIREMENTS[
|
SYSTEM_OBJECTS_PERMISSIONS_REQUIREMENTS[
|
||||||
objectMetadataItemWithFieldMaps.nameSingular
|
objectMetadataItemWithFieldMaps.nameSingular
|
||||||
];
|
];
|
||||||
|
|||||||
@ -209,6 +209,7 @@ export class GraphqlQueryCreateManyResolverService extends GraphqlQueryBaseResol
|
|||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
||||||
if (fieldValues.length > 0) {
|
if (fieldValues.length > 0) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
whereConditions[field.column] = In(fieldValues);
|
whereConditions[field.column] = In(fieldValues);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,6 +52,7 @@ export class ApiEventEmitterService {
|
|||||||
objectMetadataNameSingular: objectMetadataItem.nameSingular,
|
objectMetadataNameSingular: objectMetadataItem.nameSingular,
|
||||||
action: DatabaseEventAction.UPDATED,
|
action: DatabaseEventAction.UPDATED,
|
||||||
events: records.map((record) => {
|
events: records.map((record) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const before = mappedExistingRecords[record.id];
|
const before = mappedExistingRecords[record.id];
|
||||||
const after = record;
|
const after = record;
|
||||||
const diff = objectRecordChangedValues(
|
const diff = objectRecordChangedValues(
|
||||||
|
|||||||
@ -10,6 +10,7 @@ export class ScalarsExplorerService {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.scalarImplementations = scalars.reduce((acc, scalar) => {
|
this.scalarImplementations = scalars.reduce((acc, scalar) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[scalar.name] = scalar;
|
acc[scalar.name] = scalar;
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
|
|||||||
@ -44,6 +44,7 @@ const findFieldNode = (
|
|||||||
return field;
|
return field;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const parseValueNode = (
|
const parseValueNode = (
|
||||||
valueNode: ValueNode,
|
valueNode: ValueNode,
|
||||||
variables: GraphQLResolveInfo['variableValues'],
|
variables: GraphQLResolveInfo['variableValues'],
|
||||||
@ -62,6 +63,7 @@ const parseValueNode = (
|
|||||||
return valueNode.values.map((value) => parseValueNode(value, variables));
|
return valueNode.values.map((value) => parseValueNode(value, variables));
|
||||||
case Kind.OBJECT:
|
case Kind.OBJECT:
|
||||||
return valueNode.fields.reduce((obj, field) => {
|
return valueNode.fields.reduce((obj, field) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
obj[field.name.value] = parseValueNode(field.value, variables);
|
obj[field.name.value] = parseValueNode(field.value, variables);
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
|||||||
@ -260,12 +260,15 @@ export class QueryRunnerArgsFactory {
|
|||||||
const overrideFilter = (filterObject: ObjectRecordFilter) => {
|
const overrideFilter = (filterObject: ObjectRecordFilter) => {
|
||||||
return Object.entries(filterObject).reduce((acc, [key, value]) => {
|
return Object.entries(filterObject).reduce((acc, [key, value]) => {
|
||||||
if (key === 'and' || key === 'or') {
|
if (key === 'and' || key === 'or') {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[key] = value.map((nestedFilter: ObjectRecordFilter) =>
|
acc[key] = value.map((nestedFilter: ObjectRecordFilter) =>
|
||||||
overrideFilter(nestedFilter),
|
overrideFilter(nestedFilter),
|
||||||
);
|
);
|
||||||
} else if (key === 'not') {
|
} else if (key === 'not') {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[key] = overrideFilter(value);
|
acc[key] = overrideFilter(value);
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[key] = this.transformFilterValueByType(
|
acc[key] = this.transformFilterValueByType(
|
||||||
key,
|
key,
|
||||||
value,
|
value,
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import {
|
|||||||
} from 'src/engine/api/graphql/workspace-query-runner/utils/parse-result.util';
|
} from 'src/engine/api/graphql/workspace-query-runner/utils/parse-result.util';
|
||||||
|
|
||||||
describe('handleSpecialKey', () => {
|
describe('handleSpecialKey', () => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
let result;
|
let result;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@ -13,10 +14,12 @@ describe('handleSpecialKey', () => {
|
|||||||
|
|
||||||
test('should correctly process a composite key and add it to the result object', () => {
|
test('should correctly process a composite key and add it to the result object', () => {
|
||||||
handleCompositeKey(
|
handleCompositeKey(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
result,
|
result,
|
||||||
createCompositeFieldKey('complexField', 'link'),
|
createCompositeFieldKey('complexField', 'link'),
|
||||||
'value1',
|
'value1',
|
||||||
);
|
);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
complexField: {
|
complexField: {
|
||||||
link: 'value1',
|
link: 'value1',
|
||||||
@ -26,15 +29,18 @@ describe('handleSpecialKey', () => {
|
|||||||
|
|
||||||
test('should add values under the same newKey if called multiple times', () => {
|
test('should add values under the same newKey if called multiple times', () => {
|
||||||
handleCompositeKey(
|
handleCompositeKey(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
result,
|
result,
|
||||||
createCompositeFieldKey('complexField', 'link'),
|
createCompositeFieldKey('complexField', 'link'),
|
||||||
'value1',
|
'value1',
|
||||||
);
|
);
|
||||||
handleCompositeKey(
|
handleCompositeKey(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
result,
|
result,
|
||||||
createCompositeFieldKey('complexField', 'text'),
|
createCompositeFieldKey('complexField', 'text'),
|
||||||
'value2',
|
'value2',
|
||||||
);
|
);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
complexField: {
|
complexField: {
|
||||||
link: 'value1',
|
link: 'value1',
|
||||||
@ -44,7 +50,9 @@ describe('handleSpecialKey', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should not create a new field if the composite key is not correctly formed', () => {
|
test('should not create a new field if the composite key is not correctly formed', () => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
handleCompositeKey(result, 'COMPOSITE___complexField', 'value1');
|
handleCompositeKey(result, 'COMPOSITE___complexField', 'value1');
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
expect(result).toEqual({});
|
expect(result).toEqual({});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -35,6 +35,7 @@ const pgGraphQLErrorMapping: PgGraphQLErrorMapping = {
|
|||||||
'duplicate key value violates unique constraint': (command, objectName, _) =>
|
'duplicate key value violates unique constraint': (command, objectName, _) =>
|
||||||
new WorkspaceQueryRunnerException(
|
new WorkspaceQueryRunnerException(
|
||||||
`Cannot ${
|
`Cannot ${
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
pgGraphQLCommandMapping[command] ?? command
|
pgGraphQLCommandMapping[command] ?? command
|
||||||
} ${objectName} because it violates a uniqueness constraint.`,
|
} ${objectName} because it violates a uniqueness constraint.`,
|
||||||
WorkspaceQueryRunnerExceptionCode.QUERY_VIOLATES_UNIQUE_CONSTRAINT,
|
WorkspaceQueryRunnerExceptionCode.QUERY_VIOLATES_UNIQUE_CONSTRAINT,
|
||||||
@ -42,6 +43,7 @@ const pgGraphQLErrorMapping: PgGraphQLErrorMapping = {
|
|||||||
'violates foreign key constraint': (command, objectName, _) =>
|
'violates foreign key constraint': (command, objectName, _) =>
|
||||||
new WorkspaceQueryRunnerException(
|
new WorkspaceQueryRunnerException(
|
||||||
`Cannot ${
|
`Cannot ${
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
pgGraphQLCommandMapping[command] ?? command
|
pgGraphQLCommandMapping[command] ?? command
|
||||||
} ${objectName} because it violates a foreign key constraint.`,
|
} ${objectName} because it violates a foreign key constraint.`,
|
||||||
WorkspaceQueryRunnerExceptionCode.QUERY_VIOLATES_FOREIGN_KEY_CONSTRAINT,
|
WorkspaceQueryRunnerExceptionCode.QUERY_VIOLATES_FOREIGN_KEY_CONSTRAINT,
|
||||||
|
|||||||
@ -110,11 +110,13 @@ export class WorkspaceQueryHookExplorer implements OnModuleInit {
|
|||||||
contextId,
|
contextId,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return contextInstance[methodName].call(
|
return contextInstance[methodName].call(
|
||||||
contextInstance,
|
contextInstance,
|
||||||
...executeParams,
|
...executeParams,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return instance[methodName].call(instance, ...executeParams);
|
return instance[methodName].call(instance, ...executeParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -173,6 +175,7 @@ export class WorkspaceQueryHookExplorer implements OnModuleInit {
|
|||||||
contextId,
|
contextId,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return contextInstance[methodName].call(
|
return contextInstance[methodName].call(
|
||||||
contextInstance,
|
contextInstance,
|
||||||
executeParams[0],
|
executeParams[0],
|
||||||
@ -180,6 +183,7 @@ export class WorkspaceQueryHookExplorer implements OnModuleInit {
|
|||||||
transformedPayload,
|
transformedPayload,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return instance[methodName].call(
|
return instance[methodName].call(
|
||||||
instance,
|
instance,
|
||||||
executeParams[0],
|
executeParams[0],
|
||||||
|
|||||||
@ -97,6 +97,7 @@ export class WorkspaceResolverFactory {
|
|||||||
methodName,
|
methodName,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
resolvers.Query[resolverName] = resolverFactory.create({
|
resolvers.Query[resolverName] = resolverFactory.create({
|
||||||
authContext,
|
authContext,
|
||||||
objectMetadataMaps,
|
objectMetadataMaps,
|
||||||
@ -120,6 +121,7 @@ export class WorkspaceResolverFactory {
|
|||||||
throw new Error(`Unknown mutation resolver type: ${methodName}`);
|
throw new Error(`Unknown mutation resolver type: ${methodName}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
resolvers.Mutation[resolverName] = resolverFactory.create({
|
resolvers.Mutation[resolverName] = resolverFactory.create({
|
||||||
authContext,
|
authContext,
|
||||||
objectMetadataMaps,
|
objectMetadataMaps,
|
||||||
|
|||||||
@ -37,6 +37,7 @@ export class InputTypeDefinitionFactory {
|
|||||||
kind: InputTypeDefinitionKind,
|
kind: InputTypeDefinitionKind,
|
||||||
options: WorkspaceBuildSchemaOptions,
|
options: WorkspaceBuildSchemaOptions,
|
||||||
): InputTypeDefinition {
|
): InputTypeDefinition {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const inputType = new GraphQLInputObjectType({
|
const inputType = new GraphQLInputObjectType({
|
||||||
name: `${pascalCase(objectMetadata.nameSingular)}${kind.toString()}Input`,
|
name: `${pascalCase(objectMetadata.nameSingular)}${kind.toString()}Input`,
|
||||||
description: objectMetadata.description,
|
description: objectMetadata.description,
|
||||||
@ -46,6 +47,7 @@ export class InputTypeDefinitionFactory {
|
|||||||
* Filter input type has additional fields for filtering and is self referencing
|
* Filter input type has additional fields for filtering and is self referencing
|
||||||
*/
|
*/
|
||||||
case InputTypeDefinitionKind.Filter: {
|
case InputTypeDefinitionKind.Filter: {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const andOrType = this.typeMapperService.mapToGqlType(inputType, {
|
const andOrType = this.typeMapperService.mapToGqlType(inputType, {
|
||||||
isArray: true,
|
isArray: true,
|
||||||
arrayDepth: 1,
|
arrayDepth: 1,
|
||||||
|
|||||||
@ -172,6 +172,7 @@ export class TypeDefinitionsGenerator {
|
|||||||
) {
|
) {
|
||||||
const objectTypeDefs = objectMetadataCollection.map((objectMetadata) =>
|
const objectTypeDefs = objectMetadataCollection.map((objectMetadata) =>
|
||||||
this.objectTypeDefinitionFactory.create(
|
this.objectTypeDefinitionFactory.create(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
objectMetadata,
|
objectMetadata,
|
||||||
ObjectTypeDefinitionKind.Plain,
|
ObjectTypeDefinitionKind.Plain,
|
||||||
options,
|
options,
|
||||||
|
|||||||
@ -104,12 +104,14 @@ export const generateFields = <
|
|||||||
throw new Error('Join column name is not defined');
|
throw new Error('Join column name is not defined');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
fields[joinColumnName] = {
|
fields[joinColumnName] = {
|
||||||
type,
|
type,
|
||||||
description: fieldMetadata.description,
|
description: fieldMetadata.description,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
fields[fieldMetadata.name] = {
|
fields[fieldMetadata.name] = {
|
||||||
type,
|
type,
|
||||||
description: fieldMetadata.description,
|
description: fieldMetadata.description,
|
||||||
|
|||||||
@ -42,8 +42,10 @@ export const parseFilter = (
|
|||||||
`'filter' invalid. 'not' conjunction should contain only 1 condition. eg: not(field[eq]:1)`,
|
`'filter' invalid. 'not' conjunction should contain only 1 condition. eg: not(field[eq]:1)`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
result[conjunction] = subResult[0];
|
result[conjunction] = subResult[0];
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
result[conjunction] = subResult;
|
result[conjunction] = subResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -69,11 +69,13 @@ export class OrderByInputFactory {
|
|||||||
if (Object.keys(fieldResult).length) {
|
if (Object.keys(fieldResult).length) {
|
||||||
fieldResult = { [field]: fieldResult };
|
fieldResult = { [field]: fieldResult };
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
fieldResult[field] = itemDirection;
|
fieldResult[field] = itemDirection;
|
||||||
}
|
}
|
||||||
}, itemDirection);
|
}, itemDirection);
|
||||||
|
|
||||||
const resultFields = Object.keys(fieldResult).map((key) => ({
|
const resultFields = Object.keys(fieldResult).map((key) => ({
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
[key]: fieldResult[key],
|
[key]: fieldResult[key],
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import { fetchMetadataFields } from 'src/engine/api/rest/metadata/query-builder/
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FindManyMetadataQueryFactory {
|
export class FindManyMetadataQueryFactory {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
create(objectNamePlural): string {
|
create(objectNamePlural): string {
|
||||||
const fields = fetchMetadataFields(objectNamePlural);
|
const fields = fetchMetadataFields(objectNamePlural);
|
||||||
|
|
||||||
|
|||||||
@ -16,15 +16,18 @@ export const cleanGraphQLResponse = (input: any) => {
|
|||||||
if (isObject(obj[key])) {
|
if (isObject(obj[key])) {
|
||||||
if (obj[key].edges) {
|
if (obj[key].edges) {
|
||||||
// Handle edges by mapping over them and applying cleanObject to each node
|
// Handle edges by mapping over them and applying cleanObject to each node
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
cleanedObj[key] = obj[key].edges.map((edge) =>
|
cleanedObj[key] = obj[key].edges.map((edge) =>
|
||||||
cleanObject(edge.node),
|
cleanObject(edge.node),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Recursively clean nested objects
|
// Recursively clean nested objects
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
cleanedObj[key] = cleanObject(obj[key]);
|
cleanedObj[key] = cleanObject(obj[key]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Directly assign non-object properties
|
// Directly assign non-object properties
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
cleanedObj[key] = obj[key];
|
cleanedObj[key] = obj[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -35,22 +38,29 @@ export const cleanGraphQLResponse = (input: any) => {
|
|||||||
Object.keys(input).forEach((key) => {
|
Object.keys(input).forEach((key) => {
|
||||||
if (isObject(input[key]) && input[key].edges) {
|
if (isObject(input[key]) && input[key].edges) {
|
||||||
// Handle collections with edges, ensuring data is placed under the data key
|
// Handle collections with edges, ensuring data is placed under the data key
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
output.data[key] = input[key].edges.map((edge) => cleanObject(edge.node));
|
output.data[key] = input[key].edges.map((edge) => cleanObject(edge.node));
|
||||||
// Move pageInfo and totalCount to the top level
|
// Move pageInfo and totalCount to the top level
|
||||||
if (input[key].pageInfo) {
|
if (input[key].pageInfo) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
output['pageInfo'] = input[key].pageInfo;
|
output['pageInfo'] = input[key].pageInfo;
|
||||||
}
|
}
|
||||||
if (input[key].totalCount) {
|
if (input[key].totalCount) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
output['totalCount'] = input[key].totalCount;
|
output['totalCount'] = input[key].totalCount;
|
||||||
}
|
}
|
||||||
} else if (isObject(input[key])) {
|
} else if (isObject(input[key])) {
|
||||||
// Recursively clean and assign nested objects under the data key
|
// Recursively clean and assign nested objects under the data key
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
output.data[key] = cleanObject(input[key]);
|
output.data[key] = cleanObject(input[key]);
|
||||||
} else if (Array.isArray(input[key])) {
|
} else if (Array.isArray(input[key])) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const itemsWithEdges = input[key].filter((item) => item.edges);
|
const itemsWithEdges = input[key].filter((item) => item.edges);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const cleanedObjArray = itemsWithEdges.map(({ edges, ...item }) => {
|
const cleanedObjArray = itemsWithEdges.map(({ edges, ...item }) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
[key]: edges.map((edge) => cleanObject(edge.node)),
|
[key]: edges.map((edge) => cleanObject(edge.node)),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -58,6 +68,7 @@ export const cleanGraphQLResponse = (input: any) => {
|
|||||||
output.data = cleanedObjArray;
|
output.data = cleanedObjArray;
|
||||||
} else {
|
} else {
|
||||||
// Assign all other properties directly under the data key
|
// Assign all other properties directly under the data key
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
output.data[key] = input[key];
|
output.data[key] = input[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -47,11 +47,14 @@ export const buildDuplicateConditions = (
|
|||||||
compositeFieldMetadataMap.get(columnName);
|
compositeFieldMetadataMap.get(columnName);
|
||||||
|
|
||||||
if (compositeFieldMetadata) {
|
if (compositeFieldMetadata) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
condition[compositeFieldMetadata.parentField] = {
|
condition[compositeFieldMetadata.parentField] = {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
...condition[compositeFieldMetadata.parentField],
|
...condition[compositeFieldMetadata.parentField],
|
||||||
[compositeFieldMetadata.name]: { eq: record[columnName] },
|
[compositeFieldMetadata.name]: { eq: record[columnName] },
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
condition[columnName] = { eq: record[columnName] };
|
condition[columnName] = { eq: record[columnName] };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -127,6 +127,7 @@ export class AdminPanelHealthService {
|
|||||||
if (indicatorId === HealthIndicatorId.worker) {
|
if (indicatorId === HealthIndicatorId.worker) {
|
||||||
return {
|
return {
|
||||||
...indicatorStatus,
|
...indicatorStatus,
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
queues: (indicatorStatus?.queues ?? []).map((queue) => ({
|
queues: (indicatorStatus?.queues ?? []).map((queue) => ({
|
||||||
id: `${indicatorId}-${queue.queueName}`,
|
id: `${indicatorId}-${queue.queueName}`,
|
||||||
queueName: queue.queueName,
|
queueName: queue.queueName,
|
||||||
|
|||||||
@ -201,14 +201,18 @@ export class AdminPanelService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const versions = response.data.results
|
const versions = response.data.results
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
.filter((tag) => tag && tag.name !== 'latest')
|
.filter((tag) => tag && tag.name !== 'latest')
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
.map((tag) => semver.coerce(tag.name)?.version)
|
.map((tag) => semver.coerce(tag.name)?.version)
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
.filter((version) => version !== undefined);
|
.filter((version) => version !== undefined);
|
||||||
|
|
||||||
if (versions.length === 0) {
|
if (versions.length === 0) {
|
||||||
return { currentVersion, latestVersion: 'latest' };
|
return { currentVersion, latestVersion: 'latest' };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
versions.sort((a, b) => semver.compare(b, a));
|
versions.sort((a, b) => semver.compare(b, a));
|
||||||
const latestVersion = versions[0];
|
const latestVersion = versions[0];
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@ export class JwtAuthStrategy extends PassportStrategy(Strategy, 'jwt') {
|
|||||||
private readonly userWorkspaceRepository: Repository<UserWorkspace>,
|
private readonly userWorkspaceRepository: Repository<UserWorkspace>,
|
||||||
) {
|
) {
|
||||||
const jwtFromRequestFunction = jwtWrapperService.extractJwtFromRequest();
|
const jwtFromRequestFunction = jwtWrapperService.extractJwtFromRequest();
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const secretOrKeyProviderFunction = async (_request, rawJwtToken, done) => {
|
const secretOrKeyProviderFunction = async (_request, rawJwtToken, done) => {
|
||||||
try {
|
try {
|
||||||
const decodedToken = jwtWrapperService.decode(
|
const decodedToken = jwtWrapperService.decode(
|
||||||
|
|||||||
@ -24,6 +24,7 @@ export const transformStripeSubscriptionEventToDatabaseSubscription = (
|
|||||||
currentPeriodStart: getDateFromTimestamp(data.object.current_period_start),
|
currentPeriodStart: getDateFromTimestamp(data.object.current_period_start),
|
||||||
metadata: data.object.metadata,
|
metadata: data.object.metadata,
|
||||||
collectionMethod:
|
collectionMethod:
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
BillingSubscriptionCollectionMethod[
|
BillingSubscriptionCollectionMethod[
|
||||||
data.object.collection_method.toUpperCase()
|
data.object.collection_method.toUpperCase()
|
||||||
],
|
],
|
||||||
|
|||||||
@ -21,8 +21,10 @@ export class CloudflareSecretMatchGuard implements CanActivate {
|
|||||||
if (
|
if (
|
||||||
!cloudflareWebhookSecret ||
|
!cloudflareWebhookSecret ||
|
||||||
(cloudflareWebhookSecret &&
|
(cloudflareWebhookSecret &&
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
(typeof request.headers['cf-webhook-auth'] === 'string' ||
|
(typeof request.headers['cf-webhook-auth'] === 'string' ||
|
||||||
timingSafeEqual(
|
timingSafeEqual(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
Buffer.from(request.headers['cf-webhook-auth']),
|
Buffer.from(request.headers['cf-webhook-auth']),
|
||||||
Buffer.from(cloudflareWebhookSecret),
|
Buffer.from(cloudflareWebhookSecret),
|
||||||
)))
|
)))
|
||||||
|
|||||||
@ -18,6 +18,7 @@ describe('DomainManagerService', () => {
|
|||||||
FRONTEND_URL: 'https://example.com',
|
FRONTEND_URL: 'https://example.com',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return env[key];
|
return env[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -42,6 +43,7 @@ describe('DomainManagerService', () => {
|
|||||||
IS_MULTIWORKSPACE_ENABLED: true,
|
IS_MULTIWORKSPACE_ENABLED: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return env[key];
|
return env[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -91,6 +93,7 @@ describe('DomainManagerService', () => {
|
|||||||
FRONTEND_URL: 'https://example.com',
|
FRONTEND_URL: 'https://example.com',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return env[key];
|
return env[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -109,6 +112,7 @@ describe('DomainManagerService', () => {
|
|||||||
DEFAULT_SUBDOMAIN: 'test',
|
DEFAULT_SUBDOMAIN: 'test',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return env[key];
|
return env[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -129,6 +133,7 @@ describe('DomainManagerService', () => {
|
|||||||
DEFAULT_SUBDOMAIN: 'default',
|
DEFAULT_SUBDOMAIN: 'default',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return env[key];
|
return env[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -151,6 +156,7 @@ describe('DomainManagerService', () => {
|
|||||||
FRONTEND_URL: 'https://example.com',
|
FRONTEND_URL: 'https://example.com',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return env[key];
|
return env[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -174,6 +180,7 @@ describe('DomainManagerService', () => {
|
|||||||
FRONTEND_URL: 'https://example.com',
|
FRONTEND_URL: 'https://example.com',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return env[key];
|
return env[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ export const objectRecordChangedProperties = <
|
|||||||
newRecord: PRecord,
|
newRecord: PRecord,
|
||||||
) => {
|
) => {
|
||||||
const changedProperties = Object.keys(newRecord).filter(
|
const changedProperties = Object.keys(newRecord).filter(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
(key) => !deepEqual(oldRecord[key], newRecord[key]),
|
(key) => !deepEqual(oldRecord[key], newRecord[key]),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ export const useSentryTracing = <
|
|||||||
onExecute({ args }) {
|
onExecute({ args }) {
|
||||||
const transactionName = args.operationName || 'Anonymous Operation';
|
const transactionName = args.operationName || 'Anonymous Operation';
|
||||||
const rootOperation = args.document.definitions.find(
|
const rootOperation = args.document.definitions.find(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
(o) => o.kind === Kind.OPERATION_DEFINITION,
|
(o) => o.kind === Kind.OPERATION_DEFINITION,
|
||||||
) as OperationDefinitionNode;
|
) as OperationDefinitionNode;
|
||||||
const operationType = rootOperation.operation;
|
const operationType = rootOperation.operation;
|
||||||
|
|||||||
@ -212,6 +212,7 @@ describe('FeatureFlagService', () => {
|
|||||||
// Assert
|
// Assert
|
||||||
expect(result).toEqual(mockFeatureFlag);
|
expect(result).toEqual(mockFeatureFlag);
|
||||||
expect(mockFeatureFlagRepository.save).toHaveBeenCalledWith({
|
expect(mockFeatureFlagRepository.save).toHaveBeenCalledWith({
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
key: FeatureFlagKey[featureFlag],
|
key: FeatureFlagKey[featureFlag],
|
||||||
value,
|
value,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
|
|||||||
@ -99,6 +99,7 @@ export class FeatureFlagService {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const featureFlagKey = FeatureFlagKey[featureFlag];
|
const featureFlagKey = FeatureFlagKey[featureFlag];
|
||||||
|
|
||||||
if (shouldBePublic) {
|
if (shouldBePublic) {
|
||||||
|
|||||||
@ -7,6 +7,7 @@ const assertIsFeatureFlagKey = (
|
|||||||
featureFlagKey: string,
|
featureFlagKey: string,
|
||||||
exceptionToThrow: CustomException,
|
exceptionToThrow: CustomException,
|
||||||
): asserts featureFlagKey is FeatureFlagKey => {
|
): asserts featureFlagKey is FeatureFlagKey => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
if (isDefined(FeatureFlagKey[featureFlagKey])) return;
|
if (isDefined(FeatureFlagKey[featureFlagKey])) return;
|
||||||
throw exceptionToThrow;
|
throw exceptionToThrow;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -67,6 +67,7 @@ export class S3Driver implements StorageDriver {
|
|||||||
await this.s3Client.send(command);
|
await this.s3Client.send(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
private async emptyS3Directory(folderPath) {
|
private async emptyS3Directory(folderPath) {
|
||||||
const listParams = {
|
const listParams = {
|
||||||
Bucket: this.bucketName,
|
Bucket: this.bucketName,
|
||||||
|
|||||||
@ -40,6 +40,7 @@ export class FileController {
|
|||||||
@Req() req: Request,
|
@Req() req: Request,
|
||||||
) {
|
) {
|
||||||
const folderPath = checkFilePath(params[0]);
|
const folderPath = checkFilePath(params[0]);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const filename = checkFilename(params['filename']);
|
const filename = checkFilename(params['filename']);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
|||||||
@ -26,6 +26,7 @@ export const checkFilePath = (filePath: string): string => {
|
|||||||
if (
|
if (
|
||||||
folder !== kebabCase(FileFolder.ServerlessFunction) &&
|
folder !== kebabCase(FileFolder.ServerlessFunction) &&
|
||||||
size &&
|
size &&
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
!settings.storage.imageCropSizes[folder]?.includes(size)
|
!settings.storage.imageCropSizes[folder]?.includes(size)
|
||||||
) {
|
) {
|
||||||
throw new BadRequestException(`Size ${size} is not allowed`);
|
throw new BadRequestException(`Size ${size} is not allowed`);
|
||||||
|
|||||||
@ -54,6 +54,7 @@ export const useGraphQLErrorHandlerHook = <
|
|||||||
async onExecute({ args }) {
|
async onExecute({ args }) {
|
||||||
const exceptionHandlerService = options.exceptionHandlerService;
|
const exceptionHandlerService = options.exceptionHandlerService;
|
||||||
const rootOperation = args.document.definitions.find(
|
const rootOperation = args.document.definitions.find(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
(o) => o.kind === Kind.OPERATION_DEFINITION,
|
(o) => o.kind === Kind.OPERATION_DEFINITION,
|
||||||
) as OperationDefinitionNode;
|
) as OperationDefinitionNode;
|
||||||
|
|
||||||
|
|||||||
@ -75,6 +75,7 @@ export class KeyValuePairService<
|
|||||||
const conflictPaths = Object.keys(upsertData).filter(
|
const conflictPaths = Object.keys(upsertData).filter(
|
||||||
(key) =>
|
(key) =>
|
||||||
['userId', 'workspaceId', 'key'].includes(key) &&
|
['userId', 'workspaceId', 'key'].includes(key) &&
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
upsertData[key] !== undefined,
|
upsertData[key] !== undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -14,11 +14,13 @@ export interface MessageQueueDriver {
|
|||||||
data: T,
|
data: T,
|
||||||
options?: QueueJobOptions,
|
options?: QueueJobOptions,
|
||||||
): Promise<void>;
|
): Promise<void>;
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
work<T extends MessageQueueJobData>(
|
work<T extends MessageQueueJobData>(
|
||||||
queueName: MessageQueue,
|
queueName: MessageQueue,
|
||||||
handler: ({ data, id }: { data: T; id: string }) => Promise<void> | void,
|
handler: ({ data, id }: { data: T; id: string }) => Promise<void> | void,
|
||||||
options?: MessageQueueWorkerOptions,
|
options?: MessageQueueWorkerOptions,
|
||||||
);
|
);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
addCron<T extends MessageQueueJobData | undefined>({
|
addCron<T extends MessageQueueJobData | undefined>({
|
||||||
queueName,
|
queueName,
|
||||||
jobName,
|
jobName,
|
||||||
@ -32,6 +34,7 @@ export interface MessageQueueDriver {
|
|||||||
options: QueueCronJobOptions;
|
options: QueueCronJobOptions;
|
||||||
jobId?: string;
|
jobId?: string;
|
||||||
});
|
});
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
removeCron({
|
removeCron({
|
||||||
queueName,
|
queueName,
|
||||||
jobName,
|
jobName,
|
||||||
|
|||||||
@ -148,6 +148,7 @@ export class MessageQueueExplorer implements OnModuleInit {
|
|||||||
const filteredProcessMethodNames = processMethodNames.filter(
|
const filteredProcessMethodNames = processMethodNames.filter(
|
||||||
(processMethodName) => {
|
(processMethodName) => {
|
||||||
const metadata = this.metadataAccessor.getProcessMetadata(
|
const metadata = this.metadataAccessor.getProcessMetadata(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
instance[processMethodName],
|
instance[processMethodName],
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -203,6 +204,7 @@ export class MessageQueueExplorer implements OnModuleInit {
|
|||||||
) {
|
) {
|
||||||
for (const processMethodName of processMethodNames) {
|
for (const processMethodName of processMethodNames) {
|
||||||
try {
|
try {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
await instance[processMethodName].call(instance, job.data);
|
await instance[processMethodName].call(instance, job.data);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!shouldFilterException(err)) {
|
if (!shouldFilterException(err)) {
|
||||||
|
|||||||
@ -156,9 +156,12 @@ export class TimelineMessagingService {
|
|||||||
if (!threadParticipant.message.messageThreadId)
|
if (!threadParticipant.message.messageThreadId)
|
||||||
return threadParticipantsAcc;
|
return threadParticipantsAcc;
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
if (!threadParticipantsAcc[threadParticipant.message.messageThreadId])
|
if (!threadParticipantsAcc[threadParticipant.message.messageThreadId])
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
threadParticipantsAcc[threadParticipant.message.messageThreadId] = [];
|
threadParticipantsAcc[threadParticipant.message.messageThreadId] = [];
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
threadParticipantsAcc[threadParticipant.message.messageThreadId].push(
|
threadParticipantsAcc[threadParticipant.message.messageThreadId].push(
|
||||||
threadParticipant,
|
threadParticipant,
|
||||||
);
|
);
|
||||||
@ -248,6 +251,7 @@ export class TimelineMessagingService {
|
|||||||
[key: string]: MessageChannelVisibility;
|
[key: string]: MessageChannelVisibility;
|
||||||
} = messageThreadIds.reduce((threadVisibilityAcc, messageThreadId) => {
|
} = messageThreadIds.reduce((threadVisibilityAcc, messageThreadId) => {
|
||||||
// If the workspace member is not the owner of the thread, use the visibility value from the query
|
// If the workspace member is not the owner of the thread, use the visibility value from the query
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
threadVisibilityAcc[messageThreadId] =
|
threadVisibilityAcc[messageThreadId] =
|
||||||
threadIdsWithoutWorkspaceMember.includes(messageThreadId)
|
threadIdsWithoutWorkspaceMember.includes(messageThreadId)
|
||||||
? (threadVisibilityByThreadIdForWhichWorkspaceMemberIsNotOwner?.[
|
? (threadVisibilityByThreadIdForWhichWorkspaceMemberIsNotOwner?.[
|
||||||
|
|||||||
@ -258,7 +258,9 @@ export class SearchService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
(STANDARD_OBJECTS_BY_PRIORITY_RANK[b.objectNameSingular] || 0) -
|
(STANDARD_OBJECTS_BY_PRIORITY_RANK[b.objectNameSingular] || 0) -
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
(STANDARD_OBJECTS_BY_PRIORITY_RANK[a.objectNameSingular] || 0)
|
(STANDARD_OBJECTS_BY_PRIORITY_RANK[a.objectNameSingular] || 0)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { pipeline } from 'stream/promises';
|
import { pipeline } from 'stream/promises';
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
import archiver from 'archiver';
|
import archiver from 'archiver';
|
||||||
|
|
||||||
export const createZipFile = async (
|
export const createZipFile = async (
|
||||||
|
|||||||
@ -15,6 +15,7 @@ export class ConsoleListener {
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
intercept(callback: (type: string, message: any[]) => void) {
|
intercept(callback: (type: string, message: any[]) => void) {
|
||||||
Object.keys(this.originalConsole).forEach((method) => {
|
Object.keys(this.originalConsole).forEach((method) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
console[method] = (...args: any[]) => {
|
console[method] = (...args: any[]) => {
|
||||||
callback(method, args);
|
callback(method, args);
|
||||||
@ -24,8 +25,10 @@ export class ConsoleListener {
|
|||||||
|
|
||||||
release() {
|
release() {
|
||||||
Object.keys(this.originalConsole).forEach((method) => {
|
Object.keys(this.originalConsole).forEach((method) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
console[method] = (...args: any[]) => {
|
console[method] = (...args: any[]) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
this.originalConsole[method](...args);
|
this.originalConsole[method](...args);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@ -3,8 +3,7 @@ import { Transform } from 'class-transformer';
|
|||||||
export const CastToPositiveNumber = () =>
|
export const CastToPositiveNumber = () =>
|
||||||
Transform(({ value }: { value: string }) => toNumber(value));
|
Transform(({ value }: { value: string }) => toNumber(value));
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
const toNumber = (value: unknown): number | undefined => {
|
||||||
const toNumber = (value: any) => {
|
|
||||||
if (typeof value === 'number') {
|
if (typeof value === 'number') {
|
||||||
return value >= 0 ? value : undefined;
|
return value >= 0 ? value : undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -382,6 +382,7 @@ describe('TwentyConfigService', () => {
|
|||||||
SENSITIVE_VAR: 'sensitive_data_123',
|
SENSITIVE_VAR: 'sensitive_data_123',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return values[keyStr] || undefined;
|
return values[keyStr] || undefined;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -390,6 +391,7 @@ describe('TwentyConfigService', () => {
|
|||||||
.mockImplementation((key: keyof ConfigVariables) => {
|
.mockImplementation((key: keyof ConfigVariables) => {
|
||||||
const keyStr = String(key);
|
const keyStr = String(key);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
if (mockConfigVarMetadata[keyStr]?.isEnvOnly) {
|
if (mockConfigVarMetadata[keyStr]?.isEnvOnly) {
|
||||||
return environmentConfigDriver.get(key);
|
return environmentConfigDriver.get(key);
|
||||||
}
|
}
|
||||||
@ -398,6 +400,7 @@ describe('TwentyConfigService', () => {
|
|||||||
SENSITIVE_VAR: 'sensitive_data_123',
|
SENSITIVE_VAR: 'sensitive_data_123',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return values[keyStr] || undefined;
|
return values[keyStr] || undefined;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -64,12 +64,14 @@ describe('applyBasicValidators', () => {
|
|||||||
const mockTransformParams = { value: 'true' };
|
const mockTransformParams = { value: 'true' };
|
||||||
|
|
||||||
(configTransformers.boolean as jest.Mock).mockReturnValueOnce(true);
|
(configTransformers.boolean as jest.Mock).mockReturnValueOnce(true);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const result1 = transformFn(mockTransformParams);
|
const result1 = transformFn(mockTransformParams);
|
||||||
|
|
||||||
expect(configTransformers.boolean).toHaveBeenCalledWith('true');
|
expect(configTransformers.boolean).toHaveBeenCalledWith('true');
|
||||||
expect(result1).toBe(true);
|
expect(result1).toBe(true);
|
||||||
|
|
||||||
(configTransformers.boolean as jest.Mock).mockReturnValueOnce(undefined);
|
(configTransformers.boolean as jest.Mock).mockReturnValueOnce(undefined);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const result2 = transformFn(mockTransformParams);
|
const result2 = transformFn(mockTransformParams);
|
||||||
|
|
||||||
expect(result2).toBe('true');
|
expect(result2).toBe('true');
|
||||||
@ -99,12 +101,14 @@ describe('applyBasicValidators', () => {
|
|||||||
const mockTransformParams = { value: '42' };
|
const mockTransformParams = { value: '42' };
|
||||||
|
|
||||||
(configTransformers.number as jest.Mock).mockReturnValueOnce(42);
|
(configTransformers.number as jest.Mock).mockReturnValueOnce(42);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const result1 = transformFn(mockTransformParams);
|
const result1 = transformFn(mockTransformParams);
|
||||||
|
|
||||||
expect(configTransformers.number).toHaveBeenCalledWith('42');
|
expect(configTransformers.number).toHaveBeenCalledWith('42');
|
||||||
expect(result1).toBe(42);
|
expect(result1).toBe(42);
|
||||||
|
|
||||||
(configTransformers.number as jest.Mock).mockReturnValueOnce(undefined);
|
(configTransformers.number as jest.Mock).mockReturnValueOnce(undefined);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const result2 = transformFn(mockTransformParams);
|
const result2 = transformFn(mockTransformParams);
|
||||||
|
|
||||||
expect(result2).toBe('42');
|
expect(result2).toBe('42');
|
||||||
|
|||||||
@ -35,8 +35,10 @@ describe('mergeUserVars', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should merge user vars correctly when user vars are empty', () => {
|
it('should merge user vars correctly when user vars are empty', () => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const userVars = [];
|
const userVars = [];
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const mergedUserVars = mergeUserVars(userVars);
|
const mergedUserVars = mergeUserVars(userVars);
|
||||||
|
|
||||||
expect(mergedUserVars).toEqual(new Map());
|
expect(mergedUserVars).toEqual(new Map());
|
||||||
|
|||||||
@ -129,11 +129,15 @@ export class UserResolver {
|
|||||||
|
|
||||||
const grantedSettingsPermissions: SettingPermissionType[] = (
|
const grantedSettingsPermissions: SettingPermissionType[] = (
|
||||||
Object.keys(settingsPermissions) as SettingPermissionType[]
|
Object.keys(settingsPermissions) as SettingPermissionType[]
|
||||||
).filter((feature) => settingsPermissions[feature] === true);
|
)
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
|
.filter((feature) => settingsPermissions[feature] === true);
|
||||||
|
|
||||||
const grantedObjectRecordsPermissions = (
|
const grantedObjectRecordsPermissions = (
|
||||||
Object.keys(objectRecordsPermissions) as PermissionsOnAllObjectRecords[]
|
Object.keys(objectRecordsPermissions) as PermissionsOnAllObjectRecords[]
|
||||||
).filter((permission) => objectRecordsPermissions[permission] === true);
|
)
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
|
.filter((permission) => objectRecordsPermissions[permission] === true);
|
||||||
|
|
||||||
currentUserWorkspace.settingsPermissions = grantedSettingsPermissions;
|
currentUserWorkspace.settingsPermissions = grantedSettingsPermissions;
|
||||||
currentUserWorkspace.objectRecordsPermissions =
|
currentUserWorkspace.objectRecordsPermissions =
|
||||||
|
|||||||
@ -31,6 +31,7 @@ export const actorCompositeType: CompositeType = {
|
|||||||
(key, index) =>
|
(key, index) =>
|
||||||
({
|
({
|
||||||
id: v4(),
|
id: v4(),
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
label: `${FieldActorSource[key].toLowerCase()}`,
|
label: `${FieldActorSource[key].toLowerCase()}`,
|
||||||
value: key,
|
value: key,
|
||||||
position: index,
|
position: index,
|
||||||
|
|||||||
@ -124,6 +124,7 @@ export class FieldMetadataValidationService<
|
|||||||
if (
|
if (
|
||||||
enumOptions &&
|
enumOptions &&
|
||||||
(enumOptions.includes(formattedDefaultValue) ||
|
(enumOptions.includes(formattedDefaultValue) ||
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
enumOptions.some((option) => option.to === formattedDefaultValue))
|
enumOptions.some((option) => option.to === formattedDefaultValue))
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -699,6 +699,7 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
|||||||
}
|
}
|
||||||
|
|
||||||
const translationValue =
|
const translationValue =
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
fieldMetadata.standardOverrides?.translations?.[locale]?.[labelKey];
|
fieldMetadata.standardOverrides?.translations?.[locale]?.[labelKey];
|
||||||
|
|
||||||
if (isDefined(translationValue)) {
|
if (isDefined(translationValue)) {
|
||||||
|
|||||||
@ -29,6 +29,7 @@ export const unserializeDefaultValue = (
|
|||||||
if (typeof serializedDefaultValue === 'object') {
|
if (typeof serializedDefaultValue === 'object') {
|
||||||
return Object.entries(serializedDefaultValue).reduce(
|
return Object.entries(serializedDefaultValue).reduce(
|
||||||
(acc, [key, value]) => {
|
(acc, [key, value]) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[key] = unserializeDefaultValue(value);
|
acc[key] = unserializeDefaultValue(value);
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
|
|||||||
@ -73,6 +73,7 @@ export const validateDefaultValueForType = (
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const validators = defaultValueValidatorsMap[type] as any[];
|
const validators = defaultValueValidatorsMap[type] as any[];
|
||||||
|
|
||||||
|
|||||||
@ -31,10 +31,12 @@ export class IsFieldMetadataDefaultValue
|
|||||||
args: ValidationArguments,
|
args: ValidationArguments,
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
// Try to extract type value from the object
|
// Try to extract type value from the object
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
let type: FieldMetadataType | null = args.object['type'];
|
let type: FieldMetadataType | null = args.object['type'];
|
||||||
|
|
||||||
if (!type) {
|
if (!type) {
|
||||||
// Extract id value from the instance, should happen only when updating
|
// Extract id value from the instance, should happen only when updating
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const id: string | undefined = args.instance?.['id'];
|
const id: string | undefined = args.instance?.['id'];
|
||||||
|
|
||||||
if (!id) {
|
if (!id) {
|
||||||
|
|||||||
@ -25,10 +25,12 @@ export class IsFieldMetadataOptions {
|
|||||||
args: ValidationArguments,
|
args: ValidationArguments,
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
// Try to extract type value from the object
|
// Try to extract type value from the object
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
let type: FieldMetadataType | null = args.object['type'];
|
let type: FieldMetadataType | null = args.object['type'];
|
||||||
|
|
||||||
if (!type) {
|
if (!type) {
|
||||||
// Extract id value from the instance, should happen only when updating
|
// Extract id value from the instance, should happen only when updating
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const id: string | undefined = args.instance?.['id'];
|
const id: string | undefined = args.instance?.['id'];
|
||||||
|
|
||||||
if (!id) {
|
if (!id) {
|
||||||
|
|||||||
@ -474,6 +474,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
|||||||
acc[object.standardId ?? ''] = {
|
acc[object.standardId ?? ''] = {
|
||||||
id: object.id,
|
id: object.id,
|
||||||
fields: object.fields.reduce((acc, field) => {
|
fields: object.fields.reduce((acc, field) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[field.standardId ?? ''] = field.id;
|
acc[field.standardId ?? ''] = field.id;
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
@ -608,6 +609,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
|||||||
}
|
}
|
||||||
|
|
||||||
const translationValue =
|
const translationValue =
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
objectMetadata.standardOverrides?.translations?.[locale]?.[labelKey];
|
objectMetadata.standardOverrides?.translations?.[locale]?.[labelKey];
|
||||||
|
|
||||||
if (isDefined(translationValue)) {
|
if (isDefined(translationValue)) {
|
||||||
|
|||||||
@ -160,6 +160,7 @@ export class ObjectMetadataFieldRelationService {
|
|||||||
standardId: createRelationDeterministicUuid({
|
standardId: createRelationDeterministicUuid({
|
||||||
objectId: sourceObjectMetadata.id,
|
objectId: sourceObjectMetadata.id,
|
||||||
standardId:
|
standardId:
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
STANDARD_OBJECT_FIELD_IDS[targetObjectMetadata.nameSingular].custom,
|
STANDARD_OBJECT_FIELD_IDS[targetObjectMetadata.nameSingular].custom,
|
||||||
}),
|
}),
|
||||||
objectMetadataId: targetObjectMetadata.id,
|
objectMetadataId: targetObjectMetadata.id,
|
||||||
@ -192,6 +193,7 @@ export class ObjectMetadataFieldRelationService {
|
|||||||
const sourceFieldMetadataToUpdate =
|
const sourceFieldMetadataToUpdate =
|
||||||
await this.fieldMetadataRepository.findOneByOrFail({
|
await this.fieldMetadataRepository.findOneByOrFail({
|
||||||
standardId:
|
standardId:
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
CUSTOM_OBJECT_STANDARD_FIELD_IDS[targetObjectMetadata.namePlural],
|
CUSTOM_OBJECT_STANDARD_FIELD_IDS[targetObjectMetadata.namePlural],
|
||||||
objectMetadataId: sourceObjectMetadata.id,
|
objectMetadataId: sourceObjectMetadata.id,
|
||||||
workspaceId: workspaceId,
|
workspaceId: workspaceId,
|
||||||
@ -239,6 +241,7 @@ export class ObjectMetadataFieldRelationService {
|
|||||||
return {
|
return {
|
||||||
id: uuidV4(),
|
id: uuidV4(),
|
||||||
standardId:
|
standardId:
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
CUSTOM_OBJECT_STANDARD_FIELD_IDS[relationObjectMetadataNamePlural],
|
CUSTOM_OBJECT_STANDARD_FIELD_IDS[relationObjectMetadataNamePlural],
|
||||||
objectMetadataId: sourceObjectMetadata.id,
|
objectMetadataId: sourceObjectMetadata.id,
|
||||||
workspaceId: workspaceId,
|
workspaceId: workspaceId,
|
||||||
@ -250,6 +253,7 @@ export class ObjectMetadataFieldRelationService {
|
|||||||
label: capitalize(relationObjectMetadataNamePlural),
|
label: capitalize(relationObjectMetadataNamePlural),
|
||||||
description,
|
description,
|
||||||
icon:
|
icon:
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
STANDARD_OBJECT_ICONS[targetObjectMetadata.nameSingular] ||
|
STANDARD_OBJECT_ICONS[targetObjectMetadata.nameSingular] ||
|
||||||
'IconBuildingSkyscraper',
|
'IconBuildingSkyscraper',
|
||||||
isNullable: true,
|
isNullable: true,
|
||||||
@ -280,6 +284,7 @@ export class ObjectMetadataFieldRelationService {
|
|||||||
targetObjectMetadata: ObjectMetadataEntity,
|
targetObjectMetadata: ObjectMetadataEntity,
|
||||||
): Partial<FieldMetadataEntity<FieldMetadataType.RELATION>> {
|
): Partial<FieldMetadataEntity<FieldMetadataType.RELATION>> {
|
||||||
const customStandardFieldId =
|
const customStandardFieldId =
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
STANDARD_OBJECT_FIELD_IDS[targetObjectMetadata.nameSingular].custom;
|
STANDARD_OBJECT_FIELD_IDS[targetObjectMetadata.nameSingular].custom;
|
||||||
|
|
||||||
if (!customStandardFieldId) {
|
if (!customStandardFieldId) {
|
||||||
@ -318,6 +323,7 @@ export class ObjectMetadataFieldRelationService {
|
|||||||
targetObjectMetadata: ObjectMetadataEntity,
|
targetObjectMetadata: ObjectMetadataEntity,
|
||||||
) {
|
) {
|
||||||
const customStandardFieldId =
|
const customStandardFieldId =
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
STANDARD_OBJECT_FIELD_IDS[targetObjectMetadata.nameSingular].custom;
|
STANDARD_OBJECT_FIELD_IDS[targetObjectMetadata.nameSingular].custom;
|
||||||
|
|
||||||
if (!customStandardFieldId) {
|
if (!customStandardFieldId) {
|
||||||
|
|||||||
@ -96,6 +96,7 @@ export class DistantTableService {
|
|||||||
await entityManager.query(`DROP SCHEMA "${tmpSchemaName}" CASCADE`);
|
await entityManager.query(`DROP SCHEMA "${tmpSchemaName}" CASCADE`);
|
||||||
|
|
||||||
return createdForeignTableNames.reduce(
|
return createdForeignTableNames.reduce(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
(acc, { table_name, column_name, data_type, udt_name }) => {
|
(acc, { table_name, column_name, data_type, udt_name }) => {
|
||||||
if (!acc[table_name]) {
|
if (!acc[table_name]) {
|
||||||
acc[table_name] = [];
|
acc[table_name] = [];
|
||||||
|
|||||||
@ -41,11 +41,15 @@ export class ForeignTableService {
|
|||||||
await this.workspaceDataSourceService.connectToMainDataSource();
|
await this.workspaceDataSourceService.connectToMainDataSource();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
await mainDataSource.query(
|
(
|
||||||
`SELECT foreign_table_name, foreign_server_name FROM information_schema.foreign_tables WHERE foreign_server_name = $1`,
|
await mainDataSource.query(
|
||||||
[foreignDataWrapperId],
|
`SELECT foreign_table_name, foreign_server_name FROM information_schema.foreign_tables WHERE foreign_server_name = $1`,
|
||||||
|
[foreignDataWrapperId],
|
||||||
|
)
|
||||||
)
|
)
|
||||||
).map((foreignTable) => foreignTable.foreign_table_name);
|
// @ts-expect-error legacy noImplicitAny
|
||||||
|
.map((foreignTable) => foreignTable.foreign_table_name)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async createForeignTable(
|
public async createForeignTable(
|
||||||
|
|||||||
@ -62,6 +62,7 @@ export class RemoteTableSchemaUpdateService {
|
|||||||
const tableName = remoteTable.distantTableName;
|
const tableName = remoteTable.distantTableName;
|
||||||
|
|
||||||
if (!distantTable) {
|
if (!distantTable) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
updates[tableName] = [DistantTableUpdate.TABLE_DELETED];
|
updates[tableName] = [DistantTableUpdate.TABLE_DELETED];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -78,13 +79,17 @@ export class RemoteTableSchemaUpdateService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (columnsAdded.length > 0) {
|
if (columnsAdded.length > 0) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
updates[tableName] = [
|
updates[tableName] = [
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
...(updates[tableName] || []),
|
...(updates[tableName] || []),
|
||||||
DistantTableUpdate.COLUMNS_ADDED,
|
DistantTableUpdate.COLUMNS_ADDED,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (columnsDeleted.length > 0) {
|
if (columnsDeleted.length > 0) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
updates[tableName] = [
|
updates[tableName] = [
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
...(updates[tableName] || []),
|
...(updates[tableName] || []),
|
||||||
DistantTableUpdate.COLUMNS_DELETED,
|
DistantTableUpdate.COLUMNS_DELETED,
|
||||||
];
|
];
|
||||||
|
|||||||
@ -16,6 +16,7 @@ export const fetchTableColumns = async (
|
|||||||
workspaceId,
|
workspaceId,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return res.map((column) => ({
|
return res.map((column) => ({
|
||||||
columnName: column.column_name,
|
columnName: column.column_name,
|
||||||
dataType: column.data_type,
|
dataType: column.data_type,
|
||||||
|
|||||||
@ -44,10 +44,12 @@ export const buildUpdateRemoteServerRawQuery = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (remoteServerToUpdate.schema) {
|
if (remoteServerToUpdate.schema) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
options.push(`"schema" = $${parametersPositions['schema']}`);
|
options.push(`"schema" = $${parametersPositions['schema']}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (remoteServerToUpdate.label) {
|
if (remoteServerToUpdate.label) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
options.push(`"label" = $${parametersPositions['label']}`);
|
options.push(`"label" = $${parametersPositions['label']}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,6 +80,7 @@ const buildParametersAndPositions = (
|
|||||||
Object.entries(remoteServerToUpdate.userMappingOptions).forEach(
|
Object.entries(remoteServerToUpdate.userMappingOptions).forEach(
|
||||||
([key, value]) => {
|
([key, value]) => {
|
||||||
parameters.push(value);
|
parameters.push(value);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
parametersPositions[key] = parameters.length;
|
parametersPositions[key] = parameters.length;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -87,6 +90,7 @@ const buildParametersAndPositions = (
|
|||||||
Object.entries(remoteServerToUpdate.foreignDataWrapperOptions).forEach(
|
Object.entries(remoteServerToUpdate.foreignDataWrapperOptions).forEach(
|
||||||
([key, value]) => {
|
([key, value]) => {
|
||||||
parameters.push(value);
|
parameters.push(value);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
parametersPositions[key] = parameters.length;
|
parametersPositions[key] = parameters.length;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -94,11 +98,13 @@ const buildParametersAndPositions = (
|
|||||||
|
|
||||||
if (remoteServerToUpdate.schema) {
|
if (remoteServerToUpdate.schema) {
|
||||||
parameters.push(remoteServerToUpdate.schema);
|
parameters.push(remoteServerToUpdate.schema);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
parametersPositions['schema'] = parameters.length;
|
parametersPositions['schema'] = parameters.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (remoteServerToUpdate.label) {
|
if (remoteServerToUpdate.label) {
|
||||||
parameters.push(remoteServerToUpdate.label);
|
parameters.push(remoteServerToUpdate.label);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
parametersPositions['label'] = parameters.length;
|
parametersPositions['label'] = parameters.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,9 +125,11 @@ const buildJsonRawQuery = (
|
|||||||
): string => {
|
): string => {
|
||||||
const [[firstKey, _], ...followingOptions] = Object.entries(opts);
|
const [[firstKey, _], ...followingOptions] = Object.entries(opts);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
let query = `jsonb_set("${objectName}", '{${firstKey}}', to_jsonb($${parametersPositions[firstKey]}::text))`;
|
let query = `jsonb_set("${objectName}", '{${firstKey}}', to_jsonb($${parametersPositions[firstKey]}::text))`;
|
||||||
|
|
||||||
followingOptions.forEach(([key, _]) => {
|
followingOptions.forEach(([key, _]) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
query = `jsonb_set(${query}, '{${key}}', to_jsonb($${parametersPositions[key]}::text))`;
|
query = `jsonb_set(${query}, '{${key}}', to_jsonb($${parametersPositions[key]}::text))`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -266,6 +266,7 @@ export class RoleService {
|
|||||||
isArgDefinedIfProvidedOrThrow({
|
isArgDefinedIfProvidedOrThrow({
|
||||||
input,
|
input,
|
||||||
key,
|
key,
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
value: input[key],
|
value: input[key],
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -51,6 +51,7 @@ export class ServerlessFunctionService {
|
|||||||
private readonly messageQueueService: MessageQueueService,
|
private readonly messageQueueService: MessageQueueService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
async findManyServerlessFunctions(where) {
|
async findManyServerlessFunctions(where) {
|
||||||
return this.serverlessFunctionRepository.findBy(where);
|
return this.serverlessFunctionRepository.findBy(where);
|
||||||
}
|
}
|
||||||
@ -276,6 +277,7 @@ export class ServerlessFunctionService {
|
|||||||
|
|
||||||
for (const key of Object.keys(serverlessFunctionInput.code)) {
|
for (const key of Object.keys(serverlessFunctionInput.code)) {
|
||||||
await this.fileStorageService.write({
|
await this.fileStorageService.write({
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
file: serverlessFunctionInput.code[key],
|
file: serverlessFunctionInput.code[key],
|
||||||
name: basename(key),
|
name: basename(key),
|
||||||
mimeType: undefined,
|
mimeType: undefined,
|
||||||
@ -306,6 +308,7 @@ export class ServerlessFunctionService {
|
|||||||
const packageName = match[1].split('@', 1)[0];
|
const packageName = match[1].split('@', 1)[0];
|
||||||
const version = match[2];
|
const version = match[2];
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
if (packageJson.dependencies[packageName]) {
|
if (packageJson.dependencies[packageName]) {
|
||||||
versions[packageName] = version;
|
versions[packageName] = version;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,6 +59,7 @@ export class CompositeColumnActionFactory extends ColumnActionAbstractFactory<Co
|
|||||||
}
|
}
|
||||||
|
|
||||||
const columnName = computeCompositeColumnName(fieldMetadata, property);
|
const columnName = computeCompositeColumnName(fieldMetadata, property);
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const defaultValue = fieldMetadata.defaultValue?.[property.name];
|
const defaultValue = fieldMetadata.defaultValue?.[property.name];
|
||||||
const serializedDefaultValue = serializeDefaultValue(defaultValue);
|
const serializedDefaultValue = serializeDefaultValue(defaultValue);
|
||||||
const enumOptions = property.options
|
const enumOptions = property.options
|
||||||
@ -139,6 +140,7 @@ export class CompositeColumnActionFactory extends ColumnActionAbstractFactory<Co
|
|||||||
alteredProperty,
|
alteredProperty,
|
||||||
);
|
);
|
||||||
const defaultValue =
|
const defaultValue =
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
alteredFieldMetadata.defaultValue?.[alteredProperty.name];
|
alteredFieldMetadata.defaultValue?.[alteredProperty.name];
|
||||||
const serializedDefaultValue = serializeDefaultValue(defaultValue);
|
const serializedDefaultValue = serializeDefaultValue(defaultValue);
|
||||||
const enumOptions = alteredProperty.options
|
const enumOptions = alteredProperty.options
|
||||||
@ -173,6 +175,7 @@ export class CompositeColumnActionFactory extends ColumnActionAbstractFactory<Co
|
|||||||
currentFieldMetadata.isNullable || !currentProperty.isRequired,
|
currentFieldMetadata.isNullable || !currentProperty.isRequired,
|
||||||
isUnique: currentFieldMetadata.isUnique ?? false,
|
isUnique: currentFieldMetadata.isUnique ?? false,
|
||||||
defaultValue: serializeDefaultValue(
|
defaultValue: serializeDefaultValue(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
currentFieldMetadata.defaultValue?.[currentProperty.name],
|
currentFieldMetadata.defaultValue?.[currentProperty.name],
|
||||||
),
|
),
|
||||||
isArray:
|
isArray:
|
||||||
|
|||||||
@ -224,6 +224,7 @@ export class WorkspacePermissionsCacheService {
|
|||||||
workspaceId,
|
workspaceId,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return userWorkspaceRoleMap[userWorkspaceId];
|
return userWorkspaceRoleMap[userWorkspaceId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,8 +10,11 @@ import { convertClassNameToObjectMetadataName } from 'src/engine/workspace-manag
|
|||||||
@Global()
|
@Global()
|
||||||
@Module({})
|
@Module({})
|
||||||
export class ObjectMetadataRepositoryModule {
|
export class ObjectMetadataRepositoryModule {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
static forFeature(objectMetadatas): DynamicModule {
|
static forFeature(objectMetadatas): DynamicModule {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const providers: Provider[] = objectMetadatas.map((objectMetadata) => {
|
const providers: Provider[] = objectMetadatas.map((objectMetadata) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const repositoryClass = metadataToRepositoryMapping[objectMetadata.name];
|
const repositoryClass = metadataToRepositoryMapping[objectMetadata.name];
|
||||||
|
|
||||||
if (!repositoryClass) {
|
if (!repositoryClass) {
|
||||||
|
|||||||
@ -112,6 +112,7 @@ export class SeederService {
|
|||||||
|
|
||||||
const subFieldNameAsSQLColumnName = `${field.name}${capitalize(subFieldName)}`;
|
const subFieldNameAsSQLColumnName = `${field.name}${capitalize(subFieldName)}`;
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
objectRecordSeedsAsSQLFlattenedSeeds[
|
objectRecordSeedsAsSQLFlattenedSeeds[
|
||||||
subFieldNameAsSQLColumnName
|
subFieldNameAsSQLColumnName
|
||||||
] = subFieldValueAsSQLValue;
|
] = subFieldValueAsSQLValue;
|
||||||
@ -124,6 +125,7 @@ export class SeederService {
|
|||||||
fieldValue,
|
fieldValue,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
objectRecordSeedsAsSQLFlattenedSeeds[field.name] =
|
objectRecordSeedsAsSQLFlattenedSeeds[field.name] =
|
||||||
fieldValueAsSQLValue;
|
fieldValueAsSQLValue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,6 +122,7 @@ export class EntitySchemaColumnFactory {
|
|||||||
);
|
);
|
||||||
const columnType = fieldMetadataTypeToColumnType(compositeProperty.type);
|
const columnType = fieldMetadataTypeToColumnType(compositeProperty.type);
|
||||||
const defaultValue = serializeDefaultValue(
|
const defaultValue = serializeDefaultValue(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
fieldMetadata.defaultValue?.[compositeProperty.name],
|
fieldMetadata.defaultValue?.[compositeProperty.name],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -16,15 +16,20 @@ export class ScopedWorkspaceContextFactory {
|
|||||||
isExecutedByApiKey: boolean;
|
isExecutedByApiKey: boolean;
|
||||||
} {
|
} {
|
||||||
const workspaceId: string | undefined =
|
const workspaceId: string | undefined =
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
this.request?.['req']?.['workspaceId'] ||
|
this.request?.['req']?.['workspaceId'] ||
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
this.request?.['params']?.['workspaceId'];
|
this.request?.['params']?.['workspaceId'];
|
||||||
const workspaceMetadataVersion: number | undefined =
|
const workspaceMetadataVersion: number | undefined =
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
this.request?.['req']?.['workspaceMetadataVersion'];
|
this.request?.['req']?.['workspaceMetadataVersion'];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
workspaceId: workspaceId ?? null,
|
workspaceId: workspaceId ?? null,
|
||||||
workspaceMetadataVersion: workspaceMetadataVersion ?? null,
|
workspaceMetadataVersion: workspaceMetadataVersion ?? null,
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
userWorkspaceId: this.request?.['req']?.['userWorkspaceId'] ?? null,
|
userWorkspaceId: this.request?.['req']?.['userWorkspaceId'] ?? null,
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
isExecutedByApiKey: !!this.request?.['req']?.['apiKey'],
|
isExecutedByApiKey: !!this.request?.['req']?.['apiKey'],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,17 +63,20 @@ export function formatResult<T>(
|
|||||||
|
|
||||||
if (!compositePropertyArgs && !isRelation) {
|
if (!compositePropertyArgs && !isRelation) {
|
||||||
if (isPlainObject(value)) {
|
if (isPlainObject(value)) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
newData[key] = formatResult(
|
newData[key] = formatResult(
|
||||||
value,
|
value,
|
||||||
objectMetadataItemWithFieldMaps,
|
objectMetadataItemWithFieldMaps,
|
||||||
objectMetadataMaps,
|
objectMetadataMaps,
|
||||||
);
|
);
|
||||||
} else if (objectMetadaItemFieldsByName[key]) {
|
} else if (objectMetadaItemFieldsByName[key]) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
newData[key] = formatFieldMetadataValue(
|
newData[key] = formatFieldMetadataValue(
|
||||||
value,
|
value,
|
||||||
objectMetadaItemFieldsByName[key],
|
objectMetadaItemFieldsByName[key],
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
newData[key] = value;
|
newData[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,6 +99,7 @@ export function formatResult<T>(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
newData[key] = formatResult(
|
newData[key] = formatResult(
|
||||||
value,
|
value,
|
||||||
targetObjectMetadata,
|
targetObjectMetadata,
|
||||||
@ -109,10 +113,13 @@ export function formatResult<T>(
|
|||||||
|
|
||||||
const { parentField, ...compositeProperty } = compositePropertyArgs;
|
const { parentField, ...compositeProperty } = compositePropertyArgs;
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
if (!newData[parentField]) {
|
if (!newData[parentField]) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
newData[parentField] = {};
|
newData[parentField] = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
newData[parentField][compositeProperty.name] = value;
|
newData[parentField][compositeProperty.name] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,6 +142,7 @@ export function formatResult<T>(
|
|||||||
new Date().getTimezoneOffset() * 60 * 1000;
|
new Date().getTimezoneOffset() * 60 * 1000;
|
||||||
|
|
||||||
for (const dateFieldMetadata of dateFieldMetadataCollection) {
|
for (const dateFieldMetadata of dateFieldMetadataCollection) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const rawUpdatedDate = newData[dateFieldMetadata.name] as
|
const rawUpdatedDate = newData[dateFieldMetadata.name] as
|
||||||
| string
|
| string
|
||||||
| null
|
| null
|
||||||
@ -152,9 +160,11 @@ export function formatResult<T>(
|
|||||||
serverOffsetInMillisecondsToCounterActTypeORMAutomaticTimezoneShift,
|
serverOffsetInMillisecondsToCounterActTypeORMAutomaticTimezoneShift,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
newData[dateFieldMetadata.name] = shiftedDate;
|
newData[dateFieldMetadata.name] = shiftedDate;
|
||||||
}
|
}
|
||||||
} else if (isNonEmptyString(rawUpdatedDate)) {
|
} else if (isNonEmptyString(rawUpdatedDate)) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const currentDate = new Date(newData[dateFieldMetadata.name]);
|
const currentDate = new Date(newData[dateFieldMetadata.name]);
|
||||||
|
|
||||||
const shiftedDate = new Date(
|
const shiftedDate = new Date(
|
||||||
@ -162,6 +172,7 @@ export function formatResult<T>(
|
|||||||
serverOffsetInMillisecondsToCounterActTypeORMAutomaticTimezoneShift,
|
serverOffsetInMillisecondsToCounterActTypeORMAutomaticTimezoneShift,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
newData[dateFieldMetadata.name] = shiftedDate;
|
newData[dateFieldMetadata.name] = shiftedDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,8 +104,10 @@ const convertHttpExceptionToGraphql = (exception: HttpException) => {
|
|||||||
let error: BaseGraphQLError;
|
let error: BaseGraphQLError;
|
||||||
|
|
||||||
if (status in graphQLPredefinedExceptions) {
|
if (status in graphQLPredefinedExceptions) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const message = exception.getResponse()['message'] ?? exception.message;
|
const message = exception.getResponse()['message'] ?? exception.message;
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
error = new graphQLPredefinedExceptions[exception.getStatus()](message);
|
error = new graphQLPredefinedExceptions[exception.getStatus()](message);
|
||||||
} else {
|
} else {
|
||||||
error = new BaseGraphQLError(
|
error = new BaseGraphQLError(
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
|
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
|
||||||
|
|
||||||
export const shouldSeedWorkspaceFavorite = (
|
export const shouldSeedWorkspaceFavorite = (
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
objectMetadataId,
|
objectMetadataId,
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
objectMetadataMap,
|
objectMetadataMap,
|
||||||
): boolean =>
|
): boolean =>
|
||||||
objectMetadataId !==
|
objectMetadataId !==
|
||||||
|
|||||||
@ -16,7 +16,9 @@ const generateRandomAmountMicros = () => {
|
|||||||
return firstDigit * 10000000000;
|
return firstDigit * 10000000000;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const generateOpportunities = (companies) => {
|
const generateOpportunities = (companies) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return companies.map((company) => ({
|
return companies.map((company) => ({
|
||||||
id: v4(),
|
id: v4(),
|
||||||
name: company.name,
|
name: company.name,
|
||||||
@ -66,6 +68,7 @@ export const seedOpportunityWithDemoData = async (
|
|||||||
])
|
])
|
||||||
.orIgnore()
|
.orIgnore()
|
||||||
.values(
|
.values(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
opportunities.map((opportunity, index) => ({
|
opportunities.map((opportunity, index) => ({
|
||||||
...opportunity,
|
...opportunity,
|
||||||
position: index,
|
position: index,
|
||||||
|
|||||||
@ -16,9 +16,11 @@ export const seedWorkspaceWithDemoData = async (
|
|||||||
objectMetadata: ObjectMetadataEntity[],
|
objectMetadata: ObjectMetadataEntity[],
|
||||||
) => {
|
) => {
|
||||||
const objectMetadataMap = objectMetadata.reduce((acc, object) => {
|
const objectMetadataMap = objectMetadata.reduce((acc, object) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[object.standardId ?? ''] = {
|
acc[object.standardId ?? ''] = {
|
||||||
id: object.id,
|
id: object.id,
|
||||||
fields: object.fields.reduce((acc, field) => {
|
fields: object.fields.reduce((acc, field) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[field.standardId ?? ''] = field.id;
|
acc[field.standardId ?? ''] = field.id;
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
|
|||||||
@ -18,6 +18,7 @@ export const standardObjectsPrefillData = async (
|
|||||||
throw new Error('Standard Id is not set for object: ${object.name}');
|
throw new Error('Standard Id is not set for object: ${object.name}');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[object.standardId] = {
|
acc[object.standardId] = {
|
||||||
id: object.id,
|
id: object.id,
|
||||||
fields: object.fields.reduce((acc, field) => {
|
fields: object.fields.reduce((acc, field) => {
|
||||||
@ -25,6 +26,7 @@ export const standardObjectsPrefillData = async (
|
|||||||
throw new Error('Standard Id is not set for field: ${field.name}');
|
throw new Error('Standard Id is not set for field: ${field.name}');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[field.standardId] = field.id;
|
acc[field.standardId] = field.id;
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
|
|||||||
@ -134,6 +134,7 @@ export class WorkspaceDefaultValueFixer extends AbstractWorkspaceFixer<Workspace
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const value = currentDefaultValue[key];
|
const value = currentDefaultValue[key];
|
||||||
|
|
||||||
const newValue =
|
const newValue =
|
||||||
|
|||||||
@ -303,7 +303,8 @@ export class DatabaseStructureService {
|
|||||||
normalizer(
|
normalizer(
|
||||||
compositeProperty.type,
|
compositeProperty.type,
|
||||||
typeof initialDefaultValue === 'object'
|
typeof initialDefaultValue === 'object'
|
||||||
? initialDefaultValue?.[compositeProperty.name]
|
? // @ts-expect-error legacy noImplicitAny
|
||||||
|
initialDefaultValue?.[compositeProperty.name]
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -18,9 +18,11 @@ describe('WorkspaceRelationComparator', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
it('should generate CREATE action for new relations', () => {
|
it('should generate CREATE action for new relations', () => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const original = [];
|
const original = [];
|
||||||
const standard = [createMockRelationMetadata({})];
|
const standard = [createMockRelationMetadata({})];
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const result = comparator.compare(original, standard);
|
const result = comparator.compare(original, standard);
|
||||||
|
|
||||||
expect(result).toEqual([
|
expect(result).toEqual([
|
||||||
@ -36,8 +38,10 @@ describe('WorkspaceRelationComparator', () => {
|
|||||||
|
|
||||||
it('should generate DELETE action for removed relations', () => {
|
it('should generate DELETE action for removed relations', () => {
|
||||||
const original = [createMockRelationMetadata({ id: '1' })];
|
const original = [createMockRelationMetadata({ id: '1' })];
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const standard = [];
|
const standard = [];
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const result = comparator.compare(original, standard);
|
const result = comparator.compare(original, standard);
|
||||||
|
|
||||||
expect(result).toEqual([
|
expect(result).toEqual([
|
||||||
|
|||||||
@ -51,10 +51,12 @@ export function transformMetadataForComparison<T, Keys extends keyof T>(
|
|||||||
) {
|
) {
|
||||||
const orderedValue = orderObjectProperties(datum[property] as object);
|
const orderedValue = orderObjectProperties(datum[property] as object);
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
transformedField[property as string] = JSON.stringify(
|
transformedField[property as string] = JSON.stringify(
|
||||||
orderedValue,
|
orderedValue,
|
||||||
) as T[Keys];
|
) as T[Keys];
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
transformedField[property as string] = datum[property];
|
transformedField[property as string] = datum[property];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -183,8 +183,10 @@ export class WorkspaceFieldRelationComparator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
propertiesMap[fieldId][property] = newValue;
|
propertiesMap[fieldId][property] = newValue;
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
propertiesMap[fieldId][property] = difference.value;
|
propertiesMap[fieldId][property] = difference.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -191,10 +191,12 @@ export class WorkspaceFieldComparator {
|
|||||||
if (
|
if (
|
||||||
(fieldPropertiesToStringify as readonly string[]).includes(property)
|
(fieldPropertiesToStringify as readonly string[]).includes(property)
|
||||||
) {
|
) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
fieldPropertiesToUpdateMap[id][property] = this.parseJSONOrString(
|
fieldPropertiesToUpdateMap[id][property] = this.parseJSONOrString(
|
||||||
difference.value,
|
difference.value,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
fieldPropertiesToUpdateMap[id][property] = difference.value;
|
fieldPropertiesToUpdateMap[id][property] = difference.value;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -74,6 +74,7 @@ export class WorkspaceObjectComparator {
|
|||||||
|
|
||||||
const property = difference.path[0];
|
const property = difference.path[0];
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
objectPropertiesToUpdate[property] = standardObjectMetadata[property];
|
objectPropertiesToUpdate[property] = standardObjectMetadata[property];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,12 +26,15 @@ export class MicrosoftEmailAliasManagerService {
|
|||||||
|
|
||||||
const handleAliases =
|
const handleAliases =
|
||||||
proxyAddresses
|
proxyAddresses
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
?.filter((address) => {
|
?.filter((address) => {
|
||||||
return address.startsWith('SMTP:') === false;
|
return address.startsWith('SMTP:') === false;
|
||||||
})
|
})
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
.map((address) => {
|
.map((address) => {
|
||||||
return address.replace('smtp:', '').toLowerCase();
|
return address.replace('smtp:', '').toLowerCase();
|
||||||
})
|
})
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
.filter((address) => {
|
.filter((address) => {
|
||||||
return address !== '';
|
return address !== '';
|
||||||
}) || [];
|
}) || [];
|
||||||
|
|||||||
@ -21,6 +21,7 @@ describe('Email Alias Manager Service', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
connectedAccountRepository = {
|
connectedAccountRepository = {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
update: jest.fn().mockResolvedValue((arg) => arg),
|
update: jest.fn().mockResolvedValue((arg) => arg),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,7 @@ export function filterOutSelfAndContactsFromCompanyOrWorkspace(
|
|||||||
|
|
||||||
const workspaceMembersMap = workspaceMembers.reduce(
|
const workspaceMembersMap = workspaceMembers.reduce(
|
||||||
(map, workspaceMember) => {
|
(map, workspaceMember) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
map[workspaceMember.userEmail.toLowerCase()] = true;
|
map[workspaceMember.userEmail.toLowerCase()] = true;
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
@ -36,6 +37,7 @@ export function filterOutSelfAndContactsFromCompanyOrWorkspace(
|
|||||||
(contact) =>
|
(contact) =>
|
||||||
(isDifferentDomain(contact, selfDomainName) ||
|
(isDifferentDomain(contact, selfDomainName) ||
|
||||||
!isWorkDomain(selfDomainName)) &&
|
!isWorkDomain(selfDomainName)) &&
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
!workspaceMembersMap[contact.handle.toLowerCase()] &&
|
!workspaceMembersMap[contact.handle.toLowerCase()] &&
|
||||||
!allHandles.includes(contact.handle.toLowerCase()),
|
!allHandles.includes(contact.handle.toLowerCase()),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
import psl from 'psl';
|
import psl from 'psl';
|
||||||
import { capitalize } from 'twenty-shared/utils';
|
import { capitalize } from 'twenty-shared/utils';
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
import psl from 'psl';
|
import psl from 'psl';
|
||||||
|
|
||||||
export const getDomainNameFromHandle = (handle: string): string => {
|
export const getDomainNameFromHandle = (handle: string): string => {
|
||||||
|
|||||||
@ -77,6 +77,7 @@ export class GmailGetMessageListService {
|
|||||||
firstMessageExternalId = messageList.data.messages?.[0].id ?? undefined;
|
firstMessageExternalId = messageList.data.messages?.[0].id ?? undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
messageExternalIds.push(...messages.map((message) => message.id));
|
messageExternalIds.push(...messages.map((message) => message.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { gmail_v1 as gmailV1 } from 'googleapis';
|
import { gmail_v1 as gmailV1 } from 'googleapis';
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
import planer from 'planer';
|
import planer from 'planer';
|
||||||
|
|
||||||
import { ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity';
|
import { ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity';
|
||||||
|
|||||||
@ -91,14 +91,17 @@ export class MicrosoftGetMessagesService {
|
|||||||
'from',
|
'from',
|
||||||
),
|
),
|
||||||
...formatAddressObjectAsParticipants(
|
...formatAddressObjectAsParticipants(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
response?.toRecipients?.map((recipient) => recipient.emailAddress),
|
response?.toRecipients?.map((recipient) => recipient.emailAddress),
|
||||||
'to',
|
'to',
|
||||||
),
|
),
|
||||||
...formatAddressObjectAsParticipants(
|
...formatAddressObjectAsParticipants(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
response?.ccRecipients?.map((recipient) => recipient.emailAddress),
|
response?.ccRecipients?.map((recipient) => recipient.emailAddress),
|
||||||
'cc',
|
'cc',
|
||||||
),
|
),
|
||||||
...formatAddressObjectAsParticipants(
|
...formatAddressObjectAsParticipants(
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
response?.bccRecipients?.map((recipient) => recipient.emailAddress),
|
response?.bccRecipients?.map((recipient) => recipient.emailAddress),
|
||||||
'bcc',
|
'bcc',
|
||||||
),
|
),
|
||||||
|
|||||||
@ -175,34 +175,38 @@ export class TimelineActivityService {
|
|||||||
if (activityTargets.length === 0) return;
|
if (activityTargets.length === 0) return;
|
||||||
if (activity.length === 0) return;
|
if (activity.length === 0) return;
|
||||||
|
|
||||||
return activityTargets
|
return (
|
||||||
.map((activityTarget) => {
|
activityTargets
|
||||||
const targetColumn: string[] = Object.entries(activityTarget)
|
// @ts-expect-error legacy noImplicitAny
|
||||||
.map(([columnName, columnValue]: [string, string]) => {
|
.map((activityTarget) => {
|
||||||
if (
|
const targetColumn: string[] = Object.entries(activityTarget)
|
||||||
columnName === activityType + 'Id' ||
|
.map(([columnName, columnValue]: [string, string]) => {
|
||||||
!columnName.endsWith('Id')
|
if (
|
||||||
)
|
columnName === activityType + 'Id' ||
|
||||||
return;
|
!columnName.endsWith('Id')
|
||||||
if (columnValue === null) return;
|
)
|
||||||
|
return;
|
||||||
|
if (columnValue === null) return;
|
||||||
|
|
||||||
return columnName;
|
return columnName;
|
||||||
})
|
})
|
||||||
.filter((column): column is string => column !== undefined);
|
.filter((column): column is string => column !== undefined);
|
||||||
|
|
||||||
if (targetColumn.length === 0) return;
|
if (targetColumn.length === 0) return;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...event,
|
...event,
|
||||||
name: 'linked-' + eventName,
|
name: 'linked-' + eventName,
|
||||||
objectName: targetColumn[0].replace(/Id$/, ''),
|
objectName: targetColumn[0].replace(/Id$/, ''),
|
||||||
recordId: activityTarget[targetColumn[0]],
|
recordId: activityTarget[targetColumn[0]],
|
||||||
linkedRecordCachedName: activity[0].title,
|
linkedRecordCachedName: activity[0].title,
|
||||||
linkedRecordId: activity[0].id,
|
linkedRecordId: activity[0].id,
|
||||||
linkedObjectMetadataId: event.objectMetadata.id,
|
linkedObjectMetadataId: event.objectMetadata.id,
|
||||||
} satisfies TimelineActivity;
|
} satisfies TimelineActivity;
|
||||||
})
|
})
|
||||||
.filter((event): event is TimelineActivity => event !== undefined);
|
// @ts-expect-error legacy noImplicitAny
|
||||||
|
.filter((event): event is TimelineActivity => event !== undefined)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async computeActivityTargets({
|
private async computeActivityTargets({
|
||||||
|
|||||||
@ -35,6 +35,7 @@ export class ViewService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (const viewId of viewsIds) {
|
for (const viewId of viewsIds) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
const position = positions?.[viewId];
|
const position = positions?.[viewId];
|
||||||
const newFieldInThisView = await viewFieldRepository.findBy({
|
const newFieldInThisView = await viewFieldRepository.findBy({
|
||||||
fieldMetadataId: fieldId,
|
fieldMetadataId: fieldId,
|
||||||
|
|||||||
@ -9,6 +9,7 @@ const companyMockObjectMetadataItem = mockObjectMetadataItemsWithFieldMaps.find(
|
|||||||
)!;
|
)!;
|
||||||
|
|
||||||
describe('generateFakeFormResponse', () => {
|
describe('generateFakeFormResponse', () => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
let objectMetadataRepository;
|
let objectMetadataRepository;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@ -52,6 +53,7 @@ describe('generateFakeFormResponse', () => {
|
|||||||
const result = await generateFakeFormResponse({
|
const result = await generateFakeFormResponse({
|
||||||
formMetadata: schema,
|
formMetadata: schema,
|
||||||
workspaceId: '1',
|
workspaceId: '1',
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
objectMetadataRepository,
|
objectMetadataRepository,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@ export const generateFakeField = ({
|
|||||||
icon: icon,
|
icon: icon,
|
||||||
label: label,
|
label: label,
|
||||||
value: compositeType.properties.reduce((acc, property) => {
|
value: compositeType.properties.reduce((acc, property) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[property.name] = {
|
acc[property.name] = {
|
||||||
isLeaf: true,
|
isLeaf: true,
|
||||||
type: property.type,
|
type: property.type,
|
||||||
|
|||||||
@ -572,7 +572,9 @@ export class WorkflowVersionStepWorkspaceService {
|
|||||||
|
|
||||||
const enrichedResponses = await Promise.all(
|
const enrichedResponses = await Promise.all(
|
||||||
responseKeys.map(async (key) => {
|
responseKeys.map(async (key) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
if (!isDefined(response[key])) {
|
if (!isDefined(response[key])) {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return { key, value: response[key] };
|
return { key, value: response[key] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,7 +583,9 @@ export class WorkflowVersionStepWorkspaceService {
|
|||||||
if (
|
if (
|
||||||
field?.type === 'RECORD' &&
|
field?.type === 'RECORD' &&
|
||||||
field?.settings?.objectName &&
|
field?.settings?.objectName &&
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
isDefined(response[key].id) &&
|
isDefined(response[key].id) &&
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
isValidUuid(response[key].id)
|
isValidUuid(response[key].id)
|
||||||
) {
|
) {
|
||||||
const repository = await this.twentyORMManager.getRepository(
|
const repository = await this.twentyORMManager.getRepository(
|
||||||
@ -589,17 +593,20 @@ export class WorkflowVersionStepWorkspaceService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const record = await repository.findOne({
|
const record = await repository.findOne({
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
where: { id: response[key].id },
|
where: { id: response[key].id },
|
||||||
});
|
});
|
||||||
|
|
||||||
return { key, value: record };
|
return { key, value: record };
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
return { key, value: response[key] };
|
return { key, value: response[key] };
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
return enrichedResponses.reduce((acc, { key, value }) => {
|
return enrichedResponses.reduce((acc, { key, value }) => {
|
||||||
|
// @ts-expect-error legacy noImplicitAny
|
||||||
acc[key] = value;
|
acc[key] = value;
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user