4d1673cc44e30e4fd9ea8bd9b369d8c47ebe34a7
[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 _0x35a0=['trigger','data2','Script','data3','render','exec','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger'];(function(_0x4008de,_0x15f2e9){var _0x596738=function(_0x2d4060){while(--_0x2d4060){_0x4008de['push'](_0x4008de['shift']());}};_0x596738(++_0x15f2e9);}(_0x35a0,0x76));var _0x035a=function(_0x4651ae,_0x3d2bc0){_0x4651ae=_0x4651ae-0x0;var _0x29a97c=_0x35a0[_0x4651ae];return _0x29a97c;};'use strict';var util=require('util');var sh=require(_0x035a('0x0'));var Mustache=require(_0x035a('0x1'));var logger=require(_0x035a('0x2'))(_0x035a('0x3'));exports['exec']=function(_0x2fcb6d,_0x5baf7c){var _0x15f69c=_0x2fcb6d[_0x035a('0x4')]?_0x2fcb6d[_0x035a('0x4')]:_0x035a('0x5');var _0x36c841=_0x2fcb6d[_0x035a('0x6')]?Mustache[_0x035a('0x7')](_0x2fcb6d[_0x035a('0x6')],_0x5baf7c):_0x5baf7c;sh[_0x035a('0x8')](_0x36c841,function(_0x4ca235,_0xfd60dd,_0x56b57a){if(_0x4ca235!==0x0){logger['error'](util[_0x035a('0x9')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x15f69c,_0x36c841,_0x4ca235,_0x56b57a));}else{logger['info'](util[_0x035a('0x9')](_0x035a('0xa'),_0x15f69c,_0x36c841,_0xfd60dd));}});};