@norskvideo/ctl-sdk 0.1.52 → 0.1.53

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.
@@ -9,6 +9,29 @@ declare const DefaultProductTemplateSchema: z.ZodObject<{
9
9
  url: z.ZodString;
10
10
  }, z.core.$strip>;
11
11
  export type DefaultProductTemplate = z.infer<typeof DefaultProductTemplateSchema>;
12
+ declare const DefaultDashboardSchema: z.ZodObject<{
13
+ name: z.ZodString;
14
+ displayName: z.ZodOptional<z.ZodString>;
15
+ url: z.ZodString;
16
+ hosting: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
17
+ mode: z.ZodLiteral<"own">;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ mode: z.ZodLiteral<"shared">;
20
+ group: z.ZodString;
21
+ }, z.core.$strip>, z.ZodObject<{
22
+ mode: z.ZodLiteral<"pattern">;
23
+ pattern: z.ZodString;
24
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
25
+ kind: z.ZodLiteral<"production">;
26
+ }, z.core.$strip>, z.ZodObject<{
27
+ kind: z.ZodLiteral<"production-template">;
28
+ }, z.core.$strip>, z.ZodObject<{
29
+ kind: z.ZodLiteral<"label">;
30
+ label: z.ZodString;
31
+ }, z.core.$strip>], "kind">;
32
+ }, z.core.$strip>], "mode">>;
33
+ }, z.core.$strip>;
34
+ export type DefaultDashboard = z.infer<typeof DefaultDashboardSchema>;
12
35
  /** One product role (RFC 0003 D5a). The name rule is foundation's, so the
13
36
  * runner that stamps it and the manifest that declares it cannot disagree. */
14
37
  declare const ProductRoleSchema: z.ZodObject<{
@@ -202,6 +225,28 @@ export declare const ManifestSchema: z.ZodObject<{
202
225
  name: z.ZodString;
203
226
  url: z.ZodString;
204
227
  }, z.core.$strip>>>;
228
+ defaultDashboards: z.ZodDefault<z.ZodArray<z.ZodObject<{
229
+ name: z.ZodString;
230
+ displayName: z.ZodOptional<z.ZodString>;
231
+ url: z.ZodString;
232
+ hosting: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
233
+ mode: z.ZodLiteral<"own">;
234
+ }, z.core.$strip>, z.ZodObject<{
235
+ mode: z.ZodLiteral<"shared">;
236
+ group: z.ZodString;
237
+ }, z.core.$strip>, z.ZodObject<{
238
+ mode: z.ZodLiteral<"pattern">;
239
+ pattern: z.ZodString;
240
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
241
+ kind: z.ZodLiteral<"production">;
242
+ }, z.core.$strip>, z.ZodObject<{
243
+ kind: z.ZodLiteral<"production-template">;
244
+ }, z.core.$strip>, z.ZodObject<{
245
+ kind: z.ZodLiteral<"label">;
246
+ label: z.ZodString;
247
+ }, z.core.$strip>], "kind">;
248
+ }, z.core.$strip>], "mode">>;
249
+ }, z.core.$strip>>>;
205
250
  export: z.ZodOptional<z.ZodObject<{
206
251
  include: z.ZodDefault<z.ZodArray<z.ZodString>>;
207
252
  exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -82,6 +82,38 @@ const DefaultProductTemplateSchema = z.object({
82
82
  description: "Path on the product's HTTP surface that returns the product-template tar. Resolved against the product's base URL — relative paths only (no scheme/host).",
83
83
  }),
84
84
  });
85
+ /** A fleet dashboard the product brings (norsk-ctl task 123, RFC 0006): a
86
+ * static bundle its control plane serves, registered with norsk-mgr when the
87
+ * product is added and replaced in place on every reload. The hosting is a
88
+ * proposal: the operator's choice, once made, is kept. norsk-ctl serving
89
+ * alone hosts no dashboards and ignores these. */
90
+ const DashboardLabel = z
91
+ .string()
92
+ .regex(/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/, "one DNS label: lowercase letters, digits and hyphens, 1-63 chars");
93
+ const DefaultDashboardSchema = z.object({
94
+ name: DashboardLabel.meta({ description: "The dashboard's name, and its host's label when it has one of its own." }),
95
+ displayName: z.string().min(1).optional(),
96
+ url: z
97
+ .string()
98
+ .regex(/^\/[^/]/, "a path on the product's own HTTP surface")
99
+ .meta({ description: "Path on the product's HTTP surface that returns the dashboard's bundle tar." }),
100
+ hosting: z
101
+ .discriminatedUnion("mode", [
102
+ z.object({ mode: z.literal("own") }),
103
+ z.object({ mode: z.literal("shared"), group: DashboardLabel }),
104
+ z.object({
105
+ mode: z.literal("pattern"),
106
+ pattern: z.string().min(1),
107
+ scope: z.discriminatedUnion("kind", [
108
+ z.object({ kind: z.literal("production") }),
109
+ z.object({ kind: z.literal("production-template") }),
110
+ z.object({ kind: z.literal("label"), label: z.string().min(1) }),
111
+ ]),
112
+ }),
113
+ ])
114
+ .optional()
115
+ .meta({ description: "The hosting proposed; absent is a host of its own." }),
116
+ });
85
117
  /** Save-as-product-template file selection. When the runner exports a running
86
118
  * instance's working directory into a new product template, it packs only files
87
119
  * matching `include` and not matching `exclude` (glob patterns, relative to the
@@ -178,5 +210,8 @@ export const ManifestSchema = z.object({
178
210
  defaultProductTemplates: z.array(DefaultProductTemplateSchema).default([]).meta({
179
211
  description: "Product templates the runner auto-fetches at product-registration time. Each entry is GET'd against the product's base URL and stored under its `name` via the runner's product-template store. Lets a product offer 'zero-config' launch paths — operators add the product and immediately have a launchable product template without visiting configure.",
180
212
  }),
213
+ defaultDashboards: z.array(DefaultDashboardSchema).default([]).meta({
214
+ description: "Fleet dashboards the product brings: norsk-mgr fetches each bundle from the product at registration and on every reload, registers it as the product's, and removes it with the product. norsk-ctl serving alone ignores them.",
215
+ }),
181
216
  export: ExportSchema.optional(),
182
217
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-sdk",
3
- "version": "0.1.52",
3
+ "version": "0.1.53",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {