diff --git a/packages/nocodb/src/controllers/api-tokens.controller.ts b/packages/nocodb/src/controllers/api-tokens.controller.ts index 8ca4c10855..e6a3e51fc0 100644 --- a/packages/nocodb/src/controllers/api-tokens.controller.ts +++ b/packages/nocodb/src/controllers/api-tokens.controller.ts @@ -41,7 +41,7 @@ export class ApiTokensController { return await this.apiTokensService.apiTokenCreate({ tokenBody: body, userId: req['user'].id, - req + req, }); } @@ -54,7 +54,7 @@ export class ApiTokensController { return await this.apiTokensService.apiTokenDelete({ token, user: req['user'], - req + req, }); } } diff --git a/packages/nocodb/src/controllers/attachments-secure.controller.ts b/packages/nocodb/src/controllers/attachments-secure.controller.ts index c95c3b5062..8fc84680c6 100644 --- a/packages/nocodb/src/controllers/attachments-secure.controller.ts +++ b/packages/nocodb/src/controllers/attachments-secure.controller.ts @@ -41,7 +41,7 @@ export class AttachmentsSecureController { const attachments = await this.attachmentsService.upload({ files: files, path: path, - req + req, }); return attachments; @@ -60,7 +60,7 @@ export class AttachmentsSecureController { const attachments = await this.attachmentsService.uploadViaURL({ urls: body, path, - req + req, }); return attachments; diff --git a/packages/nocodb/src/controllers/attachments.controller.ts b/packages/nocodb/src/controllers/attachments.controller.ts index 8f9bcc46a7..6469d7d1be 100644 --- a/packages/nocodb/src/controllers/attachments.controller.ts +++ b/packages/nocodb/src/controllers/attachments.controller.ts @@ -37,7 +37,7 @@ export class AttachmentsController { const attachments = await this.attachmentsService.upload({ files: files, path: req.query?.path as string, - req + req, }); return attachments; @@ -47,12 +47,15 @@ export class AttachmentsController { @HttpCode(200) @UseInterceptors(UploadAllowedInterceptor) @UseGuards(MetaApiLimiterGuard, GlobalGuard) - async uploadViaURL(@Body() body: any, @Query('path') path: string, - @Request() req: any,) { + async uploadViaURL( + @Body() body: any, + @Query('path') path: string, + @Request() req: any, + ) { const attachments = await this.attachmentsService.uploadViaURL({ urls: body, path, - req + req, }); return attachments; diff --git a/packages/nocodb/src/controllers/bases.controller.ts b/packages/nocodb/src/controllers/bases.controller.ts index 5ca2735e56..b2571e3413 100644 --- a/packages/nocodb/src/controllers/bases.controller.ts +++ b/packages/nocodb/src/controllers/bases.controller.ts @@ -82,7 +82,7 @@ export class BasesController { baseId, base: body, user: req.user, - req + req, }); return base; @@ -94,7 +94,7 @@ export class BasesController { const deleted = await this.projectsService.baseSoftDelete({ baseId, user: req.user, - req + req, }); return deleted; diff --git a/packages/nocodb/src/controllers/filters.controller.ts b/packages/nocodb/src/controllers/filters.controller.ts index 1e357b49be..10ee4dba81 100644 --- a/packages/nocodb/src/controllers/filters.controller.ts +++ b/packages/nocodb/src/controllers/filters.controller.ts @@ -50,7 +50,7 @@ export class FiltersController { filter: body, viewId: viewId, user: req.user, - req + req, }); return filter; } @@ -70,7 +70,7 @@ export class FiltersController { filter: body, hookId, user: req.user, - req + req, }); return filter; } @@ -107,7 +107,8 @@ export class FiltersController { const filter = await this.filtersService.filterUpdate({ filterId: filterId, filter: body, - user: req.user,req + user: req.user, + req, }); return filter; } diff --git a/packages/nocodb/src/controllers/form-columns.controller.ts b/packages/nocodb/src/controllers/form-columns.controller.ts index ab777f8167..3273ec5642 100644 --- a/packages/nocodb/src/controllers/form-columns.controller.ts +++ b/packages/nocodb/src/controllers/form-columns.controller.ts @@ -1,4 +1,11 @@ -import { Body, Controller, Param, Patch, UseGuards , Request} from '@nestjs/common'; +import { + Body, + Controller, + Param, + Patch, + Request, + UseGuards, +} from '@nestjs/common'; import { GlobalGuard } from '~/guards/global/global.guard'; import { FormColumnsService } from '~/services/form-columns.service'; import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware'; @@ -25,7 +32,7 @@ export class FormColumnsController { return await this.formColumnsService.columnUpdate({ formViewColumnId, formViewColumn: formViewColumnbody, - req + req, }); } } diff --git a/packages/nocodb/src/controllers/forms.controller.ts b/packages/nocodb/src/controllers/forms.controller.ts index 0ebf0bb257..3589071b0a 100644 --- a/packages/nocodb/src/controllers/forms.controller.ts +++ b/packages/nocodb/src/controllers/forms.controller.ts @@ -6,8 +6,8 @@ import { Param, Patch, Post, - Request, Req, + Request, UseGuards, } from '@nestjs/common'; import { ViewCreateReqType } from 'nocodb-sdk'; @@ -45,7 +45,7 @@ export class FormsController { body, tableId, user: req.user, - req + req, }); return view; } @@ -54,12 +54,15 @@ export class FormsController { '/api/v2/meta/forms/:formViewId', ]) @Acl('formViewUpdate') - async formViewUpdate(@Param('formViewId') formViewId: string, @Body() body, - @Request() req: any,) { + async formViewUpdate( + @Param('formViewId') formViewId: string, + @Body() body, + @Request() req: any, + ) { return await this.formsService.formViewUpdate({ formViewId, form: body, - req + req, }); } } diff --git a/packages/nocodb/src/controllers/galleries.controller.ts b/packages/nocodb/src/controllers/galleries.controller.ts index 4c9adaa9d0..42bceb5825 100644 --- a/packages/nocodb/src/controllers/galleries.controller.ts +++ b/packages/nocodb/src/controllers/galleries.controller.ts @@ -65,7 +65,7 @@ export class GalleriesController { return await this.galleriesService.galleryViewUpdate({ galleryViewId, gallery: body, - req + req, }); } } diff --git a/packages/nocodb/src/controllers/grid-columns.controller.ts b/packages/nocodb/src/controllers/grid-columns.controller.ts index 1bb5fae65b..b500a00da5 100644 --- a/packages/nocodb/src/controllers/grid-columns.controller.ts +++ b/packages/nocodb/src/controllers/grid-columns.controller.ts @@ -1,4 +1,12 @@ -import { Body, Controller, Get,Req, Param, Patch, UseGuards } from '@nestjs/common'; +import { + Body, + Controller, + Get, + Param, + Patch, + Req, + UseGuards, +} from '@nestjs/common'; import { GridColumnReqType } from 'nocodb-sdk'; import { GlobalGuard } from '~/guards/global/global.guard'; import { GridColumnsService } from '~/services/grid-columns.service'; @@ -34,7 +42,7 @@ export class GridColumnsController { return this.gridColumnsService.gridColumnUpdate({ gridViewColumnId, grid: body, - req + req, }); } } diff --git a/packages/nocodb/src/controllers/kanbans.controller.ts b/packages/nocodb/src/controllers/kanbans.controller.ts index be141d7a43..0dce011a19 100644 --- a/packages/nocodb/src/controllers/kanbans.controller.ts +++ b/packages/nocodb/src/controllers/kanbans.controller.ts @@ -46,7 +46,7 @@ export class KanbansController { tableId, kanban: body, user: req.user, - req + req, }); } @@ -64,7 +64,7 @@ export class KanbansController { return await this.kanbansService.kanbanViewUpdate({ kanbanViewId, kanban: body, - req + req, }); } } diff --git a/packages/nocodb/src/controllers/maps.controller.ts b/packages/nocodb/src/controllers/maps.controller.ts index 987fad082c..756d51bf0c 100644 --- a/packages/nocodb/src/controllers/maps.controller.ts +++ b/packages/nocodb/src/controllers/maps.controller.ts @@ -41,7 +41,7 @@ export class MapsController { tableId, map: body, user: req.user, - req + req, }); return view; } @@ -57,7 +57,7 @@ export class MapsController { return await this.mapsService.mapViewUpdate({ mapViewId: mapViewId, map: body, - req + req, }); } } diff --git a/packages/nocodb/src/controllers/model-visibilities.controller.ts b/packages/nocodb/src/controllers/model-visibilities.controller.ts index e0057e3920..99e5a76ceb 100644 --- a/packages/nocodb/src/controllers/model-visibilities.controller.ts +++ b/packages/nocodb/src/controllers/model-visibilities.controller.ts @@ -2,11 +2,11 @@ import { Body, Controller, Get, - Req, HttpCode, Param, Post, Query, + Req, UseGuards, } from '@nestjs/common'; import { GlobalGuard } from '~/guards/global/global.guard'; @@ -35,7 +35,7 @@ export class ModelVisibilitiesController { await this.modelVisibilitiesService.xcVisibilityMetaSetAll({ visibilityRule: body, baseId, - req + req, }); return { msg: 'UI ACL has been created successfully' }; diff --git a/packages/nocodb/src/controllers/org-tokens.controller.ts b/packages/nocodb/src/controllers/org-tokens.controller.ts index 9df7e36f12..571df96ebf 100644 --- a/packages/nocodb/src/controllers/org-tokens.controller.ts +++ b/packages/nocodb/src/controllers/org-tokens.controller.ts @@ -50,7 +50,7 @@ export class OrgTokensController { return await this.orgTokensService.apiTokenCreate({ apiToken: body, user: req['user'], - req + req, }); } @@ -64,7 +64,7 @@ export class OrgTokensController { await this.orgTokensService.apiTokenDelete({ token, user: req['user'], - req + req, }); } } diff --git a/packages/nocodb/src/controllers/plugins.controller.ts b/packages/nocodb/src/controllers/plugins.controller.ts index 673f7e3fa4..d25c34a1f5 100644 --- a/packages/nocodb/src/controllers/plugins.controller.ts +++ b/packages/nocodb/src/controllers/plugins.controller.ts @@ -5,8 +5,8 @@ import { HttpCode, Param, Patch, - Req, Post, + Req, UseGuards, } from '@nestjs/common'; import { GlobalGuard } from '~/guards/global/global.guard'; @@ -48,8 +48,7 @@ export class PluginsController { @Acl('pluginTest', { scope: 'org', }) - async pluginTest(@Body() body: any, - @Req() req: any,) { + async pluginTest(@Body() body: any, @Req() req: any) { return await this.pluginsService.pluginTest({ body: body, req }); } @@ -68,12 +67,15 @@ export class PluginsController { @Acl('pluginUpdate', { scope: 'org', }) - async pluginUpdate(@Body() body: any, @Param('pluginId') pluginId: string, - @Req() req: any,) { + async pluginUpdate( + @Body() body: any, + @Param('pluginId') pluginId: string, + @Req() req: any, + ) { const plugin = await this.pluginsService.pluginUpdate({ pluginId: pluginId, plugin: body, - req + req, }); return plugin; } diff --git a/packages/nocodb/src/controllers/shared-bases.controller.ts b/packages/nocodb/src/controllers/shared-bases.controller.ts index 80cd784dc4..e6e5ff347d 100644 --- a/packages/nocodb/src/controllers/shared-bases.controller.ts +++ b/packages/nocodb/src/controllers/shared-bases.controller.ts @@ -36,7 +36,7 @@ export class SharedBasesController { roles: body?.roles, password: body?.password, siteUrl: req.ncSiteUrl, - req + req, }); return sharedBase; @@ -57,7 +57,7 @@ export class SharedBasesController { roles: body?.roles, password: body?.password, siteUrl: req.ncSiteUrl, - req + req, }); return sharedBase; @@ -68,11 +68,13 @@ export class SharedBasesController { '/api/v2/meta/bases/:baseId/shared', ]) @Acl('disableSharedBaseLink') - async disableSharedBaseLink(@Param('baseId') baseId: string, - @Request() req: any,): Promise { + async disableSharedBaseLink( + @Param('baseId') baseId: string, + @Request() req: any, + ): Promise { const sharedBase = await this.sharedBasesService.disableSharedBaseLink({ baseId, - req + req, }); return sharedBase; diff --git a/packages/nocodb/src/controllers/sorts.controller.ts b/packages/nocodb/src/controllers/sorts.controller.ts index ddde8a3728..3daf7f65ac 100644 --- a/packages/nocodb/src/controllers/sorts.controller.ts +++ b/packages/nocodb/src/controllers/sorts.controller.ts @@ -49,7 +49,7 @@ export class SortsController { const sort = await this.sortsService.sortCreate({ sort: body, viewId, - req + req, }); return sort; } @@ -73,7 +73,7 @@ export class SortsController { const sort = await this.sortsService.sortUpdate({ sortId, sort: body, - req + req, }); return sort; } @@ -83,7 +83,7 @@ export class SortsController { async sortDelete(@Param('sortId') sortId: string, @Req() req) { const sort = await this.sortsService.sortDelete({ sortId, - req + req, }); return sort; } diff --git a/packages/nocodb/src/controllers/sources.controller.ts b/packages/nocodb/src/controllers/sources.controller.ts index 4e865fbf99..5e85d10e00 100644 --- a/packages/nocodb/src/controllers/sources.controller.ts +++ b/packages/nocodb/src/controllers/sources.controller.ts @@ -1,4 +1,12 @@ -import { Body, Controller, Get,Request, Param, Patch, UseGuards } from '@nestjs/common'; +import { + Body, + Controller, + Get, + Param, + Patch, + Request, + UseGuards, +} from '@nestjs/common'; import { BaseReqType } from 'nocodb-sdk'; import { GlobalGuard } from '~/guards/global/global.guard'; import { PagedResponseImpl } from '~/helpers/PagedResponse'; @@ -43,7 +51,7 @@ export class SourcesController { sourceId, source: body, baseId, - req + req, }); return source; diff --git a/packages/nocodb/src/controllers/sync.controller.ts b/packages/nocodb/src/controllers/sync.controller.ts index 6472bc5840..0af1908e94 100644 --- a/packages/nocodb/src/controllers/sync.controller.ts +++ b/packages/nocodb/src/controllers/sync.controller.ts @@ -56,27 +56,30 @@ export class SyncController { sourceId: sourceId, userId: (req as any).user.id, syncPayload: body, - req + req, }); } @Delete(['/api/v1/db/meta/syncs/:syncId', '/api/v2/meta/syncs/:syncId']) @Acl('syncSourceDelete') - async syncDelete(@Param('syncId') syncId: string,@Req() req: any) { + async syncDelete(@Param('syncId') syncId: string, @Req() req: any) { return await this.syncService.syncDelete({ syncId: syncId, - req + req, }); } @Patch(['/api/v1/db/meta/syncs/:syncId', '/api/v2/meta/syncs/:syncId']) @Acl('syncSourceUpdate') - async syncUpdate(@Param('syncId') syncId: string, @Body() body: any, - @Req() req: any,) { + async syncUpdate( + @Param('syncId') syncId: string, + @Body() body: any, + @Req() req: any, + ) { return await this.syncService.syncUpdate({ syncId: syncId, syncPayload: body, - req + req, }); } } diff --git a/packages/nocodb/src/controllers/tables.controller.ts b/packages/nocodb/src/controllers/tables.controller.ts index 931e0d9b05..e77b741aa9 100644 --- a/packages/nocodb/src/controllers/tables.controller.ts +++ b/packages/nocodb/src/controllers/tables.controller.ts @@ -93,7 +93,7 @@ export class TablesController { table: body, baseId: req.ncProjectId, user: req.ncProjectId, - req + req, }); return { msg: 'The table has been updated successfully' }; } diff --git a/packages/nocodb/src/controllers/view-columns.controller.ts b/packages/nocodb/src/controllers/view-columns.controller.ts index 49ac2e1d75..ae1d897a83 100644 --- a/packages/nocodb/src/controllers/view-columns.controller.ts +++ b/packages/nocodb/src/controllers/view-columns.controller.ts @@ -5,7 +5,8 @@ import { HttpCode, Param, Patch, - Post, Req, + Post, + Req, UseGuards, } from '@nestjs/common'; import { ViewColumnReqType } from 'nocodb-sdk'; @@ -41,11 +42,13 @@ export class ViewColumnsController { @Acl('columnAdd') async columnAdd( @Param('viewId') viewId: string, - @Body() body: ViewColumnReqType,@Req() req: any + @Body() body: ViewColumnReqType, + @Req() req: any, ) { const viewColumn = await this.viewColumnsService.columnAdd({ viewId, - column: body,req + column: body, + req, }); return viewColumn; } @@ -58,13 +61,14 @@ export class ViewColumnsController { async columnUpdate( @Param('viewId') viewId: string, @Param('columnId') columnId: string, - @Body() body: ViewColumnReqType,@Req() req: any + @Body() body: ViewColumnReqType, + @Req() req: any, ) { const result = await this.viewColumnsService.columnUpdate({ viewId, columnId, column: body, - req + req, }); return result; } diff --git a/packages/nocodb/src/controllers/views.controller.ts b/packages/nocodb/src/controllers/views.controller.ts index 28dca55f78..8ff49f5fb6 100644 --- a/packages/nocodb/src/controllers/views.controller.ts +++ b/packages/nocodb/src/controllers/views.controller.ts @@ -48,7 +48,7 @@ export class ViewsController { viewId, view: body, user: req.user, - req + req, }); return result; } @@ -59,7 +59,7 @@ export class ViewsController { const result = await this.viewsService.viewDelete({ viewId, user: req.user, - req + req, }); return result; } @@ -132,7 +132,7 @@ export class ViewsController { viewId, sharedView: body, user: req.user, - req + req, }); } @@ -142,6 +142,10 @@ export class ViewsController { ]) @Acl('shareViewDelete') async shareViewDelete(@Param('viewId') viewId: string, @Request() req) { - return await this.viewsService.shareViewDelete({ viewId, user: req.user , req}); + return await this.viewsService.shareViewDelete({ + viewId, + user: req.user, + req, + }); } } diff --git a/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts b/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts index e4cf6944ef..b4a96b1ad1 100644 --- a/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts @@ -680,7 +680,7 @@ export class AtImportProcessor { viewId: view.list[0].id, view: { title: aTbl_grid.name }, user: syncDB.user, - req:{} + req: {}, }); recordPerfStats(_perfStart, 'dbView.update'); @@ -1527,8 +1527,8 @@ export class AtImportProcessor { url: attachment.url, size: attachment.size, mimetype: attachment.type, - })), req:{} - + })), + req: {}, }); } catch (e) { console.log(e); @@ -1571,7 +1571,7 @@ export class AtImportProcessor { ncCreatedProjectSchema = await this.basesService.baseCreate({ base: { title: projName }, user: { id: syncDB.user.id }, - req:{} + req: {}, }); recordPerfStats(_perfStart, 'base.create'); @@ -1622,7 +1622,7 @@ export class AtImportProcessor { title: viewName, }, user: syncDB.user, - req:{} + req: {}, }); recordPerfStats(_perfStart, 'dbView.galleryCreate'); @@ -1689,7 +1689,7 @@ export class AtImportProcessor { tableId: tblId, body: formData, user: syncDB.user, - req:{} + req: {}, }); recordPerfStats(_perfStart, 'dbView.formCreate'); @@ -1769,7 +1769,7 @@ export class AtImportProcessor { grid: { title: viewName, }, - req:{} + req: {}, }); recordPerfStats(_perfStart, 'dbView.gridCreate'); @@ -2146,7 +2146,7 @@ export class AtImportProcessor { viewId: viewId, filter: ncFilters[i], user: syncDB.user, - req:{} + req: {}, }); recordPerfStats(_perfStart, 'dbTableFilter.create'); @@ -2225,7 +2225,7 @@ export class AtImportProcessor { group_by_sort: ncGroup[i].direction === 'ascending' ? 'asc' : 'desc', }, - req:{} + req: {}, }); } catch (e) { // ignore @@ -2247,7 +2247,7 @@ export class AtImportProcessor { fk_column_id: columnId, direction: s.sortSet[i].ascending ? 'asc' : 'desc', }, - req:{} + req: {}, }); recordPerfStats(_perfStart, 'dbTableSort.create'); } @@ -2312,7 +2312,7 @@ export class AtImportProcessor { show: false, order: j + 1 + c.length, }, - req:{} + req: {}, }); recordPerfStats(_perfStart, 'dbViewColumn.update'); } @@ -2340,7 +2340,7 @@ export class AtImportProcessor { await this.formColumnsService.columnUpdate({ formViewColumnId: ncViewColumnId, formViewColumn: formData, - req:{} + req: {}, }); recordPerfStats(_perfStart, 'dbView.formColumnUpdate'); } @@ -2350,7 +2350,7 @@ export class AtImportProcessor { viewId: viewId, columnId: ncViewColumnId, column: configData, - req:{} + req: {}, }); recordPerfStats(_perfStart, 'dbViewColumn.update'); } diff --git a/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts b/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts index a7882608c1..240eb3ee69 100644 --- a/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts +++ b/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts @@ -72,7 +72,7 @@ export class DuplicateController { ...(body.base || {}), }, user: { id: req.user.id }, - req + req, }); const job = await this.jobsService.add(JobTypes.DuplicateBase, { @@ -142,7 +142,7 @@ export class DuplicateController { ...(body.base || {}), }, user: { id: req.user.id }, - req + req, }); const job = await this.jobsService.add(JobTypes.DuplicateBase, { diff --git a/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts b/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts index e054b22a13..6af1cc983d 100644 --- a/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts @@ -104,14 +104,14 @@ export class DuplicateProcessor { status: null, }, user: req.user, - req + req, }); } catch (e) { if (dupProject?.id) { await this.projectsService.baseSoftDelete({ baseId: dupProject.id, user: req.user, - req + req, }); } throw e; diff --git a/packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts b/packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts index b96e4fe8d8..c2bd4cadb5 100644 --- a/packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts +++ b/packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts @@ -901,7 +901,7 @@ export class ImportService { fk_parent_id: getIdOrExternalId(fl.fk_parent_id), }), user: param.user, - req:{} + req: {}, }); idMap.set(fl.id, fg.id); @@ -915,7 +915,7 @@ export class ImportService { ...sr, fk_column_id: getIdOrExternalId(sr.fk_column_id), }), - req:{} + req: {}, }); } @@ -934,9 +934,9 @@ export class ImportService { columnId: cl.id, column: { show: fcl.show, - order: fcl.order + order: fcl.order, }, - req:{} + req: {}, }); } @@ -953,7 +953,7 @@ export class ImportService { grid: { ...withoutNull(rest), }, - req:{} + req: {}, }); } break; @@ -969,7 +969,7 @@ export class ImportService { formViewColumn: { ...withoutNull(rest), }, - req:{} + req: {}, }); } break; @@ -986,7 +986,7 @@ export class ImportService { order: view.order, }, user: param.user, - req:{} + req: {}, }); } } @@ -1014,7 +1014,7 @@ export class ImportService { hook: { ...hookData, }, - req:{} + req: {}, }); if (!hk) continue; @@ -1031,7 +1031,7 @@ export class ImportService { fk_parent_id: getIdOrExternalId(fl.fk_parent_id), }), user: param.user, - req:{} + req: {}, }); idMap.set(fl.id, fg.id); @@ -1059,7 +1059,7 @@ export class ImportService { await this.gridsService.gridViewUpdate({ viewId: view.id, grid: gridData, - req:{} + req: {}, }); } } @@ -1071,14 +1071,14 @@ export class ImportService { const gview = await this.gridsService.gridViewCreate({ tableId: md.id, grid: vw as ViewCreateReqType, - req:{} + req: {}, }); const gridData = withoutNull(vw.view); if (gridData) { await this.gridsService.gridViewUpdate({ viewId: gview.id, grid: gridData, - req:{} + req: {}, }); } return gview; @@ -1088,14 +1088,14 @@ export class ImportService { tableId: md.id, body: vw as ViewCreateReqType, user, - req:{} + req: {}, }); const formData = withoutNull(vw.view); if (formData) { await this.formsService.formViewUpdate({ formViewId: fview.id, form: formData, - req:{} + req: {}, }); } return fview; @@ -1104,7 +1104,8 @@ export class ImportService { const glview = await this.galleriesService.galleryViewCreate({ tableId: md.id, gallery: vw as ViewCreateReqType, - user,req:{} + user, + req: {}, }); const galleryData = withoutNull(vw.view); if (galleryData) { @@ -1118,7 +1119,7 @@ export class ImportService { await this.galleriesService.galleryViewUpdate({ galleryViewId: glview.id, gallery: galleryData, - req:{} + req: {}, }); } return glview; @@ -1128,7 +1129,7 @@ export class ImportService { tableId: md.id, kanban: vw as ViewCreateReqType, user, - req: {} + req: {}, }); const kanbanData = withoutNull(vw.view); if (kanbanData) { @@ -1174,7 +1175,7 @@ export class ImportService { await this.kanbansService.kanbanViewUpdate({ kanbanViewId: kview.id, kanban: kanbanData, - req: {} + req: {}, }); } return kview; diff --git a/packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts b/packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts index b294407716..d33594436f 100644 --- a/packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts @@ -21,12 +21,15 @@ export class MetaSyncProcessor { } = job.data; if (info.sourceId === 'all') { - await this.metaDiffsService.metaDiffSync({ baseId: info.baseId, req: {} }); + await this.metaDiffsService.metaDiffSync({ + baseId: info.baseId, + req: {}, + }); } else { await this.metaDiffsService.baseMetaDiffSync({ baseId: info.baseId, sourceId: info.sourceId, - req: {} + req: {}, }); } diff --git a/packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts b/packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts index b0679bc6f9..8b8fb7a6c8 100644 --- a/packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts @@ -18,7 +18,7 @@ export class SourceDeleteProcessor { await this.sourcesService.baseDelete({ sourceId, - req: {} + req: {}, }); this.debugLog(`job completed for ${job.id}`); diff --git a/packages/nocodb/src/services/api-tokens.service.ts b/packages/nocodb/src/services/api-tokens.service.ts index 976f70676b..8864dffcd7 100644 --- a/packages/nocodb/src/services/api-tokens.service.ts +++ b/packages/nocodb/src/services/api-tokens.service.ts @@ -14,7 +14,11 @@ export class ApiTokensService { async apiTokenList(param: { userId: string }) { return await ApiToken.list(param.userId); } - async apiTokenCreate(param: { userId: string; tokenBody: ApiTokenReqType; req:any }) { + async apiTokenCreate(param: { + userId: string; + tokenBody: ApiTokenReqType; + req: any; + }) { validatePayload( 'swagger.json#/components/schemas/ApiTokenReq', param.tokenBody, @@ -23,7 +27,7 @@ export class ApiTokensService { this.appHooksService.emit(AppEvents.API_TOKEN_CREATE, { userId: param.userId, tokenBody: param.tokenBody, - req: param.req + req: param.req, }); return await ApiToken.insert({ @@ -32,7 +36,7 @@ export class ApiTokensService { }); } - async apiTokenDelete(param: { token; user: User; req:any }) { + async apiTokenDelete(param: { token; user: User; req: any }) { const apiToken = await ApiToken.getByToken(param.token); if ( !extractRolesObj(param.user.roles)[OrgUserRoles.SUPER_ADMIN] && @@ -44,7 +48,7 @@ export class ApiTokensService { this.appHooksService.emit(AppEvents.API_TOKEN_DELETE, { userId: param.user?.id, token: param.token, - req:param.req + req: param.req, }); // todo: verify token belongs to the user diff --git a/packages/nocodb/src/services/bases.service.ts b/packages/nocodb/src/services/bases.service.ts index 883dcd1d45..2353d93ddd 100644 --- a/packages/nocodb/src/services/bases.service.ts +++ b/packages/nocodb/src/services/bases.service.ts @@ -63,7 +63,7 @@ export class BasesService { baseId: string; base: ProjectUpdateReqType; user: UserType; - req:any + req: any; }) { validatePayload( 'swagger.json#/components/schemas/ProjectUpdateReq', diff --git a/packages/nocodb/src/services/forms.service.ts b/packages/nocodb/src/services/forms.service.ts index f0686a1731..612fa76395 100644 --- a/packages/nocodb/src/services/forms.service.ts +++ b/packages/nocodb/src/services/forms.service.ts @@ -52,7 +52,11 @@ export class FormsService { return view; } - async formViewUpdate(param: { formViewId: string; form: FormUpdateReqType; req: any }) { + async formViewUpdate(param: { + formViewId: string; + form: FormUpdateReqType; + req: any; + }) { validatePayload( 'swagger.json#/components/schemas/FormUpdateReq', param.form, @@ -68,7 +72,7 @@ export class FormsService { this.appHooksService.emit(AppEvents.VIEW_UPDATE, { view, showAs: 'form', - req: param.req + req: param.req, }); return res; diff --git a/packages/nocodb/src/services/grid-columns.service.ts b/packages/nocodb/src/services/grid-columns.service.ts index 8d8f24b514..6da1c3b7e4 100644 --- a/packages/nocodb/src/services/grid-columns.service.ts +++ b/packages/nocodb/src/services/grid-columns.service.ts @@ -26,7 +26,7 @@ export class GridColumnsService { const res = await GridViewColumn.update(param.gridViewColumnId, param.grid); this.appHooksService.emit(AppEvents.GRID_COLUMN_UPDATE, { - req: param.req + req: param.req, }); return res; diff --git a/packages/nocodb/src/services/grids.service.ts b/packages/nocodb/src/services/grids.service.ts index fd69dda9e4..a78438ffdb 100644 --- a/packages/nocodb/src/services/grids.service.ts +++ b/packages/nocodb/src/services/grids.service.ts @@ -10,7 +10,11 @@ import { GridView, View } from '~/models'; export class GridsService { constructor(private readonly appHooksService: AppHooksService) {} - async gridViewCreate(param: { tableId: string; grid: ViewCreateReqType; req:any}) { + async gridViewCreate(param: { + tableId: string; + grid: ViewCreateReqType; + req: any; + }) { validatePayload( 'swagger.json#/components/schemas/ViewCreateReq', param.grid, @@ -32,7 +36,11 @@ export class GridsService { return view; } - async gridViewUpdate(param: { viewId: string; grid: GridUpdateReqType; req: any }) { + async gridViewUpdate(param: { + viewId: string; + grid: GridUpdateReqType; + req: any; + }) { validatePayload( 'swagger.json#/components/schemas/GridUpdateReq', param.grid, diff --git a/packages/nocodb/src/services/hooks.service.ts b/packages/nocodb/src/services/hooks.service.ts index 0dfe03f291..ac39261bc2 100644 --- a/packages/nocodb/src/services/hooks.service.ts +++ b/packages/nocodb/src/services/hooks.service.ts @@ -37,9 +37,7 @@ export class HooksService { return await HookLog.list({ fk_hook_id: param.hookId }, param.query); } - async hookCreate(param: { tableId: string; hook: HookReqType; - req: any - }) { + async hookCreate(param: { tableId: string; hook: HookReqType; req: any }) { validatePayload('swagger.json#/components/schemas/HookReq', param.hook); this.validateHookPayload(param.hook.notification); @@ -57,9 +55,7 @@ export class HooksService { return hook; } - async hookDelete(param: { hookId: string - req: any - }) { + async hookDelete(param: { hookId: string; req: any }) { const hook = await Hook.get(param.hookId); if (!hook) { @@ -74,7 +70,7 @@ export class HooksService { return true; } - async hookUpdate(param: { hookId: string; hook: HookReqType ; req:any}) { + async hookUpdate(param: { hookId: string; hook: HookReqType; req: any }) { validatePayload('swagger.json#/components/schemas/HookReq', param.hook); const hook = await Hook.get(param.hookId); @@ -98,7 +94,11 @@ export class HooksService { return res; } - async hookTest(param: { tableId: string; hookTest: HookTestReqType; req: any }) { + async hookTest(param: { + tableId: string; + hookTest: HookTestReqType; + req: any; + }) { validatePayload( 'swagger.json#/components/schemas/HookTestReq', param.hookTest, diff --git a/packages/nocodb/src/services/kanbans.service.ts b/packages/nocodb/src/services/kanbans.service.ts index a6817b5918..9ffba866df 100644 --- a/packages/nocodb/src/services/kanbans.service.ts +++ b/packages/nocodb/src/services/kanbans.service.ts @@ -22,7 +22,7 @@ export class KanbansService { tableId: string; kanban: ViewCreateReqType; user: UserType; - req: any; + req: any; }) { validatePayload( 'swagger.json#/components/schemas/ViewCreateReq', @@ -41,7 +41,7 @@ export class KanbansService { showAs: 'kanban', user: param.user, - req: param.req + req: param.req, }); return view; @@ -68,7 +68,7 @@ export class KanbansService { this.appHooksService.emit(AppEvents.VIEW_UPDATE, { view, showAs: 'kanban', - req: param.req + req: param.req, }); return res; diff --git a/packages/nocodb/src/services/maps.service.ts b/packages/nocodb/src/services/maps.service.ts index 4eaa66964f..8feafc1c5c 100644 --- a/packages/nocodb/src/services/maps.service.ts +++ b/packages/nocodb/src/services/maps.service.ts @@ -18,7 +18,7 @@ export class MapsService { tableId: string; map: ViewCreateReqType; user: UserType; - req: any; + req: any; }) { validatePayload( 'swagger.json#/components/schemas/ViewCreateReq', @@ -35,14 +35,16 @@ export class MapsService { view, showAs: 'map', - req: param.req + req: param.req, }); return view; } - async mapViewUpdate(param: { mapViewId: string; map: MapUpdateReqType; - req: any; + async mapViewUpdate(param: { + mapViewId: string; + map: MapUpdateReqType; + req: any; }) { validatePayload('swagger.json#/components/schemas/MapUpdateReq', param.map); diff --git a/packages/nocodb/src/services/meta-diffs.service.ts b/packages/nocodb/src/services/meta-diffs.service.ts index 7dee3d2355..fa3c572b16 100644 --- a/packages/nocodb/src/services/meta-diffs.service.ts +++ b/packages/nocodb/src/services/meta-diffs.service.ts @@ -896,7 +896,11 @@ export class MetaDiffsService { return true; } - async baseMetaDiffSync(param: { baseId: string; sourceId: string, req: any }) { + async baseMetaDiffSync(param: { + baseId: string; + sourceId: string; + req: any; + }) { const base = await Base.getWithInfo(param.baseId); const source = await Source.get(param.sourceId); diff --git a/packages/nocodb/src/services/notifications.service.ts b/packages/nocodb/src/services/notifications.service.ts index b10030e8f3..97e8791416 100644 --- a/packages/nocodb/src/services/notifications.service.ts +++ b/packages/nocodb/src/services/notifications.service.ts @@ -37,28 +37,33 @@ export class NotificationsService implements OnModuleInit, OnModuleDestroy { { const { base, user, invitedBy } = data as ProjectInviteEvent; - await this.insertNotification({ - fk_user_id: user.id, - type: AppEvents.PROJECT_INVITE, - body: { - id: base.id, - title: base.title, - type: base.type, - invited_by: invitedBy.email, - } - }, - req,); + await this.insertNotification( + { + fk_user_id: user.id, + type: AppEvents.PROJECT_INVITE, + body: { + id: base.id, + title: base.title, + type: base.type, + invited_by: invitedBy.email, + }, + }, + req, + ); } break; case AppEvents.WELCOME: { const { user, req } = data as WelcomeEvent; - await this.insertNotification({ - fk_user_id: user.id, - type: AppEvents.WELCOME, - body: {}, - }, req); + await this.insertNotification( + { + fk_user_id: user.id, + type: AppEvents.WELCOME, + body: {}, + }, + req, + ); } break; } diff --git a/packages/nocodb/src/services/org-tokens.service.ts b/packages/nocodb/src/services/org-tokens.service.ts index baeeba1ecb..4cfe2369e9 100644 --- a/packages/nocodb/src/services/org-tokens.service.ts +++ b/packages/nocodb/src/services/org-tokens.service.ts @@ -35,7 +35,9 @@ export class OrgTokensService { ); } - async apiTokenCreate(param: { user: User; apiToken: ApiTokenReqType + async apiTokenCreate(param: { + user: User; + apiToken: ApiTokenReqType; req: any; }) { validatePayload( @@ -52,15 +54,13 @@ export class OrgTokensService { tokenBody: param.apiToken, userId: param.user?.id, - req: param.req + req: param.req, }); return apiToken; } - async apiTokenDelete(param: { user: User; token: string; - req: any; - }) { + async apiTokenDelete(param: { user: User; token: string; req: any }) { const fk_user_id = param.user.id; const apiToken = await ApiToken.getByToken(param.token); if ( diff --git a/packages/nocodb/src/services/plugins.service.ts b/packages/nocodb/src/services/plugins.service.ts index 955e40d6d7..c80f932496 100644 --- a/packages/nocodb/src/services/plugins.service.ts +++ b/packages/nocodb/src/services/plugins.service.ts @@ -14,7 +14,7 @@ export class PluginsService { return await Plugin.list(); } - async pluginTest(param: { body: PluginTestReqType; req: any}) { + async pluginTest(param: { body: PluginTestReqType; req: any }) { validatePayload( 'swagger.json#/components/schemas/PluginTestReq', param.body, @@ -22,7 +22,7 @@ export class PluginsService { this.appHooksService.emit(AppEvents.PLUGIN_TEST, { testBody: param.body, - req: param.req + req: param.req, }); return await NcPluginMgrv2.test(param.body); } @@ -30,7 +30,11 @@ export class PluginsService { async pluginRead(param: { pluginId: string }) { return await Plugin.get(param.pluginId); } - async pluginUpdate(param: { pluginId: string; plugin: PluginType; req: any }) { + async pluginUpdate(param: { + pluginId: string; + plugin: PluginType; + req: any; + }) { validatePayload('swagger.json#/components/schemas/PluginReq', param.plugin); const plugin = await Plugin.update(param.pluginId, param.plugin); @@ -39,7 +43,7 @@ export class PluginsService { plugin.active ? AppEvents.PLUGIN_INSTALL : AppEvents.PLUGIN_UNINSTALL, { plugin, - req: param.req + req: param.req, }, ); diff --git a/packages/nocodb/src/services/shared-bases.service.ts b/packages/nocodb/src/services/shared-bases.service.ts index 80e691ab6d..33e24d377d 100644 --- a/packages/nocodb/src/services/shared-bases.service.ts +++ b/packages/nocodb/src/services/shared-bases.service.ts @@ -26,7 +26,7 @@ export class SharedBasesService { password: string; siteUrl: string; - req: any + req: any; }): Promise { validatePayload('swagger.json#/components/schemas/SharedBaseReq', param); @@ -74,7 +74,7 @@ export class SharedBasesService { roles: string; password: string; siteUrl: string; - req:any + req: any; }): Promise { validatePayload('swagger.json#/components/schemas/SharedBaseReq', param); @@ -110,7 +110,7 @@ export class SharedBasesService { this.appHooksService.emit(AppEvents.SHARED_BASE_GENERATE_LINK, { link: data.url, base, - req: param.req + req: param.req, }); return data; } @@ -130,8 +130,9 @@ export class SharedBasesService { return `${siteUrl}${config.dashboardPath}#/base/${base.uuid}`; } - async disableSharedBaseLink(param: { baseId: string - req:any + async disableSharedBaseLink(param: { + baseId: string; + req: any; }): Promise { const base = await Base.get(param.baseId); diff --git a/packages/nocodb/src/services/sorts.service.ts b/packages/nocodb/src/services/sorts.service.ts index ef67ce0387..cdcae1a714 100644 --- a/packages/nocodb/src/services/sorts.service.ts +++ b/packages/nocodb/src/services/sorts.service.ts @@ -14,9 +14,7 @@ export class SortsService { return Sort.get(param.sortId); } - async sortDelete(param: { sortId: string - req: any - }) { + async sortDelete(param: { sortId: string; req: any }) { const sort = await Sort.get(param.sortId); if (!sort) { @@ -27,14 +25,12 @@ export class SortsService { this.appHooksService.emit(AppEvents.SORT_CREATE, { sort, - req: param.req + req: param.req, }); return true; } - async sortUpdate(param: { sortId: any; sort: SortReqType - req: any - }) { + async sortUpdate(param: { sortId: any; sort: SortReqType; req: any }) { validatePayload('swagger.json#/components/schemas/SortReq', param.sort); const sort = await Sort.get(param.sortId); @@ -48,15 +44,13 @@ export class SortsService { this.appHooksService.emit(AppEvents.SORT_UPDATE, { sort, - req: param.req + req: param.req, }); return res; } - async sortCreate(param: { viewId: any; sort: SortReqType - req: any - }) { + async sortCreate(param: { viewId: any; sort: SortReqType; req: any }) { validatePayload('swagger.json#/components/schemas/SortReq', param.sort); const sort = await Sort.insert({ diff --git a/packages/nocodb/src/services/sources.service.ts b/packages/nocodb/src/services/sources.service.ts index 6355da5063..e808e63ffb 100644 --- a/packages/nocodb/src/services/sources.service.ts +++ b/packages/nocodb/src/services/sources.service.ts @@ -53,7 +53,7 @@ export class SourcesService { return sources; } - async baseDelete(param: { sourceId: string; req: any}) { + async baseDelete(param: { sourceId: string; req: any }) { try { const source = await Source.get(param.sourceId, true); await source.delete(); diff --git a/packages/nocodb/src/services/sync.service.ts b/packages/nocodb/src/services/sync.service.ts index eb249dcf36..cba066407e 100644 --- a/packages/nocodb/src/services/sync.service.ts +++ b/packages/nocodb/src/services/sync.service.ts @@ -33,15 +33,13 @@ export class SyncService { this.appHooksService.emit(AppEvents.SYNC_SOURCE_CREATE, { syncSource: sync, - req: param.req + req: param.req, }); return sync; } - async syncDelete(param: { syncId: string - req: any - }) { + async syncDelete(param: { syncId: string; req: any }) { const syncSource = await SyncSource.get(param.syncId); if (!syncSource) { @@ -52,7 +50,7 @@ export class SyncService { this.appHooksService.emit(AppEvents.SYNC_SOURCE_DELETE, { syncSource, - req: param.req + req: param.req, }); return res; } @@ -73,7 +71,7 @@ export class SyncService { this.appHooksService.emit(AppEvents.SYNC_SOURCE_UPDATE, { syncSource, - req: param.req + req: param.req, }); return res; diff --git a/packages/nocodb/src/services/users/users.service.ts b/packages/nocodb/src/services/users/users.service.ts index 2be28e9967..e6c782fc7a 100644 --- a/packages/nocodb/src/services/users/users.service.ts +++ b/packages/nocodb/src/services/users/users.service.ts @@ -91,7 +91,7 @@ export class UsersService { salt, password, email_verification_token, - req + req, }: { email: string; salt: any; @@ -353,7 +353,7 @@ export class UsersService { this.appHooksService.emit(AppEvents.USER_EMAIL_VERIFICATION, { user: user, ip: req?.clientIp, - req + req, }); return true; @@ -545,11 +545,11 @@ export class UsersService { param.res.clearCookie('refresh_token'); } - private async createDefaultProject(user: User,req:any) { + private async createDefaultProject(user: User, req: any) { // create new base for user const base = await this.basesService.createDefaultBase({ user, - req + req, }); return base; diff --git a/packages/nocodb/src/services/view-columns.service.ts b/packages/nocodb/src/services/view-columns.service.ts index 0c4ad69b05..69fc81421f 100644 --- a/packages/nocodb/src/services/view-columns.service.ts +++ b/packages/nocodb/src/services/view-columns.service.ts @@ -12,8 +12,10 @@ export class ViewColumnsService { async columnList(param: { viewId: string }) { return await View.getColumns(param.viewId, undefined); } - async columnAdd(param: { viewId: string; column: ViewColumnReqType - req: any + async columnAdd(param: { + viewId: string; + column: ViewColumnReqType; + req: any; }) { validatePayload( 'swagger.json#/components/schemas/ViewColumnReq', @@ -30,7 +32,7 @@ export class ViewColumnsService { ); this.appHooksService.emit(AppEvents.VIEW_COLUMN_CREATE, { viewColumn, - req:param.req + req: param.req, }); return viewColumn; @@ -40,7 +42,7 @@ export class ViewColumnsService { viewId: string; columnId: string; column: ViewColumnUpdateReqType; - req: any + req: any; }) { validatePayload( 'swagger.json#/components/schemas/ViewColumnUpdateReq', @@ -55,7 +57,7 @@ export class ViewColumnsService { this.appHooksService.emit(AppEvents.VIEW_COLUMN_UPDATE, { viewColumn: param.column, - req: param.req + req: param.req, }); return result; diff --git a/packages/nocodb/src/services/views.service.ts b/packages/nocodb/src/services/views.service.ts index b349461757..ba0e5ce5b5 100644 --- a/packages/nocodb/src/services/views.service.ts +++ b/packages/nocodb/src/services/views.service.ts @@ -91,9 +91,7 @@ export class ViewsService { return filteredViewList; } - async shareView(param: { viewId: string; user: UserType - req: any; - }) { + async shareView(param: { viewId: string; user: UserType; req: any }) { const res = await View.share(param.viewId); const view = await View.get(param.viewId); @@ -105,7 +103,7 @@ export class ViewsService { this.appHooksService.emit(AppEvents.SHARED_VIEW_CREATE, { user: param.user, view, - req: param.req + req: param.req, }); return res; @@ -137,14 +135,12 @@ export class ViewsService { }, user: param.user, - req: param.req + req: param.req, }); return result; } - async viewDelete(param: { viewId: string; user: UserType - req: any; - }) { + async viewDelete(param: { viewId: string; user: UserType; req: any }) { const view = await View.get(param.viewId); if (!view) { @@ -184,7 +180,7 @@ export class ViewsService { this.appHooksService.emit(AppEvents.SHARED_VIEW_UPDATE, { user: param.user, view, - req: param.req + req: param.req, }); return result; @@ -201,7 +197,7 @@ export class ViewsService { this.appHooksService.emit(AppEvents.SHARED_VIEW_DELETE, { user: param.user, view, - req: param.req + req: param.req, }); return true;