feat: add the TechLog Studio asset gateway port and JSON adapter
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import type {
|
||||
Asset,
|
||||
AssetDetail,
|
||||
AssetKind,
|
||||
AssetManagementStatus,
|
||||
AssetPage,
|
||||
UpdateAssetCommand,
|
||||
} from "../../contracts/studio/contract.ts";
|
||||
import type { IdempotentOptions, RequestOptions } from "./studio-gateway.ts";
|
||||
|
||||
export type ListAssetsQuery = Readonly<{
|
||||
q?: string;
|
||||
kind?: AssetKind;
|
||||
managementStatus?: AssetManagementStatus;
|
||||
cursor?: string;
|
||||
limit?: number;
|
||||
}>;
|
||||
|
||||
export type UploadAssetForm = Readonly<{
|
||||
file: File;
|
||||
kind: AssetKind;
|
||||
altText?: string;
|
||||
decorative?: boolean;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Asset은 `StudioGateway`와 별도 포트다. 파일 전송과 JSON orchestration은
|
||||
* 실패 모델이 다르고, 업로드 구현을 presigned/resumable로 바꿀 때 교체 범위가
|
||||
* 이 포트 뒤에서 끝나야 한다.
|
||||
*/
|
||||
export interface StudioAssetGateway {
|
||||
listAssets(query: ListAssetsQuery, options?: RequestOptions): Promise<AssetPage>;
|
||||
uploadAsset(form: UploadAssetForm, options: IdempotentOptions): Promise<Asset>;
|
||||
getAsset(assetId: string, options?: RequestOptions): Promise<AssetDetail>;
|
||||
updateAssetMetadata(
|
||||
assetId: string,
|
||||
command: UpdateAssetCommand,
|
||||
options: IdempotentOptions,
|
||||
): Promise<Asset>;
|
||||
deleteAsset(assetId: string, options: IdempotentOptions): Promise<void>;
|
||||
}
|
||||
Reference in New Issue
Block a user