Built motion from commit (unavailable).|2.5.1
[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 _0xb792=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3048ea,_0x3838c2){var _0x1a13c4=function(_0x2c6a6b){while(--_0x2c6a6b){_0x3048ea['push'](_0x3048ea['shift']());}};_0x1a13c4(++_0x3838c2);}(_0xb792,0x1d1));var _0x2b79=function(_0x3f65a6,_0x440914){_0x3f65a6=_0x3f65a6-0x0;var _0x33db99=_0xb792[_0x3f65a6];return _0x33db99;};'use strict';var _=require(_0x2b79('0x0'));var util=require(_0x2b79('0x1'));var moment=require(_0x2b79('0x2'));var BPromise=require(_0x2b79('0x3'));var rs=require(_0x2b79('0x4'));var fs=require('fs');var Redis=require(_0x2b79('0x5'));var db=require(_0x2b79('0x6'))['db'];var utils=require(_0x2b79('0x7'));var logger=require(_0x2b79('0x8'))(_0x2b79('0x9'));var config=require(_0x2b79('0xa'));var jayson=require(_0x2b79('0xb'));var client=jayson[_0x2b79('0xc')][_0x2b79('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x103079,_0x450034,_0x2be67f){return new BPromise(function(_0x5e446c,_0x347df9){return client['request'](_0x103079,_0x2be67f)['then'](function(_0x2eb21c){logger[_0x2b79('0xe')](_0x2b79('0xf'),_0x450034,_0x2b79('0x10'));logger[_0x2b79('0x11')](_0x2b79('0x12'),_0x450034,'request\x20sent',JSON[_0x2b79('0x13')](_0x2eb21c));if(_0x2eb21c[_0x2b79('0x14')]){if(_0x2eb21c[_0x2b79('0x14')]['code']===0x1f4){logger[_0x2b79('0x14')](_0x2b79('0xf'),_0x450034,_0x2eb21c[_0x2b79('0x14')][_0x2b79('0x15')]);return _0x347df9(_0x2eb21c[_0x2b79('0x14')][_0x2b79('0x15')]);}logger[_0x2b79('0x14')](_0x2b79('0xf'),_0x450034,_0x2eb21c[_0x2b79('0x14')][_0x2b79('0x15')]);return _0x5e446c(_0x2eb21c[_0x2b79('0x14')][_0x2b79('0x15')]);}else{logger['info'](_0x2b79('0xf'),_0x450034,_0x2b79('0x10'));_0x5e446c(_0x2eb21c['result'][_0x2b79('0x15')]);}})[_0x2b79('0x16')](function(_0x1014a1){logger[_0x2b79('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x450034,_0x1014a1);_0x347df9(_0x1014a1);});});}