

import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.95.0/helpers/decorateMetadata.mjs";
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.95.0/helpers/decorate.mjs";
import "../../agent/index.mjs";
import { Mdoc } from "./Mdoc.mjs";
import { MdocDeviceResponse } from "./MdocDeviceResponse.mjs";
import { MdocRecord } from "./repository/MdocRecord.mjs";
import { MdocRepository } from "./repository/MdocRepository.mjs";
import "./repository/index.mjs";
import { injectable } from "tsyringe";

//#region src/modules/mdoc/MdocService.ts
var _ref;
let MdocService = class MdocService$1 {
	constructor(mdocRepository) {
		this.MdocRepository = mdocRepository;
	}
	mdocFromBase64Url(hexEncodedMdoc) {
		return Mdoc.fromBase64Url(hexEncodedMdoc);
	}
	signMdoc(agentContext, options) {
		return Mdoc.sign(agentContext, options);
	}
	async verifyMdoc(agentContext, mdoc, options) {
		return await mdoc.verify(agentContext, options);
	}
	async createDeviceResponse(agentContext, options) {
		return MdocDeviceResponse.createDeviceResponse(agentContext, options);
	}
	async createPresentationDefinitionDeviceResponse(agentContext, options) {
		return MdocDeviceResponse.createPresentationDefinitionDeviceResponse(agentContext, options);
	}
	async verifyDeviceResponse(agentContext, options) {
		return MdocDeviceResponse.fromBase64Url(options.deviceResponse).verify(agentContext, options);
	}
	async store(agentContext, mdoc) {
		const mdocRecord = new MdocRecord({ mdoc });
		await this.MdocRepository.save(agentContext, mdocRecord);
		return mdocRecord;
	}
	async getById(agentContext, id) {
		return await this.MdocRepository.getById(agentContext, id);
	}
	async getAll(agentContext) {
		return await this.MdocRepository.getAll(agentContext);
	}
	async findByQuery(agentContext, query, queryOptions) {
		return await this.MdocRepository.findByQuery(agentContext, query, queryOptions);
	}
	async deleteById(agentContext, id) {
		await this.MdocRepository.deleteById(agentContext, id);
	}
	async update(agentContext, mdocRecord) {
		await this.MdocRepository.update(agentContext, mdocRecord);
	}
};
MdocService = __decorate([injectable(), __decorateMetadata("design:paramtypes", [typeof (_ref = typeof MdocRepository !== "undefined" && MdocRepository) === "function" ? _ref : Object])], MdocService);

//#endregion
export { MdocService };
//# sourceMappingURL=MdocService.mjs.map