9b1bfeb65418b80e42dbe9bd2fe13753a2b2d303
[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 _0x1606=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x420745,_0x1a6314){var _0x153a1a=function(_0xa1135a){while(--_0xa1135a){_0x420745['push'](_0x420745['shift']());}};_0x153a1a(++_0x1a6314);}(_0x1606,0xc4));var _0x6160=function(_0xfc3867,_0x1634b2){_0xfc3867=_0xfc3867-0x0;var _0x4c2150=_0x1606[_0xfc3867];return _0x4c2150;};'use strict';var _=require(_0x6160('0x0'));var util=require(_0x6160('0x1'));var moment=require(_0x6160('0x2'));var BPromise=require(_0x6160('0x3'));var rs=require(_0x6160('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6160('0x5'))['db'];var utils=require(_0x6160('0x6'));var logger=require(_0x6160('0x7'))(_0x6160('0x8'));var config=require(_0x6160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6160('0xa')][_0x6160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe8c4d8,_0xc970dc,_0xa08e39){return new BPromise(function(_0x4884fd,_0x4d2a53){return client[_0x6160('0xc')](_0xe8c4d8,_0xa08e39)[_0x6160('0xd')](function(_0x5d1334){logger[_0x6160('0xe')](_0x6160('0xf'),_0xc970dc,_0x6160('0x10'));logger[_0x6160('0x11')](_0x6160('0x12'),_0xc970dc,_0x6160('0x10'),JSON[_0x6160('0x13')](_0x5d1334));if(_0x5d1334['error']){if(_0x5d1334[_0x6160('0x14')][_0x6160('0x15')]===0x1f4){logger[_0x6160('0x14')](_0x6160('0xf'),_0xc970dc,_0x5d1334['error'][_0x6160('0x16')]);return _0x4d2a53(_0x5d1334[_0x6160('0x14')][_0x6160('0x16')]);}logger[_0x6160('0x14')](_0x6160('0xf'),_0xc970dc,_0x5d1334['error'][_0x6160('0x16')]);return _0x4884fd(_0x5d1334[_0x6160('0x14')][_0x6160('0x16')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0xc970dc,'request\x20sent');_0x4884fd(_0x5d1334['result'][_0x6160('0x16')]);}})[_0x6160('0x17')](function(_0x31fc9c){logger[_0x6160('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0xc970dc,_0x31fc9c);_0x4d2a53(_0x31fc9c);});});}