Browse Source

chore: lint

pull/6894/head
Pranav C 1 year ago
parent
commit
117f37d8a1
  1. 4
      packages/nocodb/src/controllers/api-tokens.controller.ts
  2. 4
      packages/nocodb/src/controllers/attachments-secure.controller.ts
  3. 11
      packages/nocodb/src/controllers/attachments.controller.ts
  4. 4
      packages/nocodb/src/controllers/bases.controller.ts
  5. 7
      packages/nocodb/src/controllers/filters.controller.ts
  6. 11
      packages/nocodb/src/controllers/form-columns.controller.ts
  7. 13
      packages/nocodb/src/controllers/forms.controller.ts
  8. 2
      packages/nocodb/src/controllers/galleries.controller.ts
  9. 12
      packages/nocodb/src/controllers/grid-columns.controller.ts
  10. 4
      packages/nocodb/src/controllers/kanbans.controller.ts
  11. 4
      packages/nocodb/src/controllers/maps.controller.ts
  12. 4
      packages/nocodb/src/controllers/model-visibilities.controller.ts
  13. 4
      packages/nocodb/src/controllers/org-tokens.controller.ts
  14. 14
      packages/nocodb/src/controllers/plugins.controller.ts
  15. 12
      packages/nocodb/src/controllers/shared-bases.controller.ts
  16. 6
      packages/nocodb/src/controllers/sorts.controller.ts
  17. 12
      packages/nocodb/src/controllers/sources.controller.ts
  18. 13
      packages/nocodb/src/controllers/sync.controller.ts
  19. 2
      packages/nocodb/src/controllers/tables.controller.ts
  20. 14
      packages/nocodb/src/controllers/view-columns.controller.ts
  21. 12
      packages/nocodb/src/controllers/views.controller.ts
  22. 26
      packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts
  23. 4
      packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts
  24. 4
      packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts
  25. 37
      packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts
  26. 7
      packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts
  27. 2
      packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts
  28. 10
      packages/nocodb/src/services/api-tokens.service.ts
  29. 2
      packages/nocodb/src/services/bases.service.ts
  30. 8
      packages/nocodb/src/services/forms.service.ts
  31. 2
      packages/nocodb/src/services/grid-columns.service.ts
  32. 12
      packages/nocodb/src/services/grids.service.ts
  33. 14
      packages/nocodb/src/services/hooks.service.ts
  34. 4
      packages/nocodb/src/services/kanbans.service.ts
  35. 6
      packages/nocodb/src/services/maps.service.ts
  36. 6
      packages/nocodb/src/services/meta-diffs.service.ts
  37. 15
      packages/nocodb/src/services/notifications.service.ts
  38. 10
      packages/nocodb/src/services/org-tokens.service.ts
  39. 10
      packages/nocodb/src/services/plugins.service.ts
  40. 11
      packages/nocodb/src/services/shared-bases.service.ts
  41. 16
      packages/nocodb/src/services/sorts.service.ts
  42. 10
      packages/nocodb/src/services/sync.service.ts
  43. 6
      packages/nocodb/src/services/users/users.service.ts
  44. 12
      packages/nocodb/src/services/view-columns.service.ts
  45. 16
      packages/nocodb/src/services/views.service.ts

4
packages/nocodb/src/controllers/api-tokens.controller.ts

@ -41,7 +41,7 @@ export class ApiTokensController {
return await this.apiTokensService.apiTokenCreate({ return await this.apiTokensService.apiTokenCreate({
tokenBody: body, tokenBody: body,
userId: req['user'].id, userId: req['user'].id,
req req,
}); });
} }
@ -54,7 +54,7 @@ export class ApiTokensController {
return await this.apiTokensService.apiTokenDelete({ return await this.apiTokensService.apiTokenDelete({
token, token,
user: req['user'], user: req['user'],
req req,
}); });
} }
} }

4
packages/nocodb/src/controllers/attachments-secure.controller.ts

@ -41,7 +41,7 @@ export class AttachmentsSecureController {
const attachments = await this.attachmentsService.upload({ const attachments = await this.attachmentsService.upload({
files: files, files: files,
path: path, path: path,
req req,
}); });
return attachments; return attachments;
@ -60,7 +60,7 @@ export class AttachmentsSecureController {
const attachments = await this.attachmentsService.uploadViaURL({ const attachments = await this.attachmentsService.uploadViaURL({
urls: body, urls: body,
path, path,
req req,
}); });
return attachments; return attachments;

11
packages/nocodb/src/controllers/attachments.controller.ts

@ -37,7 +37,7 @@ export class AttachmentsController {
const attachments = await this.attachmentsService.upload({ const attachments = await this.attachmentsService.upload({
files: files, files: files,
path: req.query?.path as string, path: req.query?.path as string,
req req,
}); });
return attachments; return attachments;
@ -47,12 +47,15 @@ export class AttachmentsController {
@HttpCode(200) @HttpCode(200)
@UseInterceptors(UploadAllowedInterceptor) @UseInterceptors(UploadAllowedInterceptor)
@UseGuards(MetaApiLimiterGuard, GlobalGuard) @UseGuards(MetaApiLimiterGuard, GlobalGuard)
async uploadViaURL(@Body() body: any, @Query('path') path: string, async uploadViaURL(
@Request() req: any,) { @Body() body: any,
@Query('path') path: string,
@Request() req: any,
) {
const attachments = await this.attachmentsService.uploadViaURL({ const attachments = await this.attachmentsService.uploadViaURL({
urls: body, urls: body,
path, path,
req req,
}); });
return attachments; return attachments;

4
packages/nocodb/src/controllers/bases.controller.ts

@ -82,7 +82,7 @@ export class BasesController {
baseId, baseId,
base: body, base: body,
user: req.user, user: req.user,
req req,
}); });
return base; return base;
@ -94,7 +94,7 @@ export class BasesController {
const deleted = await this.projectsService.baseSoftDelete({ const deleted = await this.projectsService.baseSoftDelete({
baseId, baseId,
user: req.user, user: req.user,
req req,
}); });
return deleted; return deleted;

7
packages/nocodb/src/controllers/filters.controller.ts

@ -50,7 +50,7 @@ export class FiltersController {
filter: body, filter: body,
viewId: viewId, viewId: viewId,
user: req.user, user: req.user,
req req,
}); });
return filter; return filter;
} }
@ -70,7 +70,7 @@ export class FiltersController {
filter: body, filter: body,
hookId, hookId,
user: req.user, user: req.user,
req req,
}); });
return filter; return filter;
} }
@ -107,7 +107,8 @@ export class FiltersController {
const filter = await this.filtersService.filterUpdate({ const filter = await this.filtersService.filterUpdate({
filterId: filterId, filterId: filterId,
filter: body, filter: body,
user: req.user,req user: req.user,
req,
}); });
return filter; return filter;
} }

