import { UmbDocumentCreateBlueprintServerDataSource } from './document-create-blueprint.server.data-source.js';
import { UmbControllerBase } from '../../../../../../libs/class-api/index.js';
import { UMB_NOTIFICATION_CONTEXT } from '../../../../../core/notification/index.js';
export class UmbDocumentCreateBlueprintRepository extends UmbControllerBase {
    #dataSource = new UmbDocumentCreateBlueprintServerDataSource(this);
    #notificationContext;
    constructor(host) {
        super(host);
        this.consumeContext(UMB_NOTIFICATION_CONTEXT, (instance) => {
            this.#notificationContext = instance;
        });
    }
    async create(body) {
        const { data, error } = await this.#dataSource.create(body);
        if (!error) {
            const notification = { data: { message: `Document Blueprint created` } };
            this.#notificationContext.peek('positive', notification);
            return { data };
        }
        return { error };
    }
}
export { UmbDocumentCreateBlueprintRepository as api };
