Browse Source

refactor: proper request type in controllers

pull/6914/head
Pranav C 11 months ago
parent
commit
256a88118d
  1. 19
      packages/nocodb/src/controllers/auth/auth.controller.ts
  2. 2
      packages/nocodb/src/controllers/forms.controller.ts
  3. 1
      packages/nocodb/src/controllers/galleries.controller.ts
  4. 3
      packages/nocodb/src/controllers/hooks.controller.ts
  5. 1
      packages/nocodb/src/controllers/kanbans.controller.ts
  6. 1
      packages/nocodb/src/controllers/maps.controller.ts
  7. 9
      packages/nocodb/src/controllers/notifications.controller.ts
  8. 7
      packages/nocodb/src/controllers/org-tokens.controller.ts
  9. 9
      packages/nocodb/src/controllers/org-users.controller.ts
  10. 3
      packages/nocodb/src/controllers/public-metas.controller.ts
  11. 9
      packages/nocodb/src/controllers/shared-bases.controller.ts
  12. 5
      packages/nocodb/src/controllers/utils.controller.ts
  13. 9
      packages/nocodb/src/controllers/views.controller.ts
  14. 9
      packages/nocodb/src/modules/jobs/jobs.controller.ts
  15. 5
      packages/nocodb/src/modules/jobs/jobs/at-import/at-import.controller.ts
  16. 3
      packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.controller.ts
  17. 3
      packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.controller.ts
  18. 1
      packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.controller.ts
  19. 7
      packages/nocodb/src/types/express.d.ts

19
packages/nocodb/src/controllers/auth/auth.controller.ts

