Built motion from commit (unavailable).|2.5.3
[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 _0x75f6=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0x75f6,0xb4));var _0x675f=function(_0x27c9a9,_0x169549){_0x27c9a9=_0x27c9a9-0x0;var _0x4f001c=_0x75f6[_0x27c9a9];return _0x4f001c;};'use strict';var _=require(_0x675f('0x0'));var util=require('util');var moment=require(_0x675f('0x1'));var BPromise=require(_0x675f('0x2'));var rs=require(_0x675f('0x3'));var fs=require('fs');var Redis=require(_0x675f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x675f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x675f('0x6'));var jayson=require(_0x675f('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42dace,_0x311920,_0x2a83fb){return new BPromise(function(_0x30478e,_0x4f1cb8){return client[_0x675f('0x8')](_0x42dace,_0x2a83fb)['then'](function(_0x46a4c2){logger['info'](_0x675f('0x9'),_0x311920,_0x675f('0xa'));logger[_0x675f('0xb')](_0x675f('0xc'),_0x311920,_0x675f('0xa'),JSON[_0x675f('0xd')](_0x46a4c2));if(_0x46a4c2[_0x675f('0xe')]){if(_0x46a4c2[_0x675f('0xe')]['code']===0x1f4){logger[_0x675f('0xe')](_0x675f('0x9'),_0x311920,_0x46a4c2['error'][_0x675f('0xf')]);return _0x4f1cb8(_0x46a4c2[_0x675f('0xe')]['message']);}logger[_0x675f('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x311920,_0x46a4c2[_0x675f('0xe')][_0x675f('0xf')]);return _0x30478e(_0x46a4c2[_0x675f('0xe')][_0x675f('0xf')]);}else{logger[_0x675f('0x10')](_0x675f('0x9'),_0x311920,_0x675f('0xa'));_0x30478e(_0x46a4c2['result'][_0x675f('0xf')]);}})[_0x675f('0x11')](function(_0x276d72){logger[_0x675f('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x311920,_0x276d72);_0x4f1cb8(_0x276d72);});});}