Built motion from commit 43538d75.|2.5.35
[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 _0xa963=['http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x197899,_0x297080){var _0x4dbec3=function(_0x10a396){while(--_0x10a396){_0x197899['push'](_0x197899['shift']());}};_0x4dbec3(++_0x297080);}(_0xa963,0x97));var _0x3a96=function(_0x34f922,_0x5521c2){_0x34f922=_0x34f922-0x0;var _0x5aefc2=_0xa963[_0x34f922];return _0x5aefc2;};'use strict';var _=require(_0x3a96('0x0'));var util=require(_0x3a96('0x1'));var moment=require(_0x3a96('0x2'));var BPromise=require(_0x3a96('0x3'));var rs=require(_0x3a96('0x4'));var fs=require('fs');var Redis=require(_0x3a96('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3a96('0x6'))('rpc');var config=require(_0x3a96('0x7'));var jayson=require(_0x3a96('0x8'));var client=jayson[_0x3a96('0x9')][_0x3a96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a86dc,_0x3c0415,_0x4c3d54){return new BPromise(function(_0x4be0a0,_0x258544){return client[_0x3a96('0xb')](_0x5a86dc,_0x4c3d54)[_0x3a96('0xc')](function(_0x46194b){logger[_0x3a96('0xd')](_0x3a96('0xe'),_0x3c0415,_0x3a96('0xf'));logger['debug'](_0x3a96('0x10'),_0x3c0415,_0x3a96('0xf'),JSON[_0x3a96('0x11')](_0x46194b));if(_0x46194b[_0x3a96('0x12')]){if(_0x46194b[_0x3a96('0x12')][_0x3a96('0x13')]===0x1f4){logger[_0x3a96('0x12')](_0x3a96('0xe'),_0x3c0415,_0x46194b[_0x3a96('0x12')][_0x3a96('0x14')]);return _0x258544(_0x46194b[_0x3a96('0x12')][_0x3a96('0x14')]);}logger[_0x3a96('0x12')](_0x3a96('0xe'),_0x3c0415,_0x46194b[_0x3a96('0x12')][_0x3a96('0x14')]);return _0x4be0a0(_0x46194b[_0x3a96('0x12')][_0x3a96('0x14')]);}else{logger[_0x3a96('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3c0415,_0x3a96('0xf'));_0x4be0a0(_0x46194b[_0x3a96('0x15')][_0x3a96('0x14')]);}})[_0x3a96('0x16')](function(_0x105ec6){logger[_0x3a96('0x12')](_0x3a96('0xe'),_0x3c0415,_0x105ec6);_0x258544(_0x105ec6);});});}