Built motion from commit (unavailable).|2.4.17
[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 _0x93e4=['code','ZohoConfiguration,\x20%s,\x20%s','message','result','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x50e6c6,_0x1507e5){var _0x1858a3=function(_0x30fec8){while(--_0x30fec8){_0x50e6c6['push'](_0x50e6c6['shift']());}};_0x1858a3(++_0x1507e5);}(_0x93e4,0x82));var _0x493e=function(_0x12a275,_0x31c510){_0x12a275=_0x12a275-0x0;var _0x2e63f4=_0x93e4[_0x12a275];return _0x2e63f4;};'use strict';var _=require('lodash');var util=require(_0x493e('0x0'));var moment=require(_0x493e('0x1'));var BPromise=require(_0x493e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x493e('0x3'))['db'];var utils=require(_0x493e('0x4'));var logger=require(_0x493e('0x5'))(_0x493e('0x6'));var config=require('../../config/environment');var jayson=require(_0x493e('0x7'));var client=jayson['client'][_0x493e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a2f2e,_0x50c68a,_0xda5340){return new BPromise(function(_0x1c4bf7,_0x4f57fc){return client[_0x493e('0x9')](_0x2a2f2e,_0xda5340)[_0x493e('0xa')](function(_0x9b4f8e){logger[_0x493e('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x50c68a,'request\x20sent');logger[_0x493e('0xc')](_0x493e('0xd'),_0x50c68a,_0x493e('0xe'),JSON[_0x493e('0xf')](_0x9b4f8e));if(_0x9b4f8e[_0x493e('0x10')]){if(_0x9b4f8e[_0x493e('0x10')][_0x493e('0x11')]===0x1f4){logger['error'](_0x493e('0x12'),_0x50c68a,_0x9b4f8e['error'][_0x493e('0x13')]);return _0x4f57fc(_0x9b4f8e['error'][_0x493e('0x13')]);}logger[_0x493e('0x10')](_0x493e('0x12'),_0x50c68a,_0x9b4f8e[_0x493e('0x10')]['message']);return _0x1c4bf7(_0x9b4f8e['error'][_0x493e('0x13')]);}else{logger[_0x493e('0xb')](_0x493e('0x12'),_0x50c68a,_0x493e('0xe'));_0x1c4bf7(_0x9b4f8e[_0x493e('0x14')]['message']);}})['catch'](function(_0x24e162){logger[_0x493e('0x10')](_0x493e('0x12'),_0x50c68a,_0x24e162);_0x4f57fc(_0x24e162);});});}