b207f7355b7446345be5e033acf6594a0de27f26
[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 _0x9071=['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','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x1f7ff7,_0x5dd628){var _0x14760c=function(_0x417364){while(--_0x417364){_0x1f7ff7['push'](_0x1f7ff7['shift']());}};_0x14760c(++_0x5dd628);}(_0x9071,0xab));var _0x1907=function(_0x199c16,_0x577ee8){_0x199c16=_0x199c16-0x0;var _0x490c09=_0x9071[_0x199c16];return _0x490c09;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1907('0x0'));var BPromise=require(_0x1907('0x1'));var rs=require(_0x1907('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1907('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1907('0x4'))(_0x1907('0x5'));var config=require(_0x1907('0x6'));var jayson=require(_0x1907('0x7'));var client=jayson[_0x1907('0x8')][_0x1907('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aaebf,_0x4f18c6,_0x3d294c){return new BPromise(function(_0x43f642,_0x4cb379){return client[_0x1907('0xa')](_0x1aaebf,_0x3d294c)[_0x1907('0xb')](function(_0x67298e){logger[_0x1907('0xc')](_0x1907('0xd'),_0x4f18c6,_0x1907('0xe'));logger[_0x1907('0xf')](_0x1907('0x10'),_0x4f18c6,_0x1907('0xe'),JSON[_0x1907('0x11')](_0x67298e));if(_0x67298e[_0x1907('0x12')]){if(_0x67298e[_0x1907('0x12')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4f18c6,_0x67298e[_0x1907('0x12')][_0x1907('0x13')]);return _0x4cb379(_0x67298e[_0x1907('0x12')][_0x1907('0x13')]);}logger[_0x1907('0x12')](_0x1907('0xd'),_0x4f18c6,_0x67298e[_0x1907('0x12')][_0x1907('0x13')]);return _0x43f642(_0x67298e[_0x1907('0x12')]['message']);}else{logger[_0x1907('0xc')](_0x1907('0xd'),_0x4f18c6,_0x1907('0xe'));_0x43f642(_0x67298e[_0x1907('0x14')]['message']);}})[_0x1907('0x15')](function(_0x144a51){logger[_0x1907('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4f18c6,_0x144a51);_0x4cb379(_0x144a51);});});}