@mos-connection/helper
Version:
Helper functions for the MOS-connection library
31 lines • 1.66 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MosObjList = void 0;
const MosMessage_1 = require("../MosMessage");
const XMLBuilder = require("xmlbuilder");
const xmlConversion_1 = require("../profile1/xmlConversion");
const Utils_1 = require("../../utils/Utils");
class MosObjList extends MosMessage_1.MosMessage {
constructor(options, strict) {
super('upper', strict);
this.options = options;
}
get messageXMLBlocks() {
const xmlMosObjList = XMLBuilder.create('mosObjList');
xmlMosObjList.att('username', this.options.username);
(0, Utils_1.addTextElementInternal)(xmlMosObjList, 'queryID', this.options.queryID, undefined, this.strict);
(0, Utils_1.addTextElementInternal)(xmlMosObjList, 'listReturnStart', this.options.listReturnStart, undefined, this.strict);
(0, Utils_1.addTextElementInternal)(xmlMosObjList, 'listReturnEnd', this.options.listReturnEnd, undefined, this.strict);
(0, Utils_1.addTextElementInternal)(xmlMosObjList, 'listReturnTotal', this.options.listReturnTotal, undefined, this.strict);
if (this.options.listReturnStatus)
(0, Utils_1.addTextElementInternal)(xmlMosObjList, 'listReturnStatus', this.options.listReturnStatus, undefined, this.strict);
if (this.options.list) {
const xmlList = XMLBuilder.create('list');
xmlConversion_1.XMLMosObjects.toXML(xmlList, this.options.list, this.strict);
xmlMosObjList.importDocument(xmlList);
}
return xmlMosObjList;
}
}
exports.MosObjList = MosObjList;
//# sourceMappingURL=mosObjList.js.map