Built motion from commit (unavailable).|2.5.13
[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 _0xfe68=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x4c46c4,_0x3e6aaf){var _0x1aef2f=function(_0x44c901){while(--_0x44c901){_0x4c46c4['push'](_0x4c46c4['shift']());}};_0x1aef2f(++_0x3e6aaf);}(_0xfe68,0xcf));var _0x8fe6=function(_0x557bf4,_0x1f8dad){_0x557bf4=_0x557bf4-0x0;var _0x2916e2=_0xfe68[_0x557bf4];return _0x2916e2;};'use strict';var _=require(_0x8fe6('0x0'));var util=require(_0x8fe6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8fe6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fe6('0x3'))['db'];var utils=require(_0x8fe6('0x4'));var logger=require(_0x8fe6('0x5'))(_0x8fe6('0x6'));var config=require(_0x8fe6('0x7'));var jayson=require(_0x8fe6('0x8'));var client=jayson[_0x8fe6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40f7c8,_0x18874a,_0x3a7ee8){return new BPromise(function(_0x545d2d,_0x4f3ef3){return client[_0x8fe6('0xa')](_0x40f7c8,_0x3a7ee8)['then'](function(_0x38ef37){logger['info'](_0x8fe6('0xb'),_0x18874a,_0x8fe6('0xc'));logger[_0x8fe6('0xd')](_0x8fe6('0xe'),_0x18874a,_0x8fe6('0xc'),JSON[_0x8fe6('0xf')](_0x38ef37));if(_0x38ef37['error']){if(_0x38ef37[_0x8fe6('0x10')][_0x8fe6('0x11')]===0x1f4){logger[_0x8fe6('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x18874a,_0x38ef37['error']['message']);return _0x4f3ef3(_0x38ef37[_0x8fe6('0x10')]['message']);}logger[_0x8fe6('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x18874a,_0x38ef37[_0x8fe6('0x10')]['message']);return _0x545d2d(_0x38ef37[_0x8fe6('0x10')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x18874a,'request\x20sent');_0x545d2d(_0x38ef37['result'][_0x8fe6('0x12')]);}})[_0x8fe6('0x13')](function(_0x1ae749){logger[_0x8fe6('0x10')](_0x8fe6('0xb'),_0x18874a,_0x1ae749);_0x4f3ef3(_0x1ae749);});});}