{"version":3,"file":"module.cjs","sources":["../../../../../src/modules/abstract/did/module.js"],"sourcesContent":["import { AbstractBaseModule } from '../common';\nimport { withExtendedPrototypeProperties } from '../../../utils';\n\n/** Class to create, update and destroy DIDs */\nclass AbstractDIDModule extends AbstractBaseModule {\n  /**\n   * Creates a new DID document.\n   * @param {DIDDocument} didDocument - The DID Document to be created.\n   * @param {DidKeypair} didKeypair - The keypair used for signing the transaction.\n   * @param {Object} params - Additional parameters for creating the document (optional).\n   * @returns {Promise<*>} - A promise that resolves when the creation is complete.\n   */\n  async createDocument(didDocument, didKeypair, params) {\n    return await this.signAndSend(\n      await this.createDocumentTx(didDocument, didKeypair),\n      params,\n    );\n  }\n\n  /**\n   * Updates an existing DID document.\n   * @param {DIDDocument} didDocument - The updated DID Document.\n   * @param {DidKeypair} didKeypair - The keypair used for signing the transaction.\n   * @param {Object} params - Additional parameters for updating the document (optional).\n   * @returns {Promise<*>} - A promise that resolves when the update is complete.\n   */\n  async updateDocument(didDocument, didKeypair, params) {\n    return await this.signAndSend(\n      await this.updateDocumentTx(didDocument, didKeypair),\n      params,\n    );\n  }\n\n  /**\n   * Removes a DID document.\n   * @param {DockDid} did - The ID of the DID to be removed.\n   * @param {DidKeypair} didKeypair - The keypair used for signing the transaction.\n   * @param {Object} params - Additional parameters for removing the document (optional).\n   * @returns {Promise<*>} - A promise that resolves when the removal is complete.\n   */\n  async removeDocument(did, didKeypair, params) {\n    return await this.signAndSend(\n      await this.removeDocumentTx(did, didKeypair),\n      params,\n    );\n  }\n\n  /**\n   * Retrieves a DID document by ID.\n   * @param {DockDid} did - The ID of the DID to be retrieved.\n   * @returns {Promise<DIDDocument>} - A promise that resolves with the requested DID Document.\n   */\n  async getDocument(_did) {\n    throw new Error('Unimplemented');\n  }\n\n  /**\n   * Generates a transaction to create a new DID document.\n   * @param {DIDDocument} didDocument - The DID Document to be created.\n   * @param {DidKeypair} didKeypair - The keypair used for signing the transaction.\n   * @returns {Promise<*>} - A promise that resolves with the generated transaction.\n   */\n  async createDocumentTx(_didDocument, _didKeypair) {\n    throw new Error('Unimplemented');\n  }\n\n  /**\n   * Generates a transaction to update an existing DID document.\n   * @param {DIDDocument} didDocument - The updated DID Document.\n   * @param {DidKeypair} didKeypair - The keypair used for signing the transaction.\n   * @returns {Promise<*>} - A promise that resolves with the generated transaction.\n   */\n  async updateDocumentTx(_didDocument, _didKeypair) {\n    throw new Error('Unimplemented');\n  }\n\n  /**\n   * Generates a transaction to remove an existing DID document.\n   * @param {DockDid} did - The ID of the DID to be removed.\n   * @param {DidKeypair} didKeypair - The keypair used for signing the transaction.\n   * @returns {Promise<*>} - A promise that resolves with the generated transaction.\n   */\n  async removeDocumentTx(_did, _didKeypair) {\n    throw new Error('Unimplemented');\n  }\n}\n\nexport default withExtendedPrototypeProperties(\n  ['createDocumentTx', 'updateDocumentTx', 'removeDocumentTx', 'getDocument'],\n  AbstractDIDModule,\n);\n"],"names":["AbstractBaseModule","withExtendedPrototypeProperties","AbstractDIDModule"],"mappings":";;;;;;;;;;;;;;AAGA;0BACA,MAAM,iBAAiB,SAASA,0CAAkB,CAAC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE;AACxD,IAAI,OAAO,MAAM,IAAI,CAAC,WAAW;AACjC,MAAM,MAAM,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,UAAU,CAAC;AAC1D,MAAM,MAAM;AACZ,KAAK;AACL,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE;AACxD,IAAI,OAAO,MAAM,IAAI,CAAC,WAAW;AACjC,MAAM,MAAM,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,UAAU,CAAC;AAC1D,MAAM,MAAM;AACZ,KAAK;AACL,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;A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