Built motion from commit da617fac.|2.6.6
[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 _0xa1d5=['catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4c991a,_0x460730){var _0x5e3164=function(_0x286be1){while(--_0x286be1){_0x4c991a['push'](_0x4c991a['shift']());}};_0x5e3164(++_0x460730);}(_0xa1d5,0x18d));var _0x5a1d=function(_0x51fbb8,_0x3f9352){_0x51fbb8=_0x51fbb8-0x0;var _0x332188=_0xa1d5[_0x51fbb8];return _0x332188;};'use strict';var _=require(_0x5a1d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5a1d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a1d('0x2'));var db=require(_0x5a1d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a1d('0x4'))(_0x5a1d('0x5'));var config=require(_0x5a1d('0x6'));var jayson=require(_0x5a1d('0x7'));var client=jayson[_0x5a1d('0x8')][_0x5a1d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18f632,_0x21ac81,_0x3fa2a1){return new BPromise(function(_0x4b6fa2,_0x529c66){return client[_0x5a1d('0xa')](_0x18f632,_0x3fa2a1)[_0x5a1d('0xb')](function(_0x3b8134){logger[_0x5a1d('0xc')](_0x5a1d('0xd'),_0x21ac81,_0x5a1d('0xe'));logger[_0x5a1d('0xf')](_0x5a1d('0x10'),_0x21ac81,_0x5a1d('0xe'),JSON[_0x5a1d('0x11')](_0x3b8134));if(_0x3b8134['error']){if(_0x3b8134[_0x5a1d('0x12')]['code']===0x1f4){logger[_0x5a1d('0x12')](_0x5a1d('0xd'),_0x21ac81,_0x3b8134['error'][_0x5a1d('0x13')]);return _0x529c66(_0x3b8134[_0x5a1d('0x12')][_0x5a1d('0x13')]);}logger['error'](_0x5a1d('0xd'),_0x21ac81,_0x3b8134[_0x5a1d('0x12')][_0x5a1d('0x13')]);return _0x4b6fa2(_0x3b8134[_0x5a1d('0x12')][_0x5a1d('0x13')]);}else{logger[_0x5a1d('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x21ac81,_0x5a1d('0xe'));_0x4b6fa2(_0x3b8134[_0x5a1d('0x14')][_0x5a1d('0x13')]);}})[_0x5a1d('0x15')](function(_0x9ad44f){logger[_0x5a1d('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x21ac81,_0x9ad44f);_0x529c66(_0x9ad44f);});});}