Built motion from commit (unavailable).|2.5.10
[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 _0x2b84=['request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b84,0x199));var _0x42b8=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x2b84[_0xf50820];return _0x2a9b10;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x42b8('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42b8('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x42b8('0x2'));var logger=require(_0x42b8('0x3'))('rpc');var config=require(_0x42b8('0x4'));var jayson=require(_0x42b8('0x5'));var client=jayson[_0x42b8('0x6')][_0x42b8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1d0e31,_0xa57235,_0x3833e7){return new BPromise(function(_0x1e8484,_0x34977b){return client[_0x42b8('0x8')](_0x1d0e31,_0x3833e7)[_0x42b8('0x9')](function(_0x4f7e74){logger[_0x42b8('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0xa57235,_0x42b8('0xb'));logger[_0x42b8('0xc')](_0x42b8('0xd'),_0xa57235,_0x42b8('0xb'),JSON[_0x42b8('0xe')](_0x4f7e74));if(_0x4f7e74[_0x42b8('0xf')]){if(_0x4f7e74[_0x42b8('0xf')]['code']===0x1f4){logger[_0x42b8('0xf')](_0x42b8('0x10'),_0xa57235,_0x4f7e74[_0x42b8('0xf')]['message']);return _0x34977b(_0x4f7e74[_0x42b8('0xf')][_0x42b8('0x11')]);}logger['error'](_0x42b8('0x10'),_0xa57235,_0x4f7e74[_0x42b8('0xf')][_0x42b8('0x11')]);return _0x1e8484(_0x4f7e74['error'][_0x42b8('0x11')]);}else{logger[_0x42b8('0xa')](_0x42b8('0x10'),_0xa57235,'request\x20sent');_0x1e8484(_0x4f7e74[_0x42b8('0x12')][_0x42b8('0x11')]);}})[_0x42b8('0x13')](function(_0x5d5ce1){logger[_0x42b8('0xf')](_0x42b8('0x10'),_0xa57235,_0x5d5ce1);_0x34977b(_0x5d5ce1);});});}