@oneuptime/common 14.1.0 → 14.2.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 (249) hide show
  1. package/Models/DatabaseModels/Alert.d.mts +1 -0
  2. package/Models/DatabaseModels/Alert.d.ts +1 -0
  3. package/Models/DatabaseModels/Alert.js +34 -0
  4. package/Models/DatabaseModels/AutoRemediationSuggestion.d.mts +2 -0
  5. package/Models/DatabaseModels/AutoRemediationSuggestion.d.ts +2 -0
  6. package/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
  7. package/Models/DatabaseModels/Incident.d.mts +1 -0
  8. package/Models/DatabaseModels/Incident.d.ts +1 -0
  9. package/Models/DatabaseModels/Incident.js +35 -0
  10. package/Models/DatabaseModels/IncidentPostmortemActionItem.d.mts +31 -0
  11. package/Models/DatabaseModels/IncidentPostmortemActionItem.d.ts +31 -0
  12. package/Models/DatabaseModels/IncidentPostmortemActionItem.js +591 -0
  13. package/Models/DatabaseModels/IncidentPostmortemActionItem.mjs +3 -0
  14. package/Models/DatabaseModels/Index.js +2 -0
  15. package/Models/DatabaseModels/TelemetryIngestionKey.js +1 -1
  16. package/Types/AI/AIActionWords.d.mts +3 -1
  17. package/Types/AI/AIActionWords.d.ts +3 -1
  18. package/Types/AI/AIActionWords.js +70 -1
  19. package/Types/AI/AIActionWords.mjs +2 -0
  20. package/Types/AI/AIChatTypes.d.mts +2 -1
  21. package/Types/AI/AIChatTypes.d.ts +2 -1
  22. package/Types/AI/AIReadTableWords.d.mts +192 -0
  23. package/Types/AI/AIReadTableWords.d.ts +192 -0
  24. package/Types/AI/AIReadTableWords.js +368 -0
  25. package/Types/AI/AIReadTableWords.mjs +18 -0
  26. package/Types/AI/AiRunRefusal.d.mts +3 -0
  27. package/Types/AI/AiRunRefusal.d.ts +3 -0
  28. package/Types/AI/AiRunRefusal.js +22 -1
  29. package/Types/AI/ResourceAiAccessPermissions.js +7 -18
  30. package/Types/AuditLog/AuditLogActionLabel.js +19 -9
  31. package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +16 -0
  32. package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +16 -0
  33. package/Types/BaseDatabase/AggregationIntervalUtil.js +123 -16
  34. package/Types/Cloud/CloudResourceHealth.d.mts +30 -1
  35. package/Types/Cloud/CloudResourceHealth.d.ts +30 -1
  36. package/Types/Cloud/CloudResourceHealth.js +405 -13
  37. package/Types/Cloud/CloudResourceHealth.mjs +28 -0
  38. package/Types/DataObservability/DataCheckRefusals.d.mts +32 -0
  39. package/Types/DataObservability/DataCheckRefusals.d.ts +32 -0
  40. package/Types/DataObservability/DataCheckRefusals.js +77 -0
  41. package/Types/DataObservability/DataCheckRefusals.mjs +8 -0
  42. package/Types/Database/AccessControl/PermissionScopeNarrowing.js +4 -0
  43. package/Types/Date.d.mts +2 -0
  44. package/Types/Date.d.ts +2 -0
  45. package/Types/Date.js +22 -0
  46. package/Types/DateLanguage.d.mts +2 -0
  47. package/Types/DateLanguage.d.ts +2 -0
  48. package/Types/DateLanguage.js +8 -5
  49. package/Types/Email/EmailTemplateType.d.mts +1 -0
  50. package/Types/Email/EmailTemplateType.d.ts +1 -0
  51. package/Types/Email/EmailTemplateType.js +2 -0
  52. package/Types/Exception/EgressGuardException.js +1 -1
  53. package/Types/Exception/ErrorMessageRule.d.mts +1 -0
  54. package/Types/Exception/ErrorMessageRule.d.ts +1 -0
  55. package/Types/Exception/ErrorMessageRule.js +67 -13
  56. package/Types/Exception/ErrorMessageRule.mjs +1 -0
  57. package/Types/Exception/ExceptionMessages.d.mts +2 -0
  58. package/Types/Exception/ExceptionMessages.d.ts +2 -0
  59. package/Types/Exception/ExceptionMessages.js +2 -0
  60. package/Types/Incident/PostmortemActionItemStatus.d.mts +17 -0
  61. package/Types/Incident/PostmortemActionItemStatus.d.ts +17 -0
  62. package/Types/Incident/PostmortemActionItemStatus.js +74 -0
  63. package/Types/Incident/PostmortemActionItemStatus.mjs +5 -0
  64. package/Types/JSONFunctions.js +10 -3
  65. package/Types/Link.d.mts +1 -0
  66. package/Types/Link.d.ts +1 -0
  67. package/Types/MeaningKeys.d.mts +4 -0
  68. package/Types/MeaningKeys.d.ts +4 -0
  69. package/Types/MeaningKeys.js +74 -0
  70. package/Types/MeaningKeys.mjs +5 -0
  71. package/Types/Monitor/WhoIsTold.d.mts +3 -0
  72. package/Types/Monitor/WhoIsTold.d.ts +3 -0
  73. package/Types/Monitor/WhoIsTold.js +63 -13
  74. package/Types/NoBreakSpaces.d.mts +16 -0
  75. package/Types/NoBreakSpaces.d.ts +16 -0
  76. package/Types/NoBreakSpaces.js +419 -0
  77. package/Types/NoBreakSpaces.mjs +9 -0
  78. package/Types/NotificationRule/PagingLadder.d.mts +12 -0
  79. package/Types/NotificationRule/PagingLadder.d.ts +12 -0
  80. package/Types/NotificationRule/PagingLadder.js +159 -11
  81. package/Types/NotificationRule/PagingLadder.mjs +3 -0
  82. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.mts +3 -0
  83. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.ts +3 -0
  84. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.js +42 -0
  85. package/Types/OnCallDutyPolicy/OnCallPageRecordGone.mjs +4 -0
  86. package/Types/OnCallDutyPolicy/OnCallPageWords.d.mts +6 -2
  87. package/Types/OnCallDutyPolicy/OnCallPageWords.d.ts +6 -2
  88. package/Types/OnCallDutyPolicy/OnCallPageWords.js +21 -20
  89. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +4 -0
  90. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +4 -0
  91. package/Types/OnCallDutyPolicy/OnCallPersonPage.js +125 -1
  92. package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +1 -0
  93. package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +2 -0
  94. package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +2 -0
  95. package/Types/OnCallDutyPolicy/OnCallTestPage.js +12 -0
  96. package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
  97. package/Types/OpenStack/OpenStackCapacity.js +12 -5
  98. package/Types/Permission.d.mts +4 -0
  99. package/Types/Permission.d.ts +4 -0
  100. package/Types/Permission.js +64 -8
  101. package/Types/Product/ProductUsage.js +2 -1
  102. package/Types/Product/ProjectProductsAnswer.js +2 -1
  103. package/Types/ResourceAiAgent/AiResourceType.d.mts +1 -0
  104. package/Types/ResourceAiAgent/AiResourceType.d.ts +1 -0
  105. package/Types/ResourceAiAgent/AiResourceType.js +12 -0
  106. package/Types/Rum/ProductAnalyticsEventReads.js +10 -1
  107. package/Types/Rum/ProductAnalyticsEvents.js +13 -1
  108. package/Types/Rum/SessionReplayCustomEvents.d.mts +4 -1
  109. package/Types/Rum/SessionReplayCustomEvents.d.ts +4 -1
  110. package/Types/Rum/SessionReplayCustomEvents.js +12 -0
  111. package/Types/Rum/SessionReplayCustomEvents.mjs +1 -0
  112. package/Types/SetupHealth/SetupHealth.d.mts +1 -0
  113. package/Types/SetupHealth/SetupHealth.d.ts +1 -0
  114. package/Types/SetupHealth/SetupHealth.js +13 -5
  115. package/Types/StatusPage/DefaultStatusNames.d.mts +11 -3
  116. package/Types/StatusPage/DefaultStatusNames.d.ts +11 -3
  117. package/Types/StatusPage/DefaultStatusNames.js +74 -28
  118. package/Types/StatusPage/DefaultStatusNames.mjs +9 -2
  119. package/Types/StatusPage/StateChangeNoteMessage.d.mts +3 -2
  120. package/Types/StatusPage/StateChangeNoteMessage.d.ts +3 -2
  121. package/Types/StatusPage/StateChangeNoteMessage.js +16 -13
  122. package/Types/Telemetry/TelemetryIngestionKeyType.js +7 -6
  123. package/Types/Translator.d.mts +1 -0
  124. package/Types/Translator.d.ts +1 -0
  125. package/Types/Translator.js +100 -19
  126. package/Types/Translator.mjs +1 -0
  127. package/Types/UserSession/SessionLength.d.mts +33 -0
  128. package/Types/UserSession/SessionLength.d.ts +33 -0
  129. package/Types/UserSession/SessionLength.js +134 -5
  130. package/Types/UserSession/SessionLength.mjs +5 -0
  131. package/Types/Workflow/WorkflowStatus.js +21 -10
  132. package/Utils/AI/InvestigationReport.js +2 -2
  133. package/Utils/API.d.mts +0 -11
  134. package/Utils/API.d.ts +0 -11
  135. package/Utils/API.js +0 -432
  136. package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +2 -2
  137. package/Utils/AiRemediation/VerifiedFixRunbook.d.mts +39 -0
  138. package/Utils/AiRemediation/VerifiedFixRunbook.d.ts +39 -0
  139. package/Utils/AiRemediation/VerifiedFixRunbook.js +231 -0
  140. package/Utils/AiRemediation/VerifiedFixRunbook.mjs +10 -0
  141. package/Utils/Dashboard/DashboardWidgetSorts.js +11 -2
  142. package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +2 -1
  143. package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +2 -1
  144. package/Utils/Dashboard/MonitorListWidgetFormat.js +5 -3
  145. package/Utils/DefaultRecordNames.d.mts +6 -0
  146. package/Utils/DefaultRecordNames.d.ts +6 -0
  147. package/Utils/DefaultRecordNames.js +122 -0
  148. package/Utils/DefaultRecordNames.mjs +6 -0
  149. package/Utils/Grok/Grok.js +7 -4
  150. package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +20 -0
  151. package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +20 -0
  152. package/Utils/Incident/PostmortemActionItemCodeTask.js +107 -0
  153. package/Utils/Incident/PostmortemActionItemCodeTask.mjs +10 -0
  154. package/Utils/Incident/PostmortemActionItemMarkdown.d.mts +39 -0
  155. package/Utils/Incident/PostmortemActionItemMarkdown.d.ts +39 -0
  156. package/Utils/Incident/PostmortemActionItemMarkdown.js +118 -0
  157. package/Utils/Incident/PostmortemActionItemMarkdown.mjs +12 -0
  158. package/Utils/Incident/PostmortemNoteActionItems.d.mts +29 -0
  159. package/Utils/Incident/PostmortemNoteActionItems.d.ts +29 -0
  160. package/Utils/Incident/PostmortemNoteActionItems.js +544 -0
  161. package/Utils/Incident/PostmortemNoteActionItems.mjs +7 -0
  162. package/Utils/LookupTable.d.mts +3 -0
  163. package/Utils/LookupTable.d.ts +3 -0
  164. package/Utils/LookupTable.js +61 -0
  165. package/Utils/LookupTable.mjs +3 -0
  166. package/Utils/Markdown/LinkReferenceDefinitions.d.mts +2 -0
  167. package/Utils/Markdown/LinkReferenceDefinitions.d.ts +2 -0
  168. package/Utils/Markdown/LinkReferenceDefinitions.js +101 -1
  169. package/Utils/Markdown/LinkReferenceDefinitions.mjs +2 -0
  170. package/Utils/Markdown/OverLongText.js +296 -2
  171. package/Utils/Markdown/SlowMarkdown.d.mts +1 -0
  172. package/Utils/Markdown/SlowMarkdown.d.ts +1 -0
  173. package/Utils/Markdown/SlowMarkdown.js +354 -4
  174. package/Utils/Markdown/SlowMarkdown.mjs +1 -0
  175. package/Utils/Metrics/MetricFormulaEvaluator.js +10 -4
  176. package/Utils/Metrics/MetricSeriesFingerprint.js +13 -4
  177. package/Utils/Metrics/MetricSeriesScope.d.mts +5 -0
  178. package/Utils/Metrics/MetricSeriesScope.d.ts +5 -0
  179. package/Utils/Metrics/MetricSeriesScope.js +5 -1
  180. package/Utils/Monitor/MonitorRootCauseWording.d.mts +3 -0
  181. package/Utils/Monitor/MonitorRootCauseWording.d.ts +3 -0
  182. package/Utils/Monitor/MonitorRootCauseWording.js +100 -11
  183. package/Utils/Monitor/ProbeAgreementRule.d.mts +10 -0
  184. package/Utils/Monitor/ProbeAgreementRule.d.ts +10 -0
  185. package/Utils/Monitor/ProbeAgreementRule.js +58 -0
  186. package/Utils/Monitor/ProbeAgreementRule.mjs +3 -0
  187. package/Utils/Monitor/ProbeFailureReading.d.mts +4 -0
  188. package/Utils/Monitor/ProbeFailureReading.d.ts +4 -0
  189. package/Utils/Monitor/ProbeFailureReading.js +30 -1
  190. package/Utils/Monitor/ProbeFailureReading.mjs +1 -0
  191. package/Utils/Monitor/RequestFailureDescriptions.d.mts +61 -0
  192. package/Utils/Monitor/RequestFailureDescriptions.d.ts +61 -0
  193. package/Utils/Monitor/RequestFailureDescriptions.js +252 -0
  194. package/Utils/Monitor/RequestFailureDescriptions.mjs +6 -0
  195. package/Utils/PromQL/PromQLEngine.js +18 -9
  196. package/Utils/PromQL/PromQLFunctionEvaluators.js +114 -58
  197. package/Utils/PromQL/PromQLLabelOrder.d.mts +8 -0
  198. package/Utils/PromQL/PromQLLabelOrder.d.ts +8 -0
  199. package/Utils/PromQL/PromQLLabelOrder.js +212 -0
  200. package/Utils/PromQL/PromQLLabelOrder.mjs +6 -0
  201. package/Utils/PromQL/PromQLLabels.js +4 -3
  202. package/Utils/PromQL/PromQLMetricNames.js +8 -2
  203. package/Utils/PromQL/PromQLParser.js +11 -6
  204. package/Utils/PromQL/PromQLRegex.d.mts +11 -0
  205. package/Utils/PromQL/PromQLRegex.d.ts +11 -0
  206. package/Utils/PromQL/PromQLRegex.js +990 -50
  207. package/Utils/PromQL/PromQLRegex.mjs +3 -0
  208. package/Utils/PromQL/PrometheusResponse.js +3 -1
  209. package/Utils/PromQL/RE2CharacterClass.d.mts +24 -0
  210. package/Utils/PromQL/RE2CharacterClass.d.ts +24 -0
  211. package/Utils/PromQL/RE2CharacterClass.js +532 -0
  212. package/Utils/PromQL/RE2CharacterClass.mjs +16 -0
  213. package/Utils/RequestFailedDetailsUtil.d.mts +15 -0
  214. package/Utils/RequestFailedDetailsUtil.d.ts +15 -0
  215. package/Utils/RequestFailedDetailsUtil.js +452 -0
  216. package/Utils/RequestFailedDetailsUtil.mjs +2 -0
  217. package/Utils/Rum/UrlScrubber.d.mts +1 -1
  218. package/Utils/Rum/UrlScrubber.d.ts +1 -1
  219. package/Utils/Rum/UrlScrubber.js +10 -4
  220. package/Utils/Rum/UserFlow.js +22 -4
  221. package/Utils/SecurityCase/SecurityOverviewMetrics.d.mts +11 -1
  222. package/Utils/SecurityCase/SecurityOverviewMetrics.d.ts +11 -1
  223. package/Utils/SecurityCase/SecurityOverviewMetrics.js +99 -17
  224. package/Utils/SecurityCase/SecurityOverviewMetrics.mjs +3 -0
  225. package/Utils/Sms/OnCallPageSms.d.mts +2 -0
  226. package/Utils/Sms/OnCallPageSms.d.ts +2 -0
  227. package/Utils/Sms/OnCallPageSms.js +3 -1
  228. package/Utils/StateListType.d.mts +11 -0
  229. package/Utils/StateListType.d.ts +11 -0
  230. package/Utils/StateListType.js +21 -0
  231. package/Utils/StateListType.mjs +2 -0
  232. package/Utils/StateOrder.d.mts +8 -11
  233. package/Utils/StateOrder.d.ts +8 -11
  234. package/Utils/StateOrder.js +49 -84
  235. package/Utils/StateOrder.mjs +2 -0
  236. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.mts +9 -0
  237. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.ts +9 -0
  238. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.js +25 -0
  239. package/Utils/Suggestions/ActionItemCodeTaskSuggestion.mjs +2 -0
  240. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.mts +5 -0
  241. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.ts +5 -0
  242. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.js +39 -0
  243. package/Utils/Suggestions/VerifiedFixRunbookSuggestion.mjs +2 -0
  244. package/Utils/Syslog/SyslogMessageParser.js +16 -6
  245. package/Utils/Telemetry/HeartbeatAvailability.js +16 -21
  246. package/Utils/ValueFormatter.d.mts +1 -0
  247. package/Utils/ValueFormatter.d.ts +1 -0
  248. package/Utils/ValueFormatter.js +258 -18
  249. package/package.json +1 -1
