/**
 * A class that represents a DWN error.
 */
export class DwnError extends Error {
    constructor(code, message) {
        super(`${code}: ${message}`);
        this.code = code;
        this.name = 'DwnError';
    }
}
/**
 * DWN SDK error codes.
 */
export var DwnErrorCode;
(function (DwnErrorCode) {
    DwnErrorCode["AuthenticateJwsMissing"] = "AuthenticateJwsMissing";
    DwnErrorCode["AuthenticateDescriptorCidMismatch"] = "AuthenticateDescriptorCidMismatch";
    DwnErrorCode["AuthenticationMoreThanOneSignatureNotSupported"] = "AuthenticationMoreThanOneSignatureNotSupported";
    DwnErrorCode["AuthorizationUnknownAuthor"] = "AuthorizationUnknownAuthor";
    DwnErrorCode["AuthorizationNotGrantedToAuthor"] = "AuthorizationNotGrantedToAuthor";
    DwnErrorCode["ComputeCidCodecNotSupported"] = "ComputeCidCodecNotSupported";
    DwnErrorCode["ComputeCidMultihashNotSupported"] = "ComputeCidMultihashNotSupported";
    DwnErrorCode["DidMethodNotSupported"] = "DidMethodNotSupported";
    DwnErrorCode["DidNotString"] = "DidNotString";
    DwnErrorCode["DidNotValid"] = "DidNotValid";
    DwnErrorCode["DidResolutionFailed"] = "DidResolutionFailed";
    DwnErrorCode["Ed25519InvalidJwk"] = "Ed25519InvalidJwk";
    DwnErrorCode["GeneralJwsVerifierGetPublicKeyNotFound"] = "GeneralJwsVerifierGetPublicKeyNotFound";
    DwnErrorCode["GeneralJwsVerifierInvalidSignature"] = "GeneralJwsVerifierInvalidSignature";
    DwnErrorCode["GrantAuthorizationGrantExpired"] = "GrantAuthorizationGrantExpired";
    DwnErrorCode["GrantAuthorizationGrantMissing"] = "GrantAuthorizationGrantMissing";
    DwnErrorCode["GrantAuthorizationGrantRevoked"] = "GrantAuthorizationGrantRevoked";
    DwnErrorCode["GrantAuthorizationInterfaceMismatch"] = "GrantAuthorizationInterfaceMismatch";
    DwnErrorCode["GrantAuthorizationMethodMismatch"] = "GrantAuthorizationMethodMismatch";
    DwnErrorCode["GrantAuthorizationNotGrantedForTenant"] = "GrantAuthorizationNotGrantedForTenant";
    DwnErrorCode["GrantAuthorizationNotGrantedToAuthor"] = "GrantAuthorizationNotGrantedToAuthor";
    DwnErrorCode["GrantAuthorizationGrantNotYetActive"] = "GrantAuthorizationGrantNotYetActive";
    DwnErrorCode["HdKeyDerivationPathInvalid"] = "HdKeyDerivationPathInvalid";
    DwnErrorCode["JwsVerifySignatureUnsupportedCrv"] = "JwsVerifySignatureUnsupportedCrv";
    DwnErrorCode["JwsDecodePlainObjectPayloadInvalid"] = "JwsDecodePlainObjectPayloadInvalid";
    DwnErrorCode["MessageGetInvalidCid"] = "MessageGetInvalidCid";
    DwnErrorCode["ParseCidCodecNotSupported"] = "ParseCidCodecNotSupported";
    DwnErrorCode["ParseCidMultihashNotSupported"] = "ParseCidMultihashNotSupported";
    DwnErrorCode["PermissionsGrantGrantedByMismatch"] = "PermissionsGrantGrantedByMismatch";
    DwnErrorCode["PermissionsGrantNotADelegatedGrant"] = "PermissionsGrantNotADelegatedGrant";
    DwnErrorCode["PermissionsGrantScopeContextIdAndProtocolPath"] = "PermissionsGrantScopeContextIdAndProtocolPath";
    DwnErrorCode["PermissionsGrantScopeSchemaProhibitedFields"] = "PermissionsGrantScopeSchemaProhibitedFields";
    DwnErrorCode["PermissionsGrantUnauthorizedGrant"] = "PermissionsGrantUnauthorizedGrant";
    DwnErrorCode["PermissionsRevokeMissingPermissionsGrant"] = "PermissionsRevokeMissingPermissionsGrant";
    DwnErrorCode["PermissionsRevokeUnauthorizedRevoke"] = "PermissionsRevokeUnauthorizedRevoke";
    DwnErrorCode["PrivateKeySignerUnableToDeduceAlgorithm"] = "PrivateKeySignerUnableToDeduceAlgorithm";
    DwnErrorCode["PrivateKeySignerUnableToDeduceKeyId"] = "PrivateKeySignerUnableToDeduceKeyId";
    DwnErrorCode["PrivateKeySignerUnsupportedCurve"] = "PrivateKeySignerUnsupportedCurve";
    DwnErrorCode["ProtocolAuthorizationActionNotAllowed"] = "ProtocolAuthorizationActionNotAllowed";
    DwnErrorCode["ProtocolAuthorizationDuplicateContextRoleRecipient"] = "ProtocolAuthorizationDuplicateContextRoleRecipient";
    DwnErrorCode["ProtocolAuthorizationDuplicateGlobalRoleRecipient"] = "ProtocolAuthorizationDuplicateGlobalRoleRecipient";
    DwnErrorCode["ProtocolAuthorizationIncorrectDataFormat"] = "ProtocolAuthorizationIncorrectDataFormat";
    DwnErrorCode["ProtocolAuthorizationIncorrectProtocolPath"] = "ProtocolAuthorizationIncorrectProtocolPath";
    DwnErrorCode["ProtocolAuthorizationInvalidSchema"] = "ProtocolAuthorizationInvalidSchema";
    DwnErrorCode["ProtocolAuthorizationInvalidType"] = "ProtocolAuthorizationInvalidType";
    DwnErrorCode["ProtocolAuthorizationMissingContextId"] = "ProtocolAuthorizationMissingContextId";
    DwnErrorCode["ProtocolAuthorizationMissingRole"] = "ProtocolAuthorizationMissingRole";
    DwnErrorCode["ProtocolAuthorizationMissingRuleSet"] = "ProtocolAuthorizationMissingRuleSet";
    DwnErrorCode["ProtocolAuthorizationParentlessIncorrectProtocolPath"] = "ProtocolAuthorizationParentlessIncorrectProtocolPath";
    DwnErrorCode["ProtocolAuthorizationNotARole"] = "ProtocolAuthorizationNotARole";
    DwnErrorCode["ProtocolAuthorizationParentNotFound"] = "ProtocolAuthorizationParentNotFound";
    DwnErrorCode["ProtocolAuthorizationProtocolNotFound"] = "ProtocolAuthorizationProtocolNotFound";
    DwnErrorCode["ProtocolAuthorizationQueryWithoutRole"] = "ProtocolAuthorizationQueryWithoutRole";
    DwnErrorCode["ProtocolAuthorizationRoleMissingRecipient"] = "ProtocolAuthorizationRoleMissingRecipient";
    DwnErrorCode["ProtocolsConfigureContextRoleAtProhibitedProtocolPath"] = "ProtocolsConfigureContextRoleAtProhibitedProtocolPath";
    DwnErrorCode["ProtocolsConfigureGlobalRoleAtProhibitedProtocolPath"] = "ProtocolsConfigureGlobalRoleAtProhibitedProtocolPath";
    DwnErrorCode["ProtocolsConfigureInvalidRole"] = "ProtocolsConfigureInvalidRole";
    DwnErrorCode["ProtocolsConfigureInvalidActionMissingOf"] = "ProtocolsConfigureInvalidActionMissingOf";
    DwnErrorCode["ProtocolsConfigureInvalidActionOfNotAllowed"] = "ProtocolsConfigureInvalidActionOfNotAllowed";
    DwnErrorCode["ProtocolsConfigureQueryNotAllowed"] = "ProtocolsConfigureQueryNotAllowed";
    DwnErrorCode["ProtocolsConfigureUnauthorized"] = "ProtocolsConfigureUnauthorized";
    DwnErrorCode["ProtocolsQueryUnauthorized"] = "ProtocolsQueryUnauthorized";
    DwnErrorCode["RecordsDecryptNoMatchingKeyEncryptedFound"] = "RecordsDecryptNoMatchingKeyEncryptedFound";
    DwnErrorCode["RecordsDeleteAuthorizationFailed"] = "RecordsDeleteAuthorizationFailed";
    DwnErrorCode["RecordsGrantAuthorizationConditionPublicationProhibited"] = "RecordsGrantAuthorizationConditionPublicationProhibited";
    DwnErrorCode["RecordsGrantAuthorizationConditionPublicationRequired"] = "RecordsGrantAuthorizationConditionPublicationRequired";
    DwnErrorCode["RecordsGrantAuthorizationScopeContextIdMismatch"] = "RecordsGrantAuthorizationScopeContextIdMismatch";
    DwnErrorCode["RecordsGrantAuthorizationScopeNotProtocol"] = "RecordsGrantAuthorizationScopeNotProtocol";
    DwnErrorCode["RecordsGrantAuthorizationScopeProtocolMismatch"] = "RecordsGrantAuthorizationScopeProtocolMismatch";
    DwnErrorCode["RecordsGrantAuthorizationScopeProtocolPathMismatch"] = "RecordsGrantAuthorizationScopeProtocolPathMismatch";
    DwnErrorCode["RecordsGrantAuthorizationScopeSchema"] = "RecordsGrantAuthorizationScopeSchema";
    DwnErrorCode["RecordsDerivePrivateKeyUnSupportedCurve"] = "RecordsDerivePrivateKeyUnSupportedCurve";
    DwnErrorCode["RecordsInvalidAncestorKeyDerivationSegment"] = "RecordsInvalidAncestorKeyDerivationSegment";
    DwnErrorCode["RecordsProtocolContextDerivationSchemeMissingContextId"] = "RecordsProtocolContextDerivationSchemeMissingContextId";
    DwnErrorCode["RecordsProtocolPathDerivationSchemeMissingProtocol"] = "RecordsProtocolPathDerivationSchemeMissingProtocol";
    DwnErrorCode["RecordsQueryFilterMissingRequiredProperties"] = "RecordsQueryFilterMissingRequiredProperties";
    DwnErrorCode["RecordsReadReturnedMultiple"] = "RecordsReadReturnedMultiple";
    DwnErrorCode["RecordsReadAuthorizationFailed"] = "RecordsReadAuthorizationFailed";
    DwnErrorCode["RecordsSchemasDerivationSchemeMissingSchema"] = "RecordsSchemasDerivationSchemeMissingSchema";
    DwnErrorCode["RecordsWriteAttestationIntegrityMoreThanOneSignature"] = "RecordsWriteAttestationIntegrityMoreThanOneSignature";
    DwnErrorCode["RecordsWriteAttestationIntegrityDescriptorCidMismatch"] = "RecordsWriteAttestationIntegrityDescriptorCidMismatch";
    DwnErrorCode["RecordsWriteAttestationIntegrityInvalidPayloadProperty"] = "RecordsWriteAttestationIntegrityInvalidPayloadProperty";
    DwnErrorCode["RecordsWriteAuthorizationFailed"] = "RecordsWriteAuthorizationFailed";
    DwnErrorCode["RecordsWriteCreateMissingSigner"] = "RecordsWriteCreateMissingSigner";
    DwnErrorCode["RecordsWriteCreateContextIdAndParentIdMutuallyInclusive"] = "RecordsWriteCreateContextIdAndParentIdMutuallyInclusive";
    DwnErrorCode["RecordsWriteCreateDataAndDataCidMutuallyExclusive"] = "RecordsWriteCreateDataAndDataCidMutuallyExclusive";
    DwnErrorCode["RecordsWriteCreateDataCidAndDataSizeMutuallyInclusive"] = "RecordsWriteCreateDataCidAndDataSizeMutuallyInclusive";
    DwnErrorCode["RecordsWriteCreateProtocolAndProtocolPathMutuallyInclusive"] = "RecordsWriteCreateProtocolAndProtocolPathMutuallyInclusive";
    DwnErrorCode["RecordsWriteDataCidMismatch"] = "RecordsWriteDataCidMismatch";
    DwnErrorCode["RecordsWriteDataSizeMismatch"] = "RecordsWriteDataSizeMismatch";
    DwnErrorCode["RecordsWriteGetEntryIdUndefinedAuthor"] = "RecordsWriteGetEntryIdUndefinedAuthor";
    DwnErrorCode["RecordsWriteGetInitialWriteNotFound"] = "RecordsWriteGetInitialWriteNotFound";
    DwnErrorCode["RecordsWriteImmutablePropertyChanged"] = "RecordsWriteImmutablePropertyChanged";
    DwnErrorCode["RecordsWriteMissingAuthorizationSigner"] = "RecordsWriteMissingAuthorizationSigner";
    DwnErrorCode["RecordsWriteMissingSigner"] = "RecordsWriteMissingSigner";
    DwnErrorCode["RecordsWriteMissingDataInPrevious"] = "RecordsWriteMissingDataInPrevious";
    DwnErrorCode["RecordsWriteMissingDataAssociation"] = "RecordsWriteMissingDataAssociation";
    DwnErrorCode["RecordsWriteMissingDataStream"] = "RecordsWriteMissingDataStream";
    DwnErrorCode["RecordsWriteMissingProtocol"] = "RecordsWriteMissingProtocol";
    DwnErrorCode["RecordsWriteMissingSchema"] = "RecordsWriteMissingSchema";
    DwnErrorCode["RecordsWriteOwnerAndTenantMismatch"] = "RecordsWriteOwnerAndTenantMismatch";
    DwnErrorCode["RecordsWriteSignAsOwnerUnknownAuthor"] = "RecordsWriteSignAsOwnerUnknownAuthor";
    DwnErrorCode["RecordsWriteValidateIntegrityAttestationMismatch"] = "RecordsWriteValidateIntegrityAttestationMismatch";
    DwnErrorCode["RecordsWriteValidateIntegrityContextIdMismatch"] = "RecordsWriteValidateIntegrityContextIdMismatch";
    DwnErrorCode["RecordsWriteValidateIntegrityContextIdNotInSignerSignaturePayload"] = "RecordsWriteValidateIntegrityContextIdNotInSignerSignaturePayload";
    DwnErrorCode["RecordsWriteValidateIntegrityDateCreatedMismatch"] = "RecordsWriteValidateIntegrityDateCreatedMismatch";
    DwnErrorCode["RecordsWriteValidateIntegrityDelegatedGrantAndIdExistenceMismatch"] = "RecordsWriteValidateIntegrityDelegatedGrantAndIdExistenceMismatch";
    DwnErrorCode["RecordsWriteValidateIntegrityEncryptionCidMismatch"] = "RecordsWriteValidateIntegrityEncryptionCidMismatch";
    DwnErrorCode["RecordsWriteValidateIntegrityGrantedToAndSignerMismatch"] = "RecordsWriteValidateIntegrityGrantedToAndSignerMismatch";
    DwnErrorCode["RecordsWriteValidateIntegrityRecordIdUnauthorized"] = "RecordsWriteValidateIntegrityRecordIdUnauthorized";
    DwnErrorCode["SchemaValidatorSchemaNotFound"] = "SchemaValidatorSchemaNotFound";
    DwnErrorCode["SchemaValidationFailure"] = "SchemaValidationFailure";
    DwnErrorCode["Secp256k1KeyNotValid"] = "Secp256k1KeyNotValid";
    DwnErrorCode["TimestampInvalid"] = "TimestampInvalid";
    DwnErrorCode["UrlProtocolNotNormalized"] = "UrlProtocolNotNormalized";
    DwnErrorCode["UrlProtocolNotNormalizable"] = "UrlProtocolNotNormalizable";
    DwnErrorCode["UrlSchemaNotNormalized"] = "UrlSchemaNotNormalized";
    DwnErrorCode["UrlSchemaNotNormalizable"] = "UrlSchemaNotNormalizable";
})(DwnErrorCode || (DwnErrorCode = {}));
;
//# sourceMappingURL=dwn-error.js.map