Built motion from commit 3c2ce842.|2.6.31
[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 _0x339f=['request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x280584,_0x2e40b6){var _0x5c3b73=function(_0x241400){while(--_0x241400){_0x280584['push'](_0x280584['shift']());}};_0x5c3b73(++_0x2e40b6);}(_0x339f,0x114));var _0xf339=function(_0x28d75e,_0x2208a5){_0x28d75e=_0x28d75e-0x0;var _0x36ca32=_0x339f[_0x28d75e];return _0x36ca32;};'use strict';var _=require('lodash');var util=require(_0xf339('0x0'));var moment=require(_0xf339('0x1'));var BPromise=require('bluebird');var rs=require(_0xf339('0x2'));var fs=require('fs');var Redis=require(_0xf339('0x3'));var db=require(_0xf339('0x4'))['db'];var utils=require(_0xf339('0x5'));var logger=require('../../config/logger')(_0xf339('0x6'));var config=require(_0xf339('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf339('0x8')][_0xf339('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dc71e,_0x53186f,_0x1b0304){return new BPromise(function(_0x5b32c9,_0xca11e1){return client[_0xf339('0xa')](_0x4dc71e,_0x1b0304)[_0xf339('0xb')](function(_0x2283bb){logger[_0xf339('0xc')](_0xf339('0xd'),_0x53186f,_0xf339('0xe'));logger[_0xf339('0xf')](_0xf339('0x10'),_0x53186f,_0xf339('0xe'),JSON[_0xf339('0x11')](_0x2283bb));if(_0x2283bb['error']){if(_0x2283bb[_0xf339('0x12')][_0xf339('0x13')]===0x1f4){logger[_0xf339('0x12')](_0xf339('0xd'),_0x53186f,_0x2283bb[_0xf339('0x12')]['message']);return _0xca11e1(_0x2283bb[_0xf339('0x12')][_0xf339('0x14')]);}logger[_0xf339('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x53186f,_0x2283bb['error'][_0xf339('0x14')]);return _0x5b32c9(_0x2283bb[_0xf339('0x12')][_0xf339('0x14')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x53186f,_0xf339('0xe'));_0x5b32c9(_0x2283bb[_0xf339('0x15')]['message']);}})['catch'](function(_0x5a82fb){logger[_0xf339('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x53186f,_0x5a82fb);_0xca11e1(_0x5a82fb);});});}