808126eb61e7f4b0514015ec60087ca1b2f34130
[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 _0xf4ce=['error','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x47b409,_0x4fb731){var _0x2fdefb=function(_0x2f61ae){while(--_0x2f61ae){_0x47b409['push'](_0x47b409['shift']());}};_0x2fdefb(++_0x4fb731);}(_0xf4ce,0x16a));var _0xef4c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf4ce[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xef4c('0x0'));var util=require(_0xef4c('0x1'));var moment=require(_0xef4c('0x2'));var BPromise=require(_0xef4c('0x3'));var rs=require(_0xef4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef4c('0x5'))['db'];var utils=require(_0xef4c('0x6'));var logger=require(_0xef4c('0x7'))(_0xef4c('0x8'));var config=require(_0xef4c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xef4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39e75c,_0x10a6ad,_0x46a3b0){return new BPromise(function(_0x5639b3,_0x4a1ac1){return client['request'](_0x39e75c,_0x46a3b0)[_0xef4c('0xb')](function(_0x5ad9b6){logger[_0xef4c('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x10a6ad,'request\x20sent');logger['debug'](_0xef4c('0xd'),_0x10a6ad,_0xef4c('0xe'),JSON[_0xef4c('0xf')](_0x5ad9b6));if(_0x5ad9b6[_0xef4c('0x10')]){if(_0x5ad9b6['error']['code']===0x1f4){logger['error'](_0xef4c('0x11'),_0x10a6ad,_0x5ad9b6[_0xef4c('0x10')][_0xef4c('0x12')]);return _0x4a1ac1(_0x5ad9b6[_0xef4c('0x10')]['message']);}logger[_0xef4c('0x10')](_0xef4c('0x11'),_0x10a6ad,_0x5ad9b6[_0xef4c('0x10')][_0xef4c('0x12')]);return _0x5639b3(_0x5ad9b6['error'][_0xef4c('0x12')]);}else{logger[_0xef4c('0xc')](_0xef4c('0x11'),_0x10a6ad,_0xef4c('0xe'));_0x5639b3(_0x5ad9b6[_0xef4c('0x13')][_0xef4c('0x12')]);}})[_0xef4c('0x14')](function(_0x17dd6e){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x10a6ad,_0x17dd6e);_0x4a1ac1(_0x17dd6e);});});}