Built motion from commit (unavailable).|2.5.29
[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 _0xf438=['error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4410a6,_0x416bdf){var _0xb12934=function(_0x5a5426){while(--_0x5a5426){_0x4410a6['push'](_0x4410a6['shift']());}};_0xb12934(++_0x416bdf);}(_0xf438,0x1d0));var _0x8f43=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf438[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x8f43('0x0'));var moment=require(_0x8f43('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f43('0x2'));var fs=require('fs');var Redis=require(_0x8f43('0x3'));var db=require(_0x8f43('0x4'))['db'];var utils=require(_0x8f43('0x5'));var logger=require(_0x8f43('0x6'))('rpc');var config=require(_0x8f43('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8f43('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d1521,_0x176403,_0x263025){return new BPromise(function(_0x5f19d0,_0x435989){return client[_0x8f43('0x9')](_0x5d1521,_0x263025)['then'](function(_0x71d827){logger[_0x8f43('0xa')](_0x8f43('0xb'),_0x176403,_0x8f43('0xc'));logger[_0x8f43('0xd')](_0x8f43('0xe'),_0x176403,_0x8f43('0xc'),JSON[_0x8f43('0xf')](_0x71d827));if(_0x71d827[_0x8f43('0x10')]){if(_0x71d827[_0x8f43('0x10')][_0x8f43('0x11')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x176403,_0x71d827[_0x8f43('0x10')][_0x8f43('0x12')]);return _0x435989(_0x71d827[_0x8f43('0x10')][_0x8f43('0x12')]);}logger['error'](_0x8f43('0xb'),_0x176403,_0x71d827[_0x8f43('0x10')]['message']);return _0x5f19d0(_0x71d827[_0x8f43('0x10')]['message']);}else{logger[_0x8f43('0xa')](_0x8f43('0xb'),_0x176403,_0x8f43('0xc'));_0x5f19d0(_0x71d827[_0x8f43('0x13')][_0x8f43('0x12')]);}})['catch'](function(_0xa14a5b){logger[_0x8f43('0x10')](_0x8f43('0xb'),_0x176403,_0xa14a5b);_0x435989(_0xa14a5b);});});}