@uns-kit/cli 2.0.25 → 2.0.27

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 (59) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +175 -175
  3. package/package.json +6 -6
  4. package/templates/api/src/examples/api-example.ts +91 -91
  5. package/templates/azure-pipelines.yml +21 -21
  6. package/templates/codegen/codegen.ts +15 -15
  7. package/templates/codegen/src/uns/uns-tags.ts +1 -1
  8. package/templates/codegen/src/uns/uns-topics.ts +1 -1
  9. package/templates/config-files/config-docker.json +26 -26
  10. package/templates/config-files/config-localhost.json +26 -26
  11. package/templates/cron/AGENTS.md +24 -24
  12. package/templates/cron/src/examples/cron-example.ts +71 -71
  13. package/templates/default/.prettierignore +1 -1
  14. package/templates/default/.prettierrc +7 -7
  15. package/templates/default/AGENTS.md +24 -24
  16. package/templates/default/README.md +43 -43
  17. package/templates/default/config.json +27 -27
  18. package/templates/default/eslint.config.js +30 -30
  19. package/templates/default/gitignore +51 -51
  20. package/templates/default/package.json +49 -49
  21. package/templates/default/src/config/project.config.extension.example +23 -23
  22. package/templates/default/src/config/project.config.extension.ts +6 -6
  23. package/templates/default/src/examples/data-example.ts +86 -86
  24. package/templates/default/src/examples/load-test-data.ts +110 -110
  25. package/templates/default/src/examples/table-example.ts +97 -97
  26. package/templates/default/src/examples/table-window-load-test.ts +446 -446
  27. package/templates/default/src/examples/uns-gateway-cli.ts +10 -10
  28. package/templates/default/src/index.ts +15 -15
  29. package/templates/default/src/uns/uns-assets.ts +12 -12
  30. package/templates/default/src/uns/uns-dictionary.generated.ts +758 -758
  31. package/templates/default/src/uns/uns-measurements.generated.ts +366 -366
  32. package/templates/default/src/uns/uns-tags.ts +2 -2
  33. package/templates/default/src/uns/uns-topics.ts +2 -2
  34. package/templates/default/tsconfig.json +29 -29
  35. package/templates/python/app/README.md +8 -8
  36. package/templates/python/examples/README.md +134 -134
  37. package/templates/python/examples/api_handler.py +28 -28
  38. package/templates/python/examples/data_publish.py +11 -11
  39. package/templates/python/examples/data_subscribe.py +8 -8
  40. package/templates/python/examples/data_transformer.py +17 -17
  41. package/templates/python/examples/table_transformer.py +15 -15
  42. package/templates/python/gateway/cli.py +75 -75
  43. package/templates/python/gateway/client.py +155 -155
  44. package/templates/python/gateway/manager.py +97 -97
  45. package/templates/python/gen/__init__.py +1 -0
  46. package/templates/python/gen/uns_gateway_pb2.py +70 -0
  47. package/templates/python/gen/uns_gateway_pb2_grpc.py +312 -0
  48. package/templates/python/gitignore +47 -47
  49. package/templates/python/proto/uns-gateway.proto +102 -102
  50. package/templates/python/pyproject.toml +4 -4
  51. package/templates/python/runtime.json +4 -4
  52. package/templates/python/scripts/setup.sh +87 -87
  53. package/templates/temporal/src/examples/temporal-example.ts +37 -37
  54. package/templates/uns-dictionary/uns-dictionary.json +650 -650
  55. package/templates/uns-measurements/uns-measurements.json +360 -360
  56. package/templates/vscode/.vscode/launch.json +164 -164
  57. package/templates/vscode/.vscode/settings.json +9 -9
  58. package/templates/vscode/.vscode/tasks.json +27 -27
  59. package/templates/vscode/uns-kit.code-workspace +13 -13
