@oneuptime/common 14.0.91 → 14.0.93

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 (174) hide show
  1. package/Models/DatabaseModels/Alert.js +8 -1
  2. package/Models/DatabaseModels/AlertEpisodeMember.d.mts +1 -0
  3. package/Models/DatabaseModels/AlertEpisodeMember.d.ts +1 -0
  4. package/Models/DatabaseModels/AlertEpisodeMember.js +50 -0
  5. package/Models/DatabaseModels/AutoRemediationRule.js +1 -1
  6. package/Models/DatabaseModels/CodeRepository.d.mts +1 -0
  7. package/Models/DatabaseModels/CodeRepository.d.ts +1 -0
  8. package/Models/DatabaseModels/CodeRepository.js +69 -6
  9. package/Models/DatabaseModels/IncidentEpisodeMember.d.mts +1 -0
  10. package/Models/DatabaseModels/IncidentEpisodeMember.d.ts +1 -0
  11. package/Models/DatabaseModels/IncidentEpisodeMember.js +50 -0
  12. package/Models/DatabaseModels/IncomingCallPolicy.js +1 -1
  13. package/Models/DatabaseModels/LlmProvider.js +1 -1
  14. package/Models/DatabaseModels/MonitorTemplate.js +10 -4
  15. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +13 -13
  16. package/Models/DatabaseModels/OnCallDutyPolicy.js +1 -1
  17. package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +1 -1
  18. package/Models/DatabaseModels/StatusPage.d.mts +2 -0
  19. package/Models/DatabaseModels/StatusPage.d.ts +2 -0
  20. package/Models/DatabaseModels/StatusPage.js +100 -0
  21. package/Types/AI/CodeTask.d.mts +1 -0
  22. package/Types/AI/CodeTask.d.ts +1 -0
  23. package/Types/AI/TelemetryAiActivity.d.mts +1 -0
  24. package/Types/AI/TelemetryAiActivity.d.ts +1 -0
  25. package/Types/AI/TelemetryAiActivity.js +4 -0
  26. package/Types/CodeRepository/CodeRepositorySetting.d.mts +15 -0
  27. package/Types/CodeRepository/CodeRepositorySetting.d.ts +15 -0
  28. package/Types/CodeRepository/CodeRepositorySetting.js +49 -0
  29. package/Types/CodeRepository/CodeRepositorySetting.mjs +3 -0
  30. package/Types/Database/BlankColumnValue.d.mts +6 -0
  31. package/Types/Database/BlankColumnValue.d.ts +6 -0
  32. package/Types/Database/BlankColumnValue.js +77 -0
  33. package/Types/Database/BlankColumnValue.mjs +4 -0
  34. package/Types/Date.d.mts +10 -0
  35. package/Types/Date.d.ts +10 -0
  36. package/Types/Date.js +385 -98
  37. package/Types/DateLanguage.d.mts +67 -0
  38. package/Types/DateLanguage.d.ts +67 -0
  39. package/Types/DateLanguage.js +478 -0
  40. package/Types/DateLanguage.mjs +21 -0
  41. package/Types/Email/EmailTemplateType.d.mts +1 -0
  42. package/Types/Email/EmailTemplateType.d.ts +1 -0
  43. package/Types/Email/EmailTemplateType.js +1 -0
  44. package/Types/IncomingCall/IncomingCallPolicyRepeat.d.mts +6 -0
  45. package/Types/IncomingCall/IncomingCallPolicyRepeat.d.ts +6 -0
  46. package/Types/IncomingCall/IncomingCallPolicyRepeat.js +41 -14
  47. package/Types/IncomingCall/IncomingCallPolicyRepeat.mjs +3 -0
  48. package/Types/Monitor/CriteriaFilter.d.mts +1 -0
  49. package/Types/Monitor/CriteriaFilter.d.ts +1 -0
  50. package/Types/Monitor/CriteriaFilter.js +9 -0
  51. package/Types/Monitor/DatabaseMetricCatalog.js +2 -2
  52. package/Types/Monitor/KubernetesEventAlertTemplates.d.mts +20 -0
  53. package/Types/Monitor/KubernetesEventAlertTemplates.d.ts +20 -0
  54. package/Types/Monitor/KubernetesEventAlertTemplates.js +232 -0
  55. package/Types/Monitor/KubernetesEventAlertTemplates.mjs +8 -0
  56. package/Types/Monitor/MonitorType.js +12 -2
  57. package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +27 -2
  58. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.mts +1 -0
  59. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.ts +1 -0
  60. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +31 -1
  61. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.mts +3 -1
  62. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.ts +3 -1
  63. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +3 -2
  64. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.mts +1 -0
  65. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.ts +1 -0
  66. package/Types/NotificationSetting/NotificationEmailRollupCategory.js +2 -0
  67. package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +10 -3
  68. package/Types/NotificationSetting/NotificationSettingEventType.d.mts +1 -0
  69. package/Types/NotificationSetting/NotificationSettingEventType.d.ts +1 -0
  70. package/Types/NotificationSetting/NotificationSettingEventType.js +7 -0
  71. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.mts +7 -0
  72. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.ts +7 -0
  73. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.js +51 -0
  74. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.mjs +4 -0
  75. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.mts +8 -0
  76. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.ts +8 -0
  77. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.js +55 -0
  78. package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.mjs +5 -0
  79. package/Types/Runner/CodeRepositoryRunner.d.mts +7 -0
  80. package/Types/Runner/CodeRepositoryRunner.d.ts +7 -0
  81. package/Types/Runner/CodeRepositoryRunner.js +60 -14
  82. package/Types/Runner/CodeRepositoryRunner.mjs +1 -0
  83. package/Types/SecurityEvent/OcsfProcessActivity.d.mts +25 -0
  84. package/Types/SecurityEvent/OcsfProcessActivity.d.ts +25 -0
  85. package/Types/SecurityEvent/OcsfProcessActivity.js +131 -0
  86. package/Types/SecurityEvent/OcsfProcessActivity.mjs +8 -0
  87. package/Types/Workflow/Templates.js +2 -5
  88. package/UI/Utils/TranslateTemplate.d.mts +73 -0
  89. package/UI/Utils/TranslateTemplate.d.ts +73 -0
  90. package/Utils/ColorContrast.d.mts +3 -0
  91. package/Utils/ColorContrast.d.ts +3 -0
  92. package/Utils/ColorContrast.js +41 -3
  93. package/Utils/ColorContrast.mjs +2 -0
  94. package/Utils/CronTab.d.mts +41 -3
  95. package/Utils/CronTab.d.ts +41 -3
  96. package/Utils/CronTab.js +112 -38
  97. package/Utils/Incident/WhoOpenedItRootCause.d.mts +2 -0
  98. package/Utils/Incident/WhoOpenedItRootCause.d.ts +2 -0
  99. package/Utils/Incident/WhoOpenedItRootCause.js +50 -0
  100. package/Utils/Incident/WhoOpenedItRootCause.mjs +3 -0
  101. package/Utils/Monitor/MonitorOverviewTargetUtil.d.mts +2 -0
  102. package/Utils/Monitor/MonitorOverviewTargetUtil.d.ts +2 -0
  103. package/Utils/Monitor/MonitorOverviewTargetUtil.js +13 -2
  104. package/Utils/Monitor/SyntheticMonitorStepsUtil.d.mts +18 -0
  105. package/Utils/Monitor/SyntheticMonitorStepsUtil.d.ts +18 -0
  106. package/Utils/Monitor/SyntheticMonitorStepsUtil.js +129 -0
  107. package/Utils/Monitor/SyntheticMonitorStepsUtil.mjs +4 -0
  108. package/Utils/Rules/RuleRunSummary.d.mts +1 -0
  109. package/Utils/Rules/RuleRunSummary.d.ts +1 -0
  110. package/Utils/Rules/RuleRunSummary.js +19 -1
  111. package/Utils/Rules/RuleRunSummary.mjs +1 -0
  112. package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.d.mts +5 -0
  113. package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.d.ts +5 -0
  114. package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.js +219 -58
  115. package/Utils/SecurityEvent/OcsfNormalizer.js +22 -13
  116. package/Utils/Slo/SloDuration.d.mts +1 -0
  117. package/Utils/Slo/SloDuration.d.ts +1 -0
  118. package/Utils/Slo/SloDuration.js +57 -8
  119. package/Utils/Slo/SloDuration.mjs +1 -0
  120. package/Utils/Sms/Gsm7Text.js +9 -1
  121. package/Utils/Sms/OnCallPageSms.d.mts +2 -0
  122. package/Utils/Sms/OnCallPageSms.d.ts +2 -0
  123. package/Utils/Sms/OnCallPageSms.js +19 -2
  124. package/Utils/Sms/OnCallPageSms.mjs +1 -0
  125. package/Utils/Sms/SubscriberSms.d.mts +2 -0
  126. package/Utils/Sms/SubscriberSms.d.ts +2 -0
  127. package/Utils/Sms/SubscriberSms.js +35 -0
  128. package/Utils/Sms/SubscriberSms.mjs +3 -0
  129. package/Utils/Suggestions/CodeFixSuggestion.d.mts +15 -0
  130. package/Utils/Suggestions/CodeFixSuggestion.d.ts +15 -0
  131. package/Utils/Suggestions/CodeFixSuggestion.js +62 -1
  132. package/Utils/Suggestions/CodeFixSuggestion.mjs +4 -0
  133. package/Utils/Suggestions/ProfileFixSuggestion.js +4 -0
  134. package/Utils/Suggestions/SuggestionBlocker.d.mts +8 -0
  135. package/Utils/Suggestions/SuggestionBlocker.d.ts +8 -0
  136. package/Utils/Suggestions/SuggestionBlocker.js +51 -0
  137. package/Utils/Suggestions/SuggestionBlocker.mjs +4 -0
  138. package/Utils/Suggestions/SuggestionOffer.d.mts +2 -1
  139. package/Utils/Suggestions/SuggestionOffer.d.ts +2 -1
  140. package/Utils/Suggestions/SuggestionOffer.js +5 -0
  141. package/Utils/Suggestions/TelemetryAiFixSuggestion.d.mts +2 -7
  142. package/Utils/Suggestions/TelemetryAiFixSuggestion.d.ts +2 -7
  143. package/Utils/Suggestions/TelemetryAiFixSuggestion.js +8 -36
  144. package/Utils/Suggestions/TelemetryImprovementSuggestion.d.mts +1 -0
  145. package/Utils/Suggestions/TelemetryImprovementSuggestion.d.ts +1 -0
  146. package/Utils/Suggestions/TelemetryImprovementSuggestion.js +1 -0
  147. package/Utils/Suggestions/TracePerformanceFixSuggestion.d.mts +6 -0
  148. package/Utils/Suggestions/TracePerformanceFixSuggestion.d.ts +6 -0
  149. package/Utils/Suggestions/TracePerformanceFixSuggestion.js +46 -5
  150. package/package.json +8 -1
  151. package/Utils/Monitor/MonitorCheckScheduleUtil.d.mts +0 -61
  152. package/Utils/Monitor/MonitorCheckScheduleUtil.d.ts +0 -61
  153. package/Utils/Monitor/MonitorCheckScheduleUtil.js +0 -476
  154. package/Utils/Monitor/MonitorCheckScheduleUtil.mjs +0 -3
  155. package/Utils/Monitor/MonitorOverviewFamily.d.mts +0 -39
  156. package/Utils/Monitor/MonitorOverviewFamily.d.ts +0 -39
  157. package/Utils/Monitor/MonitorOverviewFamily.js +0 -206
  158. package/Utils/Monitor/MonitorOverviewFamily.mjs +0 -4
  159. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.mts +0 -189
  160. package/Utils/Monitor/MonitorOverviewPresentationUtil.d.ts +0 -189
  161. package/Utils/Monitor/MonitorOverviewPresentationUtil.js +0 -1480
  162. package/Utils/Monitor/MonitorOverviewPresentationUtil.mjs +0 -5
  163. package/Utils/Monitor/MonitorOverviewProbeUtil.d.mts +0 -112
  164. package/Utils/Monitor/MonitorOverviewProbeUtil.d.ts +0 -112
  165. package/Utils/Monitor/MonitorOverviewProbeUtil.js +0 -640
  166. package/Utils/Monitor/MonitorOverviewProbeUtil.mjs +0 -3
  167. package/Utils/Monitor/MonitorStatusHistoryUtil.d.mts +0 -27
  168. package/Utils/Monitor/MonitorStatusHistoryUtil.d.ts +0 -27
  169. package/Utils/Monitor/MonitorStatusHistoryUtil.js +0 -132
  170. package/Utils/Monitor/MonitorStatusHistoryUtil.mjs +0 -2
  171. package/Utils/Monitor/MonitorUptimeSummaryUtil.d.mts +0 -42
  172. package/Utils/Monitor/MonitorUptimeSummaryUtil.d.ts +0 -42
  173. package/Utils/Monitor/MonitorUptimeSummaryUtil.js +0 -468
  174. package/Utils/Monitor/MonitorUptimeSummaryUtil.mjs +0 -2
