@oneuptime/common 9.2.27 → 9.3.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/Models/DatabaseModels/AIAgent.ts +589 -0
- package/Models/DatabaseModels/AIAgentOwnerTeam.ts +434 -0
- package/Models/DatabaseModels/AIAgentOwnerUser.ts +433 -0
- package/Models/DatabaseModels/AIAgentTask.ts +549 -0
- package/Models/DatabaseModels/AIAgentTaskLog.ts +417 -0
- package/Models/DatabaseModels/AIAgentTaskPullRequest.ts +731 -0
- package/Models/DatabaseModels/AIAgentTaskTelemetryException.ts +388 -0
- package/Models/DatabaseModels/Index.ts +15 -0
- package/Models/DatabaseModels/Monitor.ts +33 -0
- package/Models/DatabaseModels/Project.ts +25 -0
- package/Models/DatabaseModels/TelemetryException.ts +1 -1
- package/Server/API/AIAgentAPI.ts +200 -0
- package/Server/API/AIAgentDataAPI.ts +692 -0
- package/Server/API/AIAgentTaskAPI.ts +286 -0
- package/Server/API/AIAgentTaskLogAPI.ts +165 -0
- package/Server/API/AIAgentTaskPullRequestAPI.ts +14 -0
- package/Server/API/GitHubAPI.ts +25 -7
- package/Server/API/TelemetryExceptionAPI.ts +169 -0
- package/Server/EnvironmentConfig.ts +3 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766590916627-MigrationName.ts +195 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766600860972-MigrationName.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766606720183-MigrationName.ts +17 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766688107858-MigrationName.ts +63 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766754182870-MigrationName.ts +75 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766774689743-MigrationName.ts +157 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766777986427-MigrationName.ts +33 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766918848434-AddAIAgentIsDefault.ts +27 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766923324521-MigrationName.ts +37 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766958924188-AddGitHubAppInstallationIdToProject.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1767009661768-MigrationName.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +22 -0
- package/Server/Services/AIAgentOwnerTeamService.ts +10 -0
- package/Server/Services/AIAgentOwnerUserService.ts +10 -0
- package/Server/Services/AIAgentService.ts +564 -0
- package/Server/Services/AIAgentTaskLogService.ts +10 -0
- package/Server/Services/AIAgentTaskPullRequestService.ts +10 -0
- package/Server/Services/AIAgentTaskService.ts +178 -0
- package/Server/Services/AIAgentTaskTelemetryExceptionService.ts +39 -0
- package/Server/Services/Index.ts +10 -0
- package/Server/Services/TelemetryExceptionService.ts +162 -0
- package/Server/Utils/Monitor/MonitorResource.ts +228 -0
- package/Server/Utils/PushNotificationUtil.ts +29 -0
- package/Server/Utils/WhatsAppTemplateUtil.ts +6 -0
- package/Tests/UI/Components/Badge.test.tsx +5 -5
- package/Tests/UI/Components/Card.test.tsx +4 -8
- package/Tests/UI/Components/HiddenText.test.tsx +2 -5
- package/Tests/UI/Components/SideMenuItem.test.tsx +4 -2
- package/Types/AI/AIAgentTaskMetadata.ts +25 -0
- package/Types/AI/AIAgentTaskStatus.ts +65 -0
- package/Types/AI/AIAgentTaskType.ts +40 -0
- package/Types/Email/EmailTemplateType.ts +2 -0
- package/Types/Monitor/MonitorEvaluationSummary.ts +2 -1
- package/Types/NotificationSetting/NotificationSettingEventType.ts +4 -0
- package/Types/Permission.ts +176 -0
- package/Types/WhatsApp/WhatsAppTemplates.ts +9 -0
- package/UI/Components/AIAgent/AIAgent.tsx +69 -0
- package/UI/Components/Badge/Badge.tsx +9 -5
- package/UI/Components/Banner/Banner.tsx +1 -1
- package/UI/Components/Card/Card.tsx +14 -12
- package/UI/Components/CodeBlock/CodeBlock.tsx +47 -4
- package/UI/Components/Detail/Detail.tsx +239 -49
- package/UI/Components/Detail/FieldLabel.tsx +35 -11
- package/UI/Components/Detail/PlaceholderText.tsx +18 -1
- package/UI/Components/Footer/Footer.tsx +9 -7
- package/UI/Components/Header/Header.tsx +4 -3
- package/UI/Components/Header/HeaderIconDropdownButton.tsx +13 -11
- package/UI/Components/Header/IconDropdown/IconDropdownItem.tsx +3 -3
- package/UI/Components/Header/IconDropdown/IconDropdownMenu.tsx +1 -1
- package/UI/Components/Header/ProjectPicker/CreateNewProjectButton.tsx +4 -4
- package/UI/Components/Header/ProjectPicker/ProjectPicker.tsx +6 -6
- package/UI/Components/Header/ProjectPicker/ProjectPickerFilterBox.tsx +3 -3
- package/UI/Components/Header/ProjectPicker/ProjectPickerMenu.tsx +1 -1
- package/UI/Components/Header/ProjectPicker/ProjectPickerMenuItem.tsx +4 -4
- package/UI/Components/HeaderAlert/HeaderAlert.tsx +32 -32
- package/UI/Components/HeaderAlert/HeaderAlertGroup.tsx +1 -7
- package/UI/Components/HiddenText/HiddenText.tsx +98 -27
- package/UI/Components/Icon/Icon.tsx +12 -9
- package/UI/Components/InfoCard/InfoCard.tsx +7 -3
- package/UI/Components/ModelTable/BaseModelTable.tsx +1 -1
- package/UI/Components/ObjectID/ObjectIDView.tsx +73 -0
- package/UI/Components/Page/Page.tsx +3 -5
- package/UI/Components/SideMenu/SideMenu.tsx +175 -40
- package/UI/Components/SideMenu/SideMenuDivider.tsx +17 -0
- package/UI/Components/SideMenu/SideMenuItem.tsx +111 -158
- package/UI/Components/SideMenu/SideMenuSection.tsx +53 -3
- package/UI/Components/Table/Table.tsx +1 -1
- package/UI/Components/Types/FieldType.ts +2 -0
- package/UI/Config.ts +5 -0
- package/build/dist/Models/DatabaseModels/AIAgent.js +614 -0
- package/build/dist/Models/DatabaseModels/AIAgent.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentOwnerTeam.js +452 -0
- package/build/dist/Models/DatabaseModels/AIAgentOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentOwnerUser.js +451 -0
- package/build/dist/Models/DatabaseModels/AIAgentOwnerUser.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentTask.js +580 -0
- package/build/dist/Models/DatabaseModels/AIAgentTask.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskLog.js +438 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskLog.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js +771 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskTelemetryException.js +404 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskTelemetryException.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Index.js +14 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Monitor.js +34 -0
- package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +26 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryException.js +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryException.js.map +1 -1
- package/build/dist/Server/API/AIAgentAPI.js +141 -0
- package/build/dist/Server/API/AIAgentAPI.js.map +1 -0
- package/build/dist/Server/API/AIAgentDataAPI.js +415 -0
- package/build/dist/Server/API/AIAgentDataAPI.js.map +1 -0
- package/build/dist/Server/API/AIAgentTaskAPI.js +199 -0
- package/build/dist/Server/API/AIAgentTaskAPI.js.map +1 -0
- package/build/dist/Server/API/AIAgentTaskLogAPI.js +106 -0
- package/build/dist/Server/API/AIAgentTaskLogAPI.js.map +1 -0
- package/build/dist/Server/API/AIAgentTaskPullRequestAPI.js +9 -0
- package/build/dist/Server/API/AIAgentTaskPullRequestAPI.js.map +1 -0
- package/build/dist/Server/API/GitHubAPI.js +23 -8
- package/build/dist/Server/API/GitHubAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryExceptionAPI.js +120 -0
- package/build/dist/Server/API/TelemetryExceptionAPI.js.map +1 -0
- package/build/dist/Server/EnvironmentConfig.js +2 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766590916627-MigrationName.js +74 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766590916627-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766600860972-MigrationName.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766600860972-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766606720183-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766606720183-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766688107858-MigrationName.js +28 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766688107858-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766754182870-MigrationName.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766754182870-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766774689743-MigrationName.js +60 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766774689743-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766777986427-MigrationName.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766777986427-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766918848434-AddAIAgentIsDefault.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766918848434-AddAIAgentIsDefault.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766923324521-MigrationName.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766923324521-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766958924188-AddGitHubAppInstallationIdToProject.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766958924188-AddGitHubAppInstallationIdToProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1767009661768-MigrationName.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1767009661768-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AIAgentOwnerTeamService.js +9 -0
- package/build/dist/Server/Services/AIAgentOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentOwnerUserService.js +9 -0
- package/build/dist/Server/Services/AIAgentOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentService.js +471 -0
- package/build/dist/Server/Services/AIAgentService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentTaskLogService.js +9 -0
- package/build/dist/Server/Services/AIAgentTaskLogService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentTaskPullRequestService.js +9 -0
- package/build/dist/Server/Services/AIAgentTaskPullRequestService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentTaskService.js +158 -0
- package/build/dist/Server/Services/AIAgentTaskService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentTaskTelemetryExceptionService.js +36 -0
- package/build/dist/Server/Services/AIAgentTaskTelemetryExceptionService.js.map +1 -0
- package/build/dist/Server/Services/Index.js +10 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/TelemetryExceptionService.js +137 -0
- package/build/dist/Server/Services/TelemetryExceptionService.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +168 -0
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/PushNotificationUtil.js +21 -0
- package/build/dist/Server/Utils/PushNotificationUtil.js.map +1 -1
- package/build/dist/Server/Utils/WhatsAppTemplateUtil.js +4 -0
- package/build/dist/Server/Utils/WhatsAppTemplateUtil.js.map +1 -1
- package/build/dist/Tests/UI/Components/Badge.test.js +5 -5
- package/build/dist/Tests/UI/Components/Badge.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/Card.test.js +4 -8
- package/build/dist/Tests/UI/Components/Card.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/HiddenText.test.js +2 -3
- package/build/dist/Tests/UI/Components/HiddenText.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/SideMenuItem.test.js +3 -2
- package/build/dist/Tests/UI/Components/SideMenuItem.test.js.map +1 -1
- package/build/dist/Types/AI/AIAgentTaskMetadata.js +6 -0
- package/build/dist/Types/AI/AIAgentTaskMetadata.js.map +1 -0
- package/build/dist/Types/AI/AIAgentTaskStatus.js +51 -0
- package/build/dist/Types/AI/AIAgentTaskStatus.js.map +1 -0
- package/build/dist/Types/AI/AIAgentTaskType.js +29 -0
- package/build/dist/Types/AI/AIAgentTaskType.js.map +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js +2 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js +3 -0
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js.map +1 -1
- package/build/dist/Types/Permission.js +160 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/WhatsApp/WhatsAppTemplates.js +6 -0
- package/build/dist/Types/WhatsApp/WhatsAppTemplates.js.map +1 -1
- package/build/dist/UI/Components/AIAgent/AIAgent.js +32 -0
- package/build/dist/UI/Components/AIAgent/AIAgent.js.map +1 -0
- package/build/dist/UI/Components/Badge/Badge.js +9 -5
- package/build/dist/UI/Components/Badge/Badge.js.map +1 -1
- package/build/dist/UI/Components/Banner/Banner.js +1 -1
- package/build/dist/UI/Components/Banner/Banner.js.map +1 -1
- package/build/dist/UI/Components/Card/Card.js +12 -12
- package/build/dist/UI/Components/Card/Card.js.map +1 -1
- package/build/dist/UI/Components/CodeBlock/CodeBlock.js +22 -2
- package/build/dist/UI/Components/CodeBlock/CodeBlock.js.map +1 -1
- package/build/dist/UI/Components/Detail/Detail.js +117 -37
- package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
- package/build/dist/UI/Components/Detail/FieldLabel.js +12 -7
- package/build/dist/UI/Components/Detail/FieldLabel.js.map +1 -1
- package/build/dist/UI/Components/Detail/PlaceholderText.js +4 -1
- package/build/dist/UI/Components/Detail/PlaceholderText.js.map +1 -1
- package/build/dist/UI/Components/Footer/Footer.js +6 -6
- package/build/dist/UI/Components/Footer/Footer.js.map +1 -1
- package/build/dist/UI/Components/Header/Header.js +4 -3
- package/build/dist/UI/Components/Header/Header.js.map +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +7 -7
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
- package/build/dist/UI/Components/Header/IconDropdown/IconDropdownItem.js +3 -3
- package/build/dist/UI/Components/Header/IconDropdown/IconDropdownItem.js.map +1 -1
- package/build/dist/UI/Components/Header/IconDropdown/IconDropdownMenu.js +1 -1
- package/build/dist/UI/Components/Header/IconDropdown/IconDropdownMenu.js.map +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/CreateNewProjectButton.js +4 -4
- package/build/dist/UI/Components/Header/ProjectPicker/CreateNewProjectButton.js.map +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPicker.js +6 -6
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPicker.js.map +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerFilterBox.js +2 -2
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerFilterBox.js.map +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerMenu.js +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerMenu.js.map +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerMenuItem.js +4 -4
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerMenuItem.js.map +1 -1
- package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js +31 -29
- package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js.map +1 -1
- package/build/dist/UI/Components/HeaderAlert/HeaderAlertGroup.js +1 -3
- package/build/dist/UI/Components/HeaderAlert/HeaderAlertGroup.js.map +1 -1
- package/build/dist/UI/Components/HiddenText/HiddenText.js +33 -14
- package/build/dist/UI/Components/HiddenText/HiddenText.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +3 -4
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js +3 -3
- package/build/dist/UI/Components/InfoCard/InfoCard.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ObjectID/ObjectIDView.js +30 -0
- package/build/dist/UI/Components/ObjectID/ObjectIDView.js.map +1 -0
- package/build/dist/UI/Components/Page/Page.js +3 -3
- package/build/dist/UI/Components/Page/Page.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenu.js +82 -17
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuDivider.js +7 -0
- package/build/dist/UI/Components/SideMenu/SideMenuDivider.js.map +1 -0
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js +68 -97
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuSection.js +18 -3
- package/build/dist/UI/Components/SideMenu/SideMenuSection.js.map +1 -1
- package/build/dist/UI/Components/Table/Table.js +1 -1
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Types/FieldType.js +2 -0
- package/build/dist/UI/Components/Types/FieldType.js.map +1 -1
- package/build/dist/UI/Config.js +2 -0
- package/build/dist/UI/Config.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import AIAgentService from "../Services/AIAgentService";
|
|
2
|
+
import AIAgentTaskService, {
|
|
3
|
+
Service as AIAgentTaskServiceType,
|
|
4
|
+
} from "../Services/AIAgentTaskService";
|
|
5
|
+
import {
|
|
6
|
+
ExpressRequest,
|
|
7
|
+
ExpressResponse,
|
|
8
|
+
NextFunction,
|
|
9
|
+
} from "../Utils/Express";
|
|
10
|
+
import Response from "../Utils/Response";
|
|
11
|
+
import BaseAPI from "./BaseAPI";
|
|
12
|
+
import AIAgentTask from "../../Models/DatabaseModels/AIAgentTask";
|
|
13
|
+
import AIAgent from "../../Models/DatabaseModels/AIAgent";
|
|
14
|
+
import BadDataException from "../../Types/Exception/BadDataException";
|
|
15
|
+
import { JSONObject } from "../../Types/JSON";
|
|
16
|
+
import ObjectID from "../../Types/ObjectID";
|
|
17
|
+
import OneUptimeDate from "../../Types/Date";
|
|
18
|
+
import AIAgentTaskStatus from "../../Types/AI/AIAgentTaskStatus";
|
|
19
|
+
import SortOrder from "../../Types/BaseDatabase/SortOrder";
|
|
20
|
+
import PositiveNumber from "../../Types/PositiveNumber";
|
|
21
|
+
|
|
22
|
+
export default class AIAgentTaskAPI extends BaseAPI<
|
|
23
|
+
AIAgentTask,
|
|
24
|
+
AIAgentTaskServiceType
|
|
25
|
+
> {
|
|
26
|
+
public constructor() {
|
|
27
|
+
super(AIAgentTask, AIAgentTaskService);
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
* Get the next pending (scheduled) task for processing
|
|
31
|
+
* Validates aiAgentId and aiAgentKey before returning task
|
|
32
|
+
*/
|
|
33
|
+
this.router.post(
|
|
34
|
+
`${new this.entityType().getCrudApiPath()?.toString()}/get-pending-task`,
|
|
35
|
+
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
|
36
|
+
try {
|
|
37
|
+
const data: JSONObject = req.body;
|
|
38
|
+
|
|
39
|
+
/* Validate AI Agent credentials */
|
|
40
|
+
const aiAgent: AIAgent | null = await this.validateAIAgent(data);
|
|
41
|
+
|
|
42
|
+
if (!aiAgent) {
|
|
43
|
+
return Response.sendErrorResponse(
|
|
44
|
+
req,
|
|
45
|
+
res,
|
|
46
|
+
new BadDataException("Invalid AI Agent ID or AI Agent Key"),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Fetch one scheduled task, sorted by createdAt (oldest first) */
|
|
51
|
+
const task: AIAgentTask | null = await AIAgentTaskService.findOneBy({
|
|
52
|
+
query: {
|
|
53
|
+
status: AIAgentTaskStatus.Scheduled,
|
|
54
|
+
},
|
|
55
|
+
sort: {
|
|
56
|
+
createdAt: SortOrder.Ascending,
|
|
57
|
+
},
|
|
58
|
+
select: {
|
|
59
|
+
_id: true,
|
|
60
|
+
projectId: true,
|
|
61
|
+
taskType: true,
|
|
62
|
+
metadata: true,
|
|
63
|
+
createdAt: true,
|
|
64
|
+
},
|
|
65
|
+
props: {
|
|
66
|
+
isRoot: true,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
if (!task) {
|
|
71
|
+
return Response.sendJsonObjectResponse(req, res, {
|
|
72
|
+
task: null,
|
|
73
|
+
message: "No pending tasks available",
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return Response.sendJsonObjectResponse(req, res, {
|
|
78
|
+
task: {
|
|
79
|
+
_id: task._id?.toString(),
|
|
80
|
+
projectId: task.projectId?.toString(),
|
|
81
|
+
taskType: task.taskType,
|
|
82
|
+
metadata: task.metadata as JSONObject | undefined,
|
|
83
|
+
createdAt: task.createdAt,
|
|
84
|
+
},
|
|
85
|
+
message: "Task fetched successfully",
|
|
86
|
+
});
|
|
87
|
+
} catch (err) {
|
|
88
|
+
next(err);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
/*
|
|
94
|
+
* Get the count of pending (scheduled) tasks for KEDA autoscaling
|
|
95
|
+
* Validates aiAgentId and aiAgentKey before returning count
|
|
96
|
+
*/
|
|
97
|
+
this.router.post(
|
|
98
|
+
`${new this.entityType().getCrudApiPath()?.toString()}/get-pending-task-count`,
|
|
99
|
+
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
|
100
|
+
try {
|
|
101
|
+
const data: JSONObject = req.body;
|
|
102
|
+
|
|
103
|
+
/* Validate AI Agent credentials */
|
|
104
|
+
const aiAgent: AIAgent | null = await this.validateAIAgent(data);
|
|
105
|
+
|
|
106
|
+
if (!aiAgent) {
|
|
107
|
+
return Response.sendErrorResponse(
|
|
108
|
+
req,
|
|
109
|
+
res,
|
|
110
|
+
new BadDataException("Invalid AI Agent ID or AI Agent Key"),
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Count scheduled tasks */
|
|
115
|
+
const count: PositiveNumber = await AIAgentTaskService.countBy({
|
|
116
|
+
query: {
|
|
117
|
+
status: AIAgentTaskStatus.Scheduled,
|
|
118
|
+
},
|
|
119
|
+
props: {
|
|
120
|
+
isRoot: true,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
return Response.sendJsonObjectResponse(req, res, {
|
|
125
|
+
count: count,
|
|
126
|
+
message: "Pending task count fetched successfully",
|
|
127
|
+
});
|
|
128
|
+
} catch (err) {
|
|
129
|
+
next(err);
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
/*
|
|
135
|
+
* Update task status (InProgress, Completed, Error)
|
|
136
|
+
* Validates aiAgentId and aiAgentKey before updating
|
|
137
|
+
*/
|
|
138
|
+
this.router.post(
|
|
139
|
+
`${new this.entityType().getCrudApiPath()?.toString()}/update-task-status`,
|
|
140
|
+
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
|
141
|
+
try {
|
|
142
|
+
const data: JSONObject = req.body;
|
|
143
|
+
|
|
144
|
+
/* Validate AI Agent credentials */
|
|
145
|
+
const aiAgent: AIAgent | null = await this.validateAIAgent(data);
|
|
146
|
+
|
|
147
|
+
if (!aiAgent) {
|
|
148
|
+
return Response.sendErrorResponse(
|
|
149
|
+
req,
|
|
150
|
+
res,
|
|
151
|
+
new BadDataException("Invalid AI Agent ID or AI Agent Key"),
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* Validate required fields */
|
|
156
|
+
if (!data["taskId"]) {
|
|
157
|
+
return Response.sendErrorResponse(
|
|
158
|
+
req,
|
|
159
|
+
res,
|
|
160
|
+
new BadDataException("taskId is required"),
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (!data["status"]) {
|
|
165
|
+
return Response.sendErrorResponse(
|
|
166
|
+
req,
|
|
167
|
+
res,
|
|
168
|
+
new BadDataException("status is required"),
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const taskId: ObjectID = new ObjectID(data["taskId"] as string);
|
|
173
|
+
const status: AIAgentTaskStatus = data["status"] as AIAgentTaskStatus;
|
|
174
|
+
const statusMessage: string | undefined = data["statusMessage"] as
|
|
175
|
+
| string
|
|
176
|
+
| undefined;
|
|
177
|
+
|
|
178
|
+
/* Validate status value */
|
|
179
|
+
const validStatuses: Array<AIAgentTaskStatus> = [
|
|
180
|
+
AIAgentTaskStatus.InProgress,
|
|
181
|
+
AIAgentTaskStatus.Completed,
|
|
182
|
+
AIAgentTaskStatus.Error,
|
|
183
|
+
];
|
|
184
|
+
|
|
185
|
+
if (!validStatuses.includes(status)) {
|
|
186
|
+
return Response.sendErrorResponse(
|
|
187
|
+
req,
|
|
188
|
+
res,
|
|
189
|
+
new BadDataException(
|
|
190
|
+
`Invalid status. Must be one of: ${validStatuses.join(", ")}`,
|
|
191
|
+
),
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* Check if task exists */
|
|
196
|
+
const existingTask: AIAgentTask | null =
|
|
197
|
+
await AIAgentTaskService.findOneById({
|
|
198
|
+
id: taskId,
|
|
199
|
+
select: {
|
|
200
|
+
_id: true,
|
|
201
|
+
status: true,
|
|
202
|
+
},
|
|
203
|
+
props: {
|
|
204
|
+
isRoot: true,
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
if (!existingTask) {
|
|
209
|
+
return Response.sendErrorResponse(
|
|
210
|
+
req,
|
|
211
|
+
res,
|
|
212
|
+
new BadDataException("Task not found"),
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* Update the task based on status */
|
|
217
|
+
if (status === AIAgentTaskStatus.InProgress) {
|
|
218
|
+
await AIAgentTaskService.updateOneById({
|
|
219
|
+
id: taskId,
|
|
220
|
+
data: {
|
|
221
|
+
status: status,
|
|
222
|
+
...(aiAgent.id && { aiAgentId: aiAgent.id }),
|
|
223
|
+
startedAt: OneUptimeDate.getCurrentDate(),
|
|
224
|
+
...(statusMessage && { statusMessage: statusMessage }),
|
|
225
|
+
},
|
|
226
|
+
props: {
|
|
227
|
+
isRoot: true,
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
} else if (
|
|
231
|
+
status === AIAgentTaskStatus.Completed ||
|
|
232
|
+
status === AIAgentTaskStatus.Error
|
|
233
|
+
) {
|
|
234
|
+
await AIAgentTaskService.updateOneById({
|
|
235
|
+
id: taskId,
|
|
236
|
+
data: {
|
|
237
|
+
status: status,
|
|
238
|
+
completedAt: OneUptimeDate.getCurrentDate(),
|
|
239
|
+
...(statusMessage && { statusMessage: statusMessage }),
|
|
240
|
+
},
|
|
241
|
+
props: {
|
|
242
|
+
isRoot: true,
|
|
243
|
+
},
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return Response.sendJsonObjectResponse(req, res, {
|
|
248
|
+
taskId: taskId.toString(),
|
|
249
|
+
status: status,
|
|
250
|
+
message: "Task status updated successfully",
|
|
251
|
+
});
|
|
252
|
+
} catch (err) {
|
|
253
|
+
next(err);
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/*
|
|
260
|
+
* Validate AI Agent credentials from request body
|
|
261
|
+
* Returns AIAgent if valid, null otherwise
|
|
262
|
+
*/
|
|
263
|
+
private async validateAIAgent(data: JSONObject): Promise<AIAgent | null> {
|
|
264
|
+
if (!data["aiAgentId"] || !data["aiAgentKey"]) {
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const aiAgentId: ObjectID = new ObjectID(data["aiAgentId"] as string);
|
|
269
|
+
const aiAgentKey: string = data["aiAgentKey"] as string;
|
|
270
|
+
|
|
271
|
+
const aiAgent: AIAgent | null = await AIAgentService.findOneBy({
|
|
272
|
+
query: {
|
|
273
|
+
_id: aiAgentId.toString(),
|
|
274
|
+
key: aiAgentKey,
|
|
275
|
+
},
|
|
276
|
+
select: {
|
|
277
|
+
_id: true,
|
|
278
|
+
},
|
|
279
|
+
props: {
|
|
280
|
+
isRoot: true,
|
|
281
|
+
},
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
return aiAgent;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import AIAgentTaskLogService, {
|
|
2
|
+
Service as AIAgentTaskLogServiceType,
|
|
3
|
+
} from "../Services/AIAgentTaskLogService";
|
|
4
|
+
import AIAgentService from "../Services/AIAgentService";
|
|
5
|
+
import AIAgentTaskService from "../Services/AIAgentTaskService";
|
|
6
|
+
import {
|
|
7
|
+
ExpressRequest,
|
|
8
|
+
ExpressResponse,
|
|
9
|
+
NextFunction,
|
|
10
|
+
} from "../Utils/Express";
|
|
11
|
+
import Response from "../Utils/Response";
|
|
12
|
+
import BaseAPI from "./BaseAPI";
|
|
13
|
+
import AIAgentTaskLog from "../../Models/DatabaseModels/AIAgentTaskLog";
|
|
14
|
+
import AIAgent from "../../Models/DatabaseModels/AIAgent";
|
|
15
|
+
import AIAgentTask from "../../Models/DatabaseModels/AIAgentTask";
|
|
16
|
+
import BadDataException from "../../Types/Exception/BadDataException";
|
|
17
|
+
import { JSONObject } from "../../Types/JSON";
|
|
18
|
+
import ObjectID from "../../Types/ObjectID";
|
|
19
|
+
import LogSeverity from "../../Types/Log/LogSeverity";
|
|
20
|
+
|
|
21
|
+
export default class AIAgentTaskLogAPI extends BaseAPI<
|
|
22
|
+
AIAgentTaskLog,
|
|
23
|
+
AIAgentTaskLogServiceType
|
|
24
|
+
> {
|
|
25
|
+
public constructor() {
|
|
26
|
+
super(AIAgentTaskLog, AIAgentTaskLogService);
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
* Create a log entry for an AI Agent task
|
|
30
|
+
* Validates aiAgentId and aiAgentKey before creating log
|
|
31
|
+
*/
|
|
32
|
+
this.router.post(
|
|
33
|
+
`${new this.entityType().getCrudApiPath()?.toString()}/create-log`,
|
|
34
|
+
async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
|
|
35
|
+
try {
|
|
36
|
+
const data: JSONObject = req.body;
|
|
37
|
+
|
|
38
|
+
/* Validate AI Agent credentials */
|
|
39
|
+
const aiAgent: AIAgent | null = await this.validateAIAgent(data);
|
|
40
|
+
|
|
41
|
+
if (!aiAgent) {
|
|
42
|
+
return Response.sendErrorResponse(
|
|
43
|
+
req,
|
|
44
|
+
res,
|
|
45
|
+
new BadDataException("Invalid AI Agent ID or AI Agent Key"),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Validate required fields */
|
|
50
|
+
if (!data["taskId"]) {
|
|
51
|
+
return Response.sendErrorResponse(
|
|
52
|
+
req,
|
|
53
|
+
res,
|
|
54
|
+
new BadDataException("taskId is required"),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!data["severity"]) {
|
|
59
|
+
return Response.sendErrorResponse(
|
|
60
|
+
req,
|
|
61
|
+
res,
|
|
62
|
+
new BadDataException("severity is required"),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (!data["message"]) {
|
|
67
|
+
return Response.sendErrorResponse(
|
|
68
|
+
req,
|
|
69
|
+
res,
|
|
70
|
+
new BadDataException("message is required"),
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const taskId: ObjectID = new ObjectID(data["taskId"] as string);
|
|
75
|
+
const severity: LogSeverity = data["severity"] as LogSeverity;
|
|
76
|
+
const message: string = data["message"] as string;
|
|
77
|
+
|
|
78
|
+
/* Validate severity value */
|
|
79
|
+
const validSeverities: Array<LogSeverity> =
|
|
80
|
+
Object.values(LogSeverity);
|
|
81
|
+
if (!validSeverities.includes(severity)) {
|
|
82
|
+
return Response.sendErrorResponse(
|
|
83
|
+
req,
|
|
84
|
+
res,
|
|
85
|
+
new BadDataException(
|
|
86
|
+
`Invalid severity. Must be one of: ${validSeverities.join(", ")}`,
|
|
87
|
+
),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Check if task exists and get project ID */
|
|
92
|
+
const existingTask: AIAgentTask | null =
|
|
93
|
+
await AIAgentTaskService.findOneById({
|
|
94
|
+
id: taskId,
|
|
95
|
+
select: {
|
|
96
|
+
_id: true,
|
|
97
|
+
projectId: true,
|
|
98
|
+
},
|
|
99
|
+
props: {
|
|
100
|
+
isRoot: true,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
if (!existingTask) {
|
|
105
|
+
return Response.sendErrorResponse(
|
|
106
|
+
req,
|
|
107
|
+
res,
|
|
108
|
+
new BadDataException("Task not found"),
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Create the log entry */
|
|
113
|
+
const logEntry: AIAgentTaskLog = new AIAgentTaskLog();
|
|
114
|
+
logEntry.projectId = existingTask.projectId!;
|
|
115
|
+
logEntry.aiAgentTaskId = taskId;
|
|
116
|
+
logEntry.aiAgentId = aiAgent.id!;
|
|
117
|
+
logEntry.severity = severity;
|
|
118
|
+
logEntry.message = message;
|
|
119
|
+
|
|
120
|
+
await AIAgentTaskLogService.create({
|
|
121
|
+
data: logEntry,
|
|
122
|
+
props: {
|
|
123
|
+
isRoot: true,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
return Response.sendJsonObjectResponse(req, res, {
|
|
128
|
+
taskId: taskId.toString(),
|
|
129
|
+
message: "Log entry created successfully",
|
|
130
|
+
});
|
|
131
|
+
} catch (err) {
|
|
132
|
+
next(err);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/*
|
|
139
|
+
* Validate AI Agent credentials from request body
|
|
140
|
+
* Returns AIAgent if valid, null otherwise
|
|
141
|
+
*/
|
|
142
|
+
private async validateAIAgent(data: JSONObject): Promise<AIAgent | null> {
|
|
143
|
+
if (!data["aiAgentId"] || !data["aiAgentKey"]) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const aiAgentId: ObjectID = new ObjectID(data["aiAgentId"] as string);
|
|
148
|
+
const aiAgentKey: string = data["aiAgentKey"] as string;
|
|
149
|
+
|
|
150
|
+
const aiAgent: AIAgent | null = await AIAgentService.findOneBy({
|
|
151
|
+
query: {
|
|
152
|
+
_id: aiAgentId.toString(),
|
|
153
|
+
key: aiAgentKey,
|
|
154
|
+
},
|
|
155
|
+
select: {
|
|
156
|
+
_id: true,
|
|
157
|
+
},
|
|
158
|
+
props: {
|
|
159
|
+
isRoot: true,
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
return aiAgent;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import AIAgentTaskPullRequestService, {
|
|
2
|
+
Service as AIAgentTaskPullRequestServiceType,
|
|
3
|
+
} from "../Services/AIAgentTaskPullRequestService";
|
|
4
|
+
import BaseAPI from "./BaseAPI";
|
|
5
|
+
import AIAgentTaskPullRequest from "../../Models/DatabaseModels/AIAgentTaskPullRequest";
|
|
6
|
+
|
|
7
|
+
export default class AIAgentTaskPullRequestAPI extends BaseAPI<
|
|
8
|
+
AIAgentTaskPullRequest,
|
|
9
|
+
AIAgentTaskPullRequestServiceType
|
|
10
|
+
> {
|
|
11
|
+
public constructor() {
|
|
12
|
+
super(AIAgentTaskPullRequest, AIAgentTaskPullRequestService);
|
|
13
|
+
}
|
|
14
|
+
}
|
package/Server/API/GitHubAPI.ts
CHANGED
|
@@ -7,12 +7,13 @@ import Response from "../Utils/Response";
|
|
|
7
7
|
import BadDataException from "../../Types/Exception/BadDataException";
|
|
8
8
|
import logger from "../Utils/Logger";
|
|
9
9
|
import { JSONObject } from "../../Types/JSON";
|
|
10
|
-
import { DashboardClientUrl,
|
|
10
|
+
import { DashboardClientUrl, GitHubAppName } from "../EnvironmentConfig";
|
|
11
11
|
import ObjectID from "../../Types/ObjectID";
|
|
12
12
|
import GitHubUtil, {
|
|
13
13
|
GitHubRepository,
|
|
14
14
|
} from "../Utils/CodeRepository/GitHub/GitHub";
|
|
15
15
|
import CodeRepositoryService from "../Services/CodeRepositoryService";
|
|
16
|
+
import ProjectService from "../Services/ProjectService";
|
|
16
17
|
import CodeRepository from "../../Models/DatabaseModels/CodeRepository";
|
|
17
18
|
import CodeRepositoryType from "../../Types/CodeRepository/CodeRepositoryType";
|
|
18
19
|
import URL from "../../Types/API/URL";
|
|
@@ -91,10 +92,21 @@ export default class GitHubAPI {
|
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
/*
|
|
94
|
-
* Store the installation ID
|
|
95
|
-
*
|
|
95
|
+
* Store the installation ID in the project
|
|
96
|
+
* This allows reuse when connecting additional repositories
|
|
96
97
|
*/
|
|
97
|
-
|
|
98
|
+
await ProjectService.updateOneById({
|
|
99
|
+
id: new ObjectID(projectId),
|
|
100
|
+
data: {
|
|
101
|
+
gitHubAppInstallationId: installationId,
|
|
102
|
+
},
|
|
103
|
+
props: {
|
|
104
|
+
isRoot: true,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Redirect back to dashboard with installation ID
|
|
109
|
+
const redirectUrl: string = `${DashboardClientUrl.toString()}/${projectId}/code-repository?installation_id=${installationId}`;
|
|
98
110
|
|
|
99
111
|
return Response.redirect(req, res, URL.fromString(redirectUrl));
|
|
100
112
|
} catch (error) {
|
|
@@ -116,12 +128,12 @@ export default class GitHubAPI {
|
|
|
116
128
|
"/github/auth/install",
|
|
117
129
|
async (req: ExpressRequest, res: ExpressResponse) => {
|
|
118
130
|
try {
|
|
119
|
-
if (!
|
|
131
|
+
if (!GitHubAppName) {
|
|
120
132
|
return Response.sendErrorResponse(
|
|
121
133
|
req,
|
|
122
134
|
res,
|
|
123
135
|
new BadDataException(
|
|
124
|
-
"GitHub App is not configured. Please set
|
|
136
|
+
"GitHub App is not configured. Please set GITHUB_APP_NAME.",
|
|
125
137
|
),
|
|
126
138
|
);
|
|
127
139
|
}
|
|
@@ -146,7 +158,7 @@ export default class GitHubAPI {
|
|
|
146
158
|
JSON.stringify({ projectId, userId }),
|
|
147
159
|
).toString("base64");
|
|
148
160
|
|
|
149
|
-
const installUrl: string = `https://github.com/apps/${
|
|
161
|
+
const installUrl: string = `https://github.com/apps/${GitHubAppName}/installations/new?state=${state}`;
|
|
150
162
|
|
|
151
163
|
return Response.redirect(req, res, URL.fromString(installUrl));
|
|
152
164
|
} catch (error) {
|
|
@@ -220,6 +232,8 @@ export default class GitHubAPI {
|
|
|
220
232
|
body["defaultBranch"]?.toString();
|
|
221
233
|
const repositoryUrl: string | undefined =
|
|
222
234
|
body["repositoryUrl"]?.toString();
|
|
235
|
+
const description: string | undefined =
|
|
236
|
+
body["description"]?.toString();
|
|
223
237
|
|
|
224
238
|
if (!projectId) {
|
|
225
239
|
return Response.sendErrorResponse(
|
|
@@ -267,6 +281,10 @@ export default class GitHubAPI {
|
|
|
267
281
|
codeRepository.repositoryUrl = URL.fromString(repositoryUrl);
|
|
268
282
|
}
|
|
269
283
|
|
|
284
|
+
if (description) {
|
|
285
|
+
codeRepository.description = description;
|
|
286
|
+
}
|
|
287
|
+
|
|
270
288
|
const createdRepository: CodeRepository =
|
|
271
289
|
await CodeRepositoryService.create({
|
|
272
290
|
data: codeRepository,
|