From 96b080218d7ea374e5da6131ccd2a74cf16a0556 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 6 Oct 2024 07:21:32 +0000 Subject: [PATCH] fix: corrections --- packages/nocodb/src/models/Integration.ts | 4 ++-- packages/nocodb/src/models/Source.ts | 4 ++-- packages/nocodb/src/utils/nc-config/NcConfig.ts | 5 +++-- .../version-upgrader/upgraders/0100002_ncFilterUpgrader.ts | 2 +- .../upgraders/0101002_ncAttachmentUpgrader.ts | 4 ++-- .../upgraders/0104002_ncAttachmentUpgrader.ts | 4 ++-- .../version-upgrader/upgraders/0104004_ncFilterUpgrader.ts | 2 +- .../upgraders/0105002_ncStickyColumnUpgrader.ts | 2 +- .../version-upgrader/upgraders/0105003_ncFilterUpgrader.ts | 2 +- .../src/version-upgrader/upgraders/0105004_ncHookUpgrader.ts | 2 +- .../upgraders/0107004_ncProjectConfigUpgrader.ts | 2 +- .../version-upgrader/upgraders/0108002_ncXcdbLTARUpgrader.ts | 2 +- .../upgraders/0111002_ncXcdbLTARIndexUpgrader.ts | 2 +- .../upgraders/0225002_ncDatasourceDecrypt.ts | 2 +- 14 files changed, 20 insertions(+), 19 deletions(-) diff --git a/packages/nocodb/src/models/Integration.ts b/packages/nocodb/src/models/Integration.ts index 388fac1344..712ac01bf7 100644 --- a/packages/nocodb/src/models/Integration.ts +++ b/packages/nocodb/src/models/Integration.ts @@ -60,7 +60,7 @@ export default class Integration implements IntegrationType { 'is_private', ]); - insertObj.config = await encryptPropIfRequired({ + insertObj.config = encryptPropIfRequired({ data: insertObj, }); @@ -127,7 +127,7 @@ export default class Integration implements IntegrationType { ]); if (updateObj.config) { - updateObj.config = await encryptPropIfRequired({ + updateObj.config = encryptPropIfRequired({ data: updateObj, }); } diff --git a/packages/nocodb/src/models/Source.ts b/packages/nocodb/src/models/Source.ts index ef9326478e..ae0529b746 100644 --- a/packages/nocodb/src/models/Source.ts +++ b/packages/nocodb/src/models/Source.ts @@ -89,7 +89,7 @@ export default class Source implements SourceType { 'fk_integration_id', ]); - insertObj.config = await encryptPropIfRequired({ + insertObj.config = encryptPropIfRequired({ data: insertObj, }); @@ -152,7 +152,7 @@ export default class Source implements SourceType { ]); if (updateObj.config) { - updateObj.config = await encryptPropIfRequired({ + updateObj.config = encryptPropIfRequired({ data: updateObj, }); } diff --git a/packages/nocodb/src/utils/nc-config/NcConfig.ts b/packages/nocodb/src/utils/nc-config/NcConfig.ts index e9f79dc30a..633dbbc8cc 100644 --- a/packages/nocodb/src/utils/nc-config/NcConfig.ts +++ b/packages/nocodb/src/utils/nc-config/NcConfig.ts @@ -70,10 +70,11 @@ export class NcConfig { ncConfig.auth = { jwt: { secret: secret, - }, - credentialSecret: param.credentialSecret + } }; + ncConfig.credentialSecret = param.credentialSecret; + ncConfig.port = +(port ?? 8080); ncConfig.toolDir = getToolDir(); ncConfig.worker = worker ?? false; diff --git a/packages/nocodb/src/version-upgrader/upgraders/0100002_ncFilterUpgrader.ts b/packages/nocodb/src/version-upgrader/upgraders/0100002_ncFilterUpgrader.ts index a4d5570211..996969f19e 100644 --- a/packages/nocodb/src/version-upgrader/upgraders/0100002_ncFilterUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/upgraders/0100002_ncFilterUpgrader.ts @@ -1,4 +1,4 @@ -import type { NcUpgraderCtx } from './NcUpgrader'; +import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader'; import { MetaTable } from '~/utils/globals'; import View from '~/models/View'; import Hook from '~/models/Hook'; diff --git a/packages/nocodb/src/version-upgrader/upgraders/0101002_ncAttachmentUpgrader.ts b/packages/nocodb/src/version-upgrader/upgraders/0101002_ncAttachmentUpgrader.ts index 5a7a66f96e..4822378877 100644 --- a/packages/nocodb/src/version-upgrader/upgraders/0101002_ncAttachmentUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/upgraders/0101002_ncAttachmentUpgrader.ts @@ -1,8 +1,8 @@ import { UITypes } from 'nocodb-sdk'; -import { throwTimeoutError } from './ncUpgradeErrors'; +import { throwTimeoutError } from '~/version-upgrader/ncUpgradeErrors'; import type { XKnex } from '~/db/CustomKnex'; import type { Knex } from 'knex'; -import type { NcUpgraderCtx } from './NcUpgrader'; +import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader'; // import type { XKnex } from '~/db/sql-data-mapper'; import type { SourceType } from 'nocodb-sdk'; import NcConnectionMgrv2 from '~/utils/common/NcConnectionMgrv2'; diff --git a/packages/nocodb/src/version-upgrader/upgraders/0104002_ncAttachmentUpgrader.ts b/packages/nocodb/src/version-upgrader/upgraders/0104002_ncAttachmentUpgrader.ts index 5d57a046d5..d16b3a6464 100644 --- a/packages/nocodb/src/version-upgrader/upgraders/0104002_ncAttachmentUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/upgraders/0104002_ncAttachmentUpgrader.ts @@ -1,8 +1,8 @@ import { UITypes } from 'nocodb-sdk'; -import { throwTimeoutError } from './ncUpgradeErrors'; +import { throwTimeoutError } from '~/version-upgrader/ncUpgradeErrors'; import type { XKnex } from '~/db/CustomKnex'; import type { Knex } from 'knex'; -import type { NcUpgraderCtx } from './NcUpgrader'; +import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader'; import type { SourceType } from 'nocodb-sdk'; import NcConnectionMgrv2 from '~/utils/common/NcConnectionMgrv2'; import Model from '~/models/Model'; diff --git a/packages/nocodb/src/version-upgrader/upgraders/0104004_ncFilterUpgrader.ts b/packages/nocodb/src/version-upgrader/upgraders/0104004_ncFilterUpgrader.ts index e792097e11..687d40f869 100644 --- a/packages/nocodb/src/version-upgrader/upgraders/0104004_ncFilterUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/upgraders/0104004_ncFilterUpgrader.ts @@ -1,6 +1,6 @@ import { UITypes } from 'nocodb-sdk'; import type { MetaService } from '~/meta/meta.service'; -import type { NcUpgraderCtx } from './NcUpgrader'; +import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader'; import type { SelectOptionsType } from 'nocodb-sdk'; import type { NcContext } from '~/interface/config'; import { MetaTable } from '~/utils/globals'; diff --git a/packages/nocodb/src/version-upgrader/upgraders/0105002_ncStickyColumnUpgrader.ts b/packages/nocodb/src/version-upgrader/upgraders/0105002_ncStickyColumnUpgrader.ts index 95cea59f67..5286c1a4fc 100644 --- a/packages/nocodb/src/version-upgrader/upgraders/0105002_ncStickyColumnUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/upgraders/0105002_ncStickyColumnUpgrader.ts @@ -1,4 +1,4 @@ -import type { NcUpgraderCtx } from './NcUpgrader'; +import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader'; import { MetaTable } from '~/utils/globals'; // before 0.104.3, display value column can be in any position in table diff --git a/packages/nocodb/src/version-upgrader/upgraders/0105003_ncFilterUpgrader.ts b/packages/nocodb/src/version-upgrader/upgraders/0105003_ncFilterUpgrader.ts index f1becba76a..5e6d19e41f 100644 --- a/packages/nocodb/src/version-upgrader/upgraders/0105003_ncFilterUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/upgraders/0105003_ncFilterUpgrader.ts @@ -1,6 +1,6 @@ import { UITypes } from 'nocodb-sdk'; import type { MetaService } from '~/meta/meta.service'; -import type { NcUpgraderCtx } from './NcUpgrader'; +import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader'; import type { NcContext } from '~/interface/config'; import { MetaTable } from '~/utils/globals'; import Column from '~/models/Column'; diff --git a/packages/nocodb/src/version-upgrader/upgraders/0105004_ncHookUpgrader.ts b/packages/nocodb/src/version-upgrader/upgraders/0105004_ncHookUpgrader.ts index 55eeeb6b59..bcdb5e738e 100644 --- a/packages/nocodb/src/version-upgrader/upgraders/0105004_ncHookUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/upgraders/0105004_ncHookUpgrader.ts @@ -1,4 +1,4 @@ -import type { NcUpgraderCtx } from './NcUpgrader'; +import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader'; import { MetaTable } from '~/utils/globals'; export default async function ({ ncMeta }: NcUpgraderCtx) { diff --git a/packages/nocodb/src/version-upgrader/upgraders/0107004_ncProjectConfigUpgrader.ts b/packages/nocodb/src/version-upgrader/upgraders/0107004_ncProjectConfigUpgrader.ts index a933cbef7f..57ae39722d 100644 --- a/packages/nocodb/src/version-upgrader/upgraders/0107004_ncProjectConfigUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/upgraders/0107004_ncProjectConfigUpgrader.ts @@ -1,5 +1,5 @@ import CryptoJS from 'crypto-js'; -import type { NcUpgraderCtx } from './NcUpgrader'; +import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader'; import { Source } from '~/models'; import { MetaTable } from '~/utils/globals'; diff --git a/packages/nocodb/src/version-upgrader/upgraders/0108002_ncXcdbLTARUpgrader.ts b/packages/nocodb/src/version-upgrader/upgraders/0108002_ncXcdbLTARUpgrader.ts index 4d85c317e2..ca3d47c752 100644 --- a/packages/nocodb/src/version-upgrader/upgraders/0108002_ncXcdbLTARUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/upgraders/0108002_ncXcdbLTARUpgrader.ts @@ -1,7 +1,7 @@ import { RelationTypes, UITypes } from 'nocodb-sdk'; import type { LinkToAnotherRecordColumn } from '~/models'; import type { MetaService } from '~/meta/meta.service'; -import type { NcUpgraderCtx } from './NcUpgrader'; +import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader'; import type { NcContext } from '~/interface/config'; import { MetaTable } from '~/utils/globals'; import NocoCache from '~/cache/NocoCache'; diff --git a/packages/nocodb/src/version-upgrader/upgraders/0111002_ncXcdbLTARIndexUpgrader.ts b/packages/nocodb/src/version-upgrader/upgraders/0111002_ncXcdbLTARIndexUpgrader.ts index 6ec9dda791..8b7b9b8006 100644 --- a/packages/nocodb/src/version-upgrader/upgraders/0111002_ncXcdbLTARIndexUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/upgraders/0111002_ncXcdbLTARIndexUpgrader.ts @@ -2,7 +2,7 @@ import { Logger } from '@nestjs/common'; import { RelationTypes, UITypes } from 'nocodb-sdk'; import type { LinkToAnotherRecordColumn } from '~/models'; import type { MetaService } from '~/meta/meta.service'; -import type { NcUpgraderCtx } from './NcUpgrader'; +import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader'; import type { NcContext } from '~/interface/config'; import { MetaTable } from '~/utils/globals'; import { Source } from '~/models'; diff --git a/packages/nocodb/src/version-upgrader/upgraders/0225002_ncDatasourceDecrypt.ts b/packages/nocodb/src/version-upgrader/upgraders/0225002_ncDatasourceDecrypt.ts index 6d7b83463a..6132103382 100644 --- a/packages/nocodb/src/version-upgrader/upgraders/0225002_ncDatasourceDecrypt.ts +++ b/packages/nocodb/src/version-upgrader/upgraders/0225002_ncDatasourceDecrypt.ts @@ -1,4 +1,4 @@ -import type { NcUpgraderCtx } from './NcUpgrader'; +import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader'; import Noco from '~/Noco'; import { MetaTable, RootScopes } from '~/utils/globals'; import CryptoJS from 'crypto-js';