@uns-kit/core 2.0.40 → 2.0.41
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/LICENSE +21 -21
- package/README.md +170 -147
- package/dist/index.d.ts +9 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/tools/datahub/datahub-client.js.map +1 -1
- package/dist/tools/file-utils.d.ts +2 -2
- package/dist/tools/file-utils.js +24 -24
- package/dist/tools/generate-uns-dictionary.d.ts +23 -23
- package/dist/tools/generate-uns-dictionary.js +154 -154
- package/dist/tools/generate-uns-measurements.d.ts +21 -21
- package/dist/tools/generate-uns-measurements.js +126 -126
- package/dist/tools/generate-uns-reference.d.ts +2 -2
- package/dist/tools/generate-uns-reference.js +85 -85
- package/dist/tools/refresh-uns.js +50 -50
- package/dist/tools/sync-uns-schema.d.ts +2 -2
- package/dist/tools/sync-uns-schema.js +489 -489
- package/dist/uns/service-metadata.d.ts +53 -0
- package/dist/uns/service-metadata.d.ts.map +1 -0
- package/dist/uns/service-metadata.js +56 -0
- package/dist/uns/service-metadata.js.map +1 -0
- package/dist/uns/uns-asset.d.ts +1 -1
- package/dist/uns/uns-asset.js +1 -1
- package/dist/uns/uns-attributes.d.ts +6 -6
- package/dist/uns/uns-attributes.js +9 -9
- package/dist/uns/uns-dictionary-registry.d.ts +4 -4
- package/dist/uns/uns-dictionary-registry.js +20 -20
- package/dist/uns/uns-dictionary.generated.d.ts +663 -663
- package/dist/uns/uns-dictionary.generated.js +745 -745
- package/dist/uns/uns-interfaces.d.ts +365 -365
- package/dist/uns/uns-measurements.generated.d.ts +362 -362
- package/dist/uns/uns-measurements.generated.js +359 -359
- package/dist/uns/uns-object.d.ts +20 -20
- package/dist/uns/uns-object.js +9 -9
- package/dist/uns/uns-packet.js +263 -263
- package/dist/uns/uns-path.d.ts +2 -2
- package/dist/uns/uns-path.js +10 -10
- package/dist/uns/uns-proxy-process.d.ts +11 -0
- package/dist/uns/uns-proxy-process.d.ts.map +1 -1
- package/dist/uns/uns-proxy-process.js +224 -203
- package/dist/uns/uns-proxy-process.js.map +1 -1
- package/dist/uns/uns-proxy.d.ts +51 -51
- package/dist/uns/uns-proxy.js +190 -190
- package/dist/uns-config/uns-core-schema.d.ts +3276 -3276
- package/dist/uns-grpc/uns-gateway.proto +104 -104
- package/dist/uns-mqtt/mqtt-topic-builder.d.ts +6 -0
- package/dist/uns-mqtt/mqtt-topic-builder.d.ts.map +1 -1
- package/dist/uns-mqtt/mqtt-topic-builder.js +8 -0
- package/dist/uns-mqtt/mqtt-topic-builder.js.map +1 -1
- package/dist/uns-mqtt/uns-mqtt-proxy.js +477 -477
- package/package.json +1 -1
- package/dist/app-config.d.ts.map +0 -1
- package/dist/app-config.js.map +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type UnsServiceKind = "core" | "addon" | "capability" | "service";
|
|
2
|
+
export type UnsServiceApiRouteKind = "api-route" | "api-catchall" | "health" | "swagger";
|
|
3
|
+
export interface UnsServiceApiRouteMetadata {
|
|
4
|
+
path: string;
|
|
5
|
+
kind?: UnsServiceApiRouteKind;
|
|
6
|
+
healthPath?: string;
|
|
7
|
+
swaggerPath?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface UnsServiceControllerMetadata {
|
|
10
|
+
name?: string;
|
|
11
|
+
publicBase?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface UnsServiceMetadataInput {
|
|
14
|
+
serviceId: string;
|
|
15
|
+
kind: UnsServiceKind;
|
|
16
|
+
addonId?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
capabilities?: string[];
|
|
20
|
+
apiRoutes?: UnsServiceApiRouteMetadata[];
|
|
21
|
+
healthPath?: string;
|
|
22
|
+
controller?: UnsServiceControllerMetadata;
|
|
23
|
+
instanceId?: string;
|
|
24
|
+
packageName?: string;
|
|
25
|
+
packageVersion?: string;
|
|
26
|
+
extra?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
export interface UnsServiceMetadata {
|
|
29
|
+
schemaVersion: 1;
|
|
30
|
+
serviceId: string;
|
|
31
|
+
kind: UnsServiceKind;
|
|
32
|
+
addonId?: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
packageName: string;
|
|
36
|
+
packageVersion: string;
|
|
37
|
+
processName: string;
|
|
38
|
+
processId: string;
|
|
39
|
+
instanceId?: string;
|
|
40
|
+
capabilities: string[];
|
|
41
|
+
apiRoutes: UnsServiceApiRouteMetadata[];
|
|
42
|
+
healthPath?: string;
|
|
43
|
+
controller?: UnsServiceControllerMetadata;
|
|
44
|
+
extra?: Record<string, unknown>;
|
|
45
|
+
publishedAt: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function buildUnsServiceMetadata(input: {
|
|
48
|
+
processName: string;
|
|
49
|
+
processId: string;
|
|
50
|
+
metadata: UnsServiceMetadataInput;
|
|
51
|
+
now?: Date;
|
|
52
|
+
}): UnsServiceMetadata;
|
|
53
|
+
//# sourceMappingURL=service-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-metadata.d.ts","sourceRoot":"","sources":["../../src/uns/service-metadata.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzF,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;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E,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,uBAAuB,CAAC;IAClC,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,GAAG,kBAAkB,CAqCrB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { PACKAGE_INFO } from "./process-config.js";
|
|
2
|
+
function cleanOptionalString(value) {
|
|
3
|
+
const trimmed = value?.trim();
|
|
4
|
+
return trimmed ? trimmed : undefined;
|
|
5
|
+
}
|
|
6
|
+
function cleanStringList(values) {
|
|
7
|
+
return Array.from(new Set((values ?? [])
|
|
8
|
+
.map((value) => value.trim())
|
|
9
|
+
.filter((value) => value.length > 0)));
|
|
10
|
+
}
|
|
11
|
+
function cleanApiRoutes(routes) {
|
|
12
|
+
return (routes ?? [])
|
|
13
|
+
.map((route) => ({
|
|
14
|
+
...route,
|
|
15
|
+
path: route.path.trim(),
|
|
16
|
+
healthPath: cleanOptionalString(route.healthPath),
|
|
17
|
+
swaggerPath: cleanOptionalString(route.swaggerPath),
|
|
18
|
+
}))
|
|
19
|
+
.filter((route) => route.path.length > 0);
|
|
20
|
+
}
|
|
21
|
+
export function buildUnsServiceMetadata(input) {
|
|
22
|
+
const serviceId = input.metadata.serviceId.trim();
|
|
23
|
+
if (!serviceId) {
|
|
24
|
+
throw new Error("Uns service metadata requires a serviceId.");
|
|
25
|
+
}
|
|
26
|
+
const packageName = cleanOptionalString(input.metadata.packageName) ?? PACKAGE_INFO.name;
|
|
27
|
+
const packageVersion = cleanOptionalString(input.metadata.packageVersion) ?? PACKAGE_INFO.version;
|
|
28
|
+
const controller = input.metadata.controller
|
|
29
|
+
? {
|
|
30
|
+
name: cleanOptionalString(input.metadata.controller.name),
|
|
31
|
+
publicBase: cleanOptionalString(input.metadata.controller.publicBase),
|
|
32
|
+
}
|
|
33
|
+
: undefined;
|
|
34
|
+
return {
|
|
35
|
+
schemaVersion: 1,
|
|
36
|
+
serviceId,
|
|
37
|
+
kind: input.metadata.kind,
|
|
38
|
+
addonId: cleanOptionalString(input.metadata.addonId),
|
|
39
|
+
label: cleanOptionalString(input.metadata.label),
|
|
40
|
+
description: cleanOptionalString(input.metadata.description),
|
|
41
|
+
packageName,
|
|
42
|
+
packageVersion,
|
|
43
|
+
processName: input.processName,
|
|
44
|
+
processId: input.processId,
|
|
45
|
+
instanceId: cleanOptionalString(input.metadata.instanceId),
|
|
46
|
+
capabilities: cleanStringList(input.metadata.capabilities),
|
|
47
|
+
apiRoutes: cleanApiRoutes(input.metadata.apiRoutes),
|
|
48
|
+
healthPath: cleanOptionalString(input.metadata.healthPath),
|
|
49
|
+
controller: controller && (controller.name || controller.publicBase)
|
|
50
|
+
? controller
|
|
51
|
+
: undefined,
|
|
52
|
+
extra: input.metadata.extra,
|
|
53
|
+
publishedAt: (input.now ?? new Date()).toISOString(),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=service-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-metadata.js","sourceRoot":"","sources":["../../src/uns/service-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAsDnD,SAAS,mBAAmB,CAAC,KAAyB;IACpD,MAAM,OAAO,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC;IAC9B,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACvC,CAAC;AAED,SAAS,eAAe,CAAC,MAA4B;IACnD,OAAO,KAAK,CAAC,IAAI,CACf,IAAI,GAAG,CACL,CAAC,MAAM,IAAI,EAAE,CAAC;SACX,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;SAC5B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CACvC,CACF,CAAC;AACJ,CAAC;AAED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zB,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;QACpD,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;QAChD,WAAW,EAAE,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;QAC5D,WAAW;QACX,cAAc;QACd,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,UAAU,EAAE,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC1D,YAAY,EAAE,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC1D,SAAS,EAAE,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;QACnD,UAAU,EAAE,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC1D,UAAU,EACR,UAAU,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC;YACtD,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,SAAS;QACf,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK;QAC3B,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE;KACrD,CAAC;AACJ,CAAC","sourcesContent":["import { PACKAGE_INFO } from \"./process-config.js\";\n\nexport type UnsServiceKind = \"core\" | \"addon\" | \"capability\" | \"service\";\n\nexport type UnsServiceApiRouteKind = \"api-route\" | \"api-catchall\" | \"health\" | \"swagger\";\n\nexport interface UnsServiceApiRouteMetadata {\n path: string;\n kind?: UnsServiceApiRouteKind;\n healthPath?: string;\n swaggerPath?: string;\n}\n\nexport interface UnsServiceControllerMetadata {\n name?: string;\n publicBase?: string;\n}\n\nexport interface UnsServiceMetadataInput {\n serviceId: string;\n kind: UnsServiceKind;\n addonId?: string;\n label?: string;\n description?: string;\n capabilities?: string[];\n apiRoutes?: UnsServiceApiRouteMetadata[];\n healthPath?: string;\n controller?: UnsServiceControllerMetadata;\n instanceId?: string;\n packageName?: string;\n packageVersion?: string;\n extra?: Record<string, unknown>;\n}\n\nexport interface UnsServiceMetadata {\n schemaVersion: 1;\n serviceId: string;\n kind: UnsServiceKind;\n addonId?: string;\n label?: string;\n description?: string;\n packageName: string;\n packageVersion: string;\n processName: string;\n processId: string;\n instanceId?: string;\n capabilities: string[];\n apiRoutes: UnsServiceApiRouteMetadata[];\n healthPath?: string;\n controller?: UnsServiceControllerMetadata;\n extra?: Record<string, unknown>;\n publishedAt: string;\n}\n\nfunction cleanOptionalString(value: string | undefined): string | undefined {\n const trimmed = value?.trim();\n return trimmed ? trimmed : undefined;\n}\n\nfunction cleanStringList(values: string[] | undefined): string[] {\n return Array.from(\n new Set(\n (values ?? [])\n .map((value) => value.trim())\n .filter((value) => value.length > 0),\n ),\n );\n}\n\nfunction cleanApiRoutes(routes: UnsServiceApiRouteMetadata[] | undefined): UnsServiceApiRouteMetadata[] {\n return (routes ?? [])\n .map((route) => ({\n ...route,\n path: route.path.trim(),\n healthPath: cleanOptionalString(route.healthPath),\n swaggerPath: cleanOptionalString(route.swaggerPath),\n }))\n .filter((route) => route.path.length > 0);\n}\n\nexport function buildUnsServiceMetadata(input: {\n processName: string;\n processId: string;\n metadata: UnsServiceMetadataInput;\n now?: Date;\n}): UnsServiceMetadata {\n const serviceId = input.metadata.serviceId.trim();\n if (!serviceId) {\n throw new Error(\"Uns service metadata requires a serviceId.\");\n }\n\n const packageName = cleanOptionalString(input.metadata.packageName) ?? PACKAGE_INFO.name;\n const packageVersion = cleanOptionalString(input.metadata.packageVersion) ?? PACKAGE_INFO.version;\n const controller = input.metadata.controller\n ? {\n name: cleanOptionalString(input.metadata.controller.name),\n publicBase: cleanOptionalString(input.metadata.controller.publicBase),\n }\n : undefined;\n\n return {\n schemaVersion: 1,\n serviceId,\n kind: input.metadata.kind,\n addonId: cleanOptionalString(input.metadata.addonId),\n label: cleanOptionalString(input.metadata.label),\n description: cleanOptionalString(input.metadata.description),\n packageName,\n packageVersion,\n processName: input.processName,\n processId: input.processId,\n instanceId: cleanOptionalString(input.metadata.instanceId),\n capabilities: cleanStringList(input.metadata.capabilities),\n apiRoutes: cleanApiRoutes(input.metadata.apiRoutes),\n healthPath: cleanOptionalString(input.metadata.healthPath),\n controller:\n controller && (controller.name || controller.publicBase)\n ? controller\n : undefined,\n extra: input.metadata.extra,\n publishedAt: (input.now ?? new Date()).toISOString(),\n };\n}\n"]}
|
package/dist/uns/uns-asset.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type UnsAsset = "" | (string & {});
|
|
1
|
+
export type UnsAsset = "" | (string & {});
|
|
2
2
|
//# sourceMappingURL=uns-asset.d.ts.map
|
package/dist/uns/uns-asset.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=uns-asset.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GeneratedAttributes } from "./uns-dictionary.generated.js";
|
|
2
|
-
export declare const knownUnsAttributes: ("status" | "level" | "active-energy-delivered" | "active-energy-received" | "alarm" | "assigned-to" | "authorization-level" | "availability" | "batch-number" | "conductivity" | "consumption" | "consumption-rate" | "cost" | "current" | "deviation" | "downtime" | "duration" | "end-time" | "energy" | "energy-consumption" | "fault-code" | "flow" | "frequency" | "hardness" | "inspection-result" | "instruction-url" | "last-refill" | "location" | "lot-id" | "maintenance-status" | "material-composition" | "material-type" | "operating-hours" | "operator-id" | "output-quantity" | "pass-fail" | "ph" | "planned-end" | "planned-start" | "power" | "presence" | "pressure" | "product-code" | "quantity" | "reactive-energy-delivered" | "reactive-energy-received" | "refill-required" | "revision" | "role" | "specification" | "speed" | "start-time" | "surface-defect" | "target-parameters" | "task-id" | "task-list" | "temperature" | "tensile-strength" | "total-flow" | "utilization" | "version-history" | "vibration" | "voltage" | "work-order-id")[];
|
|
3
|
-
export type KnownUnsAttributeName = typeof GeneratedAttributes[keyof typeof GeneratedAttributes];
|
|
4
|
-
export type UnsAttribute = "" | KnownUnsAttributeName | (string & {});
|
|
5
|
-
export declare const AttributeDescriptions: Record<"status" | "level" | "active-energy-delivered" | "active-energy-received" | "alarm" | "assigned-to" | "authorization-level" | "availability" | "batch-number" | "conductivity" | "consumption" | "consumption-rate" | "cost" | "current" | "deviation" | "downtime" | "duration" | "end-time" | "energy" | "energy-consumption" | "fault-code" | "flow" | "frequency" | "hardness" | "inspection-result" | "instruction-url" | "last-refill" | "location" | "lot-id" | "maintenance-status" | "material-composition" | "material-type" | "operating-hours" | "operator-id" | "output-quantity" | "pass-fail" | "ph" | "planned-end" | "planned-start" | "power" | "presence" | "pressure" | "product-code" | "quantity" | "reactive-energy-delivered" | "reactive-energy-received" | "refill-required" | "revision" | "role" | "specification" | "speed" | "start-time" | "surface-defect" | "target-parameters" | "task-id" | "task-list" | "temperature" | "tensile-strength" | "total-flow" | "utilization" | "version-history" | "vibration" | "voltage" | "work-order-id", string>;
|
|
6
|
-
export declare function getAttributeDescription(name: string): string | undefined;
|
|
1
|
+
import { GeneratedAttributes } from "./uns-dictionary.generated.js";
|
|
2
|
+
export declare const knownUnsAttributes: ("status" | "level" | "active-energy-delivered" | "active-energy-received" | "alarm" | "assigned-to" | "authorization-level" | "availability" | "batch-number" | "conductivity" | "consumption" | "consumption-rate" | "cost" | "current" | "deviation" | "downtime" | "duration" | "end-time" | "energy" | "energy-consumption" | "fault-code" | "flow" | "frequency" | "hardness" | "inspection-result" | "instruction-url" | "last-refill" | "location" | "lot-id" | "maintenance-status" | "material-composition" | "material-type" | "operating-hours" | "operator-id" | "output-quantity" | "pass-fail" | "ph" | "planned-end" | "planned-start" | "power" | "presence" | "pressure" | "product-code" | "quantity" | "reactive-energy-delivered" | "reactive-energy-received" | "refill-required" | "revision" | "role" | "specification" | "speed" | "start-time" | "surface-defect" | "target-parameters" | "task-id" | "task-list" | "temperature" | "tensile-strength" | "total-flow" | "utilization" | "version-history" | "vibration" | "voltage" | "work-order-id")[];
|
|
3
|
+
export type KnownUnsAttributeName = typeof GeneratedAttributes[keyof typeof GeneratedAttributes];
|
|
4
|
+
export type UnsAttribute = "" | KnownUnsAttributeName | (string & {});
|
|
5
|
+
export declare const AttributeDescriptions: Record<"status" | "level" | "active-energy-delivered" | "active-energy-received" | "alarm" | "assigned-to" | "authorization-level" | "availability" | "batch-number" | "conductivity" | "consumption" | "consumption-rate" | "cost" | "current" | "deviation" | "downtime" | "duration" | "end-time" | "energy" | "energy-consumption" | "fault-code" | "flow" | "frequency" | "hardness" | "inspection-result" | "instruction-url" | "last-refill" | "location" | "lot-id" | "maintenance-status" | "material-composition" | "material-type" | "operating-hours" | "operator-id" | "output-quantity" | "pass-fail" | "ph" | "planned-end" | "planned-start" | "power" | "presence" | "pressure" | "product-code" | "quantity" | "reactive-energy-delivered" | "reactive-energy-received" | "refill-required" | "revision" | "role" | "specification" | "speed" | "start-time" | "surface-defect" | "target-parameters" | "task-id" | "task-list" | "temperature" | "tensile-strength" | "total-flow" | "utilization" | "version-history" | "vibration" | "voltage" | "work-order-id", string>;
|
|
6
|
+
export declare function getAttributeDescription(name: string): string | undefined;
|
|
7
7
|
//# sourceMappingURL=uns-attributes.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// Slimmed: use generated dictionary as the source of attributes.
|
|
2
|
-
import { GeneratedAttributes, GeneratedAttributeDescriptions } from "./uns-dictionary.generated.js";
|
|
3
|
-
import { resolveAttributeDescription } from "./uns-dictionary-registry.js";
|
|
4
|
-
export const knownUnsAttributes = Object.values(GeneratedAttributes);
|
|
5
|
-
export const AttributeDescriptions = GeneratedAttributeDescriptions;
|
|
6
|
-
export function getAttributeDescription(name) {
|
|
7
|
-
return (resolveAttributeDescription(name) ??
|
|
8
|
-
AttributeDescriptions[name]);
|
|
9
|
-
}
|
|
1
|
+
// Slimmed: use generated dictionary as the source of attributes.
|
|
2
|
+
import { GeneratedAttributes, GeneratedAttributeDescriptions } from "./uns-dictionary.generated.js";
|
|
3
|
+
import { resolveAttributeDescription } from "./uns-dictionary-registry.js";
|
|
4
|
+
export const knownUnsAttributes = Object.values(GeneratedAttributes);
|
|
5
|
+
export const AttributeDescriptions = GeneratedAttributeDescriptions;
|
|
6
|
+
export function getAttributeDescription(name) {
|
|
7
|
+
return (resolveAttributeDescription(name) ??
|
|
8
|
+
AttributeDescriptions[name]);
|
|
9
|
+
}
|
|
10
10
|
//# sourceMappingURL=uns-attributes.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function registerObjectTypeDescriptions(map: Record<string, string>): void;
|
|
2
|
-
export declare function registerAttributeDescriptions(map: Record<string, string>): void;
|
|
3
|
-
export declare function resolveObjectTypeDescription(name: string | undefined): string | undefined;
|
|
4
|
-
export declare function resolveAttributeDescription(name: string | undefined): string | undefined;
|
|
1
|
+
export declare function registerObjectTypeDescriptions(map: Record<string, string>): void;
|
|
2
|
+
export declare function registerAttributeDescriptions(map: Record<string, string>): void;
|
|
3
|
+
export declare function resolveObjectTypeDescription(name: string | undefined): string | undefined;
|
|
4
|
+
export declare function resolveAttributeDescription(name: string | undefined): string | undefined;
|
|
5
5
|
//# sourceMappingURL=uns-dictionary-registry.d.ts.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
// Simple registry to allow projects to provide additional descriptions at runtime
|
|
2
|
-
// without coupling core to project-generated files.
|
|
3
|
-
let objectTypeDescriptions = {};
|
|
4
|
-
let attributeDescriptions = {};
|
|
5
|
-
export function registerObjectTypeDescriptions(map) {
|
|
6
|
-
objectTypeDescriptions = { ...objectTypeDescriptions, ...map };
|
|
7
|
-
}
|
|
8
|
-
export function registerAttributeDescriptions(map) {
|
|
9
|
-
attributeDescriptions = { ...attributeDescriptions, ...map };
|
|
10
|
-
}
|
|
11
|
-
export function resolveObjectTypeDescription(name) {
|
|
12
|
-
if (!name)
|
|
13
|
-
return undefined;
|
|
14
|
-
return objectTypeDescriptions[name];
|
|
15
|
-
}
|
|
16
|
-
export function resolveAttributeDescription(name) {
|
|
17
|
-
if (!name)
|
|
18
|
-
return undefined;
|
|
19
|
-
return attributeDescriptions[name];
|
|
20
|
-
}
|
|
1
|
+
// Simple registry to allow projects to provide additional descriptions at runtime
|
|
2
|
+
// without coupling core to project-generated files.
|
|
3
|
+
let objectTypeDescriptions = {};
|
|
4
|
+
let attributeDescriptions = {};
|
|
5
|
+
export function registerObjectTypeDescriptions(map) {
|
|
6
|
+
objectTypeDescriptions = { ...objectTypeDescriptions, ...map };
|
|
7
|
+
}
|
|
8
|
+
export function registerAttributeDescriptions(map) {
|
|
9
|
+
attributeDescriptions = { ...attributeDescriptions, ...map };
|
|
10
|
+
}
|
|
11
|
+
export function resolveObjectTypeDescription(name) {
|
|
12
|
+
if (!name)
|
|
13
|
+
return undefined;
|
|
14
|
+
return objectTypeDescriptions[name];
|
|
15
|
+
}
|
|
16
|
+
export function resolveAttributeDescription(name) {
|
|
17
|
+
if (!name)
|
|
18
|
+
return undefined;
|
|
19
|
+
return attributeDescriptions[name];
|
|
20
|
+
}
|
|
21
21
|
//# sourceMappingURL=uns-dictionary-registry.js.map
|