Built motion from commit d5e4af8c.|2.6.23
[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 _0xefef=['error','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','message'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xefef,0xdf));var _0xfefe=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0xefef[_0x5c6994];return _0x1d5c84;};'use strict';var _=require(_0xfefe('0x0'));var util=require('util');var moment=require(_0xfefe('0x1'));var BPromise=require(_0xfefe('0x2'));var rs=require(_0xfefe('0x3'));var fs=require('fs');var Redis=require(_0xfefe('0x4'));var db=require(_0xfefe('0x5'))['db'];var utils=require(_0xfefe('0x6'));var logger=require(_0xfefe('0x7'))('rpc');var config=require(_0xfefe('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfefe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18730b,_0x5e80b9,_0x338c93){return new BPromise(function(_0xfbf67e,_0xf1aa5b){return client[_0xfefe('0xa')](_0x18730b,_0x338c93)[_0xfefe('0xb')](function(_0x4472f1){logger['info'](_0xfefe('0xc'),_0x5e80b9,_0xfefe('0xd'));logger['debug'](_0xfefe('0xe'),_0x5e80b9,_0xfefe('0xd'),JSON[_0xfefe('0xf')](_0x4472f1));if(_0x4472f1['error']){if(_0x4472f1['error']['code']===0x1f4){logger['error'](_0xfefe('0xc'),_0x5e80b9,_0x4472f1['error'][_0xfefe('0x10')]);return _0xf1aa5b(_0x4472f1[_0xfefe('0x11')][_0xfefe('0x10')]);}logger[_0xfefe('0x11')](_0xfefe('0xc'),_0x5e80b9,_0x4472f1[_0xfefe('0x11')][_0xfefe('0x10')]);return _0xfbf67e(_0x4472f1[_0xfefe('0x11')][_0xfefe('0x10')]);}else{logger[_0xfefe('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x5e80b9,_0xfefe('0xd'));_0xfbf67e(_0x4472f1[_0xfefe('0x13')][_0xfefe('0x10')]);}})['catch'](function(_0x24353f){logger['error'](_0xfefe('0xc'),_0x5e80b9,_0x24353f);_0xf1aa5b(_0x24353f);});});}