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

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/interfaces.d.ts CHANGED
@@ -42,6 +42,11 @@ export declare const MediaConversionSchema: z.ZodObject<{
42
42
  description: z.ZodOptional<z.ZodString>;
43
43
  target: z.ZodRecord<z.ZodString, z.ZodUnknown>;
44
44
  }, z.core.$strip>>>;
45
+ control: z.ZodOptional<z.ZodObject<{
46
+ route: z.ZodString;
47
+ protocol: z.ZodString;
48
+ version: z.ZodNumber;
49
+ }, z.core.$strip>>;
45
50
  bindings: z.ZodObject<{
46
51
  sourceUrl: z.ZodString;
47
52
  returnName: z.ZodString;
@@ -54,7 +59,7 @@ export type MediaConversion = z.infer<typeof MediaConversionSchema>;
54
59
  /** Everything wrong with a template's interface declarations, given the
55
60
  * parameters it declares. Only known interfaces are checked. Empty = fine. */
56
61
  export declare function interfaceDeclarationProblems(template: {
57
- manifest: Pick<ProductTemplateManifest, "interfaces">;
62
+ manifest: Pick<ProductTemplateManifest, "interfaces"> & Partial<Pick<ProductTemplateManifest, "proxy">>;
58
63
  parameters: Pick<ProductTemplateParameter, "name">[];
59
64
  }): string[];
60
65
  /** The template's norsk.io/media-conversion declaration, typed, if it
package/interfaces.js CHANGED
@@ -69,6 +69,13 @@ export const MediaConversionSchema = z.object({
69
69
  target: z.record(z.string(), z.unknown()),
70
70
  }))
71
71
  .optional(),
72
+ // The converter's own control API (live adjustments, preview, stills,
73
+ // levels), when it serves one: the declared route it is on and the protocol
74
+ // it speaks there. Whoever launched it calls it through the node's proxy
75
+ // with the production's launch credential. Optional, so additive in v2.
76
+ control: z
77
+ .object({ route: z.string().min(1), protocol: z.string().min(1), version: z.number().int().min(1) })
78
+ .optional(),
72
79
  // The template's own parameters the client fills, by role.
73
80
  bindings: z.object({
74
81
  sourceUrl: parameterName,
@@ -105,6 +112,10 @@ export function interfaceDeclarationProblems(template) {
105
112
  problems.push(`${at}: binding ${role} names ${param}, which is not a declared parameter`);
106
113
  }
107
114
  }
115
+ const control = parsed.data.control;
116
+ if (control && !(template.manifest.proxy?.routes ?? []).some((r) => r.segment === control.route)) {
117
+ problems.push(`${at}: control names route ${control.route}, which the template does not declare (proxy.routes)`);
118
+ }
108
119
  });
109
120
  return problems;
110
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-product-template-schema",
3
- "version": "0.1.67",
3
+ "version": "0.1.68",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",