@norskvideo/ctl-sdk 0.1.43 → 0.1.45
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/manifest-schema.d.ts +2 -2
- package/manifest-schema.js +1 -1
- package/package.json +1 -1
- package/parsing.d.ts +6 -0
- package/parsing.js +11 -1
- package/product-types.d.ts +1 -1
package/manifest-schema.d.ts
CHANGED
|
@@ -98,9 +98,9 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
98
98
|
}, z.core.$strip>>>;
|
|
99
99
|
request: z.ZodOptional<z.ZodObject<{
|
|
100
100
|
method: z.ZodEnum<{
|
|
101
|
-
PUT: "PUT";
|
|
102
101
|
GET: "GET";
|
|
103
102
|
POST: "POST";
|
|
103
|
+
PUT: "PUT";
|
|
104
104
|
DELETE: "DELETE";
|
|
105
105
|
}>;
|
|
106
106
|
path: z.ZodString;
|
|
@@ -108,9 +108,9 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
108
108
|
}, z.core.$strip>>>;
|
|
109
109
|
request: z.ZodOptional<z.ZodObject<{
|
|
110
110
|
method: z.ZodEnum<{
|
|
111
|
-
PUT: "PUT";
|
|
112
111
|
GET: "GET";
|
|
113
112
|
POST: "POST";
|
|
113
|
+
PUT: "PUT";
|
|
114
114
|
DELETE: "DELETE";
|
|
115
115
|
}>;
|
|
116
116
|
path: z.ZodString;
|
package/manifest-schema.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PLATFORM_ROLE_LADDER, parseProductRoleName } from "@norskvideo/ctl-foundation";
|
|
1
|
+
import { PLATFORM_ROLE_LADDER, parseProductRoleName } from "@norskvideo/ctl-foundation/browser";
|
|
2
2
|
import { ProductTemplateRequirementsSchema } from "@norskvideo/ctl-product-template-schema";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
const TargetSchema = z.enum(["norsk-ctl", "docker-compose"]);
|
package/package.json
CHANGED
package/parsing.d.ts
CHANGED
|
@@ -6,4 +6,10 @@ export declare function parseSpec(raw: unknown, where: string, path: string): Pr
|
|
|
6
6
|
export interface ProductsFile {
|
|
7
7
|
products: ProductRegistration[];
|
|
8
8
|
}
|
|
9
|
+
/** The products file's schema version. Unstamped files are version 0 (every
|
|
10
|
+
* file written so far); a file stamped with a higher version was written by
|
|
11
|
+
* a newer norsk-ctl or norsk-mgr and is refused rather than misread, the
|
|
12
|
+
* rule every other store follows. Bump when the shape changes and add the
|
|
13
|
+
* migration at the store. */
|
|
14
|
+
export declare const PRODUCTS_FILE_VERSION = 0;
|
|
9
15
|
export declare function parseProductsFile(raw: unknown, path: string): ProductsFile;
|
package/parsing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parsePlatformRole } from "@norskvideo/ctl-foundation";
|
|
1
|
+
import { parsePlatformRole } from "@norskvideo/ctl-foundation/browser";
|
|
2
2
|
import { ManifestSchema } from "./manifest-schema.js";
|
|
3
3
|
export class ProductsParseError extends Error {
|
|
4
4
|
constructor(path, reason) {
|
|
@@ -60,9 +60,19 @@ function parseLicense(raw, where, path) {
|
|
|
60
60
|
}
|
|
61
61
|
throw new ProductsParseError(path, `${where}.license.mode must be 'byol' or 'marketplace'`);
|
|
62
62
|
}
|
|
63
|
+
/** The products file's schema version. Unstamped files are version 0 (every
|
|
64
|
+
* file written so far); a file stamped with a higher version was written by
|
|
65
|
+
* a newer norsk-ctl or norsk-mgr and is refused rather than misread, the
|
|
66
|
+
* rule every other store follows. Bump when the shape changes and add the
|
|
67
|
+
* migration at the store. */
|
|
68
|
+
export const PRODUCTS_FILE_VERSION = 0;
|
|
63
69
|
export function parseProductsFile(raw, path) {
|
|
64
70
|
if (!isRecord(raw))
|
|
65
71
|
throw new ProductsParseError(path, "file is not a YAML object");
|
|
72
|
+
if (typeof raw.version === "number" && raw.version > PRODUCTS_FILE_VERSION) {
|
|
73
|
+
throw new ProductsParseError(path, `is at version ${raw.version}, written by a newer norsk-ctl/norsk-mgr; this one understands up to ${PRODUCTS_FILE_VERSION}. ` +
|
|
74
|
+
"Run the newer one, or restore the pre-upgrade copy kept beside the file.");
|
|
75
|
+
}
|
|
66
76
|
const products = raw.products;
|
|
67
77
|
if (products === undefined)
|
|
68
78
|
return { products: [] };
|
package/product-types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PlatformRole } from "@norskvideo/ctl-foundation";
|
|
1
|
+
import type { PlatformRole } from "@norskvideo/ctl-foundation/browser";
|
|
2
2
|
import type { Manifest } from "./manifest-schema.js";
|
|
3
3
|
export type ProductSpec =
|
|
4
4
|
/** `env` is the deploy-time environment for the control-plane container,
|