4ca2afe68d788f253d764aa8718835167f3be483
[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 _0xac19=['error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','data2','Script','data3','exec'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac19,0x1f2));var _0x9ac1=function(_0x3221cd,_0x4a4a4a){_0x3221cd=_0x3221cd-0x0;var _0x21a689=_0xac19[_0x3221cd];return _0x21a689;};'use strict';var util=require('util');var sh=require(_0x9ac1('0x0'));var Mustache=require(_0x9ac1('0x1'));var logger=require(_0x9ac1('0x2'))(_0x9ac1('0x3'));exports['exec']=function(_0x12ea4d,_0x43c5e3){var _0x3b6c80=_0x12ea4d[_0x9ac1('0x4')]?_0x12ea4d[_0x9ac1('0x4')]:_0x9ac1('0x5');var _0x12533d=_0x12ea4d[_0x9ac1('0x6')]?Mustache['render'](_0x12ea4d[_0x9ac1('0x6')],_0x43c5e3):_0x43c5e3;sh[_0x9ac1('0x7')](_0x12533d,function(_0x5570cd,_0x563628,_0x5b2b01){if(_0x5570cd!==0x0){logger[_0x9ac1('0x8')](util['format'](_0x9ac1('0x9'),_0x3b6c80,_0x12533d,_0x5570cd,_0x5b2b01));}else{logger['info'](util['format'](_0x9ac1('0xa'),_0x3b6c80,_0x12533d,_0x563628));}});};