8ae55b617eb24919d481c183526481fcff1f23b7
[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 _0x6bf4=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x439d86,_0x4d5226){var _0xa3fcc7=function(_0x1e6f76){while(--_0x1e6f76){_0x439d86['push'](_0x439d86['shift']());}};_0xa3fcc7(++_0x4d5226);}(_0x6bf4,0x102));var _0x46bf=function(_0x6a1918,_0x24f5c5){_0x6a1918=_0x6a1918-0x0;var _0xb5d6af=_0x6bf4[_0x6a1918];return _0xb5d6af;};'use strict';var _=require('lodash');var util=require(_0x46bf('0x0'));var moment=require(_0x46bf('0x1'));var BPromise=require(_0x46bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46bf('0x3'));var db=require(_0x46bf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x46bf('0x5'));var config=require(_0x46bf('0x6'));var jayson=require(_0x46bf('0x7'));var client=jayson[_0x46bf('0x8')][_0x46bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18de8f,_0xc7be65,_0x184b8c){return new BPromise(function(_0x5e70e8,_0x3d80a9){return client[_0x46bf('0xa')](_0x18de8f,_0x184b8c)[_0x46bf('0xb')](function(_0x2ce12a){logger[_0x46bf('0xc')](_0x46bf('0xd'),_0xc7be65,_0x46bf('0xe'));logger[_0x46bf('0xf')](_0x46bf('0x10'),_0xc7be65,_0x46bf('0xe'),JSON['stringify'](_0x2ce12a));if(_0x2ce12a['error']){if(_0x2ce12a['error']['code']===0x1f4){logger[_0x46bf('0x11')](_0x46bf('0xd'),_0xc7be65,_0x2ce12a[_0x46bf('0x11')]['message']);return _0x3d80a9(_0x2ce12a['error'][_0x46bf('0x12')]);}logger[_0x46bf('0x11')](_0x46bf('0xd'),_0xc7be65,_0x2ce12a[_0x46bf('0x11')][_0x46bf('0x12')]);return _0x5e70e8(_0x2ce12a[_0x46bf('0x11')][_0x46bf('0x12')]);}else{logger[_0x46bf('0xc')](_0x46bf('0xd'),_0xc7be65,_0x46bf('0xe'));_0x5e70e8(_0x2ce12a[_0x46bf('0x13')][_0x46bf('0x12')]);}})[_0x46bf('0x14')](function(_0x51f14c){logger['error'](_0x46bf('0xd'),_0xc7be65,_0x51f14c);_0x3d80a9(_0x51f14c);});});}