UNPKG

@mos-connection/helper

Version:

Helper functions for the MOS-connection library

47 lines 1.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MosReqObjActionDelete = exports.MosReqObjActionUpdate = exports.MosReqObjActionNew = void 0; const MosMessage_1 = require("../MosMessage"); const XMLBuilder = require("xmlbuilder"); const xmlConversion_1 = require("../profile1/xmlConversion"); class MosReqObjActionNew extends MosMessage_1.MosMessage { constructor(options, strict) { super('lower', strict); this.options = options; } get messageXMLBlocks() { const xml = XMLBuilder.create('mosReqObjAction'); xml.att('operation', 'NEW'); xmlConversion_1.XMLMosObject.toXML(xml, this.options.object, this.strict); return xml; } } exports.MosReqObjActionNew = MosReqObjActionNew; class MosReqObjActionUpdate extends MosMessage_1.MosMessage { constructor(options, strict) { super('lower', strict); this.options = options; } get messageXMLBlocks() { const xml = XMLBuilder.create('mosReqObjAction'); xml.att('operation', 'UPDATE'); xml.att('objID', this.mosTypes.mosString128.stringify(this.options.objectId)); xmlConversion_1.XMLMosObject.toXML(xml, this.options.object, this.strict); return xml; } } exports.MosReqObjActionUpdate = MosReqObjActionUpdate; class MosReqObjActionDelete extends MosMessage_1.MosMessage { constructor(options, strict) { super('lower', strict); this.options = options; } get messageXMLBlocks() { const xml = XMLBuilder.create('mosReqObjAction'); xml.att('operation', 'DELETE'); xml.att('objID', this.mosTypes.mosString128.stringify(this.options.objectId)); return xml; } } exports.MosReqObjActionDelete = MosReqObjActionDelete; //# sourceMappingURL=mosReqObjAction.js.map