Built motion from commit (unavailable).|2.5.4
[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 _0x39e1=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','ioredis'];(function(_0x39b86c,_0x5a8b64){var _0x120b7a=function(_0x3478f7){while(--_0x3478f7){_0x39b86c['push'](_0x39b86c['shift']());}};_0x120b7a(++_0x5a8b64);}(_0x39e1,0xf9));var _0x139e=function(_0x4f0cfd,_0x2e0eb3){_0x4f0cfd=_0x4f0cfd-0x0;var _0x525f02=_0x39e1[_0x4f0cfd];return _0x525f02;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x139e('0x0'));var BPromise=require(_0x139e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x139e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x139e('0x3'));var logger=require(_0x139e('0x4'))('rpc');var config=require(_0x139e('0x5'));var jayson=require(_0x139e('0x6'));var client=jayson[_0x139e('0x7')][_0x139e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43f49c,_0x579e5e,_0xac09b6){return new BPromise(function(_0x56eb15,_0x2b3ae6){return client[_0x139e('0x9')](_0x43f49c,_0xac09b6)[_0x139e('0xa')](function(_0x4eb941){logger[_0x139e('0xb')](_0x139e('0xc'),_0x579e5e,_0x139e('0xd'));logger[_0x139e('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x579e5e,_0x139e('0xd'),JSON[_0x139e('0xf')](_0x4eb941));if(_0x4eb941[_0x139e('0x10')]){if(_0x4eb941[_0x139e('0x10')][_0x139e('0x11')]===0x1f4){logger[_0x139e('0x10')](_0x139e('0xc'),_0x579e5e,_0x4eb941['error'][_0x139e('0x12')]);return _0x2b3ae6(_0x4eb941[_0x139e('0x10')][_0x139e('0x12')]);}logger[_0x139e('0x10')](_0x139e('0xc'),_0x579e5e,_0x4eb941[_0x139e('0x10')][_0x139e('0x12')]);return _0x56eb15(_0x4eb941[_0x139e('0x10')][_0x139e('0x12')]);}else{logger[_0x139e('0xb')](_0x139e('0xc'),_0x579e5e,_0x139e('0xd'));_0x56eb15(_0x4eb941[_0x139e('0x13')][_0x139e('0x12')]);}})[_0x139e('0x14')](function(_0x45486b){logger[_0x139e('0x10')](_0x139e('0xc'),_0x579e5e,_0x45486b);_0x2b3ae6(_0x45486b);});});}