9ca97f39c304e4ff74a1f368a6eb0b672441cfce
[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 _0xecd9=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4f1626,_0x298634){var _0x12f399=function(_0x11ab42){while(--_0x11ab42){_0x4f1626['push'](_0x4f1626['shift']());}};_0x12f399(++_0x298634);}(_0xecd9,0x73));var _0x9ecd=function(_0x347dfe,_0x205d95){_0x347dfe=_0x347dfe-0x0;var _0x415a90=_0xecd9[_0x347dfe];return _0x415a90;};'use strict';var _=require(_0x9ecd('0x0'));var util=require('util');var moment=require(_0x9ecd('0x1'));var BPromise=require(_0x9ecd('0x2'));var rs=require(_0x9ecd('0x3'));var fs=require('fs');var Redis=require(_0x9ecd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ecd('0x5'));var logger=require(_0x9ecd('0x6'))('rpc');var config=require(_0x9ecd('0x7'));var jayson=require(_0x9ecd('0x8'));var client=jayson[_0x9ecd('0x9')][_0x9ecd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x157743,_0x14a205,_0x21fdcb){return new BPromise(function(_0x36649b,_0x5b8d67){return client[_0x9ecd('0xb')](_0x157743,_0x21fdcb)[_0x9ecd('0xc')](function(_0x1c58a8){logger[_0x9ecd('0xd')](_0x9ecd('0xe'),_0x14a205,_0x9ecd('0xf'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x14a205,_0x9ecd('0xf'),JSON[_0x9ecd('0x10')](_0x1c58a8));if(_0x1c58a8[_0x9ecd('0x11')]){if(_0x1c58a8[_0x9ecd('0x11')][_0x9ecd('0x12')]===0x1f4){logger[_0x9ecd('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x14a205,_0x1c58a8[_0x9ecd('0x11')][_0x9ecd('0x13')]);return _0x5b8d67(_0x1c58a8[_0x9ecd('0x11')][_0x9ecd('0x13')]);}logger[_0x9ecd('0x11')](_0x9ecd('0xe'),_0x14a205,_0x1c58a8[_0x9ecd('0x11')][_0x9ecd('0x13')]);return _0x36649b(_0x1c58a8[_0x9ecd('0x11')][_0x9ecd('0x13')]);}else{logger['info'](_0x9ecd('0xe'),_0x14a205,_0x9ecd('0xf'));_0x36649b(_0x1c58a8[_0x9ecd('0x14')][_0x9ecd('0x13')]);}})[_0x9ecd('0x15')](function(_0x117e2d){logger[_0x9ecd('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x14a205,_0x117e2d);_0x5b8d67(_0x117e2d);});});}