Built motion from commit 06eb8eb0.|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 _0x6f7b=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','catch','util','moment'];(function(_0x92f9d5,_0x11a2fa){var _0xd4e98a=function(_0x12e3b6){while(--_0x12e3b6){_0x92f9d5['push'](_0x92f9d5['shift']());}};_0xd4e98a(++_0x11a2fa);}(_0x6f7b,0x11f));var _0xb6f7=function(_0x364b08,_0x1d35a0){_0x364b08=_0x364b08-0x0;var _0x17d900=_0x6f7b[_0x364b08];return _0x17d900;};'use strict';var _=require('lodash');var util=require(_0xb6f7('0x0'));var moment=require(_0xb6f7('0x1'));var BPromise=require('bluebird');var rs=require(_0xb6f7('0x2'));var fs=require('fs');var Redis=require(_0xb6f7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb6f7('0x4'));var logger=require('../../config/logger')(_0xb6f7('0x5'));var config=require(_0xb6f7('0x6'));var jayson=require(_0xb6f7('0x7'));var client=jayson[_0xb6f7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4672ce,_0x120edb,_0x3b5248){return new BPromise(function(_0x3fd281,_0x589234){return client['request'](_0x4672ce,_0x3b5248)['then'](function(_0x2db80c){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x120edb,_0xb6f7('0x9'));logger['debug'](_0xb6f7('0xa'),_0x120edb,_0xb6f7('0x9'),JSON['stringify'](_0x2db80c));if(_0x2db80c['error']){if(_0x2db80c[_0xb6f7('0xb')][_0xb6f7('0xc')]===0x1f4){logger[_0xb6f7('0xb')](_0xb6f7('0xd'),_0x120edb,_0x2db80c['error'][_0xb6f7('0xe')]);return _0x589234(_0x2db80c['error'][_0xb6f7('0xe')]);}logger[_0xb6f7('0xb')](_0xb6f7('0xd'),_0x120edb,_0x2db80c['error'][_0xb6f7('0xe')]);return _0x3fd281(_0x2db80c[_0xb6f7('0xb')][_0xb6f7('0xe')]);}else{logger[_0xb6f7('0xf')](_0xb6f7('0xd'),_0x120edb,_0xb6f7('0x9'));_0x3fd281(_0x2db80c['result'][_0xb6f7('0xe')]);}})[_0xb6f7('0x10')](function(_0xe0f0f6){logger[_0xb6f7('0xb')](_0xb6f7('0xd'),_0x120edb,_0xe0f0f6);_0x589234(_0xe0f0f6);});});}