@oneuptime/common 14.0.91 → 14.0.92

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 (90) hide show
  1. package/Models/DatabaseModels/AutoRemediationRule.js +1 -1
  2. package/Models/DatabaseModels/CodeRepository.d.mts +1 -0
  3. package/Models/DatabaseModels/CodeRepository.d.ts +1 -0
  4. package/Models/DatabaseModels/CodeRepository.js +69 -6
  5. package/Types/AI/CodeTask.d.mts +1 -0
  6. package/Types/AI/CodeTask.d.ts +1 -0
  7. package/Types/AI/TelemetryAiActivity.d.mts +1 -0
  8. package/Types/AI/TelemetryAiActivity.d.ts +1 -0
  9. package/Types/AI/TelemetryAiActivity.js +4 -0
  10. package/Types/CodeRepository/CodeRepositorySetting.d.mts +15 -0
  11. package/Types/CodeRepository/CodeRepositorySetting.d.ts +15 -0
  12. package/Types/CodeRepository/CodeRepositorySetting.js +49 -0
  13. package/Types/CodeRepository/CodeRepositorySetting.mjs +3 -0
  14. package/Types/Date.d.mts +10 -0
  15. package/Types/Date.d.ts +10 -0
  16. package/Types/Date.js +385 -98
  17. package/Types/DateLanguage.d.mts +67 -0
  18. package/Types/DateLanguage.d.ts +67 -0
  19. package/Types/DateLanguage.js +478 -0
  20. package/Types/DateLanguage.mjs +21 -0
  21. package/Types/Runner/CodeRepositoryRunner.d.mts +7 -0
  22. package/Types/Runner/CodeRepositoryRunner.d.ts +7 -0
  23. package/Types/Runner/CodeRepositoryRunner.js +60 -14
  24. package/Types/Runner/CodeRepositoryRunner.mjs +1 -0
  25. package/Types/SecurityEvent/OcsfProcessActivity.d.mts +25 -0
  26. package/Types/SecurityEvent/OcsfProcessActivity.d.ts +25 -0
  27. package/Types/SecurityEvent/OcsfProcessActivity.js +131 -0
  28. package/Types/SecurityEvent/OcsfProcessActivity.mjs +8 -0
  29. package/UI/Utils/TranslateTemplate.d.mts +73 -0
  30. package/UI/Utils/TranslateTemplate.d.ts +73 -0
  31. package/Utils/CronTab.d.mts +41 -3
  32. package/Utils/CronTab.d.ts +41 -3
  33. package/Utils/CronTab.js +112 -38
  34. package/Utils/Monitor/MonitorOverviewTargetUtil.d.mts +2 -0
  35. package/Utils/Monitor/MonitorOverviewTargetUtil.d.ts +2 -0
  36. package/Utils/Monitor/MonitorOverviewTargetUtil.js +13 -2
  37. package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.d.mts +5 -0
  38. package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.d.ts +5 -0
  39. package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.js +219 -58
  40. package/Utils/SecurityEvent/OcsfNormalizer.js +22 -13
  41. package/Utils/Slo/SloDuration.d.mts +1 -0
  42. package/Utils/Slo/SloDuration.d.ts +1 -0
  43. package/Utils/Slo/SloDuration.js +57 -8
  44. package/Utils/Slo/SloDuration.mjs +1 -0
  45. package/Utils/Suggestions/CodeFixSuggestion.d.mts +15 -0
  46. package/Utils/Suggestions/CodeFixSuggestion.d.ts +15 -0
  47. package/Utils/Suggestions/CodeFixSuggestion.js +62 -1
  48. package/Utils/Suggestions/CodeFixSuggestion.mjs +4 -0
  49. package/Utils/Suggestions/ProfileFixSuggestion.js +4 -0
  50. package/Utils/Suggestions/SuggestionBlocker.d.mts +8 -0
  51. package/Utils/Suggestions/SuggestionBlocker.d.ts +8 -0
  52. package/Utils/Suggestions/SuggestionBlocker.js +51 -0
  53. package/Utils/Suggestions/SuggestionBlocker.mjs +4 -0
  54. package/Utils/Suggestions/SuggestionOffer.d.mts +2 -1
  55. package/Utils/Suggestions/SuggestionOffer.d.ts +2 -1
  56. package/Utils/Suggestions/SuggestionOffer.js +5 -0
  57. package/Utils/Suggestions/TelemetryAiFixSuggestion.d.mts +2 -7
  58. package/Utils/Suggestions/TelemetryAiFixSuggestion.d.ts +2 -7
  59. package/Utils/Suggestions/TelemetryAiFixSuggestion.js +8 -36
  60. package/Utils/Suggestions/TelemetryImprovementSuggestion.d.mts +1 -0
  61. package/Utils/Suggestions/TelemetryImprovementSuggestion.d.ts +1 -0
  62. package/Utils/Suggestions/TelemetryImprovementSuggestion.js +1 -0
  63. package/Utils/Suggestions/TracePerformanceFixSuggestion.d.mts +6 -0
  64. package/Utils/Suggestions/TracePerformanceFixSuggestion.d.ts +6 -0
  65. package/Utils/Suggestions/TracePerformanceFixSuggestion.js +46 -5
  66. package/package.json +8 -1
  67. package/Utils/Monitor/MonitorCheckScheduleUtil.d.mts +0 -61
  68. package/Utils/Monitor/MonitorCheckScheduleUtil.d.ts +0 -61
  69. package/Utils/Monitor/MonitorCheckScheduleUtil.js +0 -476
  70. package/Utils/Monitor/MonitorCheckScheduleUtil.mjs +0 -3
  71. package/Utils/Monitor/MonitorOverviewFamily.d.mts +0 -39
  72. package/Utils/Monitor/MonitorOverviewFamily.d.ts +0 -39
  73. package/Utils/Monitor/MonitorOverviewFamily.js +0 -206
  74. package/Utils/Monitor/MonitorOverviewFamily.mjs +0 -4
  75. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.mts +0 -189
  76. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.ts +0 -189
  77. package/Utils/Monitor/MonitorOverviewPresentationUtil.js +0 -1480
  78. package/Utils/Monitor/MonitorOverviewPresentationUtil.mjs +0 -5
  79. package/Utils/Monitor/MonitorOverviewProbeUtil.d.mts +0 -112
  80. package/Utils/Monitor/MonitorOverviewProbeUtil.d.ts +0 -112
  81. package/Utils/Monitor/MonitorOverviewProbeUtil.js +0 -640
  82. package/Utils/Monitor/MonitorOverviewProbeUtil.mjs +0 -3
  83. package/Utils/Monitor/MonitorStatusHistoryUtil.d.mts +0 -27
  84. package/Utils/Monitor/MonitorStatusHistoryUtil.d.ts +0 -27
  85. package/Utils/Monitor/MonitorStatusHistoryUtil.js +0 -132
  86. package/Utils/Monitor/MonitorStatusHistoryUtil.mjs +0 -2
  87. package/Utils/Monitor/MonitorUptimeSummaryUtil.d.mts +0 -42
  88. package/Utils/Monitor/MonitorUptimeSummaryUtil.d.ts +0 -42
  89. package/Utils/Monitor/MonitorUptimeSummaryUtil.js +0 -468
  90. package/Utils/Monitor/MonitorUptimeSummaryUtil.mjs +0 -2
