@norskvideo/ctl-product-template-schema 0.1.65 → 0.1.67

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.
Files changed (3) hide show
  1. package/index.d.ts +62 -0
  2. package/index.js +16 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -45,6 +45,23 @@ export declare const ProductTemplateAdvancedSchema: z.ZodObject<{
45
45
  default: z.ZodOptional<z.ZodString>;
46
46
  }, z.core.$strip>>;
47
47
  }, z.core.$strip>;
48
+ export declare const LISTENER_KINDS: readonly ["http", "webrtc", "moq", "srt", "rist", "udp-ts", "rtmp", "tcp", "udp", "grpc"];
49
+ export declare const ProductTemplateListenerSchema: z.ZodObject<{
50
+ kind: z.ZodEnum<{
51
+ tcp: "tcp";
52
+ udp: "udp";
53
+ http: "http";
54
+ webrtc: "webrtc";
55
+ moq: "moq";
56
+ srt: "srt";
57
+ rist: "rist";
58
+ "udp-ts": "udp-ts";
59
+ rtmp: "rtmp";
60
+ grpc: "grpc";
61
+ }>;
62
+ id: z.ZodOptional<z.ZodString>;
63
+ }, z.core.$strip>;
64
+ export type ProductTemplateListener = z.infer<typeof ProductTemplateListenerSchema>;
48
65
  export declare const ProductTemplateAllocatedPortSchema: z.ZodObject<{
49
66
  param: z.ZodString;
50
67
  protocol: z.ZodEnum<{
@@ -54,6 +71,21 @@ export declare const ProductTemplateAllocatedPortSchema: z.ZodObject<{
54
71
  service: z.ZodOptional<z.ZodString>;
55
72
  preferred: z.ZodNumber;
56
73
  label: z.ZodOptional<z.ZodString>;
74
+ listener: z.ZodOptional<z.ZodObject<{
75
+ kind: z.ZodEnum<{
76
+ tcp: "tcp";
77
+ udp: "udp";
78
+ http: "http";
79
+ webrtc: "webrtc";
80
+ moq: "moq";
81
+ srt: "srt";
82
+ rist: "rist";
83
+ "udp-ts": "udp-ts";
84
+ rtmp: "rtmp";
85
+ grpc: "grpc";
86
+ }>;
87
+ id: z.ZodOptional<z.ZodString>;
88
+ }, z.core.$strip>>;
57
89
  }, z.core.$strip>;
58
90
  export type ProductTemplateAllocatedPort = z.infer<typeof ProductTemplateAllocatedPortSchema>;
59
91
  export declare const ProductTemplateSideloadSchema: z.ZodObject<{
@@ -342,6 +374,21 @@ export declare const ProductTemplateManifestSchema: z.ZodObject<{
342
374
  service: z.ZodOptional<z.ZodString>;
343
375
  preferred: z.ZodNumber;
344
376
  label: z.ZodOptional<z.ZodString>;
377
+ listener: z.ZodOptional<z.ZodObject<{
378
+ kind: z.ZodEnum<{
379
+ tcp: "tcp";
380
+ udp: "udp";
381
+ http: "http";
382
+ webrtc: "webrtc";
383
+ moq: "moq";
384
+ srt: "srt";
385
+ rist: "rist";
386
+ "udp-ts": "udp-ts";
387
+ rtmp: "rtmp";
388
+ grpc: "grpc";
389
+ }>;
390
+ id: z.ZodOptional<z.ZodString>;
391
+ }, z.core.$strip>>;
345
392
  }, z.core.$strip>>>;
346
393
  logs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
347
394
  stdout: z.ZodOptional<z.ZodEnum<{
@@ -618,6 +665,21 @@ export declare const ProductTemplateMaterialsSchema: z.ZodObject<{
618
665
  service: z.ZodOptional<z.ZodString>;
619
666
  preferred: z.ZodNumber;
620
667
  label: z.ZodOptional<z.ZodString>;
668
+ listener: z.ZodOptional<z.ZodObject<{
669
+ kind: z.ZodEnum<{
670
+ tcp: "tcp";
671
+ udp: "udp";
672
+ http: "http";
673
+ webrtc: "webrtc";
674
+ moq: "moq";
675
+ srt: "srt";
676
+ rist: "rist";
677
+ "udp-ts": "udp-ts";
678
+ rtmp: "rtmp";
679
+ grpc: "grpc";
680
+ }>;
681
+ id: z.ZodOptional<z.ZodString>;
682
+ }, z.core.$strip>>;
621
683
  }, z.core.$strip>>>;
622
684
  logs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
623
685
  stdout: z.ZodOptional<z.ZodEnum<{
package/index.js CHANGED
@@ -266,6 +266,19 @@ export const ProductTemplateAdvancedSchema = z
266
266
  // re-supplies the recorded number, so an opened instance keeps its port.
267
267
  // Distinct from `advanced.hostPorts` (operator-typed extra bindings with no
268
268
  // parameter linkage).
269
+ // The listener kinds of the addressing document (norsk-contracts, src/addressing/schema.ts
270
+ // ListenerKind). Kept in step by a test in the backend, which has the contract's copy.
271
+ export const LISTENER_KINDS = ["http", "webrtc", "moq", "srt", "rist", "udp-ts", "rtmp", "tcp", "udp", "grpc"];
272
+ export const ProductTemplateListenerSchema = z
273
+ .object({
274
+ kind: z.enum(LISTENER_KINDS),
275
+ id: z
276
+ .string()
277
+ .regex(/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/, "a DNS label: a-z, 0-9 and '-'")
278
+ .optional()
279
+ .meta({ description: "The listener's name in the document; omitted = the kind. Needed only for two of a kind." }),
280
+ })
281
+ .meta({ id: "ProductTemplateListener", outputId: "ProductTemplateListener" });
269
282
  export const ProductTemplateAllocatedPortSchema = z
270
283
  .object({
271
284
  param: z.string().regex(/^[A-Z][A-Z0-9_]*$/, "env var name; uppercase, digits, underscores"),
@@ -273,6 +286,9 @@ export const ProductTemplateAllocatedPortSchema = z
273
286
  service: z.string().optional().meta({ description: "Compose service the binding targets; omitted = media" }),
274
287
  preferred: z.number().int().min(1).max(65535).meta({ description: "Allocation starts here and walks upward" }),
275
288
  label: z.string().optional().meta({ description: "Human label, e.g. 'MoQ preview (WebTransport)'" }),
289
+ listener: ProductTemplateListenerSchema.optional().meta({
290
+ description: "What listens on this port, so the runner can say in the instance's addressing document how it is reached (NORSK_ADDRESSING_FILE). Omitted = the port is published but not described there.",
291
+ }),
276
292
  })
277
293
  .meta({ id: "ProductTemplateAllocatedPort", outputId: "ProductTemplateAllocatedPort" });
278
294
  // Sideload bundle needs (docker/SIDELOAD.md). `gpu-video` (NVENC/NVDEC) follows
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-product-template-schema",
3
- "version": "0.1.65",
3
+ "version": "0.1.67",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",