@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
@@ -331,8 +331,9 @@ function parsePerformanceFinding(value) {
331
331
  /*
332
332
  * Reads the suggestion route's answer. Whatever does not hold together - an
333
333
  * offer that names no finding, a finding the rule would not offer, an
334
- * in-progress or done offer with no run, a done offer that does not say how
335
- * it came out, a set-up step whose blocker this build cannot draw - reads as
334
+ * in-progress or done offer with no run (but a fix hidden from the reader,
335
+ * which has none), a done offer that does not say how it came out, a set-up
336
+ * step whose blocker this build cannot draw - reads as
336
337
  * no suggestion, so the page never draws an action the answer does not
337
338
  * fully back. A set-up step with no blocker at all is a repository to
338
339
  * connect, as it was before blockers were sent.
@@ -350,16 +351,24 @@ function parseTracePerformanceFixSuggestion(value) {
350
351
  if (!finding || !isFindingWorthFixing(finding)) {
351
352
  return exports.NO_TRACE_PERFORMANCE_FIX_SUGGESTION;
352
353
  }
353
- const aiRunId = typeof record["aiRunId"] === "string" && record["aiRunId"].length > 0
354
+ const fixOutcome = offer === SuggestionOffer_1.default.Done
355
+ ? (0, CodeFixSuggestion_1.parseFinishedFixOutcome)(record["fixOutcome"])
356
+ : null;
357
+ /*
358
+ * A fix in a task the reader may not read (FinishedFixOutcome.Hidden)
359
+ * links to nothing, whatever the wire says.
360
+ */
361
+ const isHidden = fixOutcome === CodeFixSuggestion_1.FinishedFixOutcome.Hidden;
362
+ const aiRunId = !isHidden &&
363
+ typeof record["aiRunId"] === "string" &&
364
+ record["aiRunId"].length > 0
354
365
  ? record["aiRunId"]
355
366
  : null;
356
- const linksRun = offer === SuggestionOffer_1.default.InProgress || offer === SuggestionOffer_1.default.Done;
367
+ const linksRun = !isHidden &&
368
+ (offer === SuggestionOffer_1.default.InProgress || offer === SuggestionOffer_1.default.Done);
357
369
  if (linksRun && !aiRunId) {
358
370
  return exports.NO_TRACE_PERFORMANCE_FIX_SUGGESTION;
359
371
  }
360
- const fixOutcome = offer === SuggestionOffer_1.default.Done
361
- ? (0, CodeFixSuggestion_1.parseFinishedFixOutcome)(record["fixOutcome"])
362
- : null;
363
372
  if (offer === SuggestionOffer_1.default.Done && !fixOutcome) {
364
373
  return exports.NO_TRACE_PERFORMANCE_FIX_SUGGESTION;
365
374
  }
@@ -0,0 +1,9 @@
1
+ export default class WebhookAddressMask {
2
+ static readonly MASK: string;
3
+ static mask(address: {
4
+ toString(): string;
5
+ } | string | null | undefined): string;
6
+ static maskIn(text: string, address: {
7
+ toString(): string;
8
+ } | string | null | undefined): string;
9
+ }
@@ -0,0 +1,9 @@
1
+ export default class WebhookAddressMask {
2
+ static readonly MASK: string;
3
+ static mask(address: {
4
+ toString(): string;
5
+ } | string | null | undefined): string;
6
+ static maskIn(text: string, address: {
7
+ toString(): string;
8
+ } | string | null | undefined): string;
9
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /*
4
+ * A WEBHOOK'S ADDRESS, AS A LOG KEEPS IT.
5
+ *
6
+ * A webhook's address is its credential: a Slack, Microsoft Teams or
7
+ * Discord incoming webhook carries its secret in its path, others carry a
8
+ * token in the query, or a user and password before the host. Whoever holds
9
+ * the address posts into the channel. The webhook itself keeps it encrypted
10
+ * at rest, and only its owner reads it back (#9013), but a log of what was
11
+ * sent is read by everyone who reads the project's notification logs, and
12
+ * kept for months. So the log keeps the address's scheme, host and port -
13
+ * what tells a person's webhooks apart - and none of the rest:
14
+ *
15
+ * https://hooks.slack.com/services/T0/B0/XXXX -> https://hooks.slack.com/•••
16
+ * https://user:pass@alerts.example.com:8443/in -> https://alerts.example.com:8443/•••
17
+ * https://alerts.example.com -> https://alerts.example.com
18
+ *
19
+ * "/•••" says something was left out, and is there only when something was.
20
+ * An address that cannot be read is nothing but the mask: no part of it can
21
+ * be told apart from its secret. Masking a masked address changes nothing,
22
+ * so a log written by either release, or masked twice, reads the same.
23
+ */
24
+ // The schemes a webhook is posted over; anything else is masked whole.
25
+ const WEB_PROTOCOL = /^https?:$/;
26
+ class WebhookAddressMask {
27
+ static mask(address) {
28
+ const text = ((address === null || address === void 0 ? void 0 : address.toString()) || "").trim();
29
+ if (!text) {
30
+ return "";
31
+ }
32
+ let parsed;
33
+ try {
34
+ parsed = new globalThis.URL(text);
35
+ }
36
+ catch (_a) {
37
+ return WebhookAddressMask.MASK;
38
+ }
39
+ // `host` is the host and its port; never a user or a password.
40
+ if (!parsed.host || !WEB_PROTOCOL.test(parsed.protocol)) {
41
+ return WebhookAddressMask.MASK;
42
+ }
43
+ const origin = `${parsed.protocol}//${parsed.host}`;
44
+ const hasMore = parsed.username !== "" ||
45
+ parsed.password !== "" ||
46
+ (parsed.pathname !== "" && parsed.pathname !== "/") ||
47
+ parsed.search !== "" ||
48
+ parsed.hash !== "";
49
+ return hasMore ? `${origin}/${WebhookAddressMask.MASK}` : origin;
50
+ }
51
+ /*
52
+ * `text` with every place it quotes `address` masked: an error a send
53
+ * failed with can quote the address it was sent to, and the log keeps the
54
+ * error's words.
55
+ */
56
+ static maskIn(text, address) {
57
+ const raw = ((address === null || address === void 0 ? void 0 : address.toString()) || "").trim();
58
+ if (!text || !raw) {
59
+ return text;
60
+ }
61
+ return text.split(raw).join(WebhookAddressMask.mask(raw));
62
+ }
63
+ }
64
+ // What stands for the part of an address a log does not keep.
65
+ WebhookAddressMask.MASK = "•••";
66
+ exports.default = WebhookAddressMask;
@@ -0,0 +1,2 @@
1
+ import commonJsModule from "./WebhookAddressMask.js";
2
+ export default commonJsModule.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneuptime/common",
3
- "version": "15.0.0",
3
+ "version": "16.0.0",
4
4
  "description": "OneUptime's shared types, utilities and data models, for Node.js and TypeScript.",
5
5
  "homepage": "https://oneuptime.com",
6
6
  "repository": {