Built motion from commit f9526609.|2.6.29
[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 _0xcd05=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x69b421,_0x11761e){var _0x35a470=function(_0x5e026a){while(--_0x5e026a){_0x69b421['push'](_0x69b421['shift']());}};_0x35a470(++_0x11761e);}(_0xcd05,0x8e));var _0x5cd0=function(_0x5bc5fe,_0x2afaef){_0x5bc5fe=_0x5bc5fe-0x0;var _0x298ea7=_0xcd05[_0x5bc5fe];return _0x298ea7;};'use strict';var _=require(_0x5cd0('0x0'));var util=require(_0x5cd0('0x1'));var moment=require(_0x5cd0('0x2'));var BPromise=require(_0x5cd0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cd0('0x4'));var db=require(_0x5cd0('0x5'))['db'];var utils=require(_0x5cd0('0x6'));var logger=require(_0x5cd0('0x7'))(_0x5cd0('0x8'));var config=require(_0x5cd0('0x9'));var jayson=require(_0x5cd0('0xa'));var client=jayson[_0x5cd0('0xb')][_0x5cd0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e8cda,_0x2366e9,_0x2ffbe3){return new BPromise(function(_0x28be53,_0x22d22d){return client[_0x5cd0('0xd')](_0x5e8cda,_0x2ffbe3)[_0x5cd0('0xe')](function(_0x4f99d6){logger[_0x5cd0('0xf')](_0x5cd0('0x10'),_0x2366e9,_0x5cd0('0x11'));logger['debug'](_0x5cd0('0x12'),_0x2366e9,'request\x20sent',JSON[_0x5cd0('0x13')](_0x4f99d6));if(_0x4f99d6[_0x5cd0('0x14')]){if(_0x4f99d6[_0x5cd0('0x14')]['code']===0x1f4){logger[_0x5cd0('0x14')](_0x5cd0('0x10'),_0x2366e9,_0x4f99d6[_0x5cd0('0x14')][_0x5cd0('0x15')]);return _0x22d22d(_0x4f99d6['error'][_0x5cd0('0x15')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x2366e9,_0x4f99d6[_0x5cd0('0x14')][_0x5cd0('0x15')]);return _0x28be53(_0x4f99d6[_0x5cd0('0x14')][_0x5cd0('0x15')]);}else{logger[_0x5cd0('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2366e9,_0x5cd0('0x11'));_0x28be53(_0x4f99d6[_0x5cd0('0x16')]['message']);}})[_0x5cd0('0x17')](function(_0xf703f4){logger[_0x5cd0('0x14')](_0x5cd0('0x10'),_0x2366e9,_0xf703f4);_0x22d22d(_0xf703f4);});});}