@uns-kit/cli 0.0.71 → 0.0.73

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uns-kit/cli",
3
- "version": "0.0.71",
3
+ "version": "0.0.73",
4
4
  "description": "Command line scaffolding tool for UNS applications",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -26,13 +26,13 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "azure-devops-node-api": "^15.1.1",
29
- "@uns-kit/core": "1.0.38"
29
+ "@uns-kit/core": "1.0.40"
30
30
  },
31
31
  "unsKitPackages": {
32
- "@uns-kit/core": "1.0.38",
33
- "@uns-kit/api": "0.0.48",
34
- "@uns-kit/cron": "0.0.47",
35
- "@uns-kit/temporal": "0.0.46"
32
+ "@uns-kit/core": "1.0.40",
33
+ "@uns-kit/api": "0.0.49",
34
+ "@uns-kit/cron": "0.0.48",
35
+ "@uns-kit/temporal": "0.0.47"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsc -p tsconfig.build.json",
@@ -4,7 +4,6 @@
4
4
  import { UnsProxyProcess, ConfigFile, logger } from "@uns-kit/core";
5
5
  import { registerAttributeDescriptions, registerObjectTypeDescriptions } from "@uns-kit/core/uns/uns-dictionary-registry.js";
6
6
  import { GeneratedPhysicalMeasurements } from "../uns/uns-measurements.generated.js";
7
- import { UnsPacket } from "@uns-kit/core/uns/uns-packet.js";
8
7
  import { UnsTopics } from "@uns-kit/core/uns/uns-topics.js";
9
8
  import {
10
9
  GeneratedObjectTypes,
@@ -13,6 +12,7 @@ import {
13
12
  GeneratedObjectTypeDescriptions,
14
13
  } from "../uns/uns-dictionary.generated.js";
15
14
  import { GeneratedAssets, resolveGeneratedAsset } from "../uns/uns-assets.js";
15
+ import type { ISO8601 } from "@uns-kit/core/uns/uns-interfaces.js";
16
16
 
17
17
  /**
18
18
  * Load the configuration from a file.
@@ -48,7 +48,7 @@ mqttInput.event.on("input", async (event) => {
48
48
  const numberValue = Number.parseFloat(countRaw);
49
49
  const eventDate = new Date(Number.parseInt(timestampRaw, 10));
50
50
  const sensorValue = Number.parseFloat(sensorRaw);
51
- const time = UnsPacket.formatToISO8601(eventDate);
51
+ const time: ISO8601 = eventDate.toISOString() as ISO8601;
52
52
 
53
53
  const dataGroup = "sensor";
54
54
 
@@ -2,9 +2,8 @@
2
2
  * Change this file according to your specifications and rename it to index.ts
3
3
  */
4
4
 
5
- import { UnsProxyProcess, ConfigFile, logger, type IUnsMessage } from "@uns-kit/core";
5
+ import { UnsProxyProcess, ConfigFile, logger } from "@uns-kit/core";
6
6
  import { registerAttributeDescriptions, registerObjectTypeDescriptions } from "@uns-kit/core/uns/uns-dictionary-registry.js";
7
- import { UnsPacket } from "@uns-kit/core/uns/uns-packet.js";
8
7
  import { UnsTopics } from "@uns-kit/core/uns/uns-topics.js";
9
8
  import {
10
9
  GeneratedObjectTypes,
@@ -14,6 +13,7 @@ import {
14
13
  } from "../uns/uns-dictionary.generated.js";
15
14
  import { GeneratedAssets, resolveGeneratedAsset } from "../uns/uns-assets.js";
16
15
  import type { IUnsTableColumn } from "@uns-kit/core/uns/uns-interfaces.js";
16
+ import type { ISO8601 } from "@uns-kit/core/uns/uns-interfaces.js";
17
17
  import { GeneratedPhysicalMeasurements } from "../uns/uns-measurements.generated.js";
18
18
 
19
19
  /**
@@ -55,33 +55,32 @@ mqttInput.event.on("input", async (event) => {
55
55
  const eventDate = new Date(Number.parseInt(timestampRaw, 10));
56
56
  const sensorValue = Number.parseFloat(sensorRaw);
57
57
 
58
- const time = UnsPacket.formatToISO8601(eventDate);
58
+ const time: ISO8601 = eventDate.toISOString() as ISO8601;
59
59
  const dataGroup = "sensor_table";
60
60
  const columns: IUnsTableColumn[] = [
61
61
  { name: "current", type: "double", value: currentValue, uom: GeneratedPhysicalMeasurements.Ampere },
62
62
  { name: "voltage", type: "double", value: sensorValue },
63
63
  ];
64
- const message: IUnsMessage = {
65
- table: {
66
- dataGroup,
67
- time,
68
- columns,
69
- },
70
- };
71
64
  const topic: UnsTopics = "enterprise/site/area/line/";
72
65
  const asset = resolveGeneratedAsset("asset");
73
66
  const assetDescription = ""; // customize manually
74
- const packet = await UnsPacket.unsPacketFromUnsMessage(message);
75
67
  mqttOutput.publishMqttMessage({
76
68
  topic,
77
69
  asset,
78
70
  assetDescription,
79
71
  objectType: GeneratedObjectTypes["resource-status"],
80
72
  objectId: "main",
81
- attribute: GeneratedAttributes["status"] ?? "status",
82
- description: GeneratedAttributeDescriptions["status"] ?? "Table",
83
- tags: [],
84
- packet,
73
+ attributes: [
74
+ {
75
+ attribute: GeneratedAttributes["status"] ?? "status",
76
+ description: GeneratedAttributeDescriptions["status"] ?? "Table",
77
+ table: {
78
+ dataGroup,
79
+ time,
80
+ columns,
81
+ },
82
+ },
83
+ ],
85
84
  });
86
85
  }
87
86
  } catch (error) {