@norskvideo/ctl-product-template-schema 0.1.55 → 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 (4) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
  3. package/read.d.ts +12 -0
  4. package/read.js +17 -0
package/index.js CHANGED
@@ -240,7 +240,7 @@ export const ProductTemplateSideloadSchema = z
240
240
  export const ProductTemplateHostTlsSchema = z
241
241
  .object({
242
242
  services: z.array(z.string().min(1)).min(1).meta({
243
- description: "Compose services that get the host certificate. Each must be a service in the template's own compose.yml. The runner mounts the certificate and key read-only at /etc/norsk-host-tls (cert.pem, key.pem) and sets NORSK_HOST_TLS_DIR=/etc/norsk-host-tls and NORSK_HOST_TLS_TRUSTED=true|false (true when the certificate is a real, browser-trusted one; false when the host's is self-signed). A host with no certificate mounts nothing and sets neither variable; the launch still goes ahead.",
243
+ description: "Compose services that get the host certificate. Each must be a service in the template's own compose.yml. The runner mounts the certificate and key read-only at /etc/norsk-host-tls (cert.pem, key.pem) and sets NORSK_HOST_TLS_DIR=/etc/norsk-host-tls. A host with no certificate mounts nothing and sets no variable; the launch still goes ahead.",
244
244
  }),
245
245
  })
246
246
  .meta({ id: "ProductTemplateHostTls", outputId: "ProductTemplateHostTls" });
@@ -255,7 +255,7 @@ export const ProductTemplateHostTlsSchema = z
255
255
  export const ProductTemplateWorkdirSchema = z
256
256
  .object({
257
257
  services: z.array(z.string().min(1)).min(1).meta({
258
- description: "Compose services that get the instance working directory, read-write at /data -- the same directory, at the same path, that media and studio have -- with NORSK_WORKDIR=/data. Each must be a service in the template's own compose.yml. It survives relaunch, restart and runner upgrade; only `instance delete --purge` removes it.",
258
+ description: "Compose services that get the instance working directory, read-write at /data -- the same directory, at the same path, that media and studio have. Each must be a service in the template's own compose.yml. It survives relaunch, restart and runner upgrade; only `instance delete --purge` removes it.",
259
259
  }),
260
260
  })
261
261
  .meta({ id: "ProductTemplateWorkdir", outputId: "ProductTemplateWorkdir" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-product-template-schema",
3
- "version": "0.1.55",
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