Built motion from commit e0fa946e.|2.6.5
[motion2.git] / server / services / ami / trigger / script / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x13e6=['trigger','exec','data2','Script','data3','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache'];(function(_0x3e0a61,_0x216889){var _0x242f81=function(_0x4cdca7){while(--_0x4cdca7){_0x3e0a61['push'](_0x3e0a61['shift']());}};_0x242f81(++_0x216889);}(_0x13e6,0x1b5));var _0x613e=function(_0x12870e,_0x3916b0){_0x12870e=_0x12870e-0x0;var _0x4cb70a=_0x13e6[_0x12870e];return _0x4cb70a;};'use strict';var util=require(_0x613e('0x0'));var sh=require(_0x613e('0x1'));var Mustache=require(_0x613e('0x2'));var logger=require('../../../../config/logger')(_0x613e('0x3'));exports[_0x613e('0x4')]=function(_0x1307bf,_0x597955){var _0x2b4bf9=_0x1307bf['data2']?_0x1307bf[_0x613e('0x5')]:_0x613e('0x6');var _0x13733c=_0x1307bf['data3']?Mustache['render'](_0x1307bf[_0x613e('0x7')],_0x597955):_0x597955;sh[_0x613e('0x4')](_0x13733c,function(_0x3c9d5b,_0x4b8c9e,_0x2d9920){if(_0x3c9d5b!==0x0){logger['error'](util[_0x613e('0x8')](_0x613e('0x9'),_0x2b4bf9,_0x13733c,_0x3c9d5b,_0x2d9920));}else{logger['info'](util[_0x613e('0x8')](_0x613e('0xa'),_0x2b4bf9,_0x13733c,_0x4b8c9e));}});};