@uns-kit/core 2.0.39 → 2.0.40

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 (42) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +147 -147
  3. package/dist/app-config.d.ts.map +1 -0
  4. package/dist/app-config.js.map +1 -0
  5. package/dist/index.d.ts +8 -8
  6. package/dist/index.js +7 -7
  7. package/dist/tools/datahub/datahub-client.js +1 -1
  8. package/dist/tools/datahub/datahub-client.js.map +1 -1
  9. package/dist/tools/file-utils.d.ts +2 -2
  10. package/dist/tools/file-utils.js +24 -24
  11. package/dist/tools/generate-uns-dictionary.d.ts +23 -23
  12. package/dist/tools/generate-uns-dictionary.js +154 -154
  13. package/dist/tools/generate-uns-measurements.d.ts +21 -21
  14. package/dist/tools/generate-uns-measurements.js +126 -126
  15. package/dist/tools/generate-uns-reference.d.ts +2 -2
  16. package/dist/tools/generate-uns-reference.js +85 -85
  17. package/dist/tools/refresh-uns.js +50 -50
  18. package/dist/tools/sync-uns-schema.d.ts +2 -2
  19. package/dist/tools/sync-uns-schema.js +489 -489
  20. package/dist/uns/uns-asset.d.ts +1 -1
  21. package/dist/uns/uns-asset.js +1 -1
  22. package/dist/uns/uns-attributes.d.ts +6 -6
  23. package/dist/uns/uns-attributes.js +9 -9
  24. package/dist/uns/uns-dictionary-registry.d.ts +4 -4
  25. package/dist/uns/uns-dictionary-registry.js +20 -20
  26. package/dist/uns/uns-dictionary.generated.d.ts +663 -663
  27. package/dist/uns/uns-dictionary.generated.js +745 -745
  28. package/dist/uns/uns-interfaces.d.ts +365 -365
  29. package/dist/uns/uns-measurements.generated.d.ts +362 -362
  30. package/dist/uns/uns-measurements.generated.js +359 -359
  31. package/dist/uns/uns-object.d.ts +20 -20
  32. package/dist/uns/uns-object.js +9 -9
  33. package/dist/uns/uns-packet.js +263 -263
  34. package/dist/uns/uns-path.d.ts +2 -2
  35. package/dist/uns/uns-path.js +10 -10
  36. package/dist/uns/uns-proxy-process.js +203 -203
  37. package/dist/uns/uns-proxy.d.ts +51 -51
  38. package/dist/uns/uns-proxy.js +190 -190
  39. package/dist/uns-config/uns-core-schema.d.ts +3276 -3276
  40. package/dist/uns-grpc/uns-gateway.proto +104 -104
  41. package/dist/uns-mqtt/uns-mqtt-proxy.js +477 -477
  42. package/package.json +1 -1
