2314d1de57343a0072798ddd07c556da9f5e30a6
[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 _0xadca=['render','data3','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','exec','data2'];(function(_0x37c6e2,_0x2e9a58){var _0xfc03c8=function(_0x366d10){while(--_0x366d10){_0x37c6e2['push'](_0x37c6e2['shift']());}};_0xfc03c8(++_0x2e9a58);}(_0xadca,0x79));var _0xaadc=function(_0x12a62c,_0xc9c41a){_0x12a62c=_0x12a62c-0x0;var _0x268a58=_0xadca[_0x12a62c];return _0x268a58;};'use strict';var util=require('util');var sh=require(_0xaadc('0x0'));var Mustache=require(_0xaadc('0x1'));var logger=require(_0xaadc('0x2'))('trigger');exports[_0xaadc('0x3')]=function(_0xff81bf,_0x3a7923){var _0x5cca3f=_0xff81bf[_0xaadc('0x4')]?_0xff81bf[_0xaadc('0x4')]:'Script';var _0x17e544=_0xff81bf['data3']?Mustache[_0xaadc('0x5')](_0xff81bf[_0xaadc('0x6')],_0x3a7923):_0x3a7923;sh[_0xaadc('0x3')](_0x17e544,function(_0x429a73,_0x2831ce,_0x3af055){if(_0x429a73!==0x0){logger['error'](util[_0xaadc('0x7')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x5cca3f,_0x17e544,_0x429a73,_0x3af055));}else{logger['info'](util[_0xaadc('0x7')](_0xaadc('0x8'),_0x5cca3f,_0x17e544,_0x2831ce));}});};