jira-daily-report 0.1.102 → 0.1.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -40,7 +40,7 @@ Please set it via:
|
|
|
40
40
|
2. Config file: .jira-report.json or ~/.jira-report.json
|
|
41
41
|
3. Run: jira-report config --init to create a template`);return o}onConfigChange(p){}getEnvVarName(p){return{jiraServer:"JIRA_SERVER",username:"JIRA_USERNAME",apiToken:"JIRA_API_TOKEN",jiraTempoToken:"TEMPO_API_TOKEN",whoAmI:"WHO_AM_I",autoClipboard:"AUTO_CLIPBOARD"}[p]||p.toUpperCase()}getConfigPaths(){return this.configSources}hasConfig(){return this.configSources.some(p=>x1.existsSync(p))}static createTemplate(p){let o=p||mp.join(process.cwd(),".jira-report.json");x1.writeFileSync(o,JSON.stringify({jiraServer:"https://your-domain.atlassian.net/",username:"your-email@example.com",apiToken:"your-jira-api-token",jiraTempoToken:"your-tempo-api-token",whoAmI:"Developer",autoClipboard:!0,enableTimesheetIntegration:!0,timesheetDateFormat:"YYYY-MM-DD"},null,2),"utf-8"),console.log(`Created config template at: ${o}`),console.log(`
|
|
42
42
|
Please edit the file and add your credentials.`),console.log(`
|
|
43
|
-
To get your API tokens:`),console.log(" Jira API Token: https://id.atlassian.com/manage-profile/security/api-tokens"),console.log(" Tempo API Token: https://apidocs.tempo.io/#section/Authentication")}};var la=P(require("fs")),Up=class{constructor(p={}){this.options=p}spinnerInterval=null;currentFrame=0;startTime=0;tokenCount=0;targetTokenCount=0;displayTokenCount=0;starburstFrames=["\u2736","\u2737","\u2738","\u2739","\u273A","\u273B","\u273C","\u273D"];burstFrames=["\u25E6\u2218\u2219\u2299\u2218\u25E6","\u2218\u2219\u2299\u25CF\u2299\u2219\u2218","\u2219\u2299\u25CF\u25C9\u25CF\u2299\u2219","\u2299\u25CF\u25C9\u25C9\u25C9\u25CF\u2299","\u2219\u2299\u25CF\u25C9\u25CF\u2299\u2219","\u2218\u2219\u2299\u25CF\u2299\u2219\u2218"];asteriskFrames=["\u2726","\u2727","\u2736","\u2737"];logoColors=["\x1B[38;5;214m","\x1B[38;5;215m","\x1B[38;5;216m","\x1B[38;5;223m"];startSpinner(p="Generating report"){this.options.silent||process.stdout.isTTY===!1||(this.currentFrame=0,this.startTime=Date.now(),this.spinnerInterval=setInterval(()=>{let o=this.currentFrame%this.starburstFrames.length,b=this.currentFrame%this.logoColors.length,z=this.starburstFrames[o],n=this.logoColors[b],t=Math.floor(this.currentFrame/2)%this.logoColors.length,r=this.logoColors[t],s=Math.floor((Date.now()-this.startTime)/1e3);if(this.displayTokenCount<this.targetTokenCount){let R=Math.max(1,Math.ceil((this.targetTokenCount-this.displayTokenCount)/20));this.displayTokenCount=Math.min(this.displayTokenCount+R,this.targetTokenCount)}let d="";this.displayTokenCount>0&&(d=` \xB7 \u2193 ${this.displayTokenCount.toLocaleString()} tokens`);let A="\x1B[90m(esc to interrupt \xB7
|
|
43
|
+
To get your API tokens:`),console.log(" Jira API Token: https://id.atlassian.com/manage-profile/security/api-tokens"),console.log(" Tempo API Token: https://apidocs.tempo.io/#section/Authentication")}};var la=P(require("fs")),Up=class{constructor(p={}){this.options=p}spinnerInterval=null;currentFrame=0;startTime=0;tokenCount=0;targetTokenCount=0;displayTokenCount=0;starburstFrames=["\u2736","\u2737","\u2738","\u2739","\u273A","\u273B","\u273C","\u273D"];burstFrames=["\u25E6\u2218\u2219\u2299\u2218\u25E6","\u2218\u2219\u2299\u25CF\u2299\u2219\u2218","\u2219\u2299\u25CF\u25C9\u25CF\u2299\u2219","\u2299\u25CF\u25C9\u25C9\u25C9\u25CF\u2299","\u2219\u2299\u25CF\u25C9\u25CF\u2299\u2219","\u2218\u2219\u2299\u25CF\u2299\u2219\u2218"];asteriskFrames=["\u2726","\u2727","\u2736","\u2737"];logoColors=["\x1B[38;5;214m","\x1B[38;5;215m","\x1B[38;5;216m","\x1B[38;5;223m"];startSpinner(p="Generating report"){this.options.silent||process.stdout.isTTY===!1||(this.currentFrame=0,this.startTime=Date.now(),this.spinnerInterval=setInterval(()=>{let o=this.currentFrame%this.starburstFrames.length,b=this.currentFrame%this.logoColors.length,z=this.starburstFrames[o],n=this.logoColors[b],t=Math.floor(this.currentFrame/2)%this.logoColors.length,r=this.logoColors[t],s=Math.floor((Date.now()-this.startTime)/1e3);if(this.displayTokenCount<this.targetTokenCount){let R=Math.max(1,Math.ceil((this.targetTokenCount-this.displayTokenCount)/20));this.displayTokenCount=Math.min(this.displayTokenCount+R,this.targetTokenCount)}let d="";this.displayTokenCount>0&&(d=` \xB7 \u2193 ${this.displayTokenCount.toLocaleString()} tokens`);let A="\x1B[90m(esc to interrupt \xB7 \x1B[0m",W=`\x1B[90m${s}s${d})\x1B[0m`;process.stdout.write(`\r\x1B[K ${n}${z}\x1B[0m ${r}${p}...\x1B[0m ${A}${W}`),this.currentFrame++},150))}stopSpinner(p){this.spinnerInterval&&(clearInterval(this.spinnerInterval),this.spinnerInterval=null,process.stdout.write("\r\x1B[K"),p&&process.stdout.write(`\x1B[32m\u2713\x1B[0m \x1B[90m${p}\x1B[0m
|
|
44
44
|
`))}updateProgress(p,o){let b=0;p!==void 0&&(b+=p*30),o!==void 0&&(b+=o*10),this.targetTokenCount=b}showInfo(p){this.options.silent||console.log(`\x1B[36m\u2139\x1B[0m ${p}`)}showError(p){console.error(`\x1B[31m\u2716\x1B[0m ${p}`)}showWarning(p){this.options.silent||console.warn(`\x1B[33m\u26A0\x1B[0m ${p}`)}showReport(p){let o=p;if(this.options.format==="json"?o=this.convertToJSON(p):this.options.format==="markdown"&&(o=p),this.options.outputFile)try{la.writeFileSync(this.options.outputFile,o,"utf-8"),this.showInfo(`Report saved to ${this.options.outputFile}`)}catch(b){this.showError(`Failed to write report to file: ${b instanceof Error?b.message:String(b)}`),console.log(`
|
|
45
45
|
`+o+`
|
|
46
46
|
`)}else console.log(o)}async copyToClipboard(p){try{await(await Promise.resolve().then(()=>(ua(),qa))).default.write(p)}catch{throw new Error("Clipboard functionality not available. Install 'clipboardy' package to enable: npm install clipboardy")}}hasClipboard(){try{return require.resolve("clipboardy"),!0}catch{return!1}}convertToJSON(p){let o=p.split(`
|
package/package.json
CHANGED