0bd766868dd4c7541d5639baf487c6fbc526a61c
[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 _0x6d7a=['info','request\x20sent','debug','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x417b32,_0x5bf559){var _0x562f69=function(_0xbc92c4){while(--_0xbc92c4){_0x417b32['push'](_0x417b32['shift']());}};_0x562f69(++_0x5bf559);}(_0x6d7a,0x1d6));var _0xa6d7=function(_0x1ed8cb,_0x2f0e7b){_0x1ed8cb=_0x1ed8cb-0x0;var _0x2dbcf5=_0x6d7a[_0x1ed8cb];return _0x2dbcf5;};'use strict';var _=require(_0xa6d7('0x0'));var util=require('util');var moment=require(_0xa6d7('0x1'));var BPromise=require(_0xa6d7('0x2'));var rs=require(_0xa6d7('0x3'));var fs=require('fs');var Redis=require(_0xa6d7('0x4'));var db=require(_0xa6d7('0x5'))['db'];var utils=require(_0xa6d7('0x6'));var logger=require(_0xa6d7('0x7'))(_0xa6d7('0x8'));var config=require('../../config/environment');var jayson=require(_0xa6d7('0x9'));var client=jayson['client'][_0xa6d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12a1cc,_0x4ed201,_0x363da9){return new BPromise(function(_0x433b65,_0x2042b1){return client[_0xa6d7('0xb')](_0x12a1cc,_0x363da9)[_0xa6d7('0xc')](function(_0x50032e){logger[_0xa6d7('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4ed201,_0xa6d7('0xe'));logger[_0xa6d7('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x4ed201,'request\x20sent',JSON[_0xa6d7('0x10')](_0x50032e));if(_0x50032e[_0xa6d7('0x11')]){if(_0x50032e[_0xa6d7('0x11')][_0xa6d7('0x12')]===0x1f4){logger['error'](_0xa6d7('0x13'),_0x4ed201,_0x50032e['error'][_0xa6d7('0x14')]);return _0x2042b1(_0x50032e[_0xa6d7('0x11')][_0xa6d7('0x14')]);}logger['error'](_0xa6d7('0x13'),_0x4ed201,_0x50032e[_0xa6d7('0x11')]['message']);return _0x433b65(_0x50032e[_0xa6d7('0x11')][_0xa6d7('0x14')]);}else{logger[_0xa6d7('0xd')](_0xa6d7('0x13'),_0x4ed201,_0xa6d7('0xe'));_0x433b65(_0x50032e[_0xa6d7('0x15')][_0xa6d7('0x14')]);}})[_0xa6d7('0x16')](function(_0x12424b){logger['error'](_0xa6d7('0x13'),_0x4ed201,_0x12424b);_0x2042b1(_0x12424b);});});}