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.
@@ -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: "delivery_test",
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
@@ -8,7 +8,7 @@ import {
8
8
  requireExactConfirmation,
9
9
  resolveProjectContext,
10
10
  serializeToYaml
11
- } from "./chunk-3YJXJ76M.js";
11
+ } from "./chunk-R77P4F5N.js";
12
12
  import "./chunk-IWKP55ZB.js";
13
13
  import "./chunk-WBBDQZZI.js";
14
14
  export {
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  renderPlanList,
40
40
  renderSupportInfo,
41
41
  serializeToYaml
42
- } from "./chunk-3YJXJ76M.js";
42
+ } from "./chunk-R77P4F5N.js";
43
43
  import "./chunk-IWKP55ZB.js";
44
44
  import "./chunk-WBBDQZZI.js";
45
45
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.17.0-alpha.13",
3
+ "version": "0.17.0-alpha.14",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",