import { UmbExportMediaTypeRepository } from './repository/index.js';
import { blobDownload } from '../../../../core/utils/index.js';
import { UmbEntityActionBase } from '../../../../core/entity-action/index.js';
export class UmbExportMediaTypeEntityAction extends UmbEntityActionBase {
    #repository = new UmbExportMediaTypeRepository(this);
    async execute() {
        if (!this.args.unique)
            throw new Error('Unique is not available');
        const { data, error } = await this.#repository.requestExport(this.args.unique);
        if (error) {
            throw error;
        }
        blobDownload(data, `${this.args.unique}.udt`, 'text/xml');
    }
}
export default UmbExportMediaTypeEntityAction;
