302f9807c199370ac6979007a08d18b6e61f2e34
[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 _0x804a=['error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x342874,_0xae5304){var _0x503c39=function(_0xd68ca4){while(--_0xd68ca4){_0x342874['push'](_0x342874['shift']());}};_0x503c39(++_0xae5304);}(_0x804a,0x194));var _0xa804=function(_0x319f81,_0x2641c9){_0x319f81=_0x319f81-0x0;var _0x4d761f=_0x804a[_0x319f81];return _0x4d761f;};'use strict';var _=require('lodash');var util=require(_0xa804('0x0'));var moment=require(_0xa804('0x1'));var BPromise=require('bluebird');var rs=require(_0xa804('0x2'));var fs=require('fs');var Redis=require(_0xa804('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa804('0x4'));var logger=require(_0xa804('0x5'))('rpc');var config=require(_0xa804('0x6'));var jayson=require(_0xa804('0x7'));var client=jayson[_0xa804('0x8')][_0xa804('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3183f1,_0x2c894b,_0x1c7220){return new BPromise(function(_0x55a0f5,_0x7343f0){return client[_0xa804('0xa')](_0x3183f1,_0x1c7220)[_0xa804('0xb')](function(_0x9bfa83){logger['info'](_0xa804('0xc'),_0x2c894b,_0xa804('0xd'));logger[_0xa804('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2c894b,_0xa804('0xd'),JSON[_0xa804('0xf')](_0x9bfa83));if(_0x9bfa83['error']){if(_0x9bfa83[_0xa804('0x10')][_0xa804('0x11')]===0x1f4){logger[_0xa804('0x10')](_0xa804('0xc'),_0x2c894b,_0x9bfa83[_0xa804('0x10')][_0xa804('0x12')]);return _0x7343f0(_0x9bfa83[_0xa804('0x10')][_0xa804('0x12')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2c894b,_0x9bfa83['error'][_0xa804('0x12')]);return _0x55a0f5(_0x9bfa83[_0xa804('0x10')][_0xa804('0x12')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2c894b,_0xa804('0xd'));_0x55a0f5(_0x9bfa83[_0xa804('0x13')][_0xa804('0x12')]);}})[_0xa804('0x14')](function(_0x48b720){logger[_0xa804('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2c894b,_0x48b720);_0x7343f0(_0x48b720);});});}