feat: добавить версионирование source image
- добавлен endpoint создания новой версии asset - реализовано переключение currentVersion через image_asset_versions - обновлена документация business API и dev smoke flow
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
|
||||
import { AssetsService } from "./assets.service"
|
||||
import { AssetResponseDto, AssetVariantsResponseDto, AssetsListResponseDto } from "./asset-response.dto"
|
||||
import { CreateAssetVersionRequestDto, CreateAssetVersionResponseDto } from "./create-asset-version.dto"
|
||||
import { CreateAssetVariantsRequestDto, CreateAssetVariantsResponseDto } from "./create-asset-variants.dto"
|
||||
import { CreateAssetRequestDto, CreateAssetResponseDto } from "./create-asset.dto"
|
||||
|
||||
@@ -58,6 +59,24 @@ export class AssetsController {
|
||||
return this.assets.getAsset(publicId)
|
||||
}
|
||||
|
||||
@Post(":publicId/versions")
|
||||
@ApiOperation({
|
||||
summary: "создать новую версию source image",
|
||||
description:
|
||||
"Регистрирует новый source URL для существующего asset, увеличивает currentVersion и тем самым создаёт новый immutable Gateway URL `/v{version}` без purge старых URLs.",
|
||||
})
|
||||
@ApiParam({ description: "Публичный идентификатор asset.", example: "asset_demo", name: "publicId" })
|
||||
@ApiCreatedResponse({ description: "Новая версия source image создана и стала текущей.", type: CreateAssetVersionResponseDto })
|
||||
@ApiBadRequestResponse({ description: "Некорректный sourceUrl или source host запрещён настройками." })
|
||||
@ApiConflictResponse({ description: "Версия asset изменилась конкурентно." })
|
||||
@ApiNotFoundResponse({ description: "Asset не найден." })
|
||||
createAssetVersion(
|
||||
@Param("publicId") publicId: string,
|
||||
@Body() request: CreateAssetVersionRequestDto,
|
||||
): Promise<CreateAssetVersionResponseDto> {
|
||||
return this.assets.createAssetVersion(publicId, request)
|
||||
}
|
||||
|
||||
@Get(":publicId/variants")
|
||||
@ApiOperation({
|
||||
summary: "получить variants asset",
|
||||
|
||||
Reference in New Issue
Block a user