Built motion from commit bab6f49e.|2.6.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 _0x9fff=['catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5be06a,_0x20f0a2){var _0x1222af=function(_0x4f5667){while(--_0x4f5667){_0x5be06a['push'](_0x5be06a['shift']());}};_0x1222af(++_0x20f0a2);}(_0x9fff,0xfd));var _0xf9ff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf9ff('0x0'));var moment=require(_0xf9ff('0x1'));var BPromise=require(_0xf9ff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9ff('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf9ff('0x4'))(_0xf9ff('0x5'));var config=require(_0xf9ff('0x6'));var jayson=require(_0xf9ff('0x7'));var client=jayson['client'][_0xf9ff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcf28da,_0x1f44ac,_0x339363){return new BPromise(function(_0x3cb1dd,_0x4aaa17){return client[_0xf9ff('0x9')](_0xcf28da,_0x339363)[_0xf9ff('0xa')](function(_0xb8296){logger['info'](_0xf9ff('0xb'),_0x1f44ac,_0xf9ff('0xc'));logger['debug'](_0xf9ff('0xd'),_0x1f44ac,_0xf9ff('0xc'),JSON[_0xf9ff('0xe')](_0xb8296));if(_0xb8296[_0xf9ff('0xf')]){if(_0xb8296[_0xf9ff('0xf')][_0xf9ff('0x10')]===0x1f4){logger[_0xf9ff('0xf')](_0xf9ff('0xb'),_0x1f44ac,_0xb8296[_0xf9ff('0xf')][_0xf9ff('0x11')]);return _0x4aaa17(_0xb8296['error'][_0xf9ff('0x11')]);}logger[_0xf9ff('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x1f44ac,_0xb8296[_0xf9ff('0xf')][_0xf9ff('0x11')]);return _0x3cb1dd(_0xb8296[_0xf9ff('0xf')][_0xf9ff('0x11')]);}else{logger[_0xf9ff('0x12')](_0xf9ff('0xb'),_0x1f44ac,_0xf9ff('0xc'));_0x3cb1dd(_0xb8296[_0xf9ff('0x13')]['message']);}})[_0xf9ff('0x14')](function(_0x3f3cac){logger[_0xf9ff('0xf')](_0xf9ff('0xb'),_0x1f44ac,_0x3f3cac);_0x4aaa17(_0x3f3cac);});});}