Built motion from commit (unavailable).|2.5.26
[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 _0xb1a2=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x403fbc,_0x27dc37){var _0x1075f0=function(_0x47c59b){while(--_0x47c59b){_0x403fbc['push'](_0x403fbc['shift']());}};_0x1075f0(++_0x27dc37);}(_0xb1a2,0x1d6));var _0x2b1a=function(_0x4c0a42,_0x33686b){_0x4c0a42=_0x4c0a42-0x0;var _0x3be7b4=_0xb1a2[_0x4c0a42];return _0x3be7b4;};'use strict';var _=require(_0x2b1a('0x0'));var util=require('util');var moment=require(_0x2b1a('0x1'));var BPromise=require(_0x2b1a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b1a('0x3'));var db=require(_0x2b1a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b1a('0x5'))(_0x2b1a('0x6'));var config=require(_0x2b1a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b1a('0x8')][_0x2b1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33d736,_0x5499e7,_0x3eefd2){return new BPromise(function(_0x738302,_0x2c039b){return client[_0x2b1a('0xa')](_0x33d736,_0x3eefd2)[_0x2b1a('0xb')](function(_0x2f45f5){logger[_0x2b1a('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x5499e7,_0x2b1a('0xd'));logger['debug'](_0x2b1a('0xe'),_0x5499e7,_0x2b1a('0xd'),JSON[_0x2b1a('0xf')](_0x2f45f5));if(_0x2f45f5['error']){if(_0x2f45f5[_0x2b1a('0x10')][_0x2b1a('0x11')]===0x1f4){logger[_0x2b1a('0x10')](_0x2b1a('0x12'),_0x5499e7,_0x2f45f5[_0x2b1a('0x10')]['message']);return _0x2c039b(_0x2f45f5[_0x2b1a('0x10')]['message']);}logger['error'](_0x2b1a('0x12'),_0x5499e7,_0x2f45f5['error'][_0x2b1a('0x13')]);return _0x738302(_0x2f45f5[_0x2b1a('0x10')]['message']);}else{logger['info'](_0x2b1a('0x12'),_0x5499e7,_0x2b1a('0xd'));_0x738302(_0x2f45f5[_0x2b1a('0x14')][_0x2b1a('0x13')]);}})[_0x2b1a('0x15')](function(_0x1432d6){logger['error'](_0x2b1a('0x12'),_0x5499e7,_0x1432d6);_0x2c039b(_0x1432d6);});});}