11
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 { GlobalGuard } from '~/guards/global/global.guard';
import { FormColumnsService } from '~/services/form-columns.service'; import { FormColumnsService } from '~/services/form-columns.service';
import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware'; import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware';
@ -25,7 +32,7 @@ export class FormColumnsController {
return await this.formColumnsService.columnUpdate({ return await this.formColumnsService.columnUpdate({
formViewColumnId, formViewColumnId,
formViewColumn: formViewColumnbody, formViewColumn: formViewColumnbody,
req req,
}); });
} }
} }

13
packages/nocodb/src/controllers/forms.controller.ts

@ -6,8 +6,8 @@ import {
Param, Param,
Patch, Patch,
Post, Post,
Request,
Req, Req,
Request,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { ViewCreateReqType } from 'nocodb-sdk'; import { ViewCreateReqType } from 'nocodb-sdk';
@ -45,7 +45,7 @@ export class FormsController {
body, body,
tableId, tableId,
user: req.user, user: req.user,
req req,
}); });
return view; return view;
} }
@ -54,12 +54,15 @@ export class FormsController {
'/api/v2/meta/forms/:formViewId', '/api/v2/meta/forms/:formViewId',
]) ])
@Acl('formViewUpdate') @Acl('formViewUpdate')
async formViewUpdate(@Param('formViewId') formViewId: string, @Body() body, async formViewUpdate(
@Request() req: any,) { @Param('formViewId') formViewId: string,
@Body() body,
@Request() req: any,
) {
return await this.formsService.formViewUpdate({ return await this.formsService.formViewUpdate({
formViewId, formViewId,
form: body, form: body,
req req,
}); });
} }
} }

2
packages/nocodb/src/controllers/galleries.controller.ts

@ -65,7 +65,7 @@ export class GalleriesController {
return await this.galleriesService.galleryViewUpdate({ return await this.galleriesService.galleryViewUpdate({
galleryViewId, galleryViewId,
gallery: body, gallery: body,
req req,
}); });
} }
} }

12
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 { GridColumnReqType } from 'nocodb-sdk';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { GridColumnsService } from '~/services/grid-columns.service'; import { GridColumnsService } from '~/services/grid-columns.service';
@ -34,7 +42,7 @@ export class GridColumnsController {
return this.gridColumnsService.gridColumnUpdate({ return this.gridColumnsService.gridColumnUpdate({
gridViewColumnId, gridViewColumnId,
grid: body, grid: body,
req req,
}); });
} }
} }

4
packages/nocodb/src/controllers/kanbans.controller.ts

@ -46,7 +46,7 @@ export class KanbansController {
tableId, tableId,
kanban: body, kanban: body,
user: req.user, user: req.user,
req req,
}); });
} }
@ -64,7 +64,7 @@ export class KanbansController {
return await this.kanbansService.kanbanViewUpdate({ return await this.kanbansService.kanbanViewUpdate({
kanbanViewId, kanbanViewId,
kanban: body, kanban: body,
req req,
}); });
} }
} }

4
packages/nocodb/src/controllers/maps.controller.ts

@ -41,7 +41,7 @@ export class MapsController {
tableId, tableId,
map: body, map: body,
user: req.user, user: req.user,
req req,
}); });
return view; return view;
} }
@ -57,7 +57,7 @@ export class MapsController {
return await this.mapsService.mapViewUpdate({ return await this.mapsService.mapViewUpdate({
mapViewId: mapViewId, mapViewId: mapViewId,
map: body, map: body,
req req,
}); });
} }
} }

4
packages/nocodb/src/controllers/model-visibilities.controller.ts

@ -2,11 +2,11 @@ import {
Body, Body,
Controller, Controller,
Get, Get,
Req,
HttpCode, HttpCode,
Param, Param,
Post, Post,
Query, Query,
Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
@ -35,7 +35,7 @@ export class ModelVisibilitiesController {
await this.modelVisibilitiesService.xcVisibilityMetaSetAll({ await this.modelVisibilitiesService.xcVisibilityMetaSetAll({
visibilityRule: body, visibilityRule: body,
baseId, baseId,
req req,
}); });
return { msg: 'UI ACL has been created successfully' }; return { msg: 'UI ACL has been created successfully' };

4
packages/nocodb/src/controllers/org-tokens.controller.ts

@ -50,7 +50,7 @@ export class OrgTokensController {
return await this.orgTokensService.apiTokenCreate({ return await this.orgTokensService.apiTokenCreate({
apiToken: body, apiToken: body,
user: req['user'], user: req['user'],
req req,
}); });
} }
@ -64,7 +64,7 @@ export class OrgTokensController {
await this.orgTokensService.apiTokenDelete({ await this.orgTokensService.apiTokenDelete({
token, token,
user: req['user'], user: req['user'],
req req,
}); });
} }
} }

14
packages/nocodb/src/controllers/plugins.controller.ts

