@norskvideo/ctl-product-template-schema 0.1.56 → 0.1.57

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/package.json +1 -1
  2. package/read.d.ts +12 -0
  3. package/read.js +17 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-product-template-schema",
3
- "version": "0.1.56",
3
+ "version": "0.1.57",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
package/read.d.ts CHANGED
@@ -1,5 +1,17 @@
1
1
  import type { ProductTemplateParameter } from "./index.js";
2
2
  import { type ProductTemplateManifest } from "./index.js";
3
+ /** The NORSK_ prefix is platform-injected (runtime identity, allocated ports,
4
+ * the licence path...); mgr already refuses an operator value for one, so a
5
+ * product declaring one asks for a value nobody may give it.
6
+ *
7
+ * WARN-ONLY FOR ONE RELEASE, then a refusal (a superRefine on
8
+ * ProductTemplateParameterSchema.name). Release order: relay (its NORSK_IMAGE
9
+ * parameter became MEDIA_IMAGE) and db-chanel (NORSK_CTL_URL became CTL_URL)
10
+ * ship first, then ctl and mgr with this warning, then the refusal. The
11
+ * callers log what this returns at import, refresh, upload and metadata
12
+ * update; nothing re-validates stored templates at startup. */
13
+ export declare const RESERVED_PARAMETER_PREFIX = "NORSK_";
14
+ export declare function reservedParameterNameWarnings(parameters: readonly ProductTemplateParameter[]): string[];
3
15
  /**
4
16
  * Error taxonomy for product-template lifecycle issues. Codes cover both the
5
17
  * "store + extract" path (ctl's ProductTemplateService — extraction, manifest
package/read.js CHANGED
@@ -9,6 +9,23 @@
9
9
  // mgr (which stores raw bytes for relay) does not — so compose presence is a
10
10
  // reported fact here, not a verdict.
11
11
  import { ParametersFileSchema, ProductTemplateManifestSchema } from "./index.js";
12
+ /** The NORSK_ prefix is platform-injected (runtime identity, allocated ports,
13
+ * the licence path...); mgr already refuses an operator value for one, so a
14
+ * product declaring one asks for a value nobody may give it.
15
+ *
16
+ * WARN-ONLY FOR ONE RELEASE, then a refusal (a superRefine on
17
+ * ProductTemplateParameterSchema.name). Release order: relay (its NORSK_IMAGE
18
+ * parameter became MEDIA_IMAGE) and db-chanel (NORSK_CTL_URL became CTL_URL)
19
+ * ship first, then ctl and mgr with this warning, then the refusal. The
20
+ * callers log what this returns at import, refresh, upload and metadata
21
+ * update; nothing re-validates stored templates at startup. */
22
+ export const RESERVED_PARAMETER_PREFIX = "NORSK_";
23
+ export function reservedParameterNameWarnings(parameters) {
24
+ return parameters
25
+ .filter((p) => p.name.startsWith(RESERVED_PARAMETER_PREFIX))
26
+ .map((p) => `parameter '${p.name}' uses the reserved ${RESERVED_PARAMETER_PREFIX} prefix, which the platform sets; ` +
27
+ "rename it without the prefix. A later release refuses such templates");
28
+ }
12
29
  /**
13
30
  * Error taxonomy for product-template lifecycle issues. Codes cover both the
14
31
  * "store + extract" path (ctl's ProductTemplateService — extraction, manifest