@uns-kit/core 3.0.41 → 3.0.42
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/MIGRATIONS.md +23 -0
- package/dist/runtime/compatibility/energenti-authorization-v1.d.ts +2 -2
- package/dist/runtime/configuration-group-authorization.d.ts +2 -2
- package/dist/runtime/operator-api.d.ts +74 -0
- package/dist/runtime/operator-api.d.ts.map +1 -0
- package/dist/runtime/operator-api.js +241 -0
- package/dist/runtime/operator-api.js.map +1 -0
- package/dist/runtime/process-group-authorization.d.ts +2 -2
- package/dist/runtime/process-group-control-contract.d.ts +1 -1
- package/dist/uns/uns-interfaces.d.ts +6 -0
- package/dist/uns/uns-interfaces.d.ts.map +1 -1
- package/dist/uns/uns-interfaces.js.map +1 -1
- package/package.json +1 -1
package/MIGRATIONS.md
CHANGED
|
@@ -9,6 +9,29 @@ 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.42 - Opt-in registered operator APIs and Service API body metadata
|
|
13
|
+
|
|
14
|
+
Existing applications require no operator-API change when crossing this version.
|
|
15
|
+
To expose a protected read or command to generic Controller orchestration, declare
|
|
16
|
+
`operatorOperations` on the existing GET/POST registration. Use bounded request
|
|
17
|
+
schemas and, for commands, a UUID request ID, write domain and application-owned
|
|
18
|
+
durable idempotency receipt. See the shared
|
|
19
|
+
[operator API contract](https://github.com/uns-openhub/uns-kit/blob/master/docs/operator-api.md)
|
|
20
|
+
and [receipt example](https://github.com/uns-openhub/uns-kit/blob/master/docs/examples/operator-command-receipt.ts).
|
|
21
|
+
|
|
22
|
+
Declarations grant no permissions. Delegated operations require current Controller
|
|
23
|
+
ownership, explicit workload tools and a short-lived purpose-specific credential;
|
|
24
|
+
the SDK checks current parent authorization before invoking the handler. Ordinary
|
|
25
|
+
API bearer credentials remain separate. A missing Controller authority fails a
|
|
26
|
+
delegated call closed without changing standalone drain/signal cleanup. Reconcile
|
|
27
|
+
unknown command outcomes with the same actor/request ID and exact payload instead
|
|
28
|
+
of issuing a new command. Never mark an uncertain effect as not applied.
|
|
29
|
+
|
|
30
|
+
Shared POST/PUT/PATCH/DELETE registration also synchronizes Service API request-body
|
|
31
|
+
metadata with an explicitly supplied OpenAPI body. Existing catalog schemas and
|
|
32
|
+
examples are retained; the full JSON Schema remains in OpenAPI. No application
|
|
33
|
+
handler or permission change is required for that metadata correction.
|
|
34
|
+
|
|
12
35
|
## 3.0.41 - Explicit typed null scalar clears
|
|
13
36
|
|
|
14
37
|
Null publication is opt-in per MQTT publisher (`allowNullData: true`). A null
|
|
@@ -17,8 +17,8 @@ export declare const hvAuthorizationSchema: z.ZodObject<{
|
|
|
17
17
|
[x: string]: string;
|
|
18
18
|
}>;
|
|
19
19
|
role: z.ZodEnum<{
|
|
20
|
-
source: "source";
|
|
21
20
|
target: "target";
|
|
21
|
+
source: "source";
|
|
22
22
|
receiver: "receiver";
|
|
23
23
|
}>;
|
|
24
24
|
configurationSha256: z.ZodString;
|
|
@@ -51,8 +51,8 @@ export declare const processGroupAuthorizationSchema: z.ZodObject<{
|
|
|
51
51
|
instanceId: z.ZodString;
|
|
52
52
|
processName: z.ZodString;
|
|
53
53
|
role: z.ZodEnum<{
|
|
54
|
-
source: "source";
|
|
55
54
|
target: "target";
|
|
55
|
+
source: "source";
|
|
56
56
|
receiver: "receiver";
|
|
57
57
|
}>;
|
|
58
58
|
configurationSha256: z.ZodString;
|
|
@@ -21,8 +21,8 @@ export declare const configurationGroupAuthorizationSchema: z.ZodObject<{
|
|
|
21
21
|
instanceId: z.ZodString;
|
|
22
22
|
processName: z.ZodString;
|
|
23
23
|
role: z.ZodEnum<{
|
|
24
|
-
source: "source";
|
|
25
24
|
target: "target";
|
|
25
|
+
source: "source";
|
|
26
26
|
receiver: "receiver";
|
|
27
27
|
}>;
|
|
28
28
|
configurationSha256: z.ZodString;
|
|
@@ -40,7 +40,7 @@ export declare function verifyConfigurationGroupPolicy(context: ProcessGroupAuth
|
|
|
40
40
|
file: string;
|
|
41
41
|
directory: string;
|
|
42
42
|
journalId: string;
|
|
43
|
-
role: "
|
|
43
|
+
role: "target" | "source" | "receiver";
|
|
44
44
|
groupId: string;
|
|
45
45
|
groupProcessName: string;
|
|
46
46
|
namespace: string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Explicit opt-in. OpenAPI paths alone are never operator authority. */
|
|
3
|
+
export declare const OPERATOR_API_EXTENSION = "x-uns-operator-operations";
|
|
4
|
+
export declare const OPERATOR_DELEGATION_CLAIM = "unsOperatorDelegation";
|
|
5
|
+
export declare const OPERATOR_OUTCOME_HEADER = "x-uns-operator-outcome";
|
|
6
|
+
export declare const OPERATOR_AUTH_SCHEME = "UNS-Operator";
|
|
7
|
+
export declare const OPERATOR_JWT_TYPE = "uns-operator-api+jwt";
|
|
8
|
+
export declare const OPERATOR_JWT_AUDIENCE = "uns-operator-api";
|
|
9
|
+
export declare const OPERATOR_JWT_ALGORITHM = "PS256";
|
|
10
|
+
export declare const OPERATOR_JSON_MAX_BYTES = 65536;
|
|
11
|
+
export declare class OperatorApiError extends Error {
|
|
12
|
+
readonly code: string;
|
|
13
|
+
readonly status: number;
|
|
14
|
+
constructor(code: string, status?: number);
|
|
15
|
+
}
|
|
16
|
+
/** Canonical bounded JSON is shared by reviews, wire claims and receipts.
|
|
17
|
+
* Never hashes JSON with dropped undefined values or non-finite numbers. */
|
|
18
|
+
export declare function operatorJson(value: unknown): string;
|
|
19
|
+
export declare const operatorDigest: (value: unknown) => string;
|
|
20
|
+
/** Protocol 1 deliberately excludes references, executable regex and extensions.
|
|
21
|
+
* UUID format already enforces the standard UUID constraint without a pattern. */
|
|
22
|
+
export declare function operatorRequestSchema(value: unknown): Record<string, unknown>;
|
|
23
|
+
declare const definitionSchema: z.ZodObject<{
|
|
24
|
+
protocol: z.ZodLiteral<1>;
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
title: z.ZodString;
|
|
27
|
+
kind: z.ZodEnum<{
|
|
28
|
+
read: "read";
|
|
29
|
+
command: "command";
|
|
30
|
+
}>;
|
|
31
|
+
requestSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
32
|
+
writeDomain: z.ZodOptional<z.ZodString>;
|
|
33
|
+
replay: z.ZodOptional<z.ZodLiteral<"request-id-v1">>;
|
|
34
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
35
|
+
maxResponseBytes: z.ZodDefault<z.ZodNumber>;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
export type OperatorOperationDefinition = z.input<typeof definitionSchema>;
|
|
38
|
+
export type OperatorOperation = z.output<typeof definitionSchema> & {
|
|
39
|
+
method: "GET" | "POST";
|
|
40
|
+
path: string;
|
|
41
|
+
};
|
|
42
|
+
export declare function operatorOperation(definition: unknown, method: unknown, path: unknown): OperatorOperation;
|
|
43
|
+
export declare function operatorOperationFromWire(input: unknown): OperatorOperation;
|
|
44
|
+
export declare function assertOperatorPayload(operation: OperatorOperation, value: unknown): void;
|
|
45
|
+
export declare const operatorDeploymentSchema: z.ZodObject<{
|
|
46
|
+
controllerName: z.ZodString;
|
|
47
|
+
rttNode: z.ZodString;
|
|
48
|
+
version: z.ZodString;
|
|
49
|
+
instanceId: z.ZodString;
|
|
50
|
+
launchId: z.ZodUUID;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
export type OperatorDeployment = z.infer<typeof operatorDeploymentSchema>;
|
|
53
|
+
export declare const operatorDelegationSchema: z.ZodObject<{
|
|
54
|
+
protocol: z.ZodLiteral<1>;
|
|
55
|
+
operationId: z.ZodString;
|
|
56
|
+
operationDigest: z.ZodString;
|
|
57
|
+
requestDigest: z.ZodString;
|
|
58
|
+
target: z.ZodObject<{
|
|
59
|
+
controllerName: z.ZodString;
|
|
60
|
+
rttNode: z.ZodString;
|
|
61
|
+
version: z.ZodString;
|
|
62
|
+
instanceId: z.ZodString;
|
|
63
|
+
launchId: z.ZodUUID;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
tool: z.ZodEnum<{
|
|
66
|
+
controller_read_runtime_operator_operation: "controller_read_runtime_operator_operation";
|
|
67
|
+
controller_execute_runtime_operator_command: "controller_execute_runtime_operator_command";
|
|
68
|
+
}>;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
export type OperatorDelegation = z.infer<typeof operatorDelegationSchema>;
|
|
71
|
+
/** Called only AFTER normal JWT cryptographic, expiry and route-grant checks. */
|
|
72
|
+
export declare function assertOperatorDelegation(claims: Record<string, unknown>, operation: OperatorOperation, payload: unknown, deployment: OperatorDeployment, nowSeconds?: number): OperatorDelegation;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=operator-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator-api.d.ts","sourceRoot":"","sources":["../../src/runtime/operator-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yEAAyE;AACzE,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAClE,eAAO,MAAM,yBAAyB,0BAA0B,CAAC;AACjE,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAChE,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AACnD,eAAO,MAAM,iBAAiB,yBAAyB,CAAC;AACxD,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AACxD,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAC9C,eAAO,MAAM,uBAAuB,QAAQ,CAAC;AAiB7C,qBAAa,gBAAiB,SAAQ,KAAK;aAEvB,IAAI,EAAE,MAAM;aACZ,MAAM;gBADN,IAAI,EAAE,MAAM,EACZ,MAAM,SAAM;CAI/B;AAED;4EAC4E;AAC5E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAyBnD;A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,CAkCpB"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/** Explicit opt-in. OpenAPI paths alone are never operator authority. */
|
|
4
|
+
export const OPERATOR_API_EXTENSION = "x-uns-operator-operations";
|
|
5
|
+
export const OPERATOR_DELEGATION_CLAIM = "unsOperatorDelegation";
|
|
6
|
+
export const OPERATOR_OUTCOME_HEADER = "x-uns-operator-outcome";
|
|
7
|
+
export const OPERATOR_AUTH_SCHEME = "UNS-Operator";
|
|
8
|
+
export const OPERATOR_JWT_TYPE = "uns-operator-api+jwt";
|
|
9
|
+
export const OPERATOR_JWT_AUDIENCE = "uns-operator-api";
|
|
10
|
+
export const OPERATOR_JWT_ALGORITHM = "PS256";
|
|
11
|
+
export const OPERATOR_JSON_MAX_BYTES = 65536;
|
|
12
|
+
const identifier = z
|
|
13
|
+
.string()
|
|
14
|
+
.min(1)
|
|
15
|
+
.max(120)
|
|
16
|
+
.regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/);
|
|
17
|
+
const digest = z.string().regex(/^[a-f0-9]{64}$/);
|
|
18
|
+
const resource = z.string().min(1).max(256);
|
|
19
|
+
const localPath = z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1)
|
|
22
|
+
.max(2048)
|
|
23
|
+
.refine((value) => /^\/[a-zA-Z0-9_./-]+$/.test(value) && !value.includes("//") && !value.split("/").some((part) => part === "." || part === ".."), "Expected an exact local API path");
|
|
24
|
+
export class OperatorApiError extends Error {
|
|
25
|
+
code;
|
|
26
|
+
status;
|
|
27
|
+
constructor(code, status = 400) {
|
|
28
|
+
super(code);
|
|
29
|
+
this.code = code;
|
|
30
|
+
this.status = status;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Canonical bounded JSON is shared by reviews, wire claims and receipts.
|
|
34
|
+
* Never hashes JSON with dropped undefined values or non-finite numbers. */
|
|
35
|
+
export function operatorJson(value) {
|
|
36
|
+
let nodes = 0;
|
|
37
|
+
const visit = (item, depth) => {
|
|
38
|
+
if (++nodes > 4096 || depth > 20)
|
|
39
|
+
throw new OperatorApiError("operator_json_budget");
|
|
40
|
+
if (item === null || typeof item === "boolean")
|
|
41
|
+
return item;
|
|
42
|
+
if (typeof item === "number" && Number.isFinite(item))
|
|
43
|
+
return Object.is(item, -0) ? 0 : item;
|
|
44
|
+
if (typeof item === "string" && item.length <= 32768)
|
|
45
|
+
return item;
|
|
46
|
+
if (Array.isArray(item) && item.length <= 1024)
|
|
47
|
+
return item.map((entry) => visit(entry, depth + 1));
|
|
48
|
+
if (item && typeof item === "object" && [Object.prototype, null].includes(Object.getPrototypeOf(item))) {
|
|
49
|
+
const entries = Object.entries(item);
|
|
50
|
+
if (entries.length > 128)
|
|
51
|
+
throw new OperatorApiError("operator_json_budget");
|
|
52
|
+
return Object.fromEntries(entries
|
|
53
|
+
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
|
|
54
|
+
.map(([key, entry]) => {
|
|
55
|
+
if (key.length > 256 || ["__proto__", "prototype", "constructor"].includes(key))
|
|
56
|
+
throw new OperatorApiError("operator_json_key");
|
|
57
|
+
return [key, visit(entry, depth + 1)];
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
throw new OperatorApiError("operator_json_value");
|
|
61
|
+
};
|
|
62
|
+
const json = JSON.stringify(visit(value, 0));
|
|
63
|
+
if (Buffer.byteLength(json, "utf8") > OPERATOR_JSON_MAX_BYTES)
|
|
64
|
+
throw new OperatorApiError("operator_json_budget");
|
|
65
|
+
return json;
|
|
66
|
+
}
|
|
67
|
+
export const operatorDigest = (value) => createHash("sha256").update(operatorJson(value)).digest("hex");
|
|
68
|
+
/** Protocol 1 deliberately excludes references, executable regex and extensions.
|
|
69
|
+
* UUID format already enforces the standard UUID constraint without a pattern. */
|
|
70
|
+
export function operatorRequestSchema(value) {
|
|
71
|
+
operatorJson(value);
|
|
72
|
+
const vocabulary = new Set([
|
|
73
|
+
"$schema",
|
|
74
|
+
"type",
|
|
75
|
+
"properties",
|
|
76
|
+
"required",
|
|
77
|
+
"additionalProperties",
|
|
78
|
+
"items",
|
|
79
|
+
"minItems",
|
|
80
|
+
"maxItems",
|
|
81
|
+
"minLength",
|
|
82
|
+
"maxLength",
|
|
83
|
+
"minimum",
|
|
84
|
+
"maximum",
|
|
85
|
+
"exclusiveMinimum",
|
|
86
|
+
"exclusiveMaximum",
|
|
87
|
+
"multipleOf",
|
|
88
|
+
"format",
|
|
89
|
+
"const",
|
|
90
|
+
"enum",
|
|
91
|
+
"oneOf",
|
|
92
|
+
"anyOf",
|
|
93
|
+
"allOf",
|
|
94
|
+
"description",
|
|
95
|
+
"title",
|
|
96
|
+
"default",
|
|
97
|
+
"examples",
|
|
98
|
+
"pattern",
|
|
99
|
+
]);
|
|
100
|
+
let count = 0;
|
|
101
|
+
function schema(input, depth = 0) {
|
|
102
|
+
if (++count > 256 || depth > 12 || !input || typeof input !== "object" || Array.isArray(input))
|
|
103
|
+
throw new OperatorApiError("operator_schema_budget");
|
|
104
|
+
const source = input;
|
|
105
|
+
for (const key of Object.keys(source))
|
|
106
|
+
if (!vocabulary.has(key))
|
|
107
|
+
throw new OperatorApiError("operator_schema_keyword");
|
|
108
|
+
const out = { ...source };
|
|
109
|
+
if ("pattern" in out) {
|
|
110
|
+
if (out["format"] !== "uuid")
|
|
111
|
+
throw new OperatorApiError("operator_schema_pattern");
|
|
112
|
+
delete out["pattern"];
|
|
113
|
+
}
|
|
114
|
+
if (out["format"] && !["uuid", "date-time", "date", "time", "email", "uri"].includes(String(out["format"])))
|
|
115
|
+
throw new OperatorApiError("operator_schema_format");
|
|
116
|
+
if (source["properties"]) {
|
|
117
|
+
if (source["additionalProperties"] !== false || typeof source["properties"] !== "object" || Array.isArray(source["properties"]))
|
|
118
|
+
throw new OperatorApiError("operator_schema_object_must_be_closed");
|
|
119
|
+
out["properties"] = Object.fromEntries(Object.entries(source["properties"]).map(([key, item]) => [key, schema(item, depth + 1)]));
|
|
120
|
+
}
|
|
121
|
+
if (source["type"] === "object" && source["additionalProperties"] !== false)
|
|
122
|
+
throw new OperatorApiError("operator_schema_object_must_be_closed");
|
|
123
|
+
if (source["additionalProperties"] !== undefined && source["additionalProperties"] !== false)
|
|
124
|
+
throw new OperatorApiError("operator_schema_object_must_be_closed");
|
|
125
|
+
if (source["items"])
|
|
126
|
+
out["items"] = schema(source["items"], depth + 1);
|
|
127
|
+
for (const key of ["oneOf", "anyOf", "allOf"])
|
|
128
|
+
if (source[key]) {
|
|
129
|
+
if (!Array.isArray(source[key]) || source[key].length > 16)
|
|
130
|
+
throw new OperatorApiError("operator_schema_budget");
|
|
131
|
+
out[key] = source[key].map((item) => schema(item, depth + 1));
|
|
132
|
+
}
|
|
133
|
+
return out;
|
|
134
|
+
}
|
|
135
|
+
const normalized = schema(value);
|
|
136
|
+
try {
|
|
137
|
+
z.fromJSONSchema(normalized);
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
throw new OperatorApiError("operator_schema_unsupported");
|
|
141
|
+
}
|
|
142
|
+
return normalized;
|
|
143
|
+
}
|
|
144
|
+
const definitionSchema = z
|
|
145
|
+
.object({
|
|
146
|
+
protocol: z.literal(1),
|
|
147
|
+
id: identifier,
|
|
148
|
+
title: z.string().min(1).max(160),
|
|
149
|
+
kind: z.enum(["read", "command"]),
|
|
150
|
+
requestSchema: z.record(z.string(), z.unknown()),
|
|
151
|
+
writeDomain: identifier.optional(),
|
|
152
|
+
replay: z.literal("request-id-v1").optional(),
|
|
153
|
+
timeoutMs: z.number().int().min(500).max(10000).default(5000),
|
|
154
|
+
maxResponseBytes: z.number().int().min(256).max(262144).default(65536),
|
|
155
|
+
})
|
|
156
|
+
.strict()
|
|
157
|
+
.superRefine((d, ctx) => {
|
|
158
|
+
if (d.kind === "command" && (!d.writeDomain || d.replay !== "request-id-v1"))
|
|
159
|
+
ctx.addIssue({ code: "custom", message: "Commands require a write domain and application request-id receipt support" });
|
|
160
|
+
if (d.kind === "read" && (d.writeDomain || d.replay))
|
|
161
|
+
ctx.addIssue({ code: "custom", message: "Reads cannot declare command authority" });
|
|
162
|
+
});
|
|
163
|
+
export function operatorOperation(definition, method, path) {
|
|
164
|
+
const parsed = definitionSchema.parse(definition);
|
|
165
|
+
const checkedMethod = z.enum(["GET", "POST"]).parse(method);
|
|
166
|
+
if (parsed.kind === "command" && checkedMethod !== "POST")
|
|
167
|
+
throw new OperatorApiError("operator_command_requires_post");
|
|
168
|
+
return { ...parsed, requestSchema: operatorRequestSchema(parsed.requestSchema), method: checkedMethod, path: localPath.parse(path) };
|
|
169
|
+
}
|
|
170
|
+
export function operatorOperationFromWire(input) {
|
|
171
|
+
if (!input || typeof input !== "object" || Array.isArray(input))
|
|
172
|
+
throw new OperatorApiError("operator_operation_invalid");
|
|
173
|
+
const { method, path, ...definition } = input;
|
|
174
|
+
return operatorOperation(definition, method, path);
|
|
175
|
+
}
|
|
176
|
+
export function assertOperatorPayload(operation, value) {
|
|
177
|
+
operatorJson(value);
|
|
178
|
+
let valid = false;
|
|
179
|
+
try {
|
|
180
|
+
valid = z.fromJSONSchema(operation.requestSchema).safeParse(value).success;
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
/* fail closed */
|
|
184
|
+
}
|
|
185
|
+
if (!valid)
|
|
186
|
+
throw new OperatorApiError("operator_request_invalid");
|
|
187
|
+
if (operation.kind === "command" && !z.uuid().safeParse(value?.["requestId"]).success)
|
|
188
|
+
throw new OperatorApiError("operator_request_id_required");
|
|
189
|
+
}
|
|
190
|
+
export const operatorDeploymentSchema = z
|
|
191
|
+
.object({
|
|
192
|
+
controllerName: resource,
|
|
193
|
+
rttNode: resource,
|
|
194
|
+
version: resource,
|
|
195
|
+
instanceId: resource,
|
|
196
|
+
launchId: z.uuid(),
|
|
197
|
+
})
|
|
198
|
+
.strict();
|
|
199
|
+
export const operatorDelegationSchema = z
|
|
200
|
+
.object({
|
|
201
|
+
protocol: z.literal(1),
|
|
202
|
+
operationId: identifier,
|
|
203
|
+
operationDigest: digest,
|
|
204
|
+
requestDigest: digest,
|
|
205
|
+
target: operatorDeploymentSchema,
|
|
206
|
+
tool: z.enum(["controller_read_runtime_operator_operation", "controller_execute_runtime_operator_command"]),
|
|
207
|
+
})
|
|
208
|
+
.strict();
|
|
209
|
+
/** Called only AFTER normal JWT cryptographic, expiry and route-grant checks. */
|
|
210
|
+
export function assertOperatorDelegation(claims, operation, payload, deployment, nowSeconds = Math.floor(Date.now() / 1000)) {
|
|
211
|
+
const d = operatorDelegationSchema.parse(claims[OPERATOR_DELEGATION_CLAIM]);
|
|
212
|
+
if (claims["serviceToken"] !== true ||
|
|
213
|
+
claims["identityType"] !== "machine" ||
|
|
214
|
+
claims["workloadIdentityType"] !== "CONTROLLER_MCP" ||
|
|
215
|
+
claims["sub"] !== claims["machineIdentityId"] ||
|
|
216
|
+
!z.uuid().safeParse(claims["sub"]).success ||
|
|
217
|
+
!Number.isSafeInteger(claims["tokenVersion"]) ||
|
|
218
|
+
Number(claims["tokenVersion"]) < 1 ||
|
|
219
|
+
claims["role"] !== "operator" ||
|
|
220
|
+
!Number.isSafeInteger(claims["iat"]) ||
|
|
221
|
+
!Number.isSafeInteger(claims["exp"]) ||
|
|
222
|
+
Number(claims["exp"]) <= nowSeconds ||
|
|
223
|
+
Number(claims["iat"]) > nowSeconds + 2 ||
|
|
224
|
+
Number(claims["exp"]) - Number(claims["iat"]) > 30 ||
|
|
225
|
+
Number(claims["exp"]) <= Number(claims["iat"]) ||
|
|
226
|
+
!Array.isArray(claims["accessRules"]) ||
|
|
227
|
+
claims["accessRules"].length !== 1 ||
|
|
228
|
+
claims["accessRules"][0] !== operation.path) {
|
|
229
|
+
throw new OperatorApiError("operator_delegation_invalid", 403);
|
|
230
|
+
}
|
|
231
|
+
if (d.operationId !== operation.id ||
|
|
232
|
+
d.operationDigest !== operatorDigest(operation) ||
|
|
233
|
+
d.requestDigest !== operatorDigest(payload) ||
|
|
234
|
+
operatorDigest(d.target) !== operatorDigest(operatorDeploymentSchema.parse(deployment)) ||
|
|
235
|
+
d.tool !== (operation.kind === "command" ? "controller_execute_runtime_operator_command" : "controller_read_runtime_operator_operation")) {
|
|
236
|
+
throw new OperatorApiError("operator_delegation_binding_changed", 403);
|
|
237
|
+
}
|
|
238
|
+
assertOperatorPayload(operation, payload);
|
|
239
|
+
return d;
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=operator-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator-api.js","sourceRoot":"","sources":["../../src/runtime/operator-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yEAAyE;AACzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,2BAA2B,CAAC;AAClE,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AACjE,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAC;AACnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AACxD,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AACxD,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAC9C,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAC7C,MAAM,UAAU,GAAG,CAAC;KACjB,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,KAAK,CAAC,8BAA8B,CAAC,CAAC;AACzC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAClD,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,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AAC;QACD,MAAM,IAAI,gBAAgB,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;IACjE,CAAC;IACD,IACE,CAAC,CAAC,WAAW,KAAK,SAAS,CAAC,EAAE;QAC9B,CAAC,CAAC,eAAe,KAAK,cAAc,CAAC,SAAS,CAAC;QAC/C,CAAC,CAAC,aAAa,KAAK,cAAc,CAAC,OAAO,CAAC;QAC3C,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,cAAc,CAAC,wBAAwB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACvF,CAAC,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,6CAA6C,CAAC,CAAC,CAAC,4CAA4C,CAAC,EACxI,CAAC;QACD,MAAM,IAAI,gBAAgB,CAAC,qCAAqC,EAAE,GAAG,CAAC,CAAC;IACzE,CAAC;IACD,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1C,OAAO,CAAC,CAAC;AACX,CAAC","sourcesContent":["import { createHash } from \"node:crypto\";\nimport { z } from \"zod\";\n\n/** Explicit opt-in. OpenAPI paths alone are never operator authority. */\nexport const OPERATOR_API_EXTENSION = \"x-uns-operator-operations\";\nexport const OPERATOR_DELEGATION_CLAIM = \"unsOperatorDelegation\";\nexport const OPERATOR_OUTCOME_HEADER = \"x-uns-operator-outcome\";\nexport const OPERATOR_AUTH_SCHEME = \"UNS-Operator\";\nexport const OPERATOR_JWT_TYPE = \"uns-operator-api+jwt\";\nexport const OPERATOR_JWT_AUDIENCE = \"uns-operator-api\";\nexport const OPERATOR_JWT_ALGORITHM = \"PS256\";\nexport const OPERATOR_JSON_MAX_BYTES = 65536;\nconst identifier = z\n .string()\n .min(1)\n .max(120)\n .regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/);\nconst digest = z.string().regex(/^[a-f0-9]{64}$/);\nconst resource = z.string().min(1).max(256);\nconst localPath = z\n .string()\n .min(1)\n .max(2048)\n .refine(\n (value) => /^\\/[a-zA-Z0-9_./-]+$/.test(value) && !value.includes(\"//\") && !value.split(\"/\").some((part) => part === \".\" || part === \"..\"),\n \"Expected an exact local API path\",\n );\n\nexport class OperatorApiError extends Error {\n constructor(\n public readonly code: string,\n public readonly status = 400,\n ) {\n super(code);\n }\n}\n\n/** Canonical bounded JSON is shared by reviews, wire claims and receipts.\n * Never hashes JSON with dropped undefined values or non-finite numbers. */\nexport function operatorJson(value: unknown): string {\n let nodes = 0;\n const visit = (item: unknown, depth: number): unknown => {\n if (++nodes > 4096 || depth > 20) throw new OperatorApiError(\"operator_json_budget\");\n if (item === null || typeof item === \"boolean\") return item;\n if (typeof item === \"number\" && Number.isFinite(item)) return Object.is(item, -0) ? 0 : item;\n if (typeof item === \"string\" && item.length <= 32768) return item;\n if (Array.isArray(item) && item.length <= 1024) return item.map((entry) => visit(entry, depth + 1));\n if (item && typeof item === \"object\" && [Object.prototype, null].includes(Object.getPrototypeOf(item))) {\n const entries = Object.entries(item as Record<string, unknown>);\n if (entries.length > 128) throw new OperatorApiError(\"operator_json_budget\");\n return Object.fromEntries(\n entries\n .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))\n .map(([key, entry]) => {\n if (key.length > 256 || [\"__proto__\", \"prototype\", \"constructor\"].includes(key)) throw new OperatorApiError(\"operator_json_key\");\n return [key, visit(entry, depth + 1)];\n }),\n );\n }\n throw new OperatorApiError(\"operator_json_value\");\n };\n const json = JSON.stringify(visit(value, 0));\n if (Buffer.byteLength(json, \"utf8\") > OPERATOR_JSON_MAX_BYTES) throw new OperatorApiError(\"operator_json_budget\");\n return json;\n}\nexport const operatorDigest = (value: unknown): string => createHash(\"sha256\").update(operatorJson(value)).digest(\"hex\");\n\n/** Protocol 1 deliberately excludes references, executable regex and extensions.\n * UUID format already enforces the standard UUID constraint without a pattern. */\nexport function operatorRequestSchema(value: unknown): Record<string, unknown> {\n operatorJson(value);\n const vocabulary = new Set([\n \"$schema\",\n \"type\",\n \"properties\",\n \"required\",\n \"additionalProperties\",\n \"items\",\n \"minItems\",\n \"maxItems\",\n \"minLength\",\n \"maxLength\",\n \"minimum\",\n \"maximum\",\n \"exclusiveMinimum\",\n \"exclusiveMaximum\",\n \"multipleOf\",\n \"format\",\n \"const\",\n \"enum\",\n \"oneOf\",\n \"anyOf\",\n \"allOf\",\n \"description\",\n \"title\",\n \"default\",\n \"examples\",\n \"pattern\",\n ]);\n let count = 0;\n function schema(input: unknown, depth = 0): Record<string, unknown> {\n if (++count > 256 || depth > 12 || !input || typeof input !== \"object\" || Array.isArray(input))\n throw new OperatorApiError(\"operator_schema_budget\");\n const source = input as Record<string, unknown>;\n for (const key of Object.keys(source)) if (!vocabulary.has(key)) throw new OperatorApiError(\"operator_schema_keyword\");\n const out = { ...source };\n if (\"pattern\" in out) {\n if (out[\"format\"] !== \"uuid\") throw new OperatorApiError(\"operator_schema_pattern\");\n delete out[\"pattern\"];\n }\n if (out[\"format\"] && ![\"uuid\", \"date-time\", \"date\", \"time\", \"email\", \"uri\"].includes(String(out[\"format\"])))\n throw new OperatorApiError(\"operator_schema_format\");\n if (source[\"properties\"]) {\n if (source[\"additionalProperties\"] !== false || typeof source[\"properties\"] !== \"object\" || Array.isArray(source[\"properties\"]))\n throw new OperatorApiError(\"operator_schema_object_must_be_closed\");\n out[\"properties\"] = Object.fromEntries(\n Object.entries(source[\"properties\"] as Record<string, unknown>).map(([key, item]) => [key, schema(item, depth + 1)]),\n );\n }\n if (source[\"type\"] === \"object\" && source[\"additionalProperties\"] !== false) throw new OperatorApiError(\"operator_schema_object_must_be_closed\");\n if (source[\"additionalProperties\"] !== undefined && source[\"additionalProperties\"] !== false)\n throw new OperatorApiError(\"operator_schema_object_must_be_closed\");\n if (source[\"items\"]) out[\"items\"] = schema(source[\"items\"], depth + 1);\n for (const key of [\"oneOf\", \"anyOf\", \"allOf\"])\n if (source[key]) {\n if (!Array.isArray(source[key]) || source[key].length > 16) throw new OperatorApiError(\"operator_schema_budget\");\n out[key] = source[key].map((item) => schema(item, depth + 1));\n }\n return out;\n }\n const normalized = schema(value);\n try {\n z.fromJSONSchema(normalized as never);\n } catch {\n throw new OperatorApiError(\"operator_schema_unsupported\");\n }\n return normalized;\n}\nconst definitionSchema = z\n .object({\n protocol: z.literal(1),\n id: identifier,\n title: z.string().min(1).max(160),\n kind: z.enum([\"read\", \"command\"]),\n requestSchema: z.record(z.string(), z.unknown()),\n writeDomain: identifier.optional(),\n replay: z.literal(\"request-id-v1\").optional(),\n timeoutMs: z.number().int().min(500).max(10000).default(5000),\n maxResponseBytes: z.number().int().min(256).max(262144).default(65536),\n })\n .strict()\n .superRefine((d, ctx) => {\n if (d.kind === \"command\" && (!d.writeDomain || d.replay !== \"request-id-v1\"))\n ctx.addIssue({ code: \"custom\", message: \"Commands require a write domain and application request-id receipt support\" });\n if (d.kind === \"read\" && (d.writeDomain || d.replay)) ctx.addIssue({ code: \"custom\", message: \"Reads cannot declare command authority\" });\n });\nexport type OperatorOperationDefinition = z.input<typeof definitionSchema>;\nexport type OperatorOperation = z.output<typeof definitionSchema> & { method: \"GET\" | \"POST\"; path: string };\nexport function operatorOperation(definition: unknown, method: unknown, path: unknown): OperatorOperation {\n const parsed = definitionSchema.parse(definition);\n const checkedMethod = z.enum([\"GET\", \"POST\"]).parse(method);\n if (parsed.kind === \"command\" && checkedMethod !== \"POST\") throw new OperatorApiError(\"operator_command_requires_post\");\n return { ...parsed, requestSchema: operatorRequestSchema(parsed.requestSchema), method: checkedMethod, path: localPath.parse(path) };\n}\nexport function operatorOperationFromWire(input: unknown): OperatorOperation {\n if (!input || typeof input !== \"object\" || Array.isArray(input)) throw new OperatorApiError(\"operator_operation_invalid\");\n const { method, path, ...definition } = input as Record<string, unknown>;\n return operatorOperation(definition, method, path);\n}\nexport function assertOperatorPayload(operation: OperatorOperation, value: unknown): void {\n operatorJson(value);\n let valid = false;\n try {\n valid = z.fromJSONSchema(operation.requestSchema as never).safeParse(value).success;\n } catch {\n /* fail closed */\n }\n if (!valid) throw new OperatorApiError(\"operator_request_invalid\");\n if (operation.kind === \"command\" && !z.uuid().safeParse((value as Record<string, unknown>)?.[\"requestId\"]).success)\n throw new OperatorApiError(\"operator_request_id_required\");\n}\nexport const operatorDeploymentSchema = z\n .object({\n controllerName: resource,\n rttNode: resource,\n version: resource,\n instanceId: resource,\n launchId: z.uuid(),\n })\n .strict();\nexport type OperatorDeployment = z.infer<typeof operatorDeploymentSchema>;\nexport const operatorDelegationSchema = z\n .object({\n protocol: z.literal(1),\n operationId: identifier,\n operationDigest: digest,\n requestDigest: digest,\n target: operatorDeploymentSchema,\n tool: z.enum([\"controller_read_runtime_operator_operation\", \"controller_execute_runtime_operator_command\"]),\n })\n .strict();\nexport type OperatorDelegation = z.infer<typeof operatorDelegationSchema>;\n\n/** Called only AFTER normal JWT cryptographic, expiry and route-grant checks. */\nexport function assertOperatorDelegation(\n claims: Record<string, unknown>,\n operation: OperatorOperation,\n payload: unknown,\n deployment: OperatorDeployment,\n nowSeconds = Math.floor(Date.now() / 1000),\n): OperatorDelegation {\n const d = operatorDelegationSchema.parse(claims[OPERATOR_DELEGATION_CLAIM]);\n if (\n claims[\"serviceToken\"] !== true ||\n claims[\"identityType\"] !== \"machine\" ||\n claims[\"workloadIdentityType\"] !== \"CONTROLLER_MCP\" ||\n claims[\"sub\"] !== claims[\"machineIdentityId\"] ||\n !z.uuid().safeParse(claims[\"sub\"]).success ||\n !Number.isSafeInteger(claims[\"tokenVersion\"]) ||\n Number(claims[\"tokenVersion\"]) < 1 ||\n claims[\"role\"] !== \"operator\" ||\n !Number.isSafeInteger(claims[\"iat\"]) ||\n !Number.isSafeInteger(claims[\"exp\"]) ||\n Number(claims[\"exp\"]) <= nowSeconds ||\n Number(claims[\"iat\"]) > nowSeconds + 2 ||\n Number(claims[\"exp\"]) - Number(claims[\"iat\"]) > 30 ||\n Number(claims[\"exp\"]) <= Number(claims[\"iat\"]) ||\n !Array.isArray(claims[\"accessRules\"]) ||\n claims[\"accessRules\"].length !== 1 ||\n claims[\"accessRules\"][0] !== operation.path\n ) {\n throw new OperatorApiError(\"operator_delegation_invalid\", 403);\n }\n if (\n d.operationId !== operation.id ||\n d.operationDigest !== operatorDigest(operation) ||\n d.requestDigest !== operatorDigest(payload) ||\n operatorDigest(d.target) !== operatorDigest(operatorDeploymentSchema.parse(deployment)) ||\n d.tool !== (operation.kind === \"command\" ? \"controller_execute_runtime_operator_command\" : \"controller_read_runtime_operator_operation\")\n ) {\n throw new OperatorApiError(\"operator_delegation_binding_changed\", 403);\n }\n assertOperatorPayload(operation, payload);\n return d;\n}\n"]}
|
|
@@ -22,8 +22,8 @@ export declare const processGroupAuthorizationSchema: z.ZodObject<{
|
|
|
22
22
|
instanceId: z.ZodString;
|
|
23
23
|
processName: z.ZodString;
|
|
24
24
|
role: z.ZodEnum<{
|
|
25
|
-
source: "source";
|
|
26
25
|
target: "target";
|
|
26
|
+
source: "source";
|
|
27
27
|
receiver: "receiver";
|
|
28
28
|
}>;
|
|
29
29
|
configurationSha256: z.ZodString;
|
|
@@ -75,8 +75,8 @@ export declare const hvAuthorizationSchema: z.ZodObject<{
|
|
|
75
75
|
[x: string]: string;
|
|
76
76
|
}>;
|
|
77
77
|
role: z.ZodEnum<{
|
|
78
|
-
source: "source";
|
|
79
78
|
target: "target";
|
|
79
|
+
source: "source";
|
|
80
80
|
receiver: "receiver";
|
|
81
81
|
}>;
|
|
82
82
|
configurationSha256: z.ZodString;
|
|
@@ -46,8 +46,8 @@ export declare const groupMemberCommandSchema: z.ZodObject<{
|
|
|
46
46
|
}, z.core.$strict>;
|
|
47
47
|
operationId: z.ZodString;
|
|
48
48
|
role: z.ZodEnum<{
|
|
49
|
-
source: "source";
|
|
50
49
|
target: "target";
|
|
50
|
+
source: "source";
|
|
51
51
|
}>;
|
|
52
52
|
expectedConfigurationChecksum: z.ZodOptional<z.ZodString>;
|
|
53
53
|
requestId: z.ZodOptional<z.ZodString>;
|
|
@@ -505,6 +505,10 @@ export interface ApiChatDefaults {
|
|
|
505
505
|
[key: string]: string | number | boolean | undefined;
|
|
506
506
|
}
|
|
507
507
|
export interface IApiProxyOptions {
|
|
508
|
+
/** Fresh principal-status endpoint for operator operations. Controller-managed
|
|
509
|
+
* runtimes default to their configured controller origin. No bearer is exposed. */
|
|
510
|
+
operatorAuthorizationStatusUrl?: string;
|
|
511
|
+
operatorJwksUrl?: string;
|
|
508
512
|
jwtSecret?: string;
|
|
509
513
|
/**
|
|
510
514
|
* Public origin advertised for generated API endpoint metadata.
|
|
@@ -533,6 +537,7 @@ export interface IApiProxyOptions {
|
|
|
533
537
|
disableDefaultApiMount?: boolean;
|
|
534
538
|
}
|
|
535
539
|
export interface IGetEndpointOptions {
|
|
540
|
+
operatorOperations?: import("../runtime/operator-api.js").OperatorOperationDefinition[];
|
|
536
541
|
apiDescription?: string;
|
|
537
542
|
tags?: string[];
|
|
538
543
|
queryParams?: QueryParamDef[];
|
|
@@ -545,6 +550,7 @@ export interface IGetEndpointOptions {
|
|
|
545
550
|
chatDefaults?: ApiChatDefaults;
|
|
546
551
|
}
|
|
547
552
|
export interface IPostEndpointOptions {
|
|
553
|
+
operatorOperations?: import("../runtime/operator-api.js").OperatorOperationDefinition[];
|
|
548
554
|
apiDescription?: string;
|
|
549
555
|
tags?: string[];
|
|
550
556
|
routeOnly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uns-interfaces.d.ts","sourceRoot":"","sources":["../../src/uns/uns-interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACx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,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 type { MqttPublishQueueOptions } from \"../uns-mqtt/publish-queue-contract.js\";\nimport type { ApplicationHandoverState } from \"../runtime/application-handover-state.js\";\nimport type { HandoverShutdownHooks } from \"./handover-shutdown.js\";\nimport { 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[] | null;\n\n/** A null is an explicit typed clear, not a missing field or inferred object. */\nexport function scalarDataValueType(value: unknown, declared?: unknown): ValueTypeString {\n if (value === null) {\n if (declared === \"string\" || declared === \"number\") return declared;\n throw new Error(\"Null data requires explicit valueType string or number\");\n }\n const inferred = typeof value;\n if (inferred !== \"string\" && inferred !== \"number\")\n throw new Error(\"Value in data object must be string or number\");\n return inferred;\n}\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 /** Opt in to typed null/clear publications and a distinct handover contract. */\n allowNullData?: boolean;\n /** Stable semantic revision of calculation state; change when meaning/scaling changes. Required for correlated-v2. */\n handoverStateContract?: string;\n /** Optional MQTT output persistence; absence keeps issued queue behavior. */\n publishQueue?: MqttPublishQueueOptions;\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 /** Opt-in bounded waiting for RAM output admission instead of rejecting a full queue. */\n publishBackpressure?: { maxWaiting?: number };\n /** Keep one input owned by the worker until setInputHandler's async work finishes. */\n managedInput?: boolean;\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 /** Wait for explicit application readiness before initial ownership. */\n deferHandoverUntilReady?: boolean;\n /** Optional bounded application RAM state transferred with the reviewed SDK handover. */\n handoverState?: ApplicationHandoverState;\n /** Optional application drain after a cooperative handover. Register before creating proxies. */\n handoverShutdown?: HandoverShutdownHooks;\n processName: string;\n /**\n * Optional controller-supplied correlation id for one cooperative handover.\n * Older peers ignore it, so it must never be required for normal startup.\n */\n handoverId?: string;\n /** Opt-in state-preserving MQTT handover. Requires matching SDK peers. */\n handoverProtocol?: \"correlated-v1\" | \"correlated-v2\";\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; processedTail?: 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 /** Required for an explicit null/clear; ordinary scalar types remain inferred. */\n valueType?: ValueTypeString;\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 type IAssetProviderIdentity = {\n providerId: string;\n externalSystem: string;\n externalType: string;\n externalId: string;\n};\n\nexport type IAssetIdentityPublicationMetadata =\n | {\n assetStableEntityId?: never;\n assetDisplayName?: never;\n assetIdentityProof?: never;\n assetProviderIdentity?: never;\n assetProviderIdentityProof?: never;\n }\n | {\n /** Controller-issued stable Asset UUID. It identifies the Asset, not its current path. */\n assetStableEntityId: string;\n /** Optional operator-facing name; never used as an identity key. */\n assetDisplayName?: string;\n /** Short-lived controller-signed proof bound to this Asset UUID and exact candidate path. */\n assetIdentityProof: string;\n assetProviderIdentity?: never;\n assetProviderIdentityProof?: never;\n }\n | {\n assetStableEntityId?: never;\n assetDisplayName?: never;\n assetIdentityProof?: never;\n /** Reviewed provider namespace plus external identifier for a provisional no-ID Asset. */\n assetProviderIdentity: IAssetProviderIdentity;\n /** Short-lived controller-signed proof bound to the provider identifier and exact candidate path. */\n assetProviderIdentityProof: string;\n };\n\nexport type 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} & IAssetIdentityPublicationMetadata;\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 /** Optional stable Asset UUID; accepted by the controller only with a valid publication proof. */\n assetStableEntityId?: string;\n /** Optional operator-facing name; never used as an identity key. */\n assetDisplayName?: string;\n /** Short-lived controller-signed evidence for this exact Asset path. */\n assetIdentityProof?: string;\n /** Reviewed provider namespace plus external identifier for a provisional no-ID Asset. */\n assetProviderIdentity?: IAssetProviderIdentity;\n /** Short-lived controller-signed evidence for this provider identifier and exact Asset path. */\n assetProviderIdentityProof?: 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":"AAaA,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;AAMxD,iFAAiF;AACjF,MAAM,UAAU,mBAAmB,CAAC,KAAc,EAAE,QAAkB;IACpE,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ;YAAE,OAAO,QAAQ,CAAC;QACpE,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,MAAM,QAAQ,GAAG,OAAO,KAAK,CAAC;IAC9B,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ;QAChD,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,OAAO,QAAQ,CAAC;AAClB,CAAC;AAyCD,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 type { MqttPublishQueueOptions } from \"../uns-mqtt/publish-queue-contract.js\";\nimport type { ApplicationHandoverState } from \"../runtime/application-handover-state.js\";\nimport type { HandoverShutdownHooks } from \"./handover-shutdown.js\";\nimport { 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[] | null;\n\n/** A null is an explicit typed clear, not a missing field or inferred object. */\nexport function scalarDataValueType(value: unknown, declared?: unknown): ValueTypeString {\n if (value === null) {\n if (declared === \"string\" || declared === \"number\") return declared;\n throw new Error(\"Null data requires explicit valueType string or number\");\n }\n const inferred = typeof value;\n if (inferred !== \"string\" && inferred !== \"number\")\n throw new Error(\"Value in data object must be string or number\");\n return inferred;\n}\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 /** Opt in to typed null/clear publications and a distinct handover contract. */\n allowNullData?: boolean;\n /** Stable semantic revision of calculation state; change when meaning/scaling changes. Required for correlated-v2. */\n handoverStateContract?: string;\n /** Optional MQTT output persistence; absence keeps issued queue behavior. */\n publishQueue?: MqttPublishQueueOptions;\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 /** Opt-in bounded waiting for RAM output admission instead of rejecting a full queue. */\n publishBackpressure?: { maxWaiting?: number };\n /** Keep one input owned by the worker until setInputHandler's async work finishes. */\n managedInput?: boolean;\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 /** Wait for explicit application readiness before initial ownership. */\n deferHandoverUntilReady?: boolean;\n /** Optional bounded application RAM state transferred with the reviewed SDK handover. */\n handoverState?: ApplicationHandoverState;\n /** Optional application drain after a cooperative handover. Register before creating proxies. */\n handoverShutdown?: HandoverShutdownHooks;\n processName: string;\n /**\n * Optional controller-supplied correlation id for one cooperative handover.\n * Older peers ignore it, so it must never be required for normal startup.\n */\n handoverId?: string;\n /** Opt-in state-preserving MQTT handover. Requires matching SDK peers. */\n handoverProtocol?: \"correlated-v1\" | \"correlated-v2\";\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; processedTail?: 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 /** Required for an explicit null/clear; ordinary scalar types remain inferred. */\n valueType?: ValueTypeString;\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 type IAssetProviderIdentity = {\n providerId: string;\n externalSystem: string;\n externalType: string;\n externalId: string;\n};\n\nexport type IAssetIdentityPublicationMetadata =\n | {\n assetStableEntityId?: never;\n assetDisplayName?: never;\n assetIdentityProof?: never;\n assetProviderIdentity?: never;\n assetProviderIdentityProof?: never;\n }\n | {\n /** Controller-issued stable Asset UUID. It identifies the Asset, not its current path. */\n assetStableEntityId: string;\n /** Optional operator-facing name; never used as an identity key. */\n assetDisplayName?: string;\n /** Short-lived controller-signed proof bound to this Asset UUID and exact candidate path. */\n assetIdentityProof: string;\n assetProviderIdentity?: never;\n assetProviderIdentityProof?: never;\n }\n | {\n assetStableEntityId?: never;\n assetDisplayName?: never;\n assetIdentityProof?: never;\n /** Reviewed provider namespace plus external identifier for a provisional no-ID Asset. */\n assetProviderIdentity: IAssetProviderIdentity;\n /** Short-lived controller-signed proof bound to the provider identifier and exact candidate path. */\n assetProviderIdentityProof: string;\n };\n\nexport type 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} & IAssetIdentityPublicationMetadata;\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 /** Optional stable Asset UUID; accepted by the controller only with a valid publication proof. */\n assetStableEntityId?: string;\n /** Optional operator-facing name; never used as an identity key. */\n assetDisplayName?: string;\n /** Short-lived controller-signed evidence for this exact Asset path. */\n assetIdentityProof?: string;\n /** Reviewed provider namespace plus external identifier for a provisional no-ID Asset. */\n assetProviderIdentity?: IAssetProviderIdentity;\n /** Short-lived controller-signed evidence for this provider identifier and exact Asset path. */\n assetProviderIdentityProof?: 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 /** Fresh principal-status endpoint for operator operations. Controller-managed\n * runtimes default to their configured controller origin. No bearer is exposed. */\n operatorAuthorizationStatusUrl?: string;\n operatorJwksUrl?: string;\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 operatorOperations?: import(\"../runtime/operator-api.js\").OperatorOperationDefinition[];\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 operatorOperations?: import(\"../runtime/operator-api.js\").OperatorOperationDefinition[];\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"]}
|