@ -5,8 +5,8 @@ import {
HttpCode, HttpCode,
Param, Param,
Patch, Patch,
Req,
Post, Post,
Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
@ -48,8 +48,7 @@ export class PluginsController {
@Acl('pluginTest', { @Acl('pluginTest', {
scope: 'org', scope: 'org',
}) })
async pluginTest(@Body() body: any, async pluginTest(@Body() body: any, @Req() req: any) {
@Req() req: any,) {
return await this.pluginsService.pluginTest({ body: body, req }); return await this.pluginsService.pluginTest({ body: body, req });
} }
@ -68,12 +67,15 @@ export class PluginsController {
@Acl('pluginUpdate', { @Acl('pluginUpdate', {
scope: 'org', scope: 'org',
}) })
async pluginUpdate(@Body() body: any, @Param('pluginId') pluginId: string, async pluginUpdate(
@Req() req: any,) { @Body() body: any,
@Param('pluginId') pluginId: string,
@Req() req: any,
) {
const plugin = await this.pluginsService.pluginUpdate({ const plugin = await this.pluginsService.pluginUpdate({
pluginId: pluginId, pluginId: pluginId,
plugin: body, plugin: body,
req req,
}); });
return plugin; return plugin;
} }

12
packages/nocodb/src/controllers/shared-bases.controller.ts

@ -36,7 +36,7 @@ export class SharedBasesController {
roles: body?.roles, roles: body?.roles,
password: body?.password, password: body?.password,
siteUrl: req.ncSiteUrl, siteUrl: req.ncSiteUrl,
req req,
}); });
return sharedBase; return sharedBase;
@ -57,7 +57,7 @@ export class SharedBasesController {
roles: body?.roles, roles: body?.roles,
password: body?.password, password: body?.password,
siteUrl: req.ncSiteUrl, siteUrl: req.ncSiteUrl,
req req,
}); });
return sharedBase; return sharedBase;
@ -68,11 +68,13 @@ export class SharedBasesController {
'/api/v2/meta/bases/:baseId/shared', '/api/v2/meta/bases/:baseId/shared',
]) ])
@Acl('disableSharedBaseLink') @Acl('disableSharedBaseLink')
async disableSharedBaseLink(@Param('baseId') baseId: string, async disableSharedBaseLink(
@Request() req: any,): Promise<any> { @Param('baseId') baseId: string,
@Request() req: any,
): Promise<any> {
const sharedBase = await this.sharedBasesService.disableSharedBaseLink({ const sharedBase = await this.sharedBasesService.disableSharedBaseLink({
baseId, baseId,
req req,
}); });
return sharedBase; return sharedBase;

6
packages/nocodb/src/controllers/sorts.controller.ts

@ -49,7 +49,7 @@ export class SortsController {
const sort = await this.sortsService.sortCreate({ const sort = await this.sortsService.sortCreate({
sort: body, sort: body,
viewId, viewId,
req req,
}); });
return sort; return sort;
} }
@ -73,7 +73,7 @@ export class SortsController {
const sort = await this.sortsService.sortUpdate({ const sort = await this.sortsService.sortUpdate({
sortId, sortId,
sort: body, sort: body,
req req,
}); });
return sort; return sort;
} }
@ -83,7 +83,7 @@ export class SortsController {
async sortDelete(@Param('sortId') sortId: string, @Req() req) { async sortDelete(@Param('sortId') sortId: string, @Req() req) {
const sort = await this.sortsService.sortDelete({ const sort = await this.sortsService.sortDelete({
sortId, sortId,
req req,
}); });
return sort; return sort;
} }

12
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 { BaseReqType } from 'nocodb-sdk';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { PagedResponseImpl } from '~/helpers/PagedResponse'; import { PagedResponseImpl } from '~/helpers/PagedResponse';
@ -43,7 +51,7 @@ export class SourcesController {
sourceId, sourceId,
source: body, source: body,
baseId, baseId,
req req,
}); });
return source; return source;

13
packages/nocodb/src/controllers/sync.controller.ts

@ -56,7 +56,7 @@ export class SyncController {
sourceId: sourceId, sourceId: sourceId,
userId: (req as any).user.id, userId: (req as any).user.id,
syncPayload: body, syncPayload: body,
req req,
}); });
} }
@ -65,18 +65,21 @@ export class SyncController {
async syncDelete(@Param('syncId') syncId: string, @Req() req: any) { async syncDelete(@Param('syncId') syncId: string, @Req() req: any) {
return await this.syncService.syncDelete({ return await this.syncService.syncDelete({
syncId: syncId, syncId: syncId,
req req,
}); });
} }
@Patch(['/api/v1/db/meta/syncs/:syncId', '/api/v2/meta/syncs/:syncId']) @Patch(['/api/v1/db/meta/syncs/:syncId', '/api/v2/meta/syncs/:syncId'])
@Acl('syncSourceUpdate') @Acl('syncSourceUpdate')
async syncUpdate(@Param('syncId') syncId: string, @Body() body: any, async syncUpdate(
@Req() req: any,) { @Param('syncId') syncId: string,
@Body() body: any,
@Req() req: any,
) {
return await this.syncService.syncUpdate({ return await this.syncService.syncUpdate({
syncId: syncId, syncId: syncId,
syncPayload: body, syncPayload: body,
req req,
}); });
} }
} }

2
packages/nocodb/src/controllers/tables.controller.ts

@ -93,7 +93,7 @@ export class TablesController {
table: body, table: body,
baseId: req.ncProjectId, baseId: req.ncProjectId,
user: req.ncProjectId, user: req.ncProjectId,
req req,
}); });
return { msg: 'The table has been updated successfully' }; return { msg: 'The table has been updated successfully' };
} }

14
packages/nocodb/src/controllers/view-columns.controller.ts

@ -5,7 +5,8 @@ import {
HttpCode, HttpCode,
Param, Param,
Patch, Patch,
Post, Req, Post,
Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { ViewColumnReqType } from 'nocodb-sdk'; import { ViewColumnReqType } from 'nocodb-sdk';
@ -41,11 +42,13 @@ export class ViewColumnsController {
@Acl('columnAdd') @Acl('columnAdd')
async columnAdd( async columnAdd(
@Param('viewId') viewId: string, @Param('viewId') viewId: string,
@Body() body: ViewColumnReqType,@Req() req: any @Body() body: ViewColumnReqType,
@Req() req: any,
) { ) {
const viewColumn = await this.viewColumnsService.columnAdd({ const viewColumn = await this.viewColumnsService.columnAdd({
viewId, viewId,
column: body,req column: body,
req,
}); });
return viewColumn; return viewColumn;
} }
@ -58,13 +61,14 @@ export class ViewColumnsController {
async columnUpdate( async columnUpdate(
@Param('viewId') viewId: string, @Param('viewId') viewId: string,
@Param('columnId') columnId: string, @Param('columnId') columnId: string,
@Body() body: ViewColumnReqType,@Req() req: any @Body() body: ViewColumnReqType,
@Req() req: any,
) { ) {
const result = await this.viewColumnsService.columnUpdate({ const result = await this.viewColumnsService.columnUpdate({
viewId, viewId,
columnId, columnId,
column: body, column: body,
req req,
}); });
return result; return result;
} }

12
packages/nocodb/src/controllers/views.controller.ts

@ -48,7 +48,7 @@ export class ViewsController {
viewId, viewId,
view: body, view: body,
user: req.user, user: req.user,
req req,
}); });
return result; return result;
} }
@ -59,7 +59,7 @@ export class ViewsController {
const result = await this.viewsService.viewDelete({ const result = await this.viewsService.viewDelete({
viewId, viewId,
user: req.user, user: req.user,
req req,
}); });
return result; return result;
} }
@ -132,7 +132,7 @@ export class ViewsController {
viewId, viewId,
sharedView: body, sharedView: body,
user: req.user, user: req.user,
req req,
}); });
} }
@ -142,6 +142,10 @@ export class ViewsController {
]) ])
@Acl('shareViewDelete') @Acl('shareViewDelete')
async shareViewDelete(@Param('viewId') viewId: string, @Request() req) { 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,
});
} }
} }

