Built motion from commit (unavailable).|2.5.14
[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 _0x3a5c=['error','result','message','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x3a5c,0x1e3));var _0xc3a5=function(_0x2a7379,_0x33cc90){_0x2a7379=_0x2a7379-0x0;var _0x438974=_0x3a5c[_0x2a7379];return _0x438974;};'use strict';var _=require(_0xc3a5('0x0'));var util=require(_0xc3a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3a5('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3a5('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc3a5('0x4'));var client=jayson[_0xc3a5('0x5')][_0xc3a5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2fb134,_0x59711f,_0x1aa052){return new BPromise(function(_0x1bafe1,_0x3f96d7){return client[_0xc3a5('0x7')](_0x2fb134,_0x1aa052)[_0xc3a5('0x8')](function(_0x28f90a){logger[_0xc3a5('0x9')](_0xc3a5('0xa'),_0x59711f,_0xc3a5('0xb'));logger[_0xc3a5('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x59711f,_0xc3a5('0xb'),JSON['stringify'](_0x28f90a));if(_0x28f90a[_0xc3a5('0xd')]){if(_0x28f90a[_0xc3a5('0xd')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x59711f,_0x28f90a[_0xc3a5('0xd')]['message']);return _0x3f96d7(_0x28f90a[_0xc3a5('0xd')]['message']);}logger[_0xc3a5('0xd')](_0xc3a5('0xa'),_0x59711f,_0x28f90a[_0xc3a5('0xd')]['message']);return _0x1bafe1(_0x28f90a[_0xc3a5('0xd')]['message']);}else{logger[_0xc3a5('0x9')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x59711f,_0xc3a5('0xb'));_0x1bafe1(_0x28f90a[_0xc3a5('0xe')][_0xc3a5('0xf')]);}})['catch'](function(_0x3c4a56){logger[_0xc3a5('0xd')](_0xc3a5('0xa'),_0x59711f,_0x3c4a56);_0x3f96d7(_0x3c4a56);});});}