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 _0xaf4c=['then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaf4c,0x1da));var _0xcaf4=function(_0x3be94f,_0x582e21){_0x3be94f=_0x3be94f-0x0;var _0x477826=_0xaf4c[_0x3be94f];return _0x477826;};'use strict';var _=require(_0xcaf4('0x0'));var util=require(_0xcaf4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcaf4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcaf4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcaf4('0x4'))('rpc');var config=require(_0xcaf4('0x5'));var jayson=require(_0xcaf4('0x6'));var client=jayson[_0xcaf4('0x7')][_0xcaf4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55067b,_0x224d66,_0x386890){return new BPromise(function(_0x544a04,_0x276ec7){return client[_0xcaf4('0x9')](_0x55067b,_0x386890)[_0xcaf4('0xa')](function(_0x174024){logger[_0xcaf4('0xb')](_0xcaf4('0xc'),_0x224d66,_0xcaf4('0xd'));logger[_0xcaf4('0xe')](_0xcaf4('0xf'),_0x224d66,_0xcaf4('0xd'),JSON[_0xcaf4('0x10')](_0x174024));if(_0x174024[_0xcaf4('0x11')]){if(_0x174024[_0xcaf4('0x11')][_0xcaf4('0x12')]===0x1f4){logger[_0xcaf4('0x11')](_0xcaf4('0xc'),_0x224d66,_0x174024[_0xcaf4('0x11')]['message']);return _0x276ec7(_0x174024[_0xcaf4('0x11')][_0xcaf4('0x13')]);}logger['error'](_0xcaf4('0xc'),_0x224d66,_0x174024['error']['message']);return _0x544a04(_0x174024[_0xcaf4('0x11')][_0xcaf4('0x13')]);}else{logger[_0xcaf4('0xb')](_0xcaf4('0xc'),_0x224d66,_0xcaf4('0xd'));_0x544a04(_0x174024[_0xcaf4('0x14')][_0xcaf4('0x13')]);}})[_0xcaf4('0x15')](function(_0x4cd994){logger[_0xcaf4('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x224d66,_0x4cd994);_0x276ec7(_0x4cd994);});});}