@oneuptime/common 14.0.106 → 14.0.107
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/AnalyticsModels/AuditLog.js +1 -1
- package/Models/AnalyticsModels/Index.js +3 -0
- package/Models/AnalyticsModels/RumProductAnalyticsEvent.d.mts +5 -0
- package/Models/AnalyticsModels/RumProductAnalyticsEvent.d.ts +5 -0
- package/Models/AnalyticsModels/RumProductAnalyticsEvent.js +300 -0
- package/Models/AnalyticsModels/RumProductAnalyticsEvent.mjs +3 -0
- package/Models/DatabaseModels/CallLog.d.mts +4 -0
- package/Models/DatabaseModels/CallLog.d.ts +4 -0
- package/Models/DatabaseModels/CallLog.js +85 -0
- package/Models/DatabaseModels/DataBiConnection.d.mts +3 -0
- package/Models/DatabaseModels/DataBiConnection.d.ts +3 -0
- package/Models/DatabaseModels/DataBiConnection.js +47 -1
- package/Models/DatabaseModels/DataDashboard.d.mts +10 -0
- package/Models/DatabaseModels/DataDashboard.d.ts +10 -0
- package/Models/DatabaseModels/DataDashboard.js +129 -2
- package/Models/DatabaseModels/Index.js +6 -0
- package/Models/DatabaseModels/NetworkDevice.d.mts +1 -0
- package/Models/DatabaseModels/NetworkDevice.d.ts +1 -0
- package/Models/DatabaseModels/NetworkDevice.js +55 -0
- package/Models/DatabaseModels/NetworkDeviceNamingRule.d.mts +26 -0
- package/Models/DatabaseModels/NetworkDeviceNamingRule.d.ts +26 -0
- package/Models/DatabaseModels/NetworkDeviceNamingRule.js +536 -0
- package/Models/DatabaseModels/NetworkDeviceNamingRule.mjs +2 -0
- package/Models/DatabaseModels/NetworkSite.d.mts +1 -0
- package/Models/DatabaseModels/NetworkSite.d.ts +1 -0
- package/Models/DatabaseModels/NetworkSite.js +51 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.d.mts +2 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.d.ts +2 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLogTimeline.js +41 -0
- package/Models/DatabaseModels/ProjectCallSMSConfig.d.mts +2 -0
- package/Models/DatabaseModels/ProjectCallSMSConfig.d.ts +2 -0
- package/Models/DatabaseModels/ProjectCallSMSConfig.js +80 -1
- package/Models/DatabaseModels/RumApplication.d.mts +2 -0
- package/Models/DatabaseModels/RumApplication.d.ts +2 -0
- package/Models/DatabaseModels/RumApplication.js +108 -0
- package/Models/DatabaseModels/Team.js +10 -2
- package/Models/DatabaseModels/TeamComplianceSetting.js +8 -1
- package/Models/DatabaseModels/TeamCustomRole.js +9 -1
- package/Models/DatabaseModels/TeamMember.js +15 -1
- package/Models/DatabaseModels/TeamOwnerTeam.d.mts +17 -0
- package/Models/DatabaseModels/TeamOwnerTeam.d.ts +17 -0
- package/Models/DatabaseModels/TeamOwnerTeam.js +325 -0
- package/Models/DatabaseModels/TeamOwnerTeam.mjs +2 -0
- package/Models/DatabaseModels/TeamOwnerUser.d.mts +17 -0
- package/Models/DatabaseModels/TeamOwnerUser.d.ts +17 -0
- package/Models/DatabaseModels/TeamOwnerUser.js +331 -0
- package/Models/DatabaseModels/TeamOwnerUser.mjs +2 -0
- package/Models/DatabaseModels/TeamPermission.js +12 -1
- package/Models/DatabaseModels/TelemetryUsageBilling.d.mts +1 -0
- package/Models/DatabaseModels/TelemetryUsageBilling.d.ts +1 -0
- package/Models/DatabaseModels/TelemetryUsageBilling.js +34 -0
- package/Types/AI/AIActionWords.d.mts +1 -0
- package/Types/AI/AIActionWords.d.ts +1 -0
- package/Types/AI/AIActionWords.js +15 -4
- package/Types/AI/AIChatRecordSeen.d.mts +3 -0
- package/Types/AI/AIChatRecordSeen.d.ts +3 -0
- package/Types/AI/AIChatRecordSeen.js +28 -3
- package/Types/AI/AIChatRecordSeen.mjs +1 -0
- package/Types/AnalyticsDatabase/AnalyticsTableName.d.mts +2 -1
- package/Types/AnalyticsDatabase/AnalyticsTableName.d.ts +2 -1
- package/Types/AnalyticsDatabase/AnalyticsTableName.js +7 -0
- package/Types/AuditLog/AuditLogRetention.d.mts +10 -0
- package/Types/AuditLog/AuditLogRetention.d.ts +10 -0
- package/Types/AuditLog/AuditLogRetention.js +91 -0
- package/Types/AuditLog/AuditLogRetention.mjs +8 -0
- package/Types/CallAndSMS/TwilioConfigDefaults.d.mts +37 -0
- package/Types/CallAndSMS/TwilioConfigDefaults.d.ts +37 -0
- package/Types/CallAndSMS/TwilioConfigDefaults.js +224 -0
- package/Types/CallAndSMS/TwilioConfigDefaults.mjs +3 -0
- package/Types/CodeRepository/CodeFileSeen.d.mts +3 -0
- package/Types/CodeRepository/CodeFileSeen.d.ts +3 -0
- package/Types/CodeRepository/CodeFileSeen.js +61 -3
- package/Types/DataObservability/DataDashboardActivity.d.mts +40 -0
- package/Types/DataObservability/DataDashboardActivity.d.ts +40 -0
- package/Types/DataObservability/DataDashboardActivity.js +119 -0
- package/Types/DataObservability/DataDashboardActivity.mjs +12 -0
- package/Types/DataObservability/DataObservabilityApiTypes.d.mts +7 -0
- package/Types/DataObservability/DataObservabilityApiTypes.d.ts +7 -0
- package/Types/DataObservability/DataObservabilityApiTypes.js +2 -0
- package/Types/DataObservability/DataTableLineage.d.mts +87 -0
- package/Types/DataObservability/DataTableLineage.d.ts +87 -0
- package/Types/DataObservability/DataTableLineage.js +111 -0
- package/Types/DataObservability/DataTableLineage.mjs +19 -0
- package/Types/DataSecurity/DataStoreKind.d.mts +1 -0
- package/Types/DataSecurity/DataStoreKind.d.ts +1 -0
- package/Types/DataSecurity/DataStoreKind.js +3 -0
- package/Types/Database/AccessControl/PermissionScopeNarrowing.js +6 -0
- package/Types/DatabaseServer/DatabaseServerMetricCatalog.js +71 -82
- package/Types/Date.d.mts +4 -0
- package/Types/Date.d.ts +4 -0
- package/Types/Date.js +47 -2
- package/Types/Date.mjs +2 -0
- package/Types/DateLanguage.d.mts +9 -0
- package/Types/DateLanguage.d.ts +9 -0
- package/Types/DateLanguage.js +79 -1
- package/Types/DateLanguage.mjs +4 -0
- package/Types/MessageQueue/MessageQueueMetricCatalog.js +61 -61
- package/Types/Monitor/CriteriaFilterTerms.d.mts +4 -0
- package/Types/Monitor/CriteriaFilterTerms.d.ts +4 -0
- package/Types/Monitor/CriteriaFilterTerms.js +166 -0
- package/Types/Monitor/CriteriaFilterTerms.mjs +4 -0
- package/Types/Monitor/EvaluationSentence.d.mts +37 -0
- package/Types/Monitor/EvaluationSentence.d.ts +37 -0
- package/Types/Monitor/EvaluationSentence.js +298 -0
- package/Types/Monitor/EvaluationSentence.mjs +12 -0
- package/Types/Monitor/MonitorCriteria.d.mts +2 -0
- package/Types/Monitor/MonitorCriteria.d.ts +2 -0
- package/Types/Monitor/MonitorCriteria.js +8 -0
- package/Types/Monitor/MonitorCriteriaInstance.d.mts +5 -0
- package/Types/Monitor/MonitorCriteriaInstance.d.ts +5 -0
- package/Types/Monitor/MonitorCriteriaInstance.js +243 -194
- package/Types/Monitor/MonitorEvaluationDetails.d.mts +2 -0
- package/Types/Monitor/MonitorEvaluationDetails.d.ts +2 -0
- package/Types/Monitor/MonitorEvaluationSummary.d.mts +4 -0
- package/Types/Monitor/MonitorEvaluationSummary.d.ts +4 -0
- package/Types/Monitor/MonitorStep.d.mts +2 -0
- package/Types/Monitor/MonitorStep.d.ts +2 -0
- package/Types/Monitor/MonitorSteps.d.mts +2 -0
- package/Types/Monitor/MonitorSteps.d.ts +2 -0
- package/Types/Monitor/MonitorType.d.mts +1 -0
- package/Types/Monitor/MonitorType.d.ts +1 -0
- package/Types/Monitor/MonitorType.js +12 -0
- package/Types/Monitor/TelemetryObservation.d.mts +15 -0
- package/Types/Monitor/TelemetryObservation.d.ts +15 -0
- package/Types/Monitor/TelemetryObservation.js +28 -0
- package/Types/Monitor/TelemetryObservation.mjs +2 -0
- package/Types/NetworkDevice/DeviceNaming.d.mts +87 -0
- package/Types/NetworkDevice/DeviceNaming.d.ts +87 -0
- package/Types/NetworkDevice/DeviceNaming.js +279 -0
- package/Types/NetworkDevice/DeviceNaming.mjs +24 -0
- package/Types/NetworkDevice/DiscoveredDevice.d.mts +1 -0
- package/Types/NetworkDevice/DiscoveredDevice.d.ts +1 -0
- package/Types/NetworkDevice/DiscoveredDevice.js +4 -0
- package/Types/OnCallDutyPolicy/OnCallPageChannel.d.mts +68 -0
- package/Types/OnCallDutyPolicy/OnCallPageChannel.d.ts +68 -0
- package/Types/OnCallDutyPolicy/OnCallPageChannel.js +351 -0
- package/Types/OnCallDutyPolicy/OnCallPageChannel.mjs +15 -0
- package/Types/Permission.d.mts +5 -0
- package/Types/Permission.d.ts +5 -0
- package/Types/Permission.js +61 -5
- package/Types/Rules/RuleCriteriaFieldRegistry.js +12 -0
- package/Types/Rules/RuleCriteriaSubject.js +1 -0
- package/Types/Rum/ProductAnalyticsEventReads.d.mts +115 -0
- package/Types/Rum/ProductAnalyticsEventReads.d.ts +115 -0
- package/Types/Rum/ProductAnalyticsEventReads.js +166 -0
- package/Types/Rum/ProductAnalyticsEventReads.mjs +27 -0
- package/Types/Rum/ProductAnalyticsEvents.d.mts +121 -0
- package/Types/Rum/ProductAnalyticsEvents.d.ts +121 -0
- package/Types/Rum/ProductAnalyticsEvents.js +477 -0
- package/Types/Rum/ProductAnalyticsEvents.mjs +40 -0
- package/Types/Rum/SessionReplay.d.mts +4 -0
- package/Types/Rum/SessionReplay.d.ts +4 -0
- package/Types/Rum/SessionReplayHealth.js +1 -1
- package/Types/ServiceLevelObjective/SloErrorBudgetPolicyChange.d.mts +10 -0
- package/Types/ServiceLevelObjective/SloErrorBudgetPolicyChange.d.ts +10 -0
- package/Types/ServiceLevelObjective/SloErrorBudgetPolicyChange.js +51 -0
- package/Types/ServiceLevelObjective/SloErrorBudgetPolicyChange.mjs +4 -0
- package/Types/Team/BuiltInTeam.d.mts +1 -0
- package/Types/Team/BuiltInTeam.d.ts +1 -0
- package/Types/Team/BuiltInTeam.js +14 -1
- package/Types/Team/BuiltInTeam.mjs +1 -0
- package/Types/Telemetry/TelemetryUsage.d.mts +7 -2
- package/Types/Telemetry/TelemetryUsage.d.ts +7 -2
- package/Types/Telemetry/TelemetryUsage.js +24 -5
- package/Types/Telemetry/TelemetryUsage.mjs +3 -0
- package/Types/UserNotification/UserNotificationStatus.d.mts +2 -1
- package/Types/UserNotification/UserNotificationStatus.d.ts +2 -1
- package/Types/UserNotification/UserNotificationStatus.js +8 -0
- package/Types/Workspace/NotificationRules/EventType.d.mts +2 -1
- package/Types/Workspace/NotificationRules/EventType.d.ts +2 -1
- package/Types/Workspace/NotificationRules/EventType.js +8 -0
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.mts +7 -1
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.d.ts +7 -1
- package/Types/Workspace/NotificationRules/NotificationRuleInvites.js +5 -1
- package/Types/Workspace/NotificationRules/NotificationRuleTypes/ServiceLevelObjectiveNotificationRule.d.mts +4 -0
- package/Types/Workspace/NotificationRules/NotificationRuleTypes/ServiceLevelObjectiveNotificationRule.d.ts +4 -0
- package/Types/Workspace/NotificationRules/NotificationRuleTypes/ServiceLevelObjectiveNotificationRule.js +2 -0
- package/Types/Workspace/NotificationRules/NotificationRuleTypes/ServiceLevelObjectiveNotificationRule.mjs +1 -0
- package/Utils/AI/InvestigationReport.js +93 -21
- package/Utils/AI/InvestigationReportLanguages.d.mts +25 -0
- package/Utils/AI/InvestigationReportLanguages.d.ts +25 -0
- package/Utils/AI/InvestigationReportLanguages.js +603 -0
- package/Utils/AI/InvestigationReportLanguages.mjs +11 -0
- package/Utils/Dashboard/TableThresholds.js +5 -2
- package/Utils/Monitor/MonitorLogSummaryUtil.d.mts +8 -0
- package/Utils/Monitor/MonitorLogSummaryUtil.d.ts +8 -0
- package/Utils/Monitor/MonitorLogSummaryUtil.js +170 -0
- package/Utils/Monitor/MonitorRootCauseWording.d.mts +17 -0
- package/Utils/Monitor/MonitorRootCauseWording.d.ts +17 -0
- package/Utils/Monitor/MonitorRootCauseWording.js +242 -0
- package/Utils/Monitor/MonitorRootCauseWording.mjs +2 -0
- package/Utils/Monitor/MonitorSummarySnapshotUtil.d.mts +3 -0
- package/Utils/Monitor/MonitorSummarySnapshotUtil.d.ts +3 -0
- package/Utils/Monitor/MonitorSummarySnapshotUtil.js +5 -2
- package/Utils/NetworkDevice/Naming/DeviceNamingPlanner.d.mts +75 -0
- package/Utils/NetworkDevice/Naming/DeviceNamingPlanner.d.ts +75 -0
- package/Utils/NetworkDevice/Naming/DeviceNamingPlanner.js +303 -0
- package/Utils/NetworkDevice/Naming/DeviceNamingPlanner.mjs +8 -0
- package/Utils/NetworkDevice/Naming/NamePattern.d.mts +122 -0
- package/Utils/NetworkDevice/Naming/NamePattern.d.ts +122 -0
- package/Utils/NetworkDevice/Naming/NamePattern.js +649 -0
- package/Utils/NetworkDevice/Naming/NamePattern.mjs +22 -0
- package/Utils/NetworkDevice/Naming/NamingLookup.d.mts +77 -0
- package/Utils/NetworkDevice/Naming/NamingLookup.d.ts +77 -0
- package/Utils/NetworkDevice/Naming/NamingLookup.js +467 -0
- package/Utils/NetworkDevice/Naming/NamingLookup.mjs +14 -0
- package/Utils/NetworkDevice/Naming/NamingRuleMatcher.d.mts +26 -0
- package/Utils/NetworkDevice/Naming/NamingRuleMatcher.d.ts +26 -0
- package/Utils/NetworkDevice/Naming/NamingRuleMatcher.js +327 -0
- package/Utils/NetworkDevice/Naming/NamingRuleMatcher.mjs +7 -0
- package/Utils/NetworkDiscovery/DiscoveredNameUpgrade.d.mts +1 -0
- package/Utils/NetworkDiscovery/DiscoveredNameUpgrade.d.ts +1 -0
- package/Utils/NetworkDiscovery/DiscoveredNameUpgrade.js +8 -0
- package/Utils/NetworkDiscovery/PingMonitorBuilder.d.mts +2 -0
- package/Utils/NetworkDiscovery/PingMonitorBuilder.d.ts +2 -0
- package/Utils/NetworkDiscovery/PingMonitorBuilder.js +1 -0
- package/Utils/{Rum → SessionReplay}/SessionReplayHealth.d.mts +7 -6
- package/Utils/{Rum → SessionReplay}/SessionReplayHealth.d.ts +7 -6
- package/Utils/SessionReplay/SessionReplayHealth.js +703 -0
- package/Utils/Slo/SloErrorBudgetPolicy.d.mts +7 -0
- package/Utils/Slo/SloErrorBudgetPolicy.d.ts +7 -0
- package/Utils/Slo/SloErrorBudgetPolicy.js +39 -0
- package/Utils/Slo/SloErrorBudgetPolicy.mjs +1 -0
- package/Utils/Slo/SloFeedMarkdown.d.mts +19 -4
- package/Utils/Slo/SloFeedMarkdown.d.ts +19 -4
- package/Utils/Slo/SloFeedMarkdown.js +64 -17
- package/Utils/Slo/SloFeedMarkdown.mjs +4 -0
- package/Utils/StatusPage/ResourceExplorer.js +9 -8
- package/Utils/TotpSetupKey.d.mts +3 -0
- package/Utils/TotpSetupKey.d.ts +3 -0
- package/Utils/TotpSetupKey.js +72 -0
- package/Utils/TotpSetupKey.mjs +4 -0
- package/Utils/Workspace/WorkspaceChannelName.js +5 -1
- package/package.json +1 -1
- package/Utils/Rum/SessionReplayHealth.js +0 -558
- /package/Utils/{Rum → SessionReplay}/SessionReplayHealth.mjs +0 -0
|
@@ -17,6 +17,7 @@ const CustomRolePermission_1 = __importDefault(require("./CustomRolePermission")
|
|
|
17
17
|
const Label_1 = __importDefault(require("./Label"));
|
|
18
18
|
const Project_1 = __importDefault(require("./Project"));
|
|
19
19
|
const Team_1 = __importDefault(require("./Team"));
|
|
20
|
+
const OwnedThrough_1 = __importDefault(require("../../Types/Database/AccessControl/OwnedThrough"));
|
|
20
21
|
const TeamCustomRole_1 = __importDefault(require("./TeamCustomRole"));
|
|
21
22
|
const User_1 = __importDefault(require("./User"));
|
|
22
23
|
const DatabaseBaseModel_1 = __importDefault(require("./DatabaseBaseModel/DatabaseBaseModel"));
|
|
@@ -211,6 +212,8 @@ __decorate([
|
|
|
211
212
|
(0, typeorm_1.Index)(),
|
|
212
213
|
(0, TableColumn_1.default)({
|
|
213
214
|
type: TableColumnType_1.default.ObjectID,
|
|
215
|
+
// Every permission is a team's: TeamPermissionService refuses one without.
|
|
216
|
+
required: true,
|
|
214
217
|
title: "Team ID",
|
|
215
218
|
description: "ID of Team this permission belongs in.",
|
|
216
219
|
example: "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
|
|
@@ -727,7 +730,15 @@ TeamPermission = __decorate([
|
|
|
727
730
|
Permission_1.default.ProjectAdmin,
|
|
728
731
|
Permission_1.default.EditProjectTeamPermissions,
|
|
729
732
|
],
|
|
730
|
-
})
|
|
733
|
+
})
|
|
734
|
+
/*
|
|
735
|
+
* A team's permissions are its owners' to change: Edit Team Permissions
|
|
736
|
+
* scoped to Owned adds, changes and removes them only on the teams its
|
|
737
|
+
* holder or their teams own - and never beyond what its holder may hand on
|
|
738
|
+
* (TeamPermissionService.assertCanGrantPermission).
|
|
739
|
+
*/
|
|
740
|
+
,
|
|
741
|
+
(0, OwnedThrough_1.default)("teamId", Team_1.default),
|
|
731
742
|
(0, TenantColumn_1.default)("projectId"),
|
|
732
743
|
(0, CrudApiEndpoint_1.default)(new Route_1.default("/team-permission")),
|
|
733
744
|
(0, typeorm_1.Entity)({
|
|
@@ -14,6 +14,7 @@ export default class TelemetryUsageBilling extends BaseModel {
|
|
|
14
14
|
productType?: ProductType;
|
|
15
15
|
retainTelemetryDataForDays?: number;
|
|
16
16
|
dataIngestedInGB?: Decimal;
|
|
17
|
+
exceptionDataIngestedInGB?: Decimal;
|
|
17
18
|
totalCostInUSD?: Decimal;
|
|
18
19
|
isReportedToBillingProvider?: boolean;
|
|
19
20
|
service?: Service;
|
|
@@ -14,6 +14,7 @@ export default class TelemetryUsageBilling extends BaseModel {
|
|
|
14
14
|
productType?: ProductType;
|
|
15
15
|
retainTelemetryDataForDays?: number;
|
|
16
16
|
dataIngestedInGB?: Decimal;
|
|
17
|
+
exceptionDataIngestedInGB?: Decimal;
|
|
17
18
|
totalCostInUSD?: Decimal;
|
|
18
19
|
isReportedToBillingProvider?: boolean;
|
|
19
20
|
service?: Service;
|
|
@@ -54,6 +54,19 @@ let TelemetryUsageBilling = class TelemetryUsageBilling extends DatabaseBaseMode
|
|
|
54
54
|
this.productType = undefined;
|
|
55
55
|
this.retainTelemetryDataForDays = undefined;
|
|
56
56
|
this.dataIngestedInGB = undefined;
|
|
57
|
+
/*
|
|
58
|
+
* How much of a Traces row's data was exceptions (issue #6356). Traces are
|
|
59
|
+
* billed as one product that sums the span rows and the exception rows, so
|
|
60
|
+
* dataIngestedInGB keeps that sum - what the row is billed for, and the
|
|
61
|
+
* only figure its cost is worked out from - and this says how much of it
|
|
62
|
+
* the exceptions were, for the usage pages to show apart. It is never
|
|
63
|
+
* billed and never adds to anything: the exceptions are inside
|
|
64
|
+
* dataIngestedInGB already.
|
|
65
|
+
*
|
|
66
|
+
* Empty on every other product's row, and on a Traces row counted before
|
|
67
|
+
* the exceptions were counted apart: its exceptions stay inside Traces.
|
|
68
|
+
*/
|
|
69
|
+
this.exceptionDataIngestedInGB = undefined;
|
|
57
70
|
this.totalCostInUSD = undefined;
|
|
58
71
|
this.isReportedToBillingProvider = undefined;
|
|
59
72
|
this.service = undefined;
|
|
@@ -202,6 +215,27 @@ __decorate([
|
|
|
202
215
|
}),
|
|
203
216
|
__metadata("design:type", Decimal_1.default)
|
|
204
217
|
], TelemetryUsageBilling.prototype, "dataIngestedInGB", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
(0, ColumnAccessControl_1.default)({
|
|
220
|
+
create: [],
|
|
221
|
+
read: [...USAGE_READ_PERMISSIONS],
|
|
222
|
+
update: [],
|
|
223
|
+
}),
|
|
224
|
+
(0, TableColumn_1.default)({
|
|
225
|
+
required: false,
|
|
226
|
+
type: TableColumnType_1.default.Number,
|
|
227
|
+
canReadOnRelationQuery: true,
|
|
228
|
+
title: "Exceptions Ingested (in GB)",
|
|
229
|
+
description: "How much of the data ingested was exceptions. Set on a Traces row, which is billed for its spans and exceptions together; empty on a row counted before exceptions were counted apart.",
|
|
230
|
+
example: 2.5,
|
|
231
|
+
}),
|
|
232
|
+
(0, typeorm_1.Column)({
|
|
233
|
+
nullable: true,
|
|
234
|
+
type: ColumnType_1.default.Decimal,
|
|
235
|
+
transformer: Decimal_1.default.getDatabaseTransformer(),
|
|
236
|
+
}),
|
|
237
|
+
__metadata("design:type", Decimal_1.default)
|
|
238
|
+
], TelemetryUsageBilling.prototype, "exceptionDataIngestedInGB", void 0);
|
|
205
239
|
__decorate([
|
|
206
240
|
(0, ColumnAccessControl_1.default)({
|
|
207
241
|
create: [],
|
|
@@ -85,6 +85,7 @@ export declare const AI_ACTION_PLURAL_LINES: {
|
|
|
85
85
|
codeFilesReadOnAnotherBranch: PluralTemplate;
|
|
86
86
|
codeFilesNotRead: PluralTemplate;
|
|
87
87
|
codeFilesReadInPart: PluralTemplate;
|
|
88
|
+
codeFilesReadInEarlierAnswer: PluralTemplate;
|
|
88
89
|
codeFilesNotChecked: PluralTemplate;
|
|
89
90
|
codeFilesValuesHidden: PluralTemplate;
|
|
90
91
|
moreFiles: PluralTemplate;
|
|
@@ -85,6 +85,7 @@ export declare const AI_ACTION_PLURAL_LINES: {
|
|
|
85
85
|
codeFilesReadOnAnotherBranch: PluralTemplate;
|
|
86
86
|
codeFilesNotRead: PluralTemplate;
|
|
87
87
|
codeFilesReadInPart: PluralTemplate;
|
|
88
|
+
codeFilesReadInEarlierAnswer: PluralTemplate;
|
|
88
89
|
codeFilesNotChecked: PluralTemplate;
|
|
89
90
|
codeFilesValuesHidden: PluralTemplate;
|
|
90
91
|
moreFiles: PluralTemplate;
|
|
@@ -128,10 +128,11 @@ exports.AI_ACTION_LINES = {
|
|
|
128
128
|
* read_code_file showed it, so a commit - on a branch, or a pull request's
|
|
129
129
|
* - would undo what was pushed to a file since, or replace a file Ask AI
|
|
130
130
|
* read on another branch, or never read, or read only part of (issue
|
|
131
|
-
* #6330)
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* (moreFiles). {{count}} is how many
|
|
131
|
+
* #6330), or read only in an earlier answer (issue #6365) - or write
|
|
132
|
+
* placeholders where values were hidden from Ask AI (issue #6364). Each
|
|
133
|
+
* names the files, as {{files}}: a list of AI_ACTION_CODE_FILE, the first
|
|
134
|
+
* few written out and the rest counted (moreFiles). {{count}} is how many
|
|
135
|
+
* files it names.
|
|
135
136
|
*/
|
|
136
137
|
exports.AI_ACTION_PLURAL_LINES = {
|
|
137
138
|
// Pushed to, deleted or renamed away on the branch after Ask AI read it there.
|
|
@@ -162,6 +163,15 @@ exports.AI_ACTION_PLURAL_LINES = {
|
|
|
162
163
|
one: (0, Translator_1.translationKey)("Ask AI read only part of this file, and its version replaces all of it: {{files}}."),
|
|
163
164
|
other: (0, Translator_1.translationKey)("Ask AI read only part of these {{count}} files, and its versions replace all of them: {{files}}."),
|
|
164
165
|
},
|
|
166
|
+
/*
|
|
167
|
+
* Ask AI saw the version on the branch only in an earlier answer (issue
|
|
168
|
+
* #6365): a new turn replays the answers, never the files they read, so
|
|
169
|
+
* it writes the file whole from memory.
|
|
170
|
+
*/
|
|
171
|
+
codeFilesReadInEarlierAnswer: {
|
|
172
|
+
one: (0, Translator_1.translationKey)("Ask AI read this file in an earlier answer and no longer has its text, and its version replaces all of it: {{files}}."),
|
|
173
|
+
other: (0, Translator_1.translationKey)("Ask AI read these {{count}} files in an earlier answer and no longer has their text, and its versions replace all of them: {{files}}."),
|
|
174
|
+
},
|
|
165
175
|
// The branch could not be read: never said to be unchanged.
|
|
166
176
|
codeFilesNotChecked: {
|
|
167
177
|
one: (0, Translator_1.translationKey)("OneUptime could not check this file on {{branch}} against what Ask AI read: {{files}}."),
|
|
@@ -195,6 +205,7 @@ exports.AI_ACTION_CODE_CHANGE_LINES = [
|
|
|
195
205
|
exports.AI_ACTION_PLURAL_LINES.codeFilesReadOnAnotherBranch.other,
|
|
196
206
|
exports.AI_ACTION_PLURAL_LINES.codeFilesNotRead.other,
|
|
197
207
|
exports.AI_ACTION_PLURAL_LINES.codeFilesReadInPart.other,
|
|
208
|
+
exports.AI_ACTION_PLURAL_LINES.codeFilesReadInEarlierAnswer.other,
|
|
198
209
|
exports.AI_ACTION_PLURAL_LINES.codeFilesNotChecked.other,
|
|
199
210
|
exports.AI_ACTION_PLURAL_LINES.codeFilesValuesHidden.other,
|
|
200
211
|
];
|
|
@@ -21,6 +21,7 @@ export interface AIChatRecordSeen {
|
|
|
21
21
|
parts: Array<AIChatRecordPartSeen>;
|
|
22
22
|
isPartial?: boolean | undefined;
|
|
23
23
|
linesShown?: AIChatLinesShown | undefined;
|
|
24
|
+
fromEarlierAnswer?: boolean | undefined;
|
|
24
25
|
}
|
|
25
26
|
export interface AIChatRecordKnown {
|
|
26
27
|
revision: number;
|
|
@@ -36,6 +37,8 @@ type ReadLinesShownFunction = (value: unknown) => AIChatLinesShown | null;
|
|
|
36
37
|
export declare const readAIChatLinesShown: ReadLinesShownFunction;
|
|
37
38
|
type ReadRecordSeenFunction = (value: unknown) => AIChatRecordSeen | null;
|
|
38
39
|
export declare const readAIChatRecordSeen: ReadRecordSeenFunction;
|
|
40
|
+
type FromEarlierAnswersFunction = (records: ReadonlyArray<unknown> | null | undefined) => Array<AIChatRecordSeen>;
|
|
41
|
+
export declare const markAIChatRecordsFromEarlierAnswers: FromEarlierAnswersFunction;
|
|
39
42
|
type ListRecordsSeenFunction = (value: unknown) => Array<unknown>;
|
|
40
43
|
export declare const listAIChatRecordsSeen: ListRecordsSeenFunction;
|
|
41
44
|
type GetRecordKnownFunction = (data: {
|
|
@@ -21,6 +21,7 @@ export interface AIChatRecordSeen {
|
|
|
21
21
|
parts: Array<AIChatRecordPartSeen>;
|
|
22
22
|
isPartial?: boolean | undefined;
|
|
23
23
|
linesShown?: AIChatLinesShown | undefined;
|
|
24
|
+
fromEarlierAnswer?: boolean | undefined;
|
|
24
25
|
}
|
|
25
26
|
export interface AIChatRecordKnown {
|
|
26
27
|
revision: number;
|
|
@@ -36,6 +37,8 @@ type ReadLinesShownFunction = (value: unknown) => AIChatLinesShown | null;
|
|
|
36
37
|
export declare const readAIChatLinesShown: ReadLinesShownFunction;
|
|
37
38
|
type ReadRecordSeenFunction = (value: unknown) => AIChatRecordSeen | null;
|
|
38
39
|
export declare const readAIChatRecordSeen: ReadRecordSeenFunction;
|
|
40
|
+
type FromEarlierAnswersFunction = (records: ReadonlyArray<unknown> | null | undefined) => Array<AIChatRecordSeen>;
|
|
41
|
+
export declare const markAIChatRecordsFromEarlierAnswers: FromEarlierAnswersFunction;
|
|
39
42
|
type ListRecordsSeenFunction = (value: unknown) => Array<unknown>;
|
|
40
43
|
export declare const listAIChatRecordsSeen: ListRecordsSeenFunction;
|
|
41
44
|
type GetRecordKnownFunction = (data: {
|
|
@@ -37,9 +37,16 @@
|
|
|
37
37
|
* commit writes it whole, so a version Ask AI saw only part of is one it
|
|
38
38
|
* cannot write whole without dropping the lines it never saw. Reads of one
|
|
39
39
|
* version add up.
|
|
40
|
+
*
|
|
41
|
+
* But only the results of this turn are in front of the model (issue
|
|
42
|
+
* #6365): a new turn replays the earlier turns' questions and answers,
|
|
43
|
+
* never the files their tools read. So the chat runner marks each record of
|
|
44
|
+
* an earlier turn as it hands what the model saw to a prepare
|
|
45
|
+
* (fromEarlierAnswer): its version still says what Ask AI saw - a push
|
|
46
|
+
* since is still a push since - but its lines are not in hand.
|
|
40
47
|
*/
|
|
41
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.getLatestAIChatRecordsSeen = exports.getAIChatRecordKnown = exports.listAIChatRecordsSeen = exports.readAIChatRecordSeen = exports.readAIChatLinesShown = exports.readAIChatLineRanges = exports.MAX_LINE_RANGES = exports.MAX_RECORDS_SEEN_PER_RESULT = exports.MAX_RECORD_ID_LENGTHS = exports.MAX_RECORD_PARTS_SEEN = exports.AIChatRecordSeenType = void 0;
|
|
49
|
+
exports.getLatestAIChatRecordsSeen = exports.getAIChatRecordKnown = exports.listAIChatRecordsSeen = exports.markAIChatRecordsFromEarlierAnswers = exports.readAIChatRecordSeen = exports.readAIChatLinesShown = exports.readAIChatLineRanges = exports.MAX_LINE_RANGES = exports.MAX_RECORDS_SEEN_PER_RESULT = exports.MAX_RECORD_ID_LENGTHS = exports.MAX_RECORD_PARTS_SEEN = exports.AIChatRecordSeenType = void 0;
|
|
43
50
|
// The kinds of record a result can show the model, as the tool that changes them names them.
|
|
44
51
|
var AIChatRecordSeenType;
|
|
45
52
|
(function (AIChatRecordSeenType) {
|
|
@@ -144,6 +151,7 @@ const readAIChatRecordSeen = (value) => {
|
|
|
144
151
|
const parts = value["parts"];
|
|
145
152
|
const isPartial = value["isPartial"];
|
|
146
153
|
const linesShown = value["linesShown"];
|
|
154
|
+
const fromEarlierAnswer = value["fromEarlierAnswer"];
|
|
147
155
|
if (!Object.values(AIChatRecordSeenType).includes(recordType) ||
|
|
148
156
|
typeof recordId !== "string" ||
|
|
149
157
|
recordId.length === 0 ||
|
|
@@ -154,7 +162,8 @@ const readAIChatRecordSeen = (value) => {
|
|
|
154
162
|
revision < 0 ||
|
|
155
163
|
!Array.isArray(parts) ||
|
|
156
164
|
parts.length > exports.MAX_RECORD_PARTS_SEEN ||
|
|
157
|
-
(isPartial !== undefined && typeof isPartial !== "boolean")
|
|
165
|
+
(isPartial !== undefined && typeof isPartial !== "boolean") ||
|
|
166
|
+
(fromEarlierAnswer !== undefined && typeof fromEarlierAnswer !== "boolean")) {
|
|
158
167
|
return null;
|
|
159
168
|
}
|
|
160
169
|
/*
|
|
@@ -194,9 +203,25 @@ const readAIChatRecordSeen = (value) => {
|
|
|
194
203
|
seen.add(id);
|
|
195
204
|
read.push({ id: id, fingerprint: fingerprint });
|
|
196
205
|
}
|
|
197
|
-
return Object.assign(Object.assign({ recordType: recordType, recordId: recordId, revision: revision, parts: read }, (isPartial === true ? { isPartial: true } : {})), (lines ? { linesShown: lines } : {}));
|
|
206
|
+
return Object.assign(Object.assign(Object.assign({ recordType: recordType, recordId: recordId, revision: revision, parts: read }, (isPartial === true ? { isPartial: true } : {})), (lines ? { linesShown: lines } : {})), (fromEarlierAnswer === true ? { fromEarlierAnswer: true } : {}));
|
|
198
207
|
};
|
|
199
208
|
exports.readAIChatRecordSeen = readAIChatRecordSeen;
|
|
209
|
+
/*
|
|
210
|
+
* The records of the turns before this one, as a prepare is handed them
|
|
211
|
+
* (issue #6365): each well-formed one marked as from an earlier answer,
|
|
212
|
+
* whose text the model no longer has. Stored records are never marked.
|
|
213
|
+
*/
|
|
214
|
+
const markAIChatRecordsFromEarlierAnswers = (records) => {
|
|
215
|
+
const marked = [];
|
|
216
|
+
for (const value of records || []) {
|
|
217
|
+
const record = (0, exports.readAIChatRecordSeen)(value);
|
|
218
|
+
if (record) {
|
|
219
|
+
marked.push(Object.assign(Object.assign({}, record), { fromEarlierAnswer: true }));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return marked;
|
|
223
|
+
};
|
|
224
|
+
exports.markAIChatRecordsFromEarlierAnswers = markAIChatRecordsFromEarlierAnswers;
|
|
200
225
|
/*
|
|
201
226
|
* What tells one record from another: a workflow by its ID as the database
|
|
202
227
|
* writes it, whichever case a caller spelt it in; a repository's file
|
|
@@ -7,6 +7,7 @@ export const MAX_RECORD_PARTS_SEEN = commonJsModule.MAX_RECORD_PARTS_SEEN;
|
|
|
7
7
|
export const getAIChatRecordKnown = commonJsModule.getAIChatRecordKnown;
|
|
8
8
|
export const getLatestAIChatRecordsSeen = commonJsModule.getLatestAIChatRecordsSeen;
|
|
9
9
|
export const listAIChatRecordsSeen = commonJsModule.listAIChatRecordsSeen;
|
|
10
|
+
export const markAIChatRecordsFromEarlierAnswers = commonJsModule.markAIChatRecordsFromEarlierAnswers;
|
|
10
11
|
export const readAIChatLineRanges = commonJsModule.readAIChatLineRanges;
|
|
11
12
|
export const readAIChatLinesShown = commonJsModule.readAIChatLinesShown;
|
|
12
13
|
export const readAIChatRecordSeen = commonJsModule.readAIChatRecordSeen;
|
|
@@ -27,6 +27,7 @@ declare enum AnalyticsTableName {
|
|
|
27
27
|
RumSession = "RumSessionV1",
|
|
28
28
|
RumSessionChunk = "RumSessionChunkV1",
|
|
29
29
|
RumProductAnalyticsSession = "RumProductAnalyticsSessionV1",
|
|
30
|
-
RumProductAnalyticsUser = "RumProductAnalyticsUserV1"
|
|
30
|
+
RumProductAnalyticsUser = "RumProductAnalyticsUserV1",
|
|
31
|
+
RumProductAnalyticsEvent = "RumProductAnalyticsEventV1"
|
|
31
32
|
}
|
|
32
33
|
export default AnalyticsTableName;
|
|
@@ -27,6 +27,7 @@ declare enum AnalyticsTableName {
|
|
|
27
27
|
RumSession = "RumSessionV1",
|
|
28
28
|
RumSessionChunk = "RumSessionChunkV1",
|
|
29
29
|
RumProductAnalyticsSession = "RumProductAnalyticsSessionV1",
|
|
30
|
-
RumProductAnalyticsUser = "RumProductAnalyticsUserV1"
|
|
30
|
+
RumProductAnalyticsUser = "RumProductAnalyticsUserV1",
|
|
31
|
+
RumProductAnalyticsEvent = "RumProductAnalyticsEventV1"
|
|
31
32
|
}
|
|
32
33
|
export default AnalyticsTableName;
|
|
@@ -124,5 +124,12 @@ var AnalyticsTableName;
|
|
|
124
124
|
*/
|
|
125
125
|
AnalyticsTableName["RumProductAnalyticsSession"] = "RumProductAnalyticsSessionV1";
|
|
126
126
|
AnalyticsTableName["RumProductAnalyticsUser"] = "RumProductAnalyticsUserV1";
|
|
127
|
+
/*
|
|
128
|
+
* Product analytics events (issue #6444, part two): one row per event the
|
|
129
|
+
* RUM recorders send from every session, recorded or not - a session
|
|
130
|
+
* starting, a page viewed, a track() call - kept for the same year and a
|
|
131
|
+
* month. A plain MergeTree written by the product analytics ingest worker.
|
|
132
|
+
*/
|
|
133
|
+
AnalyticsTableName["RumProductAnalyticsEvent"] = "RumProductAnalyticsEventV1";
|
|
127
134
|
})(AnalyticsTableName || (AnalyticsTableName = {}));
|
|
128
135
|
exports.default = AnalyticsTableName;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const AUDIT_LOG_DEFAULT_RETENTION_IN_DAYS: number;
|
|
2
|
+
export declare const AUDIT_LOG_MIN_RETENTION_IN_DAYS: number;
|
|
3
|
+
export declare const AUDIT_LOG_MAX_RETENTION_IN_DAYS: number;
|
|
4
|
+
export declare const AUDIT_LOG_RETENTION_ERROR: string;
|
|
5
|
+
export declare function readAuditLogRetentionInDays(value: unknown): number;
|
|
6
|
+
export declare function getAuditLogRetentionError(value: unknown): string | null;
|
|
7
|
+
export declare function getAuditLogRetentionDate(data: {
|
|
8
|
+
recordedAt: Date;
|
|
9
|
+
retentionInDays: unknown;
|
|
10
|
+
}): Date;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const AUDIT_LOG_DEFAULT_RETENTION_IN_DAYS: number;
|
|
2
|
+
export declare const AUDIT_LOG_MIN_RETENTION_IN_DAYS: number;
|
|
3
|
+
export declare const AUDIT_LOG_MAX_RETENTION_IN_DAYS: number;
|
|
4
|
+
export declare const AUDIT_LOG_RETENTION_ERROR: string;
|
|
5
|
+
export declare function readAuditLogRetentionInDays(value: unknown): number;
|
|
6
|
+
export declare function getAuditLogRetentionError(value: unknown): string | null;
|
|
7
|
+
export declare function getAuditLogRetentionDate(data: {
|
|
8
|
+
recordedAt: Date;
|
|
9
|
+
retentionInDays: unknown;
|
|
10
|
+
}): Date;
|
|
@@ -0,0 +1,91 @@
|
|
|
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.AUDIT_LOG_RETENTION_ERROR = exports.AUDIT_LOG_MAX_RETENTION_IN_DAYS = exports.AUDIT_LOG_MIN_RETENTION_IN_DAYS = exports.AUDIT_LOG_DEFAULT_RETENTION_IN_DAYS = void 0;
|
|
7
|
+
exports.readAuditLogRetentionInDays = readAuditLogRetentionInDays;
|
|
8
|
+
exports.getAuditLogRetentionError = getAuditLogRetentionError;
|
|
9
|
+
exports.getAuditLogRetentionDate = getAuditLogRetentionDate;
|
|
10
|
+
const Date_1 = __importDefault(require("../Date"));
|
|
11
|
+
const NumericColumnValue_1 = require("../Database/NumericColumnValue");
|
|
12
|
+
/*
|
|
13
|
+
* HOW LONG THE AUDIT LOG KEEPS AN ENTRY: ONE RULE FOR EVERY READER.
|
|
14
|
+
*
|
|
15
|
+
* A project keeps each audit log entry for its Retention (days)
|
|
16
|
+
* (Project.auditLogsRetentionInDays): a whole number of days from 7 to 180,
|
|
17
|
+
* and 7 until someone sets another. The recorder stamps each entry with it
|
|
18
|
+
* as it records it - the entry's retentionDate, which the AuditLog table's
|
|
19
|
+
* TTL deletes it on - and a failing audit log export reckons with it when
|
|
20
|
+
* the entries it has not sent are deleted, to warn a day before.
|
|
21
|
+
*
|
|
22
|
+
* The two used to work it out each their own way, and the server took any
|
|
23
|
+
* value: the settings form checked 7 to 180, but the API took -3, 0 or 3.
|
|
24
|
+
* For -3 the recorder kept entries a day while the export reckoned a week,
|
|
25
|
+
* so its "will start losing entries" email came six days after they were
|
|
26
|
+
* gone (#6383). Everything that reads the setting now reads it here:
|
|
27
|
+
*
|
|
28
|
+
* - readAuditLogRetentionInDays: the retention an entry is recorded with.
|
|
29
|
+
* Every value reads as one, so a value stored before the server checked
|
|
30
|
+
* it never breaks a read: one that is not a number of days (none, NaN,
|
|
31
|
+
* text) as the default, and a number as the nearest whole number of days
|
|
32
|
+
* from 7 to 180 - -3, 0 and 3 as 7, 500 as 180;
|
|
33
|
+
* - getAuditLogRetentionDate: when an entry recorded at a moment is
|
|
34
|
+
* deleted, that many calendar days later by the server's clock
|
|
35
|
+
* (OneUptimeDate.addRemoveDays) - the retentionDate the recorder stamps
|
|
36
|
+
* and the moment a failing export reckons;
|
|
37
|
+
* - getAuditLogRetentionError: why a value cannot be saved, which
|
|
38
|
+
* ProjectService refuses a create or an update with. The settings form
|
|
39
|
+
* checks the same range in the browser.
|
|
40
|
+
*
|
|
41
|
+
* Why 7 to 180, and not 1: it is what the settings form, the column's
|
|
42
|
+
* description, the API reference and the docs (NIST 800-53 AU-11 among them)
|
|
43
|
+
* have always said. A week is the least that keeps an audit log useful: an
|
|
44
|
+
* administrator cannot shrink it to hours to hide what they do next, and a
|
|
45
|
+
* failing export has days between "is failing" and "will start losing
|
|
46
|
+
* entries". A stored value under 7 keeps new entries for 7 days, and one
|
|
47
|
+
* over 180 for 180; the entries recorded so far keep their dates.
|
|
48
|
+
*/
|
|
49
|
+
// What a project keeps its entries for until someone sets another retention.
|
|
50
|
+
exports.AUDIT_LOG_DEFAULT_RETENTION_IN_DAYS = 7;
|
|
51
|
+
// The shortest and longest retention a project can have.
|
|
52
|
+
exports.AUDIT_LOG_MIN_RETENTION_IN_DAYS = 7;
|
|
53
|
+
exports.AUDIT_LOG_MAX_RETENTION_IN_DAYS = 180;
|
|
54
|
+
// What the server answers a value it will not save.
|
|
55
|
+
exports.AUDIT_LOG_RETENTION_ERROR = `Audit log retention must be a whole number of days from ${exports.AUDIT_LOG_MIN_RETENTION_IN_DAYS} to ${exports.AUDIT_LOG_MAX_RETENTION_IN_DAYS}.`;
|
|
56
|
+
/*
|
|
57
|
+
* The retention, in whole days, an entry is recorded with for a stored or
|
|
58
|
+
* written value. A number written as text ("30", as a form sends it) reads
|
|
59
|
+
* as the number it is (coerceNumericColumnValue).
|
|
60
|
+
*/
|
|
61
|
+
function readAuditLogRetentionInDays(value) {
|
|
62
|
+
const days = (0, NumericColumnValue_1.coerceNumericColumnValue)(value);
|
|
63
|
+
if (typeof days !== "number" || !Number.isFinite(days)) {
|
|
64
|
+
return exports.AUDIT_LOG_DEFAULT_RETENTION_IN_DAYS;
|
|
65
|
+
}
|
|
66
|
+
return Math.min(exports.AUDIT_LOG_MAX_RETENTION_IN_DAYS, Math.max(exports.AUDIT_LOG_MIN_RETENTION_IN_DAYS, Math.round(days)));
|
|
67
|
+
}
|
|
68
|
+
/*
|
|
69
|
+
* Why a retention someone saves cannot be kept - not a whole number of days,
|
|
70
|
+
* or outside 7 to 180 - or null when it can. A number written as text is
|
|
71
|
+
* judged as the number it is.
|
|
72
|
+
*/
|
|
73
|
+
function getAuditLogRetentionError(value) {
|
|
74
|
+
const days = (0, NumericColumnValue_1.coerceNumericColumnValue)(value);
|
|
75
|
+
if (typeof days === "number" &&
|
|
76
|
+
Number.isInteger(days) &&
|
|
77
|
+
days >= exports.AUDIT_LOG_MIN_RETENTION_IN_DAYS &&
|
|
78
|
+
days <= exports.AUDIT_LOG_MAX_RETENTION_IN_DAYS) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return exports.AUDIT_LOG_RETENTION_ERROR;
|
|
82
|
+
}
|
|
83
|
+
/*
|
|
84
|
+
* When the audit log deletes an entry recorded at `recordedAt` by a project
|
|
85
|
+
* whose retention is `retentionInDays`: that many calendar days later, by
|
|
86
|
+
* the server's own clock, so across a change of the clocks the day in
|
|
87
|
+
* between is 23 or 25 hours long, as the recorder has always stamped it.
|
|
88
|
+
*/
|
|
89
|
+
function getAuditLogRetentionDate(data) {
|
|
90
|
+
return Date_1.default.addRemoveDays(new Date(data.recordedAt), readAuditLogRetentionInDays(data.retentionInDays));
|
|
91
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import commonJsModule from "./AuditLogRetention.js";
|
|
2
|
+
export const AUDIT_LOG_DEFAULT_RETENTION_IN_DAYS = commonJsModule.AUDIT_LOG_DEFAULT_RETENTION_IN_DAYS;
|
|
3
|
+
export const AUDIT_LOG_MAX_RETENTION_IN_DAYS = commonJsModule.AUDIT_LOG_MAX_RETENTION_IN_DAYS;
|
|
4
|
+
export const AUDIT_LOG_MIN_RETENTION_IN_DAYS = commonJsModule.AUDIT_LOG_MIN_RETENTION_IN_DAYS;
|
|
5
|
+
export const AUDIT_LOG_RETENTION_ERROR = commonJsModule.AUDIT_LOG_RETENTION_ERROR;
|
|
6
|
+
export const getAuditLogRetentionDate = commonJsModule.getAuditLogRetentionDate;
|
|
7
|
+
export const getAuditLogRetentionError = commonJsModule.getAuditLogRetentionError;
|
|
8
|
+
export const readAuditLogRetentionInDays = commonJsModule.readAuditLogRetentionInDays;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TwilioMessageKind } from "../../Utils/Project/TwilioAccount.mjs";
|
|
2
|
+
export declare const TWILIO_MESSAGE_KINDS: ReadonlyArray<TwilioMessageKind>;
|
|
3
|
+
export interface TwilioConfigDefaultFlags {
|
|
4
|
+
isProjectDefault: boolean;
|
|
5
|
+
isProjectDefaultForSms: boolean;
|
|
6
|
+
isProjectDefaultForCalls: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type TwilioConfigDefaultColumn = "isProjectDefaultForSms" | "isProjectDefaultForCalls";
|
|
9
|
+
export interface ProjectTwilioConfigDefaultRow {
|
|
10
|
+
id: string;
|
|
11
|
+
use: unknown;
|
|
12
|
+
isProjectDefault?: unknown;
|
|
13
|
+
isProjectDefaultForSms?: unknown;
|
|
14
|
+
isProjectDefaultForCalls?: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface TwilioConfigDefaultChange {
|
|
17
|
+
id: string;
|
|
18
|
+
flags: TwilioConfigDefaultFlags;
|
|
19
|
+
}
|
|
20
|
+
export default class TwilioConfigDefaults {
|
|
21
|
+
static getDefaultColumn(kind: TwilioMessageKind): TwilioConfigDefaultColumn;
|
|
22
|
+
static isUsedFor(use: unknown, kind: TwilioMessageKind): boolean;
|
|
23
|
+
static getKindsUsedFor(use: unknown): Array<TwilioMessageKind>;
|
|
24
|
+
static isDefaultFor(config: Partial<Record<TwilioConfigDefaultColumn, unknown>>, kind: TwilioMessageKind): boolean;
|
|
25
|
+
static getDefaultKinds(config: Partial<Record<TwilioConfigDefaultColumn, unknown>>): Array<TwilioMessageKind>;
|
|
26
|
+
static getKindsToTake(config: {
|
|
27
|
+
use: unknown;
|
|
28
|
+
} & Partial<Record<TwilioConfigDefaultColumn, unknown>>): Array<TwilioMessageKind>;
|
|
29
|
+
static getProjectDefaults(data: {
|
|
30
|
+
configs: ReadonlyArray<ProjectTwilioConfigDefaultRow>;
|
|
31
|
+
madeDefaultIds?: ReadonlyArray<string> | undefined;
|
|
32
|
+
}): Map<string, TwilioConfigDefaultFlags>;
|
|
33
|
+
static getProjectDefaultChanges(data: {
|
|
34
|
+
configs: ReadonlyArray<ProjectTwilioConfigDefaultRow>;
|
|
35
|
+
madeDefaultIds?: ReadonlyArray<string> | undefined;
|
|
36
|
+
}): Array<TwilioConfigDefaultChange>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TwilioMessageKind } from "../../Utils/Project/TwilioAccount";
|
|
2
|
+
export declare const TWILIO_MESSAGE_KINDS: ReadonlyArray<TwilioMessageKind>;
|
|
3
|
+
export interface TwilioConfigDefaultFlags {
|
|
4
|
+
isProjectDefault: boolean;
|
|
5
|
+
isProjectDefaultForSms: boolean;
|
|
6
|
+
isProjectDefaultForCalls: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type TwilioConfigDefaultColumn = "isProjectDefaultForSms" | "isProjectDefaultForCalls";
|
|
9
|
+
export interface ProjectTwilioConfigDefaultRow {
|
|
10
|
+
id: string;
|
|
11
|
+
use: unknown;
|
|
12
|
+
isProjectDefault?: unknown;
|
|
13
|
+
isProjectDefaultForSms?: unknown;
|
|
14
|
+
isProjectDefaultForCalls?: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface TwilioConfigDefaultChange {
|
|
17
|
+
id: string;
|
|
18
|
+
flags: TwilioConfigDefaultFlags;
|
|
19
|
+
}
|
|
20
|
+
export default class TwilioConfigDefaults {
|
|
21
|
+
static getDefaultColumn(kind: TwilioMessageKind): TwilioConfigDefaultColumn;
|
|
22
|
+
static isUsedFor(use: unknown, kind: TwilioMessageKind): boolean;
|
|
23
|
+
static getKindsUsedFor(use: unknown): Array<TwilioMessageKind>;
|
|
24
|
+
static isDefaultFor(config: Partial<Record<TwilioConfigDefaultColumn, unknown>>, kind: TwilioMessageKind): boolean;
|
|
25
|
+
static getDefaultKinds(config: Partial<Record<TwilioConfigDefaultColumn, unknown>>): Array<TwilioMessageKind>;
|
|
26
|
+
static getKindsToTake(config: {
|
|
27
|
+
use: unknown;
|
|
28
|
+
} & Partial<Record<TwilioConfigDefaultColumn, unknown>>): Array<TwilioMessageKind>;
|
|
29
|
+
static getProjectDefaults(data: {
|
|
30
|
+
configs: ReadonlyArray<ProjectTwilioConfigDefaultRow>;
|
|
31
|
+
madeDefaultIds?: ReadonlyArray<string> | undefined;
|
|
32
|
+
}): Map<string, TwilioConfigDefaultFlags>;
|
|
33
|
+
static getProjectDefaultChanges(data: {
|
|
34
|
+
configs: ReadonlyArray<ProjectTwilioConfigDefaultRow>;
|
|
35
|
+
madeDefaultIds?: ReadonlyArray<string> | undefined;
|
|
36
|
+
}): Array<TwilioConfigDefaultChange>;
|
|
37
|
+
}
|