Built motion from commit (unavailable).|2.4.18
[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 _0x8fe1=['jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x138501,_0x5b003e){var _0x5c9320=function(_0x4533a8){while(--_0x4533a8){_0x138501['push'](_0x138501['shift']());}};_0x5c9320(++_0x5b003e);}(_0x8fe1,0x6b));var _0x18fe=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x8fe1[_0x41d432];return _0x1650f9;};'use strict';var _=require(_0x18fe('0x0'));var util=require(_0x18fe('0x1'));var moment=require(_0x18fe('0x2'));var BPromise=require(_0x18fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18fe('0x4'))['db'];var utils=require(_0x18fe('0x5'));var logger=require(_0x18fe('0x6'))('rpc');var config=require(_0x18fe('0x7'));var jayson=require(_0x18fe('0x8'));var client=jayson[_0x18fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26965b,_0x5661f5,_0x482903){return new BPromise(function(_0x385537,_0x5c626d){return client[_0x18fe('0xa')](_0x26965b,_0x482903)[_0x18fe('0xb')](function(_0x34e539){logger[_0x18fe('0xc')](_0x18fe('0xd'),_0x5661f5,'request\x20sent');logger[_0x18fe('0xe')](_0x18fe('0xf'),_0x5661f5,_0x18fe('0x10'),JSON[_0x18fe('0x11')](_0x34e539));if(_0x34e539[_0x18fe('0x12')]){if(_0x34e539[_0x18fe('0x12')][_0x18fe('0x13')]===0x1f4){logger['error'](_0x18fe('0xd'),_0x5661f5,_0x34e539[_0x18fe('0x12')][_0x18fe('0x14')]);return _0x5c626d(_0x34e539['error']['message']);}logger[_0x18fe('0x12')](_0x18fe('0xd'),_0x5661f5,_0x34e539[_0x18fe('0x12')][_0x18fe('0x14')]);return _0x385537(_0x34e539[_0x18fe('0x12')][_0x18fe('0x14')]);}else{logger[_0x18fe('0xc')](_0x18fe('0xd'),_0x5661f5,'request\x20sent');_0x385537(_0x34e539[_0x18fe('0x15')][_0x18fe('0x14')]);}})[_0x18fe('0x16')](function(_0x414e14){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5661f5,_0x414e14);_0x5c626d(_0x414e14);});});}