@uns-kit/core 3.0.6 → 3.0.7

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 (31) hide show
  1. package/MIGRATIONS.md +26 -3
  2. package/dist/config/project.config.extension.d.ts +1 -1
  3. package/dist/config/project.config.extension.d.ts.map +1 -1
  4. package/dist/logger.d.ts.map +1 -1
  5. package/dist/logger.js +29 -30
  6. package/dist/logger.js.map +1 -1
  7. package/dist/tools/generate-config-schema.js +67 -11
  8. package/dist/tools/generate-config-schema.js.map +1 -1
  9. package/dist/uns/uns-attributes.d.ts +2 -2
  10. package/dist/uns/uns-interfaces.d.ts +5 -1
  11. package/dist/uns/uns-interfaces.d.ts.map +1 -1
  12. package/dist/uns/uns-interfaces.js.map +1 -1
  13. package/dist/uns-config/config-schema.d.ts +405 -5
  14. package/dist/uns-config/config-schema.d.ts.map +1 -1
  15. package/dist/uns-config/host-placeholders.d.ts +14 -98
  16. package/dist/uns-config/host-placeholders.d.ts.map +1 -1
  17. package/dist/uns-config/schema-tolls.d.ts +1 -2
  18. package/dist/uns-config/schema-tolls.d.ts.map +1 -1
  19. package/dist/uns-config/schema-tolls.js +2 -4
  20. package/dist/uns-config/schema-tolls.js.map +1 -1
  21. package/dist/uns-config/schema-tools.d.ts +6 -1
  22. package/dist/uns-config/schema-tools.d.ts.map +1 -1
  23. package/dist/uns-config/schema-tools.js +7 -8
  24. package/dist/uns-config/schema-tools.js.map +1 -1
  25. package/dist/uns-config/secret-placeholders.d.ts +8 -86
  26. package/dist/uns-config/secret-placeholders.d.ts.map +1 -1
  27. package/dist/uns-config/uns-core-schema.d.ts +191 -3106
  28. package/dist/uns-config/uns-core-schema.d.ts.map +1 -1
  29. package/dist/uns-config/uns-core-schema.js +61 -68
  30. package/dist/uns-config/uns-core-schema.js.map +1 -1
  31. package/package.json +3 -4
package/MIGRATIONS.md CHANGED
@@ -9,6 +9,31 @@ Agents must inspect the application's existing ownership and shutdown flow
9
9
  before editing it. The examples below describe the intended behavior, not a
10
10
  mechanical search-and-replace operation.
11
11
 
12
+ ## 3.0.7 - Zod 4 configuration contracts
13
+
14
+ Apply this migration when upgrading from `@uns-kit/core` `<3.0.7` to
15
+ `>=3.0.7`.
16
+
17
+ `@uns-kit/core` and `@uns-kit/database` now use Zod 4. Applications that own a
18
+ `src/config/project.config.extension.ts` file must use the same Zod major at the
19
+ schema-composition boundary. Update the application's direct `zod` dependency
20
+ to `^4.4.3` before regenerating configuration artifacts.
21
+
22
+ The UNS core and database schemas preserve their previous accepted inputs and
23
+ defaults. The migration is nevertheless source-sensitive for applications that
24
+ inspect Zod internals or use Zod-3-only type aliases. Replace those seams with
25
+ the public Zod 4 API:
26
+
27
+ - replace `z.AnyZodObject` with `z.ZodObject<z.ZodRawShape>`;
28
+ - replace `z.ZodTypeAny` with `z.ZodType` where a broad schema type is needed;
29
+ - read object keys through `.shape`, not `_def.shape()`;
30
+ - pass both key and value schemas to `z.record(keySchema, valueSchema)`;
31
+ - prefer object `.extend()` or shape spreading over deprecated `.merge()`.
32
+
33
+ After updating the extension schema, run `pnpm run generate-config-schema` and
34
+ check both `config.schema.json` and `src/config/app-config.ts`. Then run the
35
+ application's typecheck and its existing configuration compatibility tests.
36
+
12
37
  ## 3.0.0 - MQTT table columns use named objects
13
38
 
14
39
  Apply this migration when upgrading from `@uns-kit/core` `<3.0.0` to
@@ -22,9 +47,7 @@ column directly addressable as, for example,
22
47
  Before:
23
48
 
24
49
  ```ts
25
- columns: [
26
- { name: "power", type: "double", value: 42.1, uom: "kW" },
27
- ]
50
+ columns: [{ name: "power", type: "double", value: 42.1, uom: "kW" }];
28
51
  ```
29
52
 
30
53
  After:
@@ -1,4 +1,4 @@
1
1
  import { z } from "zod";
2
- export declare const projectExtrasSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
2
+ export declare const projectExtrasSchema: z.ZodObject<{}, z.core.$strip>;
3
3
  export type ProjectExtras = z.infer<typeof projectExtrasSchema>;
4
4
  //# sourceMappingURL=project.config.extension.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"project.config.extension.d.ts","sourceRoot":"","sources":["../../src/config/project.config.extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB,gDAAe,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"project.config.extension.d.ts","sourceRoot":"","sources":["../../src/config/project.config.extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB,gCAAe,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAuEA,QAAA,MAAM,MAAM,0BAiBV,CAAC;AAEH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,4BAY3C;AAED,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAyEA,QAAA,MAAM,MAAM,0BAiBV,CAAC;AAEH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,4BAU3C;AAED,eAAe,MAAM,CAAC"}
package/dist/logger.js CHANGED
@@ -1,14 +1,15 @@
1
- import { createLogger, format, transports } from 'winston';
2
- import GelfTransport from 'winston-gelf';
3
- import os from 'os';
4
- import path from 'path';
5
- import fs from 'fs';
6
- import { fileURLToPath } from 'url';
7
- import { ConfigFile } from './config-file.js';
1
+ /// <reference path="./types/winston-gelf.d.ts" />
2
+ import fs from "fs";
3
+ import os from "os";
4
+ import path from "path";
5
+ import { fileURLToPath } from "url";
6
+ import { createLogger, format, transports } from "winston";
7
+ import GelfTransport from "winston-gelf";
8
+ import { ConfigFile } from "./config-file.js";
8
9
  function loadPackageMeta() {
9
- const packageJsonPath = path.join(process.cwd(), 'package.json');
10
+ const packageJsonPath = path.join(process.cwd(), "package.json");
10
11
  try {
11
- const raw = fs.readFileSync(packageJsonPath, 'utf8');
12
+ const raw = fs.readFileSync(packageJsonPath, "utf8");
12
13
  const packageMeta = JSON.parse(raw);
13
14
  if (packageMeta.name || packageMeta.version) {
14
15
  return packageMeta;
@@ -30,54 +31,52 @@ function loadLoggingConfig() {
30
31
  const packageMeta = loadPackageMeta();
31
32
  const loggingConfig = loadLoggingConfig();
32
33
  const gelfMeta = {
33
- service: packageMeta.name ?? 'unknown-service',
34
- version: packageMeta.version ?? 'unknown',
35
- environment: process.env.NODE_ENV || 'unknown',
36
- hostname: os.hostname()
34
+ service: packageMeta.name ?? "unknown-service",
35
+ version: packageMeta.version ?? "unknown",
36
+ environment: process.env.NODE_ENV || "unknown",
37
+ hostname: os.hostname(),
37
38
  };
38
- const consoleFormat = format.combine(format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), format.errors({ stack: true }), format.splat(), format.json());
39
+ const consoleFormat = format.combine(format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), format.errors({ stack: true }), format.splat(), format.json());
39
40
  const loggerTransports = [
40
41
  new transports.Console({
41
- format: consoleFormat
42
- })
42
+ format: consoleFormat,
43
+ }),
43
44
  ];
44
45
  if (loggingConfig) {
45
46
  loggerTransports.push(new GelfTransport({
46
47
  format: format((info) => ({
47
48
  ...info,
48
- ...gelfMeta
49
+ ...gelfMeta,
49
50
  }))(),
50
51
  gelfPro: {
51
52
  adapterName: loggingConfig.adapter,
52
53
  adapterOptions: {
53
54
  host: loggingConfig.host,
54
- port: loggingConfig.port
55
- }
56
- }
55
+ port: loggingConfig.port,
56
+ },
57
+ },
57
58
  }));
58
59
  }
59
60
  const logger = createLogger({
60
- level: loggingConfig?.level ?? 'info',
61
- format: format.combine(format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), format.errors({ stack: true }), // Include stack trace
61
+ level: loggingConfig?.level ?? "info",
62
+ format: format.combine(format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), format.errors({ stack: true }), // Include stack trace
62
63
  format.splat(), format.json()),
63
64
  transports: loggerTransports,
64
65
  exceptionHandlers: [
65
66
  new transports.Console({
66
- format: consoleFormat
67
+ format: consoleFormat,
67
68
  }), // Log exceptions to console
68
69
  // Remove exception logging to file
69
70
  // new transports.File({ filename: 'logs/exceptions.log' })
70
- ]
71
+ ],
71
72
  });
72
73
  export function getLogger(modulePath) {
73
- const normalizedModulePath = modulePath.startsWith('file:')
74
- ? fileURLToPath(modulePath)
75
- : modulePath;
74
+ const normalizedModulePath = modulePath.startsWith("file:") ? fileURLToPath(modulePath) : modulePath;
76
75
  const relativePath = path.relative(process.cwd(), normalizedModulePath);
77
- const withoutExt = relativePath.replace(/\.[^/.]+$/, '');
78
- const dotted = withoutExt.split(path.sep).join('.');
76
+ const withoutExt = relativePath.replace(/\.[^/.]+$/, "");
77
+ const dotted = withoutExt.split(path.sep).join(".");
79
78
  return logger.child({
80
- facility: dotted
79
+ facility: dotted,
81
80
  });
82
81
  }
