eb5197987feb5ca047b8592f3efaea1422594efa
[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 _0xaf24=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf24,0x13c));var _0x4af2=function(_0x2acf39,_0x4db88b){_0x2acf39=_0x2acf39-0x0;var _0x530982=_0xaf24[_0x2acf39];return _0x530982;};'use strict';var _=require(_0x4af2('0x0'));var util=require(_0x4af2('0x1'));var moment=require(_0x4af2('0x2'));var BPromise=require(_0x4af2('0x3'));var rs=require(_0x4af2('0x4'));var fs=require('fs');var Redis=require(_0x4af2('0x5'));var db=require(_0x4af2('0x6'))['db'];var utils=require(_0x4af2('0x7'));var logger=require('../../config/logger')(_0x4af2('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4af2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x269109,_0x368fec,_0xbca0c7){return new BPromise(function(_0x33e3dc,_0x1b1496){return client[_0x4af2('0xa')](_0x269109,_0xbca0c7)[_0x4af2('0xb')](function(_0x2397fb){logger[_0x4af2('0xc')](_0x4af2('0xd'),_0x368fec,_0x4af2('0xe'));logger['debug'](_0x4af2('0xf'),_0x368fec,_0x4af2('0xe'),JSON[_0x4af2('0x10')](_0x2397fb));if(_0x2397fb[_0x4af2('0x11')]){if(_0x2397fb[_0x4af2('0x11')][_0x4af2('0x12')]===0x1f4){logger[_0x4af2('0x11')](_0x4af2('0xd'),_0x368fec,_0x2397fb['error'][_0x4af2('0x13')]);return _0x1b1496(_0x2397fb[_0x4af2('0x11')]['message']);}logger[_0x4af2('0x11')](_0x4af2('0xd'),_0x368fec,_0x2397fb[_0x4af2('0x11')][_0x4af2('0x13')]);return _0x33e3dc(_0x2397fb['error']['message']);}else{logger[_0x4af2('0xc')](_0x4af2('0xd'),_0x368fec,_0x4af2('0xe'));_0x33e3dc(_0x2397fb['result'][_0x4af2('0x13')]);}})['catch'](function(_0x5f3c72){logger['error'](_0x4af2('0xd'),_0x368fec,_0x5f3c72);_0x1b1496(_0x5f3c72);});});}