26
packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

@ -680,7 +680,7 @@ export class AtImportProcessor {
viewId: view.list[0].id, viewId: view.list[0].id,
view: { title: aTbl_grid.name }, view: { title: aTbl_grid.name },
user: syncDB.user, user: syncDB.user,
req:{} req: {},
}); });
recordPerfStats(_perfStart, 'dbView.update'); recordPerfStats(_perfStart, 'dbView.update');
@ -1527,8 +1527,8 @@ export class AtImportProcessor {
url: attachment.url, url: attachment.url,
size: attachment.size, size: attachment.size,
mimetype: attachment.type, mimetype: attachment.type,
})), req:{} })),
req: {},
}); });
} catch (e) { } catch (e) {
console.log(e); console.log(e);
@ -1571,7 +1571,7 @@ export class AtImportProcessor {
ncCreatedProjectSchema = await this.basesService.baseCreate({ ncCreatedProjectSchema = await this.basesService.baseCreate({
base: { title: projName }, base: { title: projName },
user: { id: syncDB.user.id }, user: { id: syncDB.user.id },
req:{} req: {},
}); });
recordPerfStats(_perfStart, 'base.create'); recordPerfStats(_perfStart, 'base.create');
@ -1622,7 +1622,7 @@ export class AtImportProcessor {
title: viewName, title: viewName,
}, },
user: syncDB.user, user: syncDB.user,
req:{} req: {},
}); });
recordPerfStats(_perfStart, 'dbView.galleryCreate'); recordPerfStats(_perfStart, 'dbView.galleryCreate');
@ -1689,7 +1689,7 @@ export class AtImportProcessor {
tableId: tblId, tableId: tblId,
body: formData, body: formData,
user: syncDB.user, user: syncDB.user,
req:{} req: {},
}); });
recordPerfStats(_perfStart, 'dbView.formCreate'); recordPerfStats(_perfStart, 'dbView.formCreate');
@ -1769,7 +1769,7 @@ export class AtImportProcessor {
grid: { grid: {
title: viewName, title: viewName,
}, },
req:{} req: {},
}); });
recordPerfStats(_perfStart, 'dbView.gridCreate'); recordPerfStats(_perfStart, 'dbView.gridCreate');
@ -2146,7 +2146,7 @@ export class AtImportProcessor {
viewId: viewId, viewId: viewId,
filter: ncFilters[i], filter: ncFilters[i],
user: syncDB.user, user: syncDB.user,
req:{} req: {},
}); });
recordPerfStats(_perfStart, 'dbTableFilter.create'); recordPerfStats(_perfStart, 'dbTableFilter.create');
@ -2225,7 +2225,7 @@ export class AtImportProcessor {
group_by_sort: group_by_sort:
ncGroup[i].direction === 'ascending' ? 'asc' : 'desc', ncGroup[i].direction === 'ascending' ? 'asc' : 'desc',
}, },
req:{} req: {},
}); });
} catch (e) { } catch (e) {
// ignore // ignore
@ -2247,7 +2247,7 @@ export class AtImportProcessor {
fk_column_id: columnId, fk_column_id: columnId,
direction: s.sortSet[i].ascending ? 'asc' : 'desc', direction: s.sortSet[i].ascending ? 'asc' : 'desc',
}, },
req:{} req: {},
}); });
recordPerfStats(_perfStart, 'dbTableSort.create'); recordPerfStats(_perfStart, 'dbTableSort.create');
} }
@ -2312,7 +2312,7 @@ export class AtImportProcessor {
show: false, show: false,
order: j + 1 + c.length, order: j + 1 + c.length,
}, },
req:{} req: {},
}); });
recordPerfStats(_perfStart, 'dbViewColumn.update'); recordPerfStats(_perfStart, 'dbViewColumn.update');
} }
@ -2340,7 +2340,7 @@ export class AtImportProcessor {
await this.formColumnsService.columnUpdate({ await this.formColumnsService.columnUpdate({
formViewColumnId: ncViewColumnId, formViewColumnId: ncViewColumnId,
formViewColumn: formData, formViewColumn: formData,
req:{} req: {},
}); });
recordPerfStats(_perfStart, 'dbView.formColumnUpdate'); recordPerfStats(_perfStart, 'dbView.formColumnUpdate');
} }
@ -2350,7 +2350,7 @@ export class AtImportProcessor {
viewId: viewId, viewId: viewId,
columnId: ncViewColumnId, columnId: ncViewColumnId,
column: configData, column: configData,
req:{} req: {},
}); });
recordPerfStats(_perfStart, 'dbViewColumn.update'); recordPerfStats(_perfStart, 'dbViewColumn.update');
} }

4
packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts

