Built motion from commit (unavailable).|2.5.30
[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 _0x81b9=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x81b9,0x1be));var _0x981b=function(_0x7e1c9e,_0x36a51d){_0x7e1c9e=_0x7e1c9e-0x0;var _0x87773a=_0x81b9[_0x7e1c9e];return _0x87773a;};'use strict';var _=require(_0x981b('0x0'));var util=require(_0x981b('0x1'));var moment=require(_0x981b('0x2'));var BPromise=require(_0x981b('0x3'));var rs=require(_0x981b('0x4'));var fs=require('fs');var Redis=require(_0x981b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x981b('0x6'));var logger=require(_0x981b('0x7'))(_0x981b('0x8'));var config=require('../../config/environment');var jayson=require(_0x981b('0x9'));var client=jayson[_0x981b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x464776,_0x1579ba,_0x1148e7){return new BPromise(function(_0x41498a,_0x30488e){return client[_0x981b('0xb')](_0x464776,_0x1148e7)[_0x981b('0xc')](function(_0x328230){logger[_0x981b('0xd')](_0x981b('0xe'),_0x1579ba,_0x981b('0xf'));logger[_0x981b('0x10')](_0x981b('0x11'),_0x1579ba,_0x981b('0xf'),JSON[_0x981b('0x12')](_0x328230));if(_0x328230[_0x981b('0x13')]){if(_0x328230[_0x981b('0x13')]['code']===0x1f4){logger[_0x981b('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1579ba,_0x328230[_0x981b('0x13')][_0x981b('0x14')]);return _0x30488e(_0x328230[_0x981b('0x13')]['message']);}logger[_0x981b('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1579ba,_0x328230['error'][_0x981b('0x14')]);return _0x41498a(_0x328230['error']['message']);}else{logger[_0x981b('0xd')](_0x981b('0xe'),_0x1579ba,'request\x20sent');_0x41498a(_0x328230[_0x981b('0x15')]['message']);}})['catch'](function(_0x4726db){logger['error'](_0x981b('0xe'),_0x1579ba,_0x4726db);_0x30488e(_0x4726db);});});}