[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:
Paul Rastoin
2025-05-15 18:23:22 +02:00
committed by GitHub
parent 08ce2f831e
commit 442f8dbe3c
120 changed files with 331 additions and 50 deletions
@@ -44,10 +44,12 @@ export const buildUpdateRemoteServerRawQuery = (
}
if (remoteServerToUpdate.schema) {
// @ts-expect-error legacy noImplicitAny
options.push(`"schema" = $${parametersPositions['schema']}`);
}
if (remoteServerToUpdate.label) {
// @ts-expect-error legacy noImplicitAny
options.push(`"label" = $${parametersPositions['label']}`);
}
@@ -78,6 +80,7 @@ const buildParametersAndPositions = (
Object.entries(remoteServerToUpdate.userMappingOptions).forEach(
([key, value]) => {
parameters.push(value);
// @ts-expect-error legacy noImplicitAny
parametersPositions[key] = parameters.length;
},
);
@@ -87,6 +90,7 @@ const buildParametersAndPositions = (
Object.entries(remoteServerToUpdate.foreignDataWrapperOptions).forEach(
([key, value]) => {
parameters.push(value);
// @ts-expect-error legacy noImplicitAny
parametersPositions[key] = parameters.length;
},
);
@@ -94,11 +98,13 @@ const buildParametersAndPositions = (
if (remoteServerToUpdate.schema) {
parameters.push(remoteServerToUpdate.schema);
// @ts-expect-error legacy noImplicitAny
parametersPositions['schema'] = parameters.length;
}
if (remoteServerToUpdate.label) {
parameters.push(remoteServerToUpdate.label);
// @ts-expect-error legacy noImplicitAny
parametersPositions['label'] = parameters.length;
}
@@ -119,9 +125,11 @@ const buildJsonRawQuery = (
): string => {
const [[firstKey, _], ...followingOptions] = Object.entries(opts);
// @ts-expect-error legacy noImplicitAny
let query = `jsonb_set("${objectName}", '{${firstKey}}', to_jsonb($${parametersPositions[firstKey]}::text))`;
followingOptions.forEach(([key, _]) => {
// @ts-expect-error legacy noImplicitAny
query = `jsonb_set(${query}, '{${key}}', to_jsonb($${parametersPositions[key]}::text))`;
});