feat: asset copy (#23172)

This commit is contained in:
Daniel Dietzler 2025-10-29 14:43:47 +01:00 committed by GitHub
parent fdfb04d83c
commit 4ae7cadeae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 644 additions and 2 deletions

View file

@ -517,6 +517,15 @@ export type AssetBulkUploadCheckResult = {
export type AssetBulkUploadCheckResponseDto = {
results: AssetBulkUploadCheckResult[];
};
export type AssetCopyDto = {
albums?: boolean;
favorite?: boolean;
sharedLinks?: boolean;
sidecar?: boolean;
sourceId: string;
stack?: boolean;
targetId: string;
};
export type CheckExistingAssetsDto = {
deviceAssetIds: string[];
deviceId: string;
@ -2256,6 +2265,18 @@ export function checkBulkUpload({ assetBulkUploadCheckDto }: {
body: assetBulkUploadCheckDto
})));
}
/**
* This endpoint requires the `asset.copy` permission.
*/
export function copyAsset({ assetCopyDto }: {
assetCopyDto: AssetCopyDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText("/assets/copy", oazapfts.json({
...opts,
method: "PUT",
body: assetCopyDto
})));
}
/**
* getAllUserAssetsByDeviceId
*/
@ -4796,6 +4817,7 @@ export enum Permission {
AssetDownload = "asset.download",
AssetUpload = "asset.upload",
AssetReplace = "asset.replace",
AssetCopy = "asset.copy",
AlbumCreate = "album.create",
AlbumRead = "album.read",
AlbumUpdate = "album.update",