@oneuptime/common 12.0.17 → 12.0.19
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/EnterpriseLicense.ts +23 -0
- package/Models/DatabaseModels/Index.ts +4 -2
- package/Models/DatabaseModels/Monitor.ts +39 -9
- package/Models/DatabaseModels/UserMicrosoftTeams.ts +344 -0
- package/Models/DatabaseModels/UserNotificationRule.ts +144 -8
- package/Models/DatabaseModels/UserNotificationSetting.ts +34 -0
- package/Models/DatabaseModels/UserOnCallLogTimeline.ts +95 -0
- package/Models/DatabaseModels/UserSlack.ts +341 -0
- package/Models/DatabaseModels/WorkspaceProjectAuthToken.ts +9 -0
- package/Server/API/UserMicrosoftTeamsAPI.ts +127 -0
- package/Server/API/UserSlackAPI.ts +125 -0
- package/Server/EnvironmentConfig.ts +12 -107
- package/Server/Infrastructure/Postgres/SchemaMigrations/1788700000000-RemoveMarketingConversionUploadState.ts +33 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1788800000000-DropMarketingConversionAddEnterpriseLicenseEmail.ts +51 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1788900000000-RedactStoredMonitorIngestSecrets.ts +117 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1789000000000-AddUserSlackAndMicrosoftTeams.ts +197 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Infrastructure/Queue.ts +7 -0
- package/Server/Services/BillingService.ts +8 -0
- package/Server/Services/EnterpriseLicenseService.ts +60 -0
- package/Server/Services/Index.ts +6 -2
- package/Server/Services/LlmLogService.ts +25 -9
- package/Server/Services/OnCallReadinessService.ts +86 -2
- package/Server/Services/ProjectService.ts +67 -0
- package/Server/Services/UserMicrosoftTeamsService.ts +208 -0
- package/Server/Services/UserNotificationMethodAdminService.ts +167 -5
- package/Server/Services/UserNotificationRuleAdminService.ts +40 -6
- package/Server/Services/UserNotificationRuleService.ts +589 -11
- package/Server/Services/UserNotificationSettingService.ts +138 -0
- package/Server/Services/UserService.ts +28 -0
- package/Server/Services/UserSlackService.ts +218 -0
- package/Server/Services/WorkspaceProjectAuthTokenService.ts +67 -1
- package/Server/Services/WorkspaceUserAuthTokenService.ts +73 -0
- package/Server/Services/WorkspaceUserNotificationService.ts +190 -0
- package/Server/Utils/Marketing/MarketingEventUtil.ts +145 -0
- package/Server/Utils/Marketing/MarketingEventWebhook.ts +114 -0
- package/Server/Utils/Monitor/MonitorLogUtil.ts +14 -1
- package/Server/Utils/Monitor/MonitorPayloadRedaction.ts +321 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +191 -4
- package/Tests/App/Dashboard/AdminNotificationRulesPage.test.tsx +22 -14
- package/Tests/App/Dashboard/AdminUserNotificationMethodsPage.test.tsx +22 -11
- package/Tests/App/Dashboard/OnCallPreventionGuards.test.tsx +37 -1
- package/Tests/App/Dashboard/OnCallRulesTable.test.tsx +18 -10
- package/Tests/App/Dashboard/PayAsYouGoNotices.test.tsx +17 -0
- package/Tests/Models/DatabaseModels/DomainRoleTierCoverage.test.ts +27 -1
- package/Tests/Models/DatabaseModels/MonitorSecretKeyColumnAccessControl.test.ts +214 -0
- package/Tests/Server/API/OnCallReadinessAPI.test.ts +145 -26
- package/Tests/Server/API/UserNotificationMethodAdminAPI.test.ts +2 -2
- package/Tests/Server/Services/AIServiceDailyBudget.test.ts +11 -1
- package/Tests/Server/Services/AdminRuleEditGuards.test.ts +22 -8
- package/Tests/Server/Services/BillingService.test.ts +20 -0
- package/Tests/Server/Services/DeliverNotificationForRuleExtraction.test.ts +18 -2
- package/Tests/Server/Services/EpisodeRuleSeverityRepair.test.ts +5 -1
- package/Tests/Server/Services/LlmLogServiceTokenAggregateParams.test.ts +640 -0
- package/Tests/Server/Services/NotificationChannelEventCoverage.test.ts +246 -22
- package/Tests/Server/Services/NotificationDeletionImpact.test.ts +136 -8
- package/Tests/Server/Services/OnCallNotificationFallback.test.ts +191 -8
- package/Tests/Server/Services/OnCallReadinessService.test.ts +343 -18
- package/Tests/Server/Services/SeverityRuleBackfill.test.ts +5 -1
- package/Tests/Server/Services/UserMicrosoftTeamsService.test.ts +343 -0
- package/Tests/Server/Services/UserNotificationMethodAdminService.test.ts +209 -8
- package/Tests/Server/Services/UserNotificationRuleAdminGuards.test.ts +22 -6
- package/Tests/Server/Services/UserNotificationRuleDefaultCreation.test.ts +12 -6
- package/Tests/Server/Services/UserNotificationRuleExecuteItem.test.ts +37 -3
- package/Tests/Server/Services/UserNotificationRuleWorkspaceDelivery.test.ts +669 -0
- package/Tests/Server/Services/UserNotificationSettingWorkspaceChannels.test.ts +410 -0
- package/Tests/Server/Services/UserSlackService.test.ts +407 -0
- package/Tests/Server/Services/WorkspaceProjectAuthTokenDisconnectCascade.test.ts +224 -0
- package/Tests/Server/Services/WorkspaceUserAuthTokenNotificationMethodCascade.test.ts +189 -0
- package/Tests/Server/Services/WorkspaceUserNotificationService.test.ts +496 -0
- package/Tests/Server/Types/Database/Permissions/AdminNotificationRuleAccess.test.ts +30 -17
- package/Tests/Server/Types/Database/Permissions/CreateOwnershipScoping.test.ts +8 -3
- package/Tests/Server/Types/Database/Permissions/OwnerOnlyColumns.test.ts +72 -3
- package/Tests/Server/Types/Database/Permissions/UserNotificationRuleScoping.test.ts +22 -18
- package/Tests/Server/Types/Database/Permissions/WorkspaceMethodStampedColumnCreate.test.ts +178 -0
- package/Tests/Server/Utils/Marketing/MarketingEventUtil.test.ts +259 -0
- package/Tests/Server/Utils/Marketing/MarketingEventWebhook.test.ts +257 -0
- package/Tests/Server/Utils/Monitor/MonitorLogUtilRedaction.test.ts +300 -0
- package/Tests/Server/Utils/Monitor/MonitorPayloadRedaction.test.ts +381 -0
- package/Tests/Server/Utils/Runbook/RunbookExecutePermission.test.ts +228 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayErasureTombstone.test.ts +189 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayUsage.test.ts +205 -0
- package/Tests/Server/Utils/Telemetry/AppMetrics.test.ts +275 -0
- package/Tests/Server/Utils/Telemetry/TelemetryContext.test.ts +279 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsDirectMessage.test.ts +454 -0
- package/Tests/Types/Kubernetes/KubernetesObjectParsers.test.ts +794 -0
- package/Tests/Types/Kubernetes/KubernetesRightSizing.test.ts +53 -0
- package/Tests/Types/Measurement/MeasurementAggregationType.test.ts +100 -0
- package/Tests/Types/Monitor/MonitorStepConfigHelpers.test.ts +114 -0
- package/Tests/Types/Workspace/WorkspaceType.test.ts +53 -0
- package/Tests/UI/Utils/NotificationMethodUtil.test.ts +137 -9
- package/Tests/UI/Utils/PermissionGate.test.ts +105 -0
- package/Tests/Utils/Dashboard/Components/DashboardComponentDefaults.test.ts +257 -0
- package/Types/Billing/PayAsYouGoPricing.ts +1 -1
- package/Types/Marketing/MarketingEvent.ts +97 -0
- package/UI/Utils/NotificationMethodUtil.ts +41 -1
- package/UI/Utils/PermissionGate.ts +56 -0
- package/build/dist/Models/DatabaseModels/EnterpriseLicense.js +24 -0
- package/build/dist/Models/DatabaseModels/EnterpriseLicense.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +4 -2
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Monitor.js +39 -9
- package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserMicrosoftTeams.js +363 -0
- package/build/dist/Models/DatabaseModels/UserMicrosoftTeams.js.map +1 -0
- package/build/dist/Models/DatabaseModels/UserNotificationRule.js +145 -8
- package/build/dist/Models/DatabaseModels/UserNotificationRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserNotificationSetting.js +38 -0
- package/build/dist/Models/DatabaseModels/UserNotificationSetting.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js +96 -0
- package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserSlack.js +361 -0
- package/build/dist/Models/DatabaseModels/UserSlack.js.map +1 -0
- package/build/dist/Models/DatabaseModels/WorkspaceProjectAuthToken.js.map +1 -1
- package/build/dist/Server/API/UserMicrosoftTeamsAPI.js +82 -0
- package/build/dist/Server/API/UserMicrosoftTeamsAPI.js.map +1 -0
- package/build/dist/Server/API/UserSlackAPI.js +81 -0
- package/build/dist/Server/API/UserSlackAPI.js.map +1 -0
- package/build/dist/Server/EnvironmentConfig.js +10 -70
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788700000000-RemoveMarketingConversionUploadState.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788700000000-RemoveMarketingConversionUploadState.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788800000000-DropMarketingConversionAddEnterpriseLicenseEmail.js +37 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788800000000-DropMarketingConversionAddEnterpriseLicenseEmail.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788900000000-RedactStoredMonitorIngestSecrets.js +106 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1788900000000-RedactStoredMonitorIngestSecrets.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789000000000-AddUserSlackAndMicrosoftTeams.js +78 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789000000000-AddUserSlackAndMicrosoftTeams.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Queue.js +7 -0
- package/build/dist/Server/Infrastructure/Queue.js.map +1 -1
- package/build/dist/Server/Services/BillingService.js +6 -0
- package/build/dist/Server/Services/BillingService.js.map +1 -1
- package/build/dist/Server/Services/EnterpriseLicenseService.js +65 -0
- package/build/dist/Server/Services/EnterpriseLicenseService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +6 -2
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/LlmLogService.js +25 -9
- package/build/dist/Server/Services/LlmLogService.js.map +1 -1
- package/build/dist/Server/Services/OnCallReadinessService.js +74 -2
- package/build/dist/Server/Services/OnCallReadinessService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +56 -0
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/UserMicrosoftTeamsService.js +183 -0
- package/build/dist/Server/Services/UserMicrosoftTeamsService.js.map +1 -0
- package/build/dist/Server/Services/UserNotificationMethodAdminService.js +138 -2
- package/build/dist/Server/Services/UserNotificationMethodAdminService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleAdminService.js +32 -4
- package/build/dist/Server/Services/UserNotificationRuleAdminService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleService.js +499 -67
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationSettingService.js +118 -0
- package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +26 -1
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Services/UserSlackService.js +195 -0
- package/build/dist/Server/Services/UserSlackService.js.map +1 -0
- package/build/dist/Server/Services/WorkspaceProjectAuthTokenService.js +64 -1
- package/build/dist/Server/Services/WorkspaceProjectAuthTokenService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceUserAuthTokenService.js +70 -0
- package/build/dist/Server/Services/WorkspaceUserAuthTokenService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceUserNotificationService.js +129 -0
- package/build/dist/Server/Services/WorkspaceUserNotificationService.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/MarketingEventUtil.js +94 -0
- package/build/dist/Server/Utils/Marketing/MarketingEventUtil.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/MarketingEventWebhook.js +93 -0
- package/build/dist/Server/Utils/Marketing/MarketingEventWebhook.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorLogUtil.js +12 -1
- package/build/dist/Server/Utils/Monitor/MonitorLogUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorPayloadRedaction.js +233 -0
- package/build/dist/Server/Utils/Monitor/MonitorPayloadRedaction.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +141 -4
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/Billing/PayAsYouGoPricing.js +1 -1
- package/build/dist/Types/Billing/PayAsYouGoPricing.js.map +1 -1
- package/build/dist/Types/Marketing/MarketingEvent.js +43 -0
- package/build/dist/Types/Marketing/MarketingEvent.js.map +1 -0
- package/build/dist/UI/Utils/NotificationMethodUtil.js +33 -1
- package/build/dist/UI/Utils/NotificationMethodUtil.js.map +1 -1
- package/build/dist/UI/Utils/PermissionGate.js +32 -0
- package/build/dist/UI/Utils/PermissionGate.js.map +1 -1
- package/package.json +1 -1
- package/Models/DatabaseModels/MarketingConversion.ts +0 -410
- package/Server/Services/MarketingConversionService.ts +0 -10
- package/Server/Utils/Marketing/ConversionUploadProvider.ts +0 -215
- package/Server/Utils/Marketing/ConversionUploadProviders.ts +0 -22
- package/Server/Utils/Marketing/Providers/GoogleAds.ts +0 -333
- package/Server/Utils/Marketing/Providers/LinkedIn.ts +0 -185
- package/Server/Utils/Marketing/Providers/Meta.ts +0 -182
- package/Server/Utils/Marketing/Providers/MicrosoftAds.ts +0 -223
- package/Server/Utils/Marketing/Providers/Reddit.ts +0 -208
- package/Tests/Server/Utils/Marketing/AdUploadableConversionTypes.test.ts +0 -315
- package/Tests/Server/Utils/Marketing/ConversionUploadProvider.test.ts +0 -300
- package/Tests/Server/Utils/Marketing/GoogleAds.test.ts +0 -592
- package/Tests/Server/Utils/Marketing/LinkedIn.test.ts +0 -282
- package/Tests/Server/Utils/Marketing/Meta.test.ts +0 -304
- package/Tests/Server/Utils/Marketing/MicrosoftAds.test.ts +0 -263
- package/Tests/Server/Utils/Marketing/Reddit.test.ts +0 -259
- package/Types/Marketing/MarketingConversion.ts +0 -53
- package/build/dist/Models/DatabaseModels/MarketingConversion.js +0 -445
- package/build/dist/Models/DatabaseModels/MarketingConversion.js.map +0 -1
- package/build/dist/Server/Services/MarketingConversionService.js +0 -9
- package/build/dist/Server/Services/MarketingConversionService.js.map +0 -1
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js +0 -93
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js.map +0 -1
- package/build/dist/Server/Utils/Marketing/ConversionUploadProviders.js +0 -20
- package/build/dist/Server/Utils/Marketing/ConversionUploadProviders.js.map +0 -1
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js +0 -221
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js.map +0 -1
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js +0 -137
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js.map +0 -1
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js +0 -133
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js.map +0 -1
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js +0 -143
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js.map +0 -1
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js +0 -145
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js.map +0 -1
- package/build/dist/Types/Marketing/MarketingConversion.js +0 -52
- package/build/dist/Types/Marketing/MarketingConversion.js.map +0 -1
|
@@ -11,8 +11,10 @@ import UserNotificationRuleService, {
|
|
|
11
11
|
} from "../../../Server/Services/UserNotificationRuleService";
|
|
12
12
|
import UserOnCallLogService from "../../../Server/Services/UserOnCallLogService";
|
|
13
13
|
import UserOnCallLogTimelineService from "../../../Server/Services/UserOnCallLogTimelineService";
|
|
14
|
+
import UserMicrosoftTeamsService from "../../../Server/Services/UserMicrosoftTeamsService";
|
|
14
15
|
import UserPushService from "../../../Server/Services/UserPushService";
|
|
15
16
|
import UserService from "../../../Server/Services/UserService";
|
|
17
|
+
import UserSlackService from "../../../Server/Services/UserSlackService";
|
|
16
18
|
import UserSmsService from "../../../Server/Services/UserSmsService";
|
|
17
19
|
import UserTelegramService from "../../../Server/Services/UserTelegramService";
|
|
18
20
|
import UserWebhookService from "../../../Server/Services/UserWebhookService";
|
|
@@ -74,7 +76,7 @@ import { afterEach, beforeEach, describe, expect, test } from "@jest/globals";
|
|
|
74
76
|
* a user id is global.
|
|
75
77
|
* R3 a rule's method FK must point at a method row owned by the rule's own
|
|
76
78
|
* user - on create, on update, through the FK column and through the
|
|
77
|
-
* relation slot, on every one of the
|
|
79
|
+
* relation slot, on every one of the nine channels, and on update with
|
|
78
80
|
* the owner re-read from the DATABASE because the body is written by the
|
|
79
81
|
* party under suspicion.
|
|
80
82
|
* R6 the audit line and the owner's warning email are keyed on the actor the
|
|
@@ -135,14 +137,14 @@ const ADMIN_EMAIL: string = "ada.admin@example.test";
|
|
|
135
137
|
const VICTIM_EMAIL: string = "vic.responder@example.test";
|
|
136
138
|
|
|
137
139
|
/*
|
|
138
|
-
* The
|
|
140
|
+
* The nine channels, each named by the FK column that carries it, the relation
|
|
139
141
|
* slot that is the same write spelled differently, the service the guard has to
|
|
140
142
|
* consult for that channel's owner, and the word that must appear in the
|
|
141
143
|
* refusal so an operator can tell WHICH method was wrong.
|
|
142
144
|
*
|
|
143
145
|
* Everything about method ownership is driven off this table on purpose. The
|
|
144
|
-
* one realistic way for the guard to be wrong is to cover
|
|
145
|
-
* forget the
|
|
146
|
+
* one realistic way for the guard to be wrong is to cover eight channels and
|
|
147
|
+
* forget the ninth, and an attacker choosing between nine doors will always
|
|
146
148
|
* choose the unlocked one - so a per-channel loop is the only shape of test
|
|
147
149
|
* that means anything here.
|
|
148
150
|
*/
|
|
@@ -188,6 +190,18 @@ const CHANNELS: Array<ChannelFixture> = [
|
|
|
188
190
|
label: "Telegram",
|
|
189
191
|
service: UserTelegramService as unknown as MethodServiceLike,
|
|
190
192
|
},
|
|
193
|
+
{
|
|
194
|
+
idColumn: "userSlackId",
|
|
195
|
+
relationColumn: "userSlack",
|
|
196
|
+
label: "Slack",
|
|
197
|
+
service: UserSlackService as unknown as MethodServiceLike,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
idColumn: "userMicrosoftTeamsId",
|
|
201
|
+
relationColumn: "userMicrosoftTeams",
|
|
202
|
+
label: "Microsoft Teams",
|
|
203
|
+
service: UserMicrosoftTeamsService as unknown as MethodServiceLike,
|
|
204
|
+
},
|
|
191
205
|
{
|
|
192
206
|
idColumn: "userPushId",
|
|
193
207
|
relationColumn: "userPush",
|
|
@@ -860,7 +874,7 @@ describe("Administrative notification rule edit guards", () => {
|
|
|
860
874
|
describe("R3 on create: a rule's method must belong to the rule's user", () => {
|
|
861
875
|
test("the guard covers exactly the notification method columns the model declares", () => {
|
|
862
876
|
/*
|
|
863
|
-
* Derived from the model rather than restated, so that
|
|
877
|
+
* Derived from the model rather than restated, so that a tenth channel
|
|
864
878
|
* added to UserNotificationRule and forgotten in the guard fails HERE,
|
|
865
879
|
* loudly, instead of quietly becoming the one unlocked door.
|
|
866
880
|
*/
|
|
@@ -873,7 +887,7 @@ describe("Administrative notification rule edit guards", () => {
|
|
|
873
887
|
});
|
|
874
888
|
|
|
875
889
|
// If the derivation itself ever breaks, fail rather than pass vacuously.
|
|
876
|
-
expect(columnsOnModel).toHaveLength(
|
|
890
|
+
expect(columnsOnModel).toHaveLength(9);
|
|
877
891
|
|
|
878
892
|
expect(
|
|
879
893
|
[
|
|
@@ -1783,7 +1797,7 @@ describe("Administrative notification rule edit guards", () => {
|
|
|
1783
1797
|
}),
|
|
1784
1798
|
),
|
|
1785
1799
|
).rejects.toThrow(
|
|
1786
|
-
"Call, SMS, WhatsApp, Telegram, Webhook, Email, or Push notification is required",
|
|
1800
|
+
"Call, SMS, WhatsApp, Telegram, Slack, Microsoft Teams, Webhook, Email, or Push notification is required",
|
|
1787
1801
|
);
|
|
1788
1802
|
});
|
|
1789
1803
|
|
|
@@ -1995,7 +2009,7 @@ describe("Administrative notification rule edit guards", () => {
|
|
|
1995
2009
|
updatePayload({ patch: { userEmailId: null } }),
|
|
1996
2010
|
),
|
|
1997
2011
|
).rejects.toThrow(
|
|
1998
|
-
"Call, SMS, WhatsApp, Telegram, Webhook, Email, or Push notification is required",
|
|
2012
|
+
"Call, SMS, WhatsApp, Telegram, Slack, Microsoft Teams, Webhook, Email, or Push notification is required",
|
|
1999
2013
|
);
|
|
2000
2014
|
});
|
|
2001
2015
|
|
|
@@ -882,6 +882,9 @@ describe("BillingService", () => {
|
|
|
882
882
|
expect(service.hasMeteredPlanPriceId(ProductType.SessionReplay)).toBe(
|
|
883
883
|
true,
|
|
884
884
|
);
|
|
885
|
+
expect(service.hasMeteredPlanPriceId(ProductType.SecurityEvents)).toBe(
|
|
886
|
+
true,
|
|
887
|
+
);
|
|
885
888
|
});
|
|
886
889
|
|
|
887
890
|
it("should return false for a product type with no Stripe price", () => {
|
|
@@ -901,6 +904,23 @@ describe("BillingService", () => {
|
|
|
901
904
|
expect(LogDataIngestMeteredPlan.hasPriceId()).toBe(true);
|
|
902
905
|
expect(SessionReplayDataIngestMeteredPlan.hasPriceId()).toBe(true);
|
|
903
906
|
});
|
|
907
|
+
|
|
908
|
+
/*
|
|
909
|
+
* Security Events shipped its ingest, metering and staging without a
|
|
910
|
+
* Stripe price, so usage accrued in TelemetryUsageBilling and was never
|
|
911
|
+
* invoiced - silently, because the callers treat a missing price as
|
|
912
|
+
* "skip this plan". Enumerate the enum rather than listing types by
|
|
913
|
+
* hand so the next pillar added cannot repeat that.
|
|
914
|
+
*/
|
|
915
|
+
it("should have a Stripe price for every ProductType", () => {
|
|
916
|
+
const unpriced: Array<ProductType> = Object.values(ProductType).filter(
|
|
917
|
+
(productType: ProductType) => {
|
|
918
|
+
return !service.hasMeteredPlanPriceId(productType);
|
|
919
|
+
},
|
|
920
|
+
);
|
|
921
|
+
|
|
922
|
+
expect(unpriced).toEqual([]);
|
|
923
|
+
});
|
|
904
924
|
});
|
|
905
925
|
|
|
906
926
|
describe("isPromoCodeValid", () => {
|
|
@@ -46,7 +46,7 @@ import { describe, expect, test, beforeEach, afterEach } from "@jest/globals";
|
|
|
46
46
|
* with a UserNotificationRule it assembled in memory and never saved: there is
|
|
47
47
|
* no rule row to claim and no id to look up, so the first half is meaningless
|
|
48
48
|
* to it while the second half is exactly what it needs. That makes the SEAM
|
|
49
|
-
* between the two halves — not the
|
|
49
|
+
* between the two halves — not the nine channel blocks, which
|
|
50
50
|
* NotificationChannelEventCoverage.test.ts owns — the thing worth pinning, and
|
|
51
51
|
* this file pins five properties of it:
|
|
52
52
|
*
|
|
@@ -731,7 +731,7 @@ describe("UserNotificationRuleService - the deliverNotificationForRule extractio
|
|
|
731
731
|
* the loaded relation's userId against the rule's, and it can only report
|
|
732
732
|
* a mismatch it can SEE - an unselected column arrives as `undefined` and
|
|
733
733
|
* is deliberately read as "no evidence", so dropping any one of these
|
|
734
|
-
*
|
|
734
|
+
* nine silently disables the backstop for that channel.
|
|
735
735
|
*
|
|
736
736
|
* Kept as an exact-shape assertion on purpose. This test caught the
|
|
737
737
|
* column being added, which is the whole argument for not relaxing it
|
|
@@ -762,6 +762,18 @@ describe("UserNotificationRuleService - the deliverNotificationForRule extractio
|
|
|
762
762
|
isVerified: true,
|
|
763
763
|
userId: true,
|
|
764
764
|
},
|
|
765
|
+
userSlack: {
|
|
766
|
+
slackUserId: true,
|
|
767
|
+
slackUserName: true,
|
|
768
|
+
isVerified: true,
|
|
769
|
+
userId: true,
|
|
770
|
+
},
|
|
771
|
+
userMicrosoftTeams: {
|
|
772
|
+
microsoftTeamsUserId: true,
|
|
773
|
+
microsoftTeamsUserName: true,
|
|
774
|
+
isVerified: true,
|
|
775
|
+
userId: true,
|
|
776
|
+
},
|
|
765
777
|
userWebhook: {
|
|
766
778
|
webhookUrl: true,
|
|
767
779
|
name: true,
|
|
@@ -788,6 +800,8 @@ describe("UserNotificationRuleService - the deliverNotificationForRule extractio
|
|
|
788
800
|
["userSms"],
|
|
789
801
|
["userWhatsApp"],
|
|
790
802
|
["userTelegram"],
|
|
803
|
+
["userSlack"],
|
|
804
|
+
["userMicrosoftTeams"],
|
|
791
805
|
["userEmail"],
|
|
792
806
|
["userPush"],
|
|
793
807
|
])(
|
|
@@ -806,6 +820,8 @@ describe("UserNotificationRuleService - the deliverNotificationForRule extractio
|
|
|
806
820
|
["userSms", "phone"],
|
|
807
821
|
["userWhatsApp", "phone"],
|
|
808
822
|
["userTelegram", "telegramChatId"],
|
|
823
|
+
["userSlack", "slackUserId"],
|
|
824
|
+
["userMicrosoftTeams", "microsoftTeamsUserId"],
|
|
809
825
|
["userEmail", "email"],
|
|
810
826
|
["userPush", "deviceToken"],
|
|
811
827
|
])(
|
|
@@ -161,13 +161,15 @@ const TELEGRAM_METHOD_ID: ObjectID = new ObjectID(
|
|
|
161
161
|
"ccccccc2-cccc-4ccc-8ccc-cccccccccccc",
|
|
162
162
|
);
|
|
163
163
|
|
|
164
|
-
/* The
|
|
164
|
+
/* The nine FK columns a rule can name a notification method through. */
|
|
165
165
|
type MethodColumn =
|
|
166
166
|
| "userEmailId"
|
|
167
167
|
| "userSmsId"
|
|
168
168
|
| "userCallId"
|
|
169
169
|
| "userWhatsAppId"
|
|
170
170
|
| "userTelegramId"
|
|
171
|
+
| "userSlackId"
|
|
172
|
+
| "userMicrosoftTeamsId"
|
|
171
173
|
| "userWebhookId"
|
|
172
174
|
| "userPushId";
|
|
173
175
|
|
|
@@ -177,6 +179,8 @@ const ALL_METHOD_COLUMNS: Array<MethodColumn> = [
|
|
|
177
179
|
"userCallId",
|
|
178
180
|
"userWhatsAppId",
|
|
179
181
|
"userTelegramId",
|
|
182
|
+
"userSlackId",
|
|
183
|
+
"userMicrosoftTeamsId",
|
|
180
184
|
"userWebhookId",
|
|
181
185
|
"userPushId",
|
|
182
186
|
];
|