Built motion from commit (unavailable).|2.5.5
[motion2.git] / server / api / intFreshdeskConfiguration / intFreshdeskConfiguration.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 _0x854e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment'];(function(_0x185ffd,_0x4d1091){var _0x5dcf26=function(_0x448fc7){while(--_0x448fc7){_0x185ffd['push'](_0x185ffd['shift']());}};_0x5dcf26(++_0x4d1091);}(_0x854e,0x168));var _0xe854=function(_0x449607,_0x287561){_0x449607=_0x449607-0x0;var _0x972d5=_0x854e[_0x449607];return _0x972d5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe854('0x0'));var BPromise=require(_0xe854('0x1'));var rs=require(_0xe854('0x2'));var fs=require('fs');var Redis=require(_0xe854('0x3'));var db=require(_0xe854('0x4'))['db'];var utils=require(_0xe854('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe854('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf0d4f4,_0x3ca48a,_0x45712d){return new BPromise(function(_0x31ff0e,_0x112ec1){return client['request'](_0xf0d4f4,_0x45712d)[_0xe854('0x7')](function(_0x3c3783){logger[_0xe854('0x8')](_0xe854('0x9'),_0x3ca48a,_0xe854('0xa'));logger[_0xe854('0xb')](_0xe854('0xc'),_0x3ca48a,_0xe854('0xa'),JSON[_0xe854('0xd')](_0x3c3783));if(_0x3c3783[_0xe854('0xe')]){if(_0x3c3783[_0xe854('0xe')][_0xe854('0xf')]===0x1f4){logger[_0xe854('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3ca48a,_0x3c3783[_0xe854('0xe')][_0xe854('0x10')]);return _0x112ec1(_0x3c3783['error'][_0xe854('0x10')]);}logger[_0xe854('0xe')](_0xe854('0x9'),_0x3ca48a,_0x3c3783['error'][_0xe854('0x10')]);return _0x31ff0e(_0x3c3783[_0xe854('0xe')][_0xe854('0x10')]);}else{logger[_0xe854('0x8')](_0xe854('0x9'),_0x3ca48a,_0xe854('0xa'));_0x31ff0e(_0x3c3783[_0xe854('0x11')][_0xe854('0x10')]);}})[_0xe854('0x12')](function(_0x1fb9b6){logger[_0xe854('0xe')](_0xe854('0x9'),_0x3ca48a,_0x1fb9b6);_0x112ec1(_0x1fb9b6);});});}