Built motion from commit 616d3211.|2.6.4
[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 _0x6407=['jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x43c379,_0x36a2d1){var _0x3ba6a8=function(_0x25a95d){while(--_0x25a95d){_0x43c379['push'](_0x43c379['shift']());}};_0x3ba6a8(++_0x36a2d1);}(_0x6407,0x108));var _0x7640=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x6407[_0x3712e2];return _0x1faff4;};'use strict';var _=require(_0x7640('0x0'));var util=require('util');var moment=require(_0x7640('0x1'));var BPromise=require(_0x7640('0x2'));var rs=require(_0x7640('0x3'));var fs=require('fs');var Redis=require(_0x7640('0x4'));var db=require(_0x7640('0x5'))['db'];var utils=require(_0x7640('0x6'));var logger=require(_0x7640('0x7'))('rpc');var config=require(_0x7640('0x8'));var jayson=require(_0x7640('0x9'));var client=jayson[_0x7640('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8f226d,_0x565cbd,_0x1a99ef){return new BPromise(function(_0x317987,_0x435075){return client[_0x7640('0xb')](_0x8f226d,_0x1a99ef)[_0x7640('0xc')](function(_0x2ef0a0){logger[_0x7640('0xd')](_0x7640('0xe'),_0x565cbd,'request\x20sent');logger['debug'](_0x7640('0xf'),_0x565cbd,_0x7640('0x10'),JSON['stringify'](_0x2ef0a0));if(_0x2ef0a0[_0x7640('0x11')]){if(_0x2ef0a0[_0x7640('0x11')][_0x7640('0x12')]===0x1f4){logger[_0x7640('0x11')](_0x7640('0xe'),_0x565cbd,_0x2ef0a0['error'][_0x7640('0x13')]);return _0x435075(_0x2ef0a0[_0x7640('0x11')][_0x7640('0x13')]);}logger['error'](_0x7640('0xe'),_0x565cbd,_0x2ef0a0[_0x7640('0x11')][_0x7640('0x13')]);return _0x317987(_0x2ef0a0[_0x7640('0x11')][_0x7640('0x13')]);}else{logger[_0x7640('0xd')](_0x7640('0xe'),_0x565cbd,'request\x20sent');_0x317987(_0x2ef0a0['result'][_0x7640('0x13')]);}})[_0x7640('0x14')](function(_0x3cc2fe){logger['error'](_0x7640('0xe'),_0x565cbd,_0x3cc2fe);_0x435075(_0x3cc2fe);});});}