Built motion from commit f3da74b7.|2.5.36
[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 _0x5fde=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x5fde,0x1de));var _0xe5fd=function(_0xccd3b5,_0x4fe7fa){_0xccd3b5=_0xccd3b5-0x0;var _0x3070ac=_0x5fde[_0xccd3b5];return _0x3070ac;};'use strict';var _=require(_0xe5fd('0x0'));var util=require(_0xe5fd('0x1'));var moment=require(_0xe5fd('0x2'));var BPromise=require(_0xe5fd('0x3'));var rs=require(_0xe5fd('0x4'));var fs=require('fs');var Redis=require(_0xe5fd('0x5'));var db=require(_0xe5fd('0x6'))['db'];var utils=require(_0xe5fd('0x7'));var logger=require('../../config/logger')(_0xe5fd('0x8'));var config=require(_0xe5fd('0x9'));var jayson=require(_0xe5fd('0xa'));var client=jayson[_0xe5fd('0xb')][_0xe5fd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e80b7,_0x3876b7,_0x29fec6){return new BPromise(function(_0x2286c1,_0x33f16d){return client[_0xe5fd('0xd')](_0x1e80b7,_0x29fec6)[_0xe5fd('0xe')](function(_0x4a3b03){logger[_0xe5fd('0xf')](_0xe5fd('0x10'),_0x3876b7,'request\x20sent');logger[_0xe5fd('0x11')](_0xe5fd('0x12'),_0x3876b7,_0xe5fd('0x13'),JSON[_0xe5fd('0x14')](_0x4a3b03));if(_0x4a3b03[_0xe5fd('0x15')]){if(_0x4a3b03[_0xe5fd('0x15')]['code']===0x1f4){logger['error'](_0xe5fd('0x10'),_0x3876b7,_0x4a3b03['error'][_0xe5fd('0x16')]);return _0x33f16d(_0x4a3b03[_0xe5fd('0x15')][_0xe5fd('0x16')]);}logger['error'](_0xe5fd('0x10'),_0x3876b7,_0x4a3b03[_0xe5fd('0x15')][_0xe5fd('0x16')]);return _0x2286c1(_0x4a3b03[_0xe5fd('0x15')][_0xe5fd('0x16')]);}else{logger[_0xe5fd('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3876b7,_0xe5fd('0x13'));_0x2286c1(_0x4a3b03[_0xe5fd('0x17')][_0xe5fd('0x16')]);}})[_0xe5fd('0x18')](function(_0x45e035){logger[_0xe5fd('0x15')](_0xe5fd('0x10'),_0x3876b7,_0x45e035);_0x33f16d(_0x45e035);});});}