@@ -0,0 +1,70 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: uns-gateway.proto
5
+ # Protobuf Python Version: 6.31.1
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 31,
16
+ 1,
17
+ '',
18
+ 'uns-gateway.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11uns-gateway.proto\x12\x03uns\"\xda\x01\n\x0ePublishRequest\x12\r\n\x05topic\x18\x01 \x01(\t\x12\x11\n\tattribute\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0c\n\x04tags\x18\x04 \x03(\t\x12#\n\x1b\x61ttribute_needs_persistence\x18\x05 \x01(\x08\x12\x19\n\x04\x64\x61ta\x18\x06 \x01(\x0b\x32\t.uns.DataH\x00\x12\x1b\n\x05table\x18\x07 \x01(\x0b\x32\n.uns.TableH\x00\x12\x1b\n\x13value_is_cumulative\x18\x08 \x01(\x08\x42\t\n\x07\x63ontent\"|\n\x04\x44\x61ta\x12\x0c\n\x04time\x18\x01 \x01(\t\x12\x14\n\x0cvalue_number\x18\x02 \x01(\x01\x12\x14\n\x0cvalue_string\x18\x03 \x01(\t\x12\x0b\n\x03uom\x18\x04 \x01(\t\x12\x12\n\ndata_group\x18\x05 \x01(\t\x12\x19\n\x11\x66oreign_event_key\x18\x06 \x01(\t\"E\n\nTableValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x14\n\x0cvalue_number\x18\x02 \x01(\x01\x12\x14\n\x0cvalue_string\x18\x03 \x01(\t\"J\n\x05Table\x12\x0c\n\x04time\x18\x01 \x01(\t\x12\x1f\n\x06values\x18\x02 \x03(\x0b\x32\x0f.uns.TableValue\x12\x12\n\ndata_group\x18\x03 \x01(\t\"\"\n\x10SubscribeRequest\x12\x0e\n\x06topics\x18\x01 \x03(\t\"-\n\x0bMqttMessage\x12\r\n\x05topic\x18\x01 \x01(\t\x12\x0f\n\x07payload\x18\x02 \x01(\t\" \n\x03\x41\x63k\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"]\n\x0cReadyRequest\x12\x12\n\ntimeout_ms\x18\x01 \x01(\x05\x12\x13\n\x0bwait_output\x18\x02 \x01(\x08\x12\x12\n\nwait_input\x18\x03 \x01(\x08\x12\x10\n\x08wait_api\x18\x04 \x01(\x08\"R\n\rApiQueryParam\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x10\n\x08required\x18\x03 \x01(\x08\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\"\x8a\x01\n\x15RegisterApiGetRequest\x12\r\n\x05topic\x18\x01 \x01(\t\x12\x11\n\tattribute\x18\x02 \x01(\t\x12\x17\n\x0f\x61pi_description\x18\x03 \x01(\t\x12\x0c\n\x04tags\x18\x04 \x03(\t\x12(\n\x0cquery_params\x18\x05 \x03(\x0b\x32\x12.uns.ApiQueryParam\";\n\x17UnregisterApiGetRequest\x12\r\n\x05topic\x18\x01 \x01(\t\x12\x11\n\tattribute\x18\x02 \x01(\t\"\x9b\x01\n\x08\x41piEvent\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06method\x18\x02 \x01(\t\x12\x0c\n\x04path\x18\x03 \x01(\t\x12\'\n\x05query\x18\x04 \x03(\x0b\x32\x18.uns.ApiEvent.QueryEntry\x12\x0e\n\x06\x62\x65\x61rer\x18\x05 \x01(\t\x1a,\n\nQueryEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa1\x01\n\x10\x41piEventResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\x05\x12\x0c\n\x04\x62ody\x18\x03 \x01(\t\x12\x33\n\x07headers\x18\x04 \x03(\x0b\x32\".uns.ApiEventResponse.HeadersEntry\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x32\xc4\x02\n\nUnsGateway\x12(\n\x07Publish\x12\x13.uns.PublishRequest\x1a\x08.uns.Ack\x12\x36\n\tSubscribe\x12\x15.uns.SubscribeRequest\x1a\x10.uns.MqttMessage0\x01\x12\x36\n\x0eRegisterApiGet\x12\x1a.uns.RegisterApiGetRequest\x1a\x08.uns.Ack\x12:\n\x10UnregisterApiGet\x12\x1c.uns.UnregisterApiGetRequest\x1a\x08.uns.Ack\x12:\n\x0e\x41piEventStream\x12\x15.uns.ApiEventResponse\x1a\r.uns.ApiEvent(\x01\x30\x01\x12$\n\x05Ready\x12\x11.uns.ReadyRequest\x1a\x08.uns.Ackb\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'uns_gateway_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_APIEVENT_QUERYENTRY']._loaded_options = None
35
+ _globals['_APIEVENT_QUERYENTRY']._serialized_options = b'8\001'
36
+ _globals['_APIEVENTRESPONSE_HEADERSENTRY']._loaded_options = None
37
+ _globals['_APIEVENTRESPONSE_HEADERSENTRY']._serialized_options = b'8\001'
38
+ _globals['_PUBLISHREQUEST']._serialized_start=27
39
+ _globals['_PUBLISHREQUEST']._serialized_end=245
40
+ _globals['_DATA']._serialized_start=247
41
+ _globals['_DATA']._serialized_end=371
42
+ _globals['_TABLEVALUE']._serialized_start=373
43
+ _globals['_TABLEVALUE']._serialized_end=442
44
+ _globals['_TABLE']._serialized_start=444
45
+ _globals['_TABLE']._serialized_end=518
46
+ _globals['_SUBSCRIBEREQUEST']._serialized_start=520
47
+ _globals['_SUBSCRIBEREQUEST']._serialized_end=554
48
+ _globals['_MQTTMESSAGE']._serialized_start=556
49
+ _globals['_MQTTMESSAGE']._serialized_end=601
50
+ _globals['_ACK']._serialized_start=603
51
+ _globals['_ACK']._serialized_end=635
52
+ _globals['_READYREQUEST']._serialized_start=637
53
+ _globals['_READYREQUEST']._serialized_end=730
54
+ _globals['_APIQUERYPARAM']._serialized_start=732
55
+ _globals['_APIQUERYPARAM']._serialized_end=814
56
+ _globals['_REGISTERAPIGETREQUEST']._serialized_start=817
57
+ _globals['_REGISTERAPIGETREQUEST']._serialized_end=955
58
+ _globals['_UNREGISTERAPIGETREQUEST']._serialized_start=957
59
+ _globals['_UNREGISTERAPIGETREQUEST']._serialized_end=1016
60
+ _globals['_APIEVENT']._serialized_start=1019
61
+ _globals['_APIEVENT']._serialized_end=1174
62
+ _globals['_APIEVENT_QUERYENTRY']._serialized_start=1130
63
+ _globals['_APIEVENT_QUERYENTRY']._serialized_end=1174
64
+ _globals['_APIEVENTRESPONSE']._serialized_start=1177
65
+ _globals['_APIEVENTRESPONSE']._serialized_end=1338
66
+ _globals['_APIEVENTRESPONSE_HEADERSENTRY']._serialized_start=1292
67
+ _globals['_APIEVENTRESPONSE_HEADERSENTRY']._serialized_end=1338
68
+ _globals['_UNSGATEWAY']._serialized_start=1341
69
+ _globals['_UNSGATEWAY']._serialized_end=1665
70
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,312 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+ from . import uns_gateway_pb2 as uns__gateway__pb2
7
+
8
+ GRPC_GENERATED_VERSION = '1.75.1'
9
+ GRPC_VERSION = grpc.__version__
10
+ _version_not_supported = False
11
+
12
+ try:
13
+ from grpc._utilities import first_version_is_lower
14
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
+ except ImportError:
16
+ _version_not_supported = True
17
+
18
+ if _version_not_supported:
19
+ raise RuntimeError(
20
+ f'The grpc package installed is at version {GRPC_VERSION},'
21
+ + f' but the generated code in uns_gateway_pb2_grpc.py depends on'
22
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
+ )
26
+
27
+
28
+ class UnsGatewayStub(object):
29
+ """Missing associated documentation comment in .proto file."""
30
+
31
+ def __init__(self, channel):
32
+ """Constructor.
33
+
34
+ Args:
35
+ channel: A grpc.Channel.
36
+ """
37
+ self.Publish = channel.unary_unary(
38
+ '/uns.UnsGateway/Publish',
39
+ request_serializer=uns__gateway__pb2.PublishRequest.SerializeToString,
40
+ response_deserializer=uns__gateway__pb2.Ack.FromString,
41
+ _registered_method=True)
42
+ self.Subscribe = channel.unary_stream(
43
+ '/uns.UnsGateway/Subscribe',
44
+ request_serializer=uns__gateway__pb2.SubscribeRequest.SerializeToString,
45
+ response_deserializer=uns__gateway__pb2.MqttMessage.FromString,
46
+ _registered_method=True)
47
+ self.RegisterApiGet = channel.unary_unary(
48
+ '/uns.UnsGateway/RegisterApiGet',
49
+ request_serializer=uns__gateway__pb2.RegisterApiGetRequest.SerializeToString,
50
+ response_deserializer=uns__gateway__pb2.Ack.FromString,
51
+ _registered_method=True)
52
+ self.UnregisterApiGet = channel.unary_unary(
53
+ '/uns.UnsGateway/UnregisterApiGet',
54
+ request_serializer=uns__gateway__pb2.UnregisterApiGetRequest.SerializeToString,
55
+ response_deserializer=uns__gateway__pb2.Ack.FromString,
56
+ _registered_method=True)
57
+ self.ApiEventStream = channel.stream_stream(
58
+ '/uns.UnsGateway/ApiEventStream',
59
+ request_serializer=uns__gateway__pb2.ApiEventResponse.SerializeToString,
60
+ response_deserializer=uns__gateway__pb2.ApiEvent.FromString,
61
+ _registered_method=True)
62
+ self.Ready = channel.unary_unary(
63
+ '/uns.UnsGateway/Ready',
64
+ request_serializer=uns__gateway__pb2.ReadyRequest.SerializeToString,
65
+ response_deserializer=uns__gateway__pb2.Ack.FromString,
66
+ _registered_method=True)
67
+
68
+
69
+ class UnsGatewayServicer(object):
70
+ """Missing associated documentation comment in .proto file."""
71
+
72
+ def Publish(self, request, context):
73
+ """Missing associated documentation comment in .proto file."""
74
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
75
+ context.set_details('Method not implemented!')
76
+ raise NotImplementedError('Method not implemented!')
77
+
78
+ def Subscribe(self, request, context):
79
+ """Missing associated documentation comment in .proto file."""
80
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
81
+ context.set_details('Method not implemented!')
82
+ raise NotImplementedError('Method not implemented!')
83
+
84
+ def RegisterApiGet(self, request, context):
85
+ """Missing associated documentation comment in .proto file."""
86
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
87
+ context.set_details('Method not implemented!')
88
+ raise NotImplementedError('Method not implemented!')
89
+
90
+ def UnregisterApiGet(self, request, context):
91
+ """Missing associated documentation comment in .proto file."""
92
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
93
+ context.set_details('Method not implemented!')
94
+ raise NotImplementedError('Method not implemented!')
95
+
96
+ def ApiEventStream(self, request_iterator, context):
97
+ """Missing associated documentation comment in .proto file."""
98
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
99
+ context.set_details('Method not implemented!')
100
+ raise NotImplementedError('Method not implemented!')
101
+
102
+ def Ready(self, request, context):
103
+ """Missing associated documentation comment in .proto file."""
104
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
105
+ context.set_details('Method not implemented!')
106
+ raise NotImplementedError('Method not implemented!')
107
+
108
+
109
+ def add_UnsGatewayServicer_to_server(servicer, server):
110
+ rpc_method_handlers = {
111
+ 'Publish': grpc.unary_unary_rpc_method_handler(
112
+ servicer.Publish,
113
+ request_deserializer=uns__gateway__pb2.PublishRequest.FromString,
114
+ response_serializer=uns__gateway__pb2.Ack.SerializeToString,
115
+ ),
116
+ 'Subscribe': grpc.unary_stream_rpc_method_handler(
117
+ servicer.Subscribe,
118
+ request_deserializer=uns__gateway__pb2.SubscribeRequest.FromString,
119
+ response_serializer=uns__gateway__pb2.MqttMessage.SerializeToString,
120
+ ),
121
+ 'RegisterApiGet': grpc.unary_unary_rpc_method_handler(
122
+ servicer.RegisterApiGet,
123
+ request_deserializer=uns__gateway__pb2.RegisterApiGetRequest.FromString,
124
+ response_serializer=uns__gateway__pb2.Ack.SerializeToString,
125
+ ),
126
+ 'UnregisterApiGet': grpc.unary_unary_rpc_method_handler(
127
+ servicer.UnregisterApiGet,
128
+ request_deserializer=uns__gateway__pb2.UnregisterApiGetRequest.FromString,
129
+ response_serializer=uns__gateway__pb2.Ack.SerializeToString,
130
+ ),
131
+ 'ApiEventStream': grpc.stream_stream_rpc_method_handler(
132
+ servicer.ApiEventStream,
133
+ request_deserializer=uns__gateway__pb2.ApiEventResponse.FromString,
134
+ response_serializer=uns__gateway__pb2.ApiEvent.SerializeToString,
135
+ ),
136
+ 'Ready': grpc.unary_unary_rpc_method_handler(
137
+ servicer.Ready,
138
+ request_deserializer=uns__gateway__pb2.ReadyRequest.FromString,
139
+ response_serializer=uns__gateway__pb2.Ack.SerializeToString,
140
+ ),
141
+ }
142
+ generic_handler = grpc.method_handlers_generic_handler(
143
+ 'uns.UnsGateway', rpc_method_handlers)
144
+ server.add_generic_rpc_handlers((generic_handler,))
145
+ server.add_registered_method_handlers('uns.UnsGateway', rpc_method_handlers)
146
+
147
+
148
+ # This class is part of an EXPERIMENTAL API.
149
+ class UnsGateway(object):
150
+ """Missing associated documentation comment in .proto file."""
151
+
152
+ @staticmethod
153
+ def Publish(request,
154
+ target,
155
+ options=(),
156
+ channel_credentials=None,
157
+ call_credentials=None,
158
+ insecure=False,
159
+ compression=None,
160
+ wait_for_ready=None,
161
+ timeout=None,
162
+ metadata=None):
163
+ return grpc.experimental.unary_unary(
164
+ request,
165
+ target,
166
+ '/uns.UnsGateway/Publish',
167
+ uns__gateway__pb2.PublishRequest.SerializeToString,
168
+ uns__gateway__pb2.Ack.FromString,
169
+ options,
170
+ channel_credentials,
171
+ insecure,
172
+ call_credentials,
173
+ compression,
174
+ wait_for_ready,
175
+ timeout,
176
+ metadata,
177
+ _registered_method=True)
178
+
179
+ @staticmethod
180
+ def Subscribe(request,
181
+ target,
182
+ options=(),
183
+ channel_credentials=None,
184
+ call_credentials=None,
185
+ insecure=False,
186
+ compression=None,
187
+ wait_for_ready=None,
188
+ timeout=None,
189
+ metadata=None):
190
+ return grpc.experimental.unary_stream(
191
+ request,
192
+ target,
193
+ '/uns.UnsGateway/Subscribe',
194
+ uns__gateway__pb2.SubscribeRequest.SerializeToString,
195
+ uns__gateway__pb2.MqttMessage.FromString,
196
+ options,
197
+ channel_credentials,
198
+ insecure,
199
+ call_credentials,
200
+ compression,
201
+ wait_for_ready,
202
+ timeout,
203
+ metadata,
204
+ _registered_method=True)
205
+
206
+ @staticmethod
207
+ def RegisterApiGet(request,
208
+ target,
209
+ options=(),
210
+ channel_credentials=None,
211
+ call_credentials=None,
212
+ insecure=False,
213
+ compression=None,
214
+ wait_for_ready=None,
215
+ timeout=None,
216
+ metadata=None):
217
+ return grpc.experimental.unary_unary(
218
+ request,
219
+ target,
220
+ '/uns.UnsGateway/RegisterApiGet',
221
+ uns__gateway__pb2.RegisterApiGetRequest.SerializeToString,
222
+ uns__gateway__pb2.Ack.FromString,
223
+ options,
224
+ channel_credentials,
225
+ insecure,
226
+ call_credentials,
227
+ compression,
228
+ wait_for_ready,
229
+ timeout,
230
+ metadata,
231
+ _registered_method=True)
232
+
233
+ @staticmethod
234
+ def UnregisterApiGet(request,
235
+ target,
236
+ options=(),
237
+ channel_credentials=None,
238
+ call_credentials=None,
239
+ insecure=False,
240
+ compression=None,
241
+ wait_for_ready=None,
242
+ timeout=None,
243
+ metadata=None):
244
+ return grpc.experimental.unary_unary(
245
+ request,
246
+ target,
247
+ '/uns.UnsGateway/UnregisterApiGet',
248
+ uns__gateway__pb2.UnregisterApiGetRequest.SerializeToString,
249
+ uns__gateway__pb2.Ack.FromString,
250
+ options,
251
+ channel_credentials,
252
+ insecure,
253
+ call_credentials,
254
+ compression,
255
+ wait_for_ready,
256
+ timeout,
257
+ metadata,
258
+ _registered_method=True)
259
+
260
+ @staticmethod
261
+ def ApiEventStream(request_iterator,
262
+ target,
263
+ options=(),
264
+ channel_credentials=None,
265
+ call_credentials=None,
266
+ insecure=False,
267
+ compression=None,
268
+ wait_for_ready=None,
269
+ timeout=None,
270
+ metadata=None):
271
+ return grpc.experimental.stream_stream(
272
+ request_iterator,
273
+ target,
274
+ '/uns.UnsGateway/ApiEventStream',
275
+ uns__gateway__pb2.ApiEventResponse.SerializeToString,
276
+ uns__gateway__pb2.ApiEvent.FromString,
277
+ options,
278
+ channel_credentials,
279
+ insecure,
280
+ call_credentials,
281
+ compression,
282
+ wait_for_ready,
283
+ timeout,
284
+ metadata,
285
+ _registered_method=True)
286
+
287
+ @staticmethod
288
+ def Ready(request,
289
+ target,
290
+ options=(),
291
+ channel_credentials=None,
292
+ call_credentials=None,
293
+ insecure=False,
294
+ compression=None,
295
+ wait_for_ready=None,
296
+ timeout=None,
297
+ metadata=None):
298
+ return grpc.experimental.unary_unary(
299
+ request,
300
+ target,
301
+ '/uns.UnsGateway/Ready',
302
+ uns__gateway__pb2.ReadyRequest.SerializeToString,
303
+ uns__gateway__pb2.Ack.FromString,
304
+ options,
305
+ channel_credentials,
306
+ insecure,
307
+ call_credentials,
308
+ compression,
309
+ wait_for_ready,
310
+ timeout,
311
+ metadata,
312
+ _registered_method=True)
@@ -1,47 +1,47 @@
1
- # Python bytecode
2
- __pycache__/
3
- *.py[cod]
4
- *$py.class
5
-
6
- # Virtual environments
7
- .venv/
8
- venv/
9
- env/
10
- ENV/
11
- .venv*/
12
-
13
- # Packaging / build artifacts
14
- build/
15
- dist/
16
- .eggs/
17
- *.egg-info/
18
- *.egg
19
- pip-wheel-metadata/
20
- .wheels/
21
-
22
- # Tests / coverage
23
- .pytest_cache/
24
- .coverage*
25
- htmlcov/
26
- .hypothesis/
27
-
28
- # Tool caches
29
- .mypy_cache/
30
- .ruff_cache/
31
-
32
- # Logs
33
- *.log
34
-
35
- # Editor / OS
36
- .idea/
37
- .vscode/
38
- .DS_Store
39
- Thumbs.db
40
- *.swp
41
-
42
- # Local configuration
43
- config.json
44
- config-*.json
45
-
46
- # Temp
47
- /tmp/
1
+ # Python bytecode
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Virtual environments
7
+ .venv/
8
+ venv/
9
+ env/
10
+ ENV/
11
+ .venv*/
12
+
13
+ # Packaging / build artifacts
14
+ build/
15
+ dist/
16
+ .eggs/
17
+ *.egg-info/
18
+ *.egg
19
+ pip-wheel-metadata/
20
+ .wheels/
21
+
22
+ # Tests / coverage
23
+ .pytest_cache/
24
+ .coverage*
25
+ htmlcov/
26
+ .hypothesis/
27
+
28
+ # Tool caches
29
+ .mypy_cache/
30
+ .ruff_cache/
31
+
32
+ # Logs
33
+ *.log
34
+
35
+ # Editor / OS
36
+ .idea/
37
+ .vscode/
38
+ .DS_Store
39
+ Thumbs.db
40
+ *.swp
41
+
42
+ # Local configuration
43
+ config.json
44
+ config-*.json
45
+
46
+ # Temp
47
+ /tmp/
@@ -1,102 +1,102 @@
1
- syntax = "proto3";
2
-
3
- package uns;
4
-
5
- service UnsGateway {
6
- rpc Publish (PublishRequest) returns (Ack);
7
- rpc Subscribe (SubscribeRequest) returns (stream MqttMessage);
8
- rpc RegisterApiGet (RegisterApiGetRequest) returns (Ack);
9
- rpc UnregisterApiGet (UnregisterApiGetRequest) returns (Ack);
10
- rpc ApiEventStream (stream ApiEventResponse) returns (stream ApiEvent);
11
- rpc Ready (ReadyRequest) returns (Ack);
12
- }
13
-
14
- message PublishRequest {
15
- string topic = 1;
16
- string attribute = 2;
17
- string description = 3;
18
- repeated string tags = 4;
19
- bool attribute_needs_persistence = 5;
20
- oneof content {
21
- Data data = 6;
22
- Table table = 7;
23
- }
24
- bool value_is_cumulative = 8; // for Data: publish as delta
25
- }
26
-
27
- message Data {
28
- string time = 1;
29
- double value_number = 2;
30
- string value_string = 3;
31
- string uom = 4;
32
- string data_group = 5;
33
- string foreign_event_key = 6;
34
- }
35
-
36
- message TableValue {
37
- string key = 1;
38
- double value_number = 2;
39
- string value_string = 3;
40
- }
41
-
42
- message Table {
43
- string time = 1;
44
- repeated TableValue values = 2;
45
- string data_group = 3;
46
- }
47
-
48
- message SubscribeRequest {
49
- repeated string topics = 1;
50
- }
51
-
52
- message MqttMessage {
53
- string topic = 1;
54
- string payload = 2; // UNS packet JSON
55
- }
56
-
57
- message Ack {
58
- bool ok = 1;
59
- string error = 2;
60
- }
61
-
62
- message ReadyRequest {
63
- int32 timeout_ms = 1; // default 15000
64
- bool wait_output = 2; // wait for publisher active (output)
65
- bool wait_input = 3; // wait for subscriber active (input)
66
- bool wait_api = 4; // wait for API server (optional)
67
- }
68
-
69
- message ApiQueryParam {
70
- string name = 1;
71
- string type = 2; // string | number | boolean
72
- bool required = 3;
73
- string description = 4;
74
- }
75
-
76
- message RegisterApiGetRequest {
77
- string topic = 1;
78
- string attribute = 2;
79
- string api_description = 3;
80
- repeated string tags = 4;
81
- repeated ApiQueryParam query_params = 5;
82
- }
83
-
84
- message UnregisterApiGetRequest {
85
- string topic = 1;
86
- string attribute = 2;
87
- }
88
-
89
- message ApiEvent {
90
- string id = 1;
91
- string method = 2; // GET only for now
92
- string path = 3; // /{topic}{attribute}
93
- map<string, string> query = 4;
94
- string bearer = 5; // access token (optional)
95
- }
96
-
97
- message ApiEventResponse {
98
- string id = 1; // correlation
99
- int32 status = 2; // HTTP status
100
- string body = 3; // response body as string (JSON string if needed)
101
- map<string, string> headers = 4; // optional extra headers
102
- }
1
+ syntax = "proto3";
2
+
3
+ package uns;
4
+
5
+ service UnsGateway {
6
+ rpc Publish (PublishRequest) returns (Ack);
7
+ rpc Subscribe (SubscribeRequest) returns (stream MqttMessage);
8
+ rpc RegisterApiGet (RegisterApiGetRequest) returns (Ack);
9
+ rpc UnregisterApiGet (UnregisterApiGetRequest) returns (Ack);
10
+ rpc ApiEventStream (stream ApiEventResponse) returns (stream ApiEvent);
11
+ rpc Ready (ReadyRequest) returns (Ack);
12
+ }
13
+
14
+ message PublishRequest {
15
+ string topic = 1;
16
+ string attribute = 2;
17
+ string description = 3;
18
+ repeated string tags = 4;
19
+ bool attribute_needs_persistence = 5;
20
+ oneof content {
21
+ Data data = 6;
22
+ Table table = 7;
23
+ }
24
+ bool value_is_cumulative = 8; // for Data: publish as delta
25
+ }
26
+
27
+ message Data {
28
+ string time = 1;
29
+ double value_number = 2;
30
+ string value_string = 3;
31
+ string uom = 4;
32
+ string data_group = 5;
33
+ string foreign_event_key = 6;
34
+ }
35
+
36
+ message TableValue {
37
+ string key = 1;
38
+ double value_number = 2;
39
+ string value_string = 3;
40
+ }
41
+
42
+ message Table {
43
+ string time = 1;
44
+ repeated TableValue values = 2;
45
+ string data_group = 3;
46
+ }
47
+
48
+ message SubscribeRequest {
49
+ repeated string topics = 1;
50
+ }
51
+
52
+ message MqttMessage {
53
+ string topic = 1;
54
+ string payload = 2; // UNS packet JSON
55
+ }
56
+
57
+ message Ack {
58
+ bool ok = 1;
59
+ string error = 2;
60
+ }
61
+
62
+ message ReadyRequest {
63
+ int32 timeout_ms = 1; // default 15000
64
+ bool wait_output = 2; // wait for publisher active (output)
65
+ bool wait_input = 3; // wait for subscriber active (input)
66
+ bool wait_api = 4; // wait for API server (optional)
67
+ }
68
+
69
+ message ApiQueryParam {
70
+ string name = 1;
71
+ string type = 2; // string | number | boolean
72
+ bool required = 3;
73
+ string description = 4;
74
+ }
75
+
76
+ message RegisterApiGetRequest {
77
+ string topic = 1;
78
+ string attribute = 2;
79
+ string api_description = 3;
80
+ repeated string tags = 4;
81
+ repeated ApiQueryParam query_params = 5;
82
+ }
83
+
84
+ message UnregisterApiGetRequest {
85
+ string topic = 1;
86
+ string attribute = 2;
87
+ }
88
+
89
+ message ApiEvent {
90
+ string id = 1;
91
+ string method = 2; // GET only for now
92
+ string path = 3; // /{topic}{attribute}
93
+ map<string, string> query = 4;
94
+ string bearer = 5; // access token (optional)
95
+ }
96
+
97
+ message ApiEventResponse {
98
+ string id = 1; // correlation
99
+ int32 status = 2; // HTTP status
100
+ string body = 3; // response body as string (JSON string if needed)
101
+ map<string, string> headers = 4; // optional extra headers
102
+ }