7b289af4a83ee18b4cc79fa714b37b08de871cb1
[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 _0x4a04=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x52d37b,_0x5e4f47){var _0x3ac7ff=function(_0x549fa3){while(--_0x549fa3){_0x52d37b['push'](_0x52d37b['shift']());}};_0x3ac7ff(++_0x5e4f47);}(_0x4a04,0x142));var _0x44a0=function(_0x3cba93,_0x5c2fd8){_0x3cba93=_0x3cba93-0x0;var _0x4a2991=_0x4a04[_0x3cba93];return _0x4a2991;};'use strict';var _=require(_0x44a0('0x0'));var util=require(_0x44a0('0x1'));var moment=require(_0x44a0('0x2'));var BPromise=require(_0x44a0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x44a0('0x4'));var db=require(_0x44a0('0x5'))['db'];var utils=require(_0x44a0('0x6'));var logger=require('../../config/logger')(_0x44a0('0x7'));var config=require(_0x44a0('0x8'));var jayson=require(_0x44a0('0x9'));var client=jayson[_0x44a0('0xa')][_0x44a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x596bac,_0x132404,_0x4d3c63){return new BPromise(function(_0x4b5759,_0x2fffe0){return client[_0x44a0('0xc')](_0x596bac,_0x4d3c63)[_0x44a0('0xd')](function(_0x2aa833){logger[_0x44a0('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x132404,_0x44a0('0xf'));logger['debug'](_0x44a0('0x10'),_0x132404,_0x44a0('0xf'),JSON['stringify'](_0x2aa833));if(_0x2aa833[_0x44a0('0x11')]){if(_0x2aa833['error'][_0x44a0('0x12')]===0x1f4){logger[_0x44a0('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x132404,_0x2aa833[_0x44a0('0x11')][_0x44a0('0x13')]);return _0x2fffe0(_0x2aa833[_0x44a0('0x11')][_0x44a0('0x13')]);}logger[_0x44a0('0x11')](_0x44a0('0x14'),_0x132404,_0x2aa833['error'][_0x44a0('0x13')]);return _0x4b5759(_0x2aa833[_0x44a0('0x11')]['message']);}else{logger[_0x44a0('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x132404,_0x44a0('0xf'));_0x4b5759(_0x2aa833['result'][_0x44a0('0x13')]);}})[_0x44a0('0x15')](function(_0x1886b0){logger[_0x44a0('0x11')](_0x44a0('0x14'),_0x132404,_0x1886b0);_0x2fffe0(_0x1886b0);});});}