0d351bda1ea85cf936ce6418a0c3b5887cab42e8
[motion2.git] / server / api / intZohoConfiguration / intZohoConfiguration.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 _0x3edf=['error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x339f10,_0x45c494){var _0x4215b5=function(_0x21f1ec){while(--_0x21f1ec){_0x339f10['push'](_0x339f10['shift']());}};_0x4215b5(++_0x45c494);}(_0x3edf,0x1a6));var _0xf3ed=function(_0x29d635,_0x2567aa){_0x29d635=_0x29d635-0x0;var _0x33c861=_0x3edf[_0x29d635];return _0x33c861;};'use strict';var _=require(_0xf3ed('0x0'));var util=require(_0xf3ed('0x1'));var moment=require('moment');var BPromise=require(_0xf3ed('0x2'));var rs=require(_0xf3ed('0x3'));var fs=require('fs');var Redis=require(_0xf3ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf3ed('0x5'))(_0xf3ed('0x6'));var config=require(_0xf3ed('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf3ed('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x228a75,_0x4b61fd,_0x7080df){return new BPromise(function(_0x2d1ba8,_0x30ad9e){return client[_0xf3ed('0x9')](_0x228a75,_0x7080df)[_0xf3ed('0xa')](function(_0x354005){logger[_0xf3ed('0xb')](_0xf3ed('0xc'),_0x4b61fd,'request\x20sent');logger['debug'](_0xf3ed('0xd'),_0x4b61fd,_0xf3ed('0xe'),JSON['stringify'](_0x354005));if(_0x354005['error']){if(_0x354005[_0xf3ed('0xf')][_0xf3ed('0x10')]===0x1f4){logger[_0xf3ed('0xf')](_0xf3ed('0xc'),_0x4b61fd,_0x354005[_0xf3ed('0xf')]['message']);return _0x30ad9e(_0x354005['error'][_0xf3ed('0x11')]);}logger[_0xf3ed('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x4b61fd,_0x354005[_0xf3ed('0xf')]['message']);return _0x2d1ba8(_0x354005[_0xf3ed('0xf')]['message']);}else{logger[_0xf3ed('0xb')](_0xf3ed('0xc'),_0x4b61fd,'request\x20sent');_0x2d1ba8(_0x354005[_0xf3ed('0x12')][_0xf3ed('0x11')]);}})['catch'](function(_0x10cd31){logger[_0xf3ed('0xf')](_0xf3ed('0xc'),_0x4b61fd,_0x10cd31);_0x30ad9e(_0x10cd31);});});}