Built motion from commit e1760111.|2.6.18
[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 _0x75a0=['lodash','util','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x1a9368,_0x57b474){var _0x5212ac=function(_0x5e0ded){while(--_0x5e0ded){_0x1a9368['push'](_0x1a9368['shift']());}};_0x5212ac(++_0x57b474);}(_0x75a0,0x110));var _0x075a=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0x75a0[_0x34f701];return _0x3e2429;};'use strict';var _=require(_0x075a('0x0'));var util=require(_0x075a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x075a('0x2'));var fs=require('fs');var Redis=require(_0x075a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x075a('0x4'))('rpc');var config=require(_0x075a('0x5'));var jayson=require(_0x075a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33f2a8,_0x15389b,_0x42c585){return new BPromise(function(_0x350ecc,_0x5dbf16){return client['request'](_0x33f2a8,_0x42c585)[_0x075a('0x7')](function(_0x2947b5){logger['info'](_0x075a('0x8'),_0x15389b,_0x075a('0x9'));logger['debug'](_0x075a('0xa'),_0x15389b,_0x075a('0x9'),JSON[_0x075a('0xb')](_0x2947b5));if(_0x2947b5['error']){if(_0x2947b5[_0x075a('0xc')]['code']===0x1f4){logger[_0x075a('0xc')](_0x075a('0x8'),_0x15389b,_0x2947b5['error'][_0x075a('0xd')]);return _0x5dbf16(_0x2947b5['error'][_0x075a('0xd')]);}logger['error'](_0x075a('0x8'),_0x15389b,_0x2947b5[_0x075a('0xc')][_0x075a('0xd')]);return _0x350ecc(_0x2947b5[_0x075a('0xc')][_0x075a('0xd')]);}else{logger[_0x075a('0xe')](_0x075a('0x8'),_0x15389b,_0x075a('0x9'));_0x350ecc(_0x2947b5[_0x075a('0xf')][_0x075a('0xd')]);}})['catch'](function(_0x24ef96){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x15389b,_0x24ef96);_0x5dbf16(_0x24ef96);});});}