Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / api / intZendeskConfiguration / intZendeskConfiguration.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 _0xe6a6=['request','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0xc4c6db,_0x424c18){var _0x148579=function(_0x1f9368){while(--_0x1f9368){_0xc4c6db['push'](_0xc4c6db['shift']());}};_0x148579(++_0x424c18);}(_0xe6a6,0x154));var _0x6e6a=function(_0x42a3b4,_0x2f1a79){_0x42a3b4=_0x42a3b4-0x0;var _0x23c3bc=_0xe6a6[_0x42a3b4];return _0x23c3bc;};'use strict';var _=require('lodash');var util=require(_0x6e6a('0x0'));var moment=require(_0x6e6a('0x1'));var BPromise=require(_0x6e6a('0x2'));var rs=require(_0x6e6a('0x3'));var fs=require('fs');var Redis=require(_0x6e6a('0x4'));var db=require(_0x6e6a('0x5'))['db'];var utils=require(_0x6e6a('0x6'));var logger=require(_0x6e6a('0x7'))('rpc');var config=require(_0x6e6a('0x8'));var jayson=require(_0x6e6a('0x9'));var client=jayson[_0x6e6a('0xa')][_0x6e6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x426182,_0x48f85d,_0x150d0e){return new BPromise(function(_0x295d55,_0xec94d3){return client[_0x6e6a('0xc')](_0x426182,_0x150d0e)['then'](function(_0x16cc60){logger[_0x6e6a('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x48f85d,_0x6e6a('0xe'));logger[_0x6e6a('0xf')](_0x6e6a('0x10'),_0x48f85d,'request\x20sent',JSON['stringify'](_0x16cc60));if(_0x16cc60[_0x6e6a('0x11')]){if(_0x16cc60['error'][_0x6e6a('0x12')]===0x1f4){logger[_0x6e6a('0x11')](_0x6e6a('0x13'),_0x48f85d,_0x16cc60[_0x6e6a('0x11')][_0x6e6a('0x14')]);return _0xec94d3(_0x16cc60[_0x6e6a('0x11')][_0x6e6a('0x14')]);}logger[_0x6e6a('0x11')](_0x6e6a('0x13'),_0x48f85d,_0x16cc60[_0x6e6a('0x11')][_0x6e6a('0x14')]);return _0x295d55(_0x16cc60['error'][_0x6e6a('0x14')]);}else{logger[_0x6e6a('0xd')](_0x6e6a('0x13'),_0x48f85d,_0x6e6a('0xe'));_0x295d55(_0x16cc60['result']['message']);}})[_0x6e6a('0x15')](function(_0x2624da){logger[_0x6e6a('0x11')](_0x6e6a('0x13'),_0x48f85d,_0x2624da);_0xec94d3(_0x2624da);});});}