Built motion from commit 74d9782e.|2.6.30
[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 _0x4f9b=['request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x4f9b,0x177));var _0xb4f9=function(_0x4f8e71,_0x38be16){_0x4f8e71=_0x4f8e71-0x0;var _0x6ae113=_0x4f9b[_0x4f8e71];return _0x6ae113;};'use strict';var _=require(_0xb4f9('0x0'));var util=require(_0xb4f9('0x1'));var moment=require(_0xb4f9('0x2'));var BPromise=require(_0xb4f9('0x3'));var rs=require(_0xb4f9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb4f9('0x5'));var logger=require('../../config/logger')(_0xb4f9('0x6'));var config=require(_0xb4f9('0x7'));var jayson=require(_0xb4f9('0x8'));var client=jayson[_0xb4f9('0x9')][_0xb4f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2225e1,_0x34c6a8,_0x3c9d4f){return new BPromise(function(_0x65627d,_0x57a16b){return client[_0xb4f9('0xb')](_0x2225e1,_0x3c9d4f)['then'](function(_0x19b0a5){logger[_0xb4f9('0xc')](_0xb4f9('0xd'),_0x34c6a8,'request\x20sent');logger[_0xb4f9('0xe')](_0xb4f9('0xf'),_0x34c6a8,_0xb4f9('0x10'),JSON[_0xb4f9('0x11')](_0x19b0a5));if(_0x19b0a5['error']){if(_0x19b0a5['error'][_0xb4f9('0x12')]===0x1f4){logger[_0xb4f9('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x34c6a8,_0x19b0a5[_0xb4f9('0x13')]['message']);return _0x57a16b(_0x19b0a5[_0xb4f9('0x13')][_0xb4f9('0x14')]);}logger['error'](_0xb4f9('0xd'),_0x34c6a8,_0x19b0a5[_0xb4f9('0x13')][_0xb4f9('0x14')]);return _0x65627d(_0x19b0a5[_0xb4f9('0x13')][_0xb4f9('0x14')]);}else{logger[_0xb4f9('0xc')](_0xb4f9('0xd'),_0x34c6a8,'request\x20sent');_0x65627d(_0x19b0a5[_0xb4f9('0x15')][_0xb4f9('0x14')]);}})[_0xb4f9('0x16')](function(_0x2b4a54){logger[_0xb4f9('0x13')](_0xb4f9('0xd'),_0x34c6a8,_0x2b4a54);_0x57a16b(_0x2b4a54);});});}