feat: configure export year window and publish ZIP archives under 99 MB
All checks were successful
Mostovik Backend CI/CD / Tests and lint (push) Successful in 4m1s
Mostovik Backend CI/CD / Build linux/amd64 release images (push) Successful in 4m9s
Mostovik Backend CI/CD / Deploy and verify internal main (push) Has been skipped
Mostovik Backend CI/CD / Deploy dev (push) Successful in 3m5s

This commit is contained in:
Aleksandr Meshchryakov
2026-11-03 10:02:04 +01:00
parent a7bf5412e9
commit f0a0266495
12 changed files with 1018 additions and 55 deletions

View File

@@ -36,12 +36,16 @@ export function addSourceExportCatalog(document) {
schemas.SourceExportPart = object({ part_id: uuid, year, dataset_key: string, title: string, part_number: positive, parts_count: positive, records_count: positive,
default_format: format, variants: { ...array(ref('SourceExportArtifact')), minItems: 1 } });
schemas.SourceExportPagination = object({ page: positive, page_size: { ...positive, maximum: 200 }, total_count: integer, total_pages: positive, has_next: bool, has_previous: bool });
schemas.SourceExportSourceDetail = object({ ...snapshot, current_generation_id: nullable(uuid), description: ref('SourceExportDescription'), datasets: array(ref('SourceExportDataset')), files: array(ref('SourceExportPart')) });
schemas.SourceExportPolicy = object({ years_back: integer, min_year: positive, max_year: positive, archive_max_bytes: positive });
schemas.SourceExportArchive = object({ archive_id: uuid, artifact_id: uuid, archive_number: positive, archives_count: positive, format,
years: array(positive), file_name: string, mime_type: string, size_bytes: positive, sha256: string, part_ids: array(uuid) });
schemas.SourceExportSourceDetail = object({ ...snapshot, current_generation_id: nullable(uuid), export_policy: nullable(ref('SourceExportPolicy')), archives: array(ref('SourceExportArchive')), description: ref('SourceExportDescription'), datasets: array(ref('SourceExportDataset')), files: array(ref('SourceExportPart')) });
schemas.SourceExportSourceDetailResponse = envelope(ref('SourceExportSourceDetail'), object({ pagination: ref('SourceExportPagination') }));
schemas.SourceExportAuthenticationError = object({ detail: string });
schemas.SourceExportError = object({ detail: string, code: string, field: nullable(string), retryable: bool, request_id: uuid });
schemas.SourceExportFileTicketRequest = object({ selection_kind: enumeration(['file']), source_group: group, generation_id: uuid, part_id: uuid, format });
schemas.SourceExportArchiveTicketRequest = object({ selection_kind: enumeration(['source_archive']), source_group: group, generation_id: uuid, format });
schemas.SourceExportNumberedArchiveTicketRequest = object({ selection_kind: enumeration(['source_archive']), source_group: group, generation_id: uuid, archive_id: uuid, format });
schemas.OrganizationSourceRecordExportRequest.additionalProperties = false;
schemas.SourceRecordExportTicket.additionalProperties = false;
schemas.SourceRecordExportTicket.required = Object.keys(schemas.SourceRecordExportTicket.properties);
@@ -63,7 +67,7 @@ export function addSourceExportCatalog(document) {
] : [];
}
const ticket = document.paths[base + 'export-ticket/'].post;
ticket.requestBody = { required: true, content: json({ oneOf: ['OrganizationSourceRecordExportRequest', 'SourceExportFileTicketRequest', 'SourceExportArchiveTicketRequest'].map(ref) }) };
ticket.requestBody = { required: true, content: json({ oneOf: ['OrganizationSourceRecordExportRequest', 'SourceExportFileTicketRequest', 'SourceExportArchiveTicketRequest', 'SourceExportNumberedArchiveTicketRequest'].map(ref) }) };
ticket.responses = { ...errorResponses, 201: response({ oneOf: ['SourceRecordExportTicket', 'SourceExportSelectionTicket'].map(ref) }), 401: response(ref('SourceExportAuthenticationError'), 'Authentication required') };
const download = document.paths[base + 'export-download/'].post;
download.requestBody = { required: true, content: { 'application/x-www-form-urlencoded': { schema: ref('SourceRecordExportDownloadRequest') } } };