Built motion from commit 2b9af5da.|2.6.26
[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 _0xc1b5=['message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc1b5,0xa5));var _0x5c1b=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0xc1b5[_0x80d733];return _0x435868;};'use strict';var _=require(_0x5c1b('0x0'));var util=require(_0x5c1b('0x1'));var moment=require(_0x5c1b('0x2'));var BPromise=require(_0x5c1b('0x3'));var rs=require(_0x5c1b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c1b('0x5'))['db'];var utils=require(_0x5c1b('0x6'));var logger=require(_0x5c1b('0x7'))(_0x5c1b('0x8'));var config=require(_0x5c1b('0x9'));var jayson=require(_0x5c1b('0xa'));var client=jayson[_0x5c1b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x221c80,_0x8c36d3,_0x3d62c7){return new BPromise(function(_0x150c1d,_0x31c853){return client['request'](_0x221c80,_0x3d62c7)[_0x5c1b('0xc')](function(_0x4cc1bb){logger[_0x5c1b('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x8c36d3,_0x5c1b('0xe'));logger[_0x5c1b('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x8c36d3,'request\x20sent',JSON[_0x5c1b('0x10')](_0x4cc1bb));if(_0x4cc1bb[_0x5c1b('0x11')]){if(_0x4cc1bb[_0x5c1b('0x11')][_0x5c1b('0x12')]===0x1f4){logger[_0x5c1b('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x8c36d3,_0x4cc1bb[_0x5c1b('0x11')][_0x5c1b('0x13')]);return _0x31c853(_0x4cc1bb[_0x5c1b('0x11')]['message']);}logger[_0x5c1b('0x11')](_0x5c1b('0x14'),_0x8c36d3,_0x4cc1bb['error'][_0x5c1b('0x13')]);return _0x150c1d(_0x4cc1bb['error'][_0x5c1b('0x13')]);}else{logger['info'](_0x5c1b('0x14'),_0x8c36d3,_0x5c1b('0xe'));_0x150c1d(_0x4cc1bb[_0x5c1b('0x15')]['message']);}})[_0x5c1b('0x16')](function(_0x2cd626){logger['error'](_0x5c1b('0x14'),_0x8c36d3,_0x2cd626);_0x31c853(_0x2cd626);});});}