Built motion from commit (unavailable).|2.3.1
[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 _0x0713=['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','connection','remoteAddress','socket','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','/rest/api/2/issue','POST','Basic\x20','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error'];(function(_0x2589c8,_0x31f0cc){var _0x202338=function(_0x246650){while(--_0x246650){_0x2589c8['push'](_0x2589c8['shift']());}};_0x202338(++_0x31f0cc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var USERNAME=_0x3071('0x2');var PASSWORD=_0x3071('0x3');function openIssue(_0x864539,_0x52b5fb){var _0x2c547f={'fields':{'project':{'key':_0x864539[_0x3071('0x4')]||_0x3071('0x5')},'summary':(_0x864539[_0x3071('0x6')]||_0x3071('0x7'))+_0x3071('0x8')+_0x864539['ip'],'description':_0x864539[_0x3071('0x9')]||JSON[_0x3071('0xa')](_0x864539),'issuetype':{'name':_0x864539[_0x3071('0xb')]||_0x3071('0xc')}}};_0x2c547f[_0x3071('0xd')][_0x3071('0xe')]=_0x864539[_0x3071('0xf')];_0x2c547f['fields'][_0x3071('0x10')]=_0x864539[_0x3071('0x11')];_0x2c547f[_0x3071('0xd')][_0x3071('0x12')]=_0x864539[_0x3071('0x13')];_0x2c547f['fields'][_0x3071('0x14')]=_0x864539[_0x3071('0x15')];_0x2c547f[_0x3071('0xd')][_0x3071('0x16')]=_0x864539[_0x3071('0x17')];_0x2c547f['fields']['customfield_10102']=_0x864539['ip'];var _0x1826ca={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x3071('0x18'),'method':_0x3071('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x3071('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x3071('0x1b'))}};var _0x45c93b=JSON[_0x3071('0xa')](_0x2c547f);var _0x1f14e1=https[_0x3071('0x1c')](_0x1826ca,function(_0x2a6a4b){_0x2a6a4b[_0x3071('0x1d')](_0x3071('0x1e'));var _0x21aad3='';_0x2a6a4b['on'](_0x3071('0x1f'),function(_0x5f3c22){_0x21aad3+=_0x5f3c22;});_0x2a6a4b['on'](_0x3071('0x20'),function(){if(_0x52b5fb){return _0x52b5fb[_0x3071('0x21')](_0x2a6a4b[_0x3071('0x22')])[_0x3071('0x23')](JSON[_0x3071('0x24')](_0x21aad3));}});});_0x1f14e1['on'](_0x3071('0x25'),function(_0x105bbb){if(_0x52b5fb){return _0x52b5fb[_0x3071('0x21')](0x1f4)['json']({'errors':[{'message':_0x3071('0x26'),'type':_0x3071('0x27')}]});}});_0x1f14e1[_0x3071('0x28')](_0x45c93b);_0x1f14e1['end']();}exports[_0x3071('0x29')]=openIssue;exports['send']=function(_0x833074,_0x43128c){_0x833074[_0x3071('0x2a')]['ip']=_0x833074[_0x3071('0x2b')][_0x3071('0x2c')]||_0x833074[_0x3071('0x2d')][_0x3071('0x2e')]||_0x833074[_0x3071('0x2f')]['remoteAddress']||_0x833074['connection'][_0x3071('0x2f')][_0x3071('0x2e')];return openIssue(_0x833074[_0x3071('0x2a')],_0x43128c);};