@interoperability/atna-audit-messages
Version:
The ATNA Audit Messages Generator is a JavaScript library that provides a set of reusable static methods for generating Audit Trail and Node Authentication (ATNA) compliant audit messages. This library is particularly useful in healthcare systems and othe
36 lines (34 loc) • 967 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ValuePair = void 0;
var _ATNAComplexType = require("./ATNAComplexType.js");
var _XMLElement = require("../helpers/xml/XMLElement.js");
/**
* Represents a value pair element for ATNA.
*/
class ValuePair extends _ATNAComplexType.ATNAComplexType {
/**
* @param {string} type - The type of the value.
* @param {string} value - The value.
*/
constructor(type, value) {
super();
this.type = type;
this.value = value;
}
/**
* Prepares XML representation of the ValuePair element.
* @returns {XMLElement} - The XML representation of the ValuePair element.
*/
prepareXML() {
let attributes = {
type: this.type,
value: new Buffer.from(this.value).toString('base64')
};
this.xml = new _XMLElement.XMLElement().setAttributes(attributes).setName('ValuePair');
return this.xml;
}
}
exports.ValuePair = ValuePair;