506495dc5d9cb2e86a01c912fb8874110de7d938
[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 _0x48ea=['exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','data2','data3','render'];(function(_0x554e8f,_0x1c5790){var _0x5589e1=function(_0x484c4b){while(--_0x484c4b){_0x554e8f['push'](_0x554e8f['shift']());}};_0x5589e1(++_0x1c5790);}(_0x48ea,0x18c));var _0xa48e=function(_0x295d37,_0x3792c2){_0x295d37=_0x295d37-0x0;var _0x488c5b=_0x48ea[_0x295d37];return _0x488c5b;};'use strict';var util=require(_0xa48e('0x0'));var sh=require(_0xa48e('0x1'));var Mustache=require('mustache');var logger=require(_0xa48e('0x2'))(_0xa48e('0x3'));exports['exec']=function(_0x42887e,_0x5b9361){var _0x1a73c5=_0x42887e[_0xa48e('0x4')]?_0x42887e[_0xa48e('0x4')]:'Script';var _0x4d0915=_0x42887e[_0xa48e('0x5')]?Mustache[_0xa48e('0x6')](_0x42887e[_0xa48e('0x5')],_0x5b9361):_0x5b9361;sh[_0xa48e('0x7')](_0x4d0915,function(_0x3c4138,_0x4deaff,_0x459ac6){if(_0x3c4138!==0x0){logger[_0xa48e('0x8')](util[_0xa48e('0x9')](_0xa48e('0xa'),_0x1a73c5,_0x4d0915,_0x3c4138,_0x459ac6));}else{logger[_0xa48e('0xb')](util[_0xa48e('0x9')](_0xa48e('0xc'),_0x1a73c5,_0x4d0915,_0x4deaff));}});};