Built motion from commit (unavailable).|2.5.11
[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 _0x23e6=['../../config/logger','rpc','jayson/promise','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x23e6,0xa2));var _0x623e=function(_0x59e703,_0x62b160){_0x59e703=_0x59e703-0x0;var _0x5e46c3=_0x23e6[_0x59e703];return _0x5e46c3;};'use strict';var _=require('lodash');var util=require(_0x623e('0x0'));var moment=require('moment');var BPromise=require(_0x623e('0x1'));var rs=require(_0x623e('0x2'));var fs=require('fs');var Redis=require(_0x623e('0x3'));var db=require(_0x623e('0x4'))['db'];var utils=require(_0x623e('0x5'));var logger=require(_0x623e('0x6'))(_0x623e('0x7'));var config=require('../../config/environment');var jayson=require(_0x623e('0x8'));var client=jayson['client'][_0x623e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3261ae,_0x51c47c,_0x2752a2){return new BPromise(function(_0x471b1d,_0x15c38b){return client[_0x623e('0xa')](_0x3261ae,_0x2752a2)['then'](function(_0x278526){logger[_0x623e('0xb')](_0x623e('0xc'),_0x51c47c,_0x623e('0xd'));logger['debug'](_0x623e('0xe'),_0x51c47c,'request\x20sent',JSON[_0x623e('0xf')](_0x278526));if(_0x278526[_0x623e('0x10')]){if(_0x278526[_0x623e('0x10')][_0x623e('0x11')]===0x1f4){logger[_0x623e('0x10')](_0x623e('0xc'),_0x51c47c,_0x278526[_0x623e('0x10')][_0x623e('0x12')]);return _0x15c38b(_0x278526['error'][_0x623e('0x12')]);}logger[_0x623e('0x10')](_0x623e('0xc'),_0x51c47c,_0x278526[_0x623e('0x10')]['message']);return _0x471b1d(_0x278526[_0x623e('0x10')][_0x623e('0x12')]);}else{logger['info'](_0x623e('0xc'),_0x51c47c,_0x623e('0xd'));_0x471b1d(_0x278526[_0x623e('0x13')][_0x623e('0x12')]);}})[_0x623e('0x14')](function(_0x1f24bf){logger['error'](_0x623e('0xc'),_0x51c47c,_0x1f24bf);_0x15c38b(_0x1f24bf);});});}