openmates 0.17.0-alpha.13 → 0.17.0-alpha.14
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/dist/{chunk-3YJXJ76M.js → chunk-R77P4F5N.js} +11 -3
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -29836,6 +29836,13 @@ async function serverNotifications(rest, flags) {
|
|
|
29836
29836
|
const role = getServerRole(flags, config);
|
|
29837
29837
|
const channel = typeof flags.channel === "string" ? flags.channel : "all";
|
|
29838
29838
|
if (!(/* @__PURE__ */ new Set(["email", "discord", "webhook", "all"])).has(channel)) throw new Error("--channel must be email, discord, webhook, or all.");
|
|
29839
|
+
const eventKind = typeof flags["event-kind"] === "string" ? flags["event-kind"] : "delivery_test";
|
|
29840
|
+
if (!(/* @__PURE__ */ new Set(["delivery_test", "incident", "critical", "recovery"])).has(eventKind)) {
|
|
29841
|
+
throw new Error("--event-kind must be delivery_test, incident, critical, or recovery.");
|
|
29842
|
+
}
|
|
29843
|
+
if (eventKind !== "delivery_test" && readEnvMap(installPath).SERVER_ENVIRONMENT !== "development") {
|
|
29844
|
+
throw new Error("Synthetic notification event kinds are restricted to development.");
|
|
29845
|
+
}
|
|
29839
29846
|
const notificationConfig = runtimeNotificationConfig(installPath);
|
|
29840
29847
|
if (channel !== "all") {
|
|
29841
29848
|
if (channel !== "email") notificationConfig.email = void 0;
|
|
@@ -29844,14 +29851,15 @@ async function serverNotifications(rest, flags) {
|
|
|
29844
29851
|
}
|
|
29845
29852
|
const deliveries = await deliverRuntimeNotification(notificationConfig, {
|
|
29846
29853
|
role,
|
|
29847
|
-
kind:
|
|
29854
|
+
kind: eventKind,
|
|
29848
29855
|
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
29849
|
-
checkIds: ["monitor"],
|
|
29850
|
-
sanitizedReason: "operator_requested_delivery_test"
|
|
29856
|
+
checkIds: [eventKind === "delivery_test" ? "monitor" : "core.object_storage"],
|
|
29857
|
+
sanitizedReason: eventKind === "recovery" ? "storage_available" : eventKind === "delivery_test" ? "operator_requested_delivery_test" : "storage_unavailable"
|
|
29851
29858
|
});
|
|
29852
29859
|
const output = {
|
|
29853
29860
|
command: "notifications test",
|
|
29854
29861
|
role,
|
|
29862
|
+
eventKind,
|
|
29855
29863
|
configured: deliveries.length > 0,
|
|
29856
29864
|
discordDestination: channel === "discord" || channel === "all" ? { source: notificationConfig.discordDestinationSource, fallbackUsed: notificationConfig.discordFallbackUsed } : void 0,
|
|
29857
29865
|
deliveries
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED