Built motion from commit (unavailable).|2.5.23
[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 _0x3a70=['result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x16ec18,_0xb13ffe){var _0x5a3bb1=function(_0x41c3e6){while(--_0x41c3e6){_0x16ec18['push'](_0x16ec18['shift']());}};_0x5a3bb1(++_0xb13ffe);}(_0x3a70,0x70));var _0x03a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a70[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x03a7('0x0'));var util=require(_0x03a7('0x1'));var moment=require(_0x03a7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03a7('0x3'))['db'];var utils=require(_0x03a7('0x4'));var logger=require(_0x03a7('0x5'))(_0x03a7('0x6'));var config=require(_0x03a7('0x7'));var jayson=require(_0x03a7('0x8'));var client=jayson[_0x03a7('0x9')][_0x03a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x143c60,_0x10dcf6,_0x1ea127){return new BPromise(function(_0x27798a,_0xb150a3){return client['request'](_0x143c60,_0x1ea127)[_0x03a7('0xb')](function(_0x2f2695){logger[_0x03a7('0xc')](_0x03a7('0xd'),_0x10dcf6,_0x03a7('0xe'));logger['debug'](_0x03a7('0xf'),_0x10dcf6,_0x03a7('0xe'),JSON[_0x03a7('0x10')](_0x2f2695));if(_0x2f2695[_0x03a7('0x11')]){if(_0x2f2695[_0x03a7('0x11')][_0x03a7('0x12')]===0x1f4){logger[_0x03a7('0x11')](_0x03a7('0xd'),_0x10dcf6,_0x2f2695['error'][_0x03a7('0x13')]);return _0xb150a3(_0x2f2695[_0x03a7('0x11')]['message']);}logger[_0x03a7('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x10dcf6,_0x2f2695[_0x03a7('0x11')]['message']);return _0x27798a(_0x2f2695[_0x03a7('0x11')][_0x03a7('0x13')]);}else{logger['info'](_0x03a7('0xd'),_0x10dcf6,'request\x20sent');_0x27798a(_0x2f2695[_0x03a7('0x14')][_0x03a7('0x13')]);}})[_0x03a7('0x15')](function(_0x263401){logger[_0x03a7('0x11')](_0x03a7('0xd'),_0x10dcf6,_0x263401);_0xb150a3(_0x263401);});});}