Built motion from commit (unavailable).|2.4.20
[motion2.git] / server / api / jira / jira.controller.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 _0xc602=['bluebird','https','api','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','customfield_11500','fields','customfield_11501','customfield_11502','newToken','customfield_11503','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','request','setEncoding','utf8','data','end','status','parse','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','body','headers','x-forwarded-for','connection','remoteAddress','socket'];(function(_0x4ab6a0,_0x5314d1){var _0x30deca=function(_0x3f3d88){while(--_0x3f3d88){_0x4ab6a0['push'](_0x4ab6a0['shift']());}};_0x30deca(++_0x5314d1);}(_0xc602,0xac));var _0x2c60=function(_0x3ed445,_0x179ec8){_0x3ed445=_0x3ed445-0x0;var _0x1f7664=_0xc602[_0x3ed445];return _0x1f7664;};'use strict';var BPromise=require(_0x2c60('0x0'));var https=require(_0x2c60('0x1'));var logger=require('../../config/logger')(_0x2c60('0x2'));var USERNAME='support';var PASSWORD=_0x2c60('0x3');function openIssue(_0x3c36be,_0x36a033){var _0x707d56={'fields':{'project':{'key':_0x3c36be[_0x2c60('0x4')]||_0x2c60('0x5')},'summary':(_0x3c36be[_0x2c60('0x6')]||_0x2c60('0x7'))+_0x2c60('0x8')+_0x3c36be['ip'],'description':_0x3c36be[_0x2c60('0x9')]||JSON[_0x2c60('0xa')](_0x3c36be),'issuetype':{'name':_0x3c36be[_0x2c60('0xb')]||'Bug'}}};_0x707d56['fields'][_0x2c60('0xc')]=_0x3c36be['email'];_0x707d56[_0x2c60('0xd')][_0x2c60('0xe')]=_0x3c36be['oldToken'];_0x707d56[_0x2c60('0xd')][_0x2c60('0xf')]=_0x3c36be[_0x2c60('0x10')];_0x707d56[_0x2c60('0xd')][_0x2c60('0x11')]=_0x3c36be['name'];_0x707d56[_0x2c60('0xd')][_0x2c60('0x12')]=_0x3c36be[_0x2c60('0x13')];_0x707d56['fields']['customfield_10102']=_0x3c36be['ip'];var _0x3cdaf6={'host':_0x2c60('0x14'),'port':0x1bb,'path':_0x2c60('0x15'),'method':_0x2c60('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x2c60('0x17'),'Authorization':_0x2c60('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x2c60('0x19')]('base64')}};var _0x216642=JSON[_0x2c60('0xa')](_0x707d56);var _0xfc3a46=https[_0x2c60('0x1a')](_0x3cdaf6,function(_0x20fa10){_0x20fa10[_0x2c60('0x1b')](_0x2c60('0x1c'));var _0x474e72='';_0x20fa10['on'](_0x2c60('0x1d'),function(_0x41a89a){_0x474e72+=_0x41a89a;});_0x20fa10['on'](_0x2c60('0x1e'),function(){if(_0x36a033){return _0x36a033[_0x2c60('0x1f')](_0x20fa10['statusCode'])['json'](JSON[_0x2c60('0x20')](_0x474e72));}});});_0xfc3a46['on']('error',function(_0x5af2a7){if(_0x36a033){return _0x36a033[_0x2c60('0x1f')](0x1f4)[_0x2c60('0x21')]({'errors':[{'message':_0x2c60('0x22'),'type':_0x2c60('0x23')}]});}});_0xfc3a46[_0x2c60('0x24')](_0x216642);_0xfc3a46[_0x2c60('0x1e')]();}exports['openIssue']=openIssue;exports['send']=function(_0x49f826,_0x1129a6){_0x49f826[_0x2c60('0x25')]['ip']=_0x49f826[_0x2c60('0x26')][_0x2c60('0x27')]||_0x49f826[_0x2c60('0x28')][_0x2c60('0x29')]||_0x49f826[_0x2c60('0x2a')]['remoteAddress']||_0x49f826[_0x2c60('0x28')][_0x2c60('0x2a')]['remoteAddress'];return openIssue(_0x49f826[_0x2c60('0x25')],_0x1129a6);};