mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): new version check (#9555)
This commit is contained in:
parent
4807fc40a6
commit
c03981ac1d
16 changed files with 257 additions and 102 deletions
|
|
@ -11,7 +11,7 @@ import _ from 'lodash';
|
|||
import { writeFileSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { SystemConfig } from 'src/config';
|
||||
import { CLIP_MODEL_INFO, serverVersion } from 'src/constants';
|
||||
import { CLIP_MODEL_INFO, isDev, serverVersion } from 'src/constants';
|
||||
import { ImmichCookie, ImmichHeader } from 'src/dtos/auth.dto';
|
||||
import { ILoggerRepository } from 'src/interfaces/logger.interface';
|
||||
import { Metadata } from 'src/middleware/auth.guard';
|
||||
|
|
@ -174,7 +174,7 @@ const patchOpenAPI = (document: OpenAPIObject) => {
|
|||
return document;
|
||||
};
|
||||
|
||||
export const useSwagger = (app: INestApplication, isDevelopment: boolean) => {
|
||||
export const useSwagger = (app: INestApplication) => {
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('Immich')
|
||||
.setDescription('Immich API')
|
||||
|
|
@ -211,7 +211,7 @@ export const useSwagger = (app: INestApplication, isDevelopment: boolean) => {
|
|||
|
||||
SwaggerModule.setup('doc', app, specification, customOptions);
|
||||
|
||||
if (isDevelopment) {
|
||||
if (isDev()) {
|
||||
// Generate API Documentation only in development mode
|
||||
const outputPath = path.resolve(process.cwd(), '../open-api/immich-openapi-specs.json');
|
||||
writeFileSync(outputPath, JSON.stringify(patchOpenAPI(specification), null, 2), { encoding: 'utf8' });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue