076441e9ca5208cc9668dff9f2a24a3dedbc8cc9
[motion2.git] / server / api / intFreshsalesConfiguration / intFreshsalesConfiguration.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 _0xb9ec=['rpc','../../config/environment','jayson/promise','client','http','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9ec,0x197));var _0xcb9e=function(_0x576670,_0x45b044){_0x576670=_0x576670-0x0;var _0x43f887=_0xb9ec[_0x576670];return _0x43f887;};'use strict';var _=require(_0xcb9e('0x0'));var util=require(_0xcb9e('0x1'));var moment=require(_0xcb9e('0x2'));var BPromise=require(_0xcb9e('0x3'));var rs=require(_0xcb9e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb9e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb9e('0x6'))(_0xcb9e('0x7'));var config=require(_0xcb9e('0x8'));var jayson=require(_0xcb9e('0x9'));var client=jayson[_0xcb9e('0xa')][_0xcb9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x324ee5,_0x2a8c10,_0x3b056e){return new BPromise(function(_0x3a4438,_0x24bfcf){return client['request'](_0x324ee5,_0x3b056e)[_0xcb9e('0xc')](function(_0x3a6c25){logger['info'](_0xcb9e('0xd'),_0x2a8c10,_0xcb9e('0xe'));logger[_0xcb9e('0xf')](_0xcb9e('0x10'),_0x2a8c10,'request\x20sent',JSON['stringify'](_0x3a6c25));if(_0x3a6c25[_0xcb9e('0x11')]){if(_0x3a6c25[_0xcb9e('0x11')][_0xcb9e('0x12')]===0x1f4){logger[_0xcb9e('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2a8c10,_0x3a6c25[_0xcb9e('0x11')][_0xcb9e('0x13')]);return _0x24bfcf(_0x3a6c25[_0xcb9e('0x11')][_0xcb9e('0x13')]);}logger[_0xcb9e('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2a8c10,_0x3a6c25['error'][_0xcb9e('0x13')]);return _0x3a4438(_0x3a6c25[_0xcb9e('0x11')][_0xcb9e('0x13')]);}else{logger[_0xcb9e('0x14')](_0xcb9e('0xd'),_0x2a8c10,_0xcb9e('0xe'));_0x3a4438(_0x3a6c25[_0xcb9e('0x15')][_0xcb9e('0x13')]);}})[_0xcb9e('0x16')](function(_0x1f2d80){logger[_0xcb9e('0x11')](_0xcb9e('0xd'),_0x2a8c10,_0x1f2d80);_0x24bfcf(_0x1f2d80);});});}