@@ -1,366 +1,366 @@
1
- import { UnsAttributeType } from "../graphql/schema.js";
2
- import { MeasurementUnit } from "./uns-measurements.js";
3
- import { UnsTags } from "./uns-tags.js";
4
- import type { UnsObjectId, UnsObjectType } from "./uns-object.js";
5
- import type { UnsAsset } from "./uns-asset.js";
6
- import type { IMqttConnectProperties, IMqttPublishOptions, IMqttServerConfig, MqttProtocol } from "../uns-mqtt/mqtt-interfaces.js";
7
- import { UnsTopics } from "./uns-topics.js";
8
- import { type KnownUnsAttributeName } from "./uns-attributes.js";
9
- export type ISO8601 = `${number}-${string}-${string}T${string}:${string}:${string}.${string}Z`;
10
- export declare function isIOS8601Type(value: string): value is ISO8601;
11
- export type UnsAttribute = KnownUnsAttributeName | (string & {});
12
- export declare const valueTypes: readonly ["string", "number"];
13
- export type ValueTypeString = (typeof valueTypes)[number];
14
- export type ValueType = string | number;
15
- export declare const questDbPrimitiveTypes: readonly ["boolean", "ipv4", "byte", "short", "char", "int", "float", "symbol", "varchar", "string", "long", "date", "timestamp", "timestamp_ns", "double", "uuid", "binary", "long256"];
16
- export type QuestDbPrimitiveType = (typeof questDbPrimitiveTypes)[number];
17
- export type QuestDbType = QuestDbPrimitiveType | `geohash(${number}${"b" | "c"})` | `decimal(${number},${number})` | `array<${string}>`;
18
- export declare function isQuestDbType(value: unknown): value is QuestDbType;
19
- export interface IUnsParameters {
20
- mqttSubToTopics?: string | string[];
21
- username?: string;
22
- password?: string;
23
- mqttSSL?: boolean;
24
- publishThrottlingDelay?: number;
25
- subscribeThrottlingDelay?: number;
26
- rejectUnauthorized?: boolean;
27
- clientId?: string;
28
- hosts?: string[];
29
- servers?: IMqttServerConfig[];
30
- port?: number;
31
- protocol?: MqttProtocol;
32
- keepalive?: number;
33
- clean?: boolean;
34
- connectTimeout?: number;
35
- reconnectPeriod?: number;
36
- reconnectOnConnackError?: boolean;
37
- resubscribe?: boolean;
38
- queueQoSZero?: boolean;
39
- properties?: IMqttConnectProperties;
40
- ca?: string;
41
- cert?: string;
42
- key?: string;
43
- servername?: string;
44
- /**
45
- * Default MQTT publish options applied to all outgoing messages
46
- * (e.g., qos, retain, messageExpiryInterval).
47
- */
48
- defaultPublishOptions?: IMqttPublishOptions;
49
- }
50
- export interface IUnsProcessParameters {
51
- processName: string;
52
- mqttSubToTopics?: string | string[];
53
- username?: string;
54
- password?: string;
55
- mqttSSL?: boolean;
56
- clientId?: string;
57
- hosts?: string[];
58
- servers?: IMqttServerConfig[];
59
- port?: number;
60
- protocol?: MqttProtocol;
61
- keepalive?: number;
62
- clean?: boolean;
63
- connectTimeout?: number;
64
- reconnectPeriod?: number;
65
- reconnectOnConnackError?: boolean;
66
- resubscribe?: boolean;
67
- queueQoSZero?: boolean;
68
- rejectUnauthorized?: boolean;
69
- properties?: IMqttConnectProperties;
70
- ca?: string;
71
- cert?: string;
72
- key?: string;
73
- servername?: string;
74
- }
75
- export interface UnsEvents {
76
- input: {
77
- topic: string;
78
- message: string;
79
- packet: any;
80
- };
81
- mqttProxyStatus: {
82
- event: string;
83
- value: number;
84
- uom: MeasurementUnit;
85
- statusTopic: string;
86
- };
87
- error: {
88
- code: number;
89
- message: string;
90
- };
91
- mqttWorker: {
92
- command: string;
93
- instanceName: string;
94
- batchSize: number;
95
- referenceHash: string;
96
- };
97
- cronEvent: {
98
- event?: string;
99
- cronExpression?: string;
100
- };
101
- apiGetEvent: {
102
- req: any;
103
- res: any;
104
- };
105
- apiPostEvent: {
106
- req: any;
107
- res: any;
108
- };
109
- unsProxyProducedTopics: {
110
- producedTopics: ITopicObject[];
111
- statusTopic: string;
112
- };
113
- unsProxyProducedApiEndpoints: {
114
- producedApiEndpoints: IApiObject[];
115
- statusTopic: string;
116
- };
117
- unsProxyProducedApiCatchAll: {
118
- producedCatchall: IApiCatchallMapping[];
119
- statusTopic: string;
120
- };
121
- }
122
- export interface IUnsExtendedData extends IUnsData {
123
- valueType: ValueTypeString;
124
- }
125
- export interface IUnsData {
126
- time: ISO8601;
127
- value: ValueType;
128
- dataGroup?: string;
129
- uom?: MeasurementUnit;
130
- foreignEventKey?: string;
131
- intervalStart?: ISO8601 | number;
132
- intervalEnd?: ISO8601 | number;
133
- windowStart?: ISO8601 | number;
134
- windowEnd?: ISO8601 | number;
135
- eventId?: string;
136
- deleted?: boolean;
137
- deletedAt?: ISO8601 | number;
138
- lastSeen?: ISO8601 | number;
139
- }
140
- export interface IUnsTableColumn {
141
- name: string;
142
- type: QuestDbType;
143
- value: string | number | boolean | null;
144
- uom?: MeasurementUnit;
145
- }
146
- export interface IUnsTable {
147
- time: ISO8601;
148
- dataGroup?: string;
149
- columns: IUnsTableColumn[];
150
- intervalStart?: ISO8601 | number;
151
- intervalEnd?: ISO8601 | number;
152
- windowStart?: ISO8601 | number;
153
- windowEnd?: ISO8601 | number;
154
- eventId?: string;
155
- deleted?: boolean;
156
- deletedAt?: ISO8601 | number;
157
- lastSeen?: ISO8601 | number;
158
- }
159
- export interface IMqttAttributeMessage {
160
- attribute: UnsAttribute;
161
- description?: string;
162
- tags?: UnsTags[];
163
- attributeNeedsPersistence?: boolean | null;
164
- /**
165
- * How the controller determines if this attribute is live or stale.
166
- * Defaults to `"interval"` with the controller's default interval (~120s) when omitted.
167
- *
168
- * @example
169
- * // Sensor publishing every 2 seconds:
170
- * { validityMode: "interval", expectedIntervalMs: 2000 }
171
- *
172
- * // Status attribute publishing every 2 seconds (string values like "HEATING"):
173
- * { validityMode: "interval", expectedIntervalMs: 2000 }
174
- *
175
- * // Material location with ENTERED/EXITED lifecycle:
176
- * { validityMode: "lifecycle", lifecycleEndValue: "EXITED" }
177
- *
178
- * // Static configuration value:
179
- * { validityMode: "static" }
180
- */
181
- validityMode?: ValidityMode;
182
- /**
183
- * Expected publish interval in milliseconds. Only meaningful for `validityMode: "interval"`.
184
- * The controller marks the attribute as stale after ~2× this value without a heartbeat update.
185
- * Ignored for `"lifecycle"` and `"static"` modes.
186
- */
187
- expectedIntervalMs?: number;
188
- /**
189
- * The string value that marks a lifecycle as completed. Only meaningful for `validityMode: "lifecycle"`.
190
- * When the attribute's current value matches this, the controller considers the lifecycle done.
191
- * Example: `"EXITED"` for a location attribute with ENTERED/EXITED events.
192
- */
193
- lifecycleEndValue?: string;
194
- }
195
- type AttributePayload = {
196
- message: IUnsMessage;
197
- data?: never;
198
- table?: never;
199
- createdAt?: never;
200
- expiresAt?: never;
201
- } | {
202
- message?: never;
203
- data: IUnsData;
204
- table?: never;
205
- createdAt?: ISO8601;
206
- expiresAt?: ISO8601;
207
- } | {
208
- message?: never;
209
- data?: never;
210
- table: IUnsTable;
211
- createdAt?: ISO8601;
212
- expiresAt?: ISO8601;
213
- };
214
- export type IMqttAttributeEntry = IMqttAttributeMessage & AttributePayload;
215
- export interface IMqttPublishRequest {
216
- topic: UnsTopics;
217
- asset: UnsAsset;
218
- assetDescription?: string;
219
- objectType: UnsObjectType;
220
- objectTypeDescription?: string;
221
- objectId: UnsObjectId;
222
- attributes: IMqttAttributeEntry | IMqttAttributeEntry[];
223
- }
224
- export interface IUnsPacket {
225
- message: IUnsExtendedMessage;
226
- messageSignature?: string;
227
- interval?: number;
228
- readonly version: string;
229
- sequenceId?: number;
230
- }
231
- export interface IUnsPackatParameters {
232
- }
233
- export interface IUnsMessage {
234
- data?: IUnsData;
235
- table?: IUnsTable;
236
- expiresAt?: ISO8601;
237
- createdAt?: ISO8601;
238
- }
239
- export interface IUnsExtendedMessage extends IUnsMessage {
240
- data?: IUnsExtendedData;
241
- }
242
- /**
243
- * Controls how the controller determines whether an attribute is live or stale.
244
- *
245
- * - `"interval"` — Attribute publishes periodically. Stale if no heartbeat within ~2× the expected interval.
246
- * Use with `expectedIntervalMs`. Works for both numeric sensors (temperature every 2s)
247
- * and string status attributes (status every 2s). Example:
248
- * `{ validityMode: "interval", expectedIntervalMs: 2000 }`
249
- *
250
- * - `"lifecycle"` — Attribute represents a lifecycle with a start and end event.
251
- * Use with `lifecycleEndValue` to mark the end state. Example: material location with "ENTERED" / "EXITED".
252
- *
253
- * - `"static"` — Attribute is set once and never changes (configuration, metadata). Always live.
254
- *
255
- * When omitted, defaults to `"interval"` with the controller's default interval (~120s).
256
- */
257
- export type ValidityMode = "interval" | "lifecycle" | "static";
258
- export interface ITopicObject {
259
- timestamp: string;
260
- attribute: string;
261
- attributeType: UnsAttributeType;
262
- topic: string;
263
- description: string;
264
- dataGroup: string;
265
- tags: string[] | null;
266
- attributeNeedsPersistence: boolean | null;
267
- asset: UnsAsset;
268
- assetDescription?: string;
269
- objectType: UnsObjectType;
270
- objectTypeDescription?: string;
271
- objectId: UnsObjectId;
272
- /** Liveliness validity mode — how the controller determines if this attribute is live/stale. */
273
- validityMode?: ValidityMode;
274
- /** For interval mode: expected publish interval in milliseconds (stale after ~2x this value). */
275
- expectedIntervalMs?: number;
276
- /** For lifecycle mode: the string value that marks the lifecycle as completed (e.g. "EXITED"). */
277
- lifecycleEndValue?: string;
278
- }
279
- export interface IApiObject {
280
- timestamp: string;
281
- attribute: string;
282
- topic: string;
283
- attributeType: UnsAttributeType;
284
- apiDescription?: string;
285
- apiHost: string;
286
- apiEndpoint: string;
287
- apiSwaggerEndpoint: string;
288
- apiMethod: "GET" | "POST" | "PUT" | "DELETE";
289
- apiQueryParams: QueryParamDef[];
290
- asset: UnsAsset;
291
- objectType: UnsObjectType;
292
- objectId: UnsObjectId;
293
- controllerName?: string;
294
- controllerHost?: string;
295
- controllerPort?: string;
296
- controllerPublicBase?: string;
297
- }
298
- export interface IApiCatchallMapping {
299
- topic: string;
300
- apiBase: string;
301
- apiBasePath: string;
302
- swaggerPath: string;
303
- }
304
- export interface QueryParamDef {
305
- name: string;
306
- type: "string" | "number" | "boolean";
307
- required?: boolean;
308
- description?: string;
309
- /**
310
- * Optional canonical chat alias used by assistant tooling.
311
- * Typical values: from, to, limit, topic, timezone, summaryOnly.
312
- */
313
- chatCanonical?: string;
314
- /**
315
- * Optional default query value. Included in generated OpenAPI metadata.
316
- */
317
- defaultValue?: string | number | boolean;
318
- }
319
- export interface ApiChatDefaults {
320
- from?: string;
321
- to?: string;
322
- limit?: number;
323
- topic?: string;
324
- timezone?: string;
325
- summaryOnly?: boolean;
326
- [key: string]: string | number | boolean | undefined;
327
- }
328
- export interface IApiProxyOptions {
329
- jwtSecret?: string;
330
- jwks?: {
331
- wellKnownJwksUrl: string;
332
- activeKidUrl?: string;
333
- cacheTtlMs?: number;
334
- algorithms?: ("RS256" | "RS384" | "RS512")[];
335
- };
336
- /**
337
- * Optional base prefixes to mount the API and swagger JSON under (e.g. "/archiver-3").
338
- * Defaults to "/api" when not provided.
339
- */
340
- apiBasePath?: string;
341
- swaggerBasePath?: string;
342
- /**
343
- * Skip mounting the default "/api" route. Useful when rebasing entirely under a custom prefix.
344
- */
345
- disableDefaultApiMount?: boolean;
346
- }
347
- export interface IGetEndpointOptions {
348
- apiDescription?: string;
349
- tags?: string[];
350
- queryParams?: QueryParamDef[];
351
- /**
352
- * Optional defaults consumed by chat tooling (published as OpenAPI vendor extension x-uns-chat.defaults).
353
- */
354
- chatDefaults?: ApiChatDefaults;
355
- }
356
- export interface IPostEndpointOptions {
357
- apiDescription?: string;
358
- tags?: string[];
359
- requestBody?: {
360
- description?: string;
361
- required?: boolean;
362
- schema?: Record<string, unknown>;
363
- };
364
- }
365
- export {};
1
+ import { UnsAttributeType } from "../graphql/schema.js";
2
+ import { MeasurementUnit } from "./uns-measurements.js";
3
+ import { UnsTags } from "./uns-tags.js";
4
+ import type { UnsObjectId, UnsObjectType } from "./uns-object.js";
5
+ import type { UnsAsset } from "./uns-asset.js";
6
+ import type { IMqttConnectProperties, IMqttPublishOptions, IMqttServerConfig, MqttProtocol } from "../uns-mqtt/mqtt-interfaces.js";
7
+ import { UnsTopics } from "./uns-topics.js";
8
+ import { type KnownUnsAttributeName } from "./uns-attributes.js";
9
+ export type ISO8601 = `${number}-${string}-${string}T${string}:${string}:${string}.${string}Z`;
10
+ export declare function isIOS8601Type(value: string): value is ISO8601;
11
+ export type UnsAttribute = KnownUnsAttributeName | (string & {});
12
+ export declare const valueTypes: readonly ["string", "number"];
13
+ export type ValueTypeString = (typeof valueTypes)[number];
14
+ export type ValueType = string | number;
15
+ export declare const questDbPrimitiveTypes: readonly ["boolean", "ipv4", "byte", "short", "char", "int", "float", "symbol", "varchar", "string", "long", "date", "timestamp", "timestamp_ns", "double", "uuid", "binary", "long256"];
16
+ export type QuestDbPrimitiveType = (typeof questDbPrimitiveTypes)[number];
17
+ export type QuestDbType = QuestDbPrimitiveType | `geohash(${number}${"b" | "c"})` | `decimal(${number},${number})` | `array<${string}>`;
18
+ export declare function isQuestDbType(value: unknown): value is QuestDbType;
19
+ export interface IUnsParameters {
20
+ mqttSubToTopics?: string | string[];
21
+ username?: string;
22
+ password?: string;
23
+ mqttSSL?: boolean;
24
+ publishThrottlingDelay?: number;
25
+ subscribeThrottlingDelay?: number;
26
+ rejectUnauthorized?: boolean;
27
+ clientId?: string;
28
+ hosts?: string[];
29
+ servers?: IMqttServerConfig[];
30
+ port?: number;
31
+ protocol?: MqttProtocol;
32
+ keepalive?: number;
33
+ clean?: boolean;
34
+ connectTimeout?: number;
35
+ reconnectPeriod?: number;
36
+ reconnectOnConnackError?: boolean;
37
+ resubscribe?: boolean;
38
+ queueQoSZero?: boolean;
39
+ properties?: IMqttConnectProperties;
40
+ ca?: string;
41
+ cert?: string;
42
+ key?: string;
43
+ servername?: string;
44
+ /**
45
+ * Default MQTT publish options applied to all outgoing messages
46
+ * (e.g., qos, retain, messageExpiryInterval).
47
+ */
48
+ defaultPublishOptions?: IMqttPublishOptions;
49
+ }
50
+ export interface IUnsProcessParameters {
51
+ processName: string;
52
+ mqttSubToTopics?: string | string[];
53
+ username?: string;
54
+ password?: string;
55
+ mqttSSL?: boolean;
56
+ clientId?: string;
57
+ hosts?: string[];
58
+ servers?: IMqttServerConfig[];
59
+ port?: number;
60
+ protocol?: MqttProtocol;
61
+ keepalive?: number;
62
+ clean?: boolean;
63
+ connectTimeout?: number;
64
+ reconnectPeriod?: number;
65
+ reconnectOnConnackError?: boolean;
66
+ resubscribe?: boolean;
67
+ queueQoSZero?: boolean;
68
+ rejectUnauthorized?: boolean;
69
+ properties?: IMqttConnectProperties;
70
+ ca?: string;
71
+ cert?: string;
72
+ key?: string;
73
+ servername?: string;
74
+ }
75
+ export interface UnsEvents {
76
+ input: {
77
+ topic: string;
78
+ message: string;
79
+ packet: any;
80
+ };
81
+ mqttProxyStatus: {
82
+ event: string;
83
+ value: number;
84
+ uom: MeasurementUnit;
85
+ statusTopic: string;
86
+ };
87
+ error: {
88
+ code: number;
89
+ message: string;
90
+ };
91
+ mqttWorker: {
92
+ command: string;
93
+ instanceName: string;
94
+ batchSize: number;
95
+ referenceHash: string;
96
+ };
97
+ cronEvent: {
98
+ event?: string;
99
+ cronExpression?: string;
100
+ };
101
+ apiGetEvent: {
102
+ req: any;
103
+ res: any;
104
+ };
105
+ apiPostEvent: {
106
+ req: any;
107
+ res: any;
108
+ };
109
+ unsProxyProducedTopics: {
110
+ producedTopics: ITopicObject[];
111
+ statusTopic: string;
112
+ };
113
+ unsProxyProducedApiEndpoints: {
114
+ producedApiEndpoints: IApiObject[];
115
+ statusTopic: string;
116
+ };
117
+ unsProxyProducedApiCatchAll: {
118
+ producedCatchall: IApiCatchallMapping[];
119
+ statusTopic: string;
120
+ };
121
+ }
122
+ export interface IUnsExtendedData extends IUnsData {
123
+ valueType: ValueTypeString;
124
+ }
125
+ export interface IUnsData {
126
+ time: ISO8601;
127
+ value: ValueType;
128
+ dataGroup?: string;
129
+ uom?: MeasurementUnit;
130
+ foreignEventKey?: string;
131
+ intervalStart?: ISO8601 | number;
132
+ intervalEnd?: ISO8601 | number;
133
+ windowStart?: ISO8601 | number;
134
+ windowEnd?: ISO8601 | number;
135
+ eventId?: string;
136
+ deleted?: boolean;
137
+ deletedAt?: ISO8601 | number;
138
+ lastSeen?: ISO8601 | number;
139
+ }
140
+ export interface IUnsTableColumn {
141
+ name: string;
142
+ type: QuestDbType;
143
+ value: string | number | boolean | null;
144
+ uom?: MeasurementUnit;
145
+ }
146
+ export interface IUnsTable {
147
+ time: ISO8601;
148
+ dataGroup?: string;
149
+ columns: IUnsTableColumn[];
150
+ intervalStart?: ISO8601 | number;
151
+ intervalEnd?: ISO8601 | number;
152
+ windowStart?: ISO8601 | number;
153
+ windowEnd?: ISO8601 | number;
154
+ eventId?: string;
155
+ deleted?: boolean;
156
+ deletedAt?: ISO8601 | number;
157
+ lastSeen?: ISO8601 | number;
158
+ }
159
+ export interface IMqttAttributeMessage {
160
+ attribute: UnsAttribute;
161
+ description?: string;
162
+ tags?: UnsTags[];
163
+ attributeNeedsPersistence?: boolean | null;
164
+ /**
165
+ * How the controller determines if this attribute is live or stale.
166
+ * Defaults to `"interval"` with the controller's default interval (~120s) when omitted.
167
+ *
168
+ * @example
169
+ * // Sensor publishing every 2 seconds:
170
+ * { validityMode: "interval", expectedIntervalMs: 2000 }
171
+ *
172
+ * // Status attribute publishing every 2 seconds (string values like "HEATING"):
173
+ * { validityMode: "interval", expectedIntervalMs: 2000 }
174
+ *
175
+ * // Material location with ENTERED/EXITED lifecycle:
176
+ * { validityMode: "lifecycle", lifecycleEndValue: "EXITED" }
177
+ *
178
+ * // Static configuration value:
179
+ * { validityMode: "static" }
180
+ */
181
+ validityMode?: ValidityMode;
182
+ /**
183
+ * Expected publish interval in milliseconds. Only meaningful for `validityMode: "interval"`.
184
+ * The controller marks the attribute as stale after ~2× this value without a heartbeat update.
185
+ * Ignored for `"lifecycle"` and `"static"` modes.
186
+ */
187
+ expectedIntervalMs?: number;
188
+ /**
189
+ * The string value that marks a lifecycle as completed. Only meaningful for `validityMode: "lifecycle"`.
190
+ * When the attribute's current value matches this, the controller considers the lifecycle done.
191
+ * Example: `"EXITED"` for a location attribute with ENTERED/EXITED events.
192
+ */
193
+ lifecycleEndValue?: string;
194
+ }
195
+ type AttributePayload = {
196
+ message: IUnsMessage;
197
+ data?: never;
198
+ table?: never;
199
+ createdAt?: never;
200
+ expiresAt?: never;
201
+ } | {
202
+ message?: never;
203
+ data: IUnsData;
204
+ table?: never;
205
+ createdAt?: ISO8601;
206
+ expiresAt?: ISO8601;
207
+ } | {
208
+ message?: never;
209
+ data?: never;
210
+ table: IUnsTable;
211
+ createdAt?: ISO8601;
212
+ expiresAt?: ISO8601;
213
+ };
214
+ export type IMqttAttributeEntry = IMqttAttributeMessage & AttributePayload;
215
+ export interface IMqttPublishRequest {
216
+ topic: UnsTopics;
217
+ asset: UnsAsset;
218
+ assetDescription?: string;
219
+ objectType: UnsObjectType;
220
+ objectTypeDescription?: string;
221
+ objectId: UnsObjectId;
222
+ attributes: IMqttAttributeEntry | IMqttAttributeEntry[];
223
+ }
224
+ export interface IUnsPacket {
225
+ message: IUnsExtendedMessage;
226
+ messageSignature?: string;
227
+ interval?: number;
228
+ readonly version: string;
229
+ sequenceId?: number;
230
+ }
231
+ export interface IUnsPackatParameters {
232
+ }
233
+ export interface IUnsMessage {
234
+ data?: IUnsData;
235
+ table?: IUnsTable;
236
+ expiresAt?: ISO8601;
237
+ createdAt?: ISO8601;
238
+ }
239
+ export interface IUnsExtendedMessage extends IUnsMessage {
240
+ data?: IUnsExtendedData;
241
+ }
242
+ /**
243
+ * Controls how the controller determines whether an attribute is live or stale.
244
+ *
245
+ * - `"interval"` — Attribute publishes periodically. Stale if no heartbeat within ~2× the expected interval.
246
+ * Use with `expectedIntervalMs`. Works for both numeric sensors (temperature every 2s)
247
+ * and string status attributes (status every 2s). Example:
248
+ * `{ validityMode: "interval", expectedIntervalMs: 2000 }`
249
+ *
250
+ * - `"lifecycle"` — Attribute represents a lifecycle with a start and end event.
251
+ * Use with `lifecycleEndValue` to mark the end state. Example: material location with "ENTERED" / "EXITED".
252
+ *
253
+ * - `"static"` — Attribute is set once and never changes (configuration, metadata). Always live.
254
+ *
255
+ * When omitted, defaults to `"interval"` with the controller's default interval (~120s).
256
+ */
257
+ export type ValidityMode = "interval" | "lifecycle" | "static";
258
+ export interface ITopicObject {
259
+ timestamp: string;
260
+ attribute: string;
261
+ attributeType: UnsAttributeType;
262
+ topic: string;
263
+ description: string;
264
+ dataGroup: string;
265
+ tags: string[] | null;
266
+ attributeNeedsPersistence: boolean | null;
267
+ asset: UnsAsset;
268
+ assetDescription?: string;
269
+ objectType: UnsObjectType;
270
+ objectTypeDescription?: string;
271
+ objectId: UnsObjectId;
272
+ /** Liveliness validity mode — how the controller determines if this attribute is live/stale. */
273
+ validityMode?: ValidityMode;
274
+ /** For interval mode: expected publish interval in milliseconds (stale after ~2x this value). */
275
+ expectedIntervalMs?: number;
276
+ /** For lifecycle mode: the string value that marks the lifecycle as completed (e.g. "EXITED"). */
277
+ lifecycleEndValue?: string;
278
+ }
279
+ export interface IApiObject {
280
+ timestamp: string;
281
+ attribute: string;
282
+ topic: string;
283
+ attributeType: UnsAttributeType;
284
+ apiDescription?: string;
285
+ apiHost: string;
286
+ apiEndpoint: string;
287
+ apiSwaggerEndpoint: string;
288
+ apiMethod: "GET" | "POST" | "PUT" | "DELETE";
289
+ apiQueryParams: QueryParamDef[];
290
+ asset: UnsAsset;
291
+ objectType: UnsObjectType;
292
+ objectId: UnsObjectId;
293
+ controllerName?: string;
294
+ controllerHost?: string;
295
+ controllerPort?: string;
296
+ controllerPublicBase?: string;
297
+ }
298
+ export interface IApiCatchallMapping {
299
+ topic: string;
300
+ apiBase: string;
301
+ apiBasePath: string;
302
+ swaggerPath: string;
303
+ }
304
+ export interface QueryParamDef {
305
+ name: string;
306
+ type: "string" | "number" | "boolean";
307
+ required?: boolean;
308
+ description?: string;
309
+ /**
310
+ * Optional canonical chat alias used by assistant tooling.
311
+ * Typical values: from, to, limit, topic, timezone, summaryOnly.
312
+ */
313
+ chatCanonical?: string;
314
+ /**
315
+ * Optional default query value. Included in generated OpenAPI metadata.
316
+ */
317
+ defaultValue?: string | number | boolean;
318
+ }
319
+ export interface ApiChatDefaults {
320
+ from?: string;
321
+ to?: string;
322
+ limit?: number;
323
+ topic?: string;
324
+ timezone?: string;
325
+ summaryOnly?: boolean;
326
+ [key: string]: string | number | boolean | undefined;
327
+ }
328
+ export interface IApiProxyOptions {
329
+ jwtSecret?: string;
330
+ jwks?: {
331
+ wellKnownJwksUrl: string;
332
+ activeKidUrl?: string;
333
+ cacheTtlMs?: number;
334
+ algorithms?: ("RS256" | "RS384" | "RS512")[];
335
+ };
336
+ /**
337
+ * Optional base prefixes to mount the API and swagger JSON under (e.g. "/archiver-3").
338
+ * Defaults to "/api" when not provided.
339
+ */
340
+ apiBasePath?: string;
341
+ swaggerBasePath?: string;
342
+ /**
343
+ * Skip mounting the default "/api" route. Useful when rebasing entirely under a custom prefix.
344
+ */
345
+ disableDefaultApiMount?: boolean;
346
+ }
347
+ export interface IGetEndpointOptions {
348
+ apiDescription?: string;
349
+ tags?: string[];
350
+ queryParams?: QueryParamDef[];
351
+ /**
352
+ * Optional defaults consumed by chat tooling (published as OpenAPI vendor extension x-uns-chat.defaults).
353
+ */
354
+ chatDefaults?: ApiChatDefaults;
355
+ }
356
+ export interface IPostEndpointOptions {
357
+ apiDescription?: string;
358
+ tags?: string[];
359
+ requestBody?: {
360
+ description?: string;
361
+ required?: boolean;
362
+ schema?: Record<string, unknown>;
363
+ };
364
+ }
365
+ export {};
366
366
  //# sourceMappingURL=uns-interfaces.d.ts.map