1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

chore(server): sort open api params (#6484)

* chore: sort spec

* chore: open api

* chore(mobile): sort auditDeletes params

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
Jason Rasmussen 2024-01-22 11:49:51 -05:00 committed by GitHub
parent bd2dbb4944
commit 7b314f9435
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 1210 additions and 1191 deletions

View File

@ -53,7 +53,7 @@ class AssetService {
Future<(List<Asset>? toUpsert, List<String>? toDelete)>
_getRemoteAssetChanges(User user, DateTime since) async {
final deleted = await _apiService.auditApi
.getAuditDeletes(EntityType.ASSET, since, userId: user.id);
.getAuditDeletes(since, EntityType.ASSET, userId: user.id);
if (deleted == null || deleted.needsFullSync) return (null, null);
final assetDto = await _apiService.assetApi
.getAllAssets(userId: user.id, updatedAfter: since);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -20,10 +20,12 @@ import {
import { NextFunction, Response } from 'express';
import { writeFileSync } from 'fs';
import { access, constants } from 'fs/promises';
import _ from 'lodash';
import path, { isAbsolute } from 'path';
import { promisify } from 'util';
import { applyDecorators, UsePipes, ValidationPipe } from '@nestjs/common';
import { SchemaObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
import { Metadata } from './app.guard';
export function UseValidation() {
@ -110,8 +112,21 @@ export const routeToErrorMessage = (methodName: string) =>
const patchOpenAPI = (document: OpenAPIObject) => {
document.paths = sortKeys(document.paths);
if (document.components?.schemas) {
document.components.schemas = sortKeys(document.components.schemas);
const schemas = document.components.schemas as Record<string, SchemaObject>;
document.components.schemas = sortKeys(schemas);
for (const schema of Object.values(schemas)) {
if (schema.properties) {
schema.properties = sortKeys(schema.properties);
}
if (schema.required) {
schema.required = schema.required.sort();
}
}
}
for (const [key, value] of Object.entries(document.paths)) {
@ -152,6 +167,10 @@ const patchOpenAPI = (document: OpenAPIObject) => {
if (operation.description === '') {
delete operation.description;
}
if (operation.parameters) {
operation.parameters = _.orderBy(operation.parameters, 'name');
}
}
}