37091aa1ebab9981ee2eb07aafac2bc7c618d877
[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 _0x32b0=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x507837,_0x44183f){var _0x464515=function(_0x128900){while(--_0x128900){_0x507837['push'](_0x507837['shift']());}};_0x464515(++_0x44183f);}(_0x32b0,0x7b));var _0x032b=function(_0x159fd1,_0x73b713){_0x159fd1=_0x159fd1-0x0;var _0x5c85b1=_0x32b0[_0x159fd1];return _0x5c85b1;};'use strict';var _=require(_0x032b('0x0'));var util=require('util');var moment=require(_0x032b('0x1'));var BPromise=require(_0x032b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x032b('0x3'));var db=require(_0x032b('0x4'))['db'];var utils=require(_0x032b('0x5'));var logger=require(_0x032b('0x6'))(_0x032b('0x7'));var config=require(_0x032b('0x8'));var jayson=require(_0x032b('0x9'));var client=jayson[_0x032b('0xa')][_0x032b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1981b5,_0x293be9,_0x31397f){return new BPromise(function(_0x55e7be,_0x5745f2){return client['request'](_0x1981b5,_0x31397f)[_0x032b('0xc')](function(_0x2a15f3){logger[_0x032b('0xd')](_0x032b('0xe'),_0x293be9,_0x032b('0xf'));logger[_0x032b('0x10')](_0x032b('0x11'),_0x293be9,_0x032b('0xf'),JSON[_0x032b('0x12')](_0x2a15f3));if(_0x2a15f3[_0x032b('0x13')]){if(_0x2a15f3[_0x032b('0x13')][_0x032b('0x14')]===0x1f4){logger[_0x032b('0x13')](_0x032b('0xe'),_0x293be9,_0x2a15f3[_0x032b('0x13')][_0x032b('0x15')]);return _0x5745f2(_0x2a15f3['error'][_0x032b('0x15')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x293be9,_0x2a15f3['error'][_0x032b('0x15')]);return _0x55e7be(_0x2a15f3['error']['message']);}else{logger[_0x032b('0xd')](_0x032b('0xe'),_0x293be9,_0x032b('0xf'));_0x55e7be(_0x2a15f3[_0x032b('0x16')][_0x032b('0x15')]);}})[_0x032b('0x17')](function(_0x2c7c3f){logger['error'](_0x032b('0xe'),_0x293be9,_0x2c7c3f);_0x5745f2(_0x2c7c3f);});});}