github-issue-tower-defence-management 1.86.0 → 1.88.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.
- package/.eslintrc.cjs +5 -1
- package/.github/workflows/console-ui.yml +47 -0
- package/.prettierignore +3 -0
- package/CHANGELOG.md +15 -0
- package/README.md +42 -0
- package/bin/adapter/entry-points/console/ui-dist/assets/index-DFxrSRH4.css +1 -0
- package/bin/adapter/entry-points/console/ui-dist/assets/index-DcOZ02ON.js +49 -0
- package/bin/adapter/entry-points/console/ui-dist/index.html +13 -0
- 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/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +306 -0
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.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 +22 -2
- package/scripts/copyConsoleUiDist.mjs +35 -0
- package/src/adapter/entry-points/console/ui/.storybook/main.ts +12 -0
- package/src/adapter/entry-points/console/ui/.storybook/preview.ts +15 -0
- package/src/adapter/entry-points/console/ui/biome.json +47 -0
- package/src/adapter/entry-points/console/ui/components.json +20 -0
- package/src/adapter/entry-points/console/ui/index.html +12 -0
- package/src/adapter/entry-points/console/ui/src/components/ui/badge.stories.tsx +35 -0
- package/src/adapter/entry-points/console/ui/src/components/ui/badge.tsx +28 -0
- package/src/adapter/entry-points/console/ui/src/components/ui/button.stories.tsx +34 -0
- package/src/adapter/entry-points/console/ui/src/components/ui/button.tsx +50 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleListView.stories.tsx +44 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleListView.tsx +58 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleTabBar.stories.tsx +34 -0
- package/src/adapter/entry-points/console/ui/src/features/console/components/ConsoleTabBar.tsx +32 -0
- package/src/adapter/entry-points/console/ui/src/features/console/fixtures.ts +47 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleList.ts +65 -0
- package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleToken.ts +64 -0
- package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsolePage.tsx +19 -0
- package/src/adapter/entry-points/console/ui/src/features/console/types.ts +69 -0
- package/src/adapter/entry-points/console/ui/src/index.css +31 -0
- package/src/adapter/entry-points/console/ui/src/lib/utils.ts +4 -0
- package/src/adapter/entry-points/console/ui/src/main.tsx +15 -0
- package/src/adapter/entry-points/console/ui/src/vite-env.d.ts +1 -0
- package/src/adapter/entry-points/console/ui/tsconfig.json +24 -0
- package/src/adapter/entry-points/console/ui/vite.config.ts +19 -0
- package/src/adapter/entry-points/console/ui-dist/assets/index-DFxrSRH4.css +1 -0
- package/src/adapter/entry-points/console/ui-dist/assets/index-DcOZ02ON.js +49 -0
- package/src/adapter/entry-points/console/ui-dist/index.html +13 -0
- 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/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.test.ts +630 -0
- package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.ts +492 -0
- package/src/domain/usecases/adapter-interfaces/IssueRepository.ts +51 -0
- package/src/domain/usecases/intmux/GenerateInTmuxByHumanDataUseCase.test.ts +285 -0
- package/src/domain/usecases/intmux/GenerateInTmuxByHumanDataUseCase.ts +182 -0
- package/tsconfig.build.json +7 -1
- package/tsconfig.json +6 -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/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts +18 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts +47 -0
- package/types/domain/usecases/adapter-interfaces/IssueRepository.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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>TDPM Console</title>
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-DcOZ02ON.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DFxrSRH4.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -44,6 +44,7 @@ const typia_1 = __importDefault(require("typia"));
|
|
|
44
44
|
const fs_1 = __importDefault(require("fs"));
|
|
45
45
|
const situationFileWriter_1 = require("./situationFileWriter");
|
|
46
46
|
const consoleListsWriter_1 = require("./consoleListsWriter");
|
|
47
|
+
const inTmuxByHumanDataWriter_1 = require("./inTmuxByHumanDataWriter");
|
|
47
48
|
const rotationOrderFileWriter_1 = require("./rotationOrderFileWriter");
|
|
48
49
|
const projectConfig_1 = require("../cli/projectConfig");
|
|
49
50
|
const SystemDateRepository_1 = require("../../repositories/SystemDateRepository");
|
|
@@ -87,13 +88,13 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
87
88
|
this.handle = async (configFilePath, _verbose) => {
|
|
88
89
|
const configFileContent = fs_1.default.readFileSync(configFilePath, 'utf8');
|
|
89
90
|
const input = yaml_1.default.parse(configFileContent);
|
|
90
|
-
if (!(() => { const _io0 = input => "string" === typeof input.projectName && "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io1(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && "number" === typeof input.allowIssueCacheMinutes && (null === input.labelsAsLlmAgentName || undefined === input.labelsAsLlmAgentName || Array.isArray(input.labelsAsLlmAgentName) && input.labelsAsLlmAgentName.every(elem => "string" === typeof elem)) && (null === input.changeTargetPathAliases || undefined === input.changeTargetPathAliases || "object" === typeof input.changeTargetPathAliases && null !== input.changeTargetPathAliases && false === Array.isArray(input.changeTargetPathAliases) && _io2(input.changeTargetPathAliases)) && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io3(input.startPreparation)) && (undefined === input.thresholdForAutoReject || "number" === typeof input.thresholdForAutoReject) && (null === input.dailySecurityScan || undefined === input.dailySecurityScan || "object" === typeof input.dailySecurityScan && null !== input.dailySecurityScan && _io4(input.dailySecurityScan)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && (undefined === input.consoleDataOutputDir || "string" === typeof input.consoleDataOutputDir) && ("object" === typeof input.credentials && null !== input.credentials && _io5(input.credentials)); const _io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && "string" === typeof input.spreadsheetUrl; const _io2 = input => Object.keys(input).every(key => {
|
|
91
|
+
if (!(() => { const _io0 = input => "string" === typeof input.projectName && "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io1(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && "number" === typeof input.allowIssueCacheMinutes && (null === input.labelsAsLlmAgentName || undefined === input.labelsAsLlmAgentName || Array.isArray(input.labelsAsLlmAgentName) && input.labelsAsLlmAgentName.every(elem => "string" === typeof elem)) && (null === input.changeTargetPathAliases || undefined === input.changeTargetPathAliases || "object" === typeof input.changeTargetPathAliases && null !== input.changeTargetPathAliases && false === Array.isArray(input.changeTargetPathAliases) && _io2(input.changeTargetPathAliases)) && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io3(input.startPreparation)) && (undefined === input.thresholdForAutoReject || "number" === typeof input.thresholdForAutoReject) && (null === input.dailySecurityScan || undefined === input.dailySecurityScan || "object" === typeof input.dailySecurityScan && null !== input.dailySecurityScan && _io4(input.dailySecurityScan)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && (undefined === input.consoleDataOutputDir || "string" === typeof input.consoleDataOutputDir) && (undefined === input.inTmuxDataOutputDir || "string" === typeof input.inTmuxDataOutputDir) && (undefined === input.inTmuxConsoleBaseUrl || "string" === typeof input.inTmuxConsoleBaseUrl) && (undefined === input.inTmuxConsoleToken || "string" === typeof input.inTmuxConsoleToken) && (undefined === input.inTmuxProjectOrder || Array.isArray(input.inTmuxProjectOrder) && input.inTmuxProjectOrder.every(elem => "string" === typeof elem)) && ("object" === typeof input.credentials && null !== input.credentials && _io5(input.credentials)); const _io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && "string" === typeof input.spreadsheetUrl; const _io2 = input => Object.keys(input).every(key => {
|
|
91
92
|
const value = input[key];
|
|
92
93
|
if (undefined === value)
|
|
93
94
|
return true;
|
|
94
95
|
return "string" === typeof value;
|
|
95
96
|
}); const _io3 = input => "string" === typeof input.defaultAgentName && (null === input.defaultLlmModelName || undefined === input.defaultLlmModelName || "string" === typeof input.defaultLlmModelName) && (null === input.fallbackLlmModelName || undefined === input.fallbackLlmModelName || "string" === typeof input.fallbackLlmModelName) && (null === input.defaultLlmAgentName || undefined === input.defaultLlmAgentName || "string" === typeof input.defaultLlmAgentName) && "string" === typeof input.configFilePath && (null === input.maximumPreparingIssuesCount || "number" === typeof input.maximumPreparingIssuesCount) && (undefined === input.utilizationPercentageThreshold || "number" === typeof input.utilizationPercentageThreshold) && (null === input.allowedIssueAuthors || undefined === input.allowedIssueAuthors || Array.isArray(input.allowedIssueAuthors) && input.allowedIssueAuthors.every(elem => "string" === typeof elem)) && (undefined === input.preparationProcessCheckCommand || "string" === typeof input.preparationProcessCheckCommand) && (null === input.codexHomeCandidates || undefined === input.codexHomeCandidates || Array.isArray(input.codexHomeCandidates) && input.codexHomeCandidates.every(elem => "string" === typeof elem)) && (undefined === input.awLogDirectoryPath || "string" === typeof input.awLogDirectoryPath) && (undefined === input.awLogStaleThresholdMinutes || "number" === typeof input.awLogStaleThresholdMinutes) && (null === input.awaitingQualityCheckStatus || undefined === input.awaitingQualityCheckStatus || "string" === typeof input.awaitingQualityCheckStatus) && (null === input.labelsAsLlmAgentName || undefined === input.labelsAsLlmAgentName || Array.isArray(input.labelsAsLlmAgentName) && input.labelsAsLlmAgentName.every(elem => "string" === typeof elem)); const _io4 = input => "string" === typeof input.scanBaseDirectory && "number" === typeof input.targetHourUtc && (undefined === input.enableKevNvdReport || "boolean" === typeof input.enableKevNvdReport) && (undefined === input.kevReportRepo || "string" === typeof input.kevReportRepo); const _io5 = input => "object" === typeof input.manager && null !== input.manager && _io6(input.manager) && ("object" === typeof input.bot && null !== input.bot && _io10(input.bot)); const _io6 = input => "object" === typeof input.github && null !== input.github && _io7(input.github) && ("object" === typeof input.slack && null !== input.slack && _io8(input.slack)) && ("object" === typeof input.googleServiceAccount && null !== input.googleServiceAccount && _io9(input.googleServiceAccount)); const _io7 = input => "string" === typeof input.token; const _io8 = input => "string" === typeof input.userToken; const _io9 = input => "string" === typeof input.serviceAccountKey; const _io10 = input => "object" === typeof input.github && null !== input.github && _io11(input.github); const _io11 = input => "string" === typeof input.token; return input => "object" === typeof input && null !== input && _io0(input); })()(input)) {
|
|
96
|
-
throw new Error(`Invalid input: ${JSON.stringify(input)}\n\n${JSON.stringify((() => { const _io0 = input => "string" === typeof input.projectName && "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io1(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && "number" === typeof input.allowIssueCacheMinutes && (null === input.labelsAsLlmAgentName || undefined === input.labelsAsLlmAgentName || Array.isArray(input.labelsAsLlmAgentName) && input.labelsAsLlmAgentName.every(elem => "string" === typeof elem)) && (null === input.changeTargetPathAliases || undefined === input.changeTargetPathAliases || "object" === typeof input.changeTargetPathAliases && null !== input.changeTargetPathAliases && false === Array.isArray(input.changeTargetPathAliases) && _io2(input.changeTargetPathAliases)) && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io3(input.startPreparation)) && (undefined === input.thresholdForAutoReject || "number" === typeof input.thresholdForAutoReject) && (null === input.dailySecurityScan || undefined === input.dailySecurityScan || "object" === typeof input.dailySecurityScan && null !== input.dailySecurityScan && _io4(input.dailySecurityScan)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && (undefined === input.consoleDataOutputDir || "string" === typeof input.consoleDataOutputDir) && ("object" === typeof input.credentials && null !== input.credentials && _io5(input.credentials)); const _io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && "string" === typeof input.spreadsheetUrl; const _io2 = input => Object.keys(input).every(key => {
|
|
97
|
+
throw new Error(`Invalid input: ${JSON.stringify(input)}\n\n${JSON.stringify((() => { const _io0 = input => "string" === typeof input.projectName && "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io1(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && "number" === typeof input.allowIssueCacheMinutes && (null === input.labelsAsLlmAgentName || undefined === input.labelsAsLlmAgentName || Array.isArray(input.labelsAsLlmAgentName) && input.labelsAsLlmAgentName.every(elem => "string" === typeof elem)) && (null === input.changeTargetPathAliases || undefined === input.changeTargetPathAliases || "object" === typeof input.changeTargetPathAliases && null !== input.changeTargetPathAliases && false === Array.isArray(input.changeTargetPathAliases) && _io2(input.changeTargetPathAliases)) && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io3(input.startPreparation)) && (undefined === input.thresholdForAutoReject || "number" === typeof input.thresholdForAutoReject) && (null === input.dailySecurityScan || undefined === input.dailySecurityScan || "object" === typeof input.dailySecurityScan && null !== input.dailySecurityScan && _io4(input.dailySecurityScan)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && (undefined === input.consoleDataOutputDir || "string" === typeof input.consoleDataOutputDir) && (undefined === input.inTmuxDataOutputDir || "string" === typeof input.inTmuxDataOutputDir) && (undefined === input.inTmuxConsoleBaseUrl || "string" === typeof input.inTmuxConsoleBaseUrl) && (undefined === input.inTmuxConsoleToken || "string" === typeof input.inTmuxConsoleToken) && (undefined === input.inTmuxProjectOrder || Array.isArray(input.inTmuxProjectOrder) && input.inTmuxProjectOrder.every(elem => "string" === typeof elem)) && ("object" === typeof input.credentials && null !== input.credentials && _io5(input.credentials)); const _io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && "string" === typeof input.spreadsheetUrl; const _io2 = input => Object.keys(input).every(key => {
|
|
97
98
|
const value = input[key];
|
|
98
99
|
if (undefined === value)
|
|
99
100
|
return true;
|
|
@@ -138,8 +139,8 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
138
139
|
path: _path + ".labelsAsLlmAgentName",
|
|
139
140
|
expected: "(Array<string> | null | undefined)",
|
|
140
141
|
value: input.labelsAsLlmAgentName
|
|
141
|
-
})) && input.labelsAsLlmAgentName.map((elem,
|
|
142
|
-
path: _path + ".labelsAsLlmAgentName[" +
|
|
142
|
+
})) && input.labelsAsLlmAgentName.map((elem, _index7) => "string" === typeof elem || _report(_exceptionable, {
|
|
143
|
+
path: _path + ".labelsAsLlmAgentName[" + _index7 + "]",
|
|
143
144
|
expected: "string",
|
|
144
145
|
value: elem
|
|
145
146
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -182,6 +183,30 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
182
183
|
path: _path + ".consoleDataOutputDir",
|
|
183
184
|
expected: "(string | undefined)",
|
|
184
185
|
value: input.consoleDataOutputDir
|
|
186
|
+
}), undefined === input.inTmuxDataOutputDir || "string" === typeof input.inTmuxDataOutputDir || _report(_exceptionable, {
|
|
187
|
+
path: _path + ".inTmuxDataOutputDir",
|
|
188
|
+
expected: "(string | undefined)",
|
|
189
|
+
value: input.inTmuxDataOutputDir
|
|
190
|
+
}), undefined === input.inTmuxConsoleBaseUrl || "string" === typeof input.inTmuxConsoleBaseUrl || _report(_exceptionable, {
|
|
191
|
+
path: _path + ".inTmuxConsoleBaseUrl",
|
|
192
|
+
expected: "(string | undefined)",
|
|
193
|
+
value: input.inTmuxConsoleBaseUrl
|
|
194
|
+
}), undefined === input.inTmuxConsoleToken || "string" === typeof input.inTmuxConsoleToken || _report(_exceptionable, {
|
|
195
|
+
path: _path + ".inTmuxConsoleToken",
|
|
196
|
+
expected: "(string | undefined)",
|
|
197
|
+
value: input.inTmuxConsoleToken
|
|
198
|
+
}), undefined === input.inTmuxProjectOrder || (Array.isArray(input.inTmuxProjectOrder) || _report(_exceptionable, {
|
|
199
|
+
path: _path + ".inTmuxProjectOrder",
|
|
200
|
+
expected: "(Array<string> | undefined)",
|
|
201
|
+
value: input.inTmuxProjectOrder
|
|
202
|
+
})) && input.inTmuxProjectOrder.map((elem, _index8) => "string" === typeof elem || _report(_exceptionable, {
|
|
203
|
+
path: _path + ".inTmuxProjectOrder[" + _index8 + "]",
|
|
204
|
+
expected: "string",
|
|
205
|
+
value: elem
|
|
206
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
207
|
+
path: _path + ".inTmuxProjectOrder",
|
|
208
|
+
expected: "(Array<string> | undefined)",
|
|
209
|
+
value: input.inTmuxProjectOrder
|
|
185
210
|
}), ("object" === typeof input.credentials && null !== input.credentials || _report(_exceptionable, {
|
|
186
211
|
path: _path + ".credentials",
|
|
187
212
|
expected: "__type.o2",
|
|
@@ -198,8 +223,8 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
198
223
|
path: _path + ".members",
|
|
199
224
|
expected: "Array<string>",
|
|
200
225
|
value: input.members
|
|
201
|
-
})) && input.members.map((elem,
|
|
202
|
-
path: _path + ".members[" +
|
|
226
|
+
})) && input.members.map((elem, _index9) => "string" === typeof elem || _report(_exceptionable, {
|
|
227
|
+
path: _path + ".members[" + _index9 + "]",
|
|
203
228
|
expected: "string",
|
|
204
229
|
value: elem
|
|
205
230
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -251,8 +276,8 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
251
276
|
path: _path + ".allowedIssueAuthors",
|
|
252
277
|
expected: "(Array<string> | null | undefined)",
|
|
253
278
|
value: input.allowedIssueAuthors
|
|
254
|
-
})) && input.allowedIssueAuthors.map((elem,
|
|
255
|
-
path: _path + ".allowedIssueAuthors[" +
|
|
279
|
+
})) && input.allowedIssueAuthors.map((elem, _index10) => "string" === typeof elem || _report(_exceptionable, {
|
|
280
|
+
path: _path + ".allowedIssueAuthors[" + _index10 + "]",
|
|
256
281
|
expected: "string",
|
|
257
282
|
value: elem
|
|
258
283
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -267,8 +292,8 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
267
292
|
path: _path + ".codexHomeCandidates",
|
|
268
293
|
expected: "(Array<string> | null | undefined)",
|
|
269
294
|
value: input.codexHomeCandidates
|
|
270
|
-
})) && input.codexHomeCandidates.map((elem,
|
|
271
|
-
path: _path + ".codexHomeCandidates[" +
|
|
295
|
+
})) && input.codexHomeCandidates.map((elem, _index11) => "string" === typeof elem || _report(_exceptionable, {
|
|
296
|
+
path: _path + ".codexHomeCandidates[" + _index11 + "]",
|
|
272
297
|
expected: "string",
|
|
273
298
|
value: elem
|
|
274
299
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -291,8 +316,8 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
291
316
|
path: _path + ".labelsAsLlmAgentName",
|
|
292
317
|
expected: "(Array<string> | null | undefined)",
|
|
293
318
|
value: input.labelsAsLlmAgentName
|
|
294
|
-
})) && input.labelsAsLlmAgentName.map((elem,
|
|
295
|
-
path: _path + ".labelsAsLlmAgentName[" +
|
|
319
|
+
})) && input.labelsAsLlmAgentName.map((elem, _index12) => "string" === typeof elem || _report(_exceptionable, {
|
|
320
|
+
path: _path + ".labelsAsLlmAgentName[" + _index12 + "]",
|
|
296
321
|
expected: "string",
|
|
297
322
|
value: elem
|
|
298
323
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -539,6 +564,23 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
539
564
|
catch (error) {
|
|
540
565
|
console.error(`Failed to write console lists: ${error instanceof Error ? error.message : String(error)}`);
|
|
541
566
|
}
|
|
567
|
+
try {
|
|
568
|
+
(0, inTmuxByHumanDataWriter_1.writeInTmuxByHumanData)({
|
|
569
|
+
inTmuxDataOutputDir: mergedInput.inTmuxDataOutputDir ?? null,
|
|
570
|
+
inTmuxConsoleBaseUrl: mergedInput.inTmuxConsoleBaseUrl ?? null,
|
|
571
|
+
inTmuxConsoleToken: mergedInput.inTmuxConsoleToken ?? null,
|
|
572
|
+
inTmuxProjectOrder: mergedInput.inTmuxProjectOrder ?? null,
|
|
573
|
+
pjcode: input.projectName,
|
|
574
|
+
assigneeLogin: input.manager,
|
|
575
|
+
org: input.org,
|
|
576
|
+
repo: input.workingReport.repo,
|
|
577
|
+
project: result.project,
|
|
578
|
+
issues: result.issues,
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
catch (error) {
|
|
582
|
+
console.error(`Failed to write in-tmux-by-human data: ${error instanceof Error ? error.message : String(error)}`);
|
|
583
|
+
}
|
|
542
584
|
}
|
|
543
585
|
return result;
|
|
544
586
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HandleScheduledEventUseCaseHandler.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAC1B,4CAAoB;AACpB,+DAA2D;AAC3D,6DAAyD;AACzD,uEAAmE;AACnE,wDAG8B;AAC9B,kFAA+E;AAC/E,sFAAmF;AACnF,gGAA6F;AAC7F,0FAAuF;AACvF,wFAAqF;AACrF,sFAAmF;AACnF,wGAAqG;AACrG,8GAA2G;AAC3G,sGAAmG;AACnG,gGAA6F;AAC7F,kGAA+F;AAC/F,gIAA6H;AAC7H,oHAAiH;AACjH,wGAAqG;AAIrG,0FAAuF;AACvF,wGAAqG;AACrG,gIAA6H;AAC7H,wGAAqG;AACrG,kIAA+H;AAC/H,8GAA2G;AAC3G,0GAAuG;AACvG,wGAAqG;AACrG,0HAAuH;AACvH,8GAA2G;AAC3G,8FAA2F;AAC3F,sFAAmF;AACnF,wGAAqG;AACrG,oGAAiG;AACjG,sGAAmG;AACnG,gHAA6G;AAC7G,0HAAuH;AACvH,kGAA+F;AAC/F,8GAA2G;AAC3G,gGAA6F;AAC7F,0EAAuE;AACvE,4EAKiD;AAEjD,MAAa,kCAAkC;IAA/C;QACE,WAAM,GAAG,KAAK,EACZ,cAAsB,EACtB,QAAiB,EAMT,EAAE;YACV,MAAM,iBAAiB,GAAG,YAAE,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;YAClE,MAAM,KAAK,GAAY,cAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"HandleScheduledEventUseCaseHandler.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAC1B,4CAAoB;AACpB,+DAA2D;AAC3D,6DAAyD;AACzD,uEAAmE;AACnE,uEAAmE;AACnE,wDAG8B;AAC9B,kFAA+E;AAC/E,sFAAmF;AACnF,gGAA6F;AAC7F,0FAAuF;AACvF,wFAAqF;AACrF,sFAAmF;AACnF,wGAAqG;AACrG,8GAA2G;AAC3G,sGAAmG;AACnG,gGAA6F;AAC7F,kGAA+F;AAC/F,gIAA6H;AAC7H,oHAAiH;AACjH,wGAAqG;AAIrG,0FAAuF;AACvF,wGAAqG;AACrG,gIAA6H;AAC7H,wGAAqG;AACrG,kIAA+H;AAC/H,8GAA2G;AAC3G,0GAAuG;AACvG,wGAAqG;AACrG,0HAAuH;AACvH,8GAA2G;AAC3G,8FAA2F;AAC3F,sFAAmF;AACnF,wGAAqG;AACrG,oGAAiG;AACjG,sGAAmG;AACnG,gHAA6G;AAC7G,0HAAuH;AACvH,kGAA+F;AAC/F,8GAA2G;AAC3G,gGAA6F;AAC7F,0EAAuE;AACvE,4EAKiD;AAEjD,MAAa,kCAAkC;IAA/C;QACE,WAAM,GAAG,KAAK,EACZ,cAAsB,EACtB,QAAiB,EAMT,EAAE;YACV,MAAM,iBAAiB,GAAG,YAAE,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;YAClE,MAAM,KAAK,GAAY,cAAI,CAAC,KAAK,CAAC,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C;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CACX,0CACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE,CACH,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;CAAA;AAtWD,gFAsWC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.writeInTmuxByHumanData = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const GenerateInTmuxByHumanDataUseCase_1 = require("../../../domain/usecases/intmux/GenerateInTmuxByHumanDataUseCase");
|
|
10
|
+
const writeJsonAtomic = (filePath, data) => {
|
|
11
|
+
const dir = path_1.default.dirname(filePath);
|
|
12
|
+
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
13
|
+
const tmpPath = `${filePath}.tmp`;
|
|
14
|
+
fs_1.default.writeFileSync(tmpPath, `${JSON.stringify(data, null, 2)}\n`);
|
|
15
|
+
fs_1.default.renameSync(tmpPath, filePath);
|
|
16
|
+
};
|
|
17
|
+
const writeInTmuxByHumanData = (params) => {
|
|
18
|
+
const { inTmuxDataOutputDir, inTmuxConsoleBaseUrl, inTmuxConsoleToken, inTmuxProjectOrder, pjcode, assigneeLogin, org, repo, project, issues, } = params;
|
|
19
|
+
if (!inTmuxDataOutputDir || !pjcode || !assigneeLogin) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const data = new GenerateInTmuxByHumanDataUseCase_1.GenerateInTmuxByHumanDataUseCase().run({
|
|
23
|
+
project,
|
|
24
|
+
issues,
|
|
25
|
+
pjcode,
|
|
26
|
+
assigneeLogin,
|
|
27
|
+
org,
|
|
28
|
+
repo,
|
|
29
|
+
consoleBaseUrl: inTmuxConsoleBaseUrl ?? null,
|
|
30
|
+
consoleToken: inTmuxConsoleToken ?? null,
|
|
31
|
+
});
|
|
32
|
+
writeJsonAtomic(path_1.default.join(inTmuxDataOutputDir, `${pjcode}.json`), data.v1);
|
|
33
|
+
writeJsonAtomic(path_1.default.join(inTmuxDataOutputDir, `${pjcode}.v2.json`), data.v2);
|
|
34
|
+
if (data.v3) {
|
|
35
|
+
writeJsonAtomic(path_1.default.join(inTmuxDataOutputDir, `${pjcode}.v3.json`), data.v3);
|
|
36
|
+
}
|
|
37
|
+
if (data.v4) {
|
|
38
|
+
writeJsonAtomic(path_1.default.join(inTmuxDataOutputDir, `${pjcode}.v4.json`), data.v4);
|
|
39
|
+
}
|
|
40
|
+
if (!inTmuxProjectOrder || inTmuxProjectOrder.length === 0) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const presentProjects = inTmuxProjectOrder.filter((name) => fs_1.default.existsSync(path_1.default.join(inTmuxDataOutputDir, `${name}.json`)));
|
|
44
|
+
writeJsonAtomic(path_1.default.join(inTmuxDataOutputDir, 'index.json'), {
|
|
45
|
+
projects: presentProjects,
|
|
46
|
+
});
|
|
47
|
+
writeJsonAtomic(path_1.default.join(inTmuxDataOutputDir, 'index.v2.json'), {
|
|
48
|
+
version: 2,
|
|
49
|
+
projects: presentProjects,
|
|
50
|
+
});
|
|
51
|
+
writeJsonAtomic(path_1.default.join(inTmuxDataOutputDir, 'index.v3.json'), {
|
|
52
|
+
version: 3,
|
|
53
|
+
projects: presentProjects,
|
|
54
|
+
});
|
|
55
|
+
if (inTmuxConsoleToken) {
|
|
56
|
+
const outputDirBasename = path_1.default.basename(inTmuxDataOutputDir);
|
|
57
|
+
writeJsonAtomic(path_1.default.join(inTmuxDataOutputDir, 'index.v4.json'), {
|
|
58
|
+
version: 4,
|
|
59
|
+
projects: presentProjects.map((name) => ({
|
|
60
|
+
name,
|
|
61
|
+
path: `/${outputDirBasename}/${name}.v4.json?k=${inTmuxConsoleToken}`,
|
|
62
|
+
})),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.writeInTmuxByHumanData = writeInTmuxByHumanData;
|
|
67
|
+
//# sourceMappingURL=inTmuxByHumanDataWriter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inTmuxByHumanDataWriter.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/inTmuxByHumanDataWriter.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,uHAG0E;AAe1E,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,IAAa,EAAQ,EAAE;IAChE,MAAM,GAAG,GAAG,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,YAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,GAAG,QAAQ,MAAM,CAAC;IAClC,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAChE,YAAE,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACnC,CAAC,CAAC;AAEK,MAAM,sBAAsB,GAAG,CACpC,MAAqC,EAC/B,EAAE;IACR,MAAM,EACJ,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,MAAM,EACN,aAAa,EACb,GAAG,EACH,IAAI,EACJ,OAAO,EACP,MAAM,GACP,GAAG,MAAM,CAAC;IACX,IAAI,CAAC,mBAAmB,IAAI,CAAC,MAAM,IAAI,CAAC,aAAa,EAA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IACH,eAAe,CAAC,cAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,EAAE;QAC/D,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,eAAe;KAC1B,CAAC,CAAC;IACH,eAAe,CAAC,cAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,EAAE;QAC/D,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,eAAe;KAC1B,CAAC,CAAC;IACH,IAAI,kBAAkB,EAAE,CAAC;QACvB,MAAM,iBAAiB,GAAG,cAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QAC7D,eAAe,CAAC,cAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,EAAE;YAC/D,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACvC,IAAI;gBACJ,IAAI,EAAE,IAAI,iBAAiB,IAAI,IAAI,cAAc,kBAAkB,EAAE;aACtE,CAAC,CAAC;SACJ,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AAxEW,QAAA,sBAAsB,0BAwEjC"}
|
|
@@ -22,6 +22,82 @@ function isPullRequestFilesResponse(value) {
|
|
|
22
22
|
return false;
|
|
23
23
|
return value.every((item) => typeof item === 'object' && item !== null && 'filename' in item);
|
|
24
24
|
}
|
|
25
|
+
function isRecord(value) {
|
|
26
|
+
return typeof value === 'object' && value !== null;
|
|
27
|
+
}
|
|
28
|
+
function isNullableString(value) {
|
|
29
|
+
return value === null || typeof value === 'string';
|
|
30
|
+
}
|
|
31
|
+
function isLoginContainer(value) {
|
|
32
|
+
return isRecord(value) && typeof value.login === 'string';
|
|
33
|
+
}
|
|
34
|
+
function isRefContainer(value) {
|
|
35
|
+
return isRecord(value) && typeof value.ref === 'string';
|
|
36
|
+
}
|
|
37
|
+
function isIssueOrPullRequestBodyResponse(value) {
|
|
38
|
+
return isRecord(value) && isNullableString(value.body);
|
|
39
|
+
}
|
|
40
|
+
function isIssueOrPullRequestStateResponse(value) {
|
|
41
|
+
return isRecord(value) && typeof value.state === 'string';
|
|
42
|
+
}
|
|
43
|
+
function isIssueCommentsResponseItem(value) {
|
|
44
|
+
if (!isRecord(value))
|
|
45
|
+
return false;
|
|
46
|
+
const userValid = value.user === null || isLoginContainer(value.user);
|
|
47
|
+
return (userValid &&
|
|
48
|
+
isNullableString(value.body) &&
|
|
49
|
+
typeof value.created_at === 'string');
|
|
50
|
+
}
|
|
51
|
+
function isIssueCommentsResponse(value) {
|
|
52
|
+
return Array.isArray(value) && value.every(isIssueCommentsResponseItem);
|
|
53
|
+
}
|
|
54
|
+
function isPullRequestDetailResponse(value) {
|
|
55
|
+
if (!isRecord(value))
|
|
56
|
+
return false;
|
|
57
|
+
const userValid = value.user === null || isLoginContainer(value.user);
|
|
58
|
+
return (typeof value.title === 'string' &&
|
|
59
|
+
typeof value.state === 'string' &&
|
|
60
|
+
typeof value.merged === 'boolean' &&
|
|
61
|
+
typeof value.draft === 'boolean' &&
|
|
62
|
+
typeof value.additions === 'number' &&
|
|
63
|
+
typeof value.deletions === 'number' &&
|
|
64
|
+
typeof value.changed_files === 'number' &&
|
|
65
|
+
isRefContainer(value.head) &&
|
|
66
|
+
isRefContainer(value.base) &&
|
|
67
|
+
userValid &&
|
|
68
|
+
isNullableString(value.body));
|
|
69
|
+
}
|
|
70
|
+
function isPullRequestDetailFilesResponseItem(value) {
|
|
71
|
+
if (!isRecord(value))
|
|
72
|
+
return false;
|
|
73
|
+
return (typeof value.filename === 'string' &&
|
|
74
|
+
typeof value.status === 'string' &&
|
|
75
|
+
typeof value.additions === 'number' &&
|
|
76
|
+
typeof value.deletions === 'number' &&
|
|
77
|
+
(value.patch === undefined || typeof value.patch === 'string'));
|
|
78
|
+
}
|
|
79
|
+
function isPullRequestDetailFilesResponse(value) {
|
|
80
|
+
return (Array.isArray(value) && value.every(isPullRequestDetailFilesResponseItem));
|
|
81
|
+
}
|
|
82
|
+
function isCommitAuthor(value) {
|
|
83
|
+
return (isRecord(value) &&
|
|
84
|
+
typeof value.name === 'string' &&
|
|
85
|
+
typeof value.date === 'string');
|
|
86
|
+
}
|
|
87
|
+
function isPullRequestCommitsResponseItem(value) {
|
|
88
|
+
if (!isRecord(value))
|
|
89
|
+
return false;
|
|
90
|
+
if (typeof value.sha !== 'string')
|
|
91
|
+
return false;
|
|
92
|
+
if (!isRecord(value.commit))
|
|
93
|
+
return false;
|
|
94
|
+
if (typeof value.commit.message !== 'string')
|
|
95
|
+
return false;
|
|
96
|
+
return value.commit.author === null || isCommitAuthor(value.commit.author);
|
|
97
|
+
}
|
|
98
|
+
function isPullRequestCommitsResponse(value) {
|
|
99
|
+
return Array.isArray(value) && value.every(isPullRequestCommitsResponseItem);
|
|
100
|
+
}
|
|
25
101
|
const fnmatch = (pattern, str) => {
|
|
26
102
|
let regexStr = '^';
|
|
27
103
|
let i = 0;
|
|
@@ -746,6 +822,236 @@ class ApiV3CheerioRestIssueRepository extends BaseGitHubRepository_1.BaseGitHubR
|
|
|
746
822
|
this.createCommentByUrl = async (issueOrPrUrl, commentBody) => {
|
|
747
823
|
await this.restIssueRepository.createComment(issueOrPrUrl, commentBody);
|
|
748
824
|
};
|
|
825
|
+
this.getIssueOrPullRequestBody = async (url) => {
|
|
826
|
+
const { owner, repo, issueNumber } = this.parseIssueUrl(url);
|
|
827
|
+
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/issues/${issueNumber}`, {
|
|
828
|
+
method: 'GET',
|
|
829
|
+
headers: {
|
|
830
|
+
Authorization: `Bearer ${this.ghToken}`,
|
|
831
|
+
Accept: 'application/vnd.github+json',
|
|
832
|
+
},
|
|
833
|
+
});
|
|
834
|
+
if (!response.ok) {
|
|
835
|
+
throw new Error(`Failed to fetch body for ${url}: HTTP ${response.status}`);
|
|
836
|
+
}
|
|
837
|
+
const body = await response.json();
|
|
838
|
+
if (!isIssueOrPullRequestBodyResponse(body)) {
|
|
839
|
+
throw new Error(`Unexpected response shape when fetching body for ${url}`);
|
|
840
|
+
}
|
|
841
|
+
return body.body ?? '';
|
|
842
|
+
};
|
|
843
|
+
this.getIssueOrPullRequestComments = async (url) => {
|
|
844
|
+
const { owner, repo, issueNumber } = this.parseIssueUrl(url);
|
|
845
|
+
const perPage = 100;
|
|
846
|
+
const collectedComments = [];
|
|
847
|
+
let page = 1;
|
|
848
|
+
let hasMore = true;
|
|
849
|
+
while (hasMore) {
|
|
850
|
+
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/issues/${issueNumber}/comments?per_page=${perPage}&page=${page}`, {
|
|
851
|
+
method: 'GET',
|
|
852
|
+
headers: {
|
|
853
|
+
Authorization: `Bearer ${this.ghToken}`,
|
|
854
|
+
Accept: 'application/vnd.github+json',
|
|
855
|
+
},
|
|
856
|
+
});
|
|
857
|
+
if (!response.ok) {
|
|
858
|
+
throw new Error(`Failed to fetch comments for ${url}: HTTP ${response.status}`);
|
|
859
|
+
}
|
|
860
|
+
const body = await response.json();
|
|
861
|
+
if (!isIssueCommentsResponse(body)) {
|
|
862
|
+
throw new Error(`Unexpected response shape when fetching comments for ${url}`);
|
|
863
|
+
}
|
|
864
|
+
for (const comment of body) {
|
|
865
|
+
collectedComments.push({
|
|
866
|
+
author: comment.user?.login ?? '',
|
|
867
|
+
body: comment.body ?? '',
|
|
868
|
+
createdAt: new Date(comment.created_at),
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
if (body.length < perPage) {
|
|
872
|
+
hasMore = false;
|
|
873
|
+
}
|
|
874
|
+
else {
|
|
875
|
+
page += 1;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
return collectedComments;
|
|
879
|
+
};
|
|
880
|
+
this.getPullRequestDetail = async (prUrl) => {
|
|
881
|
+
const { owner, repo, issueNumber: prNumber, isPr, } = this.parseIssueUrl(prUrl);
|
|
882
|
+
if (!isPr) {
|
|
883
|
+
return null;
|
|
884
|
+
}
|
|
885
|
+
const detailResponse = await fetch(`https://api.github.com/repos/${owner}/${repo}/pulls/${prNumber}`, {
|
|
886
|
+
method: 'GET',
|
|
887
|
+
headers: {
|
|
888
|
+
Authorization: `Bearer ${this.ghToken}`,
|
|
889
|
+
Accept: 'application/vnd.github+json',
|
|
890
|
+
},
|
|
891
|
+
});
|
|
892
|
+
if (!detailResponse.ok) {
|
|
893
|
+
throw new Error(`Failed to fetch detail for PR ${prUrl}: HTTP ${detailResponse.status}`);
|
|
894
|
+
}
|
|
895
|
+
const detailBody = await detailResponse.json();
|
|
896
|
+
if (!isPullRequestDetailResponse(detailBody)) {
|
|
897
|
+
throw new Error(`Unexpected response shape when fetching detail for PR ${prUrl}`);
|
|
898
|
+
}
|
|
899
|
+
const files = await this.fetchPullRequestFiles(owner, repo, prNumber, prUrl);
|
|
900
|
+
return {
|
|
901
|
+
title: detailBody.title,
|
|
902
|
+
state: detailBody.state,
|
|
903
|
+
merged: detailBody.merged,
|
|
904
|
+
isDraft: detailBody.draft,
|
|
905
|
+
additions: detailBody.additions,
|
|
906
|
+
deletions: detailBody.deletions,
|
|
907
|
+
changedFiles: detailBody.changed_files,
|
|
908
|
+
headRefName: detailBody.head.ref,
|
|
909
|
+
baseRefName: detailBody.base.ref,
|
|
910
|
+
author: detailBody.user?.login ?? '',
|
|
911
|
+
files,
|
|
912
|
+
};
|
|
913
|
+
};
|
|
914
|
+
this.fetchPullRequestFiles = async (owner, repo, prNumber, prUrl) => {
|
|
915
|
+
const perPage = 100;
|
|
916
|
+
const collectedFiles = [];
|
|
917
|
+
let page = 1;
|
|
918
|
+
let hasMore = true;
|
|
919
|
+
while (hasMore) {
|
|
920
|
+
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/pulls/${prNumber}/files?per_page=${perPage}&page=${page}`, {
|
|
921
|
+
method: 'GET',
|
|
922
|
+
headers: {
|
|
923
|
+
Authorization: `Bearer ${this.ghToken}`,
|
|
924
|
+
Accept: 'application/vnd.github+json',
|
|
925
|
+
},
|
|
926
|
+
});
|
|
927
|
+
if (!response.ok) {
|
|
928
|
+
throw new Error(`Failed to fetch files for PR ${prUrl}: HTTP ${response.status}`);
|
|
929
|
+
}
|
|
930
|
+
const body = await response.json();
|
|
931
|
+
if (!isPullRequestDetailFilesResponse(body)) {
|
|
932
|
+
throw new Error(`Unexpected response shape when fetching files for PR ${prUrl}`);
|
|
933
|
+
}
|
|
934
|
+
for (const file of body) {
|
|
935
|
+
collectedFiles.push({
|
|
936
|
+
filename: file.filename,
|
|
937
|
+
status: file.status,
|
|
938
|
+
additions: file.additions,
|
|
939
|
+
deletions: file.deletions,
|
|
940
|
+
patch: file.patch ?? null,
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
if (body.length < perPage) {
|
|
944
|
+
hasMore = false;
|
|
945
|
+
}
|
|
946
|
+
else {
|
|
947
|
+
page += 1;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
return collectedFiles;
|
|
951
|
+
};
|
|
952
|
+
this.getPullRequestCommits = async (prUrl) => {
|
|
953
|
+
const { owner, repo, issueNumber: prNumber, isPr, } = this.parseIssueUrl(prUrl);
|
|
954
|
+
if (!isPr) {
|
|
955
|
+
return [];
|
|
956
|
+
}
|
|
957
|
+
const perPage = 100;
|
|
958
|
+
const collectedCommits = [];
|
|
959
|
+
let page = 1;
|
|
960
|
+
let hasMore = true;
|
|
961
|
+
while (hasMore) {
|
|
962
|
+
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/pulls/${prNumber}/commits?per_page=${perPage}&page=${page}`, {
|
|
963
|
+
method: 'GET',
|
|
964
|
+
headers: {
|
|
965
|
+
Authorization: `Bearer ${this.ghToken}`,
|
|
966
|
+
Accept: 'application/vnd.github+json',
|
|
967
|
+
},
|
|
968
|
+
});
|
|
969
|
+
if (!response.ok) {
|
|
970
|
+
throw new Error(`Failed to fetch commits for PR ${prUrl}: HTTP ${response.status}`);
|
|
971
|
+
}
|
|
972
|
+
const body = await response.json();
|
|
973
|
+
if (!isPullRequestCommitsResponse(body)) {
|
|
974
|
+
throw new Error(`Unexpected response shape when fetching commits for PR ${prUrl}`);
|
|
975
|
+
}
|
|
976
|
+
for (const commit of body) {
|
|
977
|
+
collectedCommits.push({
|
|
978
|
+
sha: commit.sha,
|
|
979
|
+
message: commit.commit.message,
|
|
980
|
+
author: commit.commit.author?.name ?? '',
|
|
981
|
+
authoredAt: new Date(commit.commit.author?.date ?? 0),
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
if (body.length < perPage) {
|
|
985
|
+
hasMore = false;
|
|
986
|
+
}
|
|
987
|
+
else {
|
|
988
|
+
page += 1;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
return collectedCommits;
|
|
992
|
+
};
|
|
993
|
+
this.getIssueOrPullRequestState = async (url) => {
|
|
994
|
+
const { owner, repo, issueNumber, isPr } = this.parseIssueUrl(url);
|
|
995
|
+
if (isPr) {
|
|
996
|
+
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/pulls/${issueNumber}`, {
|
|
997
|
+
method: 'GET',
|
|
998
|
+
headers: {
|
|
999
|
+
Authorization: `Bearer ${this.ghToken}`,
|
|
1000
|
+
Accept: 'application/vnd.github+json',
|
|
1001
|
+
},
|
|
1002
|
+
});
|
|
1003
|
+
if (!response.ok) {
|
|
1004
|
+
throw new Error(`Failed to fetch state for ${url}: HTTP ${response.status}`);
|
|
1005
|
+
}
|
|
1006
|
+
const body = await response.json();
|
|
1007
|
+
if (!isPullRequestDetailResponse(body)) {
|
|
1008
|
+
throw new Error(`Unexpected response shape when fetching state for ${url}`);
|
|
1009
|
+
}
|
|
1010
|
+
return { state: body.state, merged: body.merged, isPullRequest: true };
|
|
1011
|
+
}
|
|
1012
|
+
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/issues/${issueNumber}`, {
|
|
1013
|
+
method: 'GET',
|
|
1014
|
+
headers: {
|
|
1015
|
+
Authorization: `Bearer ${this.ghToken}`,
|
|
1016
|
+
Accept: 'application/vnd.github+json',
|
|
1017
|
+
},
|
|
1018
|
+
});
|
|
1019
|
+
if (!response.ok) {
|
|
1020
|
+
throw new Error(`Failed to fetch state for ${url}: HTTP ${response.status}`);
|
|
1021
|
+
}
|
|
1022
|
+
const body = await response.json();
|
|
1023
|
+
if (!isIssueOrPullRequestStateResponse(body)) {
|
|
1024
|
+
throw new Error(`Unexpected response shape when fetching state for ${url}`);
|
|
1025
|
+
}
|
|
1026
|
+
return { state: body.state, merged: false, isPullRequest: false };
|
|
1027
|
+
};
|
|
1028
|
+
this.getPullRequestSummary = async (prUrl) => {
|
|
1029
|
+
const { owner, repo, issueNumber: prNumber, isPr, } = this.parseIssueUrl(prUrl);
|
|
1030
|
+
if (!isPr) {
|
|
1031
|
+
return null;
|
|
1032
|
+
}
|
|
1033
|
+
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}/pulls/${prNumber}`, {
|
|
1034
|
+
method: 'GET',
|
|
1035
|
+
headers: {
|
|
1036
|
+
Authorization: `Bearer ${this.ghToken}`,
|
|
1037
|
+
Accept: 'application/vnd.github+json',
|
|
1038
|
+
},
|
|
1039
|
+
});
|
|
1040
|
+
if (!response.ok) {
|
|
1041
|
+
throw new Error(`Failed to fetch summary for PR ${prUrl}: HTTP ${response.status}`);
|
|
1042
|
+
}
|
|
1043
|
+
const body = await response.json();
|
|
1044
|
+
if (!isPullRequestDetailResponse(body)) {
|
|
1045
|
+
throw new Error(`Unexpected response shape when fetching summary for PR ${prUrl}`);
|
|
1046
|
+
}
|
|
1047
|
+
return {
|
|
1048
|
+
title: body.title,
|
|
1049
|
+
body: body.body ?? '',
|
|
1050
|
+
additions: body.additions,
|
|
1051
|
+
deletions: body.deletions,
|
|
1052
|
+
changedFiles: body.changed_files,
|
|
1053
|
+
};
|
|
1054
|
+
};
|
|
749
1055
|
}
|
|
750
1056
|
}
|
|
751
1057
|
exports.ApiV3CheerioRestIssueRepository = ApiV3CheerioRestIssueRepository;
|