Built motion from commit (unavailable).|2.4.8
[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 _0xcaa6=['customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','stringify','setEncoding','utf8','data','end','json','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','x-forwarded-for','remoteAddress','socket','connection','body','bluebird','https','api','support','key','MOTGUI','summary','Report','description','issuetype','Bug','fields','customfield_11501','oldToken','newToken'];(function(_0x1735ac,_0x14b05c){var _0x413176=function(_0x388ca0){while(--_0x388ca0){_0x1735ac['push'](_0x1735ac['shift']());}};_0x413176(++_0x14b05c);}(_0xcaa6,0x17d));var _0x6caa=function(_0x20179d,_0x49c11b){_0x20179d=_0x20179d-0x0;var _0x744567=_0xcaa6[_0x20179d];return _0x744567;};'use strict';var BPromise=require(_0x6caa('0x0'));var https=require(_0x6caa('0x1'));var logger=require('../../config/logger')(_0x6caa('0x2'));var USERNAME=_0x6caa('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x5ad976,_0x1318f8){var _0x2c6bb5={'fields':{'project':{'key':_0x5ad976[_0x6caa('0x4')]||_0x6caa('0x5')},'summary':(_0x5ad976[_0x6caa('0x6')]||_0x6caa('0x7'))+'\x20from\x20'+_0x5ad976['ip'],'description':_0x5ad976[_0x6caa('0x8')]||JSON['stringify'](_0x5ad976),'issuetype':{'name':_0x5ad976[_0x6caa('0x9')]||_0x6caa('0xa')}}};_0x2c6bb5['fields']['customfield_11500']=_0x5ad976['email'];_0x2c6bb5[_0x6caa('0xb')][_0x6caa('0xc')]=_0x5ad976[_0x6caa('0xd')];_0x2c6bb5[_0x6caa('0xb')]['customfield_11502']=_0x5ad976[_0x6caa('0xe')];_0x2c6bb5[_0x6caa('0xb')][_0x6caa('0xf')]=_0x5ad976[_0x6caa('0x10')];_0x2c6bb5[_0x6caa('0xb')][_0x6caa('0x11')]=_0x5ad976[_0x6caa('0x12')];_0x2c6bb5[_0x6caa('0xb')][_0x6caa('0x13')]=_0x5ad976['ip'];var _0x4c7159={'host':_0x6caa('0x14'),'port':0x1bb,'path':_0x6caa('0x15'),'method':_0x6caa('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x6caa('0x17'),'Authorization':_0x6caa('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x6caa('0x19')]('base64')}};var _0x1c3018=JSON[_0x6caa('0x1a')](_0x2c6bb5);var _0x2cc215=https['request'](_0x4c7159,function(_0x30b29e){_0x30b29e[_0x6caa('0x1b')](_0x6caa('0x1c'));var _0x38a962='';_0x30b29e['on'](_0x6caa('0x1d'),function(_0x1ea91d){_0x38a962+=_0x1ea91d;});_0x30b29e['on'](_0x6caa('0x1e'),function(){if(_0x1318f8){return _0x1318f8['status'](_0x30b29e['statusCode'])[_0x6caa('0x1f')](JSON['parse'](_0x38a962));}});});_0x2cc215['on'](_0x6caa('0x20'),function(_0x43ffb2){if(_0x1318f8){return _0x1318f8[_0x6caa('0x21')](0x1f4)[_0x6caa('0x1f')]({'errors':[{'message':_0x6caa('0x22'),'type':_0x6caa('0x23')}]});}});_0x2cc215[_0x6caa('0x24')](_0x1c3018);_0x2cc215[_0x6caa('0x1e')]();}exports[_0x6caa('0x25')]=openIssue;exports[_0x6caa('0x26')]=function(_0x1268ec,_0x5802ba){_0x1268ec['body']['ip']=_0x1268ec['headers'][_0x6caa('0x27')]||_0x1268ec['connection'][_0x6caa('0x28')]||_0x1268ec[_0x6caa('0x29')]['remoteAddress']||_0x1268ec[_0x6caa('0x2a')][_0x6caa('0x29')]['remoteAddress'];return openIssue(_0x1268ec[_0x6caa('0x2b')],_0x5802ba);};