f330e233cfb1925b9eb407445531cae8218075fe
[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 _0x72b9=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x388b2b,_0x4bcdfb){var _0x491672=function(_0x2fcccd){while(--_0x2fcccd){_0x388b2b['push'](_0x388b2b['shift']());}};_0x491672(++_0x4bcdfb);}(_0x72b9,0x183));var _0x972b=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0x72b9[_0x217ff6];return _0x417c93;};'use strict';var _=require(_0x972b('0x0'));var util=require(_0x972b('0x1'));var moment=require(_0x972b('0x2'));var BPromise=require(_0x972b('0x3'));var rs=require(_0x972b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x972b('0x5'))['db'];var utils=require(_0x972b('0x6'));var logger=require(_0x972b('0x7'))(_0x972b('0x8'));var config=require(_0x972b('0x9'));var jayson=require(_0x972b('0xa'));var client=jayson['client'][_0x972b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3245c4,_0x532598,_0x186e56){return new BPromise(function(_0x143b53,_0x4497ee){return client[_0x972b('0xc')](_0x3245c4,_0x186e56)[_0x972b('0xd')](function(_0x57eca4){logger['info'](_0x972b('0xe'),_0x532598,_0x972b('0xf'));logger[_0x972b('0x10')](_0x972b('0x11'),_0x532598,'request\x20sent',JSON[_0x972b('0x12')](_0x57eca4));if(_0x57eca4[_0x972b('0x13')]){if(_0x57eca4[_0x972b('0x13')]['code']===0x1f4){logger[_0x972b('0x13')](_0x972b('0xe'),_0x532598,_0x57eca4[_0x972b('0x13')]['message']);return _0x4497ee(_0x57eca4[_0x972b('0x13')]['message']);}logger['error'](_0x972b('0xe'),_0x532598,_0x57eca4[_0x972b('0x13')][_0x972b('0x14')]);return _0x143b53(_0x57eca4['error']['message']);}else{logger[_0x972b('0x15')](_0x972b('0xe'),_0x532598,_0x972b('0xf'));_0x143b53(_0x57eca4[_0x972b('0x16')][_0x972b('0x14')]);}})[_0x972b('0x17')](function(_0x59756d){logger[_0x972b('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x532598,_0x59756d);_0x4497ee(_0x59756d);});});}