Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / intZendeskConfiguration / intZendeskConfiguration.rpc.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 _0x1993=['debug','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x1993,0xf7));var _0x3199=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1993[_0x432682];return _0x463d05;};'use strict';var _=require(_0x3199('0x0'));var util=require(_0x3199('0x1'));var moment=require(_0x3199('0x2'));var BPromise=require(_0x3199('0x3'));var rs=require(_0x3199('0x4'));var fs=require('fs');var Redis=require(_0x3199('0x5'));var db=require(_0x3199('0x6'))['db'];var utils=require(_0x3199('0x7'));var logger=require(_0x3199('0x8'))('rpc');var config=require(_0x3199('0x9'));var jayson=require(_0x3199('0xa'));var client=jayson[_0x3199('0xb')][_0x3199('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41b300,_0x15ad86,_0x26adbb){return new BPromise(function(_0x200875,_0x4ff4e1){return client[_0x3199('0xd')](_0x41b300,_0x26adbb)['then'](function(_0x305fe0){logger[_0x3199('0xe')](_0x3199('0xf'),_0x15ad86,_0x3199('0x10'));logger[_0x3199('0x11')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x15ad86,_0x3199('0x10'),JSON['stringify'](_0x305fe0));if(_0x305fe0['error']){if(_0x305fe0[_0x3199('0x12')][_0x3199('0x13')]===0x1f4){logger['error'](_0x3199('0xf'),_0x15ad86,_0x305fe0[_0x3199('0x12')][_0x3199('0x14')]);return _0x4ff4e1(_0x305fe0['error'][_0x3199('0x14')]);}logger[_0x3199('0x12')](_0x3199('0xf'),_0x15ad86,_0x305fe0['error'][_0x3199('0x14')]);return _0x200875(_0x305fe0['error'][_0x3199('0x14')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x15ad86,_0x3199('0x10'));_0x200875(_0x305fe0['result']['message']);}})[_0x3199('0x15')](function(_0x42fc82){logger[_0x3199('0x12')](_0x3199('0xf'),_0x15ad86,_0x42fc82);_0x4ff4e1(_0x42fc82);});});}