import { UmbDocumentTypeImportServerDataSource } from './document-type-import.server.data-source.js';
import { UMB_NOTIFICATION_CONTEXT } from '../../../../../core/notification/index.js';
import { UmbRepositoryBase } from '../../../../../core/repository/index.js';
export class UmbDocumentTypeImportRepository extends UmbRepositoryBase {
    #importSource = new UmbDocumentTypeImportServerDataSource(this);
    async requestImport(temporaryUnique) {
        const { data, error } = await this.#importSource.import(temporaryUnique);
        if (!error) {
            const notificationContext = await this.getContext(UMB_NOTIFICATION_CONTEXT);
            if (!notificationContext) {
                throw new Error('Notification context not found');
            }
            const notification = { data: { message: `Imported` } };
            notificationContext.peek('positive', notification);
        }
        return { data, error };
    }
}
export { UmbDocumentTypeImportRepository as api };
