Built motion from commit 932cf0d0.|2.5.42
[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 _0x89e7=['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','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4b5193,_0x191baf){var _0x256c47=function(_0x1b5c98){while(--_0x1b5c98){_0x4b5193['push'](_0x4b5193['shift']());}};_0x256c47(++_0x191baf);}(_0x89e7,0x1ba));var _0x789e=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x89e7[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x789e('0x0'));var util=require(_0x789e('0x1'));var moment=require(_0x789e('0x2'));var BPromise=require(_0x789e('0x3'));var rs=require(_0x789e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x789e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x789e('0x6'))(_0x789e('0x7'));var config=require(_0x789e('0x8'));var jayson=require(_0x789e('0x9'));var client=jayson[_0x789e('0xa')][_0x789e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x438401,_0xe1b22b,_0x4a735d){return new BPromise(function(_0xa2ff07,_0x4ca6b4){return client[_0x789e('0xc')](_0x438401,_0x4a735d)[_0x789e('0xd')](function(_0x39fb19){logger['info'](_0x789e('0xe'),_0xe1b22b,_0x789e('0xf'));logger[_0x789e('0x10')](_0x789e('0x11'),_0xe1b22b,_0x789e('0xf'),JSON[_0x789e('0x12')](_0x39fb19));if(_0x39fb19[_0x789e('0x13')]){if(_0x39fb19[_0x789e('0x13')][_0x789e('0x14')]===0x1f4){logger[_0x789e('0x13')](_0x789e('0xe'),_0xe1b22b,_0x39fb19[_0x789e('0x13')][_0x789e('0x15')]);return _0x4ca6b4(_0x39fb19[_0x789e('0x13')][_0x789e('0x15')]);}logger['error'](_0x789e('0xe'),_0xe1b22b,_0x39fb19[_0x789e('0x13')][_0x789e('0x15')]);return _0xa2ff07(_0x39fb19['error'][_0x789e('0x15')]);}else{logger['info'](_0x789e('0xe'),_0xe1b22b,_0x789e('0xf'));_0xa2ff07(_0x39fb19[_0x789e('0x16')][_0x789e('0x15')]);}})[_0x789e('0x17')](function(_0x8cc320){logger['error'](_0x789e('0xe'),_0xe1b22b,_0x8cc320);_0x4ca6b4(_0x8cc320);});});}