@ -5,10 +5,11 @@ import {
HttpCode, HttpCode,
Param, Param,
Post, Post,
Request, Req,
Response, Res,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request, Response } from 'express';
import { AuthGuard } from '@nestjs/passport'; import { AuthGuard } from '@nestjs/passport';
import { ConfigService } from '@nestjs/config'; import { ConfigService } from '@nestjs/config';
import { extractRolesObj } from 'nocodb-sdk'; import { extractRolesObj } from 'nocodb-sdk';
@ -41,7 +42,7 @@ export class AuthController {
]) ])
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@HttpCode(200) @HttpCode(200)
async signup(@Req() req: Request, @Response() res: any): Promise<any> { async signup(@Req() req: Request, @Res() res:Response): Promise<any> {
if (this.config.get('auth', { infer: true }).disableEmailAuth) { if (this.config.get('auth', { infer: true }).disableEmailAuth) {
NcError.forbidden('Email authentication is disabled'); NcError.forbidden('Email authentication is disabled');
} }
@ -61,7 +62,7 @@ export class AuthController {
]) ])
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@HttpCode(200) @HttpCode(200)
async refreshToken(@Req() req: Request, @Response() res: any): Promise<any> { async refreshToken(@Req() req: Request, @Res() res:Response): Promise<any> {
res.json( res.json(
await this.usersService.refreshToken({ await this.usersService.refreshToken({
body: req.body, body: req.body,
@ -78,7 +79,7 @@ export class AuthController {
]) ])
@UseGuards(PublicApiLimiterGuard, AuthGuard('local')) @UseGuards(PublicApiLimiterGuard, AuthGuard('local'))
@HttpCode(200) @HttpCode(200)
async signin(@Request() req, @Response() res) { async signin(@Req() req:Request, @Res() res:Response) {
if (this.config.get('auth', { infer: true }).disableEmailAuth) { if (this.config.get('auth', { infer: true }).disableEmailAuth) {
NcError.forbidden('Email authentication is disabled'); NcError.forbidden('Email authentication is disabled');
} }
@ -89,7 +90,7 @@ export class AuthController {
@UseGuards(GlobalGuard) @UseGuards(GlobalGuard)
@Post('/api/v1/auth/user/signout') @Post('/api/v1/auth/user/signout')
@HttpCode(200) @HttpCode(200)
async signOut(@Request() req, @Response() res): Promise<any> { async signOut(@Req() req:Request, @Res() res:Response): Promise<any> {
if (!(req as any).isAuthenticated()) { if (!(req as any).isAuthenticated()) {
NcError.forbidden('Not allowed'); NcError.forbidden('Not allowed');
} }
@ -104,7 +105,7 @@ export class AuthController {
@Post(`/auth/google/genTokenByCode`) @Post(`/auth/google/genTokenByCode`)
@HttpCode(200) @HttpCode(200)
@UseGuards(PublicApiLimiterGuard, AuthGuard('google')) @UseGuards(PublicApiLimiterGuard, AuthGuard('google'))
async googleSignin(@Request() req, @Response() res) { async googleSignin(@Req() req:Request, @Res() res:Response) {
await this.setRefreshToken({ req, res }); await this.setRefreshToken({ req, res });
res.json(await this.usersService.login(req.user, req)); res.json(await this.usersService.login(req.user, req));
} }
@ -117,7 +118,7 @@ export class AuthController {
@Get(['/auth/user/me', '/api/v1/db/auth/user/me', '/api/v1/auth/user/me']) @Get(['/auth/user/me', '/api/v1/db/auth/user/me', '/api/v1/auth/user/me'])
@UseGuards(MetaApiLimiterGuard, GlobalGuard) @UseGuards(MetaApiLimiterGuard, GlobalGuard)
async me(@Request() req) { async me(@Req() req:Request) {
const user = { const user = {
...req.user, ...req.user,
roles: extractRolesObj(req.user.roles), roles: extractRolesObj(req.user.roles),
@ -228,7 +229,7 @@ export class AuthController {
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
async renderPasswordReset( async renderPasswordReset(
@Req() req: Request, @Req() req: Request,
@Response() res: any, @Res() res:Response,
@Param('tokenId') tokenId: string, @Param('tokenId') tokenId: string,
): Promise<any> { ): Promise<any> {
try { try {

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

@ -7,9 +7,9 @@ import {
Patch, Patch,
Post, Post,
Req, Req,
Request,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { ViewCreateReqType } from 'nocodb-sdk'; import { ViewCreateReqType } from 'nocodb-sdk';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { FormsService } from '~/services/forms.service'; import { FormsService } from '~/services/forms.service';

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

@ -9,6 +9,7 @@ import {
Req, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { GalleryUpdateReqType, ViewCreateReqType } from 'nocodb-sdk'; import { GalleryUpdateReqType, ViewCreateReqType } from 'nocodb-sdk';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { GalleriesService } from '~/services/galleries.service'; import { GalleriesService } from '~/services/galleries.service';

3
packages/nocodb/src/controllers/hooks.controller.ts

@ -7,9 +7,10 @@ import {
Param, Param,
Patch, Patch,
Post, Post,
Request, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { HookReqType, HookTestReqType } from 'nocodb-sdk'; import { HookReqType, HookTestReqType } from 'nocodb-sdk';
import type { HookType } from 'nocodb-sdk'; import type { HookType } from 'nocodb-sdk';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';

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

@ -9,6 +9,7 @@ import {
Req, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { ViewCreateReqType } from 'nocodb-sdk'; import { ViewCreateReqType } from 'nocodb-sdk';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { KanbansService } from '~/services/kanbans.service'; import { KanbansService } from '~/services/kanbans.service';

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

@ -9,6 +9,7 @@ import {
Req, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { MapUpdateReqType, ViewCreateReqType } from 'nocodb-sdk'; import { MapUpdateReqType, ViewCreateReqType } from 'nocodb-sdk';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { MapsService } from '~/services/maps.service'; import { MapsService } from '~/services/maps.service';

9
packages/nocodb/src/controllers/notifications.controller.ts

@ -7,9 +7,10 @@ import {
Param, Param,
Patch, Patch,
Post, Post,
Request, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { NotificationsService } from '~/services/notifications.service'; import { NotificationsService } from '~/services/notifications.service';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { extractProps } from '~/helpers/extractProps'; import { extractProps } from '~/helpers/extractProps';
@ -36,7 +37,7 @@ export class NotificationsController {
async notificationUpdate( async notificationUpdate(
@Param('notificationId') notificationId, @Param('notificationId') notificationId,
@Body() body, @Body() body,
@Request() req, @Req() req:Request,
) { ) {
return this.notificationsService.notificationUpdate({ return this.notificationsService.notificationUpdate({
notificationId, notificationId,
@ -47,7 +48,7 @@ export class NotificationsController {
@Post('/api/v1/notifications/mark-all-read') @Post('/api/v1/notifications/mark-all-read')
@HttpCode(200) @HttpCode(200)
async markAllRead(@Request() req) { async markAllRead(@Req() req:Request) {
return this.notificationsService.markAllRead({ return this.notificationsService.markAllRead({
user: req.user, user: req.user,
}); });
@ -57,7 +58,7 @@ export class NotificationsController {
// @Acl('notificationDelete') // @Acl('notificationDelete')
async notificationDelete( async notificationDelete(
@Param('notificationId') notificationId, @Param('notificationId') notificationId,
@Request() req, @Req() req:Request,
) { ) {
return this.notificationsService.notificationUpdate({ return this.notificationsService.notificationUpdate({
notificationId, notificationId,

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

@ -6,9 +6,10 @@ import {
HttpCode, HttpCode,
Param, Param,
Post, Post,
Request, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { ApiTokenReqType } from 'nocodb-sdk'; import { ApiTokenReqType } from 'nocodb-sdk';
import { AuthGuard } from '@nestjs/passport'; import { AuthGuard } from '@nestjs/passport';
import { getConditionalHandler } from '~/helpers/getHandler'; import { getConditionalHandler } from '~/helpers/getHandler';
@ -46,7 +47,7 @@ export class OrgTokensController {
scope: 'org', scope: 'org',
blockApiTokenAccess: true, blockApiTokenAccess: true,
}) })
async apiTokenCreate(@Request() req, @Body() body: ApiTokenReqType) { async apiTokenCreate(@Req() req:Request, @Body() body: ApiTokenReqType) {
return await this.orgTokensService.apiTokenCreate({ return await this.orgTokensService.apiTokenCreate({
apiToken: body, apiToken: body,
user: req['user'], user: req['user'],
@ -60,7 +61,7 @@ export class OrgTokensController {
// allowedRoles: [OrgUserRoles.SUPER], // allowedRoles: [OrgUserRoles.SUPER],
blockApiTokenAccess: true, blockApiTokenAccess: true,
}) })
async apiTokenDelete(@Request() req, @Param('token') token: string) { async apiTokenDelete(@Req() req:Request, @Param('token') token: string) {
await this.orgTokensService.apiTokenDelete({ await this.orgTokensService.apiTokenDelete({
token, token,
user: req['user'], user: req['user'],

9
packages/nocodb/src/controllers/org-users.controller.ts

@ -7,9 +7,10 @@ import {
Param, Param,
Patch, Patch,
Post, Post,
Request, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { OrgUserRoles } from 'nocodb-sdk'; import { OrgUserRoles } 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';
@ -75,7 +76,7 @@ export class OrgUsersController {
allowedRoles: [OrgUserRoles.SUPER_ADMIN], allowedRoles: [OrgUserRoles.SUPER_ADMIN],
blockApiTokenAccess: true, blockApiTokenAccess: true,
}) })
async userAdd(@Body() body, @Request() req) { async userAdd(@Body() body, @Req() req: Request) {
const result = await this.orgUsersService.userAdd({ const result = await this.orgUsersService.userAdd({
user: req.body, user: req.body,
req, req,
@ -104,7 +105,7 @@ export class OrgUsersController {
blockApiTokenAccess: true, blockApiTokenAccess: true,
}) })
async userInviteResend( async userInviteResend(
@Request() req, @Req() req: Request,
@Param('userId') userId: string, @Param('userId') userId: string,
): Promise<any> { ): Promise<any> {
await this.orgUsersService.userInviteResend({ await this.orgUsersService.userInviteResend({
@ -122,7 +123,7 @@ export class OrgUsersController {
allowedRoles: [OrgUserRoles.SUPER_ADMIN], allowedRoles: [OrgUserRoles.SUPER_ADMIN],
blockApiTokenAccess: true, blockApiTokenAccess: true,
}) })
async generateResetUrl(@Request() req, @Param('userId') userId: string) { async generateResetUrl(@Req() req: Request, @Param('userId') userId: string) {
const result = await this.orgUsersService.generateResetUrl({ const result = await this.orgUsersService.generateResetUrl({
siteUrl: req.ncSiteUrl, siteUrl: req.ncSiteUrl,
userId, userId,

3
packages/nocodb/src/controllers/public-metas.controller.ts

@ -1,4 +1,5 @@
import { Controller, Get, Param, Request, UseGuards } from '@nestjs/common'; import { Controller, Get, Param, Req, UseGuards } from '@nestjs/common';
import { Request } from 'express';
import { PublicMetasService } from '~/services/public-metas.service'; import { PublicMetasService } from '~/services/public-metas.service';
import { PublicApiLimiterGuard } from '~/guards/public-api-limiter.guard'; import { PublicApiLimiterGuard } from '~/guards/public-api-limiter.guard';

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

@ -7,9 +7,10 @@ import {
Param, Param,
Patch, Patch,
Post, Post,
Request, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { SharedBasesService } from '~/services/shared-bases.service'; import { SharedBasesService } from '~/services/shared-bases.service';
import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware'; import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware';
@ -27,7 +28,7 @@ export class SharedBasesController {
@HttpCode(200) @HttpCode(200)
@Acl('createSharedBaseLink') @Acl('createSharedBaseLink')
async createSharedBaseLink( async createSharedBaseLink(
@Request() req, @Req() req:Request,
@Body() body: any, @Body() body: any,
@Param('baseId') baseId: string, @Param('baseId') baseId: string,
): Promise<any> { ): Promise<any> {
@ -48,7 +49,7 @@ export class SharedBasesController {
]) ])
@Acl('updateSharedBaseLink') @Acl('updateSharedBaseLink')
async updateSharedBaseLink( async updateSharedBaseLink(
@Request() req, @Req() req:Request,
@Body() body: any, @Body() body: any,
@Param('baseId') baseId: string, @Param('baseId') baseId: string,
): Promise<any> { ): Promise<any> {
@ -86,7 +87,7 @@ export class SharedBasesController {
]) ])
@Acl('getSharedBaseLink') @Acl('getSharedBaseLink')
async getSharedBaseLink( async getSharedBaseLink(
@Request() req, @Req() req:Request,
@Param('baseId') baseId: string, @Param('baseId') baseId: string,
): Promise<any> { ): Promise<any> {
const sharedBase = await this.sharedBasesService.getSharedBaseLink({ const sharedBase = await this.sharedBasesService.getSharedBaseLink({

5
packages/nocodb/src/controllers/utils.controller.ts

@ -6,9 +6,10 @@ import {
Get, Get,
HttpCode, HttpCode,
Post, Post,
Request, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { UtilsService } from '~/services/utils.service'; import { UtilsService } from '~/services/utils.service';
import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware'; import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware';
@ -48,7 +49,7 @@ export class UtilsController {
scope: 'org', scope: 'org',
}) })
@HttpCode(200) @HttpCode(200)
async testConnection(@Body() body: any, @Request() _req: any) { async testConnection(@Body() body: any, @Req() _req: Request) {
body.pool = { body.pool = {
min: 0, min: 0,
max: 1, max: 1,

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

@ -8,9 +8,10 @@ import {
Patch, Patch,
Post, Post,
Query, Query,
Request, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { ViewUpdateReqType } from 'nocodb-sdk'; import { ViewUpdateReqType } from 'nocodb-sdk';
import { PagedResponseImpl } from '~/helpers/PagedResponse'; import { PagedResponseImpl } from '~/helpers/PagedResponse';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
@ -101,7 +102,7 @@ export class ViewsController {
]) ])
@HttpCode(200) @HttpCode(200)
@Acl('shareView') @Acl('shareView')
async shareView(@Param('viewId') viewId: string, @Request() req) { async shareView(@Param('viewId') viewId: string, @Req() req:Request) {
return await this.viewsService.shareView({ viewId, user: req.user, req }); return await this.viewsService.shareView({ viewId, user: req.user, req });
} }
@ -126,7 +127,7 @@ export class ViewsController {
async shareViewUpdate( async shareViewUpdate(
@Param('viewId') viewId: string, @Param('viewId') viewId: string,
@Body() body: ViewUpdateReqType, @Body() body: ViewUpdateReqType,
@Request() req, @Req() req:Request,
) { ) {
return await this.viewsService.shareViewUpdate({ return await this.viewsService.shareViewUpdate({
viewId, viewId,
@ -141,7 +142,7 @@ export class ViewsController {
'/api/v2/meta/views/:viewId/share', '/api/v2/meta/views/:viewId/share',
]) ])
@Acl('shareViewDelete') @Acl('shareViewDelete')
async shareViewDelete(@Param('viewId') viewId: string, @Request() req) { async shareViewDelete(@Param('viewId') viewId: string, @Req() req:Request) {
return await this.viewsService.shareViewDelete({ return await this.viewsService.shareViewDelete({
viewId, viewId,
user: req.user, user: req.user,

9
packages/nocodb/src/modules/jobs/jobs.controller.ts

@ -4,10 +4,11 @@ import {
HttpCode, HttpCode,
Inject, Inject,
Post, Post,
Request, Req,
Response, Res,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request, Response } from 'express';
import { OnEvent } from '@nestjs/event-emitter'; import { OnEvent } from '@nestjs/event-emitter';
import { customAlphabet } from 'nanoid'; import { customAlphabet } from 'nanoid';
import { ModuleRef } from '@nestjs/core'; import { ModuleRef } from '@nestjs/core';
@ -46,7 +47,7 @@ export class JobsController implements OnModuleInit {
@Post('/jobs/listen') @Post('/jobs/listen')
@HttpCode(200) @HttpCode(200)
async listen( async listen(
@Response() res, @Res() res:Response &{resId?:string},
@Req() req: Request, @Req() req: Request,
@Body() body: { _mid: number; data: { id: string } }, @Body() body: { _mid: number; data: { id: string } },
) { ) {
@ -134,7 +135,7 @@ export class JobsController implements OnModuleInit {
res.on('close', () => { res.on('close', () => {
if (jobId && this.jobRooms[jobId]?.listeners) { if (jobId && this.jobRooms[jobId]?.listeners) {
this.jobRooms[jobId].listeners = this.jobRooms[jobId].listeners.filter( this.jobRooms[jobId].listeners = this.jobRooms[jobId].listeners.filter(
(r) => r.resId !== res.resId, (r) => r.resId !== (res as any).resId,
); );
} }
}); });

5
packages/nocodb/src/modules/jobs/jobs/at-import/at-import.controller.ts

@ -3,9 +3,10 @@ import {
HttpCode, HttpCode,
Inject, Inject,
Post, Post,
Request, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware'; import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware';
import { SyncSource } from '~/models'; import { SyncSource } from '~/models';
@ -69,7 +70,7 @@ export class AtImportController {
]) ])
@Acl('airtableImport') @Acl('airtableImport')
@HttpCode(200) @HttpCode(200)
async abortImport(@Request() _) { async abortImport() {
return {}; return {};
} }
} }

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

@ -5,9 +5,10 @@ import {
Inject, Inject,
Param, Param,
Post, Post,
Request, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { ProjectStatus } from 'nocodb-sdk'; import { ProjectStatus } from 'nocodb-sdk';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware'; import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware';

3
packages/nocodb/src/modules/jobs/jobs/meta-sync/meta-sync.controller.ts

@ -4,9 +4,10 @@ import {
Inject, Inject,
Param, Param,
Post, Post,
Request, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware'; import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware';
import { NcError } from '~/helpers/catchError'; import { NcError } from '~/helpers/catchError';

1
packages/nocodb/src/modules/jobs/jobs/source-delete/source-delete.controller.ts

@ -6,6 +6,7 @@ import {
Req, Req,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { Request } from 'express';
import { GlobalGuard } from '~/guards/global/global.guard'; import { GlobalGuard } from '~/guards/global/global.guard';
import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware'; import { Acl } from '~/middlewares/extract-ids/extract-ids.middleware';
import { NcError } from '~/helpers/catchError'; import { NcError } from '~/helpers/catchError';

7
packages/nocodb/src/types/express.d.ts vendored

@ -18,9 +18,10 @@ import { Express } from 'express-serve-static-core';
// } // }
declare module 'express-serve-static-core' { declare module 'express-serve-static-core' {
interface Request { interface Request {
// id?: string; ncWorkspaceId?: string;
// ncWorkspaceId?: string; ncProjectId?: string;
// ncProjectId?: string;
user: any; user: any;
ncSiteUrl: string;
clientIp: string;
} }
} }

Loading…
Cancel
Save