@oneuptime/common 15.0.0 → 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/Models/DatabaseModels/AIAgent.js +2 -0
  2. package/Models/DatabaseModels/AIAgentTaskPullRequest.d.mts +2 -0
  3. package/Models/DatabaseModels/AIAgentTaskPullRequest.d.ts +2 -0
  4. package/Models/DatabaseModels/AIAgentTaskPullRequest.js +62 -0
  5. package/Models/DatabaseModels/AIRun.d.mts +2 -0
  6. package/Models/DatabaseModels/AIRun.d.ts +2 -0
  7. package/Models/DatabaseModels/AIRun.js +63 -0
  8. package/Models/DatabaseModels/CustomNotificationChannel.js +17 -9
  9. package/Models/DatabaseModels/DataProduct.js +3 -2
  10. package/Models/DatabaseModels/GlobalConfig.js +1 -1
  11. package/Models/DatabaseModels/IoTDeviceCredential.js +3 -1
  12. package/Models/DatabaseModels/Monitor.d.mts +4 -0
  13. package/Models/DatabaseModels/Monitor.d.ts +4 -0
  14. package/Models/DatabaseModels/Monitor.js +108 -5
  15. package/Models/DatabaseModels/NetworkDevice.js +43 -17
  16. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +38 -15
  17. package/Models/DatabaseModels/NetworkSnmpCredentialProfile.js +4 -4
  18. package/Models/DatabaseModels/OpenStackProjectNotice.js +29 -10
  19. package/Models/DatabaseModels/Probe.js +2 -0
  20. package/Models/DatabaseModels/ProjectSCIM.d.mts +2 -1
  21. package/Models/DatabaseModels/ProjectSCIM.d.ts +2 -1
  22. package/Models/DatabaseModels/ProjectSCIM.js +21 -9
  23. package/Models/DatabaseModels/Runbook.js +3 -2
  24. package/Models/DatabaseModels/Runner.js +2 -0
  25. package/Models/DatabaseModels/StatusPage.js +3 -2
  26. package/Models/DatabaseModels/StatusPageSCIM.d.mts +2 -1
  27. package/Models/DatabaseModels/StatusPageSCIM.d.ts +2 -1
  28. package/Models/DatabaseModels/StatusPageSCIM.js +17 -8
  29. package/Models/DatabaseModels/StatusPageSubscriber.js +35 -15
  30. package/Models/DatabaseModels/TelemetryIngestionKey.d.mts +2 -0
  31. package/Models/DatabaseModels/TelemetryIngestionKey.d.ts +2 -0
  32. package/Models/DatabaseModels/TelemetryIngestionKey.js +36 -1
  33. package/Models/DatabaseModels/UserWebhook.js +25 -17
  34. package/Models/DatabaseModels/WebhookLog.js +12 -2
  35. package/Models/DatabaseModels/Workflow.d.mts +3 -0
  36. package/Models/DatabaseModels/Workflow.d.ts +3 -0
  37. package/Models/DatabaseModels/Workflow.js +70 -1
  38. package/Server/Services/DatabaseService.d.mts +21 -1
  39. package/Server/Services/DatabaseService.d.ts +21 -1
  40. package/Types/AI/AIActionWords.js +1 -1
  41. package/Types/AI/CarriedRecords.d.mts +35 -0
  42. package/Types/AI/CarriedRecords.d.ts +35 -0
  43. package/Types/AI/CarriedRecords.js +211 -0
  44. package/Types/AI/CarriedRecords.mjs +3 -0
  45. package/Types/Accounts/SetPasswordLink.d.mts +6 -0
  46. package/Types/Accounts/SetPasswordLink.d.ts +6 -0
  47. package/Types/Accounts/SetPasswordLink.js +47 -0
  48. package/Types/Accounts/SetPasswordLink.mjs +7 -0
  49. package/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.js +1 -1
  50. package/Types/CodeRepository/ProductionReview.d.mts +5 -0
  51. package/Types/CodeRepository/ProductionReview.d.ts +5 -0
  52. package/Types/CodeRepository/ProductionReview.js +108 -0
  53. package/Types/Database/DatabaseProperty.d.mts +1 -0
  54. package/Types/Database/DatabaseProperty.d.ts +1 -0
  55. package/Types/Database/DatabaseProperty.js +27 -0
  56. package/Types/Database/EncryptedValue.d.mts +2 -0
  57. package/Types/Database/EncryptedValue.d.ts +2 -0
  58. package/Types/Database/EncryptedValue.js +27 -0
  59. package/Types/Database/EncryptedValue.mjs +3 -0
  60. package/Types/Database/TableColumn.d.mts +3 -0
  61. package/Types/Database/TableColumn.d.ts +3 -0
  62. package/Types/Docs/GlossaryTerm.d.mts +1 -0
  63. package/Types/Docs/GlossaryTerm.d.ts +1 -0
  64. package/Types/Docs/GlossaryTerm.js +2 -0
  65. package/Types/Email/EmailSendFailure.d.mts +20 -0
  66. package/Types/Email/EmailSendFailure.d.ts +20 -0
  67. package/Types/Email/EmailSendFailure.js +244 -0
  68. package/Types/Email/EmailSendFailure.mjs +3 -0
  69. package/Types/Email/EmailTemplateType.d.mts +1 -0
  70. package/Types/Email/EmailTemplateType.d.ts +1 -0
  71. package/Types/Email/EmailTemplateType.js +5 -0
  72. package/Types/Runner/RunnerCodeFixCapability.d.mts +3 -1
  73. package/Types/Runner/RunnerCodeFixCapability.d.ts +3 -1
  74. package/Types/Runner/RunnerCodeFixCapability.js +19 -1
  75. package/Types/Runner/RunnerCodeFixCapability.mjs +1 -0
  76. package/Types/SSO/SessionsWithoutSso.js +2 -2
  77. package/Types/ServerSending/ServerSendingStatus.d.mts +23 -2
  78. package/Types/ServerSending/ServerSendingStatus.d.ts +23 -2
  79. package/Types/ServerSending/ServerSendingStatus.js +208 -10
  80. package/Types/ServerSending/ServerSendingStatus.mjs +3 -0
  81. package/Types/ServerSetup/ServerSetupChecklist.js +5 -0
  82. package/Types/StatusPage/StatusPageMagicLink.js +1 -1
  83. package/Types/StatusPage/StatusPageSignInMessages.d.mts +3 -0
  84. package/Types/StatusPage/StatusPageSignInMessages.d.ts +3 -0
  85. package/Types/StatusPage/StatusPageSignInMessages.js +16 -0
  86. package/Types/StatusPage/StatusPageSignInMessages.mjs +4 -0
  87. package/Types/StatusPage/StatusPageSingleSignOnProtocol.d.mts +12 -0
  88. package/Types/StatusPage/StatusPageSingleSignOnProtocol.d.ts +12 -0
  89. package/Types/StatusPage/StatusPageSingleSignOnProtocol.js +63 -0
  90. package/Types/StatusPage/StatusPageSingleSignOnProtocol.mjs +8 -0
  91. package/Types/StatusPage/StatusPageSubscriberChannel.d.mts +18 -0
  92. package/Types/StatusPage/StatusPageSubscriberChannel.d.ts +18 -0
  93. package/Types/StatusPage/StatusPageSubscriberChannel.js +91 -0
  94. package/Types/StatusPage/StatusPageSubscriberChannel.mjs +10 -0
  95. package/Types/Workspace/ConnectCallback.d.mts +2 -1
  96. package/Types/Workspace/ConnectCallback.d.ts +2 -1
  97. package/Types/Workspace/ConnectCallback.js +8 -0
  98. package/Utils/AiRemediation/DeclaredCodeChange.d.mts +4 -1
  99. package/Utils/AiRemediation/DeclaredCodeChange.d.ts +4 -1
  100. package/Utils/AiRemediation/DeclaredCodeChange.js +6 -0
  101. package/Utils/Dashboard/MonitorListWidgetFormat.js +1 -1
  102. package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +2 -0
  103. package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +2 -0
  104. package/Utils/Incident/PostmortemActionItemCodeTask.js +22 -5
  105. package/Utils/Incident/PostmortemActionItemCodeTask.mjs +1 -0
  106. package/Utils/LookupTable.d.mts +1 -0
  107. package/Utils/LookupTable.d.ts +1 -0
  108. package/Utils/LookupTable.js +19 -0
  109. package/Utils/LookupTable.mjs +1 -0
  110. package/Utils/Monitor/MonitorFirstCheckOverdue.js +5 -5
  111. package/Utils/Monitor/MonitorOverviewFamily.d.mts +2 -10
  112. package/Utils/Monitor/MonitorOverviewFamily.d.ts +2 -10
  113. package/Utils/Monitor/MonitorOverviewFamily.js +19 -99
  114. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.mts +1 -1
  115. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.ts +1 -1
  116. package/Utils/Monitor/MonitorOverviewPresentationUtil.js +6 -6
  117. package/Utils/Monitor/MonitorRowStatus.js +2 -2
  118. package/Utils/Monitor/MonitorTypeFamily.d.mts +14 -0
  119. package/Utils/Monitor/MonitorTypeFamily.d.ts +14 -0
  120. package/Utils/Monitor/MonitorTypeFamily.js +105 -0
  121. package/Utils/Monitor/MonitorTypeFamily.mjs +3 -0
  122. package/Utils/Monitor/StoredCheckEvidence.d.mts +10 -0
  123. package/Utils/Monitor/StoredCheckEvidence.d.ts +10 -0
  124. package/Utils/Monitor/StoredCheckEvidence.js +53 -0
  125. package/Utils/Monitor/StoredCheckEvidence.mjs +5 -0
  126. package/Utils/NetworkDiscovery/SnmpScanConfigUtil.js +11 -4
  127. package/Utils/Project/ProjectBilling.d.mts +1 -0
  128. package/Utils/Project/ProjectBilling.d.ts +1 -0
  129. package/Utils/Project/ProjectBilling.js +9 -1
  130. package/Utils/Project/ProjectBilling.mjs +1 -0
  131. package/Utils/StatusPage/HistoryWindow.d.mts +3 -0
  132. package/Utils/StatusPage/HistoryWindow.d.ts +3 -0
  133. package/Utils/StatusPage/HistoryWindow.js +24 -0
  134. package/Utils/StatusPage/HistoryWindow.mjs +4 -0
  135. package/Utils/Suggestions/CodeFixSuggestion.d.mts +2 -1
  136. package/Utils/Suggestions/CodeFixSuggestion.d.ts +2 -1
  137. package/Utils/Suggestions/CodeFixSuggestion.js +9 -0
  138. package/Utils/Suggestions/InvestigationCodeFixSuggestion.d.mts +1 -0
  139. package/Utils/Suggestions/InvestigationCodeFixSuggestion.d.ts +1 -0
  140. package/Utils/Suggestions/InvestigationCodeFixSuggestion.js +24 -3
  141. package/Utils/Suggestions/InvestigationCodeFixSuggestion.mjs +1 -0
  142. package/Utils/Suggestions/ProfileFixSuggestion.d.mts +1 -0
  143. package/Utils/Suggestions/ProfileFixSuggestion.d.ts +1 -0
  144. package/Utils/Suggestions/ProfileFixSuggestion.js +16 -4
  145. package/Utils/Suggestions/TelemetryAiFixSuggestion.d.mts +2 -0
  146. package/Utils/Suggestions/TelemetryAiFixSuggestion.d.ts +2 -0
  147. package/Utils/Suggestions/TelemetryAiFixSuggestion.js +17 -5
  148. package/Utils/Suggestions/TelemetryAiFixSuggestion.mjs +1 -0
  149. package/Utils/Suggestions/TracePerformanceFixSuggestion.js +16 -7
  150. package/Utils/WebhookAddressMask.d.mts +9 -0
  151. package/Utils/WebhookAddressMask.d.ts +9 -0
  152. package/Utils/WebhookAddressMask.js +66 -0
  153. package/Utils/WebhookAddressMask.mjs +2 -0
  154. package/package.json +1 -1
