Built motion from commit 9e1399f3.|2.5.37
[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 _0x2bb4=['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','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x3a7145,_0x1ead83){var _0x56106a=function(_0xf277aa){while(--_0xf277aa){_0x3a7145['push'](_0x3a7145['shift']());}};_0x56106a(++_0x1ead83);}(_0x2bb4,0x108));var _0x42bb=function(_0x1d78db,_0xaf609a){_0x1d78db=_0x1d78db-0x0;var _0x167e1d=_0x2bb4[_0x1d78db];return _0x167e1d;};'use strict';var _=require(_0x42bb('0x0'));var util=require(_0x42bb('0x1'));var moment=require(_0x42bb('0x2'));var BPromise=require(_0x42bb('0x3'));var rs=require(_0x42bb('0x4'));var fs=require('fs');var Redis=require(_0x42bb('0x5'));var db=require(_0x42bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x42bb('0x7'));var config=require(_0x42bb('0x8'));var jayson=require(_0x42bb('0x9'));var client=jayson[_0x42bb('0xa')][_0x42bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x245672,_0x7c7263,_0x49da10){return new BPromise(function(_0x8d8d58,_0x53d568){return client[_0x42bb('0xc')](_0x245672,_0x49da10)[_0x42bb('0xd')](function(_0x56bebf){logger[_0x42bb('0xe')](_0x42bb('0xf'),_0x7c7263,_0x42bb('0x10'));logger[_0x42bb('0x11')](_0x42bb('0x12'),_0x7c7263,'request\x20sent',JSON[_0x42bb('0x13')](_0x56bebf));if(_0x56bebf[_0x42bb('0x14')]){if(_0x56bebf[_0x42bb('0x14')][_0x42bb('0x15')]===0x1f4){logger[_0x42bb('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x7c7263,_0x56bebf[_0x42bb('0x14')][_0x42bb('0x16')]);return _0x53d568(_0x56bebf[_0x42bb('0x14')][_0x42bb('0x16')]);}logger['error'](_0x42bb('0xf'),_0x7c7263,_0x56bebf[_0x42bb('0x14')][_0x42bb('0x16')]);return _0x8d8d58(_0x56bebf[_0x42bb('0x14')]['message']);}else{logger[_0x42bb('0xe')](_0x42bb('0xf'),_0x7c7263,_0x42bb('0x10'));_0x8d8d58(_0x56bebf[_0x42bb('0x17')][_0x42bb('0x16')]);}})[_0x42bb('0x18')](function(_0x487e16){logger[_0x42bb('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x7c7263,_0x487e16);_0x53d568(_0x487e16);});});}