@shipeasy/openapi 1.4.0 → 1.5.0

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
@@ -2365,6 +2365,13 @@ var killswitchesResource = {
2365
2365
  import { z as z14 } from "zod";
2366
2366
  var ALERT_COMPARATORS = ["gt", "gte", "lt", "lte"];
2367
2367
  var ALERT_SEVERITIES = ["danger", "warn", "info"];
2368
+ var notificationTargetSchema = z14.object({
2369
+ slackChannel: z14.object({
2370
+ id: z14.string().min(1).describe("Slack channel id (e.g. C0123ABCD)."),
2371
+ name: z14.string().min(1).describe("Slack channel name (without the leading #).")
2372
+ }).nullish().describe("Slack channel to post this rule's alert to. Requires a Slack connector."),
2373
+ email: z14.string().email().nullish().describe("Email address to notify for this rule (overrides the default recipient).")
2374
+ }).strict();
2368
2375
  var alertRuleCreateSchema = z14.object({
2369
2376
  name: z14.string().min(1).max(120).describe("Human label for the rule, shown on the alert and the rules list."),
2370
2377
  metricId: z14.string().min(1).describe("Id of the metric to evaluate."),
@@ -2372,7 +2379,8 @@ var alertRuleCreateSchema = z14.object({
2372
2379
  threshold: z14.number().finite().describe("Threshold the metric value is compared against."),
2373
2380
  windowHours: z14.number().int().min(1).max(720).default(24).describe("Lookback window (hours) the metric is aggregated over. 1\u2013720."),
2374
2381
  severity: z14.enum(ALERT_SEVERITIES).default("warn").describe("Severity of the raised alert."),
2375
- enabled: z14.boolean().default(true).describe("Whether the rule is evaluated by the cron.")
2382
+ enabled: z14.boolean().default(true).describe("Whether the rule is evaluated by the cron."),
2383
+ notify: notificationTargetSchema.nullish().describe("Where to deliver this rule's alert (Slack channel and/or email target).")
2376
2384
  }).strict();
2377
2385
  var alertRuleUpdateSchema = z14.object({
2378
2386
  name: z14.string().min(1).max(120),
@@ -2380,7 +2388,8 @@ var alertRuleUpdateSchema = z14.object({
2380
2388
  threshold: z14.number().finite(),
2381
2389
  windowHours: z14.number().int().min(1).max(720),
2382
2390
  severity: z14.enum(ALERT_SEVERITIES),
2383
- enabled: z14.boolean()
2391
+ enabled: z14.boolean(),
2392
+ notify: notificationTargetSchema.nullish()
2384
2393
  }).partial().strict();
2385
2394
 
2386
2395
  // src/resources/alert-rules.ts
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { alertRuleCreateSchema, alertRuleUpdateSchema } from '../schemas/alert-rules.js';
2
+ import { NotificationTarget, alertRuleCreateSchema, alertRuleUpdateSchema } from '../schemas/alert-rules.js';
3
3
  import { Transport } from '../transport.js';
4
4
 
5
5
  type AlertRuleCreateInput = z.input<typeof alertRuleCreateSchema>;
@@ -24,6 +24,8 @@ interface AlertRule {
24
24
  windowHours: number;
25
25
  severity: "danger" | "warn" | "info";
26
26
  enabled: boolean;
27
+ /** Delivery target for this rule's alert; null = use project default. */
28
+ notify: NotificationTarget | null;
27
29
  createdAt: string;
28
30
  updatedAt: string;
29
31
  }
@@ -2,6 +2,13 @@
2
2
  import { z } from "zod";
3
3
  var ALERT_COMPARATORS = ["gt", "gte", "lt", "lte"];
4
4
  var ALERT_SEVERITIES = ["danger", "warn", "info"];
5
+ var notificationTargetSchema = z.object({
6
+ slackChannel: z.object({
7
+ id: z.string().min(1).describe("Slack channel id (e.g. C0123ABCD)."),
8
+ name: z.string().min(1).describe("Slack channel name (without the leading #).")
9
+ }).nullish().describe("Slack channel to post this rule's alert to. Requires a Slack connector."),
10
+ email: z.string().email().nullish().describe("Email address to notify for this rule (overrides the default recipient).")
11
+ }).strict();
5
12
  var alertRuleCreateSchema = z.object({
6
13
  name: z.string().min(1).max(120).describe("Human label for the rule, shown on the alert and the rules list."),
7
14
  metricId: z.string().min(1).describe("Id of the metric to evaluate."),
@@ -9,7 +16,8 @@ var alertRuleCreateSchema = z.object({
9
16
  threshold: z.number().finite().describe("Threshold the metric value is compared against."),
10
17
  windowHours: z.number().int().min(1).max(720).default(24).describe("Lookback window (hours) the metric is aggregated over. 1\u2013720."),
11
18
  severity: z.enum(ALERT_SEVERITIES).default("warn").describe("Severity of the raised alert."),
12
- enabled: z.boolean().default(true).describe("Whether the rule is evaluated by the cron.")
19
+ enabled: z.boolean().default(true).describe("Whether the rule is evaluated by the cron."),
20
+ notify: notificationTargetSchema.nullish().describe("Where to deliver this rule's alert (Slack channel and/or email target).")
13
21
  }).strict();
14
22
  var alertRuleUpdateSchema = z.object({
15
23
  name: z.string().min(1).max(120),
@@ -17,7 +25,8 @@ var alertRuleUpdateSchema = z.object({
17
25
  threshold: z.number().finite(),
18
26
  windowHours: z.number().int().min(1).max(720),
19
27
  severity: z.enum(ALERT_SEVERITIES),
20
- enabled: z.boolean()
28
+ enabled: z.boolean(),
29
+ notify: notificationTargetSchema.nullish()
21
30
  }).partial().strict();
22
31
 
23
32
  // src/transport.ts
@@ -2296,6 +2296,13 @@ var killswitchesResource = {
2296
2296
  import { z as z13 } from "zod";
2297
2297
  var ALERT_COMPARATORS = ["gt", "gte", "lt", "lte"];
2298
2298
  var ALERT_SEVERITIES = ["danger", "warn", "info"];
2299
+ var notificationTargetSchema = z13.object({
2300
+ slackChannel: z13.object({
2301
+ id: z13.string().min(1).describe("Slack channel id (e.g. C0123ABCD)."),
2302
+ name: z13.string().min(1).describe("Slack channel name (without the leading #).")
2303
+ }).nullish().describe("Slack channel to post this rule's alert to. Requires a Slack connector."),
2304
+ email: z13.string().email().nullish().describe("Email address to notify for this rule (overrides the default recipient).")
2305
+ }).strict();
2299
2306
  var alertRuleCreateSchema = z13.object({
2300
2307
  name: z13.string().min(1).max(120).describe("Human label for the rule, shown on the alert and the rules list."),
2301
2308
  metricId: z13.string().min(1).describe("Id of the metric to evaluate."),
@@ -2303,7 +2310,8 @@ var alertRuleCreateSchema = z13.object({
2303
2310
  threshold: z13.number().finite().describe("Threshold the metric value is compared against."),
2304
2311
  windowHours: z13.number().int().min(1).max(720).default(24).describe("Lookback window (hours) the metric is aggregated over. 1\u2013720."),
2305
2312
  severity: z13.enum(ALERT_SEVERITIES).default("warn").describe("Severity of the raised alert."),
2306
- enabled: z13.boolean().default(true).describe("Whether the rule is evaluated by the cron.")
2313
+ enabled: z13.boolean().default(true).describe("Whether the rule is evaluated by the cron."),
2314
+ notify: notificationTargetSchema.nullish().describe("Where to deliver this rule's alert (Slack channel and/or email target).")
2307
2315
  }).strict();
2308
2316
  var alertRuleUpdateSchema = z13.object({
2309
2317
  name: z13.string().min(1).max(120),
@@ -2311,7 +2319,8 @@ var alertRuleUpdateSchema = z13.object({
2311
2319
  threshold: z13.number().finite(),
2312
2320
  windowHours: z13.number().int().min(1).max(720),
2313
2321
  severity: z13.enum(ALERT_SEVERITIES),
2314
- enabled: z13.boolean()
2322
+ enabled: z13.boolean(),
2323
+ notify: notificationTargetSchema.nullish()
2315
2324
  }).partial().strict();
2316
2325
 
2317
2326
  // src/resources/alert-rules.ts
@@ -2,6 +2,14 @@ import { z } from 'zod';
2
2
 
3
3
  declare const ALERT_COMPARATORS: readonly ["gt", "gte", "lt", "lte"];
4
4
  declare const ALERT_SEVERITIES: readonly ["danger", "warn", "info"];
5
+ declare const notificationTargetSchema: z.ZodObject<{
6
+ slackChannel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
7
+ id: z.ZodString;
8
+ name: z.ZodString;
9
+ }, z.core.$strip>>>;
10
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ }, z.core.$strict>;
12
+ type NotificationTarget = z.infer<typeof notificationTargetSchema>;
5
13
  declare const alertRuleCreateSchema: z.ZodObject<{
6
14
  name: z.ZodString;
7
15
  metricId: z.ZodString;
@@ -19,6 +27,13 @@ declare const alertRuleCreateSchema: z.ZodObject<{
19
27
  info: "info";
20
28
  }>>;
21
29
  enabled: z.ZodDefault<z.ZodBoolean>;
30
+ notify: z.ZodOptional<z.ZodNullable<z.ZodObject<{
31
+ slackChannel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
32
+ id: z.ZodString;
33
+ name: z.ZodString;
34
+ }, z.core.$strip>>>;
35
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
+ }, z.core.$strict>>>;
22
37
  }, z.core.$strict>;
23
38
  declare const alertRuleUpdateSchema: z.ZodObject<{
24
39
  name: z.ZodOptional<z.ZodString>;
@@ -36,8 +51,15 @@ declare const alertRuleUpdateSchema: z.ZodObject<{
36
51
  info: "info";
37
52
  }>>;
38
53
  enabled: z.ZodOptional<z.ZodBoolean>;
54
+ notify: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
55
+ slackChannel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
56
+ id: z.ZodString;
57
+ name: z.ZodString;
58
+ }, z.core.$strip>>>;
59
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
+ }, z.core.$strict>>>>;
39
61
  }, z.core.$strict>;
40
62
  type AlertRuleCreate = z.infer<typeof alertRuleCreateSchema>;
41
63
  type AlertRuleUpdate = z.infer<typeof alertRuleUpdateSchema>;
42
64
 
43
- export { ALERT_COMPARATORS, ALERT_SEVERITIES, type AlertRuleCreate, type AlertRuleUpdate, alertRuleCreateSchema, alertRuleUpdateSchema };
65
+ export { ALERT_COMPARATORS, ALERT_SEVERITIES, type AlertRuleCreate, type AlertRuleUpdate, type NotificationTarget, alertRuleCreateSchema, alertRuleUpdateSchema, notificationTargetSchema };
@@ -2,6 +2,13 @@
2
2
  import { z } from "zod";
3
3
  var ALERT_COMPARATORS = ["gt", "gte", "lt", "lte"];
4
4
  var ALERT_SEVERITIES = ["danger", "warn", "info"];
5
+ var notificationTargetSchema = z.object({
6
+ slackChannel: z.object({
7
+ id: z.string().min(1).describe("Slack channel id (e.g. C0123ABCD)."),
8
+ name: z.string().min(1).describe("Slack channel name (without the leading #).")
9
+ }).nullish().describe("Slack channel to post this rule's alert to. Requires a Slack connector."),
10
+ email: z.string().email().nullish().describe("Email address to notify for this rule (overrides the default recipient).")
11
+ }).strict();
5
12
  var alertRuleCreateSchema = z.object({
6
13
  name: z.string().min(1).max(120).describe("Human label for the rule, shown on the alert and the rules list."),
7
14
  metricId: z.string().min(1).describe("Id of the metric to evaluate."),
@@ -9,7 +16,8 @@ var alertRuleCreateSchema = z.object({
9
16
  threshold: z.number().finite().describe("Threshold the metric value is compared against."),
10
17
  windowHours: z.number().int().min(1).max(720).default(24).describe("Lookback window (hours) the metric is aggregated over. 1\u2013720."),
11
18
  severity: z.enum(ALERT_SEVERITIES).default("warn").describe("Severity of the raised alert."),
12
- enabled: z.boolean().default(true).describe("Whether the rule is evaluated by the cron.")
19
+ enabled: z.boolean().default(true).describe("Whether the rule is evaluated by the cron."),
20
+ notify: notificationTargetSchema.nullish().describe("Where to deliver this rule's alert (Slack channel and/or email target).")
13
21
  }).strict();
14
22
  var alertRuleUpdateSchema = z.object({
15
23
  name: z.string().min(1).max(120),
@@ -17,11 +25,13 @@ var alertRuleUpdateSchema = z.object({
17
25
  threshold: z.number().finite(),
18
26
  windowHours: z.number().int().min(1).max(720),
19
27
  severity: z.enum(ALERT_SEVERITIES),
20
- enabled: z.boolean()
28
+ enabled: z.boolean(),
29
+ notify: notificationTargetSchema.nullish()
21
30
  }).partial().strict();
22
31
  export {
23
32
  ALERT_COMPARATORS,
24
33
  ALERT_SEVERITIES,
25
34
  alertRuleCreateSchema,
26
- alertRuleUpdateSchema
35
+ alertRuleUpdateSchema,
36
+ notificationTargetSchema
27
37
  };
@@ -7,5 +7,5 @@ export { GateCreateInput, GateUpdateInput, StackedGateEntryInput, gateCreateResp
7
7
  export { KillswitchCreateInput, KillswitchSwitchSetInput, KillswitchSwitchUnsetInput, KillswitchUpdateInput, KillswitchValue, KillswitchValueSetInput, SWITCH_KEY_RE, killswitchCreateResponseSchema, killswitchCreateSchema, killswitchDeleteResponseSchema, killswitchResponseSchema, killswitchSwitchSetResponseSchema, killswitchSwitchSetSchema, killswitchSwitchUnsetResponseSchema, killswitchSwitchUnsetSchema, killswitchUpdateResponseSchema, killswitchUpdateSchema, killswitchValueSchema, killswitchValueSetSchema, switchKeySchema } from './killswitches.js';
8
8
  export { UniverseCreateInput, UniverseUpdateInput, holdoutRangeSchema, universeCreateResponseSchema, universeCreateSchema, universeDeleteResponseSchema, universeNameSchema, universeResponseSchema, universeUpdateResponseSchema, universeUpdateSchema } from './universes.js';
9
9
  export { ExperimentCreateInput, ExperimentInlineMetric, ExperimentUpdateInput, bucketBySchema, experimentCreateResponseSchema, experimentCreateSchema, experimentDeleteResponseSchema, experimentGroupSchema, experimentInlineMetricSchema, experimentMetricsResponseSchema, experimentMetricsUpdateSchema, experimentNameSchema, experimentReanalyzeResponseSchema, experimentResponseSchema, experimentResultsResponseSchema, experimentStatusResponseSchema, experimentStatusUpdateSchema, experimentTimeseriesResponseSchema, experimentUpdateResponseSchema, experimentUpdateSchema, paramSchemaSchema } from './experiments.js';
10
- export { ALERT_COMPARATORS, ALERT_SEVERITIES, AlertRuleCreate, AlertRuleUpdate, alertRuleCreateSchema, alertRuleUpdateSchema } from './alert-rules.js';
10
+ export { ALERT_COMPARATORS, ALERT_SEVERITIES, AlertRuleCreate, AlertRuleUpdate, NotificationTarget, alertRuleCreateSchema, alertRuleUpdateSchema, notificationTargetSchema } from './alert-rules.js';
11
11
  import 'zod';
@@ -648,6 +648,13 @@ var experimentReanalyzeResponseSchema = z8.object({
648
648
  import { z as z9 } from "zod";
649
649
  var ALERT_COMPARATORS = ["gt", "gte", "lt", "lte"];
650
650
  var ALERT_SEVERITIES = ["danger", "warn", "info"];
651
+ var notificationTargetSchema = z9.object({
652
+ slackChannel: z9.object({
653
+ id: z9.string().min(1).describe("Slack channel id (e.g. C0123ABCD)."),
654
+ name: z9.string().min(1).describe("Slack channel name (without the leading #).")
655
+ }).nullish().describe("Slack channel to post this rule's alert to. Requires a Slack connector."),
656
+ email: z9.string().email().nullish().describe("Email address to notify for this rule (overrides the default recipient).")
657
+ }).strict();
651
658
  var alertRuleCreateSchema = z9.object({
652
659
  name: z9.string().min(1).max(120).describe("Human label for the rule, shown on the alert and the rules list."),
653
660
  metricId: z9.string().min(1).describe("Id of the metric to evaluate."),
@@ -655,7 +662,8 @@ var alertRuleCreateSchema = z9.object({
655
662
  threshold: z9.number().finite().describe("Threshold the metric value is compared against."),
656
663
  windowHours: z9.number().int().min(1).max(720).default(24).describe("Lookback window (hours) the metric is aggregated over. 1\u2013720."),
657
664
  severity: z9.enum(ALERT_SEVERITIES).default("warn").describe("Severity of the raised alert."),
658
- enabled: z9.boolean().default(true).describe("Whether the rule is evaluated by the cron.")
665
+ enabled: z9.boolean().default(true).describe("Whether the rule is evaluated by the cron."),
666
+ notify: notificationTargetSchema.nullish().describe("Where to deliver this rule's alert (Slack channel and/or email target).")
659
667
  }).strict();
660
668
  var alertRuleUpdateSchema = z9.object({
661
669
  name: z9.string().min(1).max(120),
@@ -663,7 +671,8 @@ var alertRuleUpdateSchema = z9.object({
663
671
  threshold: z9.number().finite(),
664
672
  windowHours: z9.number().int().min(1).max(720),
665
673
  severity: z9.enum(ALERT_SEVERITIES),
666
- enabled: z9.boolean()
674
+ enabled: z9.boolean(),
675
+ notify: notificationTargetSchema.nullish()
667
676
  }).partial().strict();
668
677
  export {
669
678
  ALERT_COMPARATORS,
@@ -737,6 +746,7 @@ export {
737
746
  killswitchValueSchema,
738
747
  killswitchValueSetSchema,
739
748
  metricNameSchema,
749
+ notificationTargetSchema,
740
750
  pageQuerySchema,
741
751
  paramSchemaSchema,
742
752
  rampSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipeasy/openapi",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Shipeasy admin OpenAPI spec + typed client. Single source of truth for endpoint paths, request/response shapes, and the resource registry consumed by @shipeasy/cli and @shipeasy/mcp.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",