Built motion from commit 19a84241.|2.5.34
[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 _0xd1eb=['jayson/promise','http','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x104b76,_0x9cff92){var _0x200f30=function(_0x487c3a){while(--_0x487c3a){_0x104b76['push'](_0x104b76['shift']());}};_0x200f30(++_0x9cff92);}(_0xd1eb,0x6e));var _0xbd1e=function(_0x1099d6,_0x13571d){_0x1099d6=_0x1099d6-0x0;var _0x5cb028=_0xd1eb[_0x1099d6];return _0x5cb028;};'use strict';var _=require(_0xbd1e('0x0'));var util=require(_0xbd1e('0x1'));var moment=require('moment');var BPromise=require(_0xbd1e('0x2'));var rs=require(_0xbd1e('0x3'));var fs=require('fs');var Redis=require(_0xbd1e('0x4'));var db=require(_0xbd1e('0x5'))['db'];var utils=require(_0xbd1e('0x6'));var logger=require(_0xbd1e('0x7'))(_0xbd1e('0x8'));var config=require(_0xbd1e('0x9'));var jayson=require(_0xbd1e('0xa'));var client=jayson['client'][_0xbd1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x151afa,_0x4a6ac9,_0x5d08b2){return new BPromise(function(_0x390c3c,_0x260315){return client['request'](_0x151afa,_0x5d08b2)[_0xbd1e('0xc')](function(_0x4717b4){logger['info'](_0xbd1e('0xd'),_0x4a6ac9,_0xbd1e('0xe'));logger[_0xbd1e('0xf')](_0xbd1e('0x10'),_0x4a6ac9,_0xbd1e('0xe'),JSON[_0xbd1e('0x11')](_0x4717b4));if(_0x4717b4['error']){if(_0x4717b4['error'][_0xbd1e('0x12')]===0x1f4){logger[_0xbd1e('0x13')](_0xbd1e('0xd'),_0x4a6ac9,_0x4717b4[_0xbd1e('0x13')]['message']);return _0x260315(_0x4717b4[_0xbd1e('0x13')][_0xbd1e('0x14')]);}logger[_0xbd1e('0x13')](_0xbd1e('0xd'),_0x4a6ac9,_0x4717b4['error'][_0xbd1e('0x14')]);return _0x390c3c(_0x4717b4[_0xbd1e('0x13')][_0xbd1e('0x14')]);}else{logger[_0xbd1e('0x15')](_0xbd1e('0xd'),_0x4a6ac9,_0xbd1e('0xe'));_0x390c3c(_0x4717b4[_0xbd1e('0x16')][_0xbd1e('0x14')]);}})[_0xbd1e('0x17')](function(_0x1cb2cd){logger[_0xbd1e('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4a6ac9,_0x1cb2cd);_0x260315(_0x1cb2cd);});});}