Built motion from commit e0fa946e.|2.6.5
[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 _0x80e5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1b57d6,_0x40af62){var _0x3211c1=function(_0x383f08){while(--_0x383f08){_0x1b57d6['push'](_0x1b57d6['shift']());}};_0x3211c1(++_0x40af62);}(_0x80e5,0x1aa));var _0x580e=function(_0x58b6c7,_0x3bf35e){_0x58b6c7=_0x58b6c7-0x0;var _0x5f50d0=_0x80e5[_0x58b6c7];return _0x5f50d0;};'use strict';var _=require('lodash');var util=require(_0x580e('0x0'));var moment=require(_0x580e('0x1'));var BPromise=require(_0x580e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x580e('0x3'));var db=require(_0x580e('0x4'))['db'];var utils=require(_0x580e('0x5'));var logger=require(_0x580e('0x6'))(_0x580e('0x7'));var config=require(_0x580e('0x8'));var jayson=require(_0x580e('0x9'));var client=jayson[_0x580e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58d050,_0x9d26e9,_0x1d2f15){return new BPromise(function(_0x37e84d,_0x46f2ec){return client[_0x580e('0xb')](_0x58d050,_0x1d2f15)[_0x580e('0xc')](function(_0x4effd7){logger[_0x580e('0xd')](_0x580e('0xe'),_0x9d26e9,_0x580e('0xf'));logger[_0x580e('0x10')](_0x580e('0x11'),_0x9d26e9,'request\x20sent',JSON[_0x580e('0x12')](_0x4effd7));if(_0x4effd7[_0x580e('0x13')]){if(_0x4effd7[_0x580e('0x13')][_0x580e('0x14')]===0x1f4){logger['error'](_0x580e('0xe'),_0x9d26e9,_0x4effd7[_0x580e('0x13')]['message']);return _0x46f2ec(_0x4effd7[_0x580e('0x13')]['message']);}logger['error'](_0x580e('0xe'),_0x9d26e9,_0x4effd7[_0x580e('0x13')][_0x580e('0x15')]);return _0x37e84d(_0x4effd7['error'][_0x580e('0x15')]);}else{logger[_0x580e('0xd')](_0x580e('0xe'),_0x9d26e9,_0x580e('0xf'));_0x37e84d(_0x4effd7[_0x580e('0x16')][_0x580e('0x15')]);}})[_0x580e('0x17')](function(_0x5eb1fa){logger[_0x580e('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x9d26e9,_0x5eb1fa);_0x46f2ec(_0x5eb1fa);});});}