@ -72,7 +72,7 @@ export class DuplicateController {
...(body.base || {}), ...(body.base || {}),
}, },
user: { id: req.user.id }, user: { id: req.user.id },
req req,
}); });
const job = await this.jobsService.add(JobTypes.DuplicateBase, { const job = await this.jobsService.add(JobTypes.DuplicateBase, {
@ -142,7 +142,7 @@ export class DuplicateController {
...(body.base || {}), ...(body.base || {}),
}, },
user: { id: req.user.id }, user: { id: req.user.id },
req req,
}); });
const job = await this.jobsService.add(JobTypes.DuplicateBase, { const job = await this.jobsService.add(JobTypes.DuplicateBase, {

4
packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts

@ -104,14 +104,14 @@ export class DuplicateProcessor {
status: null, status: null,
}, },
user: req.user, user: req.user,
req req,
}); });
} catch (e) { } catch (e) {
if (dupProject?.id) { if (dupProject?.id) {
await this.projectsService.baseSoftDelete({ await this.projectsService.baseSoftDelete({
baseId: dupProject.id, baseId: dupProject.id,
user: req.user, user: req.user,
req req,
}); });
} }
throw e; throw e;

37
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), fk_parent_id: getIdOrExternalId(fl.fk_parent_id),
}), }),
user: param.user, user: param.user,
req:{} req: {},
}); });
idMap.set(fl.id, fg.id); idMap.set(fl.id, fg.id);
@ -915,7 +915,7 @@ export class ImportService {
...sr, ...sr,
fk_column_id: getIdOrExternalId(sr.fk_column_id), fk_column_id: getIdOrExternalId(sr.fk_column_id),
}), }),
req:{} req: {},
}); });
} }
@ -934,9 +934,9 @@ export class ImportService {
columnId: cl.id, columnId: cl.id,
column: { column: {
show: fcl.show, show: fcl.show,
order: fcl.order order: fcl.order,
}, },
req:{} req: {},
}); });
} }
@ -953,7 +953,7 @@ export class ImportService {
grid: { grid: {
...withoutNull(rest), ...withoutNull(rest),
}, },
req:{} req: {},
}); });
} }
break; break;
@ -969,7 +969,7 @@ export class ImportService {
formViewColumn: { formViewColumn: {
...withoutNull(rest), ...withoutNull(rest),
}, },
req:{} req: {},
}); });
} }
break; break;
@ -986,7 +986,7 @@ export class ImportService {
order: view.order, order: view.order,
}, },
user: param.user, user: param.user,
req:{} req: {},
}); });
} }
} }
@ -1014,7 +1014,7 @@ export class ImportService {
hook: { hook: {
...hookData, ...hookData,
}, },
req:{} req: {},
}); });
if (!hk) continue; if (!hk) continue;
@ -1031,7 +1031,7 @@ export class ImportService {
fk_parent_id: getIdOrExternalId(fl.fk_parent_id), fk_parent_id: getIdOrExternalId(fl.fk_parent_id),
}), }),
user: param.user, user: param.user,
req:{} req: {},
}); });
idMap.set(fl.id, fg.id); idMap.set(fl.id, fg.id);
@ -1059,7 +1059,7 @@ export class ImportService {
await this.gridsService.gridViewUpdate({ await this.gridsService.gridViewUpdate({
viewId: view.id, viewId: view.id,
grid: gridData, grid: gridData,
req:{} req: {},
}); });
} }
} }
@ -1071,14 +1071,14 @@ export class ImportService {
const gview = await this.gridsService.gridViewCreate({ const gview = await this.gridsService.gridViewCreate({
tableId: md.id, tableId: md.id,
grid: vw as ViewCreateReqType, grid: vw as ViewCreateReqType,
req:{} req: {},
}); });
const gridData = withoutNull(vw.view); const gridData = withoutNull(vw.view);
if (gridData) { if (gridData) {
await this.gridsService.gridViewUpdate({ await this.gridsService.gridViewUpdate({
viewId: gview.id, viewId: gview.id,
grid: gridData, grid: gridData,
req:{} req: {},
}); });
} }
return gview; return gview;
@ -1088,14 +1088,14 @@ export class ImportService {
tableId: md.id, tableId: md.id,
body: vw as ViewCreateReqType, body: vw as ViewCreateReqType,
user, user,
req:{} req: {},
}); });
const formData = withoutNull(vw.view); const formData = withoutNull(vw.view);
if (formData) { if (formData) {
await this.formsService.formViewUpdate({ await this.formsService.formViewUpdate({
formViewId: fview.id, formViewId: fview.id,
form: formData, form: formData,
req:{} req: {},
}); });
} }
return fview; return fview;
@ -1104,7 +1104,8 @@ export class ImportService {
const glview = await this.galleriesService.galleryViewCreate({ const glview = await this.galleriesService.galleryViewCreate({
tableId: md.id, tableId: md.id,
gallery: vw as ViewCreateReqType, gallery: vw as ViewCreateReqType,
user,req:{} user,
req: {},
}); });
const galleryData = withoutNull(vw.view); const galleryData = withoutNull(vw.view);
if (galleryData) { if (galleryData) {
@ -1118,7 +1119,7 @@ export class ImportService {
await this.galleriesService.galleryViewUpdate({ await this.galleriesService.galleryViewUpdate({
galleryViewId: glview.id, galleryViewId: glview.id,
gallery: galleryData, gallery: galleryData,
req:{} req: {},
}); });
} }
return glview; return glview;
@ -1128,7 +1129,7 @@ export class ImportService {
tableId: md.id, tableId: md.id,
kanban: vw as ViewCreateReqType, kanban: vw as ViewCreateReqType,
user, user,
req: {} req: {},
}); });
const kanbanData = withoutNull(vw.view); const kanbanData = withoutNull(vw.view);
if (kanbanData) { if (kanbanData) {
@ -1174,7 +1175,7 @@ export class ImportService {
await this.kanbansService.kanbanViewUpdate({ await this.kanbansService.kanbanViewUpdate({
kanbanViewId: kview.id, kanbanViewId: kview.id,
kanban: kanbanData, kanban: kanbanData,
req: {} req: {},
}); });
} }
return kview; return kview;

7
packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.processor.ts

@ -21,12 +21,15 @@ export class MetaSyncProcessor {
} = job.data; } = job.data;
if (info.sourceId === 'all') { if (info.sourceId === 'all') {
await this.metaDiffsService.metaDiffSync({ baseId: info.baseId, req: {} }); await this.metaDiffsService.metaDiffSync({
baseId: info.baseId,
req: {},
});
} else { } else {
await this.metaDiffsService.baseMetaDiffSync({ await this.metaDiffsService.baseMetaDiffSync({
baseId: info.baseId, baseId: info.baseId,
sourceId: info.sourceId, sourceId: info.sourceId,
req: {} req: {},
}); });
} }

2
packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.processor.ts