83
82
  export default logger;
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,aAAa,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,SAAS,eAAe;IACtB,MAAM,eAAe,GAAG,IAAI,CA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MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;IACxD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAEnD,OAAO,MAAM,CAAC,KAAK,CAAC;QAClB,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAA;AACJ,CAAC;AAED,eAAe,MAAM,CAAA","sourcesContent":["import { createLogger, format, transports } from 'winston';\nimport GelfTransport from 'winston-gelf'\nimport os from 'os'\nimport path from 'path'\nimport fs from 'fs'\nimport { fileURLToPath } from 'url';\nimport { ConfigFile } from './config-file.js'\n\nfunction loadPackageMeta(): { name?: string; version?: string } {\n const packageJsonPath = path.join(process.cwd(), 'package.json')\n\n try {\n const raw = fs.readFileSync(packageJsonPath, 'utf8')\n const packageMeta = JSON.parse(raw) as { name?: string; version?: string }\n if (packageMeta.name || packageMeta.version) {\n return packageMeta\n }\n } catch {\n // Use unknown values when the application package metadata is unavailable.\n }\n\n return {}\n}\n\nfunction loadLoggingConfig() {\n try {\n return ConfigFile.loadRawConfig().logging\n } catch {\n return undefined\n }\n}\n\nconst packageMeta = loadPackageMeta()\nconst loggingConfig = loadLoggingConfig()\nconst gelfMeta = {\n service: packageMeta.name ?? 'unknown-service',\n version: packageMeta.version ?? 'unknown',\n environment: process.env.NODE_ENV || 'unknown',\n hostname: os.hostname()\n}\nconst consoleFormat = format.combine(\n format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),\n format.errors({ stack: true }),\n format.splat(),\n format.json()\n)\n\nconst loggerTransports = [\n new transports.Console({\n format: consoleFormat\n })\n]\n\nif (loggingConfig) {\n loggerTransports.push(\n new GelfTransport({\n format: format((info) => ({\n ...info,\n ...gelfMeta\n }))(),\n gelfPro: {\n adapterName: loggingConfig.adapter,\n adapterOptions: {\n host: loggingConfig.host,\n port: loggingConfig.port\n }\n }\n })\n )\n}\n\nconst logger = createLogger({\n level: loggingConfig?.level ?? 'info',\n\n format: format.combine(\n format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),\n format.errors({ stack: true }), // Include stack trace\n format.splat(),\n format.json()\n ),\n transports: loggerTransports,\n exceptionHandlers: [\n new transports.Console({\n format: consoleFormat\n }), // Log exceptions to console\n // Remove exception logging to file\n // new transports.File({ filename: 'logs/exceptions.log' })\n ]\n});\n\nexport function getLogger(modulePath: string) {\n const normalizedModulePath = modulePath.startsWith('file:')\n ? fileURLToPath(modulePath)\n : modulePath\n\n const relativePath = path.relative(process.cwd(), normalizedModulePath)\n const withoutExt = relativePath.replace(/\\.[^/.]+$/, '')\n const dotted = withoutExt.split(path.sep).join('.')\n\n return logger.child({\n facility: dotted\n })\n}\n\nexport default logger\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,aAAa,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,SAAS,eAAe;IACtB,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;IAEjE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QACrD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAwC,CAAC;QAC3E,IAAI,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,OAAO,EAAE,CAA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,CAAC","sourcesContent":["/// <reference path=\"./types/winston-gelf.d.ts\" />\nimport fs from \"fs\";\nimport os from \"os\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { createLogger, format, transports } from \"winston\";\nimport GelfTransport from \"winston-gelf\";\n\nimport { ConfigFile } from \"./config-file.js\";\n\nfunction loadPackageMeta(): { name?: string; version?: string } {\n const packageJsonPath = path.join(process.cwd(), \"package.json\");\n\n try {\n const raw = fs.readFileSync(packageJsonPath, \"utf8\");\n const packageMeta = JSON.parse(raw) as { name?: string; version?: string };\n if (packageMeta.name || packageMeta.version) {\n return packageMeta;\n }\n } catch {\n // Use unknown values when the application package metadata is unavailable.\n }\n\n return {};\n}\n\nfunction loadLoggingConfig() {\n try {\n return ConfigFile.loadRawConfig().logging;\n } catch {\n return undefined;\n }\n}\n\nconst packageMeta = loadPackageMeta();\nconst loggingConfig = loadLoggingConfig();\nconst gelfMeta = {\n service: packageMeta.name ?? \"unknown-service\",\n version: packageMeta.version ?? \"unknown\",\n environment: process.env.NODE_ENV || \"unknown\",\n hostname: os.hostname(),\n};\nconst consoleFormat = format.combine(\n format.timestamp({ format: \"YYYY-MM-DD HH:mm:ss\" }),\n format.errors({ stack: true }),\n format.splat(),\n format.json(),\n);\n\nconst loggerTransports = [\n new transports.Console({\n format: consoleFormat,\n }),\n];\n\nif (loggingConfig) {\n loggerTransports.push(\n new GelfTransport({\n format: format((info) => ({\n ...info,\n ...gelfMeta,\n }))(),\n gelfPro: {\n adapterName: loggingConfig.adapter,\n adapterOptions: {\n host: loggingConfig.host,\n port: loggingConfig.port,\n },\n },\n }),\n );\n}\n\nconst logger = createLogger({\n level: loggingConfig?.level ?? \"info\",\n\n format: format.combine(\n format.timestamp({ format: \"YYYY-MM-DD HH:mm:ss\" }),\n format.errors({ stack: true }), // Include stack trace\n format.splat(),\n format.json(),\n ),\n transports: loggerTransports,\n exceptionHandlers: [\n new transports.Console({\n format: consoleFormat,\n }), // Log exceptions to console\n // Remove exception logging to file\n // new transports.File({ filename: 'logs/exceptions.log' })\n ],\n});\n\nexport function getLogger(modulePath: string) {\n const normalizedModulePath = modulePath.startsWith(\"file:\") ? fileURLToPath(modulePath) : modulePath;\n\n const relativePath = path.relative(process.cwd(), normalizedModulePath);\n const withoutExt = relativePath.replace(/\\.[^/.]+$/, \"\");\n const dotted = withoutExt.split(path.sep).join(\".\");\n\n return logger.child({\n facility: dotted,\n });\n}\n\nexport default logger;\n"]}
@@ -1,15 +1,48 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
- import { zodToJsonSchema } from "zod-to-json-schema";
5
- import { zodToTs, printNode, withGetType } from "zod-to-ts";
4
+ import { z } from "zod";
5
+ import { createAuxiliaryTypeStore, printNode, zodToTs } from "zod-to-ts";
6
6
  import { hostValueSchema } from "../uns-config/host-placeholders.js";
7
- import { secretValueSchema } from "../uns-config/secret-placeholders.js";
8
7
  import { composeConfigSchema } from "../uns-config/schema-tools.js";
8
+ import { secretValueSchema } from "../uns-config/secret-placeholders.js";
9
9
  function write(filePath, data) {
10
10
  fs.mkdirSync(path.dirname(filePath), { recursive: true });
11
11
  fs.writeFileSync(filePath, data);
12
12
  }
13
+ function normalizeLegacyJsonSchema(value) {
14
+ if (Array.isArray(value)) {
15
+ value.forEach(normalizeLegacyJsonSchema);
16
+ return;
17
+ }
18
+ if (!value || typeof value !== "object") {
19
+ return;
20
+ }
21
+ const schema = value;
22
+ Object.values(schema).forEach(normalizeLegacyJsonSchema);
23
+ if (schema.type === "number" && schema.multipleOf === 1) {
24
+ schema.type = "integer";
25
+ delete schema.multipleOf;
26
+ }
27
+ if (schema.format === "email") {
28
+ delete schema.pattern;
29
+ }
30
+ if (Array.isArray(schema.oneOf) && !schema.anyOf) {
31
+ schema.anyOf = schema.oneOf;
32
+ delete schema.oneOf;
33
+ }
34
+ if (Array.isArray(schema.anyOf)) {
35
+ const literalOptions = schema.anyOf;
36
+ const literalType = literalOptions[0]?.type;
37
+ if (literalOptions.length > 0 &&
38
+ typeof literalType === "string" &&
39
+ literalOptions.every((option) => option.type === literalType && Object.hasOwn(option, "const"))) {
40
+ schema.type = literalType;
41
+ schema.enum = literalOptions.map((option) => option.const);
42
+ delete schema.anyOf;
43
+ }
44
+ }
45
+ }
13
46
  let tsLoaderReady = false;
14
47
  async function ensureTsLoader() {
15
48
  if (tsLoaderReady) {
@@ -19,7 +52,7 @@ async function ensureTsLoader() {
19
52
  try {
20
53
  await import("tsx/esm");
21
54
  }
22
- catch (error) {
55
+ catch {
23
56
  throw new Error("Unable to load TypeScript project.config.extension. Install 'tsx' (e.g. pnpm add -D tsx) or provide a compiled JavaScript file.");
24
57
  }
25
58
  }
@@ -53,18 +86,40 @@ async function loadProjectExtrasSchema() {
53
86
  // Keep placeholder-backed values as plain strings in the generated TypeScript typings so
54
87
  // consuming code reflects the resolved shapes while the JSON schema still exposes full unions.
55
88
  const renderAsString = (typescript) => typescript.factory.createKeywordTypeNode(typescript.SyntaxKind.StringKeyword);
56
- for (const schema of [hostValueSchema, secretValueSchema]) {
57
- withGetType(schema, renderAsString);
58
- }
89
+ const typeOverrides = new Map();
90
+ typeOverrides.set(hostValueSchema, renderAsString);
91
+ typeOverrides.set(secretValueSchema, renderAsString);
59
92
  const { unsCoreSchema } = await import("../uns-config/uns-core-schema.js");
60
93
  const projectExtrasSchema = await loadProjectExtrasSchema();
61
94
  const baseSchema = composeConfigSchema(unsCoreSchema, projectExtrasSchema).strict();
62
95
  // 1) JSON Schema for VS Code $schema
63
- const jsonSchema = zodToJsonSchema(baseSchema, "AppConfig");
96
+ const generatedJsonSchema = z.toJSONSchema(baseSchema, {
97
+ io: "input",
98
+ reused: "inline",
99
+ target: "draft-07",
100
+ });
101
+ normalizeLegacyJsonSchema(generatedJsonSchema);
102
+ const { $schema, definitions: reusedDefinitions, ...appConfigDefinition } = generatedJsonSchema;
103
+ const jsonSchema = {
104
+ $ref: "#/definitions/AppConfig",
105
+ definitions: {
106
+ AppConfig: appConfigDefinition,
107
+ ...(reusedDefinitions ?? {}),
108
+ },
109
+ $schema,
110
+ };
64
111
  write(path.resolve("config.schema.json"), JSON.stringify(jsonSchema, null, 2));
65
112
  // 2) TypeScript `export type AppConfig = {...}`
66
- const { node } = zodToTs(baseSchema, "AppConfig");
67
- const interfaceBody = printNode(node);
113
+ const auxiliaryTypeStore = createAuxiliaryTypeStore();
114
+ const { node } = zodToTs(baseSchema, {
115
+ auxiliaryTypeStore,
116
+ io: "input",
117
+ overrides: typeOverrides,
118
+ });
119
+ const interfaceBody = printNode(node)
120
+ .replace(/^\s*\[x: string\]: never;\n/gm, "")
121
+ .replace(/\[key: string\]:/g, "[x: string]:");
122
+ const auxiliaryTypes = [...auxiliaryTypeStore.definitions.values()].map((definition) => printNode(definition.node)).join("\n");
68
123
  let shouldAugment = true;
69
124
  try {
70
125
  const pkgJsonPath = path.resolve(process.cwd(), "package.json");
@@ -81,7 +136,8 @@ catch {
81
136
  const augmentationBlock = shouldAugment
82
137
  ? `\n\ntype GeneratedProjectAppConfig = ProjectAppConfig;\ntype GeneratedAppConfig = AppConfig;\n\ndeclare module "@uns-kit/core/config/app-config.js" {\n interface ProjectAppConfig extends GeneratedProjectAppConfig {}\n interface AppConfig extends GeneratedAppConfig {}\n}\n`
83
138
  : "\n";
84
- const tsContent = `/* Auto-generated. Do not edit by hand. */\nexport interface ProjectAppConfig ${interfaceBody}\n\nexport interface AppConfig extends ProjectAppConfig {}${augmentationBlock}`;
139
+ const auxiliaryPreamble = auxiliaryTypes ? `${auxiliaryTypes}\n\n` : "";
140
+ const tsContent = `/* Auto-generated. Do not edit by hand. */\n${auxiliaryPreamble}export interface ProjectAppConfig ${interfaceBody}\n\nexport interface AppConfig extends ProjectAppConfig {}${augmentationBlock}`;
85
141
  write(path.resolve("./src/config/app-config.ts"), tsContent);
86
142
  console.log("Generated config.schema.json and updated src/config/app-config.ts");
87
143
  //# sourceMappingURL=generate-config-schema.js.map
@@ -1 +1 @@
1
- {"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AC;AACH,CAAC;AAAC,MAAM,CAAC;IACP,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC;AAED,MAAM,iBAAiB,GAAG,aAAa;IACrC,CAAC,CAAC,oRAAoR;IACtR,CAAC,CAAC,IAAI,CAAC;AAET,MAAM,SAAS,GAAG,iFAAiF,aAAa,6DAA6D,iBAAiB,EAAE,CAAC;AAEjM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,4BAA4B,CAAC,EAAE,SAAS,CAAC,CAAC;AAE7D,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC","sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { zodToJsonSchema } from \"zod-to-json-schema\";\nimport { zodToTs, printNode, withGetType } from \"zod-to-ts\";\nimport { z } from \"zod\";\n\nimport { hostValueSchema } from \"../uns-config/host-placeholders.js\";\nimport { secretValueSchema } from \"../uns-config/secret-placeholders.js\";\nimport { composeConfigSchema } from \"../uns-config/schema-tools.js\";\n\nfunction write(filePath: string, data: string) {\n fs.mkdirSync(path.dirname(filePath), { recursive: true });\n fs.writeFileSync(filePath, data);\n}\n\nlet tsLoaderReady = false;\n\nasync function ensureTsLoader(): Promise<void> {\n if (tsLoaderReady) {\n return;\n }\n tsLoaderReady = true;\n try {\n await import(\"tsx/esm\");\n } catch (error) {\n throw new Error(\n \"Unable to load TypeScript project.config.extension. Install 'tsx' (e.g. pnpm add -D tsx) or provide a compiled JavaScript file.\",\n );\n }\n}\n\nasync function loadProjectExtrasSchema(): Promise<z.AnyZodObject> {\n const base = path.resolve(process.cwd(), \"src/config/project.config.extension\");\n const extensions = [\"\", \".ts\", \".mts\", \".tsx\", \".js\", \".mjs\", \".cjs\"];\n\n for (const ext of extensions) {\n const candidate = ext ? `${base}${ext}` : base;\n if (!fs.existsSync(candidate)) {\n continue;\n }\n\n const lowerExt = path.extname(candidate).toLowerCase();\n try {\n if (lowerExt === \".ts\" || lowerExt === \".mts\" || lowerExt === \".tsx\") {\n await ensureTsLoader();\n }\n\n const module = await import(pathToFileURL(candidate).href);\n if (module?.projectExtrasSchema) {\n return module.projectExtrasSchema as z.AnyZodObject;\n }\n\n throw new Error(`Module '${candidate}' does not export projectExtrasSchema.`);\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n throw new Error(`Failed to load project config extension at '${candidate}': ${reason}`);\n }\n }\n\n const coreModule = await import(\"../config/project.config.extension.js\");\n return coreModule.projectExtrasSchema as z.AnyZodObject;\n}\n\n// Keep placeholder-backed values as plain strings in the generated TypeScript typings so\n// consuming code reflects the resolved shapes while the JSON schema still exposes full unions.\nconst renderAsString = (typescript: any) =>\n typescript.factory.createKeywordTypeNode(typescript.SyntaxKind.StringKeyword);\n\nfor (const schema of [hostValueSchema, secretValueSchema]) {\n withGetType(schema, renderAsString);\n}\n\nconst { unsCoreSchema } = await import(\"../uns-config/uns-core-schema.js\");\nconst projectExtrasSchema = await loadProjectExtrasSchema();\nconst baseSchema = composeConfigSchema(unsCoreSchema, projectExtrasSchema).strict();\n\n// 1) JSON Schema for VS Code $schema\nconst jsonSchema = zodToJsonSchema(baseSchema, \"AppConfig\");\nwrite(path.resolve(\"config.schema.json\"), JSON.stringify(jsonSchema, null, 2));\n\n// 2) TypeScript `export type AppConfig = {...}`\nconst { node } = zodToTs(baseSchema, \"AppConfig\");\nconst interfaceBody = printNode(node);\n\nlet shouldAugment = true;\ntry {\n const pkgJsonPath = path.resolve(process.cwd(), \"package.json\");\n if (fs.existsSync(pkgJsonPath)) {\n const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, \"utf8\"));\n if (pkg?.name === \"@uns-kit/core\") {\n shouldAugment = false;\n }\n }\n} catch {\n shouldAugment = true;\n}\n\nconst augmentationBlock = shouldAugment\n ? `\\n\\ntype GeneratedProjectAppConfig = ProjectAppConfig;\\ntype GeneratedAppConfig = AppConfig;\\n\\ndeclare module \"@uns-kit/core/config/app-config.js\" {\\n interface ProjectAppConfig extends GeneratedProjectAppConfig {}\\n interface AppConfig extends GeneratedAppConfig {}\\n}\\n`\n : \"\\n\";\n\nconst tsContent = `/* Auto-generated. Do not edit by hand. */\\nexport interface ProjectAppConfig ${interfaceBody}\\n\\nexport interface AppConfig extends ProjectAppConfig {}${augmentationBlock}`;\n\nwrite(path.resolve(\"./src/config/app-config.ts\"), tsContent);\n\nconsole.log(\"Generated config.schema.json and updated src/config/app-config.ts\");\n"]}
1
+ {"version":3,"file":"generate-config-schema.js","sourceRoot":"","sources":["../../src/tools/generate-config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAwB,wBAAwB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE/F,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAA2B,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,SAAS,KAAK,CAAC,QAAgB,EAAE,IAAY;IAC3C,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAID,SAAS,yBAAyB,CAAC,KAAc;IAC/C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,KAAK,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;QACzC,OAAO;IACT,CAAC;IACD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,O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,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;QAC7D,IAAI,GAAG,EAAE,IAAI,KAAK,eAAe,EAAE,CAAC;YAClC,aAAa,GAAG,KAAK,CAAC;QACxB,CAAC;IACH,CAAC;AACH,CAAC;AAAC,MAAM,CAAC;IACP,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC;AAED,MAAM,iBAAiB,GAAG,aAAa;IACrC,CAAC,CAAC,oRAAoR;IACtR,CAAC,CAAC,IAAI,CAAC;AAET,MAAM,iBAAiB,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AACxE,MAAM,SAAS,GAAG,+CAA+C,iBAAiB,qCAAqC,aAAa,6DAA6D,iBAAiB,EAAE,CAAC;AAErN,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,4BAA4B,CAAC,EAAE,SAAS,CAAC,CAAC;AAE7D,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC","sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { z } from \"zod\";\nimport { type TypeOverrideMap, createAuxiliaryTypeStore, printNode, zodToTs } from \"zod-to-ts\";\n\nimport { hostValueSchema } from \"../uns-config/host-placeholders.js\";\nimport { type ConfigObjectSchema, composeConfigSchema } from \"../uns-config/schema-tools.js\";\nimport { secretValueSchema } from \"../uns-config/secret-placeholders.js\";\n\nfunction write(filePath: string, data: string) {\n fs.mkdirSync(path.dirname(filePath), { recursive: true });\n fs.writeFileSync(filePath, data);\n}\n\ntype JsonSchemaRecord = Record<string, unknown>;\n\nfunction normalizeLegacyJsonSchema(value: unknown): void {\n if (Array.isArray(value)) {\n value.forEach(normalizeLegacyJsonSchema);\n return;\n }\n if (!value || typeof value !== \"object\") {\n return;\n }\n\n const schema = value as JsonSchemaRecord;\n Object.values(schema).forEach(normalizeLegacyJsonSchema);\n\n if (schema.type === \"number\" && schema.multipleOf === 1) {\n schema.type = \"integer\";\n delete schema.multipleOf;\n }\n if (schema.format === \"email\") {\n delete schema.pattern;\n }\n if (Array.isArray(schema.oneOf) && !schema.anyOf) {\n schema.anyOf = schema.oneOf;\n delete schema.oneOf;\n }\n\n if (Array.isArray(schema.anyOf)) {\n const literalOptions = schema.anyOf as JsonSchemaRecord[];\n const literalType = literalOptions[0]?.type;\n if (\n literalOptions.length > 0 &&\n typeof literalType === \"string\" &&\n literalOptions.every((option) => option.type === literalType && Object.hasOwn(option, \"const\"))\n ) {\n schema.type = literalType;\n schema.enum = literalOptions.map((option) => option.const);\n delete schema.anyOf;\n }\n }\n}\n\nlet tsLoaderReady = false;\n\nasync function ensureTsLoader(): Promise<void> {\n if (tsLoaderReady) {\n return;\n }\n tsLoaderReady = true;\n try {\n await import(\"tsx/esm\");\n } catch {\n throw new Error(\n \"Unable to load TypeScript project.config.extension. Install 'tsx' (e.g. pnpm add -D tsx) or provide a compiled JavaScript file.\",\n );\n }\n}\n\nasync function loadProjectExtrasSchema(): Promise<ConfigObjectSchema> {\n const base = path.resolve(process.cwd(), \"src/config/project.config.extension\");\n const extensions = [\"\", \".ts\", \".mts\", \".tsx\", \".js\", \".mjs\", \".cjs\"];\n\n for (const ext of extensions) {\n const candidate = ext ? `${base}${ext}` : base;\n if (!fs.existsSync(candidate)) {\n continue;\n }\n\n const lowerExt = path.extname(candidate).toLowerCase();\n try {\n if (lowerExt === \".ts\" || lowerExt === \".mts\" || lowerExt === \".tsx\") {\n await ensureTsLoader();\n }\n\n const module = await import(pathToFileURL(candidate).href);\n if (module?.projectExtrasSchema) {\n return module.projectExtrasSchema as ConfigObjectSchema;\n }\n\n throw new Error(`Module '${candidate}' does not export projectExtrasSchema.`);\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n throw new Error(`Failed to load project config extension at '${candidate}': ${reason}`);\n }\n }\n\n const coreModule = await import(\"../config/project.config.extension.js\");\n return coreModule.projectExtrasSchema as ConfigObjectSchema;\n}\n\n// Keep placeholder-backed values as plain strings in the generated TypeScript typings so\n// consuming code reflects the resolved shapes while the JSON schema still exposes full unions.\nconst renderAsString: TypeOverrideMap extends Map<unknown, infer TOverride> ? TOverride : never = (typescript) =>\n typescript.factory.createKeywordTypeNode(typescript.SyntaxKind.StringKeyword);\n\nconst typeOverrides: TypeOverrideMap = new Map();\ntypeOverrides.set(hostValueSchema, renderAsString);\ntypeOverrides.set(secretValueSchema, renderAsString);\n\nconst { unsCoreSchema } = await import(\"../uns-config/uns-core-schema.js\");\nconst projectExtrasSchema = await loadProjectExtrasSchema();\nconst baseSchema = composeConfigSchema(unsCoreSchema, projectExtrasSchema).strict();\n\n// 1) JSON Schema for VS Code $schema\nconst generatedJsonSchema = z.toJSONSchema(baseSchema, {\n io: \"input\",\n reused: \"inline\",\n target: \"draft-07\",\n});\nnormalizeLegacyJsonSchema(generatedJsonSchema);\nconst { $schema, definitions: reusedDefinitions, ...appConfigDefinition } = generatedJsonSchema;\nconst jsonSchema = {\n $ref: \"#/definitions/AppConfig\",\n definitions: {\n AppConfig: appConfigDefinition,\n ...((reusedDefinitions ?? {}) as Record<string, unknown>),\n },\n $schema,\n};\nwrite(path.resolve(\"config.schema.json\"), JSON.stringify(jsonSchema, null, 2));\n\n// 2) TypeScript `export type AppConfig = {...}`\nconst auxiliaryTypeStore = createAuxiliaryTypeStore();\nconst { node } = zodToTs(baseSchema, {\n auxiliaryTypeStore,\n io: \"input\",\n overrides: typeOverrides,\n});\nconst interfaceBody = printNode(node)\n .replace(/^\\s*\\[x: string\\]: never;\\n/gm, \"\")\n .replace(/\\[key: string\\]:/g, \"[x: string]:\");\nconst auxiliaryTypes = [...auxiliaryTypeStore.definitions.values()].map((definition) => printNode(definition.node)).join(\"\\n\");\n\nlet shouldAugment = true;\ntry {\n const pkgJsonPath = path.resolve(process.cwd(), \"package.json\");\n if (fs.existsSync(pkgJsonPath)) {\n const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, \"utf8\"));\n if (pkg?.name === \"@uns-kit/core\") {\n shouldAugment = false;\n }\n }\n} catch {\n shouldAugment = true;\n}\n\nconst augmentationBlock = shouldAugment\n ? `\\n\\ntype GeneratedProjectAppConfig = ProjectAppConfig;\\ntype GeneratedAppConfig = AppConfig;\\n\\ndeclare module \"@uns-kit/core/config/app-config.js\" {\\n interface ProjectAppConfig extends GeneratedProjectAppConfig {}\\n interface AppConfig extends GeneratedAppConfig {}\\n}\\n`\n : \"\\n\";\n\nconst auxiliaryPreamble = auxiliaryTypes ? `${auxiliaryTypes}\\n\\n` : \"\";\nconst tsContent = `/* Auto-generated. Do not edit by hand. */\\n${auxiliaryPreamble}export interface ProjectAppConfig ${interfaceBody}\\n\\nexport interface AppConfig extends ProjectAppConfig {}${augmentationBlock}`;\n\nwrite(path.resolve(\"./src/config/app-config.ts\"), tsContent);\n\nconsole.log(\"Generated config.schema.json and updated src/config/app-config.ts\");\n"]}
@@ -1,7 +1,7 @@
1
1
  import { GeneratedAttributes } from "./uns-dictionary.generated.js";
2
- export declare const knownUnsAttributes: ("status" | "level" | "active-energy-delivered" | "active-energy-received" | "alarm" | "assigned-to" | "authorization-level" | "availability" | "batch-number" | "conductivity" | "consumption" | "consumption-rate" | "cost" | "current" | "deviation" | "downtime" | "duration" | "end-time" | "energy" | "energy-consumption" | "fault-code" | "flow" | "frequency" | "hardness" | "inspection-result" | "instruction-url" | "last-refill" | "location" | "lot-id" | "maintenance-status" | "material-composition" | "material-type" | "operating-hours" | "operator-id" | "output-quantity" | "pass-fail" | "ph" | "planned-end" | "planned-start" | "power" | "presence" | "pressure" | "product-code" | "quantity" | "reactive-energy-delivered" | "reactive-energy-received" | "refill-required" | "revision" | "role" | "specification" | "speed" | "start-time" | "surface-defect" | "target-parameters" | "task-id" | "task-list" | "temperature" | "tensile-strength" | "total-flow" | "utilization" | "version-history" | "vibration" | "voltage" | "work-order-id")[];
2
+ export declare const knownUnsAttributes: ("level" | "active-energy-delivered" | "active-energy-received" | "alarm" | "assigned-to" | "authorization-level" | "availability" | "batch-number" | "conductivity" | "consumption" | "consumption-rate" | "cost" | "current" | "deviation" | "downtime" | "duration" | "end-time" | "energy" | "energy-consumption" | "fault-code" | "flow" | "frequency" | "hardness" | "inspection-result" | "instruction-url" | "last-refill" | "location" | "lot-id" | "maintenance-status" | "material-composition" | "material-type" | "operating-hours" | "operator-id" | "output-quantity" | "pass-fail" | "ph" | "planned-end" | "planned-start" | "power" | "presence" | "pressure" | "product-code" | "quantity" | "reactive-energy-delivered" | "reactive-energy-received" | "refill-required" | "revision" | "role" | "specification" | "speed" | "start-time" | "status" | "surface-defect" | "target-parameters" | "task-id" | "task-list" | "temperature" | "tensile-strength" | "total-flow" | "utilization" | "version-history" | "vibration" | "voltage" | "work-order-id")[];
3
3
  export type KnownUnsAttributeName = typeof GeneratedAttributes[keyof typeof GeneratedAttributes];
4
4
  export type UnsAttribute = "" | KnownUnsAttributeName | (string & {});
5
- export declare const AttributeDescriptions: Record<"status" | "level" | "active-energy-delivered" | "active-energy-received" | "alarm" | "assigned-to" | "authorization-level" | "availability" | "batch-number" | "conductivity" | "consumption" | "consumption-rate" | "cost" | "current" | "deviation" | "downtime" | "duration" | "end-time" | "energy" | "energy-consumption" | "fault-code" | "flow" | "frequency" | "hardness" | "inspection-result" | "instruction-url" | "last-refill" | "location" | "lot-id" | "maintenance-status" | "material-composition" | "material-type" | "operating-hours" | "operator-id" | "output-quantity" | "pass-fail" | "ph" | "planned-end" | "planned-start" | "power" | "presence" | "pressure" | "product-code" | "quantity" | "reactive-energy-delivered" | "reactive-energy-received" | "refill-required" | "revision" | "role" | "specification" | "speed" | "start-time" | "surface-defect" | "target-parameters" | "task-id" | "task-list" | "temperature" | "tensile-strength" | "total-flow" | "utilization" | "version-history" | "vibration" | "voltage" | "work-order-id", string>;
5
+ export declare const AttributeDescriptions: Record<"level" | "active-energy-delivered" | "active-energy-received" | "alarm" | "assigned-to" | "authorization-level" | "availability" | "batch-number" | "conductivity" | "consumption" | "consumption-rate" | "cost" | "current" | "deviation" | "downtime" | "duration" | "end-time" | "energy" | "energy-consumption" | "fault-code" | "flow" | "frequency" | "hardness" | "inspection-result" | "instruction-url" | "last-refill" | "location" | "lot-id" | "maintenance-status" | "material-composition" | "material-type" | "operating-hours" | "operator-id" | "output-quantity" | "pass-fail" | "ph" | "planned-end" | "planned-start" | "power" | "presence" | "pressure" | "product-code" | "quantity" | "reactive-energy-delivered" | "reactive-energy-received" | "refill-required" | "revision" | "role" | "specification" | "speed" | "start-time" | "status" | "surface-defect" | "target-parameters" | "task-id" | "task-list" | "temperature" | "tensile-strength" | "total-flow" | "utilization" | "version-history" | "vibration" | "voltage" | "work-order-id", string>;
6
6
  export declare function getAttributeDescription(name: string): string | undefined;
7
7
  //# sourceMappingURL=uns-attributes.d.ts.map
@@ -11,7 +11,9 @@ export declare function isIOS8601Type(value: string): value is ISO8601;
11
11
  export type UnsAttribute = KnownUnsAttributeName | (string & {});
12
12
  export declare const valueTypes: readonly ["string", "number"];
13
13
  export type ValueTypeString = (typeof valueTypes)[number];
14
- export type ValueType = string | number;
14
+ export type ScalarValueType = string | number;
15
+ /** Scalar telemetry or a scalar array used by metadata such as relationship evidence. */
16
+ export type ValueType = ScalarValueType | ScalarValueType[];
15
17
  export type CounterResetPolicy = "new-value" | "null" | "rollover" | (string & {});
16
18
  export type UnsAttributeSystemRole = "relationship-evidence" | "lifecycle-start" | "lifecycle-end" | "lifecycle-time-source" | (string & {});
17
19
  export type UnsRelationshipEndpoint = "source" | "target";
@@ -177,6 +179,8 @@ export interface IUnsExtendedData extends IUnsData {
177
179
  valueType: ValueTypeString;
178
180
  }
179
181
  export interface IUnsData {
182
+ /** Domain-specific evidence/context fields may accompany the canonical value. */
183
+ [key: string]: unknown;
180
184
  time: ISO8601;
181
185
  value: ValueType;
182
186
  /** Storage/routing group for consumers such as archivers; not part of the UNS identity path. */
@@ -1 +1 @@
1
- {"version":3,"file":"uns-interfaces.d.ts","sourceRoot":"","sources":["../../src/uns/uns-inter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N,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,OAAO;IACP,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,WAAW;IACX,cAAc;IACd,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,SAAS;CACD,CAAC;AAEX,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAS,qBAAqB,CAAC,CAAC;AACvE,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAW3C,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,uBAAuB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC;QAC/B,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC;QAC/B,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["import { UnsAttributeType } from \"../graphql/schema.js\";\nimport { MeasurementUnit } from \"./uns-measurements.js\";\nimport { UnsTags } from \"./uns-tags.js\";\nimport type { UnsObjectId, UnsObjectType } from \"./uns-object.js\";\nimport type { UnsAsset } from \"./uns-asset.js\";\nimport type { IMqttConnectProperties, IMqttPublishOptions, IMqttServerConfig, MqttProtocol } from \"../uns-mqtt/mqtt-interfaces.js\";\nimport { UnsTopics } from \"./uns-topics.js\";\nimport { knownUnsAttributes, type KnownUnsAttributeName } from \"./uns-attributes.js\";\n\nexport type ISO8601 = `${number}-${string}-${string}T${string}:${string}:${string}.${string}Z`;\nexport function isIOS8601Type(value: string): value is ISO8601 {\n const iso8601Regex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$/;\n return iso8601Regex.test(value);\n}\n// Known attribute names (with IntelliSense) while still allowing arbitrary strings.\nexport type UnsAttribute = KnownUnsAttributeName | (string & {});\n\nexport const valueTypes = [\"string\", \"number\"] as const;\nexport type ValueTypeString = (typeof valueTypes)[number];\nexport type ValueType = string | number;\n\nexport type CounterResetPolicy = \"new-value\" | \"null\" | \"rollover\" | (string & {});\n\nexport type UnsAttributeSystemRole =\n | \"relationship-evidence\"\n | \"lifecycle-start\"\n | \"lifecycle-end\"\n | \"lifecycle-time-source\"\n | (string & {});\n\nexport type UnsRelationshipEndpoint = \"source\" | \"target\";\n\nexport interface IUnsRelationshipEvidenceMetadata {\n relationshipKey: string;\n ownerEndpoint?: UnsRelationshipEndpoint;\n valueEndpoint?: UnsRelationshipEndpoint;\n /** Scalar values produce one edge; array values produce one edge per ObjectId value. */\n sourceObjectType?: UnsObjectType | (string & {});\n targetObjectType?: UnsObjectType | (string & {});\n sourceObjectIdFrom?: string;\n targetObjectIdFrom?: string;\n observedAtFrom?: string;\n status?: \"suggested\" | \"accepted\" | (string & {});\n defaultStatus?: \"suggested\" | \"accepted\" | (string & {});\n}\n\nexport interface IUnsLifecycleMetadata {\n timestampFrom?: \"value\" | \"packetTimestamp\" | (string & {});\n startValues?: string[];\n endValues?: string[];\n}\n\nexport interface IUnsTableColumnMetadata {\n name: string;\n valueType?: ValueTypeString | (string & {});\n presentationKind?: string;\n defaultAggregation?: string;\n counterResetPolicy?: CounterResetPolicy;\n}\n\nexport const questDbPrimitiveTypes = [\n \"boolean\",\n \"ipv4\",\n \"byte\",\n \"short\",\n \"char\",\n \"int\",\n \"float\",\n \"symbol\",\n \"varchar\",\n \"string\",\n \"long\",\n \"date\",\n \"timestamp\",\n \"timestamp_ns\",\n \"double\",\n \"uuid\",\n \"binary\",\n \"long256\",\n] as const;\n\nconst questDbPrimitiveTypeSet = new Set<string>(questDbPrimitiveTypes);\nconst questDbGeohashRegex = /^geohash\\(\\d+[bc]\\)$/;\nconst questDbDecimalRegex = /^decimal\\(\\d+,\\d+\\)$/;\nconst questDbArrayRegex = /^array<[^>]+>$/;\n\nexport type QuestDbPrimitiveType = (typeof questDbPrimitiveTypes)[number];\n\n// Supported QuestDB column types for UNS tables.\nexport type QuestDbType =\n | QuestDbPrimitiveType\n | `geohash(${number}${\"b\" | \"c\"})`\n | `decimal(${number},${number})`\n | `array<${string}>`;\n\nexport function isQuestDbType(value: unknown): value is QuestDbType {\n if (typeof value !== \"string\") {\n return false;\n }\n if (questDbPrimitiveTypeSet.has(value)) {\n return true;\n }\n return (\n questDbGeohashRegex.test(value) ||\n questDbDecimalRegex.test(value) ||\n questDbArrayRegex.test(value)\n );\n}\n\nexport interface IUnsParameters {\n mqttSubToTopics?: string | string[];\n username?: string;\n password?: string;\n mqttSSL?: boolean;\n publishThrottlingDelay?: number; // Delay in milliseconds; default is 1ms\n publishConcurrency?: number; // Maximum concurrent outgoing publishes; default is 1\n maxPendingPublishes?: number; // Maximum pending publishes across the API boundary and worker; default is unlimited\n subscribeThrottlingDelay?: number; // Delay in milliseconds; default is 1ms\n rejectUnauthorized?: boolean;\n clientId?: string;\n hosts?: string[];\n servers?: IMqttServerConfig[];\n port?: number;\n protocol?: MqttProtocol;\n keepalive?: number;\n clean?: boolean;\n connectTimeout?: number;\n reconnectPeriod?: number;\n reconnectOnConnackError?: boolean;\n resubscribe?: boolean;\n queueQoSZero?: boolean;\n properties?: IMqttConnectProperties;\n ca?: string;\n cert?: string;\n key?: string;\n servername?: string;\n /**\n * Default MQTT publish options applied to all outgoing messages\n * (e.g., qos, retain, messageExpiryInterval).\n */\n defaultPublishOptions?: IMqttPublishOptions;\n}\n\nexport interface IUnsProcessParameters {\n processName: string;\n mqttSubToTopics?: string | string[];\n username?: string;\n password?: string;\n mqttSSL?: boolean;\n clientId?: string;\n hosts?: string[];\n servers?: IMqttServerConfig[];\n port?: number;\n protocol?: MqttProtocol;\n keepalive?: number;\n clean?: boolean;\n connectTimeout?: number;\n reconnectPeriod?: number;\n reconnectOnConnackError?: boolean;\n resubscribe?: boolean;\n queueQoSZero?: boolean;\n rejectUnauthorized?: boolean;\n properties?: IMqttConnectProperties;\n ca?: string;\n cert?: string;\n key?: string;\n servername?: string;\n}\n\nexport interface UnsEvents {\n // Emitters in MqttProxy, UnsMqttProxy\n input: { topic: string; message: string, packet: any };\n mqttProxyStatus: { event: string, value: number, uom: MeasurementUnit, statusTopic: string };\n \n // Emitters in MqttProxy\n error: { code: number; message: string };\n \n // Emitters in UnsMqttProxy\n mqttWorker: { command: string, instanceName: string; batchSize: number, referenceHash: string };\n\n // Emitter in UnsCronProxy\n cronEvent: { event?: string; cronExpression?: string };\n\n // Emitters in UnsApiProxy\n apiGetEvent: {req: any, res: any};\n apiPostEvent: {req: any, res: any};\n apiPutEvent: {req: any, res: any};\n apiPatchEvent: {req: any, res: any};\n apiDeleteEvent: {req: any, res: any};\n\n // Emitters in UnsProxy\n unsProxyProducedTopics: { producedTopics: ITopicObject[], statusTopic: string };\n\n // Emitters in UnsProxy\n unsProxyProducedApiEndpoints: { producedApiEndpoints: IApiObject[], statusTopic: string };\n\n // Emitters in UnsProxy\n unsProxyProducedServiceEndpoints: { producedServiceEndpoints: IApiObject[], statusTopic: string };\n\n // Emitters in UnsProxy\n unsProxyProducedDataOfferEndpoints: { producedDataOfferEndpoints: IApiObject[], statusTopic: string };\n\n // Emitters in UnsProxy\n unsProxyProducedApiCatchAll: { producedCatchall: IApiCatchallMapping[], statusTopic: string };\n\n // Emitters in UnsProxy / UnsApiProxy\n unsProxyProducedDataCatalogOffers: { producedDataCatalogOffers: unknown[], statusTopic: string };\n}\n\nexport interface IUnsExtendedData extends IUnsData {\n valueType: ValueTypeString;\n}\n\nexport interface IUnsData {\n time: ISO8601;\n value: ValueType;\n /** Storage/routing group for consumers such as archivers; not part of the UNS identity path. */\n dataGroup?: string;\n uom?: MeasurementUnit;\n foreignEventKey?: string;\n intervalStart?: ISO8601 | number;\n intervalEnd?: ISO8601 | number;\n windowStart?: ISO8601 | number;\n windowEnd?: ISO8601 | number;\n eventId?: string;\n deleted?: boolean;\n deletedAt?: ISO8601 | number;\n lastSeen?: ISO8601 | number;\n}\n\nexport interface IUnsTableColumn {\n type: QuestDbType;\n value: string | number | boolean | null;\n uom?: MeasurementUnit;\n}\n\n/** MQTT table columns keyed by their stable UNS/QuestDB column name. */\nexport type IUnsTableColumns = Record<string, IUnsTableColumn>;\n\nexport interface IUnsTable {\n time: ISO8601;\n /** Storage/routing group for consumers such as archivers; not part of the UNS identity path. */\n dataGroup?: string;\n columns: IUnsTableColumns;\n intervalStart?: ISO8601 | number;\n intervalEnd?: ISO8601 | number;\n windowStart?: ISO8601 | number;\n windowEnd?: ISO8601 | number;\n eventId?: string;\n deleted?: boolean;\n deletedAt?: ISO8601 | number;\n lastSeen?: ISO8601 | number;\n}\n\nexport interface IMqttAttributeMessage {\n attribute: UnsAttribute;\n description?: string;\n tags?: UnsTags[];\n attributeNeedsPersistence?: boolean | null;\n /** Optional controller/UI grouping hint for this ObjectId node; does not affect storage/table naming. */\n virtualGroup?: string;\n /** Scalar value shape for schema/catalog consumers, for example \"number\" or \"string\". */\n valueType?: ValueTypeString | (string & {});\n /**\n * Operator-facing presentation hint. Use \"counter\" for cumulative counter\n * state; delta/rate should be requested from Datahub history APIs.\n */\n presentationKind?: string;\n /** Preferred aggregation for sampled history views, for example \"last\". */\n defaultAggregation?: string;\n /** Reset handling hint for cumulative counters. Interpreted by Datahub APIs, not by the producer. */\n counterResetPolicy?: CounterResetPolicy;\n /** Field-level metadata for table columns that should behave as chartable series. */\n tableColumns?: IUnsTableColumnMetadata[];\n /** Optional schema-system role published into Datahub's attribute_schema.schema_json. */\n systemRole?: UnsAttributeSystemRole;\n /** Relationship materialization metadata for `systemRole: \"relationship-evidence\"`. */\n relationshipEvidence?: IUnsRelationshipEvidenceMetadata;\n /** Lifecycle metadata for lifecycle system roles. */\n lifecycle?: IUnsLifecycleMetadata;\n /**\n * How the controller determines if this attribute is live or stale.\n * Defaults to `\"interval\"` with the controller's default interval (~120s) when omitted.\n *\n * @example\n * // Sensor publishing every 2 seconds:\n * { validityMode: \"interval\", expectedIntervalMs: 2000 }\n *\n * // Status attribute publishing every 2 seconds (string values like \"HEATING\"):\n * { validityMode: \"interval\", expectedIntervalMs: 2000 }\n *\n * // Material location with ENTERED/EXITED lifecycle:\n * { validityMode: \"lifecycle\", lifecycleEndValue: \"EXITED\" }\n *\n * // Static configuration value:\n * { validityMode: \"static\" }\n */\n validityMode?: ValidityMode;\n /**\n * Expected publish interval in milliseconds. Only meaningful for `validityMode: \"interval\"`.\n * The controller marks the attribute as stale after ~2× this value without a heartbeat update.\n * Ignored for `\"lifecycle\"` and `\"static\"` modes.\n */\n expectedIntervalMs?: number;\n /**\n * The string value that marks a lifecycle as completed. Only meaningful for `validityMode: \"lifecycle\"`.\n * When the attribute's current value matches this, the controller considers the lifecycle done.\n * Example: `\"EXITED\"` for a location attribute with ENTERED/EXITED events.\n */\n lifecycleEndValue?: string;\n}\n\ntype AttributePayload =\n | { message: IUnsMessage; data?: never; table?: never; createdAt?: never; expiresAt?: never }\n | { message?: never; data: IUnsData; table?: never; createdAt?: ISO8601; expiresAt?: ISO8601 }\n | { message?: never; data?: never; table: IUnsTable; createdAt?: ISO8601; expiresAt?: ISO8601 };\n\nexport type IMqttAttributeEntry = IMqttAttributeMessage & AttributePayload;\n\nexport interface IMqttPublishRequest {\n topic: UnsTopics;\n asset: UnsAsset;\n assetDescription?: string;\n objectType: UnsObjectType;\n objectTypeDescription?: string;\n objectId: UnsObjectId;\n /** Optional controller/UI grouping hint for ObjectId nodes; does not affect storage/table naming. */\n virtualGroup?: string;\n attributes: IMqttAttributeEntry | IMqttAttributeEntry[];\n}\n\n// This interface represents a packet for a UNS system\nexport interface IUnsPacket {\n // The message object of the packet\n message: IUnsExtendedMessage;\n \n // The HMAC signature of the message\n messageSignature?: string;\n\n // Automatically calculated interval between two packets in ms\n interval?: number;\n\n // Current library version\n readonly version: string;\n\n // Autogenerated sequence number\n sequenceId?: number;\n}\n\nexport interface IUnsPackatParameters {\n\n}\n\nexport interface IUnsMessage {\n data?: IUnsData;\n table?: IUnsTable;\n expiresAt?: ISO8601;\n createdAt?: ISO8601;\n}\n\nexport interface IUnsExtendedMessage extends IUnsMessage {\n data?: IUnsExtendedData;\n}\n\n/**\n * Controls how the controller determines whether an attribute is live or stale.\n *\n * - `\"interval\"` — Attribute publishes periodically. Stale if no heartbeat within ~2× the expected interval.\n * Use with `expectedIntervalMs`. Works for both numeric sensors (temperature every 2s)\n * and string status attributes (status every 2s). Example:\n * `{ validityMode: \"interval\", expectedIntervalMs: 2000 }`\n *\n * - `\"lifecycle\"` — Attribute represents a lifecycle with a start and end event.\n * Use with `lifecycleEndValue` to mark the end state. Example: material location with \"ENTERED\" / \"EXITED\".\n *\n * - `\"static\"` — Attribute is set once and never changes (configuration, metadata). Always live.\n *\n * When omitted, defaults to `\"interval\"` with the controller's default interval (~120s).\n */\nexport type ValidityMode = \"interval\" | \"lifecycle\" | \"static\";\n\nexport interface ITopicObject {\n timestamp: string;\n attribute:string;\n attributeType: UnsAttributeType;\n topic:string;\n description:string;\n /** Storage/routing group observed on the latest data/table payload for this identity. */\n dataGroup:string;\n /** Optional controller/UI grouping hint for ObjectId nodes; does not affect storage/table naming. */\n virtualGroup?: string;\n tags:string[] | null;\n attributeNeedsPersistence: boolean | null;\n /** Scalar value shape for schema/catalog consumers, for example \"number\" or \"string\". */\n valueType?: ValueTypeString | (string & {});\n /** Operator-facing presentation hint, for example \"counter\" for cumulative counter state. */\n presentationKind?: string;\n /** Preferred aggregation for sampled history views, for example \"last\". */\n defaultAggregation?: string;\n /** Reset handling hint for cumulative counters. Interpreted by Datahub APIs, not by the producer. */\n counterResetPolicy?: CounterResetPolicy;\n /** Field-level metadata for table columns that should behave as chartable series. */\n tableColumns?: IUnsTableColumnMetadata[];\n /** Optional schema-system role published into Datahub's attribute_schema.schema_json. */\n systemRole?: UnsAttributeSystemRole;\n /** Relationship materialization metadata for `systemRole: \"relationship-evidence\"`. */\n relationshipEvidence?: IUnsRelationshipEvidenceMetadata;\n /** Lifecycle metadata for lifecycle system roles. */\n lifecycle?: IUnsLifecycleMetadata;\n asset: UnsAsset;\n assetDescription?: string;\n objectType: UnsObjectType;\n objectTypeDescription?: string;\n objectId: UnsObjectId;\n /** Liveliness validity mode — how the controller determines if this attribute is live/stale. */\n validityMode?: ValidityMode;\n /** For interval mode: expected publish interval in milliseconds (stale after ~2x this value). */\n expectedIntervalMs?: number;\n /** For lifecycle mode: the string value that marks the lifecycle as completed (e.g. \"EXITED\"). */\n lifecycleEndValue?: string;\n}\n\n// API Interfaces below\nexport interface IApiObject {\n timestamp: string;\n attribute:string;\n topic:string;\n attributeType: UnsAttributeType;\n routeOnly?: boolean;\n registryTopic?: \"api-endpoints\" | \"service-endpoints\" | \"data-offer-endpoints\";\n apiDescription?: string; // Optional description for the API endpoint\n apiHost: string; // Hostname of the service\n apiEndpoint: string; // API endpoint for virtual topics\n apiSwaggerEndpoint: string; // Swagger endpoint for API documentation\n apiMethod: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"; // HTTP method for API endpoint\n apiQueryParams: QueryParamDef[]; // query parameters for the API endpoint\n serviceApi?: Record<string, unknown> | null;\n asset: UnsAsset;\n objectType: UnsObjectType;\n objectId: UnsObjectId;\n controllerName?: string;\n controllerHost?: string;\n controllerPort?: string;\n controllerPublicBase?: string;\n}\n\nexport interface IApiCatchallMapping {\n topic: string;\n apiBase: string;\n apiBasePath: string;\n swaggerPath: string;\n}\n\nexport interface QueryParamDef {\n name: string;\n type: \"string\" | \"number\" | \"boolean\";\n required?: boolean;\n description?: string;\n /**\n * Optional canonical chat alias used by assistant tooling.\n * Typical values: from, to, limit, topic, timezone, summaryOnly.\n */\n chatCanonical?: string;\n /**\n * Optional default query value. Included in generated OpenAPI metadata.\n */\n defaultValue?: string | number | boolean;\n}\n\nexport interface ApiChatDefaults {\n from?: string;\n to?: string;\n limit?: number;\n topic?: string;\n timezone?: string;\n summaryOnly?: boolean;\n [key: string]: string | number | boolean | undefined;\n}\n\nexport interface IApiProxyOptions {\n jwtSecret?: string;\n /**\n * Public origin advertised for generated API endpoint metadata.\n *\n * Use a hostname or origin without a port (for example `127.0.0.1` or\n * `http://service-name`) to keep the API server's actual listening port.\n * An explicitly supplied port is preserved. Defaults to the machine's\n * external IPv4 address for backwards compatibility.\n */\n publishedApiHost?: string;\n jwks?: {\n wellKnownJwksUrl: string;\n activeKidUrl?: string;\n cacheTtlMs?: number;\n algorithms?: (\"RS256\" | \"RS384\" | \"RS512\")[];\n };\n /**\n * Optional base prefixes to mount the API and swagger JSON under (e.g. \"/archiver-3\").\n * Defaults to \"/api\" when not provided.\n */\n apiBasePath?: string;\n swaggerBasePath?: string;\n /**\n * Skip mounting the default \"/api\" route. Useful when rebasing entirely under a custom prefix.\n */\n disableDefaultApiMount?: boolean;\n}\n\nexport interface IGetEndpointOptions {\n apiDescription?: string;\n tags?: string[];\n queryParams?: QueryParamDef[];\n routeOnly?: boolean;\n registryTopic?: \"api-endpoints\" | \"service-endpoints\" | \"data-offer-endpoints\";\n serviceApi?: Record<string, unknown>;\n /**\n * Optional defaults consumed by chat tooling (published as OpenAPI vendor extension x-uns-chat.defaults).\n */\n chatDefaults?: ApiChatDefaults;\n}\n\nexport interface IPostEndpointOptions {\n apiDescription?: string;\n tags?: string[];\n routeOnly?: boolean;\n registryTopic?: \"api-endpoints\" | \"service-endpoints\" | \"data-offer-endpoints\";\n serviceApi?: Record<string, unknown>;\n requestBody?: {\n description?: string;\n required?: boolean;\n schema?: Record<string, unknown>;\n };\n}\n\nexport interface IPutEndpointOptions extends IPostEndpointOptions {}\nexport interface IPatchEndpointOptions extends IPostEndpointOptions {}\nexport interface IDeleteEndpointOptions extends IPostEndpointOptions {}\n"]}
1
+ {"version":3,"file":"uns-interfaces.js","sourceRoot":"","sources":["../../src/uns/uns-interfaces.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,MAAM,YAAY,GAAG,+CAA+C,CAAC;IACrE,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC;AAID,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AA6CxD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS;IACT,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,OAAO;IACP,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,WAAW;IACX,cAAc;IACd,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,SAAS;CACD,CAAC;AAEX,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAS,qBAAqB,CAAC,CAAC;AACvE,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAW3C,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,uBAAuB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC;QAC/B,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC;QAC/B,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["import { UnsAttributeType } from \"../graphql/schema.js\";\nimport { MeasurementUnit } from \"./uns-measurements.js\";\nimport { UnsTags } from \"./uns-tags.js\";\nimport type { UnsObjectId, UnsObjectType } from \"./uns-object.js\";\nimport type { UnsAsset } from \"./uns-asset.js\";\nimport type { IMqttConnectProperties, IMqttPublishOptions, IMqttServerConfig, MqttProtocol } from \"../uns-mqtt/mqtt-interfaces.js\";\nimport { UnsTopics } from \"./uns-topics.js\";\nimport { knownUnsAttributes, type KnownUnsAttributeName } from \"./uns-attributes.js\";\n\nexport type ISO8601 = `${number}-${string}-${string}T${string}:${string}:${string}.${string}Z`;\nexport function isIOS8601Type(value: string): value is ISO8601 {\n const iso8601Regex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$/;\n return iso8601Regex.test(value);\n}\n// Known attribute names (with IntelliSense) while still allowing arbitrary strings.\nexport type UnsAttribute = KnownUnsAttributeName | (string & {});\n\nexport const valueTypes = [\"string\", \"number\"] as const;\nexport type ValueTypeString = (typeof valueTypes)[number];\nexport type ScalarValueType = string | number;\n/** Scalar telemetry or a scalar array used by metadata such as relationship evidence. */\nexport type ValueType = ScalarValueType | ScalarValueType[];\n\nexport type CounterResetPolicy = \"new-value\" | \"null\" | \"rollover\" | (string & {});\n\nexport type UnsAttributeSystemRole =\n | \"relationship-evidence\"\n | \"lifecycle-start\"\n | \"lifecycle-end\"\n | \"lifecycle-time-source\"\n | (string & {});\n\nexport type UnsRelationshipEndpoint = \"source\" | \"target\";\n\nexport interface IUnsRelationshipEvidenceMetadata {\n relationshipKey: string;\n ownerEndpoint?: UnsRelationshipEndpoint;\n valueEndpoint?: UnsRelationshipEndpoint;\n /** Scalar values produce one edge; array values produce one edge per ObjectId value. */\n sourceObjectType?: UnsObjectType | (string & {});\n targetObjectType?: UnsObjectType | (string & {});\n sourceObjectIdFrom?: string;\n targetObjectIdFrom?: string;\n observedAtFrom?: string;\n status?: \"suggested\" | \"accepted\" | (string & {});\n defaultStatus?: \"suggested\" | \"accepted\" | (string & {});\n}\n\nexport interface IUnsLifecycleMetadata {\n timestampFrom?: \"value\" | \"packetTimestamp\" | (string & {});\n startValues?: string[];\n endValues?: string[];\n}\n\nexport interface IUnsTableColumnMetadata {\n name: string;\n valueType?: ValueTypeString | (string & {});\n presentationKind?: string;\n defaultAggregation?: string;\n counterResetPolicy?: CounterResetPolicy;\n}\n\nexport const questDbPrimitiveTypes = [\n \"boolean\",\n \"ipv4\",\n \"byte\",\n \"short\",\n \"char\",\n \"int\",\n \"float\",\n \"symbol\",\n \"varchar\",\n \"string\",\n \"long\",\n \"date\",\n \"timestamp\",\n \"timestamp_ns\",\n \"double\",\n \"uuid\",\n \"binary\",\n \"long256\",\n] as const;\n\nconst questDbPrimitiveTypeSet = new Set<string>(questDbPrimitiveTypes);\nconst questDbGeohashRegex = /^geohash\\(\\d+[bc]\\)$/;\nconst questDbDecimalRegex = /^decimal\\(\\d+,\\d+\\)$/;\nconst questDbArrayRegex = /^array<[^>]+>$/;\n\nexport type QuestDbPrimitiveType = (typeof questDbPrimitiveTypes)[number];\n\n// Supported QuestDB column types for UNS tables.\nexport type QuestDbType =\n | QuestDbPrimitiveType\n | `geohash(${number}${\"b\" | \"c\"})`\n | `decimal(${number},${number})`\n | `array<${string}>`;\n\nexport function isQuestDbType(value: unknown): value is QuestDbType {\n if (typeof value !== \"string\") {\n return false;\n }\n if (questDbPrimitiveTypeSet.has(value)) {\n return true;\n }\n return (\n questDbGeohashRegex.test(value) ||\n questDbDecimalRegex.test(value) ||\n questDbArrayRegex.test(value)\n );\n}\n\nexport interface IUnsParameters {\n mqttSubToTopics?: string | string[];\n username?: string;\n password?: string;\n mqttSSL?: boolean;\n publishThrottlingDelay?: number; // Delay in milliseconds; default is 1ms\n publishConcurrency?: number; // Maximum concurrent outgoing publishes; default is 1\n maxPendingPublishes?: number; // Maximum pending publishes across the API boundary and worker; default is unlimited\n subscribeThrottlingDelay?: number; // Delay in milliseconds; default is 1ms\n rejectUnauthorized?: boolean;\n clientId?: string;\n hosts?: string[];\n servers?: IMqttServerConfig[];\n port?: number;\n protocol?: MqttProtocol;\n keepalive?: number;\n clean?: boolean;\n connectTimeout?: number;\n reconnectPeriod?: number;\n reconnectOnConnackError?: boolean;\n resubscribe?: boolean;\n queueQoSZero?: boolean;\n properties?: IMqttConnectProperties;\n ca?: string;\n cert?: string;\n key?: string;\n servername?: string;\n /**\n * Default MQTT publish options applied to all outgoing messages\n * (e.g., qos, retain, messageExpiryInterval).\n */\n defaultPublishOptions?: IMqttPublishOptions;\n}\n\nexport interface IUnsProcessParameters {\n processName: string;\n mqttSubToTopics?: string | string[];\n username?: string;\n password?: string;\n mqttSSL?: boolean;\n clientId?: string;\n hosts?: string[];\n servers?: IMqttServerConfig[];\n port?: number;\n protocol?: MqttProtocol;\n keepalive?: number;\n clean?: boolean;\n connectTimeout?: number;\n reconnectPeriod?: number;\n reconnectOnConnackError?: boolean;\n resubscribe?: boolean;\n queueQoSZero?: boolean;\n rejectUnauthorized?: boolean;\n properties?: IMqttConnectProperties;\n ca?: string;\n cert?: string;\n key?: string;\n servername?: string;\n}\n\nexport interface UnsEvents {\n // Emitters in MqttProxy, UnsMqttProxy\n input: { topic: string; message: string, packet: any };\n mqttProxyStatus: { event: string, value: number, uom: MeasurementUnit, statusTopic: string };\n \n // Emitters in MqttProxy\n error: { code: number; message: string };\n \n // Emitters in UnsMqttProxy\n mqttWorker: { command: string, instanceName: string; batchSize: number, referenceHash: string };\n\n // Emitter in UnsCronProxy\n cronEvent: { event?: string; cronExpression?: string };\n\n // Emitters in UnsApiProxy\n apiGetEvent: {req: any, res: any};\n apiPostEvent: {req: any, res: any};\n apiPutEvent: {req: any, res: any};\n apiPatchEvent: {req: any, res: any};\n apiDeleteEvent: {req: any, res: any};\n\n // Emitters in UnsProxy\n unsProxyProducedTopics: { producedTopics: ITopicObject[], statusTopic: string };\n\n // Emitters in UnsProxy\n unsProxyProducedApiEndpoints: { producedApiEndpoints: IApiObject[], statusTopic: string };\n\n // Emitters in UnsProxy\n unsProxyProducedServiceEndpoints: { producedServiceEndpoints: IApiObject[], statusTopic: string };\n\n // Emitters in UnsProxy\n unsProxyProducedDataOfferEndpoints: { producedDataOfferEndpoints: IApiObject[], statusTopic: string };\n\n // Emitters in UnsProxy\n unsProxyProducedApiCatchAll: { producedCatchall: IApiCatchallMapping[], statusTopic: string };\n\n // Emitters in UnsProxy / UnsApiProxy\n unsProxyProducedDataCatalogOffers: { producedDataCatalogOffers: unknown[], statusTopic: string };\n}\n\nexport interface IUnsExtendedData extends IUnsData {\n valueType: ValueTypeString;\n}\n\nexport interface IUnsData {\n /** Domain-specific evidence/context fields may accompany the canonical value. */\n [key: string]: unknown;\n time: ISO8601;\n value: ValueType;\n /** Storage/routing group for consumers such as archivers; not part of the UNS identity path. */\n dataGroup?: string;\n uom?: MeasurementUnit;\n foreignEventKey?: string;\n intervalStart?: ISO8601 | number;\n intervalEnd?: ISO8601 | number;\n windowStart?: ISO8601 | number;\n windowEnd?: ISO8601 | number;\n eventId?: string;\n deleted?: boolean;\n deletedAt?: ISO8601 | number;\n lastSeen?: ISO8601 | number;\n}\n\nexport interface IUnsTableColumn {\n type: QuestDbType;\n value: string | number | boolean | null;\n uom?: MeasurementUnit;\n}\n\n/** MQTT table columns keyed by their stable UNS/QuestDB column name. */\nexport type IUnsTableColumns = Record<string, IUnsTableColumn>;\n\nexport interface IUnsTable {\n time: ISO8601;\n /** Storage/routing group for consumers such as archivers; not part of the UNS identity path. */\n dataGroup?: string;\n columns: IUnsTableColumns;\n intervalStart?: ISO8601 | number;\n intervalEnd?: ISO8601 | number;\n windowStart?: ISO8601 | number;\n windowEnd?: ISO8601 | number;\n eventId?: string;\n deleted?: boolean;\n deletedAt?: ISO8601 | number;\n lastSeen?: ISO8601 | number;\n}\n\nexport interface IMqttAttributeMessage {\n attribute: UnsAttribute;\n description?: string;\n tags?: UnsTags[];\n attributeNeedsPersistence?: boolean | null;\n /** Optional controller/UI grouping hint for this ObjectId node; does not affect storage/table naming. */\n virtualGroup?: string;\n /** Scalar value shape for schema/catalog consumers, for example \"number\" or \"string\". */\n valueType?: ValueTypeString | (string & {});\n /**\n * Operator-facing presentation hint. Use \"counter\" for cumulative counter\n * state; delta/rate should be requested from Datahub history APIs.\n */\n presentationKind?: string;\n /** Preferred aggregation for sampled history views, for example \"last\". */\n defaultAggregation?: string;\n /** Reset handling hint for cumulative counters. Interpreted by Datahub APIs, not by the producer. */\n counterResetPolicy?: CounterResetPolicy;\n /** Field-level metadata for table columns that should behave as chartable series. */\n tableColumns?: IUnsTableColumnMetadata[];\n /** Optional schema-system role published into Datahub's attribute_schema.schema_json. */\n systemRole?: UnsAttributeSystemRole;\n /** Relationship materialization metadata for `systemRole: \"relationship-evidence\"`. */\n relationshipEvidence?: IUnsRelationshipEvidenceMetadata;\n /** Lifecycle metadata for lifecycle system roles. */\n lifecycle?: IUnsLifecycleMetadata;\n /**\n * How the controller determines if this attribute is live or stale.\n * Defaults to `\"interval\"` with the controller's default interval (~120s) when omitted.\n *\n * @example\n * // Sensor publishing every 2 seconds:\n * { validityMode: \"interval\", expectedIntervalMs: 2000 }\n *\n * // Status attribute publishing every 2 seconds (string values like \"HEATING\"):\n * { validityMode: \"interval\", expectedIntervalMs: 2000 }\n *\n * // Material location with ENTERED/EXITED lifecycle:\n * { validityMode: \"lifecycle\", lifecycleEndValue: \"EXITED\" }\n *\n * // Static configuration value:\n * { validityMode: \"static\" }\n */\n validityMode?: ValidityMode;\n /**\n * Expected publish interval in milliseconds. Only meaningful for `validityMode: \"interval\"`.\n * The controller marks the attribute as stale after ~2× this value without a heartbeat update.\n * Ignored for `\"lifecycle\"` and `\"static\"` modes.\n */\n expectedIntervalMs?: number;\n /**\n * The string value that marks a lifecycle as completed. Only meaningful for `validityMode: \"lifecycle\"`.\n * When the attribute's current value matches this, the controller considers the lifecycle done.\n * Example: `\"EXITED\"` for a location attribute with ENTERED/EXITED events.\n */\n lifecycleEndValue?: string;\n}\n\ntype AttributePayload =\n | { message: IUnsMessage; data?: never; table?: never; createdAt?: never; expiresAt?: never }\n | { message?: never; data: IUnsData; table?: never; createdAt?: ISO8601; expiresAt?: ISO8601 }\n | { message?: never; data?: never; table: IUnsTable; createdAt?: ISO8601; expiresAt?: ISO8601 };\n\nexport type IMqttAttributeEntry = IMqttAttributeMessage & AttributePayload;\n\nexport interface IMqttPublishRequest {\n topic: UnsTopics;\n asset: UnsAsset;\n assetDescription?: string;\n objectType: UnsObjectType;\n objectTypeDescription?: string;\n objectId: UnsObjectId;\n /** Optional controller/UI grouping hint for ObjectId nodes; does not affect storage/table naming. */\n virtualGroup?: string;\n attributes: IMqttAttributeEntry | IMqttAttributeEntry[];\n}\n\n// This interface represents a packet for a UNS system\nexport interface IUnsPacket {\n // The message object of the packet\n message: IUnsExtendedMessage;\n \n // The HMAC signature of the message\n messageSignature?: string;\n\n // Automatically calculated interval between two packets in ms\n interval?: number;\n\n // Current library version\n readonly version: string;\n\n // Autogenerated sequence number\n sequenceId?: number;\n}\n\nexport interface IUnsPackatParameters {\n\n}\n\nexport interface IUnsMessage {\n data?: IUnsData;\n table?: IUnsTable;\n expiresAt?: ISO8601;\n createdAt?: ISO8601;\n}\n\nexport interface IUnsExtendedMessage extends IUnsMessage {\n data?: IUnsExtendedData;\n}\n\n/**\n * Controls how the controller determines whether an attribute is live or stale.\n *\n * - `\"interval\"` — Attribute publishes periodically. Stale if no heartbeat within ~2× the expected interval.\n * Use with `expectedIntervalMs`. Works for both numeric sensors (temperature every 2s)\n * and string status attributes (status every 2s). Example:\n * `{ validityMode: \"interval\", expectedIntervalMs: 2000 }`\n *\n * - `\"lifecycle\"` — Attribute represents a lifecycle with a start and end event.\n * Use with `lifecycleEndValue` to mark the end state. Example: material location with \"ENTERED\" / \"EXITED\".\n *\n * - `\"static\"` — Attribute is set once and never changes (configuration, metadata). Always live.\n *\n * When omitted, defaults to `\"interval\"` with the controller's default interval (~120s).\n */\nexport type ValidityMode = \"interval\" | \"lifecycle\" | \"static\";\n\nexport interface ITopicObject {\n timestamp: string;\n attribute:string;\n attributeType: UnsAttributeType;\n topic:string;\n description:string;\n /** Storage/routing group observed on the latest data/table payload for this identity. */\n dataGroup:string;\n /** Optional controller/UI grouping hint for ObjectId nodes; does not affect storage/table naming. */\n virtualGroup?: string;\n tags:string[] | null;\n attributeNeedsPersistence: boolean | null;\n /** Scalar value shape for schema/catalog consumers, for example \"number\" or \"string\". */\n valueType?: ValueTypeString | (string & {});\n /** Operator-facing presentation hint, for example \"counter\" for cumulative counter state. */\n presentationKind?: string;\n /** Preferred aggregation for sampled history views, for example \"last\". */\n defaultAggregation?: string;\n /** Reset handling hint for cumulative counters. Interpreted by Datahub APIs, not by the producer. */\n counterResetPolicy?: CounterResetPolicy;\n /** Field-level metadata for table columns that should behave as chartable series. */\n tableColumns?: IUnsTableColumnMetadata[];\n /** Optional schema-system role published into Datahub's attribute_schema.schema_json. */\n systemRole?: UnsAttributeSystemRole;\n /** Relationship materialization metadata for `systemRole: \"relationship-evidence\"`. */\n relationshipEvidence?: IUnsRelationshipEvidenceMetadata;\n /** Lifecycle metadata for lifecycle system roles. */\n lifecycle?: IUnsLifecycleMetadata;\n asset: UnsAsset;\n assetDescription?: string;\n objectType: UnsObjectType;\n objectTypeDescription?: string;\n objectId: UnsObjectId;\n /** Liveliness validity mode — how the controller determines if this attribute is live/stale. */\n validityMode?: ValidityMode;\n /** For interval mode: expected publish interval in milliseconds (stale after ~2x this value). */\n expectedIntervalMs?: number;\n /** For lifecycle mode: the string value that marks the lifecycle as completed (e.g. \"EXITED\"). */\n lifecycleEndValue?: string;\n}\n\n// API Interfaces below\nexport interface IApiObject {\n timestamp: string;\n attribute:string;\n topic:string;\n attributeType: UnsAttributeType;\n routeOnly?: boolean;\n registryTopic?: \"api-endpoints\" | \"service-endpoints\" | \"data-offer-endpoints\";\n apiDescription?: string; // Optional description for the API endpoint\n apiHost: string; // Hostname of the service\n apiEndpoint: string; // API endpoint for virtual topics\n apiSwaggerEndpoint: string; // Swagger endpoint for API documentation\n apiMethod: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"; // HTTP method for API endpoint\n apiQueryParams: QueryParamDef[]; // query parameters for the API endpoint\n serviceApi?: Record<string, unknown> | null;\n asset: UnsAsset;\n objectType: UnsObjectType;\n objectId: UnsObjectId;\n controllerName?: string;\n controllerHost?: string;\n controllerPort?: string;\n controllerPublicBase?: string;\n}\n\nexport interface IApiCatchallMapping {\n topic: string;\n apiBase: string;\n apiBasePath: string;\n swaggerPath: string;\n}\n\nexport interface QueryParamDef {\n name: string;\n type: \"string\" | \"number\" | \"boolean\";\n required?: boolean;\n description?: string;\n /**\n * Optional canonical chat alias used by assistant tooling.\n * Typical values: from, to, limit, topic, timezone, summaryOnly.\n */\n chatCanonical?: string;\n /**\n * Optional default query value. Included in generated OpenAPI metadata.\n */\n defaultValue?: string | number | boolean;\n}\n\nexport interface ApiChatDefaults {\n from?: string;\n to?: string;\n limit?: number;\n topic?: string;\n timezone?: string;\n summaryOnly?: boolean;\n [key: string]: string | number | boolean | undefined;\n}\n\nexport interface IApiProxyOptions {\n jwtSecret?: string;\n /**\n * Public origin advertised for generated API endpoint metadata.\n *\n * Use a hostname or origin without a port (for example `127.0.0.1` or\n * `http://service-name`) to keep the API server's actual listening port.\n * An explicitly supplied port is preserved. Defaults to the machine's\n * external IPv4 address for backwards compatibility.\n */\n publishedApiHost?: string;\n jwks?: {\n wellKnownJwksUrl: string;\n activeKidUrl?: string;\n cacheTtlMs?: number;\n algorithms?: (\"RS256\" | \"RS384\" | \"RS512\")[];\n };\n /**\n * Optional base prefixes to mount the API and swagger JSON under (e.g. \"/archiver-3\").\n * Defaults to \"/api\" when not provided.\n */\n apiBasePath?: string;\n swaggerBasePath?: string;\n /**\n * Skip mounting the default \"/api\" route. Useful when rebasing entirely under a custom prefix.\n */\n disableDefaultApiMount?: boolean;\n}\n\nexport interface IGetEndpointOptions {\n apiDescription?: string;\n tags?: string[];\n queryParams?: QueryParamDef[];\n routeOnly?: boolean;\n registryTopic?: \"api-endpoints\" | \"service-endpoints\" | \"data-offer-endpoints\";\n serviceApi?: Record<string, unknown>;\n /**\n * Optional defaults consumed by chat tooling (published as OpenAPI vendor extension x-uns-chat.defaults).\n */\n chatDefaults?: ApiChatDefaults;\n}\n\nexport interface IPostEndpointOptions {\n apiDescription?: string;\n tags?: string[];\n routeOnly?: boolean;\n registryTopic?: \"api-endpoints\" | \"service-endpoints\" | \"data-offer-endpoints\";\n serviceApi?: Record<string, unknown>;\n requestBody?: {\n description?: string;\n required?: boolean;\n schema?: Record<string, unknown>;\n };\n}\n\nexport interface IPutEndpointOptions extends IPostEndpointOptions {}\nexport interface IPatchEndpointOptions extends IPostEndpointOptions {}\nexport interface IDeleteEndpointOptions extends IPostEndpointOptions {}\n"]}