refactor: split maintenance dto for integrity checks

This commit is contained in:
izzy
2025-12-17 15:04:45 +00:00
parent 21c26dd65f
commit 08e532170f
15 changed files with 242 additions and 238 deletions

View File

@@ -331,7 +331,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MaintenanceGetIntegrityReportDto"
"$ref": "#/components/schemas/IntegrityGetReportDto"
}
}
},
@@ -342,7 +342,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MaintenanceIntegrityReportResponseDto"
"$ref": "#/components/schemas/IntegrityReportResponseDto"
}
}
},
@@ -554,7 +554,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MaintenanceIntegrityReportSummaryResponseDto"
"$ref": "#/components/schemas/IntegrityReportSummaryResponseDto"
}
}
},
@@ -16862,6 +16862,77 @@
],
"type": "string"
},
"IntegrityGetReportDto": {
"properties": {
"type": {
"allOf": [
{
"$ref": "#/components/schemas/IntegrityReportType"
}
]
}
},
"required": [
"type"
],
"type": "object"
},
"IntegrityReportDto": {
"properties": {
"id": {
"type": "string"
},
"path": {
"type": "string"
},
"type": {
"allOf": [
{
"$ref": "#/components/schemas/IntegrityReportType"
}
]
}
},
"required": [
"id",
"path",
"type"
],
"type": "object"
},
"IntegrityReportResponseDto": {
"properties": {
"items": {
"items": {
"$ref": "#/components/schemas/IntegrityReportDto"
},
"type": "array"
}
},
"required": [
"items"
],
"type": "object"
},
"IntegrityReportSummaryResponseDto": {
"properties": {
"checksum_mismatch": {
"type": "integer"
},
"missing_file": {
"type": "integer"
},
"orphan_file": {
"type": "integer"
}
},
"required": [
"checksum_mismatch",
"missing_file",
"orphan_file"
],
"type": "object"
},
"IntegrityReportType": {
"enum": [
"orphan_file",
@@ -17204,77 +17275,6 @@
],
"type": "object"
},
"MaintenanceGetIntegrityReportDto": {
"properties": {
"type": {
"allOf": [
{
"$ref": "#/components/schemas/IntegrityReportType"
}
]
}
},
"required": [
"type"
],
"type": "object"
},
"MaintenanceIntegrityReportDto": {
"properties": {
"id": {
"type": "string"
},
"path": {
"type": "string"
},
"type": {
"allOf": [
{
"$ref": "#/components/schemas/IntegrityReportType"
}
]
}
},
"required": [
"id",
"path",
"type"
],
"type": "object"
},
"MaintenanceIntegrityReportResponseDto": {
"properties": {
"items": {
"items": {
"$ref": "#/components/schemas/MaintenanceIntegrityReportDto"
},
"type": "array"
}
},
"required": [
"items"
],
"type": "object"
},
"MaintenanceIntegrityReportSummaryResponseDto": {
"properties": {
"checksum_mismatch": {
"type": "integer"
},
"missing_file": {
"type": "integer"
},
"orphan_file": {
"type": "integer"
}
},
"required": [
"checksum_mismatch",
"missing_file",
"orphan_file"
],
"type": "object"
},
"MaintenanceLoginDto": {
"properties": {
"token": {

View File

@@ -40,18 +40,18 @@ export type ActivityStatisticsResponseDto = {
comments: number;
likes: number;
};
export type MaintenanceGetIntegrityReportDto = {
export type IntegrityGetReportDto = {
"type": IntegrityReportType;
};
export type MaintenanceIntegrityReportDto = {
export type IntegrityReportDto = {
id: string;
path: string;
"type": IntegrityReportType;
};
export type MaintenanceIntegrityReportResponseDto = {
items: MaintenanceIntegrityReportDto[];
export type IntegrityReportResponseDto = {
items: IntegrityReportDto[];
};
export type MaintenanceIntegrityReportSummaryResponseDto = {
export type IntegrityReportSummaryResponseDto = {
checksum_mismatch: number;
missing_file: number;
orphan_file: number;
@@ -1887,16 +1887,16 @@ export function unlinkAllOAuthAccountsAdmin(opts?: Oazapfts.RequestOpts) {
/**
* Get integrity report by type
*/
export function getIntegrityReport({ maintenanceGetIntegrityReportDto }: {
maintenanceGetIntegrityReportDto: MaintenanceGetIntegrityReportDto;
export function getIntegrityReport({ integrityGetReportDto }: {
integrityGetReportDto: IntegrityGetReportDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 201;
data: MaintenanceIntegrityReportResponseDto;
data: IntegrityReportResponseDto;
}>("/admin/integrity/report", oazapfts.json({
...opts,
method: "POST",
body: maintenanceGetIntegrityReportDto
body: integrityGetReportDto
})));
}
/**
@@ -1942,7 +1942,7 @@ export function getIntegrityReportCsv({ $type }: {
export function getIntegrityReportSummary(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: MaintenanceIntegrityReportSummaryResponseDto;
data: IntegrityReportSummaryResponseDto;
}>("/admin/integrity/summary", {
...opts
}));