Built motion from commit 85328c08.|2.5.50
[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 _0xa321=['../../config/environment','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x3514da,_0x332bb6){var _0x5348e7=function(_0x2fb52b){while(--_0x2fb52b){_0x3514da['push'](_0x3514da['shift']());}};_0x5348e7(++_0x332bb6);}(_0xa321,0x68));var _0x1a32=function(_0x35c12c,_0x378ba0){_0x35c12c=_0x35c12c-0x0;var _0x2bab3a=_0xa321[_0x35c12c];return _0x2bab3a;};'use strict';var _=require(_0x1a32('0x0'));var util=require('util');var moment=require(_0x1a32('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a32('0x2'));var fs=require('fs');var Redis=require(_0x1a32('0x3'));var db=require(_0x1a32('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a32('0x5'));var config=require(_0x1a32('0x6'));var jayson=require(_0x1a32('0x7'));var client=jayson[_0x1a32('0x8')][_0x1a32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ca734,_0x1eb98c,_0x2cbe96){return new BPromise(function(_0x43e939,_0x3c8a66){return client['request'](_0x3ca734,_0x2cbe96)[_0x1a32('0xa')](function(_0x467dfc){logger[_0x1a32('0xb')](_0x1a32('0xc'),_0x1eb98c,'request\x20sent');logger[_0x1a32('0xd')](_0x1a32('0xe'),_0x1eb98c,_0x1a32('0xf'),JSON[_0x1a32('0x10')](_0x467dfc));if(_0x467dfc[_0x1a32('0x11')]){if(_0x467dfc[_0x1a32('0x11')][_0x1a32('0x12')]===0x1f4){logger[_0x1a32('0x11')](_0x1a32('0xc'),_0x1eb98c,_0x467dfc[_0x1a32('0x11')][_0x1a32('0x13')]);return _0x3c8a66(_0x467dfc[_0x1a32('0x11')]['message']);}logger[_0x1a32('0x11')](_0x1a32('0xc'),_0x1eb98c,_0x467dfc[_0x1a32('0x11')][_0x1a32('0x13')]);return _0x43e939(_0x467dfc['error'][_0x1a32('0x13')]);}else{logger[_0x1a32('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1eb98c,'request\x20sent');_0x43e939(_0x467dfc[_0x1a32('0x14')][_0x1a32('0x13')]);}})[_0x1a32('0x15')](function(_0x24bd8f){logger[_0x1a32('0x11')](_0x1a32('0xc'),_0x1eb98c,_0x24bd8f);_0x3c8a66(_0x24bd8f);});});}