@oneuptime/common 7.0.2994 → 7.0.3018
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/AnalyticsModels/ExceptionInstance.ts +488 -0
- package/Models/AnalyticsModels/Index.ts +2 -0
- package/Models/AnalyticsModels/Span.ts +2 -2
- package/Models/DatabaseModels/CopilotAction.ts +232 -38
- package/Models/DatabaseModels/CopilotActionTypePriority.ts +325 -0
- package/Models/DatabaseModels/Index.ts +6 -0
- package/Models/DatabaseModels/TelemetryException.ts +978 -0
- package/Server/API/CopilotActionAPI.ts +69 -7
- package/Server/API/StatusAPI.ts +61 -51
- package/Server/EnvironmentConfig.ts +3 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1724610006927-MigrationName.ts +93 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1724613666632-MigrationName.ts +60 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1724659071843-MigrationName.ts +17 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1725291476867-MigrationName.ts +51 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1725357719072-MigrationName.ts +23 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1725360199561-MigrationName.ts +13 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1725379949648-MigrationName.ts +17 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +14 -0
- package/Server/Infrastructure/QueueWorker.ts +2 -2
- package/Server/Services/CopilotActionTypePriorityService.ts +66 -0
- package/Server/Services/DatabaseService.ts +4 -5
- package/Server/Services/ExceptionInstanceService.ts +11 -0
- package/Server/Services/Index.ts +7 -0
- package/Server/Services/StatusPageDomainService.ts +118 -59
- package/Server/Services/TelemetryExceptionService.ts +10 -0
- package/Server/Types/Database/Permissions/Index.ts +1 -1
- package/Server/Types/Database/UpdateByID.ts +1 -1
- package/Server/Types/Workflow/Components/Email.ts +32 -25
- package/Server/Utils/CodeRepository/CodeRepository.ts +10 -14
- package/Server/Utils/CodeRepository/CodeRepositoryFile.ts +0 -7
- package/Server/Utils/Greenlock/Greenlock.ts +331 -204
- package/Server/Utils/Logger.ts +8 -2
- package/Server/Utils/Telemetry.ts +109 -25
- package/Types/Code/CodeType.ts +1 -0
- package/Types/Copilot/CopilotActionProps/DirectoryActionProp.ts +3 -0
- package/Types/Copilot/CopilotActionProps/ExceptionActionProp.ts +4 -0
- package/Types/Copilot/CopilotActionProps/FileActionProp.ts +5 -0
- package/Types/Copilot/CopilotActionProps/FunctionActionProp.ts +5 -0
- package/Types/Copilot/CopilotActionProps/Index.ts +96 -0
- package/Types/Copilot/CopilotActionProps/SpanActionProp.ts +4 -0
- package/Types/Copilot/CopilotActionStatus.ts +109 -1
- package/Types/Copilot/CopilotActionType.ts +203 -1
- package/Types/Database/PartialEntity.ts +14 -1
- package/Types/Date.ts +9 -1
- package/Types/Icon/IconProp.ts +3 -0
- package/Types/Permission.ts +65 -0
- package/Types/Workflow/Components/Email.ts +4 -4
- package/UI/Components/ActionCard/ActionCard.tsx +66 -0
- package/UI/Components/Alerts/Alert.tsx +69 -60
- package/UI/Components/Card/Card.tsx +1 -0
- package/UI/Components/Detail/Detail.tsx +6 -1
- package/UI/Components/GanttChart/Row/Row.tsx +4 -2
- package/UI/Components/GanttChart/Row/RowLabel.tsx +7 -3
- package/UI/Components/Icon/Icon.tsx +24 -0
- package/UI/Components/LogsViewer/LogsViewer.tsx +1 -1
- package/UI/Components/Types/FieldType.ts +1 -0
- package/UI/Components/Workflow/WorkflowStatus.tsx +2 -2
- package/UI/Config.ts +2 -0
- package/UI/Utils/Telemetry.ts +7 -2
- package/Utils/Crypto.ts +11 -0
- package/build/dist/Models/AnalyticsModels/ExceptionInstance.js +445 -0
- package/build/dist/Models/AnalyticsModels/ExceptionInstance.js.map +1 -0
- package/build/dist/Models/AnalyticsModels/Index.js +2 -0
- package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/Span.js +2 -2
- package/build/dist/Models/DatabaseModels/CopilotAction.js +237 -40
- package/build/dist/Models/DatabaseModels/CopilotAction.js.map +1 -1
- package/build/dist/Models/DatabaseModels/CopilotActionTypePriority.js +343 -0
- package/build/dist/Models/DatabaseModels/CopilotActionTypePriority.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Index.js +4 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryException.js +1010 -0
- package/build/dist/Models/DatabaseModels/TelemetryException.js.map +1 -0
- package/build/dist/Server/API/CopilotActionAPI.js +56 -9
- package/build/dist/Server/API/CopilotActionAPI.js.map +1 -1
- package/build/dist/Server/API/StatusAPI.js +51 -44
- package/build/dist/Server/API/StatusAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +1 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1724610006927-MigrationName.js +38 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1724610006927-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1724613666632-MigrationName.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1724613666632-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1724659071843-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1724659071843-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725291476867-MigrationName.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725291476867-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725357719072-MigrationName.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725357719072-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725360199561-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725360199561-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725379949648-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1725379949648-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/QueueWorker.js +2 -2
- package/build/dist/Server/Infrastructure/QueueWorker.js.map +1 -1
- package/build/dist/Server/Services/CopilotActionTypePriorityService.js +45 -0
- package/build/dist/Server/Services/CopilotActionTypePriorityService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/ExceptionInstanceService.js +9 -0
- package/build/dist/Server/Services/ExceptionInstanceService.js.map +1 -0
- package/build/dist/Server/Services/Index.js +6 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/StatusPageDomainService.js +101 -53
- package/build/dist/Server/Services/StatusPageDomainService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryExceptionService.js +9 -0
- package/build/dist/Server/Services/TelemetryExceptionService.js.map +1 -0
- package/build/dist/Server/Types/Database/Permissions/Index.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Email.js +26 -27
- package/build/dist/Server/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/Server/Utils/CodeRepository/CodeRepository.js +5 -13
- package/build/dist/Server/Utils/CodeRepository/CodeRepository.js.map +1 -1
- package/build/dist/Server/Utils/Greenlock/Greenlock.js +234 -157
- package/build/dist/Server/Utils/Greenlock/Greenlock.js.map +1 -1
- package/build/dist/Server/Utils/Logger.js +5 -1
- package/build/dist/Server/Utils/Logger.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry.js +63 -22
- package/build/dist/Server/Utils/Telemetry.js.map +1 -1
- package/build/dist/Types/Code/CodeType.js +1 -0
- package/build/dist/Types/Code/CodeType.js.map +1 -1
- package/build/dist/Types/Copilot/CopilotActionProps/DirectoryActionProp.js +2 -0
- package/build/dist/Types/Copilot/CopilotActionProps/DirectoryActionProp.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionProps/ExceptionActionProp.js +2 -0
- package/build/dist/Types/Copilot/CopilotActionProps/ExceptionActionProp.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionProps/FileActionProp.js +2 -0
- package/build/dist/Types/Copilot/CopilotActionProps/FileActionProp.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionProps/FunctionActionProp.js +2 -0
- package/build/dist/Types/Copilot/CopilotActionProps/FunctionActionProp.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionProps/Index.js +64 -0
- package/build/dist/Types/Copilot/CopilotActionProps/Index.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionProps/SpanActionProp.js +2 -0
- package/build/dist/Types/Copilot/CopilotActionProps/SpanActionProp.js.map +1 -0
- package/build/dist/Types/Copilot/CopilotActionStatus.js +89 -0
- package/build/dist/Types/Copilot/CopilotActionStatus.js.map +1 -1
- package/build/dist/Types/Copilot/CopilotActionType.js +165 -1
- package/build/dist/Types/Copilot/CopilotActionType.js.map +1 -1
- package/build/dist/Types/Database/PartialEntity.js +3 -0
- package/build/dist/Types/Database/PartialEntity.js.map +1 -1
- package/build/dist/Types/Date.js +7 -1
- package/build/dist/Types/Date.js.map +1 -1
- package/build/dist/Types/Icon/IconProp.js +3 -0
- package/build/dist/Types/Icon/IconProp.js.map +1 -1
- package/build/dist/Types/Permission.js +57 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Email.js +4 -4
- package/build/dist/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/UI/Components/ActionCard/ActionCard.js +27 -0
- package/build/dist/UI/Components/ActionCard/ActionCard.js.map +1 -0
- package/build/dist/UI/Components/Alerts/Alert.js +36 -45
- package/build/dist/UI/Components/Alerts/Alert.js.map +1 -1
- package/build/dist/UI/Components/Card/Card.js +1 -1
- package/build/dist/UI/Components/Card/Card.js.map +1 -1
- package/build/dist/UI/Components/Detail/Detail.js +5 -1
- package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
- package/build/dist/UI/Components/GanttChart/Row/Row.js +2 -2
- package/build/dist/UI/Components/GanttChart/Row/Row.js.map +1 -1
- package/build/dist/UI/Components/GanttChart/Row/RowLabel.js +3 -3
- package/build/dist/UI/Components/GanttChart/Row/RowLabel.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +9 -0
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +1 -1
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/Types/FieldType.js +1 -0
- package/build/dist/UI/Components/Types/FieldType.js.map +1 -1
- package/build/dist/UI/Components/Workflow/WorkflowStatus.js +2 -2
- package/build/dist/UI/Components/Workflow/WorkflowStatus.js.map +1 -1
- package/build/dist/UI/Config.js +1 -0
- package/build/dist/UI/Config.js.map +1 -1
- package/build/dist/UI/Utils/Telemetry.js +6 -3
- package/build/dist/UI/Utils/Telemetry.js.map +1 -1
- package/build/dist/Utils/Crypto.js +10 -0
- package/build/dist/Utils/Crypto.js.map +1 -0
- package/package.json +11 -11
|
@@ -1,10 +1,212 @@
|
|
|
1
1
|
enum CopilotActionType {
|
|
2
2
|
IMPROVE_COMMENTS = "Improve Comments",
|
|
3
|
-
|
|
3
|
+
ADD_COMMENTS = "Add Comments",
|
|
4
|
+
|
|
5
|
+
IMPROVE_README = "Improve Readme",
|
|
6
|
+
ADD_README = "Add Readme",
|
|
7
|
+
|
|
4
8
|
FIX_GRAMMAR_AND_SPELLING = "Fix Grammar and Spelling",
|
|
5
9
|
IMPROVE_VARIABLE_NAMES = "Improve Variable Names",
|
|
6
10
|
REFACTOR_CODE = "Refactor Code",
|
|
11
|
+
|
|
7
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
|
+
}
|
|
8
210
|
}
|
|
9
211
|
|
|
10
212
|
export default CopilotActionType;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Make all properties in T optional. Deep version.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
type QueryDeepPartialEntity<T> = {
|
|
6
|
+
[P in keyof T]?:
|
|
7
|
+
| (T[P] extends Array<infer U>
|
|
8
|
+
? Array<QueryDeepPartialEntity<U>>
|
|
9
|
+
: T[P] extends ReadonlyArray<infer U>
|
|
10
|
+
? ReadonlyArray<QueryDeepPartialEntity<U>>
|
|
11
|
+
: QueryDeepPartialEntity<T[P]>)
|
|
12
|
+
| (() => string)
|
|
13
|
+
| null;
|
|
14
|
+
};
|
|
2
15
|
|
|
3
16
|
export default QueryDeepPartialEntity;
|
package/Types/Date.ts
CHANGED
|
@@ -9,10 +9,18 @@ import Timezone from "./Timezone";
|
|
|
9
9
|
export const Moment: typeof moment = moment;
|
|
10
10
|
|
|
11
11
|
export default class OneUptimeDate {
|
|
12
|
-
public
|
|
12
|
+
public static convertMinutesToMilliseconds(minutes: number): number {
|
|
13
|
+
return minutes * 60 * 1000;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public static getNanoSecondsFromSeconds(seconds: number): number {
|
|
13
17
|
return seconds * 1000 * 1000 * 1000;
|
|
14
18
|
}
|
|
15
19
|
|
|
20
|
+
public static now(): Date {
|
|
21
|
+
return this.getCurrentDate();
|
|
22
|
+
}
|
|
23
|
+
|
|
16
24
|
public static getDateFromYYYYMMDD(
|
|
17
25
|
year: string,
|
|
18
26
|
month: string,
|
package/Types/Icon/IconProp.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
enum IconProp {
|
|
2
2
|
Equals = "Equals",
|
|
3
|
+
Archive = "Archive",
|
|
3
4
|
File = "File",
|
|
4
5
|
Automation = "Automation",
|
|
5
6
|
Workflow = "Workflow",
|
|
@@ -15,6 +16,8 @@ enum IconProp {
|
|
|
15
16
|
CursorArrowRays = "CursorArrowRays",
|
|
16
17
|
ArrowUpDown = "ArrowUpDown",
|
|
17
18
|
Cube = "Cube",
|
|
19
|
+
Unarchive = "Unarchive",
|
|
20
|
+
CPUChip = "CPUChip",
|
|
18
21
|
Swatch = "Swatch",
|
|
19
22
|
Squares = "Squares",
|
|
20
23
|
RectangleStack = "RectangleStack",
|
package/Types/Permission.ts
CHANGED
|
@@ -53,6 +53,12 @@ enum Permission {
|
|
|
53
53
|
EditTelemetryServiceLog = "EditTelemetryServiceLog",
|
|
54
54
|
ReadTelemetryServiceLog = "ReadTelemetryServiceLog",
|
|
55
55
|
|
|
56
|
+
// Exceptions
|
|
57
|
+
CreateTelemetryException = "CreateTelemetryException",
|
|
58
|
+
DeleteTelemetryException = "DeleteTelemetryException",
|
|
59
|
+
EditTelemetryException = "EditTelemetryException",
|
|
60
|
+
ReadTelemetryException = "ReadTelemetryException",
|
|
61
|
+
|
|
56
62
|
// Spans
|
|
57
63
|
CreateTelemetryServiceTraces = "CreateTelemetryServiceTraces",
|
|
58
64
|
DeleteTelemetryServiceTraces = "DeleteTelemetryServiceTraces",
|
|
@@ -493,6 +499,9 @@ enum Permission {
|
|
|
493
499
|
ReadCopilotCodeRepository = "ReadCopilotCodeRepository",
|
|
494
500
|
|
|
495
501
|
ReadCopilotAction = "ReadCopilotAction",
|
|
502
|
+
CreateCopilotAction = "CreateCopilotAction",
|
|
503
|
+
DeleteCopilotAction = "DeleteCopilotAction",
|
|
504
|
+
EditCopilotAction = "EditCopilotAction",
|
|
496
505
|
|
|
497
506
|
ReadCopilotPullRequest = "ReadCopilotPullRequest",
|
|
498
507
|
|
|
@@ -2445,6 +2454,39 @@ export class PermissionHelper {
|
|
|
2445
2454
|
isAccessControlPermission: false,
|
|
2446
2455
|
},
|
|
2447
2456
|
|
|
2457
|
+
{
|
|
2458
|
+
permission: Permission.CreateTelemetryException,
|
|
2459
|
+
title: "Create Telemetry Service Exception",
|
|
2460
|
+
description:
|
|
2461
|
+
"This permission can create Telemetry Service Exception this project.",
|
|
2462
|
+
isAssignableToTenant: true,
|
|
2463
|
+
isAccessControlPermission: false,
|
|
2464
|
+
},
|
|
2465
|
+
{
|
|
2466
|
+
permission: Permission.DeleteTelemetryException,
|
|
2467
|
+
title: "Delete Telemetry Service Exception",
|
|
2468
|
+
description:
|
|
2469
|
+
"This permission can delete Telemetry Service Exception of this project.",
|
|
2470
|
+
isAssignableToTenant: true,
|
|
2471
|
+
isAccessControlPermission: false,
|
|
2472
|
+
},
|
|
2473
|
+
{
|
|
2474
|
+
permission: Permission.EditTelemetryException,
|
|
2475
|
+
title: "Edit Telemetry Service Exception",
|
|
2476
|
+
description:
|
|
2477
|
+
"This permission can edit Telemetry Service Exception of this project.",
|
|
2478
|
+
isAssignableToTenant: true,
|
|
2479
|
+
isAccessControlPermission: false,
|
|
2480
|
+
},
|
|
2481
|
+
{
|
|
2482
|
+
permission: Permission.ReadTelemetryException,
|
|
2483
|
+
title: "Read Telemetry Service Exception",
|
|
2484
|
+
description:
|
|
2485
|
+
"This permission can read Telemetry Service Exception of this project.",
|
|
2486
|
+
isAssignableToTenant: true,
|
|
2487
|
+
isAccessControlPermission: false,
|
|
2488
|
+
},
|
|
2489
|
+
|
|
2448
2490
|
{
|
|
2449
2491
|
permission: Permission.CreateCopilotCodeRepository,
|
|
2450
2492
|
title: "Create Code Repository",
|
|
@@ -2517,6 +2559,29 @@ export class PermissionHelper {
|
|
|
2517
2559
|
isAssignableToTenant: true,
|
|
2518
2560
|
isAccessControlPermission: false,
|
|
2519
2561
|
},
|
|
2562
|
+
{
|
|
2563
|
+
permission: Permission.EditCopilotAction,
|
|
2564
|
+
title: "Edit Copilot Event",
|
|
2565
|
+
description: "This permission can edit Copilot Event of this project.",
|
|
2566
|
+
isAssignableToTenant: true,
|
|
2567
|
+
isAccessControlPermission: false,
|
|
2568
|
+
},
|
|
2569
|
+
{
|
|
2570
|
+
permission: Permission.DeleteCopilotAction,
|
|
2571
|
+
title: "Delete Copilot Event",
|
|
2572
|
+
description:
|
|
2573
|
+
"This permission can delete Copilot Event of this project.",
|
|
2574
|
+
isAssignableToTenant: true,
|
|
2575
|
+
isAccessControlPermission: false,
|
|
2576
|
+
},
|
|
2577
|
+
{
|
|
2578
|
+
permission: Permission.CreateCopilotAction,
|
|
2579
|
+
title: "Create Copilot Event",
|
|
2580
|
+
description:
|
|
2581
|
+
"This permission can create Copilot Event of this project.",
|
|
2582
|
+
isAssignableToTenant: true,
|
|
2583
|
+
isAccessControlPermission: false,
|
|
2584
|
+
},
|
|
2520
2585
|
|
|
2521
2586
|
{
|
|
2522
2587
|
permission: Permission.CreateProbeOwnerTeam,
|
|
@@ -33,14 +33,14 @@ const components: Array<ComponentMetadata> = [
|
|
|
33
33
|
{
|
|
34
34
|
type: ComponentInputType.Text,
|
|
35
35
|
name: "Subject",
|
|
36
|
-
description: "
|
|
36
|
+
description: "Subject of the email",
|
|
37
37
|
required: false,
|
|
38
38
|
id: "subject",
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
type: ComponentInputType.HTML,
|
|
42
42
|
name: "Email Body",
|
|
43
|
-
description: "
|
|
43
|
+
description: "Body of the email",
|
|
44
44
|
required: false,
|
|
45
45
|
id: "email-body",
|
|
46
46
|
},
|
|
@@ -55,14 +55,14 @@ const components: Array<ComponentMetadata> = [
|
|
|
55
55
|
type: ComponentInputType.Text,
|
|
56
56
|
name: "SMTP Username",
|
|
57
57
|
description: "SMTP Username to send emails from",
|
|
58
|
-
required:
|
|
58
|
+
required: false,
|
|
59
59
|
id: "smtp-username",
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
type: ComponentInputType.Password,
|
|
63
63
|
name: "SMTP Password",
|
|
64
64
|
description: "SMTP Password to send emails from",
|
|
65
|
-
required:
|
|
65
|
+
required: false,
|
|
66
66
|
id: "smtp-password",
|
|
67
67
|
},
|
|
68
68
|
{
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ButtonStyleType } from "../Button/Button";
|
|
2
|
+
import Card from "../Card/Card";
|
|
3
|
+
import ConfirmModal from "../Modal/ConfirmModal";
|
|
4
|
+
import IconProp from "Common/Types/Icon/IconProp";
|
|
5
|
+
import React, { ReactElement, useState } from "react";
|
|
6
|
+
|
|
7
|
+
export interface ConfirmAction {
|
|
8
|
+
actionName: string;
|
|
9
|
+
actionIcon: IconProp;
|
|
10
|
+
onConfirmAction: () => void;
|
|
11
|
+
actionButtonStyle?: ButtonStyleType;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ComponentProps {
|
|
16
|
+
title: string;
|
|
17
|
+
description: string;
|
|
18
|
+
actions: Array<ConfirmAction>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const ActionCard: (props: ComponentProps) => ReactElement = (
|
|
22
|
+
props: ComponentProps,
|
|
23
|
+
): ReactElement => {
|
|
24
|
+
const [currentAction, setCurrentAction] = useState<ConfirmAction | undefined>(
|
|
25
|
+
undefined,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<Card
|
|
31
|
+
title={props.title}
|
|
32
|
+
description={props.description}
|
|
33
|
+
buttons={props.actions.map((action: ConfirmAction) => {
|
|
34
|
+
return {
|
|
35
|
+
title: action.actionName,
|
|
36
|
+
buttonStyle: action.actionButtonStyle || ButtonStyleType.NORMAL,
|
|
37
|
+
onClick: () => {
|
|
38
|
+
setCurrentAction(action);
|
|
39
|
+
},
|
|
40
|
+
icon: action.actionIcon,
|
|
41
|
+
isLoading: action.isLoading,
|
|
42
|
+
};
|
|
43
|
+
})}
|
|
44
|
+
/>
|
|
45
|
+
|
|
46
|
+
{currentAction ? (
|
|
47
|
+
<ConfirmModal
|
|
48
|
+
description={`Are you sure you want to ${currentAction.actionName}?`}
|
|
49
|
+
title={`Confirm ${currentAction.actionName}`}
|
|
50
|
+
onSubmit={() => {
|
|
51
|
+
currentAction.onConfirmAction();
|
|
52
|
+
setCurrentAction(undefined);
|
|
53
|
+
}}
|
|
54
|
+
submitButtonText={`Confirm`}
|
|
55
|
+
onClose={() => {
|
|
56
|
+
setCurrentAction(undefined);
|
|
57
|
+
}}
|
|
58
|
+
/>
|
|
59
|
+
) : (
|
|
60
|
+
<></>
|
|
61
|
+
)}
|
|
62
|
+
</>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default ActionCard;
|
|
@@ -16,13 +16,13 @@ export enum AlertSize {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface ComponentProps {
|
|
19
|
-
strongTitle?:
|
|
20
|
-
title?:
|
|
21
|
-
onClose?:
|
|
22
|
-
type?:
|
|
23
|
-
onClick?: (
|
|
19
|
+
strongTitle?: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
onClose?: () => void;
|
|
22
|
+
type?: AlertType;
|
|
23
|
+
onClick?: () => void;
|
|
24
24
|
doNotShowIcon?: boolean | undefined;
|
|
25
|
-
dataTestId?: string;
|
|
25
|
+
dataTestId?: string | undefined;
|
|
26
26
|
textClassName?: string | undefined;
|
|
27
27
|
className?: string | undefined;
|
|
28
28
|
color?: Color | undefined;
|
|
@@ -33,93 +33,102 @@ export interface ComponentProps {
|
|
|
33
33
|
const Alert: FunctionComponent<ComponentProps> = (
|
|
34
34
|
props: ComponentProps,
|
|
35
35
|
): ReactElement => {
|
|
36
|
-
|
|
36
|
+
const type: AlertType = props.type || AlertType.INFO;
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const typeClassNames: {
|
|
39
|
+
[key in AlertType]: {
|
|
40
|
+
text: string;
|
|
41
|
+
bg: string;
|
|
42
|
+
hover: string;
|
|
43
|
+
};
|
|
44
|
+
} = {
|
|
45
|
+
[AlertType.DANGER]: {
|
|
46
|
+
text: "text-red-200",
|
|
47
|
+
bg: "bg-red-700",
|
|
48
|
+
hover: "hover:bg-red-600",
|
|
49
|
+
},
|
|
50
|
+
[AlertType.INFO]: {
|
|
51
|
+
text: "text-gray-200",
|
|
52
|
+
bg: "bg-gray-700",
|
|
53
|
+
hover: "hover:bg-gray-600",
|
|
54
|
+
},
|
|
55
|
+
[AlertType.WARNING]: {
|
|
56
|
+
text: "text-yellow-200",
|
|
57
|
+
bg: "bg-gray-700",
|
|
58
|
+
hover: "hover:bg-yellow-600",
|
|
59
|
+
},
|
|
60
|
+
[AlertType.SUCCESS]: {
|
|
61
|
+
text: "text-green-200",
|
|
62
|
+
bg: "bg-gray-700",
|
|
63
|
+
hover: "hover:bg-green-600",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
41
66
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
bgClassName = "bg-red";
|
|
48
|
-
} else if (AlertType.INFO === type) {
|
|
49
|
-
className = "text-gray";
|
|
50
|
-
bgClassName = "bg-gray";
|
|
51
|
-
} else if (AlertType.WARNING === type) {
|
|
52
|
-
className = "text-yellow";
|
|
53
|
-
bgClassName = "bg-gray";
|
|
54
|
-
} else if (AlertType.SUCCESS === type) {
|
|
55
|
-
className = "text-green";
|
|
56
|
-
bgClassName = "bg-gray";
|
|
57
|
-
}
|
|
67
|
+
const {
|
|
68
|
+
text: textClassName,
|
|
69
|
+
bg: bgClassName,
|
|
70
|
+
hover: hoverClassName,
|
|
71
|
+
} = typeClassNames[type];
|
|
58
72
|
|
|
59
73
|
return (
|
|
60
74
|
<div
|
|
61
75
|
id={props.id}
|
|
62
|
-
className={`rounded-md ${bgClassName}
|
|
76
|
+
className={`alert rounded-md ${bgClassName} p-4 ${props.className}`}
|
|
63
77
|
data-testid={props.dataTestId}
|
|
64
|
-
onClick={
|
|
65
|
-
props.onClick && props.onClick();
|
|
66
|
-
}}
|
|
78
|
+
onClick={props.onClick}
|
|
67
79
|
role="alert"
|
|
68
|
-
style={
|
|
69
|
-
props.color
|
|
70
|
-
? {
|
|
71
|
-
backgroundColor: props.color?.toString(),
|
|
72
|
-
}
|
|
73
|
-
: {}
|
|
74
|
-
}
|
|
80
|
+
style={props.color ? { backgroundColor: props.color.toString() } : {}}
|
|
75
81
|
>
|
|
76
|
-
<div className="flex
|
|
82
|
+
<div className="alert-content flex">
|
|
77
83
|
{!props.doNotShowIcon && (
|
|
78
|
-
<div className="flex-shrink-0">
|
|
79
|
-
{AlertType.DANGER
|
|
80
|
-
<Icon
|
|
84
|
+
<div className="alert-icon flex-shrink-0">
|
|
85
|
+
{type === AlertType.DANGER && (
|
|
86
|
+
<Icon
|
|
87
|
+
icon={IconProp.Alert}
|
|
88
|
+
className={`h-5 w-5 ${textClassName}`}
|
|
89
|
+
/>
|
|
81
90
|
)}
|
|
82
|
-
{AlertType.WARNING
|
|
83
|
-
<Icon
|
|
91
|
+
{type === AlertType.WARNING && (
|
|
92
|
+
<Icon
|
|
93
|
+
icon={IconProp.Alert}
|
|
94
|
+
className={`h-5 w-5 ${textClassName}`}
|
|
95
|
+
/>
|
|
84
96
|
)}
|
|
85
|
-
{AlertType.SUCCESS
|
|
97
|
+
{type === AlertType.SUCCESS && (
|
|
86
98
|
<Icon
|
|
87
99
|
icon={IconProp.CheckCircle}
|
|
88
|
-
className=
|
|
100
|
+
className={`h-5 w-5 ${textClassName}`}
|
|
89
101
|
/>
|
|
90
102
|
)}
|
|
91
|
-
{AlertType.INFO
|
|
92
|
-
<Icon
|
|
103
|
+
{type === AlertType.INFO && (
|
|
104
|
+
<Icon
|
|
105
|
+
icon={IconProp.Info}
|
|
106
|
+
className={`h-5 w-5 ${textClassName}`}
|
|
107
|
+
/>
|
|
93
108
|
)}
|
|
94
109
|
</div>
|
|
95
110
|
)}
|
|
96
111
|
<div
|
|
97
|
-
className={`ml-3 mr-3 flex-1 md:flex md:justify-between ${props.
|
|
112
|
+
className={`alert-text ml-3 mr-3 flex-1 md:flex md:justify-between ${props.textClassName}`}
|
|
98
113
|
>
|
|
99
114
|
<div
|
|
100
|
-
className={
|
|
101
|
-
props.textClassName ||
|
|
102
|
-
`text-sm flex justify-between ${className}-200`
|
|
103
|
-
}
|
|
115
|
+
className={`alert-message text-sm flex justify-between ${textClassName}`}
|
|
104
116
|
>
|
|
105
117
|
<div>
|
|
106
118
|
<span className="font-medium">
|
|
107
119
|
{props.strongTitle}{" "}
|
|
108
|
-
{props.title && props.strongTitle ? "-" : ""}
|
|
120
|
+
{props.title && props.strongTitle ? "- " : ""}
|
|
109
121
|
</span>
|
|
110
122
|
{props.title}
|
|
111
123
|
</div>
|
|
112
124
|
{props.textOnRight && <div>{props.textOnRight}</div>}
|
|
113
125
|
</div>
|
|
114
|
-
|
|
115
126
|
{props.onClose && (
|
|
116
|
-
<p className="mt-3 text-sm md:mt-0 md:ml-6">
|
|
127
|
+
<p className="alert-close mt-3 text-sm md:mt-0 md:ml-6">
|
|
117
128
|
<button
|
|
118
|
-
onClick={
|
|
119
|
-
|
|
120
|
-
}}
|
|
121
|
-
role={"alert-close-button"}
|
|
122
|
-
className={`whitespace-nowrap font-medium ${className}-200 hover:${className}-50`}
|
|
129
|
+
onClick={props.onClose}
|
|
130
|
+
role="alert-close-button"
|
|
131
|
+
className={`whitespace-nowrap font-medium ${textClassName} hover:${hoverClassName}`}
|
|
123
132
|
>
|
|
124
133
|
Close
|
|
125
134
|
<span aria-hidden="true"> →</span>
|
|
@@ -283,7 +283,8 @@ const Detail: DetailFunction = <T extends GenericObject>(
|
|
|
283
283
|
(field.fieldType === FieldType.HTML ||
|
|
284
284
|
field.fieldType === FieldType.CSS ||
|
|
285
285
|
field.fieldType === FieldType.JSON ||
|
|
286
|
-
field.fieldType === FieldType.JavaScript
|
|
286
|
+
field.fieldType === FieldType.JavaScript ||
|
|
287
|
+
field.fieldType === FieldType.Code)
|
|
287
288
|
) {
|
|
288
289
|
let codeType: CodeType = CodeType.HTML;
|
|
289
290
|
|
|
@@ -315,6 +316,10 @@ const Detail: DetailFunction = <T extends GenericObject>(
|
|
|
315
316
|
codeType = CodeType.JavaScript;
|
|
316
317
|
}
|
|
317
318
|
|
|
319
|
+
if (field.fieldType === FieldType.Code) {
|
|
320
|
+
codeType = CodeType.Text;
|
|
321
|
+
}
|
|
322
|
+
|
|
318
323
|
data = (
|
|
319
324
|
<CodeEditor
|
|
320
325
|
type={codeType}
|
|
@@ -50,8 +50,10 @@ const Row: FunctionComponent<ComponentProps> = (
|
|
|
50
50
|
<div
|
|
51
51
|
className={`flex w-full border-b-2 border-gray-200 border-l-2 border-l-gray-400 border-r-2 border-r-gray-400`}
|
|
52
52
|
>
|
|
53
|
-
<div className="flex w-1/4 border-r-2 border-gray-300">
|
|
54
|
-
<div
|
|
53
|
+
<div className="flex w-1/4 border-r-2 border-gray-300 overflow-hidden">
|
|
54
|
+
<div
|
|
55
|
+
className={`pl-${paddingCount} pt-2 pb-2 pr-2 flex overflow-hidden`}
|
|
56
|
+
>
|
|
55
57
|
<div className="w-5 h-5 ml-3 mt-1">
|
|
56
58
|
{hasChildRows && (
|
|
57
59
|
<Icon
|