Built motion from commit 911eb874.|2.6.31
[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 _0xe916=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','randomstring'];(function(_0x32de4b,_0x19d2b5){var _0x433f7f=function(_0x21c894){while(--_0x21c894){_0x32de4b['push'](_0x32de4b['shift']());}};_0x433f7f(++_0x19d2b5);}(_0xe916,0xa6));var _0x6e91=function(_0x2146dc,_0x23c1fc){_0x2146dc=_0x2146dc-0x0;var _0xe19c5c=_0xe916[_0x2146dc];return _0xe19c5c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6e91('0x0'));var BPromise=require('bluebird');var rs=require(_0x6e91('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e91('0x2'))['db'];var utils=require(_0x6e91('0x3'));var logger=require(_0x6e91('0x4'))('rpc');var config=require(_0x6e91('0x5'));var jayson=require(_0x6e91('0x6'));var client=jayson[_0x6e91('0x7')][_0x6e91('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x406288,_0x356dea,_0x46539b){return new BPromise(function(_0xca1f5c,_0x41e29c){return client[_0x6e91('0x9')](_0x406288,_0x46539b)[_0x6e91('0xa')](function(_0x51d510){logger[_0x6e91('0xb')](_0x6e91('0xc'),_0x356dea,'request\x20sent');logger['debug'](_0x6e91('0xd'),_0x356dea,_0x6e91('0xe'),JSON[_0x6e91('0xf')](_0x51d510));if(_0x51d510[_0x6e91('0x10')]){if(_0x51d510[_0x6e91('0x10')][_0x6e91('0x11')]===0x1f4){logger[_0x6e91('0x10')](_0x6e91('0xc'),_0x356dea,_0x51d510[_0x6e91('0x10')][_0x6e91('0x12')]);return _0x41e29c(_0x51d510[_0x6e91('0x10')]['message']);}logger[_0x6e91('0x10')](_0x6e91('0xc'),_0x356dea,_0x51d510[_0x6e91('0x10')][_0x6e91('0x12')]);return _0xca1f5c(_0x51d510[_0x6e91('0x10')][_0x6e91('0x12')]);}else{logger[_0x6e91('0xb')](_0x6e91('0xc'),_0x356dea,_0x6e91('0xe'));_0xca1f5c(_0x51d510[_0x6e91('0x13')][_0x6e91('0x12')]);}})[_0x6e91('0x14')](function(_0x417277){logger[_0x6e91('0x10')](_0x6e91('0xc'),_0x356dea,_0x417277);_0x41e29c(_0x417277);});});}