e038aaa433886f7073fbe9a34b1a28b71595d26a
[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 _0xf72f=['jayson/promise','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x36c1bd,_0x481465){var _0x80c757=function(_0x157200){while(--_0x157200){_0x36c1bd['push'](_0x36c1bd['shift']());}};_0x80c757(++_0x481465);}(_0xf72f,0x1af));var _0xff72=function(_0x2aeeec,_0x3fc296){_0x2aeeec=_0x2aeeec-0x0;var _0x175d20=_0xf72f[_0x2aeeec];return _0x175d20;};'use strict';var _=require(_0xff72('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xff72('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff72('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xff72('0x3'))(_0xff72('0x4'));var config=require(_0xff72('0x5'));var jayson=require(_0xff72('0x6'));var client=jayson[_0xff72('0x7')][_0xff72('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x344a5a,_0x5543d6,_0x444282){return new BPromise(function(_0x8540b9,_0x26f40d){return client[_0xff72('0x9')](_0x344a5a,_0x444282)[_0xff72('0xa')](function(_0x572b94){logger['info'](_0xff72('0xb'),_0x5543d6,_0xff72('0xc'));logger['debug'](_0xff72('0xd'),_0x5543d6,_0xff72('0xc'),JSON[_0xff72('0xe')](_0x572b94));if(_0x572b94['error']){if(_0x572b94[_0xff72('0xf')]['code']===0x1f4){logger['error'](_0xff72('0xb'),_0x5543d6,_0x572b94[_0xff72('0xf')][_0xff72('0x10')]);return _0x26f40d(_0x572b94['error']['message']);}logger[_0xff72('0xf')](_0xff72('0xb'),_0x5543d6,_0x572b94[_0xff72('0xf')][_0xff72('0x10')]);return _0x8540b9(_0x572b94['error'][_0xff72('0x10')]);}else{logger[_0xff72('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5543d6,_0xff72('0xc'));_0x8540b9(_0x572b94['result']['message']);}})[_0xff72('0x12')](function(_0x2ac7aa){logger[_0xff72('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x5543d6,_0x2ac7aa);_0x26f40d(_0x2ac7aa);});});}