@uns-kit/cli 2.0.56 → 2.0.57
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 +168 -168
- package/dist/index.js +59 -59
- package/package.json +6 -6
- package/templates/api/src/examples/api-example.ts +155 -155
- package/templates/azure-pipelines.yml +21 -21
- package/templates/codegen/codegen.ts +15 -15
- package/templates/codegen/src/uns/uns-tags.ts +1 -1
- package/templates/codegen/src/uns/uns-topics.ts +1 -1
- package/templates/config-files/config-docker.json +32 -32
- package/templates/config-files/config-localhost.json +32 -32
- package/templates/cron/AGENTS.md +20 -20
- package/templates/cron/src/examples/cron-example.ts +71 -71
- package/templates/default/.prettierignore +1 -1
- package/templates/default/.prettierrc +7 -7
- package/templates/default/AGENTS.md +20 -20
- package/templates/default/README.md +83 -81
- package/templates/default/config.json +35 -35
- package/templates/default/eslint.config.js +30 -30
- package/templates/default/gitignore +51 -51
- package/templates/default/package.json +46 -46
- package/templates/default/src/config/project.config.extension.example +23 -23
- package/templates/default/src/config/project.config.extension.ts +6 -6
- package/templates/default/src/examples/data-example.ts +86 -86
- package/templates/default/src/examples/load-test-data.ts +110 -110
- package/templates/default/src/examples/table-example.ts +97 -97
- package/templates/default/src/examples/table-window-load-test.ts +446 -446
- package/templates/default/src/examples/uns-gateway-cli.ts +10 -10
- package/templates/default/src/index.ts +41 -41
- package/templates/default/src/uns/uns-assets.ts +12 -12
- package/templates/default/src/uns/uns-dictionary.generated.ts +758 -758
- package/templates/default/src/uns/uns-measurements.generated.ts +366 -366
- package/templates/default/src/uns/uns-tags.ts +2 -2
- package/templates/default/src/uns/uns-topics.ts +2 -2
- package/templates/default/tsconfig.json +29 -29
- package/templates/python/app/README.md +8 -8
- package/templates/python/examples/README.md +134 -134
- package/templates/python/examples/api_handler.py +28 -28
- package/templates/python/examples/data_publish.py +11 -11
- package/templates/python/examples/data_subscribe.py +8 -8
- package/templates/python/examples/data_transformer.py +17 -17
- package/templates/python/examples/table_transformer.py +15 -15
- package/templates/python/gateway/cli.py +75 -75
- package/templates/python/gateway/client.py +155 -155
- package/templates/python/gateway/manager.py +97 -97
- package/templates/python/gen/__init__.py +1 -0
- package/templates/python/gen/uns_gateway_pb2.py +70 -0
- package/templates/python/gen/uns_gateway_pb2_grpc.py +312 -0
- package/templates/python/gitignore +47 -47
- package/templates/python/proto/uns-gateway.proto +102 -102
- package/templates/python/pyproject.toml +4 -4
- package/templates/python/runtime.json +4 -4
- package/templates/python/scripts/setup.sh +87 -87
- package/templates/uns-dictionary/uns-dictionary.json +650 -650
- package/templates/uns-measurements/uns-measurements.json +360 -360
- package/templates/vscode/.vscode/launch.json +164 -164
- package/templates/vscode/.vscode/settings.json +9 -9
- package/templates/vscode/.vscode/tasks.json +27 -27
- package/templates/vscode/uns-kit.code-workspace +13 -13
|
@@ -1,155 +1,155 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Change this file according to your specifications and rename it to index.ts
|
|
3
|
-
*
|
|
4
|
-
* This example shows how to register GET and POST API endpoints using @uns-kit/api.
|
|
5
|
-
* Each endpoint is tied to a UNS topic/asset/objectType/objectId/attribute path and
|
|
6
|
-
* is automatically registered with the UNS controller and exposed via Swagger.
|
|
7
|
-
*
|
|
8
|
-
* Endpoint signature:
|
|
9
|
-
* api.get(topic, asset, objectType, objectId, attribute, options?)
|
|
10
|
-
* api.post(topic, asset, objectType, objectId, attribute, options?)
|
|
11
|
-
*
|
|
12
|
-
* Events:
|
|
13
|
-
* apiGetEvent — fired for every incoming GET request
|
|
14
|
-
* apiPostEvent — fired for every incoming POST request
|
|
15
|
-
*/
|
|
16
|
-
import { UnsProxyProcess, ConfigFile } from "@uns-kit/core";
|
|
17
|
-
import { IApiProxyOptions } from "@uns-kit/core";
|
|
18
|
-
import type { UnsEvents } from "@uns-kit/core";
|
|
19
|
-
import "@uns-kit/api";
|
|
20
|
-
import { type UnsProxyProcessWithApi } from "@uns-kit/api";
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Load the configuration from a file.
|
|
24
|
-
* On the server, this file is provided by the `uns-datahub-controller`.
|
|
25
|
-
* In the development environment, you are responsible for creating and maintaining this file.
|
|
26
|
-
*/
|
|
27
|
-
const config = await ConfigFile.loadConfig();
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Create the API proxy.
|
|
31
|
-
* Auth is automatically applied to every registered endpoint.
|
|
32
|
-
* Use jwksWellKnownUrl (preferred in production) or jwtSecret (dev/simple deployments).
|
|
33
|
-
*/
|
|
34
|
-
const unsProxyProcess = new UnsProxyProcess(config.infra.host!, { processName: config.uns.processName }) as UnsProxyProcessWithApi;
|
|
35
|
-
const apiOptions: IApiProxyOptions = config.uns?.jwksWellKnownUrl
|
|
36
|
-
? {
|
|
37
|
-
jwks: {
|
|
38
|
-
wellKnownJwksUrl: config.uns.jwksWellKnownUrl,
|
|
39
|
-
...(config.uns.kidWellKnownUrl !== undefined
|
|
40
|
-
? { activeKidUrl: config.uns.kidWellKnownUrl }
|
|
41
|
-
: {}),
|
|
42
|
-
},
|
|
43
|
-
}
|
|
44
|
-
: {
|
|
45
|
-
jwtSecret: "CHANGEME",
|
|
46
|
-
};
|
|
47
|
-
const apiInput = await unsProxyProcess.createApiProxy("templateUnsApiInput", apiOptions);
|
|
48
|
-
|
|
49
|
-
// ─── GET endpoints ────────────────────────────────────────────────────────────
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Register a GET endpoint.
|
|
53
|
-
* Query params are validated automatically; required params return 400 when missing.
|
|
54
|
-
* chatCanonical maps natural-language field names to query params for LLM tooling.
|
|
55
|
-
*/
|
|
56
|
-
await apiInput.get(
|
|
57
|
-
"enterprise/site/area/line/",
|
|
58
|
-
"line-3-furnace",
|
|
59
|
-
"energy-resource",
|
|
60
|
-
"main-bus",
|
|
61
|
-
"current",
|
|
62
|
-
{
|
|
63
|
-
tags: ["Energy"],
|
|
64
|
-
apiDescription: "Current reading for line-3-furnace main-bus",
|
|
65
|
-
queryParams: [
|
|
66
|
-
{ name: "from", type: "string", required: false, description: "Start of time range (ISO 8601)", chatCanonical: "from" },
|
|
67
|
-
{ name: "to", type: "string", required: false, description: "End of time range (ISO 8601)", chatCanonical: "to" },
|
|
68
|
-
{ name: "limit", type: "number", required: false, description: "Maximum number of records", chatCanonical: "limit", defaultValue: 100 },
|
|
69
|
-
],
|
|
70
|
-
chatDefaults: { limit: 100 },
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
await apiInput.get(
|
|
75
|
-
"enterprise/site/area/line/",
|
|
76
|
-
"line-3-compressor",
|
|
77
|
-
"utility-resource",
|
|
78
|
-
"air-loop-1",
|
|
79
|
-
"pressure",
|
|
80
|
-
{
|
|
81
|
-
tags: ["Utility"],
|
|
82
|
-
apiDescription: "Pressure reading for line-3-compressor air-loop-1",
|
|
83
|
-
queryParams: [
|
|
84
|
-
{ name: "limit", type: "number", required: false, description: "Maximum number of records", defaultValue: 50 },
|
|
85
|
-
],
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
// ─── POST endpoints ───────────────────────────────────────────────────────────
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Register a POST endpoint.
|
|
93
|
-
* Use POST when the caller needs to send a request body (commands, write operations, etc.).
|
|
94
|
-
* The requestBody schema is published to Swagger so clients know what to send.
|
|
95
|
-
*/
|
|
96
|
-
await apiInput.post(
|
|
97
|
-
"enterprise/site/area/line/",
|
|
98
|
-
"line-3-furnace",
|
|
99
|
-
"energy-resource",
|
|
100
|
-
"main-bus",
|
|
101
|
-
"setpoint",
|
|
102
|
-
{
|
|
103
|
-
tags: ["Energy"],
|
|
104
|
-
apiDescription: "Write a new setpoint for line-3-furnace main-bus",
|
|
105
|
-
requestBody: {
|
|
106
|
-
description: "Setpoint payload",
|
|
107
|
-
required: true,
|
|
108
|
-
schema: {
|
|
109
|
-
type: "object",
|
|
110
|
-
required: ["value"],
|
|
111
|
-
properties: {
|
|
112
|
-
value: { type: "number", description: "Target setpoint value" },
|
|
113
|
-
unit: { type: "string", description: "Unit of measurement, e.g. A" },
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
}
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
// ─── Event handlers ───────────────────────────────────────────────────────────
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Handle all GET requests.
|
|
124
|
-
* event.req is the Express Request; event.res is the Express Response.
|
|
125
|
-
* Use event.req.query for query parameters and event.req.appContext for UNS context.
|
|
126
|
-
*/
|
|
127
|
-
apiInput.event.on("apiGetEvent", (event: UnsEvents["apiGetEvent"]) => {
|
|
128
|
-
try {
|
|
129
|
-
// const { from, to, limit } = event.req.query;
|
|
130
|
-
// Add your data-fetching logic here (e.g. SQL query, time-series lookup)
|
|
131
|
-
event.res.json({ status: "ok", data: [] });
|
|
132
|
-
} catch (error) {
|
|
133
|
-
event.res.status(400).json({ error: "Bad request" });
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Handle all POST requests.
|
|
139
|
-
* event.req.body contains the parsed JSON body (Express json() middleware is pre-configured).
|
|
140
|
-
*/
|
|
141
|
-
apiInput.event.on("apiPostEvent", (event: UnsEvents["apiPostEvent"]) => {
|
|
142
|
-
try {
|
|
143
|
-
const body = event.req.body as { value?: number; unit?: string };
|
|
144
|
-
// Add your write/command logic here
|
|
145
|
-
event.res.json({ status: "ok", received: body });
|
|
146
|
-
} catch (error) {
|
|
147
|
-
event.res.status(400).json({ error: "Bad request" });
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
// ─── NOTE: registerCatchAll ───────────────────────────────────────────────────
|
|
152
|
-
//
|
|
153
|
-
// registerCatchAll() is used ONLY by the uns-api-global microservice, which acts
|
|
154
|
-
// as a catch-all gateway for an entire topic namespace. Regular microservices
|
|
155
|
-
// do NOT call this — use get() / post() above for per-attribute endpoints.
|
|
1
|
+
/**
|
|
2
|
+
* Change this file according to your specifications and rename it to index.ts
|
|
3
|
+
*
|
|
4
|
+
* This example shows how to register GET and POST API endpoints using @uns-kit/api.
|
|
5
|
+
* Each endpoint is tied to a UNS topic/asset/objectType/objectId/attribute path and
|
|
6
|
+
* is automatically registered with the UNS controller and exposed via Swagger.
|
|
7
|
+
*
|
|
8
|
+
* Endpoint signature:
|
|
9
|
+
* api.get(topic, asset, objectType, objectId, attribute, options?)
|
|
10
|
+
* api.post(topic, asset, objectType, objectId, attribute, options?)
|
|
11
|
+
*
|
|
12
|
+
* Events:
|
|
13
|
+
* apiGetEvent — fired for every incoming GET request
|
|
14
|
+
* apiPostEvent — fired for every incoming POST request
|
|
15
|
+
*/
|
|
16
|
+
import { UnsProxyProcess, ConfigFile } from "@uns-kit/core";
|
|
17
|
+
import { IApiProxyOptions } from "@uns-kit/core";
|
|
18
|
+
import type { UnsEvents } from "@uns-kit/core";
|
|
19
|
+
import "@uns-kit/api";
|
|
20
|
+
import { type UnsProxyProcessWithApi } from "@uns-kit/api";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Load the configuration from a file.
|
|
24
|
+
* On the server, this file is provided by the `uns-datahub-controller`.
|
|
25
|
+
* In the development environment, you are responsible for creating and maintaining this file.
|
|
26
|
+
*/
|
|
27
|
+
const config = await ConfigFile.loadConfig();
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Create the API proxy.
|
|
31
|
+
* Auth is automatically applied to every registered endpoint.
|
|
32
|
+
* Use jwksWellKnownUrl (preferred in production) or jwtSecret (dev/simple deployments).
|
|
33
|
+
*/
|
|
34
|
+
const unsProxyProcess = new UnsProxyProcess(config.infra.host!, { processName: config.uns.processName }) as UnsProxyProcessWithApi;
|
|
35
|
+
const apiOptions: IApiProxyOptions = config.uns?.jwksWellKnownUrl
|
|
36
|
+
? {
|
|
37
|
+
jwks: {
|
|
38
|
+
wellKnownJwksUrl: config.uns.jwksWellKnownUrl,
|
|
39
|
+
...(config.uns.kidWellKnownUrl !== undefined
|
|
40
|
+
? { activeKidUrl: config.uns.kidWellKnownUrl }
|
|
41
|
+
: {}),
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
: {
|
|
45
|
+
jwtSecret: "CHANGEME",
|
|
46
|
+
};
|
|
47
|
+
const apiInput = await unsProxyProcess.createApiProxy("templateUnsApiInput", apiOptions);
|
|
48
|
+
|
|
49
|
+
// ─── GET endpoints ────────────────────────────────────────────────────────────
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Register a GET endpoint.
|
|
53
|
+
* Query params are validated automatically; required params return 400 when missing.
|
|
54
|
+
* chatCanonical maps natural-language field names to query params for LLM tooling.
|
|
55
|
+
*/
|
|
56
|
+
await apiInput.get(
|
|
57
|
+
"enterprise/site/area/line/",
|
|
58
|
+
"line-3-furnace",
|
|
59
|
+
"energy-resource",
|
|
60
|
+
"main-bus",
|
|
61
|
+
"current",
|
|
62
|
+
{
|
|
63
|
+
tags: ["Energy"],
|
|
64
|
+
apiDescription: "Current reading for line-3-furnace main-bus",
|
|
65
|
+
queryParams: [
|
|
66
|
+
{ name: "from", type: "string", required: false, description: "Start of time range (ISO 8601)", chatCanonical: "from" },
|
|
67
|
+
{ name: "to", type: "string", required: false, description: "End of time range (ISO 8601)", chatCanonical: "to" },
|
|
68
|
+
{ name: "limit", type: "number", required: false, description: "Maximum number of records", chatCanonical: "limit", defaultValue: 100 },
|
|
69
|
+
],
|
|
70
|
+
chatDefaults: { limit: 100 },
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
await apiInput.get(
|
|
75
|
+
"enterprise/site/area/line/",
|
|
76
|
+
"line-3-compressor",
|
|
77
|
+
"utility-resource",
|
|
78
|
+
"air-loop-1",
|
|
79
|
+
"pressure",
|
|
80
|
+
{
|
|
81
|
+
tags: ["Utility"],
|
|
82
|
+
apiDescription: "Pressure reading for line-3-compressor air-loop-1",
|
|
83
|
+
queryParams: [
|
|
84
|
+
{ name: "limit", type: "number", required: false, description: "Maximum number of records", defaultValue: 50 },
|
|
85
|
+
],
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
// ─── POST endpoints ───────────────────────────────────────────────────────────
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Register a POST endpoint.
|
|
93
|
+
* Use POST when the caller needs to send a request body (commands, write operations, etc.).
|
|
94
|
+
* The requestBody schema is published to Swagger so clients know what to send.
|
|
95
|
+
*/
|
|
96
|
+
await apiInput.post(
|
|
97
|
+
"enterprise/site/area/line/",
|
|
98
|
+
"line-3-furnace",
|
|
99
|
+
"energy-resource",
|
|
100
|
+
"main-bus",
|
|
101
|
+
"setpoint",
|
|
102
|
+
{
|
|
103
|
+
tags: ["Energy"],
|
|
104
|
+
apiDescription: "Write a new setpoint for line-3-furnace main-bus",
|
|
105
|
+
requestBody: {
|
|
106
|
+
description: "Setpoint payload",
|
|
107
|
+
required: true,
|
|
108
|
+
schema: {
|
|
109
|
+
type: "object",
|
|
110
|
+
required: ["value"],
|
|
111
|
+
properties: {
|
|
112
|
+
value: { type: "number", description: "Target setpoint value" },
|
|
113
|
+
unit: { type: "string", description: "Unit of measurement, e.g. A" },
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
// ─── Event handlers ───────────────────────────────────────────────────────────
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Handle all GET requests.
|
|
124
|
+
* event.req is the Express Request; event.res is the Express Response.
|
|
125
|
+
* Use event.req.query for query parameters and event.req.appContext for UNS context.
|
|
126
|
+
*/
|
|
127
|
+
apiInput.event.on("apiGetEvent", (event: UnsEvents["apiGetEvent"]) => {
|
|
128
|
+
try {
|
|
129
|
+
// const { from, to, limit } = event.req.query;
|
|
130
|
+
// Add your data-fetching logic here (e.g. SQL query, time-series lookup)
|
|
131
|
+
event.res.json({ status: "ok", data: [] });
|
|
132
|
+
} catch (error) {
|
|
133
|
+
event.res.status(400).json({ error: "Bad request" });
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Handle all POST requests.
|
|
139
|
+
* event.req.body contains the parsed JSON body (Express json() middleware is pre-configured).
|
|
140
|
+
*/
|
|
141
|
+
apiInput.event.on("apiPostEvent", (event: UnsEvents["apiPostEvent"]) => {
|
|
142
|
+
try {
|
|
143
|
+
const body = event.req.body as { value?: number; unit?: string };
|
|
144
|
+
// Add your write/command logic here
|
|
145
|
+
event.res.json({ status: "ok", received: body });
|
|
146
|
+
} catch (error) {
|
|
147
|
+
event.res.status(400).json({ error: "Bad request" });
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// ─── NOTE: registerCatchAll ───────────────────────────────────────────────────
|
|
152
|
+
//
|
|
153
|
+
// registerCatchAll() is used ONLY by the uns-api-global microservice, which acts
|
|
154
|
+
// as a catch-all gateway for an entire topic namespace. Regular microservices
|
|
155
|
+
// do NOT call this — use get() / post() above for per-attribute endpoints.
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
variables:
|
|
2
|
-
privatePool: 'Azure private pool'
|
|
3
|
-
|
|
4
|
-
trigger:
|
|
5
|
-
- master
|
|
6
|
-
|
|
7
|
-
stages:
|
|
8
|
-
- stage: version_tag
|
|
9
|
-
displayName: Add Version Tag
|
|
10
|
-
pool: $(privatePool)
|
|
11
|
-
jobs:
|
|
12
|
-
- job: add_tags
|
|
13
|
-
steps:
|
|
14
|
-
- checkout: self
|
|
15
|
-
persistCredentials: true
|
|
16
|
-
clean: true
|
|
17
|
-
- script: |
|
|
18
|
-
tag=$(node -pe "require('./package.json').version")
|
|
19
|
-
git tag $tag
|
|
20
|
-
git push origin $tag
|
|
21
|
-
displayName: "Add version tag from package.json"
|
|
1
|
+
variables:
|
|
2
|
+
privatePool: 'Azure private pool'
|
|
3
|
+
|
|
4
|
+
trigger:
|
|
5
|
+
- master
|
|
6
|
+
|
|
7
|
+
stages:
|
|
8
|
+
- stage: version_tag
|
|
9
|
+
displayName: Add Version Tag
|
|
10
|
+
pool: $(privatePool)
|
|
11
|
+
jobs:
|
|
12
|
+
- job: add_tags
|
|
13
|
+
steps:
|
|
14
|
+
- checkout: self
|
|
15
|
+
persistCredentials: true
|
|
16
|
+
clean: true
|
|
17
|
+
- script: |
|
|
18
|
+
tag=$(node -pe "require('./package.json').version")
|
|
19
|
+
git tag $tag
|
|
20
|
+
git push origin $tag
|
|
21
|
+
displayName: "Add version tag from package.json"
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
2
|
-
import { ConfigFile } from '@uns-kit/core';
|
|
3
|
-
|
|
4
|
-
const appConfig = await ConfigFile.loadConfig();
|
|
5
|
-
|
|
6
|
-
const config: CodegenConfig = {
|
|
7
|
-
schema: appConfig.uns.graphql,
|
|
8
|
-
generates: {
|
|
9
|
-
'src/graphql/schema.ts': {
|
|
10
|
-
plugins: ['typescript', 'typescript-operations', 'typescript-resolvers'],
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default config;
|
|
1
|
+
import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
2
|
+
import { ConfigFile } from '@uns-kit/core';
|
|
3
|
+
|
|
4
|
+
const appConfig = await ConfigFile.loadConfig();
|
|
5
|
+
|
|
6
|
+
const config: CodegenConfig = {
|
|
7
|
+
schema: appConfig.uns.graphql,
|
|
8
|
+
generates: {
|
|
9
|
+
'src/graphql/schema.ts': {
|
|
10
|
+
plugins: ['typescript', 'typescript-operations', 'typescript-resolvers'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type UnsTags = string & {};
|
|
1
|
+
export type UnsTags = string & {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type UnsTopics = string & {};
|
|
1
|
+
export type UnsTopics = string & {};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"uns": {
|
|
3
|
-
"graphql": "http://uns-datahub-controller:3200/graphql",
|
|
4
|
-
"rest": "http://uns-datahub-controller:3200/api",
|
|
5
|
-
"processName": "__APP_NAME__",
|
|
6
|
-
"supervisor": {
|
|
7
|
-
"enabled": false,
|
|
8
|
-
"restartOnExit": false,
|
|
9
|
-
"maxMemoryMb": 512,
|
|
10
|
-
"restartOnUnhealthy": false,
|
|
11
|
-
"unhealthyAfterMs": 60000,
|
|
12
|
-
"restartCooldownMs": 300000
|
|
13
|
-
},
|
|
14
|
-
"instanceMode": "wait",
|
|
15
|
-
"handover": true,
|
|
16
|
-
"jwksWellKnownUrl": "http://uns-datahub-controller:3200/api/.well-known/jwks.json",
|
|
17
|
-
"kidWellKnownUrl": "http://uns-datahub-controller:3200/api/.well-known/kid",
|
|
1
|
+
{
|
|
2
|
+
"uns": {
|
|
3
|
+
"graphql": "http://uns-datahub-controller:3200/graphql",
|
|
4
|
+
"rest": "http://uns-datahub-controller:3200/api",
|
|
5
|
+
"processName": "__APP_NAME__",
|
|
6
|
+
"supervisor": {
|
|
7
|
+
"enabled": false,
|
|
8
|
+
"restartOnExit": false,
|
|
9
|
+
"maxMemoryMb": 512,
|
|
10
|
+
"restartOnUnhealthy": false,
|
|
11
|
+
"unhealthyAfterMs": 60000,
|
|
12
|
+
"restartCooldownMs": 300000
|
|
13
|
+
},
|
|
14
|
+
"instanceMode": "wait",
|
|
15
|
+
"handover": true,
|
|
16
|
+
"jwksWellKnownUrl": "http://uns-datahub-controller:3200/api/.well-known/jwks.json",
|
|
17
|
+
"kidWellKnownUrl": "http://uns-datahub-controller:3200/api/.well-known/kid",
|
|
18
18
|
"email": "user@example-org.com",
|
|
19
19
|
"password": "secret"
|
|
20
20
|
},
|
|
21
|
-
"infra": {
|
|
22
|
-
"host": "mosquitto:1883"
|
|
23
|
-
},
|
|
24
|
-
"output": {
|
|
25
|
-
"host": "mosquitto:1883"
|
|
26
|
-
},
|
|
27
|
-
"input": {
|
|
28
|
-
"host": "mosquitto:1883"
|
|
29
|
-
},
|
|
30
|
-
"devops": {
|
|
31
|
-
"provider": "azure-devops",
|
|
32
|
-
"organization": "example-org",
|
|
33
|
-
"project": "example-project"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
21
|
+
"infra": {
|
|
22
|
+
"host": "mosquitto:1883"
|
|
23
|
+
},
|
|
24
|
+
"output": {
|
|
25
|
+
"host": "mosquitto:1883"
|
|
26
|
+
},
|
|
27
|
+
"input": {
|
|
28
|
+
"host": "mosquitto:1883"
|
|
29
|
+
},
|
|
30
|
+
"devops": {
|
|
31
|
+
"provider": "azure-devops",
|
|
32
|
+
"organization": "example-org",
|
|
33
|
+
"project": "example-project"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"uns": {
|
|
3
|
-
"graphql": "http://localhost:3200/graphql",
|
|
4
|
-
"rest": "http://localhost:3200/api",
|
|
5
|
-
"processName": "__APP_NAME__",
|
|
6
|
-
"supervisor": {
|
|
7
|
-
"enabled": false,
|
|
8
|
-
"restartOnExit": false,
|
|
9
|
-
"maxMemoryMb": 512,
|
|
10
|
-
"restartOnUnhealthy": false,
|
|
11
|
-
"unhealthyAfterMs": 60000,
|
|
12
|
-
"restartCooldownMs": 300000
|
|
13
|
-
},
|
|
14
|
-
"instanceMode": "wait",
|
|
15
|
-
"handover": true,
|
|
16
|
-
"jwksWellKnownUrl": "http://localhost:3200/api/.well-known/jwks.json",
|
|
17
|
-
"kidWellKnownUrl": "http://localhost:3200/api/.well-known/kid",
|
|
1
|
+
{
|
|
2
|
+
"uns": {
|
|
3
|
+
"graphql": "http://localhost:3200/graphql",
|
|
4
|
+
"rest": "http://localhost:3200/api",
|
|
5
|
+
"processName": "__APP_NAME__",
|
|
6
|
+
"supervisor": {
|
|
7
|
+
"enabled": false,
|
|
8
|
+
"restartOnExit": false,
|
|
9
|
+
"maxMemoryMb": 512,
|
|
10
|
+
"restartOnUnhealthy": false,
|
|
11
|
+
"unhealthyAfterMs": 60000,
|
|
12
|
+
"restartCooldownMs": 300000
|
|
13
|
+
},
|
|
14
|
+
"instanceMode": "wait",
|
|
15
|
+
"handover": true,
|
|
16
|
+
"jwksWellKnownUrl": "http://localhost:3200/api/.well-known/jwks.json",
|
|
17
|
+
"kidWellKnownUrl": "http://localhost:3200/api/.well-known/kid",
|
|
18
18
|
"email": "user@example-org.com",
|
|
19
19
|
"password": "secret"
|
|
20
20
|
},
|
|
21
|
-
"infra": {
|
|
22
|
-
"host": "localhost"
|
|
23
|
-
},
|
|
24
|
-
"output": {
|
|
25
|
-
"host": "localhost"
|
|
26
|
-
},
|
|
27
|
-
"input": {
|
|
28
|
-
"host": "localhost"
|
|
29
|
-
},
|
|
30
|
-
"devops": {
|
|
31
|
-
"provider": "azure-devops",
|
|
32
|
-
"organization": "example-org",
|
|
33
|
-
"project": "example-project"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
21
|
+
"infra": {
|
|
22
|
+
"host": "localhost"
|
|
23
|
+
},
|
|
24
|
+
"output": {
|
|
25
|
+
"host": "localhost"
|
|
26
|
+
},
|
|
27
|
+
"input": {
|
|
28
|
+
"host": "localhost"
|
|
29
|
+
},
|
|
30
|
+
"devops": {
|
|
31
|
+
"provider": "azure-devops",
|
|
32
|
+
"organization": "example-org",
|
|
33
|
+
"project": "example-project"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/templates/cron/AGENTS.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# Agent Onboarding (template)
|
|
2
|
-
|
|
3
|
-
Pointers for AI/code-assist tools when working in this generated project.
|
|
4
|
-
|
|
5
|
-
## What to read locally
|
|
6
|
-
|
|
7
|
-
- `package.json` for scripts (`sync-uns-*`, `generate-codegen`, etc.).
|
|
8
|
-
- `config.schema.json` for the app config shape; `processName` is required.
|
|
9
|
-
- `src/examples/*.ts` for cron-driven publish patterns and description registration.
|
|
10
|
-
- Installed docs (under `node_modules`):
|
|
11
|
-
- `@uns-kit/core/README.md`
|
|
12
|
-
- `@uns-kit/api/README.md` (if installed)
|
|
13
|
-
- `@uns-kit/cron/README.md` (if installed)
|
|
14
|
-
- `@uns-kit/cli/README.md` (if installed)
|
|
15
|
-
|
|
16
|
-
## Generators in this project
|
|
17
|
-
|
|
18
|
-
- `pnpm run generate-codegen` -> GraphQL codegen (after configure-codegen)
|
|
19
|
-
- `pnpm run sync-uns-schema -- --controller-url ... --token ...` -> pulls `uns-dictionary.json` + `uns-measurements.json` from the controller and regenerates local TS helpers
|
|
20
|
-
- `pnpm run sync-uns-metadata -- --controller-url ... --token ...` -> pulls topics/tags/assets from the controller and regenerates local TS helpers
|
|
1
|
+
# Agent Onboarding (template)
|
|
2
|
+
|
|
3
|
+
Pointers for AI/code-assist tools when working in this generated project.
|
|
4
|
+
|
|
5
|
+
## What to read locally
|
|
6
|
+
|
|
7
|
+
- `package.json` for scripts (`sync-uns-*`, `generate-codegen`, etc.).
|
|
8
|
+
- `config.schema.json` for the app config shape; `processName` is required.
|
|
9
|
+
- `src/examples/*.ts` for cron-driven publish patterns and description registration.
|
|
10
|
+
- Installed docs (under `node_modules`):
|
|
11
|
+
- `@uns-kit/core/README.md`
|
|
12
|
+
- `@uns-kit/api/README.md` (if installed)
|
|
13
|
+
- `@uns-kit/cron/README.md` (if installed)
|
|
14
|
+
- `@uns-kit/cli/README.md` (if installed)
|
|
15
|
+
|
|
16
|
+
## Generators in this project
|
|
17
|
+
|
|
18
|
+
- `pnpm run generate-codegen` -> GraphQL codegen (after configure-codegen)
|
|
19
|
+
- `pnpm run sync-uns-schema -- --controller-url ... --token ...` -> pulls `uns-dictionary.json` + `uns-measurements.json` from the controller and regenerates local TS helpers
|
|
20
|
+
- `pnpm run sync-uns-metadata -- --controller-url ... --token ...` -> pulls topics/tags/assets from the controller and regenerates local TS helpers
|