Built motion from commit d5e4af8c.|2.6.23
[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 _0x4149=['message','request\x20sent','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2d595f,_0xdfdb46){var _0x1e26a2=function(_0x17f26a){while(--_0x17f26a){_0x2d595f['push'](_0x2d595f['shift']());}};_0x1e26a2(++_0xdfdb46);}(_0x4149,0x67));var _0x9414=function(_0x2416c1,_0x1bd086){_0x2416c1=_0x2416c1-0x0;var _0x491df9=_0x4149[_0x2416c1];return _0x491df9;};'use strict';var _=require(_0x9414('0x0'));var util=require(_0x9414('0x1'));var moment=require(_0x9414('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9414('0x3'));var db=require(_0x9414('0x4'))['db'];var utils=require(_0x9414('0x5'));var logger=require('../../config/logger')(_0x9414('0x6'));var config=require('../../config/environment');var jayson=require(_0x9414('0x7'));var client=jayson[_0x9414('0x8')][_0x9414('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ee5ff,_0x26bdea,_0x2feb20){return new BPromise(function(_0x1efb1a,_0x1945e6){return client[_0x9414('0xa')](_0x4ee5ff,_0x2feb20)[_0x9414('0xb')](function(_0x4f42b7){logger[_0x9414('0xc')](_0x9414('0xd'),_0x26bdea,'request\x20sent');logger['debug'](_0x9414('0xe'),_0x26bdea,'request\x20sent',JSON['stringify'](_0x4f42b7));if(_0x4f42b7[_0x9414('0xf')]){if(_0x4f42b7[_0x9414('0xf')][_0x9414('0x10')]===0x1f4){logger[_0x9414('0xf')](_0x9414('0xd'),_0x26bdea,_0x4f42b7[_0x9414('0xf')][_0x9414('0x11')]);return _0x1945e6(_0x4f42b7[_0x9414('0xf')][_0x9414('0x11')]);}logger[_0x9414('0xf')](_0x9414('0xd'),_0x26bdea,_0x4f42b7[_0x9414('0xf')][_0x9414('0x11')]);return _0x1efb1a(_0x4f42b7[_0x9414('0xf')][_0x9414('0x11')]);}else{logger[_0x9414('0xc')](_0x9414('0xd'),_0x26bdea,_0x9414('0x12'));_0x1efb1a(_0x4f42b7['result'][_0x9414('0x11')]);}})[_0x9414('0x13')](function(_0x3790ad){logger[_0x9414('0xf')](_0x9414('0xd'),_0x26bdea,_0x3790ad);_0x1945e6(_0x3790ad);});});}