Built motion from commit (unavailable).|2.5.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 _0x4dc0=['FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x417fcd,_0x16a009){var _0x5af139=function(_0xe24a36){while(--_0xe24a36){_0x417fcd['push'](_0x417fcd['shift']());}};_0x5af139(++_0x16a009);}(_0x4dc0,0x13d));var _0x04dc=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x4dc0[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x04dc('0x0'));var BPromise=require(_0x04dc('0x1'));var rs=require(_0x04dc('0x2'));var fs=require('fs');var Redis=require(_0x04dc('0x3'));var db=require(_0x04dc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x04dc('0x5'))(_0x04dc('0x6'));var config=require(_0x04dc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x04dc('0x8')][_0x04dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40d327,_0x53cc43,_0x53f6e4){return new BPromise(function(_0x5ce79e,_0x118c0e){return client[_0x04dc('0xa')](_0x40d327,_0x53f6e4)[_0x04dc('0xb')](function(_0x2641fa){logger[_0x04dc('0xc')](_0x04dc('0xd'),_0x53cc43,_0x04dc('0xe'));logger[_0x04dc('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x53cc43,_0x04dc('0xe'),JSON[_0x04dc('0x10')](_0x2641fa));if(_0x2641fa[_0x04dc('0x11')]){if(_0x2641fa['error'][_0x04dc('0x12')]===0x1f4){logger[_0x04dc('0x11')](_0x04dc('0xd'),_0x53cc43,_0x2641fa['error'][_0x04dc('0x13')]);return _0x118c0e(_0x2641fa[_0x04dc('0x11')][_0x04dc('0x13')]);}logger[_0x04dc('0x11')](_0x04dc('0xd'),_0x53cc43,_0x2641fa[_0x04dc('0x11')][_0x04dc('0x13')]);return _0x5ce79e(_0x2641fa['error']['message']);}else{logger['info'](_0x04dc('0xd'),_0x53cc43,_0x04dc('0xe'));_0x5ce79e(_0x2641fa[_0x04dc('0x14')][_0x04dc('0x13')]);}})[_0x04dc('0x15')](function(_0x1ff3eb){logger[_0x04dc('0x11')](_0x04dc('0xd'),_0x53cc43,_0x1ff3eb);_0x118c0e(_0x1ff3eb);});});}