Built motion from commit 25580385.|2.6.2
[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 _0x5e7a=['../../config/logger','../../config/environment','request','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZohoConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x6b9bb5,_0x280a6d){var _0x2bd02b=function(_0x51dce4){while(--_0x51dce4){_0x6b9bb5['push'](_0x6b9bb5['shift']());}};_0x2bd02b(++_0x280a6d);}(_0x5e7a,0x116));var _0xa5e7=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0x5e7a[_0x44a64f];return _0x52024b;};'use strict';var _=require(_0xa5e7('0x0'));var util=require(_0xa5e7('0x1'));var moment=require(_0xa5e7('0x2'));var BPromise=require(_0xa5e7('0x3'));var rs=require(_0xa5e7('0x4'));var fs=require('fs');var Redis=require(_0xa5e7('0x5'));var db=require(_0xa5e7('0x6'))['db'];var utils=require(_0xa5e7('0x7'));var logger=require(_0xa5e7('0x8'))('rpc');var config=require(_0xa5e7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2cfc26,_0x1e9109,_0x46af5f){return new BPromise(function(_0x1e93f0,_0xd63839){return client[_0xa5e7('0xa')](_0x2cfc26,_0x46af5f)[_0xa5e7('0xb')](function(_0x1f812c){logger[_0xa5e7('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x1e9109,'request\x20sent');logger[_0xa5e7('0xd')](_0xa5e7('0xe'),_0x1e9109,'request\x20sent',JSON['stringify'](_0x1f812c));if(_0x1f812c['error']){if(_0x1f812c[_0xa5e7('0xf')][_0xa5e7('0x10')]===0x1f4){logger[_0xa5e7('0xf')](_0xa5e7('0x11'),_0x1e9109,_0x1f812c['error'][_0xa5e7('0x12')]);return _0xd63839(_0x1f812c[_0xa5e7('0xf')]['message']);}logger[_0xa5e7('0xf')](_0xa5e7('0x11'),_0x1e9109,_0x1f812c[_0xa5e7('0xf')][_0xa5e7('0x12')]);return _0x1e93f0(_0x1f812c[_0xa5e7('0xf')]['message']);}else{logger['info'](_0xa5e7('0x11'),_0x1e9109,_0xa5e7('0x13'));_0x1e93f0(_0x1f812c[_0xa5e7('0x14')]['message']);}})[_0xa5e7('0x15')](function(_0x923a12){logger[_0xa5e7('0xf')](_0xa5e7('0x11'),_0x1e9109,_0x923a12);_0xd63839(_0x923a12);});});}