github-issue-tower-defence-management 2.83.0 → 2.85.0

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.
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnalyzeProblemByIssueUseCase = void 0;
4
- class AnalyzeProblemByIssueUseCase {
5
- constructor(issueRepository, dateRepository) {
6
- this.issueRepository = issueRepository;
7
- this.dateRepository = dateRepository;
8
- this.run = async (input) => {
9
- const storyProgressCommentEnabled = input.storyProgressCommentEnabled ?? true;
10
- const story = input.project.story;
11
- if (!storyProgressCommentEnabled ||
12
- !story ||
13
- !input.targetDates.find((targetDate) => targetDate.getUTCHours() === 0 && targetDate.getUTCMinutes() === 0)) {
14
- return;
15
- }
16
- const targetDate = input.targetDates[input.targetDates.length - 1];
17
- if (!targetDate) {
18
- return;
19
- }
20
- for (const storyObject of input.storyObjectMap.values()) {
21
- const storyIssue = storyObject.storyIssue;
22
- if (!storyIssue) {
23
- continue;
24
- }
25
- await this.issueRepository.createComment(storyIssue, this.createSummaryCommentBody({ ...storyObject, storyIssue }));
26
- await new Promise((resolve) => setTimeout(resolve, 5000));
27
- }
28
- };
29
- this.createSummaryCommentBody = (storyObject) => {
30
- const getFlowchartIdFromUrl = (url) => {
31
- return url.split('/').slice(-3).join('/');
32
- };
33
- const issueTitleForFlowchart = (title) => {
34
- return title.replace(/"/g, "'");
35
- };
36
- const flowChart = `
37
- \`\`\`mermaid
38
-
39
- flowchart TD
40
- ${storyObject.issues
41
- .map((issue) => ` ${getFlowchartIdFromUrl(issue.url)}["${issue.isClosed ? '🟣' : '🟢'}#${issue.number} ${issue.isClosed ? 'Closed' : 'Open'}<br/>${issue.assignees.map((a) => `${a}`).join('<br/>')}<br/>${issueTitleForFlowchart(issue.title)}"]`)
42
- .join('\n')}
43
- ${storyObject.issues
44
- .map((issue) => Array.from(issue.dependedIssueUrls)
45
- .map((dependedIssueUrl) => {
46
- if (issue.isClosed) {
47
- return ` ${getFlowchartIdFromUrl(dependedIssueUrl)} --> ${getFlowchartIdFromUrl(issue.url)}`;
48
- }
49
- return ` ${getFlowchartIdFromUrl(dependedIssueUrl)} -->|${issue.estimationMinutes
50
- ? `Estimation: ${this.dateRepository.formatDurationToHHMM(issue.estimationMinutes)}<br/>`
51
- : ''}<br/>by ${issue.completionDate50PercentConfidence
52
- ? this.dateRepository.formatDateWithDayOfWeek(issue.completionDate50PercentConfidence)
53
- : 'Unknown'}| ${getFlowchartIdFromUrl(issue.url)}`;
54
- })
55
- .join('\n'))
56
- .join('\n')}
57
- %% click event
58
- ${storyObject.issues
59
- .map((issue) => `click ${getFlowchartIdFromUrl(issue.url)} "${issue.url}"`)
60
- .join('\n')}
61
-
62
- \`\`\``;
63
- let noMultipleNewLineBody = `
64
- ${storyObject.issues.map((issue) => `- ${issue.url}`).join('\n')}`;
65
- while (noMultipleNewLineBody.includes('\n\n')) {
66
- noMultipleNewLineBody = noMultipleNewLineBody.replace('\n\n', '\n');
67
- }
68
- return `${flowChart}
69
-
70
- ${noMultipleNewLineBody}
71
- `;
72
- };
73
- }
74
- }
75
- exports.AnalyzeProblemByIssueUseCase = AnalyzeProblemByIssueUseCase;
76
- //# sourceMappingURL=AnalyzeProblemByIssueUseCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnalyzeProblemByIssueUseCase.js","sourceRoot":"","sources":["../../../src/domain/usecases/AnalyzeProblemByIssueUseCase.ts"],"names":[],"mappings":";;;AAKA,MAAa,4BAA4B;IACvC,YACW,eAAuD,EACvD,cAGR;QAJQ,oBAAe,GAAf,eAAe,CAAwC;QACvD,mBAAc,GAAd,cAAc,CAGtB;QAGH,QAAG,GAAG,KAAK,EAAE,KAKZ,EAAiB,EAAE;YAClB,MAAM,2BAA2B,GAC/B,KAAK,CAAC,2BAA2B,IAAI,IAAI,CAAC;YAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CA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GAAG,CAAC,EAAE,CAAC;YAC1C,CAAC,CAAC;iBACD,IAAI,CAAC,IAAI,CAAC,CACd;iBACA,IAAI,CAAC,IAAI,CAAC;;MAEP,WAAW,CAAC,MAAM;iBACjB,GAAG,CACF,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,qBAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,GAAG,CACtE;iBACA,IAAI,CAAC,IAAI,CAAC;;OAEV,CAAC;YACJ,IAAI,qBAAqB,GAAG;EAC9B,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAE/D,OAAO,qBAAqB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC9C,qBAAqB,GAAG,qBAAqB,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACtE,CAAC;YACD,OAAO,GAAG,SAAS;;EAErB,qBAAqB;CACtB,CAAC;QACA,CAAC,CAAC;IAlGC,CAAC;CAmGL;AA1GD,oEA0GC"}
@@ -1,19 +0,0 @@
1
- import { IssueRepository } from './adapter-interfaces/IssueRepository';
2
- import { Project } from '../entities/Project';
3
- import { DateRepository } from './adapter-interfaces/DateRepository';
4
- import { StoryObject, StoryObjectMap } from '../entities/StoryObjectMap';
5
- export declare class AnalyzeProblemByIssueUseCase {
6
- readonly issueRepository: Pick<IssueRepository, 'createComment'>;
7
- readonly dateRepository: Pick<DateRepository, 'formatDurationToHHMM' | 'formatDateWithDayOfWeek'>;
8
- constructor(issueRepository: Pick<IssueRepository, 'createComment'>, dateRepository: Pick<DateRepository, 'formatDurationToHHMM' | 'formatDateWithDayOfWeek'>);
9
- run: (input: {
10
- targetDates: Date[];
11
- project: Project;
12
- storyObjectMap: StoryObjectMap;
13
- storyProgressCommentEnabled?: boolean;
14
- }) => Promise<void>;
15
- createSummaryCommentBody: (storyObject: StoryObject & {
16
- storyIssue: NonNullable<StoryObject["storyIssue"]>;
17
- }) => string;
18
- }
19
- //# sourceMappingURL=AnalyzeProblemByIssueUseCase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnalyzeProblemByIssueUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/AnalyzeProblemByIssueUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEzE,qBAAa,4BAA4B;IAErC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC;IAChE,QAAQ,CAAC,cAAc,EAAE,IAAI,CAC3B,cAAc,EACd,sBAAsB,GAAG,yBAAyB,CACnD;gBAJQ,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,EACvD,cAAc,EAAE,IAAI,CAC3B,cAAc,EACd,sBAAsB,GAAG,yBAAyB,CACnD;IAGH,GAAG,GAAU,OAAO;QAClB,WAAW,EAAE,IAAI,EAAE,CAAC;QACpB,OAAO,EAAE,OAAO,CAAC;QACjB,cAAc,EAAE,cAAc,CAAC;QAC/B,2BAA2B,CAAC,EAAE,OAAO,CAAC;KACvC,KAAG,OAAO,CAAC,IAAI,CAAC,CA6Bf;IACF,wBAAwB,GACtB,aAAa,WAAW,GAAG;QACzB,UAAU,EAAE,WAAW,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;KACpD,KACA,MAAM,CAyDP;CACH"}