34575a84f882243f2f51b3adff5aae055e7016c4
[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 _0xb0e5=['message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','../../config/utils','rpc','jayson/promise','client','then','info','request\x20sent','stringify','error','code'];(function(_0x1c7277,_0x46d1c4){var _0x3e5112=function(_0x1e2b00){while(--_0x1e2b00){_0x1c7277['push'](_0x1c7277['shift']());}};_0x3e5112(++_0x46d1c4);}(_0xb0e5,0xe1));var _0x5b0e=function(_0x211b6a,_0x54c798){_0x211b6a=_0x211b6a-0x0;var _0x1ba2a9=_0xb0e5[_0x211b6a];return _0x1ba2a9;};'use strict';var _=require(_0x5b0e('0x0'));var util=require('util');var moment=require(_0x5b0e('0x1'));var BPromise=require('bluebird');var rs=require(_0x5b0e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b0e('0x3'));var logger=require('../../config/logger')(_0x5b0e('0x4'));var config=require('../../config/environment');var jayson=require(_0x5b0e('0x5'));var client=jayson[_0x5b0e('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x96a170,_0x192781,_0x57efcf){return new BPromise(function(_0x2561a1,_0x311053){return client['request'](_0x96a170,_0x57efcf)[_0x5b0e('0x7')](function(_0xb48fc0){logger[_0x5b0e('0x8')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x192781,_0x5b0e('0x9'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x192781,_0x5b0e('0x9'),JSON[_0x5b0e('0xa')](_0xb48fc0));if(_0xb48fc0['error']){if(_0xb48fc0[_0x5b0e('0xb')][_0x5b0e('0xc')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x192781,_0xb48fc0[_0x5b0e('0xb')][_0x5b0e('0xd')]);return _0x311053(_0xb48fc0[_0x5b0e('0xb')][_0x5b0e('0xd')]);}logger[_0x5b0e('0xb')](_0x5b0e('0xe'),_0x192781,_0xb48fc0[_0x5b0e('0xb')][_0x5b0e('0xd')]);return _0x2561a1(_0xb48fc0[_0x5b0e('0xb')][_0x5b0e('0xd')]);}else{logger[_0x5b0e('0x8')](_0x5b0e('0xe'),_0x192781,_0x5b0e('0x9'));_0x2561a1(_0xb48fc0[_0x5b0e('0xf')][_0x5b0e('0xd')]);}})[_0x5b0e('0x10')](function(_0x59640d){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x192781,_0x59640d);_0x311053(_0x59640d);});});}