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 _0x551f=['toString','base64','request','setEncoding','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','body','headers','x-forwarded-for','remoteAddress','socket','connection','bluebird','../../config/logger','support','3eAmWpBVP0','MOTGUI','summary','\x20from\x20','stringify','issuetype','Bug','customfield_11501','oldToken','fields','customfield_11502','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20'];(function(_0x18d417,_0x692f5e){var _0x40fb7a=function(_0x54163b){while(--_0x54163b){_0x18d417['push'](_0x18d417['shift']());}};_0x40fb7a(++_0x692f5e);}(_0x551f,0x67));var _0xf551=function(_0x5f0f89,_0x1fc5cc){_0x5f0f89=_0x5f0f89-0x0;var _0x541945=_0x551f[_0x5f0f89];return _0x541945;};'use strict';var BPromise=require(_0xf551('0x0'));var https=require('https');var logger=require(_0xf551('0x1'))('api');var USERNAME=_0xf551('0x2');var PASSWORD=_0xf551('0x3');function openIssue(_0x500048,_0x2e2f8f){var _0x5d2060={'fields':{'project':{'key':_0x500048['key']||_0xf551('0x4')},'summary':(_0x500048[_0xf551('0x5')]||'Report')+_0xf551('0x6')+_0x500048['ip'],'description':_0x500048['description']||JSON[_0xf551('0x7')](_0x500048),'issuetype':{'name':_0x500048[_0xf551('0x8')]||_0xf551('0x9')}}};_0x5d2060['fields']['customfield_11500']=_0x500048['email'];_0x5d2060['fields'][_0xf551('0xa')]=_0x500048[_0xf551('0xb')];_0x5d2060[_0xf551('0xc')][_0xf551('0xd')]=_0x500048['newToken'];_0x5d2060[_0xf551('0xc')]['customfield_11503']=_0x500048[_0xf551('0xe')];_0x5d2060[_0xf551('0xc')][_0xf551('0xf')]=_0x500048[_0xf551('0x10')];_0x5d2060[_0xf551('0xc')][_0xf551('0x11')]=_0x500048['ip'];var _0x2e8947={'host':_0xf551('0x12'),'port':0x1bb,'path':_0xf551('0x13'),'method':_0xf551('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xf551('0x15'),'Authorization':_0xf551('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xf551('0x17')](_0xf551('0x18'))}};var _0x593567=JSON[_0xf551('0x7')](_0x5d2060);var _0x396bf5=https[_0xf551('0x19')](_0x2e8947,function(_0x38ed7d){_0x38ed7d[_0xf551('0x1a')]('utf8');var _0x3c8ded='';_0x38ed7d['on']('data',function(_0x5bf956){_0x3c8ded+=_0x5bf956;});_0x38ed7d['on'](_0xf551('0x1b'),function(){if(_0x2e2f8f){return _0x2e2f8f['status'](_0x38ed7d['statusCode'])[_0xf551('0x1c')](JSON[_0xf551('0x1d')](_0x3c8ded));}});});_0x396bf5['on'](_0xf551('0x1e'),function(_0x31db80){if(_0x2e2f8f){return _0x2e2f8f[_0xf551('0x1f')](0x1f4)[_0xf551('0x1c')]({'errors':[{'message':_0xf551('0x20'),'type':_0xf551('0x21')}]});}});_0x396bf5[_0xf551('0x22')](_0x593567);_0x396bf5[_0xf551('0x1b')]();}exports[_0xf551('0x23')]=openIssue;exports['send']=function(_0x590632,_0x34797e){_0x590632[_0xf551('0x24')]['ip']=_0x590632[_0xf551('0x25')][_0xf551('0x26')]||_0x590632['connection'][_0xf551('0x27')]||_0x590632[_0xf551('0x28')][_0xf551('0x27')]||_0x590632[_0xf551('0x29')][_0xf551('0x28')][_0xf551('0x27')];return openIssue(_0x590632[_0xf551('0x24')],_0x34797e);};