Built motion from commit (unavailable).|2.5.4
[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 _0x4c38=['oldToken','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','request','setEncoding','utf8','data','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','end','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','api','support','key','MOTGUI','summary','Report','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x4c38,0xfe));var _0x84c3=function(_0x559ae3,_0x259e00){_0x559ae3=_0x559ae3-0x0;var _0x3edef1=_0x4c38[_0x559ae3];return _0x3edef1;};'use strict';var BPromise=require('bluebird');var https=require(_0x84c3('0x0'));var logger=require(_0x84c3('0x1'))(_0x84c3('0x2'));var USERNAME=_0x84c3('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x3f2dca,_0x376b30){var _0x1d3c5b={'fields':{'project':{'key':_0x3f2dca[_0x84c3('0x4')]||_0x84c3('0x5')},'summary':(_0x3f2dca[_0x84c3('0x6')]||_0x84c3('0x7'))+'\x20from\x20'+_0x3f2dca['ip'],'description':_0x3f2dca[_0x84c3('0x8')]||JSON[_0x84c3('0x9')](_0x3f2dca),'issuetype':{'name':_0x3f2dca[_0x84c3('0xa')]||_0x84c3('0xb')}}};_0x1d3c5b[_0x84c3('0xc')][_0x84c3('0xd')]=_0x3f2dca[_0x84c3('0xe')];_0x1d3c5b[_0x84c3('0xc')][_0x84c3('0xf')]=_0x3f2dca[_0x84c3('0x10')];_0x1d3c5b[_0x84c3('0xc')][_0x84c3('0x11')]=_0x3f2dca['newToken'];_0x1d3c5b[_0x84c3('0xc')][_0x84c3('0x12')]=_0x3f2dca[_0x84c3('0x13')];_0x1d3c5b[_0x84c3('0xc')][_0x84c3('0x14')]=_0x3f2dca[_0x84c3('0x15')];_0x1d3c5b[_0x84c3('0xc')][_0x84c3('0x16')]=_0x3f2dca['ip'];var _0x34f960={'host':_0x84c3('0x17'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x84c3('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x84c3('0x19'),'Authorization':_0x84c3('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x3b37ca=JSON['stringify'](_0x1d3c5b);var _0x4c9418=https[_0x84c3('0x1b')](_0x34f960,function(_0x16b042){_0x16b042[_0x84c3('0x1c')](_0x84c3('0x1d'));var _0x2449b2='';_0x16b042['on'](_0x84c3('0x1e'),function(_0x2e1105){_0x2449b2+=_0x2e1105;});_0x16b042['on']('end',function(){if(_0x376b30){return _0x376b30[_0x84c3('0x1f')](_0x16b042[_0x84c3('0x20')])[_0x84c3('0x21')](JSON['parse'](_0x2449b2));}});});_0x4c9418['on'](_0x84c3('0x22'),function(_0x594108){if(_0x376b30){return _0x376b30[_0x84c3('0x1f')](0x1f4)['json']({'errors':[{'message':_0x84c3('0x23'),'type':_0x84c3('0x24')}]});}});_0x4c9418['write'](_0x3b37ca);_0x4c9418[_0x84c3('0x25')]();}exports['openIssue']=openIssue;exports[_0x84c3('0x26')]=function(_0x2f0564,_0x408ff3){_0x2f0564[_0x84c3('0x27')]['ip']=_0x2f0564[_0x84c3('0x28')][_0x84c3('0x29')]||_0x2f0564[_0x84c3('0x2a')][_0x84c3('0x2b')]||_0x2f0564['socket'][_0x84c3('0x2b')]||_0x2f0564['connection'][_0x84c3('0x2c')][_0x84c3('0x2b')];return openIssue(_0x2f0564[_0x84c3('0x27')],_0x408ff3);};