Built motion from commit 3c2ce842.|2.6.31
[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 _0xcfad=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0xcfad,0x14d));var _0xdcfa=function(_0x21930d,_0x4127f8){_0x21930d=_0x21930d-0x0;var _0x5667db=_0xcfad[_0x21930d];return _0x5667db;};'use strict';var _=require(_0xdcfa('0x0'));var util=require(_0xdcfa('0x1'));var moment=require(_0xdcfa('0x2'));var BPromise=require('bluebird');var rs=require(_0xdcfa('0x3'));var fs=require('fs');var Redis=require(_0xdcfa('0x4'));var db=require(_0xdcfa('0x5'))['db'];var utils=require(_0xdcfa('0x6'));var logger=require('../../config/logger')(_0xdcfa('0x7'));var config=require(_0xdcfa('0x8'));var jayson=require(_0xdcfa('0x9'));var client=jayson[_0xdcfa('0xa')][_0xdcfa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c43aa,_0x1eeeb1,_0x43b074){return new BPromise(function(_0x5d6684,_0x14dfd9){return client[_0xdcfa('0xc')](_0x3c43aa,_0x43b074)[_0xdcfa('0xd')](function(_0x3b65e1){logger['info'](_0xdcfa('0xe'),_0x1eeeb1,_0xdcfa('0xf'));logger[_0xdcfa('0x10')](_0xdcfa('0x11'),_0x1eeeb1,_0xdcfa('0xf'),JSON[_0xdcfa('0x12')](_0x3b65e1));if(_0x3b65e1[_0xdcfa('0x13')]){if(_0x3b65e1[_0xdcfa('0x13')][_0xdcfa('0x14')]===0x1f4){logger[_0xdcfa('0x13')](_0xdcfa('0xe'),_0x1eeeb1,_0x3b65e1[_0xdcfa('0x13')][_0xdcfa('0x15')]);return _0x14dfd9(_0x3b65e1['error'][_0xdcfa('0x15')]);}logger[_0xdcfa('0x13')](_0xdcfa('0xe'),_0x1eeeb1,_0x3b65e1[_0xdcfa('0x13')][_0xdcfa('0x15')]);return _0x5d6684(_0x3b65e1[_0xdcfa('0x13')][_0xdcfa('0x15')]);}else{logger[_0xdcfa('0x16')]('ZohoConfiguration,\x20%s,\x20%s',_0x1eeeb1,_0xdcfa('0xf'));_0x5d6684(_0x3b65e1[_0xdcfa('0x17')][_0xdcfa('0x15')]);}})[_0xdcfa('0x18')](function(_0x41b7e6){logger[_0xdcfa('0x13')](_0xdcfa('0xe'),_0x1eeeb1,_0x41b7e6);_0x14dfd9(_0x41b7e6);});});}