@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.
- package/Models/DatabaseModels/Alert.js +8 -1
- package/Models/DatabaseModels/AlertEpisodeMember.d.mts +1 -0
- package/Models/DatabaseModels/AlertEpisodeMember.d.ts +1 -0
- package/Models/DatabaseModels/AlertEpisodeMember.js +50 -0
- package/Models/DatabaseModels/AutoRemediationRule.js +1 -1
- package/Models/DatabaseModels/CodeRepository.d.mts +1 -0
- package/Models/DatabaseModels/CodeRepository.d.ts +1 -0
- package/Models/DatabaseModels/CodeRepository.js +69 -6
- package/Models/DatabaseModels/IncidentEpisodeMember.d.mts +1 -0
- package/Models/DatabaseModels/IncidentEpisodeMember.d.ts +1 -0
- package/Models/DatabaseModels/IncidentEpisodeMember.js +50 -0
- package/Models/DatabaseModels/IncomingCallPolicy.js +1 -1
- package/Models/DatabaseModels/LlmProvider.js +1 -1
- package/Models/DatabaseModels/MonitorTemplate.js +10 -4
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +13 -13
- package/Models/DatabaseModels/OnCallDutyPolicy.js +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceReminderRule.js +1 -1
- package/Models/DatabaseModels/StatusPage.d.mts +2 -0
- package/Models/DatabaseModels/StatusPage.d.ts +2 -0
- package/Models/DatabaseModels/StatusPage.js +100 -0
- package/Types/AI/CodeTask.d.mts +1 -0
- package/Types/AI/CodeTask.d.ts +1 -0
- package/Types/AI/TelemetryAiActivity.d.mts +1 -0
- package/Types/AI/TelemetryAiActivity.d.ts +1 -0
- package/Types/AI/TelemetryAiActivity.js +4 -0
- package/Types/CodeRepository/CodeRepositorySetting.d.mts +15 -0
- package/Types/CodeRepository/CodeRepositorySetting.d.ts +15 -0
- package/Types/CodeRepository/CodeRepositorySetting.js +49 -0
- package/Types/CodeRepository/CodeRepositorySetting.mjs +3 -0
- package/Types/Database/BlankColumnValue.d.mts +6 -0
- package/Types/Database/BlankColumnValue.d.ts +6 -0
- package/Types/Database/BlankColumnValue.js +77 -0
- package/Types/Database/BlankColumnValue.mjs +4 -0
- package/Types/Date.d.mts +10 -0
- package/Types/Date.d.ts +10 -0
- package/Types/Date.js +385 -98
- package/Types/DateLanguage.d.mts +67 -0
- package/Types/DateLanguage.d.ts +67 -0
- package/Types/DateLanguage.js +478 -0
- package/Types/DateLanguage.mjs +21 -0
- package/Types/Email/EmailTemplateType.d.mts +1 -0
- package/Types/Email/EmailTemplateType.d.ts +1 -0
- package/Types/Email/EmailTemplateType.js +1 -0
- package/Types/IncomingCall/IncomingCallPolicyRepeat.d.mts +6 -0
- package/Types/IncomingCall/IncomingCallPolicyRepeat.d.ts +6 -0
- package/Types/IncomingCall/IncomingCallPolicyRepeat.js +41 -14
- package/Types/IncomingCall/IncomingCallPolicyRepeat.mjs +3 -0
- package/Types/Monitor/CriteriaFilter.d.mts +1 -0
- package/Types/Monitor/CriteriaFilter.d.ts +1 -0
- package/Types/Monitor/CriteriaFilter.js +9 -0
- package/Types/Monitor/DatabaseMetricCatalog.js +2 -2
- package/Types/Monitor/KubernetesEventAlertTemplates.d.mts +20 -0
- package/Types/Monitor/KubernetesEventAlertTemplates.d.ts +20 -0
- package/Types/Monitor/KubernetesEventAlertTemplates.js +232 -0
- package/Types/Monitor/KubernetesEventAlertTemplates.mjs +8 -0
- package/Types/Monitor/MonitorType.js +12 -2
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +27 -2
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.mts +1 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.d.ts +1 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +31 -1
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.mts +3 -1
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.ts +3 -1
- package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +3 -2
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.mts +1 -0
- package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.d.ts +1 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.js +2 -0
- package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +10 -3
- package/Types/NotificationSetting/NotificationSettingEventType.d.mts +1 -0
- package/Types/NotificationSetting/NotificationSettingEventType.d.ts +1 -0
- package/Types/NotificationSetting/NotificationSettingEventType.js +7 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.mts +7 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.d.ts +7 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.js +51 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRepeat.mjs +4 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.mts +8 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.d.ts +8 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.js +55 -0
- package/Types/Reminder/ScheduledMaintenanceReminderNeverReminds.mjs +5 -0
- package/Types/Runner/CodeRepositoryRunner.d.mts +7 -0
- package/Types/Runner/CodeRepositoryRunner.d.ts +7 -0
- package/Types/Runner/CodeRepositoryRunner.js +60 -14
- package/Types/Runner/CodeRepositoryRunner.mjs +1 -0
- package/Types/SecurityEvent/OcsfProcessActivity.d.mts +25 -0
- package/Types/SecurityEvent/OcsfProcessActivity.d.ts +25 -0
- package/Types/SecurityEvent/OcsfProcessActivity.js +131 -0
- package/Types/SecurityEvent/OcsfProcessActivity.mjs +8 -0
- package/Types/Workflow/Templates.js +2 -5
- package/UI/Utils/TranslateTemplate.d.mts +73 -0
- package/UI/Utils/TranslateTemplate.d.ts +73 -0
- package/Utils/ColorContrast.d.mts +3 -0
- package/Utils/ColorContrast.d.ts +3 -0
- package/Utils/ColorContrast.js +41 -3
- package/Utils/ColorContrast.mjs +2 -0
- package/Utils/CronTab.d.mts +41 -3
- package/Utils/CronTab.d.ts +41 -3
- package/Utils/CronTab.js +112 -38
- package/Utils/Incident/WhoOpenedItRootCause.d.mts +2 -0
- package/Utils/Incident/WhoOpenedItRootCause.d.ts +2 -0
- package/Utils/Incident/WhoOpenedItRootCause.js +50 -0
- package/Utils/Incident/WhoOpenedItRootCause.mjs +3 -0
- package/Utils/Monitor/MonitorOverviewTargetUtil.d.mts +2 -0
- package/Utils/Monitor/MonitorOverviewTargetUtil.d.ts +2 -0
- package/Utils/Monitor/MonitorOverviewTargetUtil.js +13 -2
- package/Utils/Monitor/SyntheticMonitorStepsUtil.d.mts +18 -0
- package/Utils/Monitor/SyntheticMonitorStepsUtil.d.ts +18 -0
- package/Utils/Monitor/SyntheticMonitorStepsUtil.js +129 -0
- package/Utils/Monitor/SyntheticMonitorStepsUtil.mjs +4 -0
- package/Utils/Rules/RuleRunSummary.d.mts +1 -0
- package/Utils/Rules/RuleRunSummary.d.ts +1 -0
- package/Utils/Rules/RuleRunSummary.js +19 -1
- package/Utils/Rules/RuleRunSummary.mjs +1 -0
- package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.d.mts +5 -0
- package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.d.ts +5 -0
- package/Utils/SecurityEvent/Destinations/GoogleSecOpsUdmMapper.js +219 -58
- package/Utils/SecurityEvent/OcsfNormalizer.js +22 -13
- package/Utils/Slo/SloDuration.d.mts +1 -0
- package/Utils/Slo/SloDuration.d.ts +1 -0
- package/Utils/Slo/SloDuration.js +57 -8
- package/Utils/Slo/SloDuration.mjs +1 -0
- package/Utils/Sms/Gsm7Text.js +9 -1
- package/Utils/Sms/OnCallPageSms.d.mts +2 -0
- package/Utils/Sms/OnCallPageSms.d.ts +2 -0
- package/Utils/Sms/OnCallPageSms.js +19 -2
- package/Utils/Sms/OnCallPageSms.mjs +1 -0
- package/Utils/Sms/SubscriberSms.d.mts +2 -0
- package/Utils/Sms/SubscriberSms.d.ts +2 -0
- package/Utils/Sms/SubscriberSms.js +35 -0
- package/Utils/Sms/SubscriberSms.mjs +3 -0
- package/Utils/Suggestions/CodeFixSuggestion.d.mts +15 -0
- package/Utils/Suggestions/CodeFixSuggestion.d.ts +15 -0
- package/Utils/Suggestions/CodeFixSuggestion.js +62 -1
- package/Utils/Suggestions/CodeFixSuggestion.mjs +4 -0
- package/Utils/Suggestions/ProfileFixSuggestion.js +4 -0
- package/Utils/Suggestions/SuggestionBlocker.d.mts +8 -0
- package/Utils/Suggestions/SuggestionBlocker.d.ts +8 -0
- package/Utils/Suggestions/SuggestionBlocker.js +51 -0
- package/Utils/Suggestions/SuggestionBlocker.mjs +4 -0
- package/Utils/Suggestions/SuggestionOffer.d.mts +2 -1
- package/Utils/Suggestions/SuggestionOffer.d.ts +2 -1
- package/Utils/Suggestions/SuggestionOffer.js +5 -0
- package/Utils/Suggestions/TelemetryAiFixSuggestion.d.mts +2 -7
- package/Utils/Suggestions/TelemetryAiFixSuggestion.d.ts +2 -7
- package/Utils/Suggestions/TelemetryAiFixSuggestion.js +8 -36
- package/Utils/Suggestions/TelemetryImprovementSuggestion.d.mts +1 -0
- package/Utils/Suggestions/TelemetryImprovementSuggestion.d.ts +1 -0
- package/Utils/Suggestions/TelemetryImprovementSuggestion.js +1 -0
- package/Utils/Suggestions/TracePerformanceFixSuggestion.d.mts +6 -0
- package/Utils/Suggestions/TracePerformanceFixSuggestion.d.ts +6 -0
- package/Utils/Suggestions/TracePerformanceFixSuggestion.js +46 -5
- package/package.json +8 -1
- package/Utils/Monitor/MonitorCheckScheduleUtil.d.mts +0 -61
- package/Utils/Monitor/MonitorCheckScheduleUtil.d.ts +0 -61
- package/Utils/Monitor/MonitorCheckScheduleUtil.js +0 -476
- package/Utils/Monitor/MonitorCheckScheduleUtil.mjs +0 -3
- package/Utils/Monitor/MonitorOverviewFamily.d.mts +0 -39
- package/Utils/Monitor/MonitorOverviewFamily.d.ts +0 -39
- package/Utils/Monitor/MonitorOverviewFamily.js +0 -206
- package/Utils/Monitor/MonitorOverviewFamily.mjs +0 -4
- package/Utils/Monitor/MonitorOverviewPresentationUtil.d.mts +0 -189
- package/Utils/Monitor/MonitorOverviewPresentationUtil.d.ts +0 -189
- package/Utils/Monitor/MonitorOverviewPresentationUtil.js +0 -1480
- package/Utils/Monitor/MonitorOverviewPresentationUtil.mjs +0 -5
- package/Utils/Monitor/MonitorOverviewProbeUtil.d.mts +0 -112
- package/Utils/Monitor/MonitorOverviewProbeUtil.d.ts +0 -112
- package/Utils/Monitor/MonitorOverviewProbeUtil.js +0 -640
- package/Utils/Monitor/MonitorOverviewProbeUtil.mjs +0 -3
- package/Utils/Monitor/MonitorStatusHistoryUtil.d.mts +0 -27
- package/Utils/Monitor/MonitorStatusHistoryUtil.d.ts +0 -27
- package/Utils/Monitor/MonitorStatusHistoryUtil.js +0 -132
- package/Utils/Monitor/MonitorStatusHistoryUtil.mjs +0 -2
- package/Utils/Monitor/MonitorUptimeSummaryUtil.d.mts +0 -42
- package/Utils/Monitor/MonitorUptimeSummaryUtil.d.ts +0 -42
- package/Utils/Monitor/MonitorUptimeSummaryUtil.js +0 -468
- package/Utils/Monitor/MonitorUptimeSummaryUtil.mjs +0 -2
package/Types/AI/CodeTask.d.ts
CHANGED
|
@@ -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,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
|
+
}
|
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;
|