datadog-mcp 1.0.6 → 1.0.8

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/index.js CHANGED
@@ -3270,7 +3270,30 @@ async function getDowntime(api, id) {
3270
3270
  };
3271
3271
  }
3272
3272
  function normalizeDowntimeConfig(config) {
3273
- const normalized = { ...config };
3273
+ const keyMapping = {
3274
+ monitor_identifier: "monitorIdentifier",
3275
+ display_timezone: "displayTimezone",
3276
+ mute_first_recovery_notification: "muteFirstRecoveryNotification",
3277
+ notify_end_states: "notifyEndStates",
3278
+ notify_end_types: "notifyEndTypes"
3279
+ };
3280
+ const normalized = {};
3281
+ for (const [key, value] of Object.entries(config)) {
3282
+ const newKey = keyMapping[key] || key;
3283
+ normalized[newKey] = value;
3284
+ }
3285
+ if (normalized.monitorIdentifier && typeof normalized.monitorIdentifier === "object") {
3286
+ const mi = { ...normalized.monitorIdentifier };
3287
+ if ("monitor_id" in mi) {
3288
+ mi.monitorId = mi.monitor_id;
3289
+ delete mi.monitor_id;
3290
+ }
3291
+ if ("monitor_tags" in mi) {
3292
+ mi.monitorTags = mi.monitor_tags;
3293
+ delete mi.monitor_tags;
3294
+ }
3295
+ normalized.monitorIdentifier = mi;
3296
+ }
3274
3297
  if (normalized.schedule && typeof normalized.schedule === "object") {
3275
3298
  const schedule = { ...normalized.schedule };
3276
3299
  const isRecurring = "duration" in schedule && "rrule" in schedule;
@@ -3281,6 +3304,10 @@ function normalizeDowntimeConfig(config) {
3281
3304
  if (schedule.end && typeof schedule.end === "string") {
3282
3305
  schedule.end = new Date(schedule.end);
3283
3306
  }
3307
+ if (schedule.timezone && !normalized.displayTimezone) {
3308
+ normalized.displayTimezone = schedule.timezone;
3309
+ }
3310
+ delete schedule.timezone;
3284
3311
  }
3285
3312
  normalized.schedule = schedule;
3286
3313
  }