@@ -175,6 +175,7 @@ export interface CodeTaskOriginJSON {
175
175
  label: string;
176
176
  recordId?: string | undefined;
177
177
  url?: string | undefined;
178
+ insightType?: string | undefined;
178
179
  }
179
180
  export declare enum CodeTaskListKind {
180
181
  Tasks = "tasks",
@@ -53,6 +53,7 @@ export interface TelemetryAiLogEntryJSON {
53
53
  id: string;
54
54
  title: string;
55
55
  serviceName?: string | undefined;
56
+ type?: string | undefined;
56
57
  };
57
58
  requestedBy?: string | undefined;
58
59
  taskId?: string | undefined;
@@ -53,6 +53,7 @@ export interface TelemetryAiLogEntryJSON {
53
53
  id: string;
54
54
  title: string;
55
55
  serviceName?: string | undefined;
56
+ type?: string | undefined;
56
57
  };
57
58
  requestedBy?: string | undefined;
58
59
  taskId?: string | undefined;
@@ -145,6 +145,10 @@ function parseEntry(value) {
145
145
  if (serviceName) {
146
146
  entry.insight.serviceName = serviceName;
147
147
  }
148
+ const insightType = readText(insight["type"]);
149
+ if (insightType) {
150
+ entry.insight.type = insightType;
151
+ }
148
152
  for (const key of [
149
153
  "requestedBy",
150
154
  "taskId",
@@ -0,0 +1,15 @@
1
+ export declare enum CodeRepositorySetting {
2
+ GitHubCommands = "github-commands",
3
+ ProductionReview = "production-review",
4
+ Runner = "runner",
5
+ PullRequests = "pull-requests",
6
+ TriggerLabel = "trigger-label",
7
+ ProductionReviewComment = "production-review-comment",
8
+ Commands = "commands",
9
+ Branches = "branches"
10
+ }
11
+ export declare function getCodeRepositorySettingsPath(data: {
12
+ projectId: string;
13
+ codeRepositoryId: string;
14
+ setting?: CodeRepositorySetting | undefined;
15
+ }): string;
@@ -0,0 +1,15 @@
1
+ export declare enum CodeRepositorySetting {
2
+ GitHubCommands = "github-commands",
3
+ ProductionReview = "production-review",
4
+ Runner = "runner",
5
+ PullRequests = "pull-requests",
6
+ TriggerLabel = "trigger-label",
7
+ ProductionReviewComment = "production-review-comment",
8
+ Commands = "commands",
9
+ Branches = "branches"
10
+ }
11
+ export declare function getCodeRepositorySettingsPath(data: {
12
+ projectId: string;
13
+ codeRepositoryId: string;
14
+ setting?: CodeRepositorySetting | undefined;
15
+ }): string;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /*
3
+ * THE PLACES OF A CODE REPOSITORY'S SETTINGS ON ITS SETTINGS PAGE.
4
+ *
5
+ * Each setting of a repository in Code has a place on its Settings page:
6
+ * its card's id, the key the page's More settings lists it by, and what a
7
+ * link names after the page's "#" to land on it - More settings then opens
8
+ * by itself there (Common/UI/Utils/PageAnchor). "Pick a Runner" opens
9
+ * ".../settings#runner".
10
+ *
11
+ * React-free and server-free, so the Dashboard's page and links
12
+ * (Components/Code/CodeRepositorySettingsCopy, CodePaths) and the server's
13
+ * links into the Dashboard - the GitHub App's answer when a repository's
14
+ * commands are off links straight to its switch - name the same places.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.CodeRepositorySetting = void 0;
18
+ exports.getCodeRepositorySettingsPath = getCodeRepositorySettingsPath;
19
+ /*
20
+ * The settings of a repository, by their places on its Settings page, in
21
+ * the order the page draws them under More settings.
22
+ */
23
+ var CodeRepositorySetting;
24
+ (function (CodeRepositorySetting) {
25
+ CodeRepositorySetting["GitHubCommands"] = "github-commands";
26
+ CodeRepositorySetting["ProductionReview"] = "production-review";
27
+ CodeRepositorySetting["Runner"] = "runner";
28
+ CodeRepositorySetting["PullRequests"] = "pull-requests";
29
+ CodeRepositorySetting["TriggerLabel"] = "trigger-label";
30
+ CodeRepositorySetting["ProductionReviewComment"] = "production-review-comment";
31
+ // Only on a repository whose operator set build and test commands.
32
+ CodeRepositorySetting["Commands"] = "commands";
33
+ /*
34
+ * A Git repository's Pull Requests: AI pushes a branch there and opens no
35
+ * pull request, so only the branch it starts from is asked.
36
+ */
37
+ CodeRepositorySetting["Branches"] = "branches";
38
+ })(CodeRepositorySetting || (exports.CodeRepositorySetting = CodeRepositorySetting = {}));
39
+ /*
40
+ * A repository's Settings page in the Dashboard, under the Dashboard's own
41
+ * address (DashboardClientUrl, ".../dashboard"), landing on one of its
42
+ * settings when it is named: the route the Dashboard draws it at
43
+ * (RouteMap's PageMap.CODE_REPOSITORY_VIEW_SETTINGS), and the place after
44
+ * its "#".
45
+ */
46
+ function getCodeRepositorySettingsPath(data) {
47
+ const path = `/${encodeURIComponent(data.projectId)}/code/repositories/${encodeURIComponent(data.codeRepositoryId)}/settings`;
48
+ return data.setting ? `${path}#${data.setting}` : path;
49
+ }
@@ -0,0 +1,3 @@
1
+ import commonJsModule from "./CodeRepositorySetting.js";
2
+ export const CodeRepositorySetting = commonJsModule.CodeRepositorySetting;
3
+ export const getCodeRepositorySettingsPath = commonJsModule.getCodeRepositorySettingsPath;
@@ -0,0 +1,6 @@
1
+ import { JSONObject } from "../JSON.mjs";
2
+ import { ColumnMetadataSource } from "./NumericColumnValue.mjs";
3
+ import TableColumnType from "./TableColumnType.mjs";
4
+ export declare function cannotHoldBlank(type: TableColumnType | undefined | null): boolean;
5
+ export declare function isBlankFormValue(value: unknown): boolean;
6
+ export declare function clearBlankColumnValues(json: JSONObject, model: ColumnMetadataSource): JSONObject;
@@ -0,0 +1,6 @@
1
+ import { JSONObject } from "../JSON";
2
+ import { ColumnMetadataSource } from "./NumericColumnValue";
3
+ import TableColumnType from "./TableColumnType";
4
+ export declare function cannotHoldBlank(type: TableColumnType | undefined | null): boolean;
5
+ export declare function isBlankFormValue(value: unknown): boolean;
6
+ export declare function clearBlankColumnValues(json: JSONObject, model: ColumnMetadataSource): JSONObject;
@@ -0,0 +1,77 @@
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
+ exports.cannotHoldBlank = cannotHoldBlank;
7
+ exports.isBlankFormValue = isBlankFormValue;
8
+ exports.clearBlankColumnValues = clearBlankColumnValues;
9
+ const DateColumnValue_1 = require("./DateColumnValue");
10
+ const NumericColumnValue_1 = require("./NumericColumnValue");
11
+ const TableColumnType_1 = __importDefault(require("./TableColumnType"));
12
+ /*
13
+ * WHAT AN EMPTIED NUMBER, DATE OR PORT BOX IS SAVED AS.
14
+ *
15
+ * A form's number box is an <input type="number">, and a DOM input's value
16
+ * is a string: emptied, it hands the form "", and so does an emptied date
17
+ * or port box. A number, date or port column cannot hold "" - Postgres
18
+ * refuses it ("invalid input syntax for type integer"), so emptying an
19
+ * optional number on a form failed the save with an error about a column
20
+ * the reader did not know was wrong. The server leaves a blank alone on
21
+ * purpose (NumericColumnValue: turned into 0 or null there, it would write
22
+ * a value nobody chose, or defeat a column's default), so the form, which
23
+ * knows the reader emptied the box, says what the blank means:
24
+ *
25
+ * - a column that may be empty: none (null) - "Leave empty for no limit",
26
+ * "Leave empty to not track it" - on a Create form and an Edit form
27
+ * alike, whatever the box showed before (a default, a stored value);
28
+ * - a column that may not be empty: the column's default - a sample
29
+ * percentage's 100, a budget's 0 - which is what an untouched Create
30
+ * form would have saved;
31
+ * - a column that may not be empty and has no default: nothing is sent,
32
+ * so an Edit keeps what is stored and a Create is told what is missing.
33
+ *
34
+ * Only a blank: every other value, and every other column, is left exactly
35
+ * as it is. Run by ModelForm on what it is about to send, for every form in
36
+ * the product - it replaces the page-by-page fixes the SLA rules and the
37
+ * session replay policy carried.
38
+ */
39
+ const COLUMN_TYPES_THAT_CANNOT_HOLD_A_BLANK = new Set([TableColumnType_1.default.Port]);
40
+ // Whether a column of this type can never store an empty string.
41
+ function cannotHoldBlank(type) {
42
+ if (!type) {
43
+ return false;
44
+ }
45
+ return ((0, NumericColumnValue_1.isNumericTableColumnType)(type) ||
46
+ (0, DateColumnValue_1.isDateTableColumnType)(type) ||
47
+ COLUMN_TYPES_THAT_CANNOT_HOLD_A_BLANK.has(type));
48
+ }
49
+ // What an emptied box hands the form: a string with nothing in it.
50
+ function isBlankFormValue(value) {
51
+ return typeof value === "string" && value.trim().length === 0;
52
+ }
53
+ /*
54
+ * The blanks of a form's values, for the columns that cannot hold one,
55
+ * replaced with what they mean (see above). In place; returns the values.
56
+ */
57
+ function clearBlankColumnValues(json, model) {
58
+ for (const key of Object.keys(json)) {
59
+ if (!isBlankFormValue(json[key])) {
60
+ continue;
61
+ }
62
+ const metadata = model.getTableColumnMetadata(key);
63
+ if (!metadata || !cannotHoldBlank(metadata.type)) {
64
+ continue;
65
+ }
66
+ if (!metadata.required) {
67
+ json[key] = null;
68
+ continue;
69
+ }
70
+ if (metadata.defaultValue !== undefined && metadata.defaultValue !== null) {
71
+ json[key] = metadata.defaultValue;
72
+ continue;
73
+ }
74
+ delete json[key];
75
+ }
76
+ return json;
77
+ }
@@ -0,0 +1,4 @@
1
+ import commonJsModule from "./BlankColumnValue.js";
2
+ export const cannotHoldBlank = commonJsModule.cannotHoldBlank;
3
+ export const clearBlankColumnValues = commonJsModule.clearBlankColumnValues;
4
+ export const isBlankFormValue = commonJsModule.isBlankFormValue;
package/Types/Date.d.mts CHANGED
@@ -13,8 +13,12 @@ export default class OneUptimeDate {
13
13
  private static isUtcDateTimeString;
14
14
  private static normalizeUtcDateTimeString;
15
15
  private static getLocalShortMonthName;
16
+ private static getCurrentTimezoneNames;
17
+ private static getTimezoneNames;
18
+ private static getLocalizedDateText;
16
19
  static getSchema(): ZodSchema;
17
20
  static getHoursAndMinutesFromMinutes(minutes: number): string;
21
+ private static formatLocalizedDuration;
18
22
  static fromUnixTimestamp(timestamp: number): Date;
19
23
  static getStartOfTheWeek(date: Date, timezone?: string | undefined): Date;
20
24
  static getEndOfTheWeek(date: Date): Date;
@@ -118,6 +122,7 @@ export default class OneUptimeDate {
118
122
  showWeekday?: boolean | undefined;
119
123
  use12HourFormat?: boolean | undefined;
120
124
  }): string;
125
+ private static getEnglishDateInTimezone;
121
126
  static getDateAsCustomFormattedStringInTimezone(data: {
122
127
  date: Date | string;
123
128
  format: string;
@@ -259,6 +264,7 @@ export default class OneUptimeDate {
259
264
  static secondsToFormattedTimeString(seconds: number): string;
260
265
  static toUnixTimestamp(date: Date): number;
261
266
  static secondsToFormattedFriendlyTimeString(seconds: number): string;
267
+ private static getFriendlyTimeParts;
262
268
  static getGreaterDate(a: Date, b: Date): Date;
263
269
  static getLesserDate(a: Date, b: Date): Date;
264
270
  static getSecondsBetweenDates(start: Date, end: Date): number;
@@ -323,11 +329,15 @@ export default class OneUptimeDate {
323
329
  static getDifferenceInSeconds(date: Date, date2: Date): number;
324
330
  static getDifferenceInMonths(date: Date, date2: Date): number;
325
331
  static convertSecondsToDaysHoursMinutesAndSeconds(seconds: number): string;
332
+ private static getEnglishDaysHoursMinutesAndSeconds;
326
333
  static convertMinutesToDaysHoursAndMinutes(minutes: number): string;
334
+ private static getEnglishDaysHoursAndMinutes;
327
335
  static getHumanizedDurationFromNanoseconds(data: {
328
336
  nanoseconds: number;
329
337
  maxParts?: number;
330
338
  }): string;
339
+ private static withDecimalSeparatorOf;
340
+ private static getEnglishHumanizedDuration;
331
341
  private static formatDurationValue;
332
342
  static getGmtOffsetByTimezone(timezone: Timezone): number;
333
343
  static getGmtOffsetFriendlyStringByTimezone(timezone: Timezone): string;
package/Types/Date.d.ts CHANGED
@@ -13,8 +13,12 @@ export default class OneUptimeDate {
13
13
  private static isUtcDateTimeString;
14
14
  private static normalizeUtcDateTimeString;
15
15
  private static getLocalShortMonthName;
16
+ private static getCurrentTimezoneNames;
17
+ private static getTimezoneNames;
18
+ private static getLocalizedDateText;
16
19
  static getSchema(): ZodSchema;
17
20
  static getHoursAndMinutesFromMinutes(minutes: number): string;
21
+ private static formatLocalizedDuration;
18
22
  static fromUnixTimestamp(timestamp: number): Date;
19
23
  static getStartOfTheWeek(date: Date, timezone?: string | undefined): Date;
20
24
  static getEndOfTheWeek(date: Date): Date;
@@ -118,6 +122,7 @@ export default class OneUptimeDate {
118
122
  showWeekday?: boolean | undefined;
119
123
  use12HourFormat?: boolean | undefined;
120
124
  }): string;
125
+ private static getEnglishDateInTimezone;
121
126
  static getDateAsCustomFormattedStringInTimezone(data: {
122
127
  date: Date | string;
123
128
  format: string;
@@ -259,6 +264,7 @@ export default class OneUptimeDate {
259
264
  static secondsToFormattedTimeString(seconds: number): string;
260
265
  static toUnixTimestamp(date: Date): number;
261
266
  static secondsToFormattedFriendlyTimeString(seconds: number): string;
267
+ private static getFriendlyTimeParts;
262
268
  static getGreaterDate(a: Date, b: Date): Date;
263
269
  static getLesserDate(a: Date, b: Date): Date;
264
270
  static getSecondsBetweenDates(start: Date, end: Date): number;
@@ -323,11 +329,15 @@ export default class OneUptimeDate {
323
329
  static getDifferenceInSeconds(date: Date, date2: Date): number;
324
330
  static getDifferenceInMonths(date: Date, date2: Date): number;
325
331
  static convertSecondsToDaysHoursMinutesAndSeconds(seconds: number): string;
332
+ private static getEnglishDaysHoursMinutesAndSeconds;
326
333
  static convertMinutesToDaysHoursAndMinutes(minutes: number): string;
334
+ private static getEnglishDaysHoursAndMinutes;
327
335
  static getHumanizedDurationFromNanoseconds(data: {
328
336
  nanoseconds: number;
329
337
  maxParts?: number;
330
338
  }): string;
339
+ private static withDecimalSeparatorOf;
340
+ private static getEnglishHumanizedDuration;
331
341
  private static formatDurationValue;
332
342
  static getGmtOffsetByTimezone(timezone: Timezone): number;
333
343
  static getGmtOffsetFriendlyStringByTimezone(timezone: Timezone): string;