Built motion from commit 753c950e.|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 _0xf7c5=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x4a83f4,_0x50f589){var _0x1fc810=function(_0xc651f9){while(--_0xc651f9){_0x4a83f4['push'](_0x4a83f4['shift']());}};_0x1fc810(++_0x50f589);}(_0xf7c5,0x109));var _0x5f7c=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xf7c5[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x5f7c('0x0'));var util=require(_0x5f7c('0x1'));var moment=require('moment');var BPromise=require(_0x5f7c('0x2'));var rs=require(_0x5f7c('0x3'));var fs=require('fs');var Redis=require(_0x5f7c('0x4'));var db=require(_0x5f7c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f7c('0x6'))(_0x5f7c('0x7'));var config=require(_0x5f7c('0x8'));var jayson=require(_0x5f7c('0x9'));var client=jayson[_0x5f7c('0xa')][_0x5f7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59d76e,_0x5db639,_0x5bd55f){return new BPromise(function(_0x4d2c7a,_0x80db12){return client[_0x5f7c('0xc')](_0x59d76e,_0x5bd55f)[_0x5f7c('0xd')](function(_0x2babd1){logger[_0x5f7c('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5db639,'request\x20sent');logger[_0x5f7c('0xf')](_0x5f7c('0x10'),_0x5db639,_0x5f7c('0x11'),JSON[_0x5f7c('0x12')](_0x2babd1));if(_0x2babd1[_0x5f7c('0x13')]){if(_0x2babd1['error'][_0x5f7c('0x14')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5db639,_0x2babd1[_0x5f7c('0x13')][_0x5f7c('0x15')]);return _0x80db12(_0x2babd1[_0x5f7c('0x13')][_0x5f7c('0x15')]);}logger[_0x5f7c('0x13')](_0x5f7c('0x16'),_0x5db639,_0x2babd1['error'][_0x5f7c('0x15')]);return _0x4d2c7a(_0x2babd1['error'][_0x5f7c('0x15')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5db639,_0x5f7c('0x11'));_0x4d2c7a(_0x2babd1[_0x5f7c('0x17')][_0x5f7c('0x15')]);}})['catch'](function(_0x2c0ab1){logger[_0x5f7c('0x13')](_0x5f7c('0x16'),_0x5db639,_0x2c0ab1);_0x80db12(_0x2c0ab1);});});}