@@ -80,6 +80,7 @@ export default class Alert extends BaseModel {
80
80
  aiInvestigationWaitUntil?: Date;
81
81
  groupingWaitKey?: string;
82
82
  isOwnerNotifiedOfAlertCreation?: boolean;
83
+ createdNotificationHeldAt?: Date;
83
84
  rootCause?: string;
84
85
  createdStateLog?: JSONObject;
85
86
  createdCriteriaId?: string;
@@ -80,6 +80,7 @@ export default class Alert extends BaseModel {
80
80
  aiInvestigationWaitUntil?: Date;
81
81
  groupingWaitKey?: string;
82
82
  isOwnerNotifiedOfAlertCreation?: boolean;
83
+ createdNotificationHeldAt?: Date;
83
84
  rootCause?: string;
84
85
  createdStateLog?: JSONObject;
85
86
  createdCriteriaId?: string;
@@ -146,6 +146,17 @@ let Alert = class Alert extends DatabaseBaseModel_1.default {
146
146
  */
147
147
  this.groupingWaitKey = undefined;
148
148
  this.isOwnerNotifiedOfAlertCreation = undefined;
149
+ /*
150
+ * While the owners' "Alert Created" notification is held for the alert's
151
+ * owners (CreatedNotificationHold): when the hold began, as the alert was
152
+ * written. Cleared when the hold is let go - every owner its create adds
153
+ * is in - and when the Created job takes it. A hold nobody lets go,
154
+ * because the process that made the alert stopped, ends by itself: the
155
+ * job takes it once it is old enough. Null for every other alert.
156
+ * Written by the create's hook - which is why it is computed: no
157
+ * caller's create is refused for it - and by nobody else.
158
+ */
159
+ this.createdNotificationHeldAt = undefined;
149
160
  this.rootCause = undefined;
150
161
  this.createdStateLog = undefined;
151
162
  this.createdCriteriaId = undefined;
@@ -2168,6 +2179,19 @@ __decorate([
2168
2179
  }),
2169
2180
  __metadata("design:type", Boolean)
2170
2181
  ], Alert.prototype, "isOwnerNotifiedOfAlertCreation", void 0);
2182
+ __decorate([
2183
+ (0, ColumnAccessControl_1.default)({ create: [], read: [], update: [] }),
2184
+ (0, TableColumn_1.default)({
2185
+ required: false,
2186
+ computed: true,
2187
+ hideColumnInDocumentation: true,
2188
+ type: TableColumnType_1.default.Date,
2189
+ title: "Created Notification Held At",
2190
+ description: "Internal: while the owners' Alert Created notification waits for every owner the alert's create adds, when it started waiting.",
2191
+ }),
2192
+ (0, typeorm_1.Column)({ type: ColumnType_1.default.Date, nullable: true }),
2193
+ __metadata("design:type", Date)
2194
+ ], Alert.prototype, "createdNotificationHeldAt", void 0);
2171
2195
  __decorate([
2172
2196
  (0, ColumnAccessControl_1.default)({
2173
2197
  create: [
@@ -2978,5 +3002,15 @@ Alert = __decorate([
2978
3002
  (0, typeorm_1.Index)(["groupingWaitKey", "createdAt"], {
2979
3003
  where: '"groupingWaitKey" IS NOT NULL AND "deletedAt" IS NULL',
2980
3004
  })
3005
+ /*
3006
+ * The alerts whose owners' "Alert Created" notification is held for their
3007
+ * owners (CreatedNotificationHold): the few being created at any moment, so
3008
+ * the index holds only them, and the Created job's read of a hold nobody
3009
+ * let go (createdNotificationHeldAt <= then) implies its predicate.
3010
+ */
3011
+ ,
3012
+ (0, typeorm_1.Index)(["createdNotificationHeldAt"], {
3013
+ where: '"createdNotificationHeldAt" IS NOT NULL AND "deletedAt" IS NULL',
3014
+ })
2981
3015
  ], Alert);
2982
3016
  exports.default = Alert;
@@ -31,6 +31,8 @@ export default class AutoRemediationSuggestion extends BaseModel {
31
31
  runbook?: Runbook;
32
32
  runbookId?: ObjectID;
33
33
  runbookNameSnapshot?: string;
34
+ savedAsRunbook?: Runbook;
35
+ savedAsRunbookId?: ObjectID;
34
36
  runbookTrackRecord?: JSONObject;
35
37
  status?: AutoRemediationSuggestionStatus;
36
38
  executionMode?: AutoRemediationExecutionMode;
@@ -31,6 +31,8 @@ export default class AutoRemediationSuggestion extends BaseModel {
31
31
  runbook?: Runbook;
32
32
  runbookId?: ObjectID;
33
33
  runbookNameSnapshot?: string;
34
+ savedAsRunbook?: Runbook;
35
+ savedAsRunbookId?: ObjectID;
34
36
  runbookTrackRecord?: JSONObject;
35
37
  status?: AutoRemediationSuggestionStatus;
36
38
  executionMode?: AutoRemediationExecutionMode;
@@ -81,6 +81,15 @@ let AutoRemediationSuggestion = class AutoRemediationSuggestion extends Database
81
81
  this.runbook = undefined;
82
82
  this.runbookId = undefined;
83
83
  this.runbookNameSnapshot = undefined;
84
+ /*
85
+ * The runbook a verified fix was saved as (issue #6801): written by
86
+ * OneUptime from the commands the fix ran, turned off until someone
87
+ * reviews it (VerifiedFixRunbook). Set once, by Save as Runbook on the
88
+ * fix; cleared when that runbook is deleted, so the fix can be saved
89
+ * again.
90
+ */
91
+ this.savedAsRunbook = undefined;
92
+ this.savedAsRunbookId = undefined;
84
93
  /*
85
94
  * How the proposed runbook went the last times OneUptime AI ran it as a
86
95
  * fix for other incidents and alerts of the project, when it was proposed
@@ -559,6 +568,59 @@ __decorate([
559
568
  }),
560
569
  __metadata("design:type", String)
561
570
  ], AutoRemediationSuggestion.prototype, "runbookNameSnapshot", void 0);
571
+ __decorate([
572
+ (0, ColumnAccessControl_1.default)({
573
+ create: [],
574
+ read: [
575
+ Permission_1.default.ProjectOwner,
576
+ Permission_1.default.ProjectAdmin,
577
+ Permission_1.default.ProjectMember,
578
+ ],
579
+ update: [],
580
+ }),
581
+ (0, TableColumn_1.default)({
582
+ manyToOneRelationColumn: "savedAsRunbookId",
583
+ type: TableColumnType_1.default.Entity,
584
+ modelType: Runbook_1.default,
585
+ title: "Saved As Runbook",
586
+ description: "The runbook this fix was saved as once it was verified: written from the commands that ran, and off until someone reviews it.",
587
+ }),
588
+ (0, typeorm_1.ManyToOne)(() => {
589
+ return Runbook_1.default;
590
+ }, {
591
+ eager: false,
592
+ nullable: true,
593
+ onDelete: "SET NULL",
594
+ orphanedRowAction: "nullify",
595
+ }),
596
+ (0, typeorm_1.JoinColumn)({ name: "savedAsRunbookId" }),
597
+ __metadata("design:type", Runbook_1.default)
598
+ ], AutoRemediationSuggestion.prototype, "savedAsRunbook", void 0);
599
+ __decorate([
600
+ (0, ColumnAccessControl_1.default)({
601
+ create: [],
602
+ read: [
603
+ Permission_1.default.ProjectOwner,
604
+ Permission_1.default.ProjectAdmin,
605
+ Permission_1.default.ProjectMember,
606
+ ],
607
+ update: [],
608
+ }),
609
+ (0, typeorm_1.Index)(),
610
+ (0, TableColumn_1.default)({
611
+ type: TableColumnType_1.default.ObjectID,
612
+ required: false,
613
+ canReadOnRelationQuery: true,
614
+ title: "Saved As Runbook ID",
615
+ description: "ID of the runbook this fix was saved as. Empty until someone saves the verified fix as a runbook.",
616
+ }),
617
+ (0, typeorm_1.Column)({
618
+ type: ColumnType_1.default.ObjectID,
619
+ nullable: true,
620
+ transformer: ObjectID_1.default.getDatabaseTransformer(),
621
+ }),
622
+ __metadata("design:type", ObjectID_1.default)
623
+ ], AutoRemediationSuggestion.prototype, "savedAsRunbookId", void 0);
562
624
  __decorate([
563
625
  (0, ColumnAccessControl_1.default)({
564
626
  create: [],
@@ -92,6 +92,7 @@ export default class Incident extends BaseModel {
92
92
  aiInvestigationWaitUntil?: Date;
93
93
  groupingWaitKey?: string;
94
94
  isOwnerNotifiedOfResourceCreation?: boolean;
95
+ createdNotificationHeldAt?: Date;
95
96
  rootCause?: string;
96
97
  postmortemNote?: string;
97
98
  showPostmortemOnStatusPage?: boolean;
@@ -92,6 +92,7 @@ export default class Incident extends BaseModel {
92
92
  aiInvestigationWaitUntil?: Date;
93
93
  groupingWaitKey?: string;
94
94
  isOwnerNotifiedOfResourceCreation?: boolean;
95
+ createdNotificationHeldAt?: Date;
95
96
  rootCause?: string;
96
97
  postmortemNote?: string;
97
98
  showPostmortemOnStatusPage?: boolean;
@@ -184,6 +184,17 @@ let Incident = class Incident extends DatabaseBaseModel_1.default {
184
184
  */
185
185
  this.groupingWaitKey = undefined;
186
186
  this.isOwnerNotifiedOfResourceCreation = undefined;
187
+ /*
188
+ * While the owners' "Incident Created" notification is held for the
189
+ * incident's owners (CreatedNotificationHold): when the hold began, as
190
+ * the incident was written. Cleared when the hold is let go - every owner
191
+ * its create adds is in - and when the Created job takes it. A hold
192
+ * nobody lets go, because the process that made the incident stopped,
193
+ * ends by itself: the job takes it once it is old enough. Null for every
194
+ * other incident. Written by the create's hook - which is why it is
195
+ * computed: no caller's create is refused for it - and by nobody else.
196
+ */
197
+ this.createdNotificationHeldAt = undefined;
187
198
  this.rootCause = undefined;
188
199
  this.postmortemNote = undefined;
189
200
  this.showPostmortemOnStatusPage = undefined;
@@ -2603,6 +2614,19 @@ __decorate([
2603
2614
  }),
2604
2615
  __metadata("design:type", Boolean)
2605
2616
  ], Incident.prototype, "isOwnerNotifiedOfResourceCreation", void 0);
2617
+ __decorate([
2618
+ (0, ColumnAccessControl_1.default)({ create: [], read: [], update: [] }),
2619
+ (0, TableColumn_1.default)({
2620
+ required: false,
2621
+ computed: true,
2622
+ hideColumnInDocumentation: true,
2623
+ type: TableColumnType_1.default.Date,
2624
+ title: "Created Notification Held At",
2625
+ description: "Internal: while the owners' Incident Created notification waits for every owner the incident's create adds, when it started waiting.",
2626
+ }),
2627
+ (0, typeorm_1.Column)({ type: ColumnType_1.default.Date, nullable: true }),
2628
+ __metadata("design:type", Date)
2629
+ ], Incident.prototype, "createdNotificationHeldAt", void 0);
2606
2630
  __decorate([
2607
2631
  (0, ColumnAccessControl_1.default)({
2608
2632
  create: [
@@ -3955,5 +3979,16 @@ Incident = __decorate([
3955
3979
  (0, typeorm_1.Index)(["groupingWaitKey", "createdAt"], {
3956
3980
  where: '"groupingWaitKey" IS NOT NULL AND "deletedAt" IS NULL',
3957
3981
  })
3982
+ /*
3983
+ * The incidents whose owners' "Incident Created" notification is held for
3984
+ * their owners (CreatedNotificationHold): the few being created at any
3985
+ * moment, so the index holds only them, and the Created job's read of a
3986
+ * hold nobody let go (createdNotificationHeldAt <= then) implies its
3987
+ * predicate.
3988
+ */
3989
+ ,
3990
+ (0, typeorm_1.Index)(["createdNotificationHeldAt"], {
3991
+ where: '"createdNotificationHeldAt" IS NOT NULL AND "deletedAt" IS NULL',
3992
+ })
3958
3993
  ], Incident);
3959
3994
  exports.default = Incident;
@@ -0,0 +1,31 @@
1
+ import Incident from "./Incident.mjs";
2
+ import Monitor from "./Monitor.mjs";
3
+ import Project from "./Project.mjs";
4
+ import User from "./User.mjs";
5
+ import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel.mjs";
6
+ import PostmortemActionItemStatus from "../../Types/Incident/PostmortemActionItemStatus.mjs";
7
+ import ObjectID from "../../Types/ObjectID.mjs";
8
+ import Permission from "../../Types/Permission.mjs";
9
+ export declare const POSTMORTEM_ACTION_ITEM_UPDATE_PERMISSIONS: Array<Permission>;
10
+ export default class IncidentPostmortemActionItem extends BaseModel {
11
+ project?: Project;
12
+ projectId?: ObjectID;
13
+ incident?: Incident;
14
+ incidentId?: ObjectID;
15
+ title?: string;
16
+ description?: string;
17
+ status?: PostmortemActionItemStatus;
18
+ ownerUser?: User;
19
+ ownerUserId?: ObjectID;
20
+ dueDate?: Date;
21
+ closedAt?: Date;
22
+ closedByUser?: User;
23
+ closedByUserId?: ObjectID;
24
+ codeTaskId?: ObjectID;
25
+ monitor?: Monitor;
26
+ monitorId?: ObjectID;
27
+ createdByUser?: User;
28
+ createdByUserId?: ObjectID;
29
+ deletedByUser?: User;
30
+ deletedByUserId?: ObjectID;
31
+ }
@@ -0,0 +1,31 @@
1
+ import Incident from "./Incident";
2
+ import Monitor from "./Monitor";
3
+ import Project from "./Project";
4
+ import User from "./User";
5
+ import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
6
+ import PostmortemActionItemStatus from "../../Types/Incident/PostmortemActionItemStatus";
7
+ import ObjectID from "../../Types/ObjectID";
8
+ import Permission from "../../Types/Permission";
9
+ export declare const POSTMORTEM_ACTION_ITEM_UPDATE_PERMISSIONS: Array<Permission>;
10
+ export default class IncidentPostmortemActionItem extends BaseModel {
11
+ project?: Project;
12
+ projectId?: ObjectID;
13
+ incident?: Incident;
14
+ incidentId?: ObjectID;
15
+ title?: string;
16
+ description?: string;
17
+ status?: PostmortemActionItemStatus;
18
+ ownerUser?: User;
19
+ ownerUserId?: ObjectID;
20
+ dueDate?: Date;
21
+ closedAt?: Date;
22
+ closedByUser?: User;
23
+ closedByUserId?: ObjectID;
24
+ codeTaskId?: ObjectID;
25
+ monitor?: Monitor;
26
+ monitorId?: ObjectID;
27
+ createdByUser?: User;
28
+ createdByUserId?: ObjectID;
29
+ deletedByUser?: User;
30
+ deletedByUserId?: ObjectID;
31
+ }