@@ -1,27 +0,0 @@
1
- import Color from "../../Types/Color";
2
- import MonitorStatusTimeline from "../../Models/DatabaseModels/MonitorStatusTimeline";
3
- export interface MonitorStatusChangeRow {
4
- id: string;
5
- statusName: string;
6
- statusColor: string | undefined;
7
- startsAt: Date;
8
- endsAt: Date | undefined;
9
- isOngoing: boolean;
10
- }
11
- export default class MonitorStatusHistoryUtil {
12
- static getStatusSince(data: {
13
- currentStatusId: string | undefined;
14
- latestRow: MonitorStatusTimeline | undefined;
15
- now: Date;
16
- }): Date | undefined;
17
- static hasStatusDrift(data: {
18
- currentStatusId: string | undefined;
19
- latestRow: MonitorStatusTimeline | undefined;
20
- }): boolean;
21
- static getStatusChangeRows(rows: Array<MonitorStatusTimeline>): Array<MonitorStatusChangeRow>;
22
- static getStatusFingerprint(data: {
23
- currentStatusId: string | undefined;
24
- latestRow: MonitorStatusTimeline | undefined;
25
- }): string;
26
- static normalizeColor(color: Color | string | undefined | null): string | undefined;
27
- }
@@ -1,132 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const Color_1 = __importDefault(require("../../Types/Color"));
7
- const MonitorCheckScheduleUtil_1 = __importDefault(require("./MonitorCheckScheduleUtil"));
8
- // #rgb, #rgba, #rrggbb and #rrggbbaa.
9
- const HEX_COLOR = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
10
- // rgb(), rgba(), hsl() and hsla() with plain numeric arguments.
11
- const FUNCTIONAL_COLOR = /^(?:rgb|rgba|hsl|hsla)\(\s*[\d.%,\s/]+\)$/i;
12
- // A CSS named colour such as "red" or "rebeccapurple".
13
- const NAMED_COLOR = /^[a-z]{3,20}$/i;
14
- const getStatusId = (row) => {
15
- var _a;
16
- return ((_a = row === null || row === void 0 ? void 0 : row.monitorStatusId) === null || _a === void 0 ? void 0 : _a.toString()) || "";
17
- };
18
- class MonitorStatusHistoryUtil {
19
- /*
20
- * When the current status began, or undefined when the rows cannot vouch
21
- * for it: no rows, a closed newest row, or a newest row with another
22
- * status (drift). A headline must not say "Operational for 3 days" off a
23
- * row that describes something else.
24
- */
25
- static getStatusSince(data) {
26
- const row = data.latestRow;
27
- if (!row || !data.currentStatusId) {
28
- return undefined;
29
- }
30
- if (MonitorCheckScheduleUtil_1.default.parseDate(row.endsAt)) {
31
- return undefined;
32
- }
33
- if (getStatusId(row) !== data.currentStatusId) {
34
- return undefined;
35
- }
36
- const startsAt = MonitorCheckScheduleUtil_1.default.parseDate(row.startsAt);
37
- if (!startsAt) {
38
- return undefined;
39
- }
40
- // Clock skew must not produce a status that began in the future.
41
- return startsAt.getTime() > data.now.getTime() ? data.now : startsAt;
42
- }
43
- /*
44
- * True when the newest timeline row disagrees with Monitor's stored
45
- * current status. The overview then waits for refresh-status and reloads
46
- * once, instead of showing two different statuses on one page.
47
- */
48
- static hasStatusDrift(data) {
49
- if (!data.latestRow) {
50
- return false;
51
- }
52
- return getStatusId(data.latestRow) !== (data.currentStatusId || "");
53
- }
54
- /*
55
- * Rows must already be sorted newest first. A row with no end is capped
56
- * at the start of the row after it: only the newest open row is really
57
- * ongoing, and an older open row is an orphan the reconciler has not
58
- * closed yet, which must not read as still running.
59
- */
60
- static getStatusChangeRows(rows) {
61
- var _a, _b, _c, _d;
62
- const changeRows = [];
63
- const list = rows || [];
64
- for (let i = 0; i < list.length; i++) {
65
- const row = list[i];
66
- if (!row) {
67
- continue;
68
- }
69
- const startsAt = MonitorCheckScheduleUtil_1.default.parseDate(row.startsAt);
70
- if (!startsAt) {
71
- continue;
72
- }
73
- const rowEndsAt = MonitorCheckScheduleUtil_1.default.parseDate(row.endsAt);
74
- const successorStartsAt = i > 0
75
- ? MonitorCheckScheduleUtil_1.default.parseDate((_a = list[i - 1]) === null || _a === void 0 ? void 0 : _a.startsAt)
76
- : undefined;
77
- changeRows.push({
78
- id: ((_b = row._id) === null || _b === void 0 ? void 0 : _b.toString()) || `row-${i}`,
79
- statusName: ((_c = row.monitorStatus) === null || _c === void 0 ? void 0 : _c.name) || "Unknown status",
80
- statusColor: MonitorStatusHistoryUtil.normalizeColor((_d = row.monitorStatus) === null || _d === void 0 ? void 0 : _d.color),
81
- startsAt: startsAt,
82
- endsAt: rowEndsAt !== null && rowEndsAt !== void 0 ? rowEndsAt : successorStartsAt,
83
- isOngoing: i === 0 && !rowEndsAt,
84
- });
85
- }
86
- return changeRows;
87
- }
88
- /*
89
- * Changes when the current status changes, when a new newest row appears,
90
- * or when the newest row closes - the three things that should reload the
91
- * uptime strip and the feed.
92
- */
93
- static getStatusFingerprint(data) {
94
- var _a, _b, _c;
95
- const endsAt = MonitorCheckScheduleUtil_1.default.parseDate((_a = data.latestRow) === null || _a === void 0 ? void 0 : _a.endsAt);
96
- return `${data.currentStatusId || ""}|${((_c = (_b = data.latestRow) === null || _b === void 0 ? void 0 : _b._id) === null || _c === void 0 ? void 0 : _c.toString()) || ""}|${endsAt ? endsAt.toISOString() : ""}`;
97
- }
98
- /*
99
- * A status colour as a CSS value for an inline style, or undefined when
100
- * there is none or it is not a colour. Accepts the Color class, a plain
101
- * string, or a typed { _type: "Color", value } envelope.
102
- */
103
- static normalizeColor(color) {
104
- var _a;
105
- if (color === null || color === undefined) {
106
- return undefined;
107
- }
108
- let text = "";
109
- if (typeof color === "string") {
110
- text = color;
111
- }
112
- else if (color instanceof Color_1.default) {
113
- text = color.toString();
114
- }
115
- else if (typeof color === "object") {
116
- const envelopeValue = color["value"];
117
- text =
118
- typeof envelopeValue === "string"
119
- ? envelopeValue
120
- : String((_a = color.color) !== null && _a !== void 0 ? _a : "");
121
- }
122
- text = (text || "").trim();
123
- if (!text ||
124
- !(HEX_COLOR.test(text) ||
125
- FUNCTIONAL_COLOR.test(text) ||
126
- NAMED_COLOR.test(text))) {
127
- return undefined;
128
- }
129
- return text;
130
- }
131
- }
132
- exports.default = MonitorStatusHistoryUtil;
@@ -1,2 +0,0 @@
1
- import commonJsModule from "./MonitorStatusHistoryUtil.js";
2
- export default commonJsModule.default;
@@ -1,42 +0,0 @@
1
- import { JSONObject } from "../../Types/JSON.mjs";
2
- import { MonitorUptimeSummary, MonitorUptimeSummaryStatus, MonitorUptimeWindowKey, MonitorUptimeWindowTotal } from "../../Types/Monitor/MonitorUptimeSummary.mjs";
3
- import { UptimeDayBucket } from "../../Types/StatusPage/UptimeDailyAggregate.mjs";
4
- export type UptimeWindowKind = "Measured" | "NoData";
5
- export type MonitorUptimeCaveat = "paused" | "not-checking" | "no-results";
6
- export interface UptimeWindowPresentation {
7
- key: MonitorUptimeWindowKey;
8
- kind: UptimeWindowKind;
9
- uptimePercent: number | null;
10
- valueText: string;
11
- description: string;
12
- downtimeSeconds: number;
13
- coveredSeconds: number;
14
- windowSeconds: number;
15
- isPartial: boolean;
16
- }
17
- export default class MonitorUptimeSummaryUtil {
18
- static readonly COVERAGE_TOLERANCE_SECONDS: number;
19
- static sumBuckets(data: {
20
- key: MonitorUptimeWindowKey;
21
- buckets: Array<UptimeDayBucket>;
22
- startDate: Date;
23
- endDate: Date;
24
- }): MonitorUptimeWindowTotal;
25
- static getDowntimeStatusIds(statuses: Array<MonitorUptimeSummaryStatus>): Set<string>;
26
- static getWindowPresentation(data: {
27
- window: MonitorUptimeWindowTotal | undefined;
28
- downtimeStatusIds: Set<string>;
29
- caveat?: MonitorUptimeCaveat | null | undefined;
30
- isPausedNow?: boolean | undefined;
31
- }): UptimeWindowPresentation | null;
32
- static formatUptimePercent(data: {
33
- uptimePercent: number;
34
- downtimeSeconds: number;
35
- }): string;
36
- static getWindow(summary: MonitorUptimeSummary, key: MonitorUptimeWindowKey): MonitorUptimeWindowTotal | undefined;
37
- static toJSON(summary: MonitorUptimeSummary): JSONObject;
38
- static fromJSON(json: JSONObject | null | undefined): MonitorUptimeSummary | null;
39
- static parseTimezone(raw: unknown): string;
40
- static getBrowserTimezone(): string;
41
- private static toKnownZone;
42
- }
@@ -1,42 +0,0 @@
1
- import { JSONObject } from "../../Types/JSON";
2
- import { MonitorUptimeSummary, MonitorUptimeSummaryStatus, MonitorUptimeWindowKey, MonitorUptimeWindowTotal } from "../../Types/Monitor/MonitorUptimeSummary";
3
- import { UptimeDayBucket } from "../../Types/StatusPage/UptimeDailyAggregate";
4
- export type UptimeWindowKind = "Measured" | "NoData";
5
- export type MonitorUptimeCaveat = "paused" | "not-checking" | "no-results";
6
- export interface UptimeWindowPresentation {
7
- key: MonitorUptimeWindowKey;
8
- kind: UptimeWindowKind;
9
- uptimePercent: number | null;
10
- valueText: string;
11
- description: string;
12
- downtimeSeconds: number;
13
- coveredSeconds: number;
14
- windowSeconds: number;
15
- isPartial: boolean;
16
- }
17
- export default class MonitorUptimeSummaryUtil {
18
- static readonly COVERAGE_TOLERANCE_SECONDS: number;
19
- static sumBuckets(data: {
20
- key: MonitorUptimeWindowKey;
21
- buckets: Array<UptimeDayBucket>;
22
- startDate: Date;
23
- endDate: Date;
24
- }): MonitorUptimeWindowTotal;
25
- static getDowntimeStatusIds(statuses: Array<MonitorUptimeSummaryStatus>): Set<string>;
26
- static getWindowPresentation(data: {
27
- window: MonitorUptimeWindowTotal | undefined;
28
- downtimeStatusIds: Set<string>;
29
- caveat?: MonitorUptimeCaveat | null | undefined;
30
- isPausedNow?: boolean | undefined;
31
- }): UptimeWindowPresentation | null;
32
- static formatUptimePercent(data: {
33
- uptimePercent: number;
34
- downtimeSeconds: number;
35
- }): string;
36
- static getWindow(summary: MonitorUptimeSummary, key: MonitorUptimeWindowKey): MonitorUptimeWindowTotal | undefined;
37
- static toJSON(summary: MonitorUptimeSummary): JSONObject;
38
- static fromJSON(json: JSONObject | null | undefined): MonitorUptimeSummary | null;
39
- static parseTimezone(raw: unknown): string;
40
- static getBrowserTimezone(): string;
41
- private static toKnownZone;
42
- }