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 _0x8910=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x8910,0x1c9));var _0x0891=function(_0x3c600d,_0x4b5c85){_0x3c600d=_0x3c600d-0x0;var _0xd195e3=_0x8910[_0x3c600d];return _0xd195e3;};'use strict';var _=require(_0x0891('0x0'));var util=require(_0x0891('0x1'));var moment=require(_0x0891('0x2'));var BPromise=require(_0x0891('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0891('0x4'));var db=require(_0x0891('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0891('0x6'))(_0x0891('0x7'));var config=require(_0x0891('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0891('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1141a4,_0x314adf,_0x264f61){return new BPromise(function(_0x1c00ff,_0x4edbf3){return client[_0x0891('0xa')](_0x1141a4,_0x264f61)[_0x0891('0xb')](function(_0x2d663e){logger[_0x0891('0xc')](_0x0891('0xd'),_0x314adf,_0x0891('0xe'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x314adf,'request\x20sent',JSON[_0x0891('0xf')](_0x2d663e));if(_0x2d663e['error']){if(_0x2d663e[_0x0891('0x10')]['code']===0x1f4){logger[_0x0891('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x314adf,_0x2d663e[_0x0891('0x10')][_0x0891('0x11')]);return _0x4edbf3(_0x2d663e[_0x0891('0x10')][_0x0891('0x11')]);}logger['error'](_0x0891('0xd'),_0x314adf,_0x2d663e[_0x0891('0x10')][_0x0891('0x11')]);return _0x1c00ff(_0x2d663e['error']['message']);}else{logger[_0x0891('0xc')](_0x0891('0xd'),_0x314adf,_0x0891('0xe'));_0x1c00ff(_0x2d663e[_0x0891('0x12')][_0x0891('0x11')]);}})[_0x0891('0x13')](function(_0x255af2){logger[_0x0891('0x10')](_0x0891('0xd'),_0x314adf,_0x255af2);_0x4edbf3(_0x255af2);});});}