@uns-kit/cli 2.0.56 → 2.0.58

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": "2.0.56",
3
+ "version": "2.0.58",
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": "2.0.56"
29
+ "@uns-kit/core": "2.0.58"
30
30
  },
31
31
  "unsKitPackages": {
32
- "@uns-kit/core": "2.0.56",
33
- "@uns-kit/api": "2.0.56",
34
- "@uns-kit/cron": "2.0.56",
35
- "@uns-kit/database": "2.0.56"
32
+ "@uns-kit/core": "2.0.58",
33
+ "@uns-kit/api": "2.0.58",
34
+ "@uns-kit/cron": "2.0.58",
35
+ "@uns-kit/database": "2.0.58"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsc -p tsconfig.build.json",
@@ -18,7 +18,7 @@ pnpm run sync-uns-metadata -- --controller-url http://localhost:3200 --token <me
18
18
 
19
19
  ## Configuration
20
20
 
21
- Update `config.json` with your broker, UNS URLs, and credentials. The generated file contains sensible defaults for local development.
21
+ Update `config.json` with your broker, UNS URLs, and credentials. The generated file contains sensible defaults for local development. If you use a service token, add `uns.token` and pass it to `UnsClient`.
22
22
 
23
23
  ## Validity / Liveliness
24
24
 
@@ -49,10 +49,12 @@ await proxy.publishMqttMessage({
49
49
  `UnsClient` provides a minimal REST client for the UNS Datahub API, including the batch last-value endpoint. Prefer a long-lived service token if available; you can pass it directly and skip username/password auth.
50
50
 
51
51
  ```ts
52
- import { UnsClient } from "@uns-kit/core";
52
+ import { ConfigFile, UnsClient } from "@uns-kit/core";
53
+
54
+ const config = await ConfigFile.loadConfig();
53
55
 
54
56
  const client = new UnsClient("https://datahub.example.com", {
55
- token: process.env.UNS_SERVICE_TOKEN,
57
+ token: process.env.UNS_SERVICE_TOKEN ?? config.uns.token,
56
58
  });
57
59
 
58
60
  const values = await client.lastValue([