github-issue-tower-defence-management 1.87.0 → 1.88.1
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/CHANGELOG.md +14 -0
- package/README.md +51 -1
- package/bin/adapter/entry-points/cli/index.js +35 -0
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/console/consoleDataDelivery.js +155 -0
- package/bin/adapter/entry-points/console/consoleDataDelivery.js.map +1 -0
- package/bin/adapter/entry-points/console/consoleDoneStore.js +100 -0
- package/bin/adapter/entry-points/console/consoleDoneStore.js.map +1 -0
- package/bin/adapter/entry-points/console/consoleOperationApi.js +178 -0
- package/bin/adapter/entry-points/console/consoleOperationApi.js.map +1 -0
- package/bin/adapter/entry-points/console/consoleReadApi.js +119 -0
- package/bin/adapter/entry-points/console/consoleReadApi.js.map +1 -0
- package/bin/adapter/entry-points/console/consoleServer.js +147 -3
- package/bin/adapter/entry-points/console/consoleServer.js.map +1 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +54 -12
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
- package/bin/adapter/entry-points/handlers/inTmuxByHumanDataWriter.js +67 -0
- package/bin/adapter/entry-points/handlers/inTmuxByHumanDataWriter.js.map +1 -0
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js +3 -0
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/intmux/GenerateInTmuxByHumanDataUseCase.js +91 -0
- package/bin/domain/usecases/intmux/GenerateInTmuxByHumanDataUseCase.js.map +1 -0
- package/package.json +1 -1
- package/src/adapter/entry-points/cli/index.test.ts +94 -0
- package/src/adapter/entry-points/cli/index.ts +61 -0
- package/src/adapter/entry-points/console/consoleDataDelivery.test.ts +184 -0
- package/src/adapter/entry-points/console/consoleDataDelivery.ts +169 -0
- package/src/adapter/entry-points/console/consoleDoneStore.test.ts +98 -0
- package/src/adapter/entry-points/console/consoleDoneStore.ts +91 -0
- package/src/adapter/entry-points/console/consoleOperationApi.test.ts +444 -0
- package/src/adapter/entry-points/console/consoleOperationApi.ts +280 -0
- package/src/adapter/entry-points/console/consoleReadApi.test.ts +297 -0
- package/src/adapter/entry-points/console/consoleReadApi.ts +192 -0
- package/src/adapter/entry-points/console/consoleServer.test.ts +269 -0
- package/src/adapter/entry-points/console/consoleServer.ts +228 -4
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts +26 -0
- package/src/adapter/entry-points/handlers/inTmuxByHumanDataWriter.test.ts +266 -0
- package/src/adapter/entry-points/handlers/inTmuxByHumanDataWriter.ts +103 -0
- package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.test.ts +34 -0
- package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.ts +3 -0
- package/src/domain/usecases/intmux/GenerateInTmuxByHumanDataUseCase.test.ts +285 -0
- package/src/domain/usecases/intmux/GenerateInTmuxByHumanDataUseCase.ts +182 -0
- package/types/adapter/entry-points/cli/index.d.ts.map +1 -1
- package/types/adapter/entry-points/console/consoleDataDelivery.d.ts +23 -0
- package/types/adapter/entry-points/console/consoleDataDelivery.d.ts.map +1 -0
- package/types/adapter/entry-points/console/consoleDoneStore.d.ts +10 -0
- package/types/adapter/entry-points/console/consoleDoneStore.d.ts.map +1 -0
- package/types/adapter/entry-points/console/consoleOperationApi.d.ts +18 -0
- package/types/adapter/entry-points/console/consoleOperationApi.d.ts.map +1 -0
- package/types/adapter/entry-points/console/consoleReadApi.d.ts +44 -0
- package/types/adapter/entry-points/console/consoleReadApi.d.ts.map +1 -0
- package/types/adapter/entry-points/console/consoleServer.d.ts +8 -1
- package/types/adapter/entry-points/console/consoleServer.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/inTmuxByHumanDataWriter.d.ts +16 -0
- package/types/adapter/entry-points/handlers/inTmuxByHumanDataWriter.d.ts.map +1 -0
- package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/intmux/GenerateInTmuxByHumanDataUseCase.d.ts +57 -0
- package/types/domain/usecases/intmux/GenerateInTmuxByHumanDataUseCase.d.ts.map +1 -0
|
@@ -1876,6 +1876,40 @@ describe('NotifyFinishedIssuePreparationUseCase', () => {
|
|
|
1876
1876
|
);
|
|
1877
1877
|
});
|
|
1878
1878
|
|
|
1879
|
+
it('should not call setDependedIssueUrl when issue is a PR and the resolved PR URL matches the issue URL (self-reference prevention)', async () => {
|
|
1880
|
+
const prUrl = 'https://github.com/user/repo/pull/77';
|
|
1881
|
+
const prIssue = createMockIssue({
|
|
1882
|
+
url: prUrl,
|
|
1883
|
+
status: 'Preparation',
|
|
1884
|
+
isPr: true,
|
|
1885
|
+
});
|
|
1886
|
+
|
|
1887
|
+
mockProjectRepository.getByUrl.mockResolvedValue(mockProject);
|
|
1888
|
+
mockIssueRepository.get.mockResolvedValue(prIssue);
|
|
1889
|
+
mockIssueCommentRepository.getCommentsFromIssue.mockResolvedValue([
|
|
1890
|
+
createMockComment({ content: 'From: :robot: Agent report' }),
|
|
1891
|
+
]);
|
|
1892
|
+
mockIssueRepository.getOpenPullRequest.mockResolvedValue({
|
|
1893
|
+
url: prUrl,
|
|
1894
|
+
isConflicted: false,
|
|
1895
|
+
isPassedAllCiJob: true,
|
|
1896
|
+
isCiStateSuccess: true,
|
|
1897
|
+
isResolvedAllReviewComments: true,
|
|
1898
|
+
isBranchOutOfDate: false,
|
|
1899
|
+
missingRequiredCheckNames: [],
|
|
1900
|
+
});
|
|
1901
|
+
|
|
1902
|
+
await useCase.run({
|
|
1903
|
+
projectUrl: 'https://github.com/users/user/projects/1',
|
|
1904
|
+
issueUrl: prUrl,
|
|
1905
|
+
thresholdForAutoReject: 3,
|
|
1906
|
+
workflowBlockerResolvedWebhookUrl: null,
|
|
1907
|
+
allowedIssueAuthors: null,
|
|
1908
|
+
});
|
|
1909
|
+
|
|
1910
|
+
expect(mockIssueRepository.setDependedIssueUrl).not.toHaveBeenCalled();
|
|
1911
|
+
});
|
|
1912
|
+
|
|
1879
1913
|
it('should log a warning and skip setDependedIssueUrl when dependedIssueUrlSeparatedByComma is not configured in project', async () => {
|
|
1880
1914
|
const projectWithoutDependedField = createMockProject({
|
|
1881
1915
|
dependedIssueUrlSeparatedByComma: null,
|
|
@@ -360,6 +360,9 @@ export class NotifyFinishedIssuePreparationUseCase {
|
|
|
360
360
|
? await this.resolveOpenPrsForPrItem(issue.url)
|
|
361
361
|
: await this.issueRepository.findRelatedOpenPRs(issue.url);
|
|
362
362
|
for (const pr of openPRs) {
|
|
363
|
+
if (pr.url === issueUrl) {
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
363
366
|
await this.issueRepository.setDependedIssueUrl(pr.url, project, issueUrl);
|
|
364
367
|
}
|
|
365
368
|
};
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { Issue } from '../../entities/Issue';
|
|
2
|
+
import { FieldOption, Project } from '../../entities/Project';
|
|
3
|
+
import { GenerateInTmuxByHumanDataUseCase } from './GenerateInTmuxByHumanDataUseCase';
|
|
4
|
+
|
|
5
|
+
const ASSIGNEE = 'owner-login';
|
|
6
|
+
const CONSOLE_BASE_URL = 'https://console.example.test';
|
|
7
|
+
const CONSOLE_TOKEN = 'test-token-value';
|
|
8
|
+
|
|
9
|
+
const storyOption = (
|
|
10
|
+
id: string,
|
|
11
|
+
name: string,
|
|
12
|
+
color: FieldOption['color'],
|
|
13
|
+
): FieldOption => ({ id, name, color, description: '' });
|
|
14
|
+
|
|
15
|
+
const STORY_OPTIONS: FieldOption[] = [
|
|
16
|
+
storyOption('s1', 'Story Alpha', 'BLUE'),
|
|
17
|
+
storyOption('s2', 'Story Beta', 'GREEN'),
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const STATUS_OPTIONS: FieldOption[] = [
|
|
21
|
+
storyOption('st-unread', 'Unread', 'ORANGE'),
|
|
22
|
+
storyOption('st-tmux', 'In Tmux by human', 'RED'),
|
|
23
|
+
storyOption('st-done', 'Done', 'PURPLE'),
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const baseProject = (story: Project['story']): Project => ({
|
|
27
|
+
id: 'project-node-id',
|
|
28
|
+
url: 'https://github.com/orgs/demo/projects/1',
|
|
29
|
+
databaseId: 1,
|
|
30
|
+
name: 'demo',
|
|
31
|
+
status: {
|
|
32
|
+
name: 'Status',
|
|
33
|
+
fieldId: 'status-field',
|
|
34
|
+
statuses: STATUS_OPTIONS,
|
|
35
|
+
},
|
|
36
|
+
nextActionDate: null,
|
|
37
|
+
nextActionHour: null,
|
|
38
|
+
story,
|
|
39
|
+
remainingEstimationMinutes: null,
|
|
40
|
+
dependedIssueUrlSeparatedByComma: null,
|
|
41
|
+
completionDate50PercentConfidence: null,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const projectWithStory: Project = baseProject({
|
|
45
|
+
name: 'story',
|
|
46
|
+
fieldId: 'story-field',
|
|
47
|
+
databaseId: 2,
|
|
48
|
+
stories: STORY_OPTIONS,
|
|
49
|
+
workflowManagementStory: { id: 'wm', name: 'workflow management' },
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const projectWithoutStory: Project = baseProject(null);
|
|
53
|
+
|
|
54
|
+
let issueCounter = 0;
|
|
55
|
+
const makeIssue = (overrides: Partial<Issue>): Issue => {
|
|
56
|
+
issueCounter += 1;
|
|
57
|
+
return {
|
|
58
|
+
nameWithOwner: 'demo/repo',
|
|
59
|
+
number: issueCounter,
|
|
60
|
+
title: `Issue ${issueCounter}`,
|
|
61
|
+
state: 'OPEN',
|
|
62
|
+
status: 'In Tmux by human',
|
|
63
|
+
story: null,
|
|
64
|
+
nextActionDate: null,
|
|
65
|
+
nextActionHour: null,
|
|
66
|
+
estimationMinutes: null,
|
|
67
|
+
dependedIssueUrls: [],
|
|
68
|
+
completionDate50PercentConfidence: null,
|
|
69
|
+
url: `https://github.com/demo/repo/issues/${issueCounter}`,
|
|
70
|
+
assignees: [ASSIGNEE],
|
|
71
|
+
labels: [],
|
|
72
|
+
org: 'demo',
|
|
73
|
+
repo: 'repo',
|
|
74
|
+
body: 'should never be projected',
|
|
75
|
+
itemId: `item-${issueCounter}`,
|
|
76
|
+
isPr: false,
|
|
77
|
+
isInProgress: false,
|
|
78
|
+
isClosed: false,
|
|
79
|
+
createdAt: new Date('2026-06-13T08:18:45.000Z'),
|
|
80
|
+
author: 'someone',
|
|
81
|
+
...overrides,
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
describe('GenerateInTmuxByHumanDataUseCase', () => {
|
|
86
|
+
const usecase = new GenerateInTmuxByHumanDataUseCase();
|
|
87
|
+
|
|
88
|
+
beforeEach(() => {
|
|
89
|
+
issueCounter = 0;
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const run = (
|
|
93
|
+
issues: Issue[],
|
|
94
|
+
overrides: {
|
|
95
|
+
project?: Project;
|
|
96
|
+
consoleBaseUrl?: string | null;
|
|
97
|
+
consoleToken?: string | null;
|
|
98
|
+
} = {},
|
|
99
|
+
) =>
|
|
100
|
+
usecase.run({
|
|
101
|
+
project: overrides.project ?? projectWithStory,
|
|
102
|
+
issues,
|
|
103
|
+
pjcode: 'demo',
|
|
104
|
+
assigneeLogin: ASSIGNEE,
|
|
105
|
+
org: 'demo-org',
|
|
106
|
+
repo: 'demo-repo',
|
|
107
|
+
consoleBaseUrl:
|
|
108
|
+
overrides.consoleBaseUrl === undefined
|
|
109
|
+
? CONSOLE_BASE_URL
|
|
110
|
+
: overrides.consoleBaseUrl,
|
|
111
|
+
consoleToken:
|
|
112
|
+
overrides.consoleToken === undefined
|
|
113
|
+
? CONSOLE_TOKEN
|
|
114
|
+
: overrides.consoleToken,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
describe('item filter', () => {
|
|
118
|
+
it('keeps In Tmux by human open issues assigned to the assignee login', () => {
|
|
119
|
+
const result = run([makeIssue({ story: 'Story Alpha' })]);
|
|
120
|
+
expect(result.v1).toEqual([
|
|
121
|
+
{
|
|
122
|
+
story: 'Story Alpha',
|
|
123
|
+
urls: ['https://github.com/demo/repo/issues/1'],
|
|
124
|
+
},
|
|
125
|
+
]);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('rejects issues whose status is not In Tmux by human', () => {
|
|
129
|
+
const result = run([makeIssue({ status: 'Unread' })]);
|
|
130
|
+
expect(result.v1).toEqual([]);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it('rejects closed issues', () => {
|
|
134
|
+
const result = run([makeIssue({ isClosed: true })]);
|
|
135
|
+
expect(result.v1).toEqual([]);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('rejects issues not assigned to the assignee login', () => {
|
|
139
|
+
const result = run([makeIssue({ assignees: ['other-person'] })]);
|
|
140
|
+
expect(result.v1).toEqual([]);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
describe('story grouping and ordering', () => {
|
|
145
|
+
it('orders groups by the project story option display order', () => {
|
|
146
|
+
const result = run([
|
|
147
|
+
makeIssue({ story: 'Story Beta' }),
|
|
148
|
+
makeIssue({ story: 'Story Alpha' }),
|
|
149
|
+
]);
|
|
150
|
+
expect(result.v2.map((group) => group.story)).toEqual([
|
|
151
|
+
'Story Alpha',
|
|
152
|
+
'Story Beta',
|
|
153
|
+
]);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('places stories not present in the story options at the tail ordered by story string', () => {
|
|
157
|
+
const result = run([
|
|
158
|
+
makeIssue({ story: 'zzz unknown' }),
|
|
159
|
+
makeIssue({ story: 'Story Alpha' }),
|
|
160
|
+
makeIssue({ story: 'aaa unknown' }),
|
|
161
|
+
]);
|
|
162
|
+
expect(result.v2.map((group) => group.story)).toEqual([
|
|
163
|
+
'Story Alpha',
|
|
164
|
+
'aaa unknown',
|
|
165
|
+
'zzz unknown',
|
|
166
|
+
]);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('maps a null story to the empty string group', () => {
|
|
170
|
+
const result = run([makeIssue({ story: null })]);
|
|
171
|
+
expect(result.v1.map((group) => group.story)).toEqual(['']);
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it('keeps input order of issues within a group', () => {
|
|
175
|
+
const result = run([
|
|
176
|
+
makeIssue({ story: 'Story Alpha' }),
|
|
177
|
+
makeIssue({ story: 'Story Alpha' }),
|
|
178
|
+
]);
|
|
179
|
+
expect(result.v2[0].urls).toEqual([
|
|
180
|
+
{
|
|
181
|
+
url: 'https://github.com/demo/repo/issues/1',
|
|
182
|
+
title: 'Issue 1',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
url: 'https://github.com/demo/repo/issues/2',
|
|
186
|
+
title: 'Issue 2',
|
|
187
|
+
},
|
|
188
|
+
]);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('uses an empty story order when the project has no story field', () => {
|
|
192
|
+
const result = run([makeIssue({ story: 'whatever' })], {
|
|
193
|
+
project: projectWithoutStory,
|
|
194
|
+
});
|
|
195
|
+
expect(result.v2.map((group) => group.story)).toEqual(['whatever']);
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
describe('v3 document', () => {
|
|
200
|
+
it('builds version 3 with overviewUrl from the project and a token-free console url', () => {
|
|
201
|
+
const result = run([makeIssue({ story: 'Story Alpha' })]);
|
|
202
|
+
expect(result.v3).toEqual({
|
|
203
|
+
version: 3,
|
|
204
|
+
overviewUrl: 'https://github.com/orgs/demo/projects/1',
|
|
205
|
+
tdpmConsoleUrl: 'https://console.example.test/projects/demo/prs',
|
|
206
|
+
groups: result.v2,
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
it('is null when the console base url is unset', () => {
|
|
211
|
+
const result = run([makeIssue({ story: 'Story Alpha' })], {
|
|
212
|
+
consoleBaseUrl: null,
|
|
213
|
+
});
|
|
214
|
+
expect(result.v3).toBeNull();
|
|
215
|
+
expect(result.v4).toBeNull();
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
describe('v4 document', () => {
|
|
220
|
+
it('builds version 4 with key order version, overviewUrl, tdpmConsoleUrl, newIssueUrl, groups', () => {
|
|
221
|
+
const result = run([makeIssue({ story: 'Story Alpha' })]);
|
|
222
|
+
expect(result.v4).not.toBeNull();
|
|
223
|
+
expect(Object.keys(result.v4 ?? {})).toEqual([
|
|
224
|
+
'version',
|
|
225
|
+
'overviewUrl',
|
|
226
|
+
'tdpmConsoleUrl',
|
|
227
|
+
'newIssueUrl',
|
|
228
|
+
'groups',
|
|
229
|
+
]);
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
it('embeds the token in the console url and derives the new issue url from org and repo', () => {
|
|
233
|
+
const result = run([makeIssue({ story: 'Story Alpha' })]);
|
|
234
|
+
expect(result.v4).toEqual({
|
|
235
|
+
version: 4,
|
|
236
|
+
overviewUrl: 'https://github.com/orgs/demo/projects/1',
|
|
237
|
+
tdpmConsoleUrl:
|
|
238
|
+
'https://console.example.test/projects/demo/prs?k=test-token-value',
|
|
239
|
+
newIssueUrl:
|
|
240
|
+
'https://github.com/demo-org/demo-repo/issues/new?assignees=owner-login',
|
|
241
|
+
groups: [
|
|
242
|
+
{
|
|
243
|
+
story: 'Story Alpha',
|
|
244
|
+
sessions: [
|
|
245
|
+
{
|
|
246
|
+
name: 'https://github.com/demo/repo/issues/1',
|
|
247
|
+
description: 'Issue 1',
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
],
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it('maps each session to the issue url as name and the issue title as description', () => {
|
|
256
|
+
const result = run([
|
|
257
|
+
makeIssue({ story: 'Story Alpha' }),
|
|
258
|
+
makeIssue({ story: 'Story Alpha' }),
|
|
259
|
+
]);
|
|
260
|
+
expect(result.v4?.groups).toEqual([
|
|
261
|
+
{
|
|
262
|
+
story: 'Story Alpha',
|
|
263
|
+
sessions: [
|
|
264
|
+
{
|
|
265
|
+
name: 'https://github.com/demo/repo/issues/1',
|
|
266
|
+
description: 'Issue 1',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'https://github.com/demo/repo/issues/2',
|
|
270
|
+
description: 'Issue 2',
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
},
|
|
274
|
+
]);
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it('is null when the console token is unset while v3 is still produced', () => {
|
|
278
|
+
const result = run([makeIssue({ story: 'Story Alpha' })], {
|
|
279
|
+
consoleToken: null,
|
|
280
|
+
});
|
|
281
|
+
expect(result.v4).toBeNull();
|
|
282
|
+
expect(result.v3).not.toBeNull();
|
|
283
|
+
});
|
|
284
|
+
});
|
|
285
|
+
});
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { Issue } from '../../entities/Issue';
|
|
2
|
+
import { FieldOption, Project } from '../../entities/Project';
|
|
3
|
+
|
|
4
|
+
export type InTmuxByHumanUrlEntry = {
|
|
5
|
+
url: string;
|
|
6
|
+
title: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type InTmuxByHumanGroupV1 = {
|
|
10
|
+
story: string;
|
|
11
|
+
urls: string[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type InTmuxByHumanGroupV2 = {
|
|
15
|
+
story: string;
|
|
16
|
+
urls: InTmuxByHumanUrlEntry[];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type InTmuxByHumanSession = {
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type InTmuxByHumanGroupV4 = {
|
|
25
|
+
story: string;
|
|
26
|
+
sessions: InTmuxByHumanSession[];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type InTmuxByHumanV3 = {
|
|
30
|
+
version: 3;
|
|
31
|
+
overviewUrl: string;
|
|
32
|
+
tdpmConsoleUrl: string;
|
|
33
|
+
groups: InTmuxByHumanGroupV2[];
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type InTmuxByHumanV4 = {
|
|
37
|
+
version: 4;
|
|
38
|
+
overviewUrl: string;
|
|
39
|
+
tdpmConsoleUrl: string;
|
|
40
|
+
newIssueUrl: string;
|
|
41
|
+
groups: InTmuxByHumanGroupV4[];
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type InTmuxByHumanData = {
|
|
45
|
+
v1: InTmuxByHumanGroupV1[];
|
|
46
|
+
v2: InTmuxByHumanGroupV2[];
|
|
47
|
+
v3: InTmuxByHumanV3 | null;
|
|
48
|
+
v4: InTmuxByHumanV4 | null;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type GenerateInTmuxByHumanDataInput = {
|
|
52
|
+
project: Project;
|
|
53
|
+
issues: Issue[];
|
|
54
|
+
pjcode: string;
|
|
55
|
+
assigneeLogin: string;
|
|
56
|
+
org: string;
|
|
57
|
+
repo: string;
|
|
58
|
+
consoleBaseUrl: string | null;
|
|
59
|
+
consoleToken: string | null;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type InTmuxByHumanStoryGroup = {
|
|
63
|
+
story: string;
|
|
64
|
+
issues: Issue[];
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const IN_TMUX_BY_HUMAN_STATUS_NAME = 'In Tmux by human';
|
|
68
|
+
const UNKNOWN_STORY_SORT_INDEX = 999999;
|
|
69
|
+
|
|
70
|
+
export class GenerateInTmuxByHumanDataUseCase {
|
|
71
|
+
run = (input: GenerateInTmuxByHumanDataInput): InTmuxByHumanData => {
|
|
72
|
+
const {
|
|
73
|
+
project,
|
|
74
|
+
issues,
|
|
75
|
+
pjcode,
|
|
76
|
+
assigneeLogin,
|
|
77
|
+
org,
|
|
78
|
+
repo,
|
|
79
|
+
consoleBaseUrl,
|
|
80
|
+
consoleToken,
|
|
81
|
+
} = input;
|
|
82
|
+
|
|
83
|
+
const storyOrder = project.story
|
|
84
|
+
? project.story.stories.map((option: FieldOption) => option.name)
|
|
85
|
+
: [];
|
|
86
|
+
|
|
87
|
+
const selectedIssues = issues.filter((issue) =>
|
|
88
|
+
this.isInTmuxByHuman(issue, assigneeLogin),
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
const groups = this.groupByStoryOrder(selectedIssues, storyOrder);
|
|
92
|
+
|
|
93
|
+
const v2: InTmuxByHumanGroupV2[] = groups.map((group) => ({
|
|
94
|
+
story: group.story,
|
|
95
|
+
urls: group.issues.map((issue) => ({
|
|
96
|
+
url: issue.url,
|
|
97
|
+
title: issue.title,
|
|
98
|
+
})),
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
const v1: InTmuxByHumanGroupV1[] = groups.map((group) => ({
|
|
102
|
+
story: group.story,
|
|
103
|
+
urls: group.issues.map((issue) => issue.url),
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
const v4Groups: InTmuxByHumanGroupV4[] = groups.map((group) => ({
|
|
107
|
+
story: group.story,
|
|
108
|
+
sessions: group.issues.map((issue) => ({
|
|
109
|
+
name: issue.url,
|
|
110
|
+
description: issue.title,
|
|
111
|
+
})),
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
const overviewUrl = project.url;
|
|
115
|
+
const tdpmConsoleUrl = consoleBaseUrl
|
|
116
|
+
? `${consoleBaseUrl}/projects/${pjcode}/prs`
|
|
117
|
+
: null;
|
|
118
|
+
|
|
119
|
+
const v3: InTmuxByHumanV3 | null = tdpmConsoleUrl
|
|
120
|
+
? {
|
|
121
|
+
version: 3,
|
|
122
|
+
overviewUrl,
|
|
123
|
+
tdpmConsoleUrl,
|
|
124
|
+
groups: v2,
|
|
125
|
+
}
|
|
126
|
+
: null;
|
|
127
|
+
|
|
128
|
+
const v4: InTmuxByHumanV4 | null =
|
|
129
|
+
tdpmConsoleUrl && consoleToken
|
|
130
|
+
? {
|
|
131
|
+
version: 4,
|
|
132
|
+
overviewUrl,
|
|
133
|
+
tdpmConsoleUrl: `${tdpmConsoleUrl}?k=${consoleToken}`,
|
|
134
|
+
newIssueUrl: `https://github.com/${org}/${repo}/issues/new?assignees=${assigneeLogin}`,
|
|
135
|
+
groups: v4Groups,
|
|
136
|
+
}
|
|
137
|
+
: null;
|
|
138
|
+
|
|
139
|
+
return { v1, v2, v3, v4 };
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
private isInTmuxByHuman = (issue: Issue, assigneeLogin: string): boolean =>
|
|
143
|
+
issue.status === IN_TMUX_BY_HUMAN_STATUS_NAME &&
|
|
144
|
+
issue.isClosed === false &&
|
|
145
|
+
issue.assignees.includes(assigneeLogin);
|
|
146
|
+
|
|
147
|
+
private groupByStoryOrder = (
|
|
148
|
+
issues: Issue[],
|
|
149
|
+
storyOrder: string[],
|
|
150
|
+
): InTmuxByHumanStoryGroup[] => {
|
|
151
|
+
const indexByStory = new Map(
|
|
152
|
+
storyOrder.map((name, index) => [name, index]),
|
|
153
|
+
);
|
|
154
|
+
const issuesByStory = new Map<string, Issue[]>();
|
|
155
|
+
for (const issue of issues) {
|
|
156
|
+
const story = issue.story ?? '';
|
|
157
|
+
const existing = issuesByStory.get(story);
|
|
158
|
+
if (existing) {
|
|
159
|
+
existing.push(issue);
|
|
160
|
+
} else {
|
|
161
|
+
issuesByStory.set(story, [issue]);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return [...issuesByStory.entries()]
|
|
165
|
+
.map(([story, groupedIssues]) => ({
|
|
166
|
+
story,
|
|
167
|
+
issues: groupedIssues,
|
|
168
|
+
sortIndex: indexByStory.get(story) ?? UNKNOWN_STORY_SORT_INDEX,
|
|
169
|
+
}))
|
|
170
|
+
.sort((left, right) =>
|
|
171
|
+
left.sortIndex !== right.sortIndex
|
|
172
|
+
? left.sortIndex - right.sortIndex
|
|
173
|
+
: left.story < right.story
|
|
174
|
+
? -1
|
|
175
|
+
: 1,
|
|
176
|
+
)
|
|
177
|
+
.map(({ story, issues: groupedIssues }) => ({
|
|
178
|
+
story,
|
|
179
|
+
issues: groupedIssues,
|
|
180
|
+
}));
|
|
181
|
+
};
|
|
182
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,UAAU,EACV,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,UAAU,EACV,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAiFzB,eAAO,MAAM,OAAO,SAAgB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const CONSOLE_LIST_TAB_NAMES: string[];
|
|
2
|
+
export type ConsoleDataRoute = {
|
|
3
|
+
kind: 'list';
|
|
4
|
+
pjcode: string;
|
|
5
|
+
tab: string;
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'detail';
|
|
8
|
+
pjcode: string;
|
|
9
|
+
tab: string;
|
|
10
|
+
key: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'in-tmux';
|
|
13
|
+
pjcode: string;
|
|
14
|
+
relativePath: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const parseConsoleDataRoute: (requestPath: string) => ConsoleDataRoute | null;
|
|
17
|
+
export type ConsoleDataResponse = {
|
|
18
|
+
statusCode: number;
|
|
19
|
+
contentType: string;
|
|
20
|
+
body: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const buildConsoleDataResponse: (consoleDataOutputDir: string, route: ConsoleDataRoute) => ConsoleDataResponse;
|
|
23
|
+
//# sourceMappingURL=consoleDataDelivery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consoleDataDelivery.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleDataDelivery.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,EAAE,MAAM,EAM1C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAO9D,eAAO,MAAM,qBAAqB,GAChC,aAAa,MAAM,KAClB,gBAAgB,GAAG,IAoCrB,CAAC;AA0CF,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,sBAAsB,MAAM,EAC5B,OAAO,gBAAgB,KACtB,mBA6CF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const CONSOLE_DONE_FILE_NAME = ".done.json";
|
|
2
|
+
export type ConsoleDoneRecord = {
|
|
3
|
+
projectItemIds: string[];
|
|
4
|
+
};
|
|
5
|
+
export declare const doneFilePathForTab: (consoleDataOutputDir: string, pjcode: string, tab: string) => string;
|
|
6
|
+
export declare const readDoneProjectItemIds: (consoleDataOutputDir: string, pjcode: string, tab: string) => string[];
|
|
7
|
+
export declare const recordDoneProjectItemId: (consoleDataOutputDir: string, pjcode: string, tab: string, projectItemId: string) => void;
|
|
8
|
+
export declare const CONSOLE_DONE_TAB_NAMES: string[];
|
|
9
|
+
export declare const recordDoneProjectItemIdAcrossTabs: (consoleDataOutputDir: string, pjcode: string, projectItemId: string) => void;
|
|
10
|
+
//# sourceMappingURL=consoleDoneStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consoleDoneStore.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleDoneStore.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,eAAe,CAAC;AAEnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAqBF,eAAO,MAAM,kBAAkB,GAC7B,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,KAAK,MAAM,KACV,MACmE,CAAC;AAEvE,eAAO,MAAM,sBAAsB,GACjC,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,KAAK,MAAM,KACV,MAAM,EASR,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,KAAK,MAAM,EACX,eAAe,MAAM,KACpB,IAgBF,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,EAO1C,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,eAAe,MAAM,KACpB,IAIF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IssueRepository } from '../../../domain/usecases/adapter-interfaces/IssueRepository';
|
|
2
|
+
import { Project } from '../../../domain/entities/Project';
|
|
3
|
+
export declare const AWAITING_WORKSPACE_STATUS_NAME = "awaiting workspace";
|
|
4
|
+
export declare const IN_TMUX_BY_HUMAN_STATUS_NAME = "in tmux by human";
|
|
5
|
+
export type ConsoleOperationContext = {
|
|
6
|
+
issueRepository: IssueRepository;
|
|
7
|
+
project: Project;
|
|
8
|
+
consoleDataOutputDir: string | null;
|
|
9
|
+
pjcode: string | null;
|
|
10
|
+
};
|
|
11
|
+
export type ConsoleOperationResponse = {
|
|
12
|
+
statusCode: number;
|
|
13
|
+
body: unknown;
|
|
14
|
+
};
|
|
15
|
+
export declare const handleReview: (context: ConsoleOperationContext, body: Record<string, unknown>) => Promise<ConsoleOperationResponse>;
|
|
16
|
+
export declare const handleTriage: (context: ConsoleOperationContext, body: Record<string, unknown>) => Promise<ConsoleOperationResponse>;
|
|
17
|
+
export declare const handleIntmux: (context: ConsoleOperationContext, body: Record<string, unknown>) => Promise<ConsoleOperationResponse>;
|
|
18
|
+
//# sourceMappingURL=consoleOperationApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consoleOperationApi.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleOperationApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC;AAC9F,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAI3D,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AACnE,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AA0EF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAiElC,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAkFlC,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CA2BlC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IssueRepository } from '../../../domain/usecases/adapter-interfaces/IssueRepository';
|
|
2
|
+
export declare const ISSUE_TITLE_CACHE_TTL_MS: number;
|
|
3
|
+
export type IssueOrPullRequestState = {
|
|
4
|
+
state: string;
|
|
5
|
+
merged: boolean;
|
|
6
|
+
isPullRequest: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare class IssueTitleStateCache {
|
|
9
|
+
private readonly nowMs;
|
|
10
|
+
private readonly entries;
|
|
11
|
+
constructor(nowMs?: () => number);
|
|
12
|
+
get: (url: string) => IssueOrPullRequestState | null;
|
|
13
|
+
set: (url: string, state: IssueOrPullRequestState) => void;
|
|
14
|
+
}
|
|
15
|
+
export type ConsoleReadApiResponse = {
|
|
16
|
+
statusCode: number;
|
|
17
|
+
body: unknown;
|
|
18
|
+
};
|
|
19
|
+
export type RelatedPullRequestWithSummary = {
|
|
20
|
+
url: string;
|
|
21
|
+
branchName: string | null;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
isDraft: boolean;
|
|
24
|
+
isConflicted: boolean;
|
|
25
|
+
isPassedAllCiJob: boolean;
|
|
26
|
+
isCiStateSuccess: boolean;
|
|
27
|
+
isResolvedAllReviewComments: boolean;
|
|
28
|
+
isBranchOutOfDate: boolean;
|
|
29
|
+
missingRequiredCheckNames: string[];
|
|
30
|
+
summary: {
|
|
31
|
+
title: string;
|
|
32
|
+
body: string;
|
|
33
|
+
additions: number;
|
|
34
|
+
deletions: number;
|
|
35
|
+
changedFiles: number;
|
|
36
|
+
} | null;
|
|
37
|
+
};
|
|
38
|
+
export declare const handleItemBody: (issueRepository: IssueRepository, url: string | null) => Promise<ConsoleReadApiResponse>;
|
|
39
|
+
export declare const handleComments: (issueRepository: IssueRepository, url: string | null) => Promise<ConsoleReadApiResponse>;
|
|
40
|
+
export declare const handlePrFiles: (issueRepository: IssueRepository, url: string | null) => Promise<ConsoleReadApiResponse>;
|
|
41
|
+
export declare const handlePrCommits: (issueRepository: IssueRepository, url: string | null) => Promise<ConsoleReadApiResponse>;
|
|
42
|
+
export declare const handleRelatedPrs: (issueRepository: IssueRepository, url: string | null) => Promise<ConsoleReadApiResponse>;
|
|
43
|
+
export declare const handleIssueTitle: (issueRepository: IssueRepository, cache: IssueTitleStateCache, url: string | null) => Promise<ConsoleReadApiResponse>;
|
|
44
|
+
//# sourceMappingURL=consoleReadApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consoleReadApi.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleReadApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,6DAA6D,CAAC;AAErE,eAAO,MAAM,wBAAwB,QAAa,CAAC;AAEnD,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAOF,qBAAa,oBAAoB;IAGnB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2C;gBAEtC,KAAK,GAAE,MAAM,MAAyB;IAEnE,GAAG,GAAI,KAAK,MAAM,KAAG,uBAAuB,GAAG,IAAI,CAYjD;IAEF,GAAG,GAAI,KAAK,MAAM,EAAE,OAAO,uBAAuB,KAAG,IAAI,CAEvD;CACH;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAYF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,2BAA2B,EAAE,OAAO,CAAC;IACrC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,yBAAyB,EAAE,MAAM,EAAE,CAAC;IACpC,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;KACtB,GAAG,IAAI,CAAC;CACV,CAAC;AAqBF,eAAO,MAAM,cAAc,GACzB,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAMhC,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAMhC,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAShC,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAMhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CA2BhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,iBAAiB,eAAe,EAChC,OAAO,oBAAoB,EAC3B,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAWhC,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import * as http from 'http';
|
|
2
|
+
import { IssueRepository } from '../../../domain/usecases/adapter-interfaces/IssueRepository';
|
|
3
|
+
import { Project } from '../../../domain/entities/Project';
|
|
4
|
+
import { IssueTitleStateCache } from './consoleReadApi';
|
|
2
5
|
export declare const DEFAULT_CONSOLE_PORT = 9981;
|
|
3
6
|
export declare const CONSOLE_TOKEN_HEADER = "x-pv-token";
|
|
4
7
|
export declare const hasDotSegment: (requestPath: string) => boolean;
|
|
@@ -9,8 +12,12 @@ export type ConsoleServerOptions = {
|
|
|
9
12
|
accessToken: string;
|
|
10
13
|
uiDistDir: string;
|
|
11
14
|
consoleDataOutputDir: string | null;
|
|
15
|
+
pjcode?: string | null;
|
|
16
|
+
issueRepository?: IssueRepository | null;
|
|
17
|
+
project?: Project | null;
|
|
18
|
+
issueTitleStateCache?: IssueTitleStateCache | null;
|
|
12
19
|
};
|
|
13
|
-
export declare const handleConsoleRequest: (options: ConsoleServerOptions, request: http.IncomingMessage, response: http.ServerResponse) => void
|
|
20
|
+
export declare const handleConsoleRequest: (options: ConsoleServerOptions, request: http.IncomingMessage, response: http.ServerResponse) => Promise<void>;
|
|
14
21
|
export declare const createConsoleServer: (options: ConsoleServerOptions) => http.Server;
|
|
15
22
|
export type StartConsoleServerOptions = ConsoleServerOptions & {
|
|
16
23
|
port: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consoleServer.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"consoleServer.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,OAAO,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC;AAC9F,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAK3D,OAAO,EACL,oBAAoB,EAOrB,MAAM,kBAAkB,CAAC;AAQ1B,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAmCjD,eAAO,MAAM,aAAa,GAAI,aAAa,MAAM,KAAG,OAGiB,CAAC;AAEtE,eAAO,MAAM,aAAa,GAAI,aAAa,MAAM,KAAG,OAGrB,CAAC;AAEhC,eAAO,MAAM,YAAY,GACvB,eAAe,MAAM,EACrB,eAAe,MAAM,GAAG,IAAI,KAC3B,OAAoE,CAAC;AAExE,eAAO,MAAM,oBAAoB,GAC/B,YAAY,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,EACpC,aAAa,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,KACzC,MAAM,GAAG,IAQX,CAAC;AAuCF,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,eAAe,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACpD,CAAC;AA4MF,eAAO,MAAM,oBAAoB,GAC/B,SAAS,oBAAoB,EAC7B,SAAS,IAAI,CAAC,eAAe,EAC7B,UAAU,IAAI,CAAC,cAAc,KAC5B,OAAO,CAAC,IAAI,CA8Dd,CAAC;AAcF,eAAO,MAAM,mBAAmB,GAC9B,SAAS,oBAAoB,KAC5B,IAAI,CAAC,MAMJ,CAAC;AAEL,MAAM,MAAM,yBAAyB,GAAG,oBAAoB,GAAG;IAC7D,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,yBAAyB,KACjC,OAAO,CAAC,IAAI,CAAC,MAAM,CAQlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HandleScheduledEventUseCaseHandler.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HandleScheduledEventUseCaseHandler.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AA8B3D,qBAAa,kCAAkC;IAC7C,MAAM,GACJ,gBAAgB,MAAM,EACtB,UAAU,OAAO,KAChB,OAAO,CAAC;QACT,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,KAAK,EAAE,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,eAAe,EAAE,IAAI,EAAE,CAAC;KACzB,GAAG,IAAI,CAAC,CA4VP;CACH"}
|