Built motion from commit 092f8824.|2.5.49
[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 _0xea14=['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','rpc','../../config/environment','jayson/promise'];(function(_0x2a87e7,_0x16f01c){var _0x1e253e=function(_0x25a923){while(--_0x25a923){_0x2a87e7['push'](_0x2a87e7['shift']());}};_0x1e253e(++_0x16f01c);}(_0xea14,0xc8));var _0x4ea1=function(_0x4d88ce,_0xe6896b){_0x4d88ce=_0x4d88ce-0x0;var _0x48ecc8=_0xea14[_0x4d88ce];return _0x48ecc8;};'use strict';var _=require(_0x4ea1('0x0'));var util=require(_0x4ea1('0x1'));var moment=require(_0x4ea1('0x2'));var BPromise=require(_0x4ea1('0x3'));var rs=require(_0x4ea1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ea1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4ea1('0x6'))(_0x4ea1('0x7'));var config=require(_0x4ea1('0x8'));var jayson=require(_0x4ea1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14bc94,_0x193160,_0x3ac773){return new BPromise(function(_0x114a0a,_0x2a18a4){return client['request'](_0x14bc94,_0x3ac773)[_0x4ea1('0xa')](function(_0x14e03b){logger['info'](_0x4ea1('0xb'),_0x193160,_0x4ea1('0xc'));logger[_0x4ea1('0xd')](_0x4ea1('0xe'),_0x193160,'request\x20sent',JSON['stringify'](_0x14e03b));if(_0x14e03b[_0x4ea1('0xf')]){if(_0x14e03b['error'][_0x4ea1('0x10')]===0x1f4){logger[_0x4ea1('0xf')](_0x4ea1('0xb'),_0x193160,_0x14e03b[_0x4ea1('0xf')]['message']);return _0x2a18a4(_0x14e03b['error'][_0x4ea1('0x11')]);}logger[_0x4ea1('0xf')](_0x4ea1('0xb'),_0x193160,_0x14e03b[_0x4ea1('0xf')]['message']);return _0x114a0a(_0x14e03b['error']['message']);}else{logger[_0x4ea1('0x12')](_0x4ea1('0xb'),_0x193160,_0x4ea1('0xc'));_0x114a0a(_0x14e03b[_0x4ea1('0x13')][_0x4ea1('0x11')]);}})[_0x4ea1('0x14')](function(_0x2c4c99){logger[_0x4ea1('0xf')](_0x4ea1('0xb'),_0x193160,_0x2c4c99);_0x2a18a4(_0x2c4c99);});});}