@oneuptime/common 9.2.16 → 9.2.18
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/CodeRepository.ts +664 -0
- package/Models/DatabaseModels/Index.ts +8 -0
- package/Models/DatabaseModels/LlmLog.ts +818 -0
- package/Models/DatabaseModels/LlmProvider.ts +21 -0
- package/Models/DatabaseModels/Project.ts +206 -0
- package/Models/DatabaseModels/ServiceCatalogCodeRepository.ts +549 -0
- package/Server/API/AIBillingAPI.ts +126 -0
- package/Server/API/AlertAPI.ts +139 -0
- package/Server/API/GitHubAPI.ts +360 -0
- package/Server/API/IncidentAPI.ts +258 -0
- package/Server/API/ScheduledMaintenanceAPI.ts +164 -0
- package/Server/EnvironmentConfig.ts +44 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1765580181582-MigrationName.ts +79 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1765633554715-MigrationName.ts +75 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1765801357168-MigrationName.ts +32 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1765810218488-MigrationName.ts +69 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1765830758857-MigrationName.ts +111 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1765834537501-MigrationName.ts +39 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +12 -0
- package/Server/Services/AIBillingService.ts +247 -0
- package/Server/Services/AIService.ts +238 -0
- package/Server/Services/CodeRepositoryService.ts +10 -0
- package/Server/Services/IncidentService.ts +88 -0
- package/Server/Services/Index.ts +2 -0
- package/Server/Services/LlmLogService.ts +14 -0
- package/Server/Services/LlmProviderService.ts +58 -0
- package/Server/Services/ServiceCatalogCodeRepositoryService.ts +55 -0
- package/Server/Utils/AI/AlertAIContextBuilder.ts +264 -0
- package/Server/Utils/AI/IncidentAIContextBuilder.ts +710 -0
- package/Server/Utils/AI/ScheduledMaintenanceAIContextBuilder.ts +345 -0
- package/Server/Utils/CodeRepository/GitHub/GitHub.ts +226 -0
- package/Server/Utils/LLM/LLMService.ts +276 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +166 -0
- package/Server/Utils/Workspace/Slack/Slack.ts +134 -0
- package/Server/Utils/Workspace/Workspace.ts +126 -0
- package/Tests/Types/Domain.test.ts +24 -3
- package/Types/CodeRepository/CodeRepositoryType.ts +1 -1
- package/Types/Domain.ts +21 -24
- package/Types/LlmLogStatus.ts +7 -0
- package/Types/Permission.ts +87 -0
- package/Types/ServiceCatalog/CodeRepositoryImprovementAction.ts +9 -0
- package/UI/Components/AI/AILoader.tsx +95 -0
- package/UI/Components/AI/GenerateFromAIModal.tsx +432 -0
- package/UI/Components/Modal/Modal.tsx +6 -1
- package/build/dist/Models/DatabaseModels/CodeRepository.js +689 -0
- package/build/dist/Models/DatabaseModels/CodeRepository.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Index.js +7 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LlmLog.js +856 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js.map +1 -0
- package/build/dist/Models/DatabaseModels/LlmProvider.js +22 -0
- package/build/dist/Models/DatabaseModels/LlmProvider.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +220 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ServiceCatalogCodeRepository.js +565 -0
- package/build/dist/Models/DatabaseModels/ServiceCatalogCodeRepository.js.map +1 -0
- package/build/dist/Server/API/AIBillingAPI.js +58 -0
- package/build/dist/Server/API/AIBillingAPI.js.map +1 -0
- package/build/dist/Server/API/AlertAPI.js +94 -0
- package/build/dist/Server/API/AlertAPI.js.map +1 -0
- package/build/dist/Server/API/GitHubAPI.js +207 -0
- package/build/dist/Server/API/GitHubAPI.js.map +1 -0
- package/build/dist/Server/API/IncidentAPI.js +171 -1
- package/build/dist/Server/API/IncidentAPI.js.map +1 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js +103 -0
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -0
- package/build/dist/Server/EnvironmentConfig.js +31 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765580181582-MigrationName.js +34 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765580181582-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765633554715-MigrationName.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765633554715-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765801357168-MigrationName.js +38 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765801357168-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765810218488-MigrationName.js +30 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765810218488-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765830758857-MigrationName.js +44 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765830758857-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765834537501-MigrationName.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1765834537501-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AIBillingService.js +187 -0
- package/build/dist/Server/Services/AIBillingService.js.map +1 -0
- package/build/dist/Server/Services/AIService.js +184 -0
- package/build/dist/Server/Services/AIService.js.map +1 -0
- package/build/dist/Server/Services/CodeRepositoryService.js +9 -0
- package/build/dist/Server/Services/CodeRepositoryService.js.map +1 -0
- package/build/dist/Server/Services/IncidentService.js +60 -0
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +2 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/LlmLogService.js +13 -0
- package/build/dist/Server/Services/LlmLogService.js.map +1 -0
- package/build/dist/Server/Services/LlmProviderService.js +65 -0
- package/build/dist/Server/Services/LlmProviderService.js.map +1 -1
- package/build/dist/Server/Services/ServiceCatalogCodeRepositoryService.js +54 -0
- package/build/dist/Server/Services/ServiceCatalogCodeRepositoryService.js.map +1 -0
- package/build/dist/Server/Utils/AI/AlertAIContextBuilder.js +238 -0
- package/build/dist/Server/Utils/AI/AlertAIContextBuilder.js.map +1 -0
- package/build/dist/Server/Utils/AI/IncidentAIContextBuilder.js +597 -0
- package/build/dist/Server/Utils/AI/IncidentAIContextBuilder.js.map +1 -0
- package/build/dist/Server/Utils/AI/ScheduledMaintenanceAIContextBuilder.js +311 -0
- package/build/dist/Server/Utils/AI/ScheduledMaintenanceAIContextBuilder.js.map +1 -0
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js +163 -0
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +225 -0
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +110 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +89 -0
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Workspace.js +80 -0
- package/build/dist/Server/Utils/Workspace/Workspace.js.map +1 -1
- package/build/dist/Tests/Types/Domain.test.js +19 -3
- package/build/dist/Tests/Types/Domain.test.js.map +1 -1
- package/build/dist/Types/CodeRepository/CodeRepositoryType.js +1 -1
- package/build/dist/Types/CodeRepository/CodeRepositoryType.js.map +1 -1
- package/build/dist/Types/Domain.js +18 -16
- package/build/dist/Types/Domain.js.map +1 -1
- package/build/dist/Types/LlmLogStatus.js +8 -0
- package/build/dist/Types/LlmLogStatus.js.map +1 -0
- package/build/dist/Types/Permission.js +74 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/ServiceCatalog/CodeRepositoryImprovementAction.js +10 -0
- package/build/dist/Types/ServiceCatalog/CodeRepositoryImprovementAction.js.map +1 -0
- package/build/dist/UI/Components/AI/AILoader.js +64 -0
- package/build/dist/UI/Components/AI/AILoader.js.map +1 -0
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js +320 -0
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js.map +1 -0
- package/build/dist/UI/Components/Modal/Modal.js +6 -1
- package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
- package/package.json +1 -1
|
@@ -462,4 +462,25 @@ export default class LlmProvider extends BaseModel {
|
|
|
462
462
|
default: false,
|
|
463
463
|
})
|
|
464
464
|
public isDefault?: boolean = undefined;
|
|
465
|
+
|
|
466
|
+
@ColumnAccessControl({
|
|
467
|
+
create: [],
|
|
468
|
+
read: [Permission.Public],
|
|
469
|
+
update: [],
|
|
470
|
+
})
|
|
471
|
+
@TableColumn({
|
|
472
|
+
isDefaultValueColumn: true,
|
|
473
|
+
required: true,
|
|
474
|
+
type: TableColumnType.Number,
|
|
475
|
+
title: "Cost Per Million Tokens (USD Cents)",
|
|
476
|
+
description:
|
|
477
|
+
"Cost per million tokens in USD cents. Used for billing when using global LLM providers.",
|
|
478
|
+
defaultValue: 0,
|
|
479
|
+
})
|
|
480
|
+
@Column({
|
|
481
|
+
type: ColumnType.Number,
|
|
482
|
+
nullable: false,
|
|
483
|
+
default: 0,
|
|
484
|
+
})
|
|
485
|
+
public costPerMillionTokensInUSDCents?: number = undefined;
|
|
465
486
|
}
|
|
@@ -962,6 +962,212 @@ export default class Project extends TenantModel {
|
|
|
962
962
|
})
|
|
963
963
|
public notEnabledSmsOrCallNotificationSentToOwners?: boolean = undefined;
|
|
964
964
|
|
|
965
|
+
// AI Billing Fields
|
|
966
|
+
|
|
967
|
+
@ColumnAccessControl({
|
|
968
|
+
create: [],
|
|
969
|
+
read: [
|
|
970
|
+
Permission.ProjectOwner,
|
|
971
|
+
Permission.ProjectAdmin,
|
|
972
|
+
Permission.ProjectMember,
|
|
973
|
+
Permission.ReadProject,
|
|
974
|
+
Permission.UnAuthorizedSsoUser,
|
|
975
|
+
],
|
|
976
|
+
update: [],
|
|
977
|
+
})
|
|
978
|
+
@TableColumn({
|
|
979
|
+
type: TableColumnType.Number,
|
|
980
|
+
isDefaultValueColumn: true,
|
|
981
|
+
required: true,
|
|
982
|
+
title: "AI Current Balance",
|
|
983
|
+
description: "Balance in USD for AI services",
|
|
984
|
+
defaultValue: 0,
|
|
985
|
+
example: 2500,
|
|
986
|
+
})
|
|
987
|
+
@Column({
|
|
988
|
+
type: ColumnType.Number,
|
|
989
|
+
nullable: false,
|
|
990
|
+
unique: false,
|
|
991
|
+
default: 0,
|
|
992
|
+
})
|
|
993
|
+
public aiCurrentBalanceInUSDCents?: number = undefined;
|
|
994
|
+
|
|
995
|
+
@ColumnAccessControl({
|
|
996
|
+
create: [],
|
|
997
|
+
read: [
|
|
998
|
+
Permission.ProjectOwner,
|
|
999
|
+
Permission.ProjectAdmin,
|
|
1000
|
+
Permission.ProjectMember,
|
|
1001
|
+
Permission.ReadProject,
|
|
1002
|
+
Permission.UnAuthorizedSsoUser,
|
|
1003
|
+
],
|
|
1004
|
+
update: [Permission.ProjectOwner, Permission.ManageProjectBilling],
|
|
1005
|
+
})
|
|
1006
|
+
@TableColumn({
|
|
1007
|
+
type: TableColumnType.Number,
|
|
1008
|
+
isDefaultValueColumn: true,
|
|
1009
|
+
required: true,
|
|
1010
|
+
title: "AI Auto Recharge Amount",
|
|
1011
|
+
description: "Auto recharge amount in USD for AI services",
|
|
1012
|
+
defaultValue: 20,
|
|
1013
|
+
example: 20,
|
|
1014
|
+
})
|
|
1015
|
+
@Column({
|
|
1016
|
+
type: ColumnType.Number,
|
|
1017
|
+
nullable: false,
|
|
1018
|
+
unique: false,
|
|
1019
|
+
default: 20,
|
|
1020
|
+
})
|
|
1021
|
+
public autoAiRechargeByBalanceInUSD?: number = undefined;
|
|
1022
|
+
|
|
1023
|
+
@ColumnAccessControl({
|
|
1024
|
+
create: [],
|
|
1025
|
+
read: [
|
|
1026
|
+
Permission.ProjectOwner,
|
|
1027
|
+
Permission.ProjectAdmin,
|
|
1028
|
+
Permission.ProjectMember,
|
|
1029
|
+
Permission.ReadProject,
|
|
1030
|
+
Permission.UnAuthorizedSsoUser,
|
|
1031
|
+
],
|
|
1032
|
+
update: [Permission.ProjectOwner, Permission.ManageProjectBilling],
|
|
1033
|
+
})
|
|
1034
|
+
@TableColumn({
|
|
1035
|
+
type: TableColumnType.Number,
|
|
1036
|
+
isDefaultValueColumn: true,
|
|
1037
|
+
required: true,
|
|
1038
|
+
title: "AI Auto Recharge when current balance falls to",
|
|
1039
|
+
description:
|
|
1040
|
+
"Auto recharge is triggered when current balance falls to this amount in USD for AI services",
|
|
1041
|
+
defaultValue: 10,
|
|
1042
|
+
example: 10,
|
|
1043
|
+
})
|
|
1044
|
+
@Column({
|
|
1045
|
+
type: ColumnType.Number,
|
|
1046
|
+
nullable: false,
|
|
1047
|
+
unique: false,
|
|
1048
|
+
default: 10,
|
|
1049
|
+
})
|
|
1050
|
+
public autoRechargeAiWhenCurrentBalanceFallsInUSD?: number = undefined;
|
|
1051
|
+
|
|
1052
|
+
@ColumnAccessControl({
|
|
1053
|
+
create: [],
|
|
1054
|
+
read: [
|
|
1055
|
+
Permission.ProjectOwner,
|
|
1056
|
+
Permission.ProjectAdmin,
|
|
1057
|
+
Permission.ProjectMember,
|
|
1058
|
+
Permission.ReadProject,
|
|
1059
|
+
Permission.UnAuthorizedSsoUser,
|
|
1060
|
+
Permission.ProjectUser,
|
|
1061
|
+
],
|
|
1062
|
+
update: [Permission.ProjectOwner, Permission.ManageProjectBilling],
|
|
1063
|
+
})
|
|
1064
|
+
@TableColumn({
|
|
1065
|
+
required: true,
|
|
1066
|
+
isDefaultValueColumn: true,
|
|
1067
|
+
type: TableColumnType.Boolean,
|
|
1068
|
+
title: "Enable AI",
|
|
1069
|
+
description: "Enable AI services for this project.",
|
|
1070
|
+
defaultValue: true,
|
|
1071
|
+
example: true,
|
|
1072
|
+
})
|
|
1073
|
+
@Column({
|
|
1074
|
+
nullable: false,
|
|
1075
|
+
default: true,
|
|
1076
|
+
type: ColumnType.Boolean,
|
|
1077
|
+
})
|
|
1078
|
+
public enableAi?: boolean = undefined;
|
|
1079
|
+
|
|
1080
|
+
@ColumnAccessControl({
|
|
1081
|
+
create: [],
|
|
1082
|
+
read: [
|
|
1083
|
+
Permission.ProjectOwner,
|
|
1084
|
+
Permission.ProjectAdmin,
|
|
1085
|
+
Permission.ProjectMember,
|
|
1086
|
+
Permission.ReadProject,
|
|
1087
|
+
Permission.UnAuthorizedSsoUser,
|
|
1088
|
+
Permission.ProjectUser,
|
|
1089
|
+
],
|
|
1090
|
+
update: [Permission.ProjectOwner, Permission.ManageProjectBilling],
|
|
1091
|
+
})
|
|
1092
|
+
@TableColumn({
|
|
1093
|
+
required: true,
|
|
1094
|
+
isDefaultValueColumn: true,
|
|
1095
|
+
type: TableColumnType.Boolean,
|
|
1096
|
+
title: "Enable auto recharge for AI balance",
|
|
1097
|
+
description: "Enable auto recharge for AI balance for this project.",
|
|
1098
|
+
defaultValue: false,
|
|
1099
|
+
example: true,
|
|
1100
|
+
})
|
|
1101
|
+
@Column({
|
|
1102
|
+
nullable: false,
|
|
1103
|
+
default: false,
|
|
1104
|
+
type: ColumnType.Boolean,
|
|
1105
|
+
})
|
|
1106
|
+
public enableAutoRechargeAiBalance?: boolean = undefined;
|
|
1107
|
+
|
|
1108
|
+
@ColumnAccessControl({
|
|
1109
|
+
create: [],
|
|
1110
|
+
read: [],
|
|
1111
|
+
update: [],
|
|
1112
|
+
})
|
|
1113
|
+
@TableColumn({
|
|
1114
|
+
required: true,
|
|
1115
|
+
isDefaultValueColumn: true,
|
|
1116
|
+
hideColumnInDocumentation: true,
|
|
1117
|
+
type: TableColumnType.Boolean,
|
|
1118
|
+
title: "Low AI Balance Notification Sent to Owners",
|
|
1119
|
+
description: "Low AI Balance Notification Sent to Owners",
|
|
1120
|
+
defaultValue: false,
|
|
1121
|
+
})
|
|
1122
|
+
@Column({
|
|
1123
|
+
nullable: false,
|
|
1124
|
+
default: false,
|
|
1125
|
+
type: ColumnType.Boolean,
|
|
1126
|
+
})
|
|
1127
|
+
public lowAiBalanceNotificationSentToOwners?: boolean = undefined;
|
|
1128
|
+
|
|
1129
|
+
@ColumnAccessControl({
|
|
1130
|
+
create: [],
|
|
1131
|
+
read: [],
|
|
1132
|
+
update: [],
|
|
1133
|
+
})
|
|
1134
|
+
@TableColumn({
|
|
1135
|
+
required: true,
|
|
1136
|
+
isDefaultValueColumn: true,
|
|
1137
|
+
type: TableColumnType.Boolean,
|
|
1138
|
+
hideColumnInDocumentation: true,
|
|
1139
|
+
title: "Failed AI Balance Charge Notification Sent to Owners",
|
|
1140
|
+
description: "Failed AI Balance Charge Notification Sent to Owners",
|
|
1141
|
+
defaultValue: false,
|
|
1142
|
+
})
|
|
1143
|
+
@Column({
|
|
1144
|
+
nullable: false,
|
|
1145
|
+
default: false,
|
|
1146
|
+
type: ColumnType.Boolean,
|
|
1147
|
+
})
|
|
1148
|
+
public failedAiBalanceChargeNotificationSentToOwners?: boolean = undefined;
|
|
1149
|
+
|
|
1150
|
+
@ColumnAccessControl({
|
|
1151
|
+
create: [],
|
|
1152
|
+
read: [],
|
|
1153
|
+
update: [],
|
|
1154
|
+
})
|
|
1155
|
+
@TableColumn({
|
|
1156
|
+
required: true,
|
|
1157
|
+
isDefaultValueColumn: true,
|
|
1158
|
+
hideColumnInDocumentation: true,
|
|
1159
|
+
type: TableColumnType.Boolean,
|
|
1160
|
+
title: "Not Enabled AI Notification Sent to Owners",
|
|
1161
|
+
description: "Not Enabled AI Notification Sent to Owners",
|
|
1162
|
+
defaultValue: false,
|
|
1163
|
+
})
|
|
1164
|
+
@Column({
|
|
1165
|
+
nullable: false,
|
|
1166
|
+
default: false,
|
|
1167
|
+
type: ColumnType.Boolean,
|
|
1168
|
+
})
|
|
1169
|
+
public notEnabledAiNotificationSentToOwners?: boolean = undefined;
|
|
1170
|
+
|
|
965
1171
|
@ColumnAccessControl({
|
|
966
1172
|
create: [Permission.User],
|
|
967
1173
|
read: [
|