Built motion from commit 9d1906d1.|2.5.40
[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 _0x6a4a=['catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x6a4a,0x14b));var _0xa6a4=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x6a4a[_0x521929];return _0x632436;};'use strict';var _=require(_0xa6a4('0x0'));var util=require(_0xa6a4('0x1'));var moment=require('moment');var BPromise=require(_0xa6a4('0x2'));var rs=require(_0xa6a4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa6a4('0x4'));var logger=require(_0xa6a4('0x5'))(_0xa6a4('0x6'));var config=require(_0xa6a4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa6a4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fdd4b,_0x50ee60,_0x35fc2b){return new BPromise(function(_0x3116fa,_0x439d63){return client[_0xa6a4('0x9')](_0x2fdd4b,_0x35fc2b)[_0xa6a4('0xa')](function(_0x535d18){logger[_0xa6a4('0xb')](_0xa6a4('0xc'),_0x50ee60,_0xa6a4('0xd'));logger[_0xa6a4('0xe')](_0xa6a4('0xf'),_0x50ee60,'request\x20sent',JSON[_0xa6a4('0x10')](_0x535d18));if(_0x535d18[_0xa6a4('0x11')]){if(_0x535d18[_0xa6a4('0x11')][_0xa6a4('0x12')]===0x1f4){logger[_0xa6a4('0x11')](_0xa6a4('0xc'),_0x50ee60,_0x535d18['error'][_0xa6a4('0x13')]);return _0x439d63(_0x535d18[_0xa6a4('0x11')][_0xa6a4('0x13')]);}logger[_0xa6a4('0x11')](_0xa6a4('0xc'),_0x50ee60,_0x535d18['error'][_0xa6a4('0x13')]);return _0x3116fa(_0x535d18[_0xa6a4('0x11')]['message']);}else{logger['info'](_0xa6a4('0xc'),_0x50ee60,'request\x20sent');_0x3116fa(_0x535d18[_0xa6a4('0x14')]['message']);}})[_0xa6a4('0x15')](function(_0x48c16a){logger[_0xa6a4('0x11')](_0xa6a4('0xc'),_0x50ee60,_0x48c16a);_0x439d63(_0x48c16a);});});}