Built motion from commit 97153652.|2.6.26
[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 _0x8b89=['../../config/logger','rpc','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x472cfc,_0x4ec9f3){var _0x3ba7cb=function(_0x49eb43){while(--_0x49eb43){_0x472cfc['push'](_0x472cfc['shift']());}};_0x3ba7cb(++_0x4ec9f3);}(_0x8b89,0x148));var _0x98b8=function(_0x1306f3,_0x1da761){_0x1306f3=_0x1306f3-0x0;var _0xc1c7bf=_0x8b89[_0x1306f3];return _0xc1c7bf;};'use strict';var _=require(_0x98b8('0x0'));var util=require(_0x98b8('0x1'));var moment=require(_0x98b8('0x2'));var BPromise=require(_0x98b8('0x3'));var rs=require(_0x98b8('0x4'));var fs=require('fs');var Redis=require(_0x98b8('0x5'));var db=require(_0x98b8('0x6'))['db'];var utils=require(_0x98b8('0x7'));var logger=require(_0x98b8('0x8'))(_0x98b8('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x98b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x353d3e,_0x3f3600,_0xeb2bf7){return new BPromise(function(_0x2aa785,_0x477c09){return client[_0x98b8('0xb')](_0x353d3e,_0xeb2bf7)['then'](function(_0x3aa2e5){logger[_0x98b8('0xc')](_0x98b8('0xd'),_0x3f3600,_0x98b8('0xe'));logger[_0x98b8('0xf')](_0x98b8('0x10'),_0x3f3600,_0x98b8('0xe'),JSON['stringify'](_0x3aa2e5));if(_0x3aa2e5[_0x98b8('0x11')]){if(_0x3aa2e5[_0x98b8('0x11')]['code']===0x1f4){logger[_0x98b8('0x11')](_0x98b8('0xd'),_0x3f3600,_0x3aa2e5['error'][_0x98b8('0x12')]);return _0x477c09(_0x3aa2e5['error'][_0x98b8('0x12')]);}logger[_0x98b8('0x11')](_0x98b8('0xd'),_0x3f3600,_0x3aa2e5[_0x98b8('0x11')][_0x98b8('0x12')]);return _0x2aa785(_0x3aa2e5['error'][_0x98b8('0x12')]);}else{logger[_0x98b8('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3f3600,'request\x20sent');_0x2aa785(_0x3aa2e5[_0x98b8('0x13')]['message']);}})[_0x98b8('0x14')](function(_0x135643){logger[_0x98b8('0x11')](_0x98b8('0xd'),_0x3f3600,_0x135643);_0x477c09(_0x135643);});});}