Built motion from commit (unavailable).|2.5.10
[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 _0x6877=['customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','request','setEncoding','utf8','data','end','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','name','reason'];(function(_0x276a14,_0x467f1d){var _0x2d7a0d=function(_0x1df128){while(--_0x1df128){_0x276a14['push'](_0x276a14['shift']());}};_0x2d7a0d(++_0x467f1d);}(_0x6877,0xa1));var _0x7687=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x6877[_0x136619];return _0x38c4a5;};'use strict';var BPromise=require(_0x7687('0x0'));var https=require(_0x7687('0x1'));var logger=require(_0x7687('0x2'))(_0x7687('0x3'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x2e1710,_0x53caaa){var _0x1dbb3c={'fields':{'project':{'key':_0x2e1710['key']||_0x7687('0x4')},'summary':(_0x2e1710[_0x7687('0x5')]||'Report')+_0x7687('0x6')+_0x2e1710['ip'],'description':_0x2e1710[_0x7687('0x7')]||JSON[_0x7687('0x8')](_0x2e1710),'issuetype':{'name':_0x2e1710[_0x7687('0x9')]||'Bug'}}};_0x1dbb3c[_0x7687('0xa')][_0x7687('0xb')]=_0x2e1710[_0x7687('0xc')];_0x1dbb3c[_0x7687('0xa')][_0x7687('0xd')]=_0x2e1710[_0x7687('0xe')];_0x1dbb3c[_0x7687('0xa')][_0x7687('0xf')]=_0x2e1710[_0x7687('0x10')];_0x1dbb3c[_0x7687('0xa')]['customfield_11503']=_0x2e1710[_0x7687('0x11')];_0x1dbb3c[_0x7687('0xa')]['customfield_11504']=_0x2e1710[_0x7687('0x12')];_0x1dbb3c['fields'][_0x7687('0x13')]=_0x2e1710['ip'];var _0x3561dd={'host':_0x7687('0x14'),'port':0x1bb,'path':_0x7687('0x15'),'method':_0x7687('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x7687('0x17'),'Authorization':_0x7687('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x7687('0x19')]('base64')}};var _0x2c097b=JSON[_0x7687('0x8')](_0x1dbb3c);var _0x2f4ab4=https[_0x7687('0x1a')](_0x3561dd,function(_0x5f50d8){_0x5f50d8[_0x7687('0x1b')](_0x7687('0x1c'));var _0x1f6ac2='';_0x5f50d8['on'](_0x7687('0x1d'),function(_0x2e716a){_0x1f6ac2+=_0x2e716a;});_0x5f50d8['on'](_0x7687('0x1e'),function(){if(_0x53caaa){return _0x53caaa['status'](_0x5f50d8['statusCode'])[_0x7687('0x1f')](JSON[_0x7687('0x20')](_0x1f6ac2));}});});_0x2f4ab4['on'](_0x7687('0x21'),function(_0x5a837e){if(_0x53caaa){return _0x53caaa[_0x7687('0x22')](0x1f4)[_0x7687('0x1f')]({'errors':[{'message':_0x7687('0x23'),'type':_0x7687('0x24')}]});}});_0x2f4ab4[_0x7687('0x25')](_0x2c097b);_0x2f4ab4['end']();}exports[_0x7687('0x26')]=openIssue;exports[_0x7687('0x27')]=function(_0xdf0c72,_0x4c8153){_0xdf0c72[_0x7687('0x28')]['ip']=_0xdf0c72[_0x7687('0x29')]['x-forwarded-for']||_0xdf0c72['connection'][_0x7687('0x2a')]||_0xdf0c72[_0x7687('0x2b')][_0x7687('0x2a')]||_0xdf0c72[_0x7687('0x2c')][_0x7687('0x2b')]['remoteAddress'];return openIssue(_0xdf0c72['body'],_0x4c8153);};