Built motion from commit da617fac.|2.6.6
[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 _0x471a=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x12f587,_0x3d5be8){var _0x13f5e6=function(_0x5ccf6e){while(--_0x5ccf6e){_0x12f587['push'](_0x12f587['shift']());}};_0x13f5e6(++_0x3d5be8);}(_0x471a,0xcc));var _0xa471=function(_0x47185c,_0x2c1d34){_0x47185c=_0x47185c-0x0;var _0x25a495=_0x471a[_0x47185c];return _0x25a495;};'use strict';var _=require(_0xa471('0x0'));var util=require(_0xa471('0x1'));var moment=require('moment');var BPromise=require(_0xa471('0x2'));var rs=require(_0xa471('0x3'));var fs=require('fs');var Redis=require(_0xa471('0x4'));var db=require(_0xa471('0x5'))['db'];var utils=require(_0xa471('0x6'));var logger=require(_0xa471('0x7'))(_0xa471('0x8'));var config=require(_0xa471('0x9'));var jayson=require(_0xa471('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48ba4b,_0x46d66b,_0x3f3caf){return new BPromise(function(_0x341a9a,_0x2f111b){return client[_0xa471('0xb')](_0x48ba4b,_0x3f3caf)['then'](function(_0x1c301f){logger[_0xa471('0xc')](_0xa471('0xd'),_0x46d66b,_0xa471('0xe'));logger[_0xa471('0xf')](_0xa471('0x10'),_0x46d66b,_0xa471('0xe'),JSON['stringify'](_0x1c301f));if(_0x1c301f['error']){if(_0x1c301f['error']['code']===0x1f4){logger[_0xa471('0x11')](_0xa471('0xd'),_0x46d66b,_0x1c301f[_0xa471('0x11')]['message']);return _0x2f111b(_0x1c301f[_0xa471('0x11')]['message']);}logger[_0xa471('0x11')](_0xa471('0xd'),_0x46d66b,_0x1c301f[_0xa471('0x11')][_0xa471('0x12')]);return _0x341a9a(_0x1c301f['error']['message']);}else{logger[_0xa471('0xc')](_0xa471('0xd'),_0x46d66b,'request\x20sent');_0x341a9a(_0x1c301f[_0xa471('0x13')]['message']);}})['catch'](function(_0x306248){logger['error'](_0xa471('0xd'),_0x46d66b,_0x306248);_0x2f111b(_0x306248);});});}