@oneuptime/common 12.0.17 → 12.0.18
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/Server/Services/BillingService.ts +8 -0
- package/Tests/App/Dashboard/PayAsYouGoNotices.test.tsx +17 -0
- package/Tests/Server/Services/BillingService.test.ts +20 -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/Utils/Dashboard/Components/DashboardComponentDefaults.test.ts +257 -0
- package/Types/Billing/PayAsYouGoPricing.ts +1 -1
- package/build/dist/Server/Services/BillingService.js +6 -0
- package/build/dist/Server/Services/BillingService.js.map +1 -1
- package/build/dist/Types/Billing/PayAsYouGoPricing.js +1 -1
- package/build/dist/Types/Billing/PayAsYouGoPricing.js.map +1 -1
- package/package.json +1 -1
|
@@ -2074,6 +2074,14 @@ export class BillingService extends BaseService {
|
|
|
2074
2074
|
return "price_1U0iWJANuQdJ93r7iVAXwhdP";
|
|
2075
2075
|
}
|
|
2076
2076
|
|
|
2077
|
+
if (productType === ProductType.SecurityEvents) {
|
|
2078
|
+
if (this.isTestEnvironment()) {
|
|
2079
|
+
return "price_1U7efaANuQdJ93r74hFVOgdS";
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
return "price_1U7edTANuQdJ93r7hR9jpBfv";
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2077
2085
|
throw new BadDataException(
|
|
2078
2086
|
"Plan with productType " + productType + " not found",
|
|
2079
2087
|
);
|
|
@@ -120,6 +120,23 @@ describe("Pay as you go notices", () => {
|
|
|
120
120
|
expect(card).toHaveTextContent("Starting at");
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
+
it("names security events among the pillars billed at the telemetry rate", () => {
|
|
124
|
+
/*
|
|
125
|
+
* Security events ingest on the same key and meter at the same
|
|
126
|
+
* $0.10/GB as the other telemetry pillars. This sentence is the body of
|
|
127
|
+
* the consent checkbox a user has to tick to create a key, so a pillar
|
|
128
|
+
* missing from it is a pillar the user is charged for without ever
|
|
129
|
+
* having been told.
|
|
130
|
+
*/
|
|
131
|
+
render(<TelemetryPayAsYouGoCard />);
|
|
132
|
+
|
|
133
|
+
expect(
|
|
134
|
+
screen.getByTestId("telemetry-pay-as-you-go-card"),
|
|
135
|
+
).toHaveTextContent(
|
|
136
|
+
"Logs, traces, metrics, profiles and security events are billed at",
|
|
137
|
+
);
|
|
138
|
+
});
|
|
139
|
+
|
|
123
140
|
it("says the charge stops when the key is deleted, so the notice is not just a threat", () => {
|
|
124
141
|
render(<TelemetryPayAsYouGoCard />);
|
|
125
142
|
|
|
@@ -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", () => {
|