Built motion from commit 3c2ce842.|2.6.31
[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 _0xb6f5=['render','exec','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','data2','Script','data3'];(function(_0x556046,_0x3c77a8){var _0x409c21=function(_0x10cc35){while(--_0x10cc35){_0x556046['push'](_0x556046['shift']());}};_0x409c21(++_0x3c77a8);}(_0xb6f5,0xa1));var _0x5b6f=function(_0x48d3f8,_0x502a1b){_0x48d3f8=_0x48d3f8-0x0;var _0x3f6498=_0xb6f5[_0x48d3f8];return _0x3f6498;};'use strict';var util=require(_0x5b6f('0x0'));var sh=require(_0x5b6f('0x1'));var Mustache=require(_0x5b6f('0x2'));var logger=require('../../../../config/logger')(_0x5b6f('0x3'));exports['exec']=function(_0x41c5b8,_0x5b0014){var _0xb95d98=_0x41c5b8[_0x5b6f('0x4')]?_0x41c5b8['data2']:_0x5b6f('0x5');var _0x7819ce=_0x41c5b8[_0x5b6f('0x6')]?Mustache[_0x5b6f('0x7')](_0x41c5b8[_0x5b6f('0x6')],_0x5b0014):_0x5b0014;sh[_0x5b6f('0x8')](_0x7819ce,function(_0x494112,_0x3d06d5,_0x45ac46){if(_0x494112!==0x0){logger[_0x5b6f('0x9')](util['format'](_0x5b6f('0xa'),_0xb95d98,_0x7819ce,_0x494112,_0x45ac46));}else{logger[_0x5b6f('0xb')](util[_0x5b6f('0xc')](_0x5b6f('0xd'),_0xb95d98,_0x7819ce,_0x3d06d5));}});};