Built motion from commit (unavailable).|2.5.22
[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 _0x37b8=['request\x20sent','debug','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x6cf3b6,_0x4b7560){var _0xdbe948=function(_0x1504d6){while(--_0x1504d6){_0x6cf3b6['push'](_0x6cf3b6['shift']());}};_0xdbe948(++_0x4b7560);}(_0x37b8,0x122));var _0x837b=function(_0x33de88,_0x581346){_0x33de88=_0x33de88-0x0;var _0x105957=_0x37b8[_0x33de88];return _0x105957;};'use strict';var _=require(_0x837b('0x0'));var util=require(_0x837b('0x1'));var moment=require(_0x837b('0x2'));var BPromise=require(_0x837b('0x3'));var rs=require(_0x837b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x837b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x837b('0x6'));var jayson=require(_0x837b('0x7'));var client=jayson[_0x837b('0x8')][_0x837b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4cf852,_0x3ad850,_0x46089b){return new BPromise(function(_0x3c3d2a,_0x19d716){return client[_0x837b('0xa')](_0x4cf852,_0x46089b)[_0x837b('0xb')](function(_0x486aa8){logger[_0x837b('0xc')](_0x837b('0xd'),_0x3ad850,_0x837b('0xe'));logger[_0x837b('0xf')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3ad850,'request\x20sent',JSON['stringify'](_0x486aa8));if(_0x486aa8[_0x837b('0x10')]){if(_0x486aa8[_0x837b('0x10')][_0x837b('0x11')]===0x1f4){logger[_0x837b('0x10')](_0x837b('0xd'),_0x3ad850,_0x486aa8[_0x837b('0x10')][_0x837b('0x12')]);return _0x19d716(_0x486aa8[_0x837b('0x10')]['message']);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3ad850,_0x486aa8[_0x837b('0x10')][_0x837b('0x12')]);return _0x3c3d2a(_0x486aa8[_0x837b('0x10')]['message']);}else{logger[_0x837b('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x3ad850,_0x837b('0xe'));_0x3c3d2a(_0x486aa8['result'][_0x837b('0x12')]);}})['catch'](function(_0x2c6383){logger[_0x837b('0x10')](_0x837b('0xd'),_0x3ad850,_0x2c6383);_0x19d716(_0x2c6383);});});}