Built motion from commit (unavailable).|2.5.15
[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 _0x2b22=['error','message','result','lodash','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x2b22,0x135));var _0x22b2=function(_0x471a1e,_0x3ab9f5){_0x471a1e=_0x471a1e-0x0;var _0xc8bf8b=_0x2b22[_0x471a1e];return _0xc8bf8b;};'use strict';var _=require(_0x22b2('0x0'));var util=require('util');var moment=require(_0x22b2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22b2('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x22b2('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22b2('0x4'));var client=jayson[_0x22b2('0x5')][_0x22b2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1d3853,_0x3c7774,_0x144977){return new BPromise(function(_0x203577,_0x47b50d){return client['request'](_0x1d3853,_0x144977)[_0x22b2('0x7')](function(_0x45959c){logger[_0x22b2('0x8')](_0x22b2('0x9'),_0x3c7774,_0x22b2('0xa'));logger[_0x22b2('0xb')](_0x22b2('0xc'),_0x3c7774,_0x22b2('0xa'),JSON[_0x22b2('0xd')](_0x45959c));if(_0x45959c[_0x22b2('0xe')]){if(_0x45959c[_0x22b2('0xe')]['code']===0x1f4){logger['error'](_0x22b2('0x9'),_0x3c7774,_0x45959c[_0x22b2('0xe')][_0x22b2('0xf')]);return _0x47b50d(_0x45959c[_0x22b2('0xe')][_0x22b2('0xf')]);}logger['error'](_0x22b2('0x9'),_0x3c7774,_0x45959c[_0x22b2('0xe')][_0x22b2('0xf')]);return _0x203577(_0x45959c[_0x22b2('0xe')][_0x22b2('0xf')]);}else{logger[_0x22b2('0x8')](_0x22b2('0x9'),_0x3c7774,_0x22b2('0xa'));_0x203577(_0x45959c[_0x22b2('0x10')][_0x22b2('0xf')]);}})['catch'](function(_0xa9a2e6){logger[_0x22b2('0xe')](_0x22b2('0x9'),_0x3c7774,_0xa9a2e6);_0x47b50d(_0xa9a2e6);});});}