|
|
@ -15,6 +15,7 @@ import { PublicApiLimiterGuard } from '~/guards/public-api-limiter.guard'; |
|
|
|
import { MetaApiLimiterGuard } from '~/guards/meta-api-limiter.guard'; |
|
|
|
import { MetaApiLimiterGuard } from '~/guards/meta-api-limiter.guard'; |
|
|
|
import { TenantContext } from '~/decorators/tenant-context.decorator'; |
|
|
|
import { TenantContext } from '~/decorators/tenant-context.decorator'; |
|
|
|
import { NcContext } from '~/interface/config'; |
|
|
|
import { NcContext } from '~/interface/config'; |
|
|
|
|
|
|
|
import Noco from '~/Noco'; |
|
|
|
|
|
|
|
|
|
|
|
@Controller() |
|
|
|
@Controller() |
|
|
|
export class ApiDocsController { |
|
|
|
export class ApiDocsController { |
|
|
@ -55,24 +56,44 @@ export class ApiDocsController { |
|
|
|
@Get(['/api/v1/db/meta/projects/:baseId/swagger']) |
|
|
|
@Get(['/api/v1/db/meta/projects/:baseId/swagger']) |
|
|
|
@UseGuards(PublicApiLimiterGuard) |
|
|
|
@UseGuards(PublicApiLimiterGuard) |
|
|
|
swaggerHtml(@Param('baseId') baseId: string, @Response() res) { |
|
|
|
swaggerHtml(@Param('baseId') baseId: string, @Response() res) { |
|
|
|
res.send(getSwaggerHtml({ ncSiteUrl: process.env.NC_PUBLIC_URL || '' })); |
|
|
|
res.send( |
|
|
|
|
|
|
|
getSwaggerHtml({ |
|
|
|
|
|
|
|
ncSiteUrl: process.env.NC_PUBLIC_URL || '', |
|
|
|
|
|
|
|
dashboardPath: Noco.getConfig().dashboardPath || '', |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@UseGuards(PublicApiLimiterGuard) |
|
|
|
@UseGuards(PublicApiLimiterGuard) |
|
|
|
@Get(['/api/v1/db/meta/projects/:baseId/redoc']) |
|
|
|
@Get(['/api/v1/db/meta/projects/:baseId/redoc']) |
|
|
|
redocHtml(@Param('baseId') baseId: string, @Response() res) { |
|
|
|
redocHtml(@Param('baseId') baseId: string, @Response() res) { |
|
|
|
res.send(getRedocHtml({ ncSiteUrl: process.env.NC_PUBLIC_URL || '' })); |
|
|
|
res.send( |
|
|
|
|
|
|
|
getRedocHtml({ |
|
|
|
|
|
|
|
ncSiteUrl: process.env.NC_PUBLIC_URL || '', |
|
|
|
|
|
|
|
dashboardPath: Noco.getConfig().dashboardPath || '', |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Get(['/api/v2/meta/bases/:baseId/swagger']) |
|
|
|
@Get(['/api/v2/meta/bases/:baseId/swagger']) |
|
|
|
@UseGuards(PublicApiLimiterGuard) |
|
|
|
@UseGuards(PublicApiLimiterGuard) |
|
|
|
swaggerHtmlV2(@Param('baseId') baseId: string, @Response() res) { |
|
|
|
swaggerHtmlV2(@Param('baseId') baseId: string, @Response() res) { |
|
|
|
res.send(getSwaggerHtml({ ncSiteUrl: process.env.NC_PUBLIC_URL || '' })); |
|
|
|
res.send( |
|
|
|
|
|
|
|
getSwaggerHtml({ |
|
|
|
|
|
|
|
ncSiteUrl: process.env.NC_PUBLIC_URL || '', |
|
|
|
|
|
|
|
dashboardPath: Noco.getConfig().dashboardPath || '', |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@UseGuards(PublicApiLimiterGuard) |
|
|
|
@UseGuards(PublicApiLimiterGuard) |
|
|
|
@Get(['/api/v2/meta/bases/:baseId/redoc']) |
|
|
|
@Get(['/api/v2/meta/bases/:baseId/redoc']) |
|
|
|
redocHtmlV2(@Param('baseId') baseId: string, @Response() res) { |
|
|
|
redocHtmlV2(@Param('baseId') baseId: string, @Response() res) { |
|
|
|
res.send(getRedocHtml({ ncSiteUrl: process.env.NC_PUBLIC_URL || '' })); |
|
|
|
res.send( |
|
|
|
|
|
|
|
getRedocHtml({ |
|
|
|
|
|
|
|
ncSiteUrl: process.env.NC_PUBLIC_URL || '', |
|
|
|
|
|
|
|
dashboardPath: Noco.getConfig().dashboardPath || '', |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|