13655b825650ddb7f8db4d54d44403a08d92df40
[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 _0x8b88=['code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0x8b88,0x18a));var _0x88b8=function(_0x5675d9,_0x5b50d4){_0x5675d9=_0x5675d9-0x0;var _0x222de4=_0x8b88[_0x5675d9];return _0x222de4;};'use strict';var _=require(_0x88b8('0x0'));var util=require(_0x88b8('0x1'));var moment=require('moment');var BPromise=require(_0x88b8('0x2'));var rs=require(_0x88b8('0x3'));var fs=require('fs');var Redis=require(_0x88b8('0x4'));var db=require(_0x88b8('0x5'))['db'];var utils=require(_0x88b8('0x6'));var logger=require(_0x88b8('0x7'))(_0x88b8('0x8'));var config=require('../../config/environment');var jayson=require(_0x88b8('0x9'));var client=jayson[_0x88b8('0xa')][_0x88b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b2ef2,_0x4a1b66,_0x437df5){return new BPromise(function(_0x32eb54,_0x54987d){return client[_0x88b8('0xc')](_0x4b2ef2,_0x437df5)[_0x88b8('0xd')](function(_0x409887){logger[_0x88b8('0xe')](_0x88b8('0xf'),_0x4a1b66,'request\x20sent');logger[_0x88b8('0x10')](_0x88b8('0x11'),_0x4a1b66,'request\x20sent',JSON[_0x88b8('0x12')](_0x409887));if(_0x409887[_0x88b8('0x13')]){if(_0x409887[_0x88b8('0x13')][_0x88b8('0x14')]===0x1f4){logger[_0x88b8('0x13')](_0x88b8('0xf'),_0x4a1b66,_0x409887[_0x88b8('0x13')]['message']);return _0x54987d(_0x409887['error'][_0x88b8('0x15')]);}logger[_0x88b8('0x13')](_0x88b8('0xf'),_0x4a1b66,_0x409887[_0x88b8('0x13')][_0x88b8('0x15')]);return _0x32eb54(_0x409887[_0x88b8('0x13')]['message']);}else{logger[_0x88b8('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4a1b66,'request\x20sent');_0x32eb54(_0x409887['result'][_0x88b8('0x15')]);}})[_0x88b8('0x16')](function(_0x4b7604){logger[_0x88b8('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4a1b66,_0x4b7604);_0x54987d(_0x4b7604);});});}