@ -18,7 +18,7 @@ export class SourceDeleteProcessor {
await this.sourcesService.baseDelete({ await this.sourcesService.baseDelete({
sourceId, sourceId,
req: {} req: {},
}); });
this.debugLog(`job completed for ${job.id}`); this.debugLog(`job completed for ${job.id}`);

10
packages/nocodb/src/services/api-tokens.service.ts

@ -14,7 +14,11 @@ export class ApiTokensService {
async apiTokenList(param: { userId: string }) { async apiTokenList(param: { userId: string }) {
return await ApiToken.list(param.userId); 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( validatePayload(
'swagger.json#/components/schemas/ApiTokenReq', 'swagger.json#/components/schemas/ApiTokenReq',
param.tokenBody, param.tokenBody,
@ -23,7 +27,7 @@ export class ApiTokensService {
this.appHooksService.emit(AppEvents.API_TOKEN_CREATE, { this.appHooksService.emit(AppEvents.API_TOKEN_CREATE, {
userId: param.userId, userId: param.userId,
tokenBody: param.tokenBody, tokenBody: param.tokenBody,
req: param.req req: param.req,
}); });
return await ApiToken.insert({ return await ApiToken.insert({
@ -44,7 +48,7 @@ export class ApiTokensService {
this.appHooksService.emit(AppEvents.API_TOKEN_DELETE, { this.appHooksService.emit(AppEvents.API_TOKEN_DELETE, {
userId: param.user?.id, userId: param.user?.id,
token: param.token, token: param.token,
req:param.req req: param.req,
}); });
// todo: verify token belongs to the user // todo: verify token belongs to the user

2
packages/nocodb/src/services/bases.service.ts

@ -63,7 +63,7 @@ export class BasesService {
baseId: string; baseId: string;
base: ProjectUpdateReqType; base: ProjectUpdateReqType;
user: UserType; user: UserType;
req:any req: any;
}) { }) {
validatePayload( validatePayload(
'swagger.json#/components/schemas/ProjectUpdateReq', 'swagger.json#/components/schemas/ProjectUpdateReq',

8
packages/nocodb/src/services/forms.service.ts

@ -52,7 +52,11 @@ export class FormsService {
return view; return view;
} }
async formViewUpdate(param: { formViewId: string; form: FormUpdateReqType; req: any }) { async formViewUpdate(param: {
formViewId: string;
form: FormUpdateReqType;
req: any;
}) {
validatePayload( validatePayload(
'swagger.json#/components/schemas/FormUpdateReq', 'swagger.json#/components/schemas/FormUpdateReq',
param.form, param.form,
@ -68,7 +72,7 @@ export class FormsService {
this.appHooksService.emit(AppEvents.VIEW_UPDATE, { this.appHooksService.emit(AppEvents.VIEW_UPDATE, {
view, view,
showAs: 'form', showAs: 'form',
req: param.req req: param.req,
}); });
return res; return res;

2
packages/nocodb/src/services/grid-columns.service.ts

@ -26,7 +26,7 @@ export class GridColumnsService {
const res = await GridViewColumn.update(param.gridViewColumnId, param.grid); const res = await GridViewColumn.update(param.gridViewColumnId, param.grid);
this.appHooksService.emit(AppEvents.GRID_COLUMN_UPDATE, { this.appHooksService.emit(AppEvents.GRID_COLUMN_UPDATE, {
req: param.req req: param.req,
}); });
return res; return res;

12
packages/nocodb/src/services/grids.service.ts

@ -10,7 +10,11 @@ import { GridView, View } from '~/models';
export class GridsService { export class GridsService {
constructor(private readonly appHooksService: AppHooksService) {} constructor(private readonly appHooksService: AppHooksService) {}
async gridViewCreate(param: { tableId: string; grid: ViewCreateReqType; req:any}) { async gridViewCreate(param: {
tableId: string;
grid: ViewCreateReqType;
req: any;
}) {
validatePayload( validatePayload(
'swagger.json#/components/schemas/ViewCreateReq', 'swagger.json#/components/schemas/ViewCreateReq',
param.grid, param.grid,
@ -32,7 +36,11 @@ export class GridsService {
return view; return view;
} }
async gridViewUpdate(param: { viewId: string; grid: GridUpdateReqType; req: any }) { async gridViewUpdate(param: {
viewId: string;
grid: GridUpdateReqType;
req: any;
}) {
validatePayload( validatePayload(
'swagger.json#/components/schemas/GridUpdateReq', 'swagger.json#/components/schemas/GridUpdateReq',
param.grid, param.grid,

14
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); return await HookLog.list({ fk_hook_id: param.hookId }, param.query);
} }
async hookCreate(param: { tableId: string; hook: HookReqType; async hookCreate(param: { tableId: string; hook: HookReqType; req: any }) {
req: any
}) {
validatePayload('swagger.json#/components/schemas/HookReq', param.hook); validatePayload('swagger.json#/components/schemas/HookReq', param.hook);
this.validateHookPayload(param.hook.notification); this.validateHookPayload(param.hook.notification);
@ -57,9 +55,7 @@ export class HooksService {
return hook; return hook;
} }
async hookDelete(param: { hookId: string async hookDelete(param: { hookId: string; req: any }) {
req: any
}) {
const hook = await Hook.get(param.hookId); const hook = await Hook.get(param.hookId);
if (!hook) { if (!hook) {
@ -98,7 +94,11 @@ export class HooksService {
return res; return res;
} }
async hookTest(param: { tableId: string; hookTest: HookTestReqType; req: any }) { async hookTest(param: {
tableId: string;
hookTest: HookTestReqType;
req: any;
}) {
validatePayload( validatePayload(
'swagger.json#/components/schemas/HookTestReq', 'swagger.json#/components/schemas/HookTestReq',
param.hookTest, param.hookTest,

4
packages/nocodb/src/services/kanbans.service.ts

@ -41,7 +41,7 @@ export class KanbansService {
showAs: 'kanban', showAs: 'kanban',
user: param.user, user: param.user,
req: param.req req: param.req,
}); });
return view; return view;
@ -68,7 +68,7 @@ export class KanbansService {
this.appHooksService.emit(AppEvents.VIEW_UPDATE, { this.appHooksService.emit(AppEvents.VIEW_UPDATE, {
view, view,
showAs: 'kanban', showAs: 'kanban',
req: param.req req: param.req,
}); });
return res; return res;

6
packages/nocodb/src/services/maps.service.ts

@ -35,13 +35,15 @@ export class MapsService {
view, view,
showAs: 'map', showAs: 'map',
req: param.req req: param.req,
}); });
return view; return view;
} }
async mapViewUpdate(param: { mapViewId: string; map: MapUpdateReqType; async mapViewUpdate(param: {
mapViewId: string;
map: MapUpdateReqType;
req: any; req: any;
}) { }) {
validatePayload('swagger.json#/components/schemas/MapUpdateReq', param.map); validatePayload('swagger.json#/components/schemas/MapUpdateReq', param.map);

6
packages/nocodb/src/services/meta-diffs.service.ts

@ -896,7 +896,11 @@ export class MetaDiffsService {
return true; 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 base = await Base.getWithInfo(param.baseId);
const source = await Source.get(param.sourceId); const source = await Source.get(param.sourceId);

15
packages/nocodb/src/services/notifications.service.ts

@ -37,7 +37,8 @@ export class NotificationsService implements OnModuleInit, OnModuleDestroy {
{ {
const { base, user, invitedBy } = data as ProjectInviteEvent; const { base, user, invitedBy } = data as ProjectInviteEvent;
await this.insertNotification({ await this.insertNotification(
{
fk_user_id: user.id, fk_user_id: user.id,
type: AppEvents.PROJECT_INVITE, type: AppEvents.PROJECT_INVITE,
body: { body: {
@ -45,20 +46,24 @@ export class NotificationsService implements OnModuleInit, OnModuleDestroy {
title: base.title, title: base.title,
type: base.type, type: base.type,
invited_by: invitedBy.email, invited_by: invitedBy.email,
}
}, },
req,); },
req,
);
} }
break; break;
case AppEvents.WELCOME: case AppEvents.WELCOME:
{ {
const { user, req } = data as WelcomeEvent; const { user, req } = data as WelcomeEvent;
await this.insertNotification({ await this.insertNotification(
{
fk_user_id: user.id, fk_user_id: user.id,
type: AppEvents.WELCOME, type: AppEvents.WELCOME,
body: {}, body: {},
}, req); },
req,
);
} }
break; break;
} }

10
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; req: any;
}) { }) {
validatePayload( validatePayload(
@ -52,15 +54,13 @@ export class OrgTokensService {
tokenBody: param.apiToken, tokenBody: param.apiToken,
userId: param.user?.id, userId: param.user?.id,
req: param.req req: param.req,
}); });
return apiToken; return apiToken;
} }
async apiTokenDelete(param: { user: User; token: string; async apiTokenDelete(param: { user: User; token: string; req: any }) {
req: any;
}) {
const fk_user_id = param.user.id; const fk_user_id = param.user.id;
const apiToken = await ApiToken.getByToken(param.token); const apiToken = await ApiToken.getByToken(param.token);
if ( if (

10
packages/nocodb/src/services/plugins.service.ts

@ -22,7 +22,7 @@ export class PluginsService {
this.appHooksService.emit(AppEvents.PLUGIN_TEST, { this.appHooksService.emit(AppEvents.PLUGIN_TEST, {
testBody: param.body, testBody: param.body,
req: param.req req: param.req,
}); });
return await NcPluginMgrv2.test(param.body); return await NcPluginMgrv2.test(param.body);
} }
@ -30,7 +30,11 @@ export class PluginsService {
async pluginRead(param: { pluginId: string }) { async pluginRead(param: { pluginId: string }) {
return await Plugin.get(param.pluginId); 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); validatePayload('swagger.json#/components/schemas/PluginReq', param.plugin);
const plugin = await Plugin.update(param.pluginId, 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.active ? AppEvents.PLUGIN_INSTALL : AppEvents.PLUGIN_UNINSTALL,
{ {
plugin, plugin,
req: param.req req: param.req,
}, },
); );

11
packages/nocodb/src/services/shared-bases.service.ts

@ -26,7 +26,7 @@ export class SharedBasesService {
password: string; password: string;
siteUrl: string; siteUrl: string;
req: any req: any;
}): Promise<any> { }): Promise<any> {
validatePayload('swagger.json#/components/schemas/SharedBaseReq', param); validatePayload('swagger.json#/components/schemas/SharedBaseReq', param);
@ -74,7 +74,7 @@ export class SharedBasesService {
roles: string; roles: string;
password: string; password: string;
siteUrl: string; siteUrl: string;
req:any req: any;
}): Promise<any> { }): Promise<any> {
validatePayload('swagger.json#/components/schemas/SharedBaseReq', param); validatePayload('swagger.json#/components/schemas/SharedBaseReq', param);
@ -110,7 +110,7 @@ export class SharedBasesService {
this.appHooksService.emit(AppEvents.SHARED_BASE_GENERATE_LINK, { this.appHooksService.emit(AppEvents.SHARED_BASE_GENERATE_LINK, {
link: data.url, link: data.url,
base, base,
req: param.req req: param.req,
}); });
return data; return data;
} }
@ -130,8 +130,9 @@ export class SharedBasesService {
return `${siteUrl}${config.dashboardPath}#/base/${base.uuid}`; return `${siteUrl}${config.dashboardPath}#/base/${base.uuid}`;
} }
async disableSharedBaseLink(param: { baseId: string async disableSharedBaseLink(param: {
req:any baseId: string;
req: any;
}): Promise<any> { }): Promise<any> {
const base = await Base.get(param.baseId); const base = await Base.get(param.baseId);

16
packages/nocodb/src/services/sorts.service.ts

@ -14,9 +14,7 @@ export class SortsService {
return Sort.get(param.sortId); return Sort.get(param.sortId);
} }
async sortDelete(param: { sortId: string async sortDelete(param: { sortId: string; req: any }) {
req: any
}) {
const sort = await Sort.get(param.sortId); const sort = await Sort.get(param.sortId);
if (!sort) { if (!sort) {
@ -27,14 +25,12 @@ export class SortsService {
this.appHooksService.emit(AppEvents.SORT_CREATE, { this.appHooksService.emit(AppEvents.SORT_CREATE, {
sort, sort,
req: param.req req: param.req,
}); });
return true; return true;
} }
async sortUpdate(param: { sortId: any; sort: SortReqType async sortUpdate(param: { sortId: any; sort: SortReqType; req: any }) {
req: any
}) {
validatePayload('swagger.json#/components/schemas/SortReq', param.sort); validatePayload('swagger.json#/components/schemas/SortReq', param.sort);
const sort = await Sort.get(param.sortId); const sort = await Sort.get(param.sortId);
@ -48,15 +44,13 @@ export class SortsService {
this.appHooksService.emit(AppEvents.SORT_UPDATE, { this.appHooksService.emit(AppEvents.SORT_UPDATE, {
sort, sort,
req: param.req req: param.req,
}); });
return res; return res;
} }
async sortCreate(param: { viewId: any; sort: SortReqType async sortCreate(param: { viewId: any; sort: SortReqType; req: any }) {
req: any
}) {
validatePayload('swagger.json#/components/schemas/SortReq', param.sort); validatePayload('swagger.json#/components/schemas/SortReq', param.sort);
const sort = await Sort.insert({ const sort = await Sort.insert({

10
packages/nocodb/src/services/sync.service.ts

@ -33,15 +33,13 @@ export class SyncService {
this.appHooksService.emit(AppEvents.SYNC_SOURCE_CREATE, { this.appHooksService.emit(AppEvents.SYNC_SOURCE_CREATE, {
syncSource: sync, syncSource: sync,
req: param.req req: param.req,
}); });
return sync; return sync;
} }
async syncDelete(param: { syncId: string async syncDelete(param: { syncId: string; req: any }) {
req: any
}) {
const syncSource = await SyncSource.get(param.syncId); const syncSource = await SyncSource.get(param.syncId);
if (!syncSource) { if (!syncSource) {
@ -52,7 +50,7 @@ export class SyncService {
this.appHooksService.emit(AppEvents.SYNC_SOURCE_DELETE, { this.appHooksService.emit(AppEvents.SYNC_SOURCE_DELETE, {
syncSource, syncSource,
req: param.req req: param.req,
}); });
return res; return res;
} }
@ -73,7 +71,7 @@ export class SyncService {
this.appHooksService.emit(AppEvents.SYNC_SOURCE_UPDATE, { this.appHooksService.emit(AppEvents.SYNC_SOURCE_UPDATE, {
syncSource, syncSource,
req: param.req req: param.req,
}); });
return res; return res;

6
packages/nocodb/src/services/users/users.service.ts

@ -91,7 +91,7 @@ export class UsersService {
salt, salt,
password, password,
email_verification_token, email_verification_token,
req req,
}: { }: {
email: string; email: string;
salt: any; salt: any;
@ -353,7 +353,7 @@ export class UsersService {
this.appHooksService.emit(AppEvents.USER_EMAIL_VERIFICATION, { this.appHooksService.emit(AppEvents.USER_EMAIL_VERIFICATION, {
user: user, user: user,
ip: req?.clientIp, ip: req?.clientIp,
req req,
}); });
return true; return true;
@ -549,7 +549,7 @@ export class UsersService {
// create new base for user // create new base for user
const base = await this.basesService.createDefaultBase({ const base = await this.basesService.createDefaultBase({
user, user,
req req,
}); });
return base; return base;

12
packages/nocodb/src/services/view-columns.service.ts

@ -12,8 +12,10 @@ export class ViewColumnsService {
async columnList(param: { viewId: string }) { async columnList(param: { viewId: string }) {
return await View.getColumns(param.viewId, undefined); return await View.getColumns(param.viewId, undefined);
} }
async columnAdd(param: { viewId: string; column: ViewColumnReqType async columnAdd(param: {
req: any viewId: string;
column: ViewColumnReqType;
req: any;
}) { }) {
validatePayload( validatePayload(
'swagger.json#/components/schemas/ViewColumnReq', 'swagger.json#/components/schemas/ViewColumnReq',
@ -30,7 +32,7 @@ export class ViewColumnsService {
); );
this.appHooksService.emit(AppEvents.VIEW_COLUMN_CREATE, { this.appHooksService.emit(AppEvents.VIEW_COLUMN_CREATE, {
viewColumn, viewColumn,
req:param.req req: param.req,
}); });
return viewColumn; return viewColumn;
@ -40,7 +42,7 @@ export class ViewColumnsService {
viewId: string; viewId: string;
columnId: string; columnId: string;
column: ViewColumnUpdateReqType; column: ViewColumnUpdateReqType;
req: any req: any;
}) { }) {
validatePayload( validatePayload(
'swagger.json#/components/schemas/ViewColumnUpdateReq', 'swagger.json#/components/schemas/ViewColumnUpdateReq',
@ -55,7 +57,7 @@ export class ViewColumnsService {
this.appHooksService.emit(AppEvents.VIEW_COLUMN_UPDATE, { this.appHooksService.emit(AppEvents.VIEW_COLUMN_UPDATE, {
viewColumn: param.column, viewColumn: param.column,
req: param.req req: param.req,
}); });
return result; return result;

16
packages/nocodb/src/services/views.service.ts

@ -91,9 +91,7 @@ export class ViewsService {
return filteredViewList; return filteredViewList;
} }
async shareView(param: { viewId: string; user: UserType async shareView(param: { viewId: string; user: UserType; req: any }) {
req: any;
}) {
const res = await View.share(param.viewId); const res = await View.share(param.viewId);
const view = await View.get(param.viewId); const view = await View.get(param.viewId);
@ -105,7 +103,7 @@ export class ViewsService {
this.appHooksService.emit(AppEvents.SHARED_VIEW_CREATE, { this.appHooksService.emit(AppEvents.SHARED_VIEW_CREATE, {
user: param.user, user: param.user,
view, view,
req: param.req req: param.req,
}); });
return res; return res;
@ -137,14 +135,12 @@ export class ViewsService {
}, },
user: param.user, user: param.user,
req: param.req req: param.req,
}); });
return result; return result;
} }
async viewDelete(param: { viewId: string; user: UserType async viewDelete(param: { viewId: string; user: UserType; req: any }) {
req: any;
}) {
const view = await View.get(param.viewId); const view = await View.get(param.viewId);
if (!view) { if (!view) {
@ -184,7 +180,7 @@ export class ViewsService {
this.appHooksService.emit(AppEvents.SHARED_VIEW_UPDATE, { this.appHooksService.emit(AppEvents.SHARED_VIEW_UPDATE, {
user: param.user, user: param.user,
view, view,
req: param.req req: param.req,
}); });
return result; return result;
@ -201,7 +197,7 @@ export class ViewsService {
this.appHooksService.emit(AppEvents.SHARED_VIEW_DELETE, { this.appHooksService.emit(AppEvents.SHARED_VIEW_DELETE, {
user: param.user, user: param.user,
view, view,
req: param.req req: param.req,
}); });
return true; return true;

Loading…
Cancel
Save