Built motion from commit 497d3d92.|2.5.43
[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 _0x300a=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent'];(function(_0x336082,_0x5c364b){var _0x2ea2eb=function(_0x4c6c53){while(--_0x4c6c53){_0x336082['push'](_0x336082['shift']());}};_0x2ea2eb(++_0x5c364b);}(_0x300a,0x1bc));var _0xa300=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0x300a[_0x58c851];return _0x534d8a;};'use strict';var _=require(_0xa300('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa300('0x1'));var rs=require(_0xa300('0x2'));var fs=require('fs');var Redis=require(_0xa300('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa300('0x4'));var logger=require(_0xa300('0x5'))('rpc');var config=require(_0xa300('0x6'));var jayson=require(_0xa300('0x7'));var client=jayson[_0xa300('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2011bc,_0xbfcbc9,_0x54e2c1){return new BPromise(function(_0x58a7a7,_0x48e56e){return client['request'](_0x2011bc,_0x54e2c1)[_0xa300('0x9')](function(_0x70cd9a){logger[_0xa300('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xbfcbc9,_0xa300('0xb'));logger['debug'](_0xa300('0xc'),_0xbfcbc9,'request\x20sent',JSON[_0xa300('0xd')](_0x70cd9a));if(_0x70cd9a['error']){if(_0x70cd9a[_0xa300('0xe')][_0xa300('0xf')]===0x1f4){logger[_0xa300('0xe')](_0xa300('0x10'),_0xbfcbc9,_0x70cd9a['error'][_0xa300('0x11')]);return _0x48e56e(_0x70cd9a['error'][_0xa300('0x11')]);}logger[_0xa300('0xe')](_0xa300('0x10'),_0xbfcbc9,_0x70cd9a['error'][_0xa300('0x11')]);return _0x58a7a7(_0x70cd9a[_0xa300('0xe')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0xbfcbc9,_0xa300('0xb'));_0x58a7a7(_0x70cd9a[_0xa300('0x12')][_0xa300('0x11')]);}})['catch'](function(_0x5b4d69){logger[_0xa300('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xbfcbc9,_0x5b4d69);_0x48e56e(_0x5b4d69);});});}