Built motion from commit d1eab355.|2.6.28
[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 _0x27e5=['catch','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5b5b95,_0x15823d){var _0x303edc=function(_0x2a28f7){while(--_0x2a28f7){_0x5b5b95['push'](_0x5b5b95['shift']());}};_0x303edc(++_0x15823d);}(_0x27e5,0x18d));var _0x527e=function(_0x20ec57,_0xdc8832){_0x20ec57=_0x20ec57-0x0;var _0xc33525=_0x27e5[_0x20ec57];return _0xc33525;};'use strict';var _=require('lodash');var util=require(_0x527e('0x0'));var moment=require('moment');var BPromise=require(_0x527e('0x1'));var rs=require(_0x527e('0x2'));var fs=require('fs');var Redis=require(_0x527e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x527e('0x4'));var config=require(_0x527e('0x5'));var jayson=require(_0x527e('0x6'));var client=jayson[_0x527e('0x7')][_0x527e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c2e21,_0xab49fe,_0x592f21){return new BPromise(function(_0x27e087,_0x33310f){return client[_0x527e('0x9')](_0x3c2e21,_0x592f21)[_0x527e('0xa')](function(_0x97be42){logger[_0x527e('0xb')](_0x527e('0xc'),_0xab49fe,_0x527e('0xd'));logger[_0x527e('0xe')](_0x527e('0xf'),_0xab49fe,_0x527e('0xd'),JSON[_0x527e('0x10')](_0x97be42));if(_0x97be42[_0x527e('0x11')]){if(_0x97be42[_0x527e('0x11')][_0x527e('0x12')]===0x1f4){logger[_0x527e('0x11')](_0x527e('0xc'),_0xab49fe,_0x97be42[_0x527e('0x11')][_0x527e('0x13')]);return _0x33310f(_0x97be42['error'][_0x527e('0x13')]);}logger[_0x527e('0x11')](_0x527e('0xc'),_0xab49fe,_0x97be42[_0x527e('0x11')][_0x527e('0x13')]);return _0x27e087(_0x97be42[_0x527e('0x11')][_0x527e('0x13')]);}else{logger[_0x527e('0xb')](_0x527e('0xc'),_0xab49fe,'request\x20sent');_0x27e087(_0x97be42[_0x527e('0x14')][_0x527e('0x13')]);}})[_0x527e('0x15')](function(_0x54b78c){logger['error'](_0x527e('0xc'),_0xab49fe,_0x54b78c);_0x33310f(_0x54b78c);});});}