Built motion from commit (unavailable).|2.5.15
[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 _0xe662=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x56cc19,_0x2fd3a3){var _0x19cf03=function(_0x2e70ed){while(--_0x2e70ed){_0x56cc19['push'](_0x56cc19['shift']());}};_0x19cf03(++_0x2fd3a3);}(_0xe662,0xee));var _0x2e66=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xe662[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x2e66('0x0'));var util=require(_0x2e66('0x1'));var moment=require(_0x2e66('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e66('0x3'));var fs=require('fs');var Redis=require(_0x2e66('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e66('0x5'));var logger=require('../../config/logger')(_0x2e66('0x6'));var config=require(_0x2e66('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ec659,_0x2b3587,_0x459f26){return new BPromise(function(_0x5943d6,_0x473308){return client[_0x2e66('0x8')](_0x1ec659,_0x459f26)[_0x2e66('0x9')](function(_0x7a7b82){logger[_0x2e66('0xa')](_0x2e66('0xb'),_0x2b3587,_0x2e66('0xc'));logger[_0x2e66('0xd')](_0x2e66('0xe'),_0x2b3587,_0x2e66('0xc'),JSON[_0x2e66('0xf')](_0x7a7b82));if(_0x7a7b82['error']){if(_0x7a7b82[_0x2e66('0x10')][_0x2e66('0x11')]===0x1f4){logger[_0x2e66('0x10')](_0x2e66('0xb'),_0x2b3587,_0x7a7b82[_0x2e66('0x10')]['message']);return _0x473308(_0x7a7b82[_0x2e66('0x10')][_0x2e66('0x12')]);}logger[_0x2e66('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x2b3587,_0x7a7b82[_0x2e66('0x10')][_0x2e66('0x12')]);return _0x5943d6(_0x7a7b82[_0x2e66('0x10')][_0x2e66('0x12')]);}else{logger['info'](_0x2e66('0xb'),_0x2b3587,_0x2e66('0xc'));_0x5943d6(_0x7a7b82[_0x2e66('0x13')][_0x2e66('0x12')]);}})[_0x2e66('0x14')](function(_0x1f1df3){logger[_0x2e66('0x10')](_0x2e66('0xb'),_0x2b3587,_0x1f1df3);_0x473308(_0x1f1df3);});});}