@@ -104,6 +104,8 @@ __decorate([
104
104
  }),
105
105
  (0, TableColumn_1.default)({
106
106
  secret: true,
107
+ encrypted: true,
108
+ presentedKey: true,
107
109
  required: false,
108
110
  unique: true,
109
111
  type: TableColumnType_1.default.ShortText,
@@ -15,6 +15,8 @@ export default class AIAgentTaskPullRequest extends BaseModel {
15
15
  project?: Project;
16
16
  projectId?: ObjectID;
17
17
  aiRunId?: ObjectID;
18
+ carriedIncidentIds?: Array<string>;
19
+ carriedAlertIds?: Array<string>;
18
20
  aiAgent?: AIAgent;
19
21
  aiAgentId?: ObjectID;
20
22
  codeRepository?: CodeRepository;
@@ -15,6 +15,8 @@ export default class AIAgentTaskPullRequest extends BaseModel {
15
15
  project?: Project;
16
16
  projectId?: ObjectID;
17
17
  aiRunId?: ObjectID;
18
+ carriedIncidentIds?: Array<string>;
19
+ carriedAlertIds?: Array<string>;
18
20
  aiAgent?: AIAgent;
19
21
  aiAgentId?: ObjectID;
20
22
  codeRepository?: CodeRepository;
@@ -47,6 +47,20 @@ let AIAgentTaskPullRequest = class AIAgentTaskPullRequest extends DatabaseBaseMo
47
47
  this.project = undefined;
48
48
  this.projectId = undefined;
49
49
  this.aiRunId = undefined;
50
+ /*
51
+ * The incidents and alerts a pull request OneUptime AI opened from a chat
52
+ * carries (#9186): the chat's subject - the incident or alert whose AI
53
+ * conversation it is, or the one Ask AI was asked about. Its title and
54
+ * description are the model's, written in that chat. Read by
55
+ * AIRunOutputReadFilter beside the run it names (a CodeFix run's pull
56
+ * request is read through its run, which carries what its task carries):
57
+ * one carrying a private incident or alert is read only by those who may
58
+ * read it, one carrying a record that is gone only by Project Owners and
59
+ * Project Admins. Written by OneUptime only.
60
+ */
61
+ this.carriedIncidentIds = undefined;
62
+ // The alert counterpart of carriedIncidentIds.
63
+ this.carriedAlertIds = undefined;
50
64
  this.aiAgent = undefined;
51
65
  this.aiAgentId = undefined;
52
66
  this.codeRepository = undefined;
@@ -204,6 +218,54 @@ __decorate([
204
218
  }),
205
219
  __metadata("design:type", ObjectID_1.default)
206
220
  ], AIAgentTaskPullRequest.prototype, "aiRunId", void 0);
221
+ __decorate([
222
+ (0, ColumnAccessControl_1.default)({
223
+ create: [],
224
+ read: [
225
+ Permission_1.default.ProjectOwner,
226
+ Permission_1.default.ProjectAdmin,
227
+ Permission_1.default.ProjectMember,
228
+ Permission_1.default.Viewer,
229
+ Permission_1.default.ReadProjectAIAgentTask,
230
+ ],
231
+ update: [],
232
+ }),
233
+ (0, TableColumn_1.default)({
234
+ type: TableColumnType_1.default.JSON,
235
+ required: false,
236
+ title: "Carried Incident IDs",
237
+ description: "IDs of the incidents this pull request carries: the subject of the AI chat it was opened from.",
238
+ }),
239
+ (0, typeorm_1.Column)({
240
+ type: ColumnType_1.default.JSON,
241
+ nullable: true,
242
+ }),
243
+ __metadata("design:type", Array)
244
+ ], AIAgentTaskPullRequest.prototype, "carriedIncidentIds", void 0);
245
+ __decorate([
246
+ (0, ColumnAccessControl_1.default)({
247
+ create: [],
248
+ read: [
249
+ Permission_1.default.ProjectOwner,
250
+ Permission_1.default.ProjectAdmin,
251
+ Permission_1.default.ProjectMember,
252
+ Permission_1.default.Viewer,
253
+ Permission_1.default.ReadProjectAIAgentTask,
254
+ ],
255
+ update: [],
256
+ }),
257
+ (0, TableColumn_1.default)({
258
+ type: TableColumnType_1.default.JSON,
259
+ required: false,
260
+ title: "Carried Alert IDs",
261
+ description: "IDs of the alerts this pull request carries: the subject of the AI chat it was opened from.",
262
+ }),
263
+ (0, typeorm_1.Column)({
264
+ type: ColumnType_1.default.JSON,
265
+ nullable: true,
266
+ }),
267
+ __metadata("design:type", Array)
268
+ ], AIAgentTaskPullRequest.prototype, "carriedAlertIds", void 0);
207
269
  __decorate([
208
270
  (0, ColumnAccessControl_1.default)({
209
271
  create: [
@@ -55,6 +55,8 @@ export default class AIRun extends BaseModel {
55
55
  codeRepository?: CodeRepository;
56
56
  codeRepositoryId?: ObjectID;
57
57
  codeTaskId?: ObjectID;
58
+ carriedIncidentIds?: Array<string>;
59
+ carriedAlertIds?: Array<string>;
58
60
  title?: string;
59
61
  needsUserInput?: boolean;
60
62
  taskOutcome?: CodeTaskOutcome;
@@ -55,6 +55,8 @@ export default class AIRun extends BaseModel {
55
55
  codeRepository?: CodeRepository;
56
56
  codeRepositoryId?: ObjectID;
57
57
  codeTaskId?: ObjectID;
58
+ carriedIncidentIds?: Array<string>;
59
+ carriedAlertIds?: Array<string>;
58
60
  title?: string;
59
61
  needsUserInput?: boolean;
60
62
  taskOutcome?: CodeTaskOutcome;
@@ -187,6 +187,23 @@ let AIRun = class AIRun extends DatabaseBaseModel_1.default {
187
187
  * that run and every run whose codeTaskId is its id.
188
188
  */
189
189
  this.codeTaskId = undefined;
190
+ /*
191
+ * The incidents and alerts a Code task carries without being a fix of one
192
+ * (#9186): a person added them as context to a request or a reply, or the
193
+ * task was asked from a postmortem action item and carries its incident.
194
+ * A task carries what every one of its turns carries, so a reply that adds
195
+ * one adds it to its task too (AIRunService). A list of ids each, a task
196
+ * can carry several. Read by AIRunOutputReadFilter: a task carrying a
197
+ * private incident or alert - every turn of it, and its pull request - is
198
+ * read only by those who may read every one of them; one carrying a record
199
+ * that is gone, only by Project Owners and Project Admins. Not
200
+ * triggeredByIncidentId and triggeredByAlertId, which the fix-task
201
+ * triggers, the daily fix-task limit and the AI logs read as a fix of the
202
+ * record. Written by OneUptime only.
203
+ */
204
+ this.carriedIncidentIds = undefined;
205
+ // The alert counterpart of carriedIncidentIds.
206
+ this.carriedAlertIds = undefined;
190
207
  /*
191
208
  * A request's title: the first line of what the person asked (CodeTask
192
209
  * Title). Server-only like taskContext (empty read ACL): it is their words,
@@ -1293,6 +1310,52 @@ __decorate([
1293
1310
  }),
1294
1311
  __metadata("design:type", ObjectID_1.default)
1295
1312
  ], AIRun.prototype, "codeTaskId", void 0);
1313
+ __decorate([
1314
+ (0, ColumnAccessControl_1.default)({
1315
+ create: [],
1316
+ read: [
1317
+ Permission_1.default.ProjectOwner,
1318
+ Permission_1.default.ProjectAdmin,
1319
+ Permission_1.default.ProjectMember,
1320
+ Permission_1.default.Viewer,
1321
+ ],
1322
+ update: [],
1323
+ }),
1324
+ (0, TableColumn_1.default)({
1325
+ type: TableColumnType_1.default.JSON,
1326
+ required: false,
1327
+ title: "Carried Incident IDs",
1328
+ description: "IDs of the incidents this code task carries without being a fix of one: added as context to its request or a reply, or the incident of the postmortem action item it was asked from.",
1329
+ }),
1330
+ (0, typeorm_1.Column)({
1331
+ type: ColumnType_1.default.JSON,
1332
+ nullable: true,
1333
+ }),
1334
+ __metadata("design:type", Array)
1335
+ ], AIRun.prototype, "carriedIncidentIds", void 0);
1336
+ __decorate([
1337
+ (0, ColumnAccessControl_1.default)({
1338
+ create: [],
1339
+ read: [
1340
+ Permission_1.default.ProjectOwner,
1341
+ Permission_1.default.ProjectAdmin,
1342
+ Permission_1.default.ProjectMember,
1343
+ Permission_1.default.Viewer,
1344
+ ],
1345
+ update: [],
1346
+ }),
1347
+ (0, TableColumn_1.default)({
1348
+ type: TableColumnType_1.default.JSON,
1349
+ required: false,
1350
+ title: "Carried Alert IDs",
1351
+ description: "IDs of the alerts this code task carries without being a fix of one: added as context to its request or a reply.",
1352
+ }),
1353
+ (0, typeorm_1.Column)({
1354
+ type: ColumnType_1.default.JSON,
1355
+ nullable: true,
1356
+ }),
1357
+ __metadata("design:type", Array)
1358
+ ], AIRun.prototype, "carriedAlertIds", void 0);
1296
1359
  __decorate([
1297
1360
  (0, ColumnAccessControl_1.default)({
1298
1361
  create: [],
@@ -63,12 +63,20 @@ let CustomNotificationChannel = class CustomNotificationChannel extends Database
63
63
  * Where every page is POSTed. The admin's own service, which may well be on
64
64
  * the installation's private network, so CustomNotificationChannelService
65
65
  * checks it allowing private targets, as it does a person's own webhook.
66
+ *
67
+ * An address can carry its service's credential, so it is kept encrypted
68
+ * at rest (`encrypted: true`), as the signing secret below is:
69
+ * DatabaseService encrypts both on every write and decrypts them on every
70
+ * read, the sender's and the Admin Dashboard's included. The
71
+ * EncryptWebhookAddresses data migration encrypts the values stored
72
+ * before. Text, as a ciphertext is longer than its value.
66
73
  */
67
74
  this.webhookUrl = undefined;
68
75
  /*
69
76
  * The HMAC key every request is signed with (X-OneUptime-Signature). The
70
77
  * service checks it to know a page came from OneUptime; whoever reads it can
71
- * forge one. Generated when the admin leaves it empty.
78
+ * forge one. Generated when the admin leaves it empty. Kept encrypted at
79
+ * rest, as the URL above is.
72
80
  */
73
81
  this.secret = undefined;
74
82
  /*
@@ -137,13 +145,13 @@ __decorate([
137
145
  title: "Webhook URL",
138
146
  required: true,
139
147
  unique: false,
140
- type: TableColumnType_1.default.LongText,
148
+ encrypted: true,
149
+ type: TableColumnType_1.default.VeryLongText,
141
150
  canReadOnRelationQuery: false,
142
- description: "Where OneUptime sends each page, as a JSON POST request signed with the signing secret.",
151
+ description: "Where OneUptime sends each page, as a JSON POST request signed with the signing secret. Kept encrypted at rest.",
143
152
  }),
144
153
  (0, typeorm_1.Column)({
145
- type: ColumnType_1.default.LongText,
146
- length: ColumnLength_1.default.LongText,
154
+ type: ColumnType_1.default.VeryLongText,
147
155
  unique: false,
148
156
  nullable: false,
149
157
  }),
@@ -157,16 +165,16 @@ __decorate([
157
165
  }),
158
166
  (0, TableColumn_1.default)({
159
167
  secret: true,
168
+ encrypted: true,
160
169
  title: "Signing Secret",
161
170
  required: true,
162
171
  unique: false,
163
- type: TableColumnType_1.default.ShortText,
172
+ type: TableColumnType_1.default.VeryLongText,
164
173
  canReadOnRelationQuery: false,
165
- description: "Every request carries an HMAC-SHA256 signature of its body made with this secret, in the X-OneUptime-Signature header (sha256=<hex>).",
174
+ description: "Every request carries an HMAC-SHA256 signature of its body made with this secret, in the X-OneUptime-Signature header (sha256=<hex>). Kept encrypted at rest.",
166
175
  }),
167
176
  (0, typeorm_1.Column)({
168
- type: ColumnType_1.default.ShortText,
169
- length: ColumnLength_1.default.ShortText,
177
+ type: ColumnType_1.default.VeryLongText,
170
178
  unique: false,
171
179
  nullable: false,
172
180
  }),
@@ -539,6 +539,8 @@ __decorate([
539
539
  (0, ColumnAccessControl_1.default)(serverWrittenColumnAccess),
540
540
  (0, TableColumn_1.default)({
541
541
  secret: true,
542
+ encrypted: true,
543
+ presentedKey: true,
542
544
  type: TableColumnType_1.default.ShortText,
543
545
  required: false,
544
546
  computed: true,
@@ -546,8 +548,7 @@ __decorate([
546
548
  description: "The secret in the badge's URL, so a badge can be embedded where people cannot sign in to OneUptime.",
547
549
  }),
548
550
  (0, typeorm_1.Column)({
549
- type: ColumnType_1.default.ShortText,
550
- length: ColumnLength_1.default.ShortText,
551
+ type: ColumnType_1.default.VeryLongText,
551
552
  nullable: true,
552
553
  }),
553
554
  __metadata("design:type", String)
@@ -467,7 +467,7 @@ __decorate([
467
467
  }),
468
468
  (0, TableColumn_1.default)({
469
469
  type: TableColumnType_1.default.Boolean,
470
- title: "Require SSO for Login",
470
+ title: "Require SSO to Sign In",
471
471
  description: "When enabled, all users must sign in with SSO to access any project on this server. Master admins are exempt so they can always recover from a misconfigured SSO. A project's own SSO settings still apply on top of this.",
472
472
  defaultValue: false,
473
473
  }),
@@ -440,6 +440,8 @@ __decorate([
440
440
  (0, typeorm_1.Index)(),
441
441
  (0, TableColumn_1.default)({
442
442
  secret: true,
443
+ encrypted: true,
444
+ presentedKey: true,
443
445
  type: TableColumnType_1.default.ObjectID,
444
446
  isDefaultValueColumn: false,
445
447
  computed: true,
@@ -448,7 +450,7 @@ __decorate([
448
450
  example: "c3d4e5f6-a7b8-9012-cdef-123456789012",
449
451
  }),
450
452
  (0, typeorm_1.Column)({
451
- type: ColumnType_1.default.ObjectID,
453
+ type: ColumnType_1.default.VeryLongText,
452
454
  nullable: false,
453
455
  transformer: ObjectID_1.default.getDatabaseTransformer(),
454
456
  }),
@@ -27,6 +27,7 @@ import { IncomingRequestSecretProblem } from "../../Types/Monitor/IncomingMonito
27
27
  import MonitorSteps from "../../Types/Monitor/MonitorSteps.mjs";
28
28
  import MonitorType from "../../Types/Monitor/MonitorType.mjs";
29
29
  import ServerMonitorResponse from "../../Types/Monitor/ServerMonitor/ServerMonitorResponse.mjs";
30
+ import HashedString from "../../Types/HashedString.mjs";
30
31
  import ObjectID from "../../Types/ObjectID.mjs";
31
32
  import NotificationRuleWorkspaceChannel from "../../Types/Workspace/NotificationRules/NotificationRuleWorkspaceChannel.mjs";
32
33
  export default class Monitor extends BaseModel {
@@ -83,13 +84,16 @@ export default class Monitor extends BaseModel {
83
84
  disableActiveMonitoringBecauseOfManualIncident?: boolean;
84
85
  serverMonitorRequestReceivedAt?: Date;
85
86
  serverMonitorSecretKey?: ObjectID;
87
+ serverMonitorSecretKeyHash?: HashedString;
86
88
  incomingRequestSecretKey?: ObjectID;
89
+ incomingRequestSecretKeyHash?: HashedString;
87
90
  incomingMonitorRequest?: IncomingMonitorRequest;
88
91
  incomingMonitorRequestAsReceived?: IncomingMonitorRequest;
89
92
  incomingRequestWithSecretAt?: Date;
90
93
  incomingRequestWithoutSecretAt?: Date;
91
94
  incomingRequestWithoutSecretReason?: IncomingRequestSecretProblem;
92
95
  incomingEmailSecretKey?: ObjectID;
96
+ incomingEmailSecretKeyHash?: HashedString;
93
97
  incomingEmailCustomLocalPart?: string;
94
98
  incomingEmailMonitorLastEmailReceivedAt?: Date;
95
99
  incomingEmailMonitorRequest?: IncomingEmailMonitorRequest;
@@ -27,6 +27,7 @@ import { IncomingRequestSecretProblem } from "../../Types/Monitor/IncomingMonito
27
27
  import MonitorSteps from "../../Types/Monitor/MonitorSteps";
28
28
  import MonitorType from "../../Types/Monitor/MonitorType";
29
29
  import ServerMonitorResponse from "../../Types/Monitor/ServerMonitor/ServerMonitorResponse";
30
+ import HashedString from "../../Types/HashedString";
30
31
  import ObjectID from "../../Types/ObjectID";
31
32
  import NotificationRuleWorkspaceChannel from "../../Types/Workspace/NotificationRules/NotificationRuleWorkspaceChannel";
32
33
  export default class Monitor extends BaseModel {
@@ -83,13 +84,16 @@ export default class Monitor extends BaseModel {
83
84
  disableActiveMonitoringBecauseOfManualIncident?: boolean;
84
85
  serverMonitorRequestReceivedAt?: Date;
85
86
  serverMonitorSecretKey?: ObjectID;
87
+ serverMonitorSecretKeyHash?: HashedString;
86
88
  incomingRequestSecretKey?: ObjectID;
89
+ incomingRequestSecretKeyHash?: HashedString;
87
90
  incomingMonitorRequest?: IncomingMonitorRequest;
88
91
  incomingMonitorRequestAsReceived?: IncomingMonitorRequest;
89
92
  incomingRequestWithSecretAt?: Date;
90
93
  incomingRequestWithoutSecretAt?: Date;
91
94
  incomingRequestWithoutSecretReason?: IncomingRequestSecretProblem;
92
95
  incomingEmailSecretKey?: ObjectID;
96
+ incomingEmailSecretKeyHash?: HashedString;
93
97
  incomingEmailCustomLocalPart?: string;
94
98
  incomingEmailMonitorLastEmailReceivedAt?: Date;
95
99
  incomingEmailMonitorRequest?: IncomingEmailMonitorRequest;
@@ -56,6 +56,7 @@ const IncomingRequestSecret_1 = require("../../Types/Monitor/IncomingMonitor/Inc
56
56
  const MonitorSteps_1 = __importDefault(require("../../Types/Monitor/MonitorSteps"));
57
57
  const MonitorStepsColumnTransformer_1 = __importDefault(require("../../Types/Monitor/MonitorStepsColumnTransformer"));
58
58
  const MonitorType_1 = __importDefault(require("../../Types/Monitor/MonitorType"));
59
+ const HashedString_1 = __importDefault(require("../../Types/HashedString"));
59
60
  const ObjectID_1 = __importDefault(require("../../Types/ObjectID"));
60
61
  const Permission_1 = __importDefault(require("../../Types/Permission"));
61
62
  const typeorm_1 = require("typeorm");
@@ -178,7 +179,25 @@ let Monitor = class Monitor extends DatabaseBaseModel_1.default {
178
179
  this.disableActiveMonitoringBecauseOfManualIncident = undefined;
179
180
  this.serverMonitorRequestReceivedAt = undefined;
180
181
  this.serverMonitorSecretKey = undefined;
182
+ /*
183
+ * The lookup hash of serverMonitorSecretKey, the key a
184
+ * server's agent reports with (#9012).
185
+ * The key is kept encrypted, which no query can find by its value, so
186
+ * a request that presents it is matched by this hash
187
+ * (DatabaseService.findOneByPresentedKey), then held to the key itself.
188
+ * OneUptime writes it with every write of the key.
189
+ */
190
+ this.serverMonitorSecretKeyHash = undefined;
181
191
  this.incomingRequestSecretKey = undefined;
192
+ /*
193
+ * The lookup hash of incomingRequestSecretKey, the key in
194
+ * the heartbeat URL (#9012).
195
+ * The key is kept encrypted, which no query can find by its value, so
196
+ * a request that presents it is matched by this hash
197
+ * (DatabaseService.findOneByPresentedKey), then held to the key itself.
198
+ * OneUptime writes it with every write of the key.
199
+ */
200
+ this.incomingRequestSecretKeyHash = undefined;
182
201
  // this is for incoming request monitor.
183
202
  /*
184
203
  * The latest request as people read it: cut as the monitor's logs are,
@@ -228,6 +247,15 @@ let Monitor = class Monitor extends DatabaseBaseModel_1.default {
228
247
  this.incomingRequestWithoutSecretReason = undefined;
229
248
  // Incoming Email Monitor fields
230
249
  this.incomingEmailSecretKey = undefined;
250
+ /*
251
+ * The lookup hash of incomingEmailSecretKey, the key in
252
+ * the inbound email address (#9012).
253
+ * The key is kept encrypted, which no query can find by its value, so
254
+ * a request that presents it is matched by this hash
255
+ * (DatabaseService.findOneByPresentedKey), then held to the key itself.
256
+ * OneUptime writes it with every write of the key.
257
+ */
258
+ this.incomingEmailSecretKeyHash = undefined;
231
259
  this.incomingEmailCustomLocalPart = undefined;
232
260
  this.incomingEmailMonitorLastEmailReceivedAt = undefined;
233
261
  this.incomingEmailMonitorRequest = undefined;
@@ -2460,6 +2488,9 @@ __decorate([
2460
2488
  (0, typeorm_1.Index)(),
2461
2489
  (0, TableColumn_1.default)({
2462
2490
  secret: true,
2491
+ encrypted: true,
2492
+ presentedKey: true,
2493
+ lookupHashColumn: "serverMonitorSecretKeyHash",
2463
2494
  type: TableColumnType_1.default.ObjectID,
2464
2495
  required: false,
2465
2496
  isDefaultValueColumn: false,
@@ -2468,12 +2499,34 @@ __decorate([
2468
2499
  description: "This field is for Server Monitor only. Secret Key to authenticate the request.",
2469
2500
  }),
2470
2501
  (0, typeorm_1.Column)({
2471
- type: ColumnType_1.default.ObjectID,
2502
+ type: ColumnType_1.default.VeryLongText,
2472
2503
  nullable: true,
2473
2504
  transformer: ObjectID_1.default.getDatabaseTransformer(),
2474
2505
  }),
2475
2506
  __metadata("design:type", ObjectID_1.default)
2476
2507
  ], Monitor.prototype, "serverMonitorSecretKey", void 0);
2508
+ __decorate([
2509
+ (0, ColumnAccessControl_1.default)({
2510
+ create: [],
2511
+ read: [],
2512
+ update: [],
2513
+ }),
2514
+ (0, typeorm_1.Index)(),
2515
+ (0, TableColumn_1.default)({
2516
+ type: TableColumnType_1.default.HashedString,
2517
+ computed: true,
2518
+ hideColumnInDocumentation: true,
2519
+ title: "Server Monitor Secret Key Hash",
2520
+ description: "The lookup hash of serverMonitorSecretKey, which a request that presents the key finds this record by. OneUptime writes it with every write of the key; nobody reads or writes it through the API.",
2521
+ }),
2522
+ (0, typeorm_1.Column)({
2523
+ type: ColumnType_1.default.HashedString,
2524
+ length: ColumnLength_1.default.HashedString,
2525
+ nullable: true,
2526
+ transformer: HashedString_1.default.getDatabaseTransformer(),
2527
+ }),
2528
+ __metadata("design:type", HashedString_1.default)
2529
+ ], Monitor.prototype, "serverMonitorSecretKeyHash", void 0);
2477
2530
  __decorate([
2478
2531
  (0, ColumnAccessControl_1.default)({
2479
2532
  create: [],
@@ -2509,6 +2562,9 @@ __decorate([
2509
2562
  (0, typeorm_1.Index)(),
2510
2563
  (0, TableColumn_1.default)({
2511
2564
  secret: true,
2565
+ encrypted: true,
2566
+ presentedKey: true,
2567
+ lookupHashColumn: "incomingRequestSecretKeyHash",
2512
2568
  type: TableColumnType_1.default.ObjectID,
2513
2569
  required: false,
2514
2570
  isDefaultValueColumn: false,
@@ -2517,12 +2573,34 @@ __decorate([
2517
2573
  description: "This field is for Incoming Request Monitor only. Secret Key to authenticate the request.",
2518
2574
  }),
2519
2575
  (0, typeorm_1.Column)({
2520
- type: ColumnType_1.default.ObjectID,
2576
+ type: ColumnType_1.default.VeryLongText,
2521
2577
  nullable: true,
2522
2578
  transformer: ObjectID_1.default.getDatabaseTransformer(),
2523
2579
  }),
2524
2580
  __metadata("design:type", ObjectID_1.default)
2525
2581
  ], Monitor.prototype, "incomingRequestSecretKey", void 0);
2582
+ __decorate([
2583
+ (0, ColumnAccessControl_1.default)({
2584
+ create: [],
2585
+ read: [],
2586
+ update: [],
2587
+ }),
2588
+ (0, typeorm_1.Index)(),
2589
+ (0, TableColumn_1.default)({
2590
+ type: TableColumnType_1.default.HashedString,
2591
+ computed: true,
2592
+ hideColumnInDocumentation: true,
2593
+ title: "Incoming Request Secret Key Hash",
2594
+ description: "The lookup hash of incomingRequestSecretKey, which a request that presents the key finds this record by. OneUptime writes it with every write of the key; nobody reads or writes it through the API.",
2595
+ }),
2596
+ (0, typeorm_1.Column)({
2597
+ type: ColumnType_1.default.HashedString,
2598
+ length: ColumnLength_1.default.HashedString,
2599
+ nullable: true,
2600
+ transformer: HashedString_1.default.getDatabaseTransformer(),
2601
+ }),
2602
+ __metadata("design:type", HashedString_1.default)
2603
+ ], Monitor.prototype, "incomingRequestSecretKeyHash", void 0);
2526
2604
  __decorate([
2527
2605
  (0, ColumnAccessControl_1.default)({
2528
2606
  create: [],
@@ -2690,6 +2768,9 @@ __decorate([
2690
2768
  (0, typeorm_1.Index)(),
2691
2769
  (0, TableColumn_1.default)({
2692
2770
  secret: true,
2771
+ encrypted: true,
2772
+ presentedKey: true,
2773
+ lookupHashColumn: "incomingEmailSecretKeyHash",
2693
2774
  type: TableColumnType_1.default.ObjectID,
2694
2775
  required: false,
2695
2776
  isDefaultValueColumn: false,
@@ -2698,12 +2779,34 @@ __decorate([
2698
2779
  description: "This field is for Incoming Email Monitor only. Secret Key used to generate unique email address.",
2699
2780
  }),
2700
2781
  (0, typeorm_1.Column)({
2701
- type: ColumnType_1.default.ObjectID,
2782
+ type: ColumnType_1.default.VeryLongText,
2702
2783
  nullable: true,
2703
2784
  transformer: ObjectID_1.default.getDatabaseTransformer(),
2704
2785
  }),
2705
2786
  __metadata("design:type", ObjectID_1.default)
2706
2787
  ], Monitor.prototype, "incomingEmailSecretKey", void 0);
2788
+ __decorate([
2789
+ (0, ColumnAccessControl_1.default)({
2790
+ create: [],
2791
+ read: [],
2792
+ update: [],
2793
+ }),
2794
+ (0, typeorm_1.Index)(),
2795
+ (0, TableColumn_1.default)({
2796
+ type: TableColumnType_1.default.HashedString,
2797
+ computed: true,
2798
+ hideColumnInDocumentation: true,
2799
+ title: "Incoming Email Secret Key Hash",
2800
+ description: "The lookup hash of incomingEmailSecretKey, which a request that presents the key finds this record by. OneUptime writes it with every write of the key; nobody reads or writes it through the API.",
2801
+ }),
2802
+ (0, typeorm_1.Column)({
2803
+ type: ColumnType_1.default.HashedString,
2804
+ length: ColumnLength_1.default.HashedString,
2805
+ nullable: true,
2806
+ transformer: HashedString_1.default.getDatabaseTransformer(),
2807
+ }),
2808
+ __metadata("design:type", HashedString_1.default)
2809
+ ], Monitor.prototype, "incomingEmailSecretKeyHash", void 0);
2707
2810
  __decorate([
2708
2811
  (0, ColumnAccessControl_1.default)({
2709
2812
  /*
@@ -3093,7 +3196,7 @@ Monitor = __decorate([
3093
3196
  ,
3094
3197
  (0, typeorm_1.Index)(["monitorType", "_id"])
3095
3198
  /*
3096
- * The Monitors menu's Probe Disconnected, Probe Disabled and Disabled
3199
+ * The Monitors menu's Probes Disconnected, No Probe Enabled and Disabled
3097
3200
  * counts (Pages/Monitor/SideMenu.tsx), counted again on every change to a
3098
3201
  * monitor, and their pages: each holds only the monitors it counts.
3099
3202
  */
@@ -3120,7 +3223,7 @@ Monitor = __decorate([
3120
3223
  * A monitor changes on its own: a check fails and its status moves, every
3121
3224
  * probe watching it disconnects, a maintenance event turns its monitoring
3122
3225
  * off. The Monitors menu counts what needs attention (Not Operational,
3123
- * Disabled, Probe Disconnected, Probe Disabled) beside the lists that show
3226
+ * Disabled, Probes Disconnected, No Probe Enabled) beside the lists that show
3124
3227
  * them, and both follow these announcements at once (UseLiveCount,
3125
3228
  * UseLiveRows) instead of waiting for a reload (#6918).
3126
3229
  *