Built motion from commit efa66e19.|2.6.22
[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 _0x80df=['jayson/promise','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x10bc13,_0x33e345){var _0x21f48a=function(_0x5603e5){while(--_0x5603e5){_0x10bc13['push'](_0x10bc13['shift']());}};_0x21f48a(++_0x33e345);}(_0x80df,0xa0));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf80d('0x0'));var util=require('util');var moment=require(_0xf80d('0x1'));var BPromise=require(_0xf80d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x3'));var db=require(_0xf80d('0x4'))['db'];var utils=require(_0xf80d('0x5'));var logger=require(_0xf80d('0x6'))('rpc');var config=require(_0xf80d('0x7'));var jayson=require(_0xf80d('0x8'));var client=jayson[_0xf80d('0x9')][_0xf80d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x920a55,_0x6a88e7,_0x53f8e0){return new BPromise(function(_0x3fb50a,_0x5163c2){return client[_0xf80d('0xb')](_0x920a55,_0x53f8e0)[_0xf80d('0xc')](function(_0x305bf3){logger['info'](_0xf80d('0xd'),_0x6a88e7,'request\x20sent');logger[_0xf80d('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x6a88e7,_0xf80d('0xf'),JSON['stringify'](_0x305bf3));if(_0x305bf3[_0xf80d('0x10')]){if(_0x305bf3[_0xf80d('0x10')][_0xf80d('0x11')]===0x1f4){logger[_0xf80d('0x10')](_0xf80d('0xd'),_0x6a88e7,_0x305bf3[_0xf80d('0x10')][_0xf80d('0x12')]);return _0x5163c2(_0x305bf3[_0xf80d('0x10')][_0xf80d('0x12')]);}logger[_0xf80d('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x6a88e7,_0x305bf3[_0xf80d('0x10')][_0xf80d('0x12')]);return _0x3fb50a(_0x305bf3['error'][_0xf80d('0x12')]);}else{logger[_0xf80d('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x6a88e7,'request\x20sent');_0x3fb50a(_0x305bf3['result']['message']);}})[_0xf80d('0x14')](function(_0x2b3f33){logger[_0xf80d('0x10')](_0xf80d('0xd'),_0x6a88e7,_0x2b3f33);_0x5163c2(_0x2b3f33);});});}