

import { AgentContext } from "../../agent/context/AgentContext.mjs";
import { injectable } from "../../plugins/index.mjs";
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 { MdocService } from "./MdocService.mjs";

//#region src/modules/mdoc/MdocApi.ts
var _ref, _ref2;
let MdocApi = class MdocApi$1 {
	constructor(agentContext, mdocService) {
		this.agentContext = agentContext;
		this.mdocService = mdocService;
	}
	/**
	* Create a new Mdoc, with a spcific doctype, namespace, and validity info.
	*
	* @param options {MdocSignOptions}
	* @returns {Promise<Mdoc>}
	*/
	async sign(options) {
		return await this.mdocService.signMdoc(this.agentContext, options);
	}
	/**
	*
	* Verify an incoming mdoc. It will check whether everything is valid, but also returns parts of the validation.
	*
	* For example, you might still want to continue with a flow if not all the claims are included, but the signature is valid.
	*
	*/
	async verify(mdoc, options) {
		return await this.mdocService.verifyMdoc(this.agentContext, mdoc, options);
	}
	/**
	* Create a Mdoc class from a base64url encoded Mdoc Issuer-Signed structure
	*/
	fromBase64Url(base64Url) {
		return Mdoc.fromBase64Url(base64Url);
	}
	async store(issuerSigned) {
		return await this.mdocService.store(this.agentContext, issuerSigned);
	}
	async getById(id) {
		return await this.mdocService.getById(this.agentContext, id);
	}
	async getAll() {
		return await this.mdocService.getAll(this.agentContext);
	}
	async findAllByQuery(query, queryOptions) {
		return await this.mdocService.findByQuery(this.agentContext, query, queryOptions);
	}
	async deleteById(id) {
		return await this.mdocService.deleteById(this.agentContext, id);
	}
	async update(mdocRecord) {
		return await this.mdocService.update(this.agentContext, mdocRecord);
	}
};
MdocApi = __decorate([injectable(), __decorateMetadata("design:paramtypes", [typeof (_ref = typeof AgentContext !== "undefined" && AgentContext) === "function" ? _ref : Object, typeof (_ref2 = typeof MdocService !== "undefined" && MdocService) === "function" ? _ref2 : Object])], MdocApi);

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