@oneuptime/common 9.2.12 → 9.2.14
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/AlertInternalNote.ts +29 -0
- package/Models/DatabaseModels/IncidentInternalNote.ts +29 -0
- package/Models/DatabaseModels/IncidentPublicNote.ts +29 -0
- package/Models/DatabaseModels/Index.ts +3 -11
- package/Models/DatabaseModels/{CopilotPullRequest.ts → LlmProvider.ts} +243 -248
- package/Models/DatabaseModels/ScheduledMaintenanceInternalNote.ts +29 -0
- package/Models/DatabaseModels/ScheduledMaintenancePublicNote.ts +29 -0
- package/Server/API/LlmProviderAPI.ts +57 -0
- package/Server/API/MicrosoftTeamsAPI.ts +2 -146
- package/Server/API/SlackAPI.ts +105 -0
- package/Server/API/StatusPageAPI.ts +6 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1765477339178-MigrationName.ts +71 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1765540325149-MigrationName.ts +45 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1765540549739-MigrationName.ts +61 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1765544010078-MigrationName.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Middleware/SlackAuthorization.ts +4 -1
- package/Server/Services/AlertInternalNoteService.ts +26 -0
- package/Server/Services/IncidentInternalNoteService.ts +26 -0
- package/Server/Services/IncidentPublicNoteService.ts +26 -0
- package/Server/Services/Index.ts +2 -11
- package/Server/Services/LlmProviderService.ts +100 -0
- package/Server/Services/ScheduledMaintenanceInternalNoteService.ts +26 -0
- package/Server/Services/ScheduledMaintenancePublicNoteService.ts +26 -0
- package/Server/Services/StatusPageService.ts +3 -0
- package/Server/Utils/Express.ts +1 -0
- package/Server/Utils/StartServer.ts +5 -0
- package/Server/Utils/StatusPageResource.ts +89 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +96 -55
- package/Server/Utils/Workspace/Slack/Actions/ActionTypes.ts +16 -0
- package/Server/Utils/Workspace/Slack/Actions/Alert.ts +184 -1
- package/Server/Utils/Workspace/Slack/Actions/Incident.ts +224 -1
- package/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts +232 -1
- package/Server/Utils/Workspace/Slack/Slack.ts +113 -0
- package/Server/Utils/Workspace/Slack/app-manifest.json +13 -2
- package/Tests/Server/Utils/StatusPageResource.test.ts +161 -0
- package/Types/Icon/IconProp.ts +1 -0
- package/Types/LLM/Index.ts +4 -0
- package/Types/LLM/LlmType.ts +7 -0
- package/Types/Permission.ts +38 -113
- package/UI/Components/Icon/Icon.tsx +8 -0
- package/UI/Components/Link/Link.tsx +5 -1
- package/build/dist/Models/DatabaseModels/AlertInternalNote.js +30 -0
- package/build/dist/Models/DatabaseModels/AlertInternalNote.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentInternalNote.js +30 -0
- package/build/dist/Models/DatabaseModels/IncidentInternalNote.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentPublicNote.js +30 -0
- package/build/dist/Models/DatabaseModels/IncidentPublicNote.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -10
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/{CopilotPullRequest.js → LlmProvider.js} +263 -255
- package/build/dist/Models/DatabaseModels/LlmProvider.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceInternalNote.js +30 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceInternalNote.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +30 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenancePublicNote.js.map +1 -1
- package/build/dist/Server/API/LlmProviderAPI.js +36 -0
- package/build/dist/Server/API/LlmProviderAPI.js.map +1 -0
- package/build/dist/Server/API/MicrosoftTeamsAPI.js +2 -91
- package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
- package/build/dist/Server/API/SlackAPI.js +74 -0
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +6 -0
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765477339178-MigrationName.js +30 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765477339178-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765540325149-MigrationName.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765540325149-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765540549739-MigrationName.js +39 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765540549739-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765544010078-MigrationName.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765544010078-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/SlackAuthorization.js +4 -1
- package/build/dist/Server/Middleware/SlackAuthorization.js.map +1 -1
- package/build/dist/Server/Services/AlertInternalNoteService.js +24 -0
- package/build/dist/Server/Services/AlertInternalNoteService.js.map +1 -1
- package/build/dist/Server/Services/IncidentInternalNoteService.js +24 -0
- package/build/dist/Server/Services/IncidentInternalNoteService.js.map +1 -1
- package/build/dist/Server/Services/IncidentPublicNoteService.js +24 -0
- package/build/dist/Server/Services/IncidentPublicNoteService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +2 -10
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/LlmProviderService.js +85 -0
- package/build/dist/Server/Services/LlmProviderService.js.map +1 -0
- package/build/dist/Server/Services/ScheduledMaintenanceInternalNoteService.js +24 -0
- package/build/dist/Server/Services/ScheduledMaintenanceInternalNoteService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js +24 -0
- package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +3 -0
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Utils/Express.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +5 -0
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/StatusPageResource.js +68 -0
- package/build/dist/Server/Utils/StatusPageResource.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +73 -42
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ActionTypes.js +13 -0
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ActionTypes.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js +143 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Alert.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js +173 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js +173 -1
- package/build/dist/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +92 -0
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/app-manifest.json +12 -2
- package/build/dist/Tests/Server/Utils/StatusPageResource.test.js +122 -0
- package/build/dist/Tests/Server/Utils/StatusPageResource.test.js.map +1 -0
- package/build/dist/Types/Icon/IconProp.js +1 -0
- package/build/dist/Types/Icon/IconProp.js.map +1 -1
- package/build/dist/Types/LLM/Index.js +4 -0
- package/build/dist/Types/LLM/Index.js.map +1 -0
- package/build/dist/Types/LLM/LlmType.js +8 -0
- package/build/dist/Types/LLM/LlmType.js.map +1 -0
- package/build/dist/Types/Permission.js +32 -97
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +3 -0
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/Link/Link.js +4 -1
- package/build/dist/UI/Components/Link/Link.js.map +1 -1
- package/package.json +5 -1
- package/Models/DatabaseModels/CopilotAction.ts +0 -772
- package/Models/DatabaseModels/CopilotActionTypePriority.ts +0 -340
- package/Models/DatabaseModels/CopilotCodeRepository.ts +0 -637
- package/Models/DatabaseModels/ServiceCopilotCodeRepository.ts +0 -544
- package/Server/API/CopilotActionAPI.ts +0 -418
- package/Server/API/CopilotCodeRepositoryAPI.ts +0 -127
- package/Server/API/CopilotPullRequestAPI.ts +0 -243
- package/Server/Docs/CodeRepository.md +0 -43
- package/Server/Middleware/CodeRepositoryAuthorization.ts +0 -50
- package/Server/Services/CopilotActionService.ts +0 -10
- package/Server/Services/CopilotActionTypePriorityService.ts +0 -67
- package/Server/Services/CopilotCodeRepositoryService.ts +0 -62
- package/Server/Services/CopilotPullRequestService.ts +0 -10
- package/Server/Services/ServiceCopilotCodeRepositoryService.ts +0 -10
- package/Types/Copilot/CopilotActionProps/DirectoryActionProp.ts +0 -3
- package/Types/Copilot/CopilotActionProps/ExceptionActionProp.ts +0 -4
- package/Types/Copilot/CopilotActionProps/FileActionProp.ts +0 -7
- package/Types/Copilot/CopilotActionProps/FunctionActionProp.ts +0 -5
- package/Types/Copilot/CopilotActionProps/Index.ts +0 -96
- package/Types/Copilot/CopilotActionProps/SpanActionProp.ts +0 -4
- package/Types/Copilot/CopilotActionStatus.ts +0 -114
- package/Types/Copilot/CopilotActionType.ts +0 -212
- package/build/dist/Models/DatabaseModels/CopilotAction.js +0 -793
- package/build/dist/Models/DatabaseModels/CopilotAction.js.map +0 -1
- package/build/dist/Models/DatabaseModels/CopilotActionTypePriority.js +0 -358
- package/build/dist/Models/DatabaseModels/CopilotActionTypePriority.js.map +0 -1
- package/build/dist/Models/DatabaseModels/CopilotCodeRepository.js +0 -656
- package/build/dist/Models/DatabaseModels/CopilotCodeRepository.js.map +0 -1
- package/build/dist/Models/DatabaseModels/CopilotPullRequest.js.map +0 -1
- package/build/dist/Models/DatabaseModels/ServiceCopilotCodeRepository.js +0 -561
- package/build/dist/Models/DatabaseModels/ServiceCopilotCodeRepository.js.map +0 -1
- package/build/dist/Server/API/CopilotActionAPI.js +0 -295
- package/build/dist/Server/API/CopilotActionAPI.js.map +0 -1
- package/build/dist/Server/API/CopilotCodeRepositoryAPI.js +0 -91
- package/build/dist/Server/API/CopilotCodeRepositoryAPI.js.map +0 -1
- package/build/dist/Server/API/CopilotPullRequestAPI.js +0 -166
- package/build/dist/Server/API/CopilotPullRequestAPI.js.map +0 -1
- package/build/dist/Server/Middleware/CodeRepositoryAuthorization.js +0 -48
- package/build/dist/Server/Middleware/CodeRepositoryAuthorization.js.map +0 -1
- package/build/dist/Server/Services/CopilotActionService.js +0 -9
- package/build/dist/Server/Services/CopilotActionService.js.map +0 -1
- package/build/dist/Server/Services/CopilotActionTypePriorityService.js +0 -61
- package/build/dist/Server/Services/CopilotActionTypePriorityService.js.map +0 -1
- package/build/dist/Server/Services/CopilotCodeRepositoryService.js +0 -61
- package/build/dist/Server/Services/CopilotCodeRepositoryService.js.map +0 -1
- package/build/dist/Server/Services/CopilotPullRequestService.js +0 -9
- package/build/dist/Server/Services/CopilotPullRequestService.js.map +0 -1
- package/build/dist/Server/Services/ServiceCopilotCodeRepositoryService.js +0 -9
- package/build/dist/Server/Services/ServiceCopilotCodeRepositoryService.js.map +0 -1
- package/build/dist/Types/Copilot/CopilotActionProps/DirectoryActionProp.js +0 -2
- package/build/dist/Types/Copilot/CopilotActionProps/DirectoryActionProp.js.map +0 -1
- package/build/dist/Types/Copilot/CopilotActionProps/ExceptionActionProp.js +0 -2
- package/build/dist/Types/Copilot/CopilotActionProps/ExceptionActionProp.js.map +0 -1
- package/build/dist/Types/Copilot/CopilotActionProps/FileActionProp.js +0 -2
- package/build/dist/Types/Copilot/CopilotActionProps/FileActionProp.js.map +0 -1
- package/build/dist/Types/Copilot/CopilotActionProps/FunctionActionProp.js +0 -2
- package/build/dist/Types/Copilot/CopilotActionProps/FunctionActionProp.js.map +0 -1
- package/build/dist/Types/Copilot/CopilotActionProps/Index.js +0 -64
- package/build/dist/Types/Copilot/CopilotActionProps/Index.js.map +0 -1
- package/build/dist/Types/Copilot/CopilotActionProps/SpanActionProp.js +0 -2
- package/build/dist/Types/Copilot/CopilotActionProps/SpanActionProp.js.map +0 -1
- package/build/dist/Types/Copilot/CopilotActionStatus.js +0 -96
- package/build/dist/Types/Copilot/CopilotActionStatus.js.map +0 -1
- package/build/dist/Types/Copilot/CopilotActionType.js +0 -175
- package/build/dist/Types/Copilot/CopilotActionType.js.map +0 -1
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
enum CopilotActionStatus {
|
|
2
|
-
// Processed States.
|
|
3
|
-
PR_CREATED = "Pull Request Created", // PR created and waiting for review
|
|
4
|
-
NO_ACTION_REQUIRED = "No Action Required", // Code is all good. No action required. No PR created.
|
|
5
|
-
CANNOT_FIX = "Cannot Fix", // OneUptime Copilot tried to fix the issue but failed.
|
|
6
|
-
|
|
7
|
-
// Processing States
|
|
8
|
-
PROCESSING = "Processing", // Action is being processed.
|
|
9
|
-
|
|
10
|
-
// In Queue
|
|
11
|
-
IN_QUEUE = "In Queue", // Action is in queue.
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface CopilotActionStatusData {
|
|
15
|
-
status: CopilotActionStatus;
|
|
16
|
-
description: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export class CopilotActionStatusUtil {
|
|
20
|
-
public static getAllCopilotActionStatuses(): Array<CopilotActionStatus> {
|
|
21
|
-
return [
|
|
22
|
-
CopilotActionStatus.PR_CREATED,
|
|
23
|
-
CopilotActionStatus.NO_ACTION_REQUIRED,
|
|
24
|
-
CopilotActionStatus.CANNOT_FIX,
|
|
25
|
-
CopilotActionStatus.PROCESSING,
|
|
26
|
-
CopilotActionStatus.IN_QUEUE,
|
|
27
|
-
];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public static getCopilotActionStatus(status: string): CopilotActionStatus {
|
|
31
|
-
switch (status) {
|
|
32
|
-
case CopilotActionStatus.PR_CREATED:
|
|
33
|
-
return CopilotActionStatus.PR_CREATED;
|
|
34
|
-
case CopilotActionStatus.NO_ACTION_REQUIRED:
|
|
35
|
-
return CopilotActionStatus.NO_ACTION_REQUIRED;
|
|
36
|
-
case CopilotActionStatus.CANNOT_FIX:
|
|
37
|
-
return CopilotActionStatus.CANNOT_FIX;
|
|
38
|
-
case CopilotActionStatus.PROCESSING:
|
|
39
|
-
return CopilotActionStatus.PROCESSING;
|
|
40
|
-
case CopilotActionStatus.IN_QUEUE:
|
|
41
|
-
return CopilotActionStatus.IN_QUEUE;
|
|
42
|
-
default:
|
|
43
|
-
throw new Error(`Invalid CopilotActionStatus: ${status}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public static isCopilotActionStatus(status: string): boolean {
|
|
48
|
-
return CopilotActionStatusUtil.getAllCopilotActionStatuses().includes(
|
|
49
|
-
status as CopilotActionStatus,
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
public static isCopilotActionStatusArray(statuses: Array<string>): boolean {
|
|
54
|
-
return statuses.every((status: string) => {
|
|
55
|
-
return CopilotActionStatusUtil.isCopilotActionStatus(status);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// get processing status
|
|
60
|
-
public static getProcessingStatus(): CopilotActionStatus {
|
|
61
|
-
return CopilotActionStatus.PROCESSING;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// get in queue status
|
|
65
|
-
public static getInQueueStatus(): CopilotActionStatus {
|
|
66
|
-
return CopilotActionStatus.IN_QUEUE;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// get processed status
|
|
70
|
-
public static getProcessedStatus(): Array<CopilotActionStatus> {
|
|
71
|
-
return [
|
|
72
|
-
CopilotActionStatus.PR_CREATED,
|
|
73
|
-
CopilotActionStatus.NO_ACTION_REQUIRED,
|
|
74
|
-
CopilotActionStatus.CANNOT_FIX,
|
|
75
|
-
];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// get copilot actiomn status data
|
|
79
|
-
public static getCopilotActionStatusData(
|
|
80
|
-
status: CopilotActionStatus,
|
|
81
|
-
): CopilotActionStatusData {
|
|
82
|
-
switch (status) {
|
|
83
|
-
case CopilotActionStatus.PR_CREATED:
|
|
84
|
-
return {
|
|
85
|
-
status: CopilotActionStatus.PR_CREATED,
|
|
86
|
-
description: "Pull Request Created",
|
|
87
|
-
};
|
|
88
|
-
case CopilotActionStatus.NO_ACTION_REQUIRED:
|
|
89
|
-
return {
|
|
90
|
-
status: CopilotActionStatus.NO_ACTION_REQUIRED,
|
|
91
|
-
description: "No Action Required",
|
|
92
|
-
};
|
|
93
|
-
case CopilotActionStatus.CANNOT_FIX:
|
|
94
|
-
return {
|
|
95
|
-
status: CopilotActionStatus.CANNOT_FIX,
|
|
96
|
-
description: "Cannot Fix",
|
|
97
|
-
};
|
|
98
|
-
case CopilotActionStatus.PROCESSING:
|
|
99
|
-
return {
|
|
100
|
-
status: CopilotActionStatus.PROCESSING,
|
|
101
|
-
description: "Processing",
|
|
102
|
-
};
|
|
103
|
-
case CopilotActionStatus.IN_QUEUE:
|
|
104
|
-
return {
|
|
105
|
-
status: CopilotActionStatus.IN_QUEUE,
|
|
106
|
-
description: "In Queue",
|
|
107
|
-
};
|
|
108
|
-
default:
|
|
109
|
-
throw new Error(`Invalid CopilotActionStatus: ${status}`);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export default CopilotActionStatus;
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
enum CopilotActionType {
|
|
2
|
-
IMPROVE_COMMENTS = "Improve Comments",
|
|
3
|
-
ADD_COMMENTS = "Add Comments",
|
|
4
|
-
|
|
5
|
-
IMPROVE_README = "Improve Readme",
|
|
6
|
-
ADD_README = "Add Readme",
|
|
7
|
-
|
|
8
|
-
FIX_GRAMMAR_AND_SPELLING = "Fix Grammar and Spelling",
|
|
9
|
-
IMPROVE_VARIABLE_NAMES = "Improve Variable Names",
|
|
10
|
-
REFACTOR_CODE = "Refactor Code",
|
|
11
|
-
|
|
12
|
-
WRITE_UNIT_TESTS = "Write Unit Tests",
|
|
13
|
-
IMPROVE_UNIT_TESTS = "Improve Unit Tests",
|
|
14
|
-
|
|
15
|
-
IMPROVE_LOGS = "Improve Logs",
|
|
16
|
-
ADD_LOGS = "Add Logs",
|
|
17
|
-
|
|
18
|
-
IMPROVE_SPANS = "Improve Spans",
|
|
19
|
-
ADD_SPANS = "Add Spans",
|
|
20
|
-
|
|
21
|
-
IMPROVE_METRICS = "Improve Metrics",
|
|
22
|
-
ADD_METRICS = "Add Metrics",
|
|
23
|
-
|
|
24
|
-
FIX_EXCEPTIONS = "Fix Exceptions",
|
|
25
|
-
FIX_PERFORMANCE_ISSUES = "Fix Performance Issues",
|
|
26
|
-
FIX_BUGS = "Fix Bugs",
|
|
27
|
-
|
|
28
|
-
// SETUP_ACTIONS
|
|
29
|
-
SETUP_OPEN_TELEMETRY = "Setup OpenTelemetry",
|
|
30
|
-
|
|
31
|
-
// Setup Unit Test Framework
|
|
32
|
-
SETUP_UNIT_TEST_FRAMEWORK = "Setup Unit Test Framework",
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface CopilotActionTypeData {
|
|
36
|
-
type: CopilotActionType;
|
|
37
|
-
description: string;
|
|
38
|
-
defaultPriority: number;
|
|
39
|
-
dependsOn: Array<CopilotActionType>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export class CopilotActionTypeUtil {
|
|
43
|
-
public static getAllCopilotActionTypes(): Array<CopilotActionTypeData> {
|
|
44
|
-
return [
|
|
45
|
-
// Fix broken code.
|
|
46
|
-
{
|
|
47
|
-
type: CopilotActionType.FIX_EXCEPTIONS,
|
|
48
|
-
description: "Fix exceptions in your codebase",
|
|
49
|
-
defaultPriority: 1,
|
|
50
|
-
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: CopilotActionType.FIX_PERFORMANCE_ISSUES,
|
|
54
|
-
description: "Fix performance issues in your codebase",
|
|
55
|
-
defaultPriority: 1,
|
|
56
|
-
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
type: CopilotActionType.FIX_BUGS,
|
|
60
|
-
description: "Fix simple bugs and small issues in your codebase",
|
|
61
|
-
defaultPriority: 1,
|
|
62
|
-
dependsOn: [],
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
// Improve debugging.
|
|
66
|
-
|
|
67
|
-
// add logs, metircs and spans.
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
type: CopilotActionType.ADD_LOGS,
|
|
71
|
-
description: "Add OpenTelemetry logs in your codebase",
|
|
72
|
-
defaultPriority: 2,
|
|
73
|
-
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
type: CopilotActionType.ADD_SPANS,
|
|
77
|
-
description: "Add OpenTelemetry spans in your codebase",
|
|
78
|
-
defaultPriority: 2,
|
|
79
|
-
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
type: CopilotActionType.ADD_METRICS,
|
|
83
|
-
description: "Add OpenTelemetry metrics in your codebase",
|
|
84
|
-
defaultPriority: 2,
|
|
85
|
-
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
type: CopilotActionType.IMPROVE_LOGS,
|
|
89
|
-
description:
|
|
90
|
-
"Improve OpenTelemetry logs in your codebase where required to make debugging easier.",
|
|
91
|
-
defaultPriority: 2,
|
|
92
|
-
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
type: CopilotActionType.IMPROVE_SPANS,
|
|
96
|
-
description:
|
|
97
|
-
"Improve OpenTelemetry spans in your codebase where required to make debugging easier.",
|
|
98
|
-
defaultPriority: 2,
|
|
99
|
-
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
type: CopilotActionType.IMPROVE_METRICS,
|
|
103
|
-
description:
|
|
104
|
-
"Improve OpenTelemetry metrics in your codebase where required to make debugging easier.",
|
|
105
|
-
defaultPriority: 2,
|
|
106
|
-
dependsOn: [CopilotActionType.SETUP_OPEN_TELEMETRY],
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
// Improve code and test quality.
|
|
110
|
-
{
|
|
111
|
-
type: CopilotActionType.REFACTOR_CODE,
|
|
112
|
-
description: "Refactor code and make it into smaller units",
|
|
113
|
-
defaultPriority: 3,
|
|
114
|
-
dependsOn: [],
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
type: CopilotActionType.WRITE_UNIT_TESTS,
|
|
118
|
-
description: "Add unit tests",
|
|
119
|
-
defaultPriority: 3,
|
|
120
|
-
dependsOn: [CopilotActionType.SETUP_UNIT_TEST_FRAMEWORK],
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
type: CopilotActionType.IMPROVE_UNIT_TESTS,
|
|
124
|
-
description: "Improve unit tests",
|
|
125
|
-
defaultPriority: 3,
|
|
126
|
-
dependsOn: [CopilotActionType.SETUP_UNIT_TEST_FRAMEWORK],
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
// add comments.
|
|
130
|
-
{
|
|
131
|
-
type: CopilotActionType.IMPROVE_COMMENTS,
|
|
132
|
-
description: "Improve comments in your codebase",
|
|
133
|
-
defaultPriority: 4,
|
|
134
|
-
dependsOn: [],
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
type: CopilotActionType.ADD_COMMENTS,
|
|
138
|
-
description: "Add comments in your codebase",
|
|
139
|
-
defaultPriority: 4,
|
|
140
|
-
dependsOn: [],
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
// Add or improve README file.
|
|
144
|
-
{
|
|
145
|
-
type: CopilotActionType.ADD_README,
|
|
146
|
-
description: "Add a README file",
|
|
147
|
-
defaultPriority: 4,
|
|
148
|
-
dependsOn: [],
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
type: CopilotActionType.IMPROVE_README,
|
|
152
|
-
description: "Improve the README file",
|
|
153
|
-
defaultPriority: 4,
|
|
154
|
-
dependsOn: [],
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
// Fix grammar and spelling mistakes
|
|
158
|
-
{
|
|
159
|
-
type: CopilotActionType.FIX_GRAMMAR_AND_SPELLING,
|
|
160
|
-
description: "Fix grammar and spelling mistakes",
|
|
161
|
-
defaultPriority: 5,
|
|
162
|
-
dependsOn: [],
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
type: CopilotActionType.IMPROVE_VARIABLE_NAMES,
|
|
166
|
-
description: "Improve variable names and make it understandable",
|
|
167
|
-
defaultPriority: 5,
|
|
168
|
-
dependsOn: [],
|
|
169
|
-
},
|
|
170
|
-
];
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
public static getSetupActionTypes(): Array<CopilotActionTypeData> {
|
|
174
|
-
return [
|
|
175
|
-
{
|
|
176
|
-
type: CopilotActionType.SETUP_OPEN_TELEMETRY,
|
|
177
|
-
description: "Setup OpenTelemetry in your codebase",
|
|
178
|
-
defaultPriority: 1,
|
|
179
|
-
dependsOn: [],
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
type: CopilotActionType.SETUP_UNIT_TEST_FRAMEWORK,
|
|
183
|
-
description: "Setup Unit Test Framework in your codebase",
|
|
184
|
-
defaultPriority: 1,
|
|
185
|
-
dependsOn: [],
|
|
186
|
-
},
|
|
187
|
-
];
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
public static getCopilotActionType(
|
|
191
|
-
type: CopilotActionType,
|
|
192
|
-
): CopilotActionTypeData {
|
|
193
|
-
return this.getAllCopilotActionTypes().find(
|
|
194
|
-
(copilotActionTypeData: CopilotActionTypeData) => {
|
|
195
|
-
return copilotActionTypeData.type === type;
|
|
196
|
-
},
|
|
197
|
-
) as CopilotActionTypeData;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// get actions by priority.
|
|
201
|
-
public static getActionsByPriority(
|
|
202
|
-
priority: number,
|
|
203
|
-
): Array<CopilotActionTypeData> {
|
|
204
|
-
return this.getAllCopilotActionTypes().filter(
|
|
205
|
-
(copilotActionTypeData: CopilotActionTypeData) => {
|
|
206
|
-
return copilotActionTypeData.defaultPriority === priority;
|
|
207
|
-
},
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export default CopilotActionType;
|