

const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.js');
const require_AgentContext = require('../../agent/context/AgentContext.js');
require('../../plugins/index.js');
const require_decorateMetadata = require('../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.js');
const require_decorate = require('../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.js');
require('../../agent/index.js');
const require_Mdoc = require('./Mdoc.js');
const require_MdocService = require('./MdocService.js');
let tsyringe = require("tsyringe");

//#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 require_Mdoc.Mdoc.fromBase64Url(base64Url);
	}
	async store(options) {
		return await this.mdocService.store(this.agentContext, options);
	}
	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 = require_decorate.__decorate([(0, tsyringe.injectable)(), require_decorateMetadata.__decorateMetadata("design:paramtypes", [typeof (_ref = typeof require_AgentContext.AgentContext !== "undefined" && require_AgentContext.AgentContext) === "function" ? _ref : Object, typeof (_ref2 = typeof require_MdocService.MdocService !== "undefined" && require_MdocService.MdocService) === "function" ? _ref2 : Object])], MdocApi);

//#endregion
Object.defineProperty(exports, 'MdocApi', {
  enumerable: true,
  get: function () {
    return MdocApi;
  }
});