Built motion from commit 511216ff.|2.6.34
[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 _0x3add=['info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','debug','request\x20sent','stringify','code','error','ZohoConfiguration,\x20%s,\x20%s','message'];(function(_0x322e7f,_0x3bb5ca){var _0x4d06c3=function(_0x519a3f){while(--_0x519a3f){_0x322e7f['push'](_0x322e7f['shift']());}};_0x4d06c3(++_0x3bb5ca);}(_0x3add,0x1a6));var _0xd3ad=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0x3add[_0x272638];return _0x19d027;};'use strict';var _=require('lodash');var util=require(_0xd3ad('0x0'));var moment=require(_0xd3ad('0x1'));var BPromise=require(_0xd3ad('0x2'));var rs=require(_0xd3ad('0x3'));var fs=require('fs');var Redis=require(_0xd3ad('0x4'));var db=require(_0xd3ad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3ad('0x6'))(_0xd3ad('0x7'));var config=require(_0xd3ad('0x8'));var jayson=require(_0xd3ad('0x9'));var client=jayson['client'][_0xd3ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5833be,_0x4efa5a,_0x447f96){return new BPromise(function(_0x386565,_0x5864cf){return client['request'](_0x5833be,_0x447f96)[_0xd3ad('0xb')](function(_0x3cb5fb){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x4efa5a,'request\x20sent');logger[_0xd3ad('0xc')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x4efa5a,_0xd3ad('0xd'),JSON[_0xd3ad('0xe')](_0x3cb5fb));if(_0x3cb5fb['error']){if(_0x3cb5fb['error'][_0xd3ad('0xf')]===0x1f4){logger[_0xd3ad('0x10')](_0xd3ad('0x11'),_0x4efa5a,_0x3cb5fb[_0xd3ad('0x10')][_0xd3ad('0x12')]);return _0x5864cf(_0x3cb5fb[_0xd3ad('0x10')][_0xd3ad('0x12')]);}logger[_0xd3ad('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x4efa5a,_0x3cb5fb['error'][_0xd3ad('0x12')]);return _0x386565(_0x3cb5fb[_0xd3ad('0x10')][_0xd3ad('0x12')]);}else{logger[_0xd3ad('0x13')](_0xd3ad('0x11'),_0x4efa5a,_0xd3ad('0xd'));_0x386565(_0x3cb5fb['result'][_0xd3ad('0x12')]);}})[_0xd3ad('0x14')](function(_0x47672a){logger[_0xd3ad('0x10')](_0xd3ad('0x11'),_0x4efa5a,_0x47672a);_0x5864cf(_0x47672a);});});}