75917dccd55f6c2cd98e888f82665abb9467478b
[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 _0x770f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x57b740,_0x3a8814){var _0x576e93=function(_0x5b8041){while(--_0x5b8041){_0x57b740['push'](_0x57b740['shift']());}};_0x576e93(++_0x3a8814);}(_0x770f,0xf4));var _0xf770=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0x770f[_0x4c260a];return _0x17bbdd;};'use strict';var _=require(_0xf770('0x0'));var util=require(_0xf770('0x1'));var moment=require('moment');var BPromise=require(_0xf770('0x2'));var rs=require(_0xf770('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf770('0x4'))['db'];var utils=require(_0xf770('0x5'));var logger=require(_0xf770('0x6'))(_0xf770('0x7'));var config=require(_0xf770('0x8'));var jayson=require(_0xf770('0x9'));var client=jayson[_0xf770('0xa')][_0xf770('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x541f7e,_0x184dbd,_0x3c3373){return new BPromise(function(_0xa37f1e,_0x44da49){return client[_0xf770('0xc')](_0x541f7e,_0x3c3373)[_0xf770('0xd')](function(_0x353c0a){logger[_0xf770('0xe')](_0xf770('0xf'),_0x184dbd,_0xf770('0x10'));logger[_0xf770('0x11')](_0xf770('0x12'),_0x184dbd,_0xf770('0x10'),JSON[_0xf770('0x13')](_0x353c0a));if(_0x353c0a[_0xf770('0x14')]){if(_0x353c0a[_0xf770('0x14')][_0xf770('0x15')]===0x1f4){logger[_0xf770('0x14')](_0xf770('0xf'),_0x184dbd,_0x353c0a[_0xf770('0x14')][_0xf770('0x16')]);return _0x44da49(_0x353c0a[_0xf770('0x14')][_0xf770('0x16')]);}logger[_0xf770('0x14')](_0xf770('0xf'),_0x184dbd,_0x353c0a[_0xf770('0x14')][_0xf770('0x16')]);return _0xa37f1e(_0x353c0a[_0xf770('0x14')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x184dbd,'request\x20sent');_0xa37f1e(_0x353c0a[_0xf770('0x17')]['message']);}})[_0xf770('0x18')](function(_0x2b2d59){logger[_0xf770('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x184dbd,_0x2b2d59);_0x44da49(_0x2b2d59);});});}