@oneuptime/common 9.2.11 → 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/Monitor/MonitorStep.ts +14 -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/Monitor/MonitorStep.js +10 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- 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,18 +1,16 @@
|
|
|
1
|
-
import CodeRepository from "./CopilotCodeRepository";
|
|
2
1
|
import Project from "./Project";
|
|
3
|
-
import ServiceCatalog from "./ServiceCatalog";
|
|
4
|
-
import ServiceCopilotCodeRepository from "./ServiceCopilotCodeRepository";
|
|
5
2
|
import User from "./User";
|
|
6
3
|
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
|
7
4
|
import Route from "../../Types/API/Route";
|
|
8
|
-
import
|
|
5
|
+
import { PlanType } from "../../Types/Billing/SubscriptionPlan";
|
|
9
6
|
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
|
10
7
|
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
|
11
|
-
import
|
|
8
|
+
import TableBillingAccessControl from "../../Types/Database/AccessControl/TableBillingAccessControl";
|
|
9
|
+
import ColumnLength from "../../Types/Database/ColumnLength";
|
|
12
10
|
import ColumnType from "../../Types/Database/ColumnType";
|
|
13
11
|
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
12
|
+
import IsPermissionsIf from "../../Types/Database/IsPermissionsIf";
|
|
13
|
+
import SlugifyColumn from "../../Types/Database/SlugifyColumn";
|
|
16
14
|
import TableColumn from "../../Types/Database/TableColumn";
|
|
17
15
|
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
18
16
|
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
@@ -20,451 +18,448 @@ import TenantColumn from "../../Types/Database/TenantColumn";
|
|
|
20
18
|
import IconProp from "../../Types/Icon/IconProp";
|
|
21
19
|
import ObjectID from "../../Types/ObjectID";
|
|
22
20
|
import Permission from "../../Types/Permission";
|
|
23
|
-
import { Column, Entity,
|
|
21
|
+
import { Column, Entity, JoinColumn, ManyToOne } from "typeorm";
|
|
22
|
+
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
|
23
|
+
import LlmType from "../../Types/LLM/LlmType";
|
|
24
24
|
|
|
25
|
-
@CanAccessIfCanReadOn("codeRepository")
|
|
26
25
|
@EnableDocumentation()
|
|
26
|
+
@TableBillingAccessControl({
|
|
27
|
+
create: PlanType.Growth,
|
|
28
|
+
read: PlanType.Free,
|
|
29
|
+
update: PlanType.Growth,
|
|
30
|
+
delete: PlanType.Free,
|
|
31
|
+
})
|
|
32
|
+
@IsPermissionsIf(Permission.Public, "projectId", null)
|
|
27
33
|
@TenantColumn("projectId")
|
|
34
|
+
@CrudApiEndpoint(new Route("/llm-provider"))
|
|
35
|
+
@SlugifyColumn("name", "slug")
|
|
36
|
+
@Entity({
|
|
37
|
+
name: "LlmProvider",
|
|
38
|
+
})
|
|
39
|
+
@TableMetadata({
|
|
40
|
+
tableName: "LlmProvider",
|
|
41
|
+
singularName: "LLM Provider",
|
|
42
|
+
pluralName: "LLM Providers",
|
|
43
|
+
icon: IconProp.Bolt,
|
|
44
|
+
tableDescription:
|
|
45
|
+
"Manage LLM Provider configurations. Connect to OpenAI, Anthropic, Ollama, or other LLM providers to enable AI features.",
|
|
46
|
+
})
|
|
28
47
|
@TableAccessControl({
|
|
29
|
-
create: [
|
|
48
|
+
create: [
|
|
49
|
+
Permission.ProjectOwner,
|
|
50
|
+
Permission.ProjectAdmin,
|
|
51
|
+
Permission.ProjectMember,
|
|
52
|
+
Permission.CreateProjectLlm,
|
|
53
|
+
],
|
|
30
54
|
read: [
|
|
55
|
+
Permission.Public,
|
|
31
56
|
Permission.ProjectOwner,
|
|
32
57
|
Permission.ProjectAdmin,
|
|
33
58
|
Permission.ProjectMember,
|
|
34
|
-
Permission.
|
|
59
|
+
Permission.ReadProjectLlm,
|
|
60
|
+
],
|
|
61
|
+
delete: [
|
|
62
|
+
Permission.ProjectOwner,
|
|
63
|
+
Permission.ProjectAdmin,
|
|
64
|
+
Permission.ProjectMember,
|
|
65
|
+
Permission.DeleteProjectLlm,
|
|
66
|
+
],
|
|
67
|
+
update: [
|
|
68
|
+
Permission.ProjectOwner,
|
|
69
|
+
Permission.ProjectAdmin,
|
|
70
|
+
Permission.ProjectMember,
|
|
71
|
+
Permission.EditProjectLlm,
|
|
35
72
|
],
|
|
36
|
-
delete: [],
|
|
37
|
-
update: [],
|
|
38
|
-
})
|
|
39
|
-
@EnableWorkflow({
|
|
40
|
-
create: true,
|
|
41
|
-
delete: false,
|
|
42
|
-
update: true,
|
|
43
|
-
})
|
|
44
|
-
@CrudApiEndpoint(new Route("/copilot-pull-request"))
|
|
45
|
-
@TableMetadata({
|
|
46
|
-
tableName: "CopilotPullRequest",
|
|
47
|
-
singularName: "Copilot Pull Request",
|
|
48
|
-
pluralName: "Copilot Pull Requests",
|
|
49
|
-
icon: IconProp.Bolt,
|
|
50
|
-
tableDescription:
|
|
51
|
-
"List of pull requests created by Copilot and status of those requests.",
|
|
52
|
-
})
|
|
53
|
-
@Entity({
|
|
54
|
-
name: "CopilotPullRequest",
|
|
55
73
|
})
|
|
56
|
-
export default class
|
|
74
|
+
export default class LlmProvider extends BaseModel {
|
|
57
75
|
@ColumnAccessControl({
|
|
58
|
-
create: [
|
|
59
|
-
read: [
|
|
76
|
+
create: [
|
|
60
77
|
Permission.ProjectOwner,
|
|
61
78
|
Permission.ProjectAdmin,
|
|
62
79
|
Permission.ProjectMember,
|
|
63
|
-
Permission.
|
|
80
|
+
Permission.CreateProjectLlm,
|
|
81
|
+
],
|
|
82
|
+
read: [Permission.Public],
|
|
83
|
+
update: [
|
|
84
|
+
Permission.ProjectOwner,
|
|
85
|
+
Permission.ProjectAdmin,
|
|
86
|
+
Permission.ProjectMember,
|
|
87
|
+
Permission.EditProjectLlm,
|
|
64
88
|
],
|
|
65
|
-
update: [],
|
|
66
89
|
})
|
|
67
90
|
@TableColumn({
|
|
68
|
-
|
|
69
|
-
type: TableColumnType.
|
|
70
|
-
|
|
71
|
-
title: "
|
|
72
|
-
description: "
|
|
91
|
+
required: true,
|
|
92
|
+
type: TableColumnType.Name,
|
|
93
|
+
canReadOnRelationQuery: true,
|
|
94
|
+
title: "Name",
|
|
95
|
+
description: "A friendly name for this LLM configuration.",
|
|
73
96
|
})
|
|
74
|
-
@
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
nullable: false,
|
|
81
|
-
onDelete: "CASCADE",
|
|
82
|
-
orphanedRowAction: "nullify",
|
|
83
|
-
},
|
|
84
|
-
)
|
|
85
|
-
@JoinColumn({ name: "projectId" })
|
|
86
|
-
public project?: Project = undefined;
|
|
97
|
+
@Column({
|
|
98
|
+
nullable: false,
|
|
99
|
+
type: ColumnType.Name,
|
|
100
|
+
length: ColumnLength.Name,
|
|
101
|
+
})
|
|
102
|
+
public name?: string = undefined;
|
|
87
103
|
|
|
88
104
|
@ColumnAccessControl({
|
|
89
|
-
create: [
|
|
90
|
-
read: [
|
|
105
|
+
create: [
|
|
91
106
|
Permission.ProjectOwner,
|
|
92
107
|
Permission.ProjectAdmin,
|
|
93
108
|
Permission.ProjectMember,
|
|
94
|
-
Permission.
|
|
109
|
+
Permission.CreateProjectLlm,
|
|
95
110
|
],
|
|
111
|
+
read: [Permission.Public],
|
|
112
|
+
update: [
|
|
113
|
+
Permission.ProjectOwner,
|
|
114
|
+
Permission.ProjectAdmin,
|
|
115
|
+
Permission.ProjectMember,
|
|
116
|
+
Permission.EditProjectLlm,
|
|
117
|
+
],
|
|
118
|
+
})
|
|
119
|
+
@TableColumn({
|
|
120
|
+
required: false,
|
|
121
|
+
type: TableColumnType.LongText,
|
|
122
|
+
title: "Description",
|
|
123
|
+
description: "Description of this LLM configuration.",
|
|
124
|
+
})
|
|
125
|
+
@Column({
|
|
126
|
+
nullable: true,
|
|
127
|
+
type: ColumnType.LongText,
|
|
128
|
+
})
|
|
129
|
+
public description?: string = undefined;
|
|
130
|
+
|
|
131
|
+
@ColumnAccessControl({
|
|
132
|
+
create: [],
|
|
133
|
+
read: [Permission.Public],
|
|
96
134
|
update: [],
|
|
97
135
|
})
|
|
98
|
-
@Index()
|
|
99
136
|
@TableColumn({
|
|
100
|
-
type: TableColumnType.ObjectID,
|
|
101
137
|
required: true,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
138
|
+
unique: true,
|
|
139
|
+
type: TableColumnType.Slug,
|
|
140
|
+
computed: true,
|
|
141
|
+
title: "Slug",
|
|
142
|
+
description: "Friendly globally unique name for your object",
|
|
105
143
|
})
|
|
106
144
|
@Column({
|
|
107
|
-
type: ColumnType.ObjectID,
|
|
108
145
|
nullable: false,
|
|
109
|
-
|
|
146
|
+
type: ColumnType.Slug,
|
|
147
|
+
length: ColumnLength.Slug,
|
|
110
148
|
})
|
|
111
|
-
public
|
|
149
|
+
public slug?: string = undefined;
|
|
112
150
|
|
|
113
151
|
@ColumnAccessControl({
|
|
114
|
-
create: [
|
|
115
|
-
read: [
|
|
152
|
+
create: [
|
|
116
153
|
Permission.ProjectOwner,
|
|
117
154
|
Permission.ProjectAdmin,
|
|
118
155
|
Permission.ProjectMember,
|
|
119
|
-
Permission.
|
|
156
|
+
Permission.CreateProjectLlm,
|
|
157
|
+
],
|
|
158
|
+
read: [Permission.Public],
|
|
159
|
+
update: [
|
|
160
|
+
Permission.ProjectOwner,
|
|
161
|
+
Permission.ProjectAdmin,
|
|
162
|
+
Permission.ProjectMember,
|
|
163
|
+
Permission.EditProjectLlm,
|
|
120
164
|
],
|
|
121
|
-
update: [],
|
|
122
165
|
})
|
|
123
166
|
@TableColumn({
|
|
124
|
-
|
|
125
|
-
type: TableColumnType.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
description:
|
|
129
|
-
"Relation to CodeRepository Resource in which this object belongs",
|
|
167
|
+
required: true,
|
|
168
|
+
type: TableColumnType.ShortText,
|
|
169
|
+
title: "LLM Type",
|
|
170
|
+
description: "The type of LLM provider (OpenAI, Anthropic, Ollama, etc.)",
|
|
130
171
|
})
|
|
131
|
-
@
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
nullable: true,
|
|
138
|
-
onDelete: "CASCADE",
|
|
139
|
-
orphanedRowAction: "nullify",
|
|
140
|
-
},
|
|
141
|
-
)
|
|
142
|
-
@JoinColumn({ name: "codeRepositoryId" })
|
|
143
|
-
public codeRepository?: CodeRepository = undefined;
|
|
172
|
+
@Column({
|
|
173
|
+
nullable: false,
|
|
174
|
+
type: ColumnType.ShortText,
|
|
175
|
+
length: ColumnLength.ShortText,
|
|
176
|
+
})
|
|
177
|
+
public llmType?: LlmType = undefined;
|
|
144
178
|
|
|
145
179
|
@ColumnAccessControl({
|
|
146
|
-
create: [
|
|
147
|
-
read: [
|
|
180
|
+
create: [
|
|
148
181
|
Permission.ProjectOwner,
|
|
149
182
|
Permission.ProjectAdmin,
|
|
150
183
|
Permission.ProjectMember,
|
|
151
|
-
Permission.
|
|
184
|
+
Permission.CreateProjectLlm,
|
|
185
|
+
],
|
|
186
|
+
read: [Permission.ProjectOwner, Permission.ProjectAdmin],
|
|
187
|
+
update: [
|
|
188
|
+
Permission.ProjectOwner,
|
|
189
|
+
Permission.ProjectAdmin,
|
|
190
|
+
Permission.ProjectMember,
|
|
191
|
+
Permission.EditProjectLlm,
|
|
152
192
|
],
|
|
153
|
-
update: [],
|
|
154
193
|
})
|
|
155
|
-
@Index()
|
|
156
194
|
@TableColumn({
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
title: "Code Repository ID",
|
|
195
|
+
required: false,
|
|
196
|
+
type: TableColumnType.LongText,
|
|
197
|
+
title: "API Key",
|
|
161
198
|
description:
|
|
162
|
-
"
|
|
199
|
+
"The API key for the LLM provider. Required for OpenAI and Anthropic.",
|
|
200
|
+
encrypted: true,
|
|
163
201
|
})
|
|
164
202
|
@Column({
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
transformer: ObjectID.getDatabaseTransformer(),
|
|
203
|
+
nullable: true,
|
|
204
|
+
type: ColumnType.LongText,
|
|
168
205
|
})
|
|
169
|
-
public
|
|
206
|
+
public apiKey?: string = undefined;
|
|
170
207
|
|
|
171
208
|
@ColumnAccessControl({
|
|
172
|
-
create: [
|
|
173
|
-
read: [
|
|
209
|
+
create: [
|
|
174
210
|
Permission.ProjectOwner,
|
|
175
211
|
Permission.ProjectAdmin,
|
|
176
212
|
Permission.ProjectMember,
|
|
177
|
-
Permission.
|
|
213
|
+
Permission.CreateProjectLlm,
|
|
214
|
+
],
|
|
215
|
+
read: [Permission.Public],
|
|
216
|
+
update: [
|
|
217
|
+
Permission.ProjectOwner,
|
|
218
|
+
Permission.ProjectAdmin,
|
|
219
|
+
Permission.ProjectMember,
|
|
220
|
+
Permission.EditProjectLlm,
|
|
178
221
|
],
|
|
179
|
-
update: [],
|
|
180
222
|
})
|
|
181
223
|
@TableColumn({
|
|
182
|
-
|
|
183
|
-
type: TableColumnType.
|
|
184
|
-
|
|
185
|
-
title: "Created by User",
|
|
224
|
+
required: false,
|
|
225
|
+
type: TableColumnType.ShortText,
|
|
226
|
+
title: "Model Name",
|
|
186
227
|
description:
|
|
187
|
-
"
|
|
228
|
+
"The name of the model to use (e.g., gpt-4, claude-3-opus, llama2).",
|
|
188
229
|
})
|
|
189
|
-
@
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
nullable: true,
|
|
196
|
-
onDelete: "SET NULL",
|
|
197
|
-
orphanedRowAction: "nullify",
|
|
198
|
-
},
|
|
199
|
-
)
|
|
200
|
-
@JoinColumn({ name: "createdByUserId" })
|
|
201
|
-
public createdByUser?: User = undefined;
|
|
230
|
+
@Column({
|
|
231
|
+
nullable: true,
|
|
232
|
+
type: ColumnType.ShortText,
|
|
233
|
+
length: ColumnLength.ShortText,
|
|
234
|
+
})
|
|
235
|
+
public modelName?: string = undefined;
|
|
202
236
|
|
|
203
237
|
@ColumnAccessControl({
|
|
204
|
-
create: [
|
|
205
|
-
read: [
|
|
238
|
+
create: [
|
|
206
239
|
Permission.ProjectOwner,
|
|
207
240
|
Permission.ProjectAdmin,
|
|
208
241
|
Permission.ProjectMember,
|
|
209
|
-
Permission.
|
|
242
|
+
Permission.CreateProjectLlm,
|
|
243
|
+
],
|
|
244
|
+
read: [Permission.Public],
|
|
245
|
+
update: [
|
|
246
|
+
Permission.ProjectOwner,
|
|
247
|
+
Permission.ProjectAdmin,
|
|
248
|
+
Permission.ProjectMember,
|
|
249
|
+
Permission.EditProjectLlm,
|
|
210
250
|
],
|
|
211
|
-
update: [],
|
|
212
251
|
})
|
|
213
252
|
@TableColumn({
|
|
214
|
-
|
|
215
|
-
|
|
253
|
+
required: false,
|
|
254
|
+
type: TableColumnType.ShortURL,
|
|
255
|
+
title: "Base URL",
|
|
216
256
|
description:
|
|
217
|
-
"
|
|
257
|
+
"The base URL for the LLM API. Required for Ollama, optional for others.",
|
|
218
258
|
})
|
|
219
259
|
@Column({
|
|
220
|
-
type: ColumnType.ObjectID,
|
|
221
260
|
nullable: true,
|
|
222
|
-
|
|
261
|
+
type: ColumnType.ShortURL,
|
|
262
|
+
length: ColumnLength.ShortURL,
|
|
223
263
|
})
|
|
224
|
-
public
|
|
264
|
+
public baseUrl?: string = undefined;
|
|
225
265
|
|
|
226
266
|
@ColumnAccessControl({
|
|
227
|
-
create: [
|
|
228
|
-
read: [
|
|
267
|
+
create: [
|
|
229
268
|
Permission.ProjectOwner,
|
|
230
269
|
Permission.ProjectAdmin,
|
|
231
270
|
Permission.ProjectMember,
|
|
232
|
-
Permission.
|
|
271
|
+
Permission.CreateProjectLlm,
|
|
233
272
|
],
|
|
273
|
+
read: [Permission.Public],
|
|
234
274
|
update: [],
|
|
235
275
|
})
|
|
236
276
|
@TableColumn({
|
|
237
|
-
manyToOneRelationColumn: "deletedByUserId",
|
|
238
277
|
type: TableColumnType.Entity,
|
|
239
|
-
|
|
240
|
-
modelType:
|
|
278
|
+
required: false,
|
|
279
|
+
modelType: Project,
|
|
280
|
+
title: "Project",
|
|
241
281
|
description:
|
|
242
|
-
"
|
|
282
|
+
"The project this LLM belongs to. If null, it is a global LLM.",
|
|
243
283
|
})
|
|
244
284
|
@ManyToOne(
|
|
245
285
|
() => {
|
|
246
|
-
return
|
|
286
|
+
return Project;
|
|
247
287
|
},
|
|
248
288
|
{
|
|
249
289
|
cascade: false,
|
|
250
290
|
eager: false,
|
|
251
291
|
nullable: true,
|
|
252
|
-
onDelete: "
|
|
292
|
+
onDelete: "CASCADE",
|
|
253
293
|
orphanedRowAction: "nullify",
|
|
254
294
|
},
|
|
255
295
|
)
|
|
256
|
-
@JoinColumn({ name: "
|
|
257
|
-
public
|
|
296
|
+
@JoinColumn({ name: "projectId" })
|
|
297
|
+
public project?: Project = undefined;
|
|
258
298
|
|
|
259
299
|
@ColumnAccessControl({
|
|
260
|
-
create: [
|
|
261
|
-
read: [
|
|
300
|
+
create: [
|
|
262
301
|
Permission.ProjectOwner,
|
|
263
302
|
Permission.ProjectAdmin,
|
|
264
303
|
Permission.ProjectMember,
|
|
265
|
-
Permission.
|
|
304
|
+
Permission.CreateProjectLlm,
|
|
266
305
|
],
|
|
306
|
+
read: [Permission.Public],
|
|
267
307
|
update: [],
|
|
268
308
|
})
|
|
269
309
|
@TableColumn({
|
|
270
310
|
type: TableColumnType.ObjectID,
|
|
271
|
-
|
|
311
|
+
required: false,
|
|
312
|
+
canReadOnRelationQuery: true,
|
|
313
|
+
title: "Project ID",
|
|
272
314
|
description:
|
|
273
|
-
"
|
|
315
|
+
"ID of the project this LLM belongs to. If null, it is a global LLM.",
|
|
274
316
|
})
|
|
275
317
|
@Column({
|
|
276
318
|
type: ColumnType.ObjectID,
|
|
277
319
|
nullable: true,
|
|
278
320
|
transformer: ObjectID.getDatabaseTransformer(),
|
|
279
321
|
})
|
|
280
|
-
public
|
|
322
|
+
public projectId?: ObjectID = undefined;
|
|
281
323
|
|
|
282
324
|
@ColumnAccessControl({
|
|
283
325
|
create: [],
|
|
284
|
-
read: [
|
|
285
|
-
Permission.ProjectOwner,
|
|
286
|
-
Permission.ProjectAdmin,
|
|
287
|
-
Permission.ProjectMember,
|
|
288
|
-
Permission.ReadCopilotPullRequest,
|
|
289
|
-
],
|
|
326
|
+
read: [],
|
|
290
327
|
update: [],
|
|
291
328
|
})
|
|
292
|
-
@TableColumn({
|
|
293
|
-
manyToOneRelationColumn: "serviceCatalogId",
|
|
294
|
-
type: TableColumnType.Entity,
|
|
295
|
-
required: false,
|
|
296
|
-
modelType: ServiceCatalog,
|
|
297
|
-
title: "Service Catalog",
|
|
298
|
-
description:
|
|
299
|
-
"Relation to Service Catalog Resource in which this object belongs",
|
|
300
|
-
})
|
|
329
|
+
@TableColumn({ type: TableColumnType.Entity, modelType: User })
|
|
301
330
|
@ManyToOne(
|
|
302
331
|
() => {
|
|
303
|
-
return
|
|
332
|
+
return User;
|
|
304
333
|
},
|
|
305
334
|
{
|
|
335
|
+
cascade: false,
|
|
306
336
|
eager: false,
|
|
307
337
|
nullable: true,
|
|
308
|
-
onDelete: "
|
|
338
|
+
onDelete: "SET NULL",
|
|
309
339
|
orphanedRowAction: "nullify",
|
|
310
340
|
},
|
|
311
341
|
)
|
|
312
|
-
@JoinColumn({ name: "
|
|
313
|
-
public
|
|
342
|
+
@JoinColumn({ name: "deletedByUserId" })
|
|
343
|
+
public deletedByUser?: User = undefined;
|
|
314
344
|
|
|
315
345
|
@ColumnAccessControl({
|
|
316
346
|
create: [],
|
|
317
|
-
read: [
|
|
318
|
-
Permission.ProjectOwner,
|
|
319
|
-
Permission.ProjectAdmin,
|
|
320
|
-
Permission.ProjectMember,
|
|
321
|
-
Permission.ReadCopilotPullRequest,
|
|
322
|
-
],
|
|
347
|
+
read: [],
|
|
323
348
|
update: [],
|
|
324
349
|
})
|
|
325
|
-
@Index()
|
|
326
350
|
@TableColumn({
|
|
327
351
|
type: TableColumnType.ObjectID,
|
|
328
|
-
|
|
329
|
-
canReadOnRelationQuery: true,
|
|
330
|
-
title: "Service Catalog ID",
|
|
352
|
+
title: "Deleted by User ID",
|
|
331
353
|
description:
|
|
332
|
-
"ID
|
|
354
|
+
"User ID who deleted this object (if this object was deleted by a User)",
|
|
333
355
|
})
|
|
334
356
|
@Column({
|
|
335
357
|
type: ColumnType.ObjectID,
|
|
336
358
|
nullable: true,
|
|
337
359
|
transformer: ObjectID.getDatabaseTransformer(),
|
|
338
360
|
})
|
|
339
|
-
public
|
|
361
|
+
public deletedByUserId?: ObjectID = undefined;
|
|
340
362
|
|
|
341
363
|
@ColumnAccessControl({
|
|
342
|
-
create: [
|
|
343
|
-
read: [
|
|
364
|
+
create: [
|
|
344
365
|
Permission.ProjectOwner,
|
|
345
366
|
Permission.ProjectAdmin,
|
|
346
367
|
Permission.ProjectMember,
|
|
347
|
-
Permission.
|
|
368
|
+
Permission.CreateProjectLlm,
|
|
348
369
|
],
|
|
370
|
+
read: [Permission.ProjectOwner],
|
|
349
371
|
update: [],
|
|
350
372
|
})
|
|
351
|
-
@TableColumn({
|
|
352
|
-
manyToOneRelationColumn: "serviceRepositoryId",
|
|
353
|
-
type: TableColumnType.Entity,
|
|
354
|
-
required: false,
|
|
355
|
-
modelType: ServiceCopilotCodeRepository,
|
|
356
|
-
title: "Service Repository",
|
|
357
|
-
description:
|
|
358
|
-
"Relation to Service Repository Resource in which this object belongs",
|
|
359
|
-
})
|
|
373
|
+
@TableColumn({ type: TableColumnType.Entity, modelType: User })
|
|
360
374
|
@ManyToOne(
|
|
361
375
|
() => {
|
|
362
|
-
return
|
|
376
|
+
return User;
|
|
363
377
|
},
|
|
364
378
|
{
|
|
365
379
|
eager: false,
|
|
366
380
|
nullable: true,
|
|
367
|
-
onDelete: "
|
|
381
|
+
onDelete: "SET NULL",
|
|
368
382
|
orphanedRowAction: "nullify",
|
|
369
383
|
},
|
|
370
384
|
)
|
|
371
|
-
@JoinColumn({ name: "
|
|
372
|
-
public
|
|
385
|
+
@JoinColumn({ name: "createdByUserId" })
|
|
386
|
+
public createdByUser?: User = undefined;
|
|
373
387
|
|
|
374
388
|
@ColumnAccessControl({
|
|
375
|
-
create: [
|
|
376
|
-
read: [
|
|
389
|
+
create: [
|
|
377
390
|
Permission.ProjectOwner,
|
|
378
391
|
Permission.ProjectAdmin,
|
|
379
392
|
Permission.ProjectMember,
|
|
380
|
-
Permission.
|
|
393
|
+
Permission.CreateProjectLlm,
|
|
381
394
|
],
|
|
395
|
+
read: [Permission.ProjectOwner],
|
|
382
396
|
update: [],
|
|
383
397
|
})
|
|
384
|
-
@Index()
|
|
385
398
|
@TableColumn({
|
|
386
399
|
type: TableColumnType.ObjectID,
|
|
387
|
-
|
|
388
|
-
canReadOnRelationQuery: true,
|
|
389
|
-
title: "Service Repository ID",
|
|
400
|
+
title: "Created by User ID",
|
|
390
401
|
description:
|
|
391
|
-
"ID
|
|
402
|
+
"User ID who created this object (if this object was created by a User)",
|
|
392
403
|
})
|
|
393
404
|
@Column({
|
|
394
405
|
type: ColumnType.ObjectID,
|
|
395
406
|
nullable: true,
|
|
396
407
|
transformer: ObjectID.getDatabaseTransformer(),
|
|
397
408
|
})
|
|
398
|
-
public
|
|
409
|
+
public createdByUserId?: ObjectID = undefined;
|
|
399
410
|
|
|
400
411
|
@ColumnAccessControl({
|
|
401
412
|
create: [],
|
|
402
|
-
read: [
|
|
403
|
-
Permission.ProjectOwner,
|
|
404
|
-
Permission.ProjectAdmin,
|
|
405
|
-
Permission.ProjectMember,
|
|
406
|
-
Permission.ReadCopilotPullRequest,
|
|
407
|
-
],
|
|
413
|
+
read: [],
|
|
408
414
|
update: [],
|
|
409
415
|
})
|
|
410
416
|
@TableColumn({
|
|
411
|
-
|
|
412
|
-
required:
|
|
413
|
-
|
|
417
|
+
isDefaultValueColumn: true,
|
|
418
|
+
required: true,
|
|
419
|
+
type: TableColumnType.Boolean,
|
|
414
420
|
canReadOnRelationQuery: true,
|
|
415
|
-
title: "
|
|
421
|
+
title: "Is Global LLM",
|
|
416
422
|
description:
|
|
417
|
-
"
|
|
423
|
+
"Is this a global LLM that is available to all projects? Only admins can create global LLMs.",
|
|
424
|
+
defaultValue: false,
|
|
418
425
|
})
|
|
419
426
|
@Column({
|
|
420
|
-
type: ColumnType.
|
|
421
|
-
nullable:
|
|
427
|
+
type: ColumnType.Boolean,
|
|
428
|
+
nullable: false,
|
|
429
|
+
unique: false,
|
|
430
|
+
default: false,
|
|
422
431
|
})
|
|
423
|
-
public
|
|
432
|
+
public isGlobalLlm?: boolean = undefined;
|
|
424
433
|
|
|
425
434
|
@ColumnAccessControl({
|
|
426
|
-
create: [
|
|
427
|
-
read: [
|
|
435
|
+
create: [
|
|
428
436
|
Permission.ProjectOwner,
|
|
429
437
|
Permission.ProjectAdmin,
|
|
430
438
|
Permission.ProjectMember,
|
|
431
|
-
Permission.
|
|
439
|
+
Permission.CreateProjectLlm,
|
|
432
440
|
],
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
@TableColumn({
|
|
436
|
-
type: TableColumnType.ShortText,
|
|
437
|
-
title: "Copilot Event Status",
|
|
438
|
-
canReadOnRelationQuery: true,
|
|
439
|
-
description:
|
|
440
|
-
"Status of Copilot Event that was triggered for this file in Code Repository",
|
|
441
|
-
})
|
|
442
|
-
@Column({
|
|
443
|
-
type: ColumnType.ShortText,
|
|
444
|
-
nullable: false,
|
|
445
|
-
})
|
|
446
|
-
public copilotPullRequestStatus?: PullRequestState = undefined;
|
|
447
|
-
|
|
448
|
-
@ColumnAccessControl({
|
|
449
|
-
create: [],
|
|
450
|
-
read: [
|
|
441
|
+
read: [Permission.Public],
|
|
442
|
+
update: [
|
|
451
443
|
Permission.ProjectOwner,
|
|
452
444
|
Permission.ProjectAdmin,
|
|
453
445
|
Permission.ProjectMember,
|
|
454
|
-
Permission.
|
|
446
|
+
Permission.EditProjectLlm,
|
|
455
447
|
],
|
|
456
|
-
update: [],
|
|
457
448
|
})
|
|
458
449
|
@TableColumn({
|
|
450
|
+
isDefaultValueColumn: true,
|
|
451
|
+
required: true,
|
|
459
452
|
type: TableColumnType.Boolean,
|
|
460
|
-
title: "Is
|
|
461
|
-
required: false,
|
|
453
|
+
title: "Is Default",
|
|
462
454
|
description:
|
|
463
|
-
"Is this
|
|
455
|
+
"Is this the default LLM provider for the project? When set, the global LLM provider will not be used.",
|
|
456
|
+
defaultValue: false,
|
|
464
457
|
})
|
|
465
458
|
@Column({
|
|
466
459
|
type: ColumnType.Boolean,
|
|
467
|
-
nullable:
|
|
460
|
+
nullable: false,
|
|
461
|
+
unique: false,
|
|
462
|
+
default: false,
|
|
468
463
|
})
|
|
469
|
-
public
|
|
464
|
+
public isDefault?: boolean = undefined;
|
|
470
465
|
}
|