Built motion from commit (unavailable).|2.4.8
[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 _0x6822=['ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','catch','moment','randomstring'];(function(_0x1c1820,_0x18bb79){var _0x6690e6=function(_0x11ae54){while(--_0x11ae54){_0x1c1820['push'](_0x1c1820['shift']());}};_0x6690e6(++_0x18bb79);}(_0x6822,0x102));var _0x2682=function(_0x36c870,_0x5aad59){_0x36c870=_0x36c870-0x0;var _0x39645f=_0x6822[_0x36c870];return _0x39645f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2682('0x0'));var BPromise=require('bluebird');var rs=require(_0x2682('0x1'));var fs=require('fs');var Redis=require(_0x2682('0x2'));var db=require(_0x2682('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2682('0x4'));var config=require('../../config/environment');var jayson=require(_0x2682('0x5'));var client=jayson[_0x2682('0x6')][_0x2682('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1e5dfb,_0x4ddeaf,_0x16da4c){return new BPromise(function(_0x195057,_0x13e590){return client[_0x2682('0x8')](_0x1e5dfb,_0x16da4c)[_0x2682('0x9')](function(_0x2c5cd4){logger[_0x2682('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x4ddeaf,_0x2682('0xb'));logger[_0x2682('0xc')](_0x2682('0xd'),_0x4ddeaf,_0x2682('0xb'),JSON[_0x2682('0xe')](_0x2c5cd4));if(_0x2c5cd4[_0x2682('0xf')]){if(_0x2c5cd4[_0x2682('0xf')][_0x2682('0x10')]===0x1f4){logger[_0x2682('0xf')](_0x2682('0x11'),_0x4ddeaf,_0x2c5cd4[_0x2682('0xf')][_0x2682('0x12')]);return _0x13e590(_0x2c5cd4['error'][_0x2682('0x12')]);}logger['error'](_0x2682('0x11'),_0x4ddeaf,_0x2c5cd4[_0x2682('0xf')][_0x2682('0x12')]);return _0x195057(_0x2c5cd4[_0x2682('0xf')][_0x2682('0x12')]);}else{logger[_0x2682('0xa')](_0x2682('0x11'),_0x4ddeaf,_0x2682('0xb'));_0x195057(_0x2c5cd4['result'][_0x2682('0x12')]);}})[_0x2682('0x13')](function(_0x5e9058){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x4ddeaf,_0x5e9058);_0x13e590(_0x5e9058);});});}