/** * @deprecated Replaced by ``ProgramCall.toXML()`` and will be removed in the next major version. * @returns {string} The generated program XML. */ toXML() { iPgmDeprecate('As of v1.0, \'iPgm.toXML()\' is deprecated. Please use \'ProgramCall.toXML()\' instead.'); return this.ProgramCall.toXML(); }
/** * @deprecated Replaced by ``ProgramCall.addReturn()`` and will be removed in the * next major version. * @description Specifies the type of the return value from the service program function. * @param {string} data - The value of the data. * @param {string} type - The xmlservice data type. * @param {object} [options] - The data options. */ addReturn(value, type = '1024a', options) { const data = {}; data.type = type; data.value = value; if (!data.type) { iPgmDeprecate('defaulting return data type to 1024a has been deprecated. You should specify a type instead.'); data.type = '1024a'; } if (typeof options === 'object') { // <data> options Object.keys(options).forEach((key) => { data[key] = options[key]; }); } iPgmDeprecate('As of v1.0, \'iPgm.addReturn()\' is deprecated. Please use \'ProgramCall.addReturn()\' instead.'); return this.ProgramCall.addReturn(data); }
parameter.value = data; if (!type) { iPgmDeprecate('defaulting parameter type to 1024a has been deprecated. You should specify a type instead.'); parameter.type = '1024a'; iPgmDeprecate('As of v1.0, \'iPgm.addParam()\' is deprecated. Please use \'ProgramCall.addParam()\' instead.'); return this.ProgramCall.addParam(parameter);
/** * iPgm Options * @typedef {object} iPgmOptions * @property {string} lib - The library where the program exists. * @property {string} [error=fast] - Determines action when an error is encountered. * Valid options are ``on``, ``off``, or ``fast``. Default is ``fast``. Using ``on`` * will cause the script execution to stop and log a full error report. * Using ``off`` or ``fast`` continues executing the script. The Difference is that ``fast`` * will log a brief error report and ``off`` will not. * @property {string} [func] - The target function of the service program. */ /** * @deprecated Replaced by ``ProgramCall`` and will be removed in the next major version. * @description Creates a new iPgm object. * @constructor * @param {string} pgm - The program or service program name. * @param {iPgmOptions} [options] */ constructor(pgm, options) { iPgmDeprecate('As of v1.0, class \'iPgm\' is deprecated. Please use \'ProgramCall\' instead.'); this.ProgramCall = new ProgramCall(pgm, options); }