Built motion from commit (unavailable).|2.5.21
[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 _0x3c3b=['FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0x3c3b,0x1eb));var _0xb3c3=function(_0x44f86e,_0x30e4a0){_0x44f86e=_0x44f86e-0x0;var _0x2b8a23=_0x3c3b[_0x44f86e];return _0x2b8a23;};'use strict';var _=require(_0xb3c3('0x0'));var util=require(_0xb3c3('0x1'));var moment=require('moment');var BPromise=require(_0xb3c3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb3c3('0x3'));var db=require(_0xb3c3('0x4'))['db'];var utils=require(_0xb3c3('0x5'));var logger=require(_0xb3c3('0x6'))(_0xb3c3('0x7'));var config=require(_0xb3c3('0x8'));var jayson=require(_0xb3c3('0x9'));var client=jayson['client'][_0xb3c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cfc40,_0x33c634,_0x396a76){return new BPromise(function(_0x5d632d,_0x8518fa){return client[_0xb3c3('0xb')](_0x1cfc40,_0x396a76)[_0xb3c3('0xc')](function(_0x391efc){logger['info'](_0xb3c3('0xd'),_0x33c634,_0xb3c3('0xe'));logger[_0xb3c3('0xf')](_0xb3c3('0x10'),_0x33c634,'request\x20sent',JSON[_0xb3c3('0x11')](_0x391efc));if(_0x391efc['error']){if(_0x391efc['error']['code']===0x1f4){logger[_0xb3c3('0x12')](_0xb3c3('0xd'),_0x33c634,_0x391efc[_0xb3c3('0x12')][_0xb3c3('0x13')]);return _0x8518fa(_0x391efc[_0xb3c3('0x12')]['message']);}logger[_0xb3c3('0x12')](_0xb3c3('0xd'),_0x33c634,_0x391efc['error'][_0xb3c3('0x13')]);return _0x5d632d(_0x391efc['error'][_0xb3c3('0x13')]);}else{logger['info'](_0xb3c3('0xd'),_0x33c634,_0xb3c3('0xe'));_0x5d632d(_0x391efc['result']['message']);}})[_0xb3c3('0x14')](function(_0x3f9c6b){logger[_0xb3c3('0x12')](_0xb3c3('0xd'),_0x33c634,_0x3f9c6b);_0x8518fa(_0x3f9c6b);});});}