@norskvideo/ctl-product-template-schema 0.1.64 → 0.1.66

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 +64 -6
  2. package/index.js +16 -0
  3. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -45,6 +45,22 @@ 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"];
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
+ }>;
61
+ id: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strip>;
63
+ export type ProductTemplateListener = z.infer<typeof ProductTemplateListenerSchema>;
48
64
  export declare const ProductTemplateAllocatedPortSchema: z.ZodObject<{
49
65
  param: z.ZodString;
50
66
  protocol: z.ZodEnum<{
@@ -54,6 +70,20 @@ export declare const ProductTemplateAllocatedPortSchema: z.ZodObject<{
54
70
  service: z.ZodOptional<z.ZodString>;
55
71
  preferred: z.ZodNumber;
56
72
  label: z.ZodOptional<z.ZodString>;
73
+ listener: z.ZodOptional<z.ZodObject<{
74
+ kind: z.ZodEnum<{
75
+ tcp: "tcp";
76
+ udp: "udp";
77
+ http: "http";
78
+ webrtc: "webrtc";
79
+ moq: "moq";
80
+ srt: "srt";
81
+ rist: "rist";
82
+ "udp-ts": "udp-ts";
83
+ rtmp: "rtmp";
84
+ }>;
85
+ id: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$strip>>;
57
87
  }, z.core.$strip>;
58
88
  export type ProductTemplateAllocatedPort = z.infer<typeof ProductTemplateAllocatedPortSchema>;
59
89
  export declare const ProductTemplateSideloadSchema: z.ZodObject<{
@@ -342,6 +372,20 @@ export declare const ProductTemplateManifestSchema: z.ZodObject<{
342
372
  service: z.ZodOptional<z.ZodString>;
343
373
  preferred: z.ZodNumber;
344
374
  label: z.ZodOptional<z.ZodString>;
375
+ listener: z.ZodOptional<z.ZodObject<{
376
+ kind: z.ZodEnum<{
377
+ tcp: "tcp";
378
+ udp: "udp";
379
+ http: "http";
380
+ webrtc: "webrtc";
381
+ moq: "moq";
382
+ srt: "srt";
383
+ rist: "rist";
384
+ "udp-ts": "udp-ts";
385
+ rtmp: "rtmp";
386
+ }>;
387
+ id: z.ZodOptional<z.ZodString>;
388
+ }, z.core.$strip>>;
345
389
  }, z.core.$strip>>>;
346
390
  logs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
347
391
  stdout: z.ZodOptional<z.ZodEnum<{
@@ -445,7 +489,7 @@ export declare const ParametersFileSchema: z.ZodObject<{
445
489
  export type ParametersFile = z.infer<typeof ParametersFileSchema>;
446
490
  declare const ProductTemplateFileSchema: z.ZodObject<{
447
491
  path: z.ZodString;
448
- content: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
492
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodInstanceOf<Uint8Array<ArrayBuffer>>]>;
449
493
  }, z.core.$strip>;
450
494
  export type ProductTemplateFile = z.infer<typeof ProductTemplateFileSchema>;
451
495
  export declare const ProductTemplateMaterialsSchema: z.ZodObject<{
@@ -618,6 +662,20 @@ export declare const ProductTemplateMaterialsSchema: z.ZodObject<{
618
662
  service: z.ZodOptional<z.ZodString>;
619
663
  preferred: z.ZodNumber;
620
664
  label: z.ZodOptional<z.ZodString>;
665
+ listener: z.ZodOptional<z.ZodObject<{
666
+ kind: z.ZodEnum<{
667
+ tcp: "tcp";
668
+ udp: "udp";
669
+ http: "http";
670
+ webrtc: "webrtc";
671
+ moq: "moq";
672
+ srt: "srt";
673
+ rist: "rist";
674
+ "udp-ts": "udp-ts";
675
+ rtmp: "rtmp";
676
+ }>;
677
+ id: z.ZodOptional<z.ZodString>;
678
+ }, z.core.$strip>>;
621
679
  }, z.core.$strip>>>;
622
680
  logs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
623
681
  stdout: z.ZodOptional<z.ZodEnum<{
@@ -693,23 +751,23 @@ export declare const ProductTemplateMaterialsSchema: z.ZodObject<{
693
751
  workflow: z.ZodOptional<z.ZodString>;
694
752
  components: z.ZodDefault<z.ZodArray<z.ZodObject<{
695
753
  path: z.ZodString;
696
- content: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
754
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodInstanceOf<Uint8Array<ArrayBuffer>>]>;
697
755
  }, z.core.$strip>>>;
698
756
  dashboards: z.ZodDefault<z.ZodArray<z.ZodObject<{
699
757
  path: z.ZodString;
700
- content: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
758
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodInstanceOf<Uint8Array<ArrayBuffer>>]>;
701
759
  }, z.core.$strip>>>;
702
760
  assets: z.ZodDefault<z.ZodArray<z.ZodObject<{
703
761
  path: z.ZodString;
704
- content: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
762
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodInstanceOf<Uint8Array<ArrayBuffer>>]>;
705
763
  }, z.core.$strip>>>;
706
764
  openapi: z.ZodOptional<z.ZodArray<z.ZodObject<{
707
765
  path: z.ZodString;
708
- content: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
766
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodInstanceOf<Uint8Array<ArrayBuffer>>]>;
709
767
  }, z.core.$strip>>>;
710
768
  workdirSeed: z.ZodDefault<z.ZodArray<z.ZodObject<{
711
769
  path: z.ZodString;
712
- content: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
770
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodInstanceOf<Uint8Array<ArrayBuffer>>]>;
713
771
  }, z.core.$strip>>>;
714
772
  }, z.core.$strip>;
715
773
  export type ProductTemplateMaterials = z.infer<typeof ProductTemplateMaterialsSchema>;
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"];
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.64",
3
+ "version": "0.1.66",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@norskvideo/ctl-foundation": "^0.1.20",
52
52
  "yaml": "^2.8.0",
53
- "zod": "4.4.3"
53
+ "zod": "4.6.7"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/bun": "latest",