Built motion from commit (unavailable).|2.5.14
[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 _0xb336=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug'];(function(_0x6cda3,_0x1a3902){var _0x15d463=function(_0x3682c1){while(--_0x3682c1){_0x6cda3['push'](_0x6cda3['shift']());}};_0x15d463(++_0x1a3902);}(_0xb336,0xf4));var _0x6b33=function(_0x15ce9b,_0x24f5f4){_0x15ce9b=_0x15ce9b-0x0;var _0x50e796=_0xb336[_0x15ce9b];return _0x50e796;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b33('0x0'));var db=require(_0x6b33('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b33('0x2'))(_0x6b33('0x3'));var config=require(_0x6b33('0x4'));var jayson=require(_0x6b33('0x5'));var client=jayson['client'][_0x6b33('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x12b2ca,_0x486aa2,_0x2e9d24){return new BPromise(function(_0x3cc7c5,_0x3cca11){return client['request'](_0x12b2ca,_0x2e9d24)[_0x6b33('0x7')](function(_0x16cf46){logger[_0x6b33('0x8')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x486aa2,_0x6b33('0x9'));logger[_0x6b33('0xa')](_0x6b33('0xb'),_0x486aa2,_0x6b33('0x9'),JSON['stringify'](_0x16cf46));if(_0x16cf46[_0x6b33('0xc')]){if(_0x16cf46['error'][_0x6b33('0xd')]===0x1f4){logger[_0x6b33('0xc')](_0x6b33('0xe'),_0x486aa2,_0x16cf46['error'][_0x6b33('0xf')]);return _0x3cca11(_0x16cf46[_0x6b33('0xc')]['message']);}logger[_0x6b33('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x486aa2,_0x16cf46['error'][_0x6b33('0xf')]);return _0x3cc7c5(_0x16cf46['error'][_0x6b33('0xf')]);}else{logger[_0x6b33('0x8')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x486aa2,'request\x20sent');_0x3cc7c5(_0x16cf46['result'][_0x6b33('0xf')]);}})[_0x6b33('0x10')](function(_0x3628d6){logger[_0x6b33('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x486aa2,_0x3628d6);_0x3cca11(_0x3628d6);});});}