@kusinta/iot-schema 0.2.0-beta.22 → 0.2.0-beta.23

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": "@kusinta/iot-schema",
3
- "version": "0.2.0-beta.22",
3
+ "version": "0.2.0-beta.23",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": ["src"],
@@ -36,6 +36,37 @@ export declare type ErrorDetail = Message<"kusinta.iot.common.v1.ErrorDetail"> &
36
36
  */
37
37
  export declare const ErrorDetailSchema: GenMessage<ErrorDetail>;
38
38
 
39
+ /**
40
+ * A connector's backend health, as both legs carry it: connector to gateway inside
41
+ * connector.v1.BackendHealthReport, and gateway to app on webrtc.v1.ConnectorDescriptor.
42
+ *
43
+ * Deliberately state and category only. A connector's free-text detail travels beside this,
44
+ * on the connector leg alone, and is for the gateway's logs: it may name hosts, addresses or
45
+ * accounts, and it never reaches the app or the cloud. Carrying only this type on the app
46
+ * leg is what keeps it there.
47
+ *
48
+ * @generated from message kusinta.iot.common.v1.BackendHealth
49
+ */
50
+ export declare type BackendHealth = Message<"kusinta.iot.common.v1.BackendHealth"> & {
51
+ /**
52
+ * @generated from field: kusinta.iot.common.v1.BackendHealthState state = 1;
53
+ */
54
+ state: BackendHealthState;
55
+
56
+ /**
57
+ * Why, when state is FAILING. UNSPECIFIED otherwise, and ignored when state is not FAILING.
58
+ *
59
+ * @generated from field: kusinta.iot.common.v1.BackendFailureReason reason = 2;
60
+ */
61
+ reason: BackendFailureReason;
62
+ };
63
+
64
+ /**
65
+ * Describes the message kusinta.iot.common.v1.BackendHealth.
66
+ * Use `create(BackendHealthSchema)` to create a new message.
67
+ */
68
+ export declare const BackendHealthSchema: GenMessage<BackendHealth>;
69
+
39
70
  /**
40
71
  * @generated from enum kusinta.iot.common.v1.SpaceType
41
72
  */
@@ -195,3 +226,113 @@ export enum ConnectorKind {
195
226
  */
196
227
  export declare const ConnectorKindSchema: GenEnum<ConnectorKind>;
197
228
 
229
+ /**
230
+ * Whether the backend a connector drives is working: the radio central, the network server,
231
+ * whatever the connector talks to on the far side from the gateway. Distinct from whether
232
+ * the connector itself is connected — that is the gateway↔connector stream, and a connector
233
+ * whose stream is down states nothing at all.
234
+ *
235
+ * Open, like every proto3 enum: a reader given a value its schema predates holds the number.
236
+ * Every reader treats anything but FAILING as healthy, so a state added later must be one an
237
+ * older reader may safely take for OK. A new way of failing is a new BackendFailureReason
238
+ * under FAILING, never a new state.
239
+ *
240
+ * @generated from enum kusinta.iot.common.v1.BackendHealthState
241
+ */
242
+ export enum BackendHealthState {
243
+ /**
244
+ * No statement. Read as OK: a connector that predates backend health, or one whose backend
245
+ * is still in doubt as it handshakes (see connector.v1.BackendHealthReport), has said
246
+ * nothing is wrong.
247
+ *
248
+ * @generated from enum value: BACKEND_HEALTH_STATE_UNSPECIFIED = 0;
249
+ */
250
+ UNSPECIFIED = 0,
251
+
252
+ /**
253
+ * The backend is reachable and answering.
254
+ *
255
+ * @generated from enum value: BACKEND_HEALTH_STATE_OK = 1;
256
+ */
257
+ OK = 1,
258
+
259
+ /**
260
+ * The backend is failing, and not for a single dropped call: it has been in doubt for 60
261
+ * seconds within the last 120 (see connector.v1.BackendHealthReport), or the connector's own
262
+ * retries are used up, or a requested re-initialisation
263
+ * left it failing (see connector.v1.BackendHealthReport). The connector stays connected to
264
+ * the gateway.
265
+ *
266
+ * @generated from enum value: BACKEND_HEALTH_STATE_FAILING = 2;
267
+ */
268
+ FAILING = 2,
269
+ }
270
+
271
+ /**
272
+ * Describes the enum kusinta.iot.common.v1.BackendHealthState.
273
+ */
274
+ export declare const BackendHealthStateSchema: GenEnum<BackendHealthState>;
275
+
276
+ /**
277
+ * Why a backend is failing, or why a re-initialisation could not be attempted. Coarse on
278
+ * purpose: each value answers "what should someone do now?", and the specifics belong in a
279
+ * connector's log-only detail, never here.
280
+ *
281
+ * Shared rather than mirrored, for the reason PairingError gives: the connector produces it
282
+ * and the gateway passes it through unchanged.
283
+ *
284
+ * @generated from enum kusinta.iot.common.v1.BackendFailureReason
285
+ */
286
+ export enum BackendFailureReason {
287
+ /**
288
+ * Not stated, or a value this reader's schema does not know. Read as BACKEND_ERROR.
289
+ *
290
+ * @generated from enum value: BACKEND_FAILURE_REASON_UNSPECIFIED = 0;
291
+ */
292
+ UNSPECIFIED = 0,
293
+
294
+ /**
295
+ * The backend cannot be reached: no route, connection refused, no answer. Often a power or
296
+ * network fault at the backend's side; a re-initialisation may help once that is fixed.
297
+ *
298
+ * @generated from enum value: BACKEND_FAILURE_REASON_UNREACHABLE = 1;
299
+ */
300
+ UNREACHABLE = 1,
301
+
302
+ /**
303
+ * The backend answered and refused the connector's credentials. Retrying the same
304
+ * credentials will not help; someone must change them.
305
+ *
306
+ * @generated from enum value: BACKEND_FAILURE_REASON_AUTH_FAILED = 2;
307
+ */
308
+ AUTH_FAILED = 2,
309
+
310
+ /**
311
+ * The backend is reached and authenticated, but answers with errors or not as the connector
312
+ * expects: a fault on the backend's side, or a version the connector does not understand.
313
+ *
314
+ * @generated from enum value: BACKEND_FAILURE_REASON_BACKEND_ERROR = 3;
315
+ */
316
+ BACKEND_ERROR = 3,
317
+
318
+ /**
319
+ * The connector lacks what it needs to reach the backend at all: an address, credentials.
320
+ * Needs an installer, not a retry.
321
+ *
322
+ * @generated from enum value: BACKEND_FAILURE_REASON_MISCONFIGURED = 4;
323
+ */
324
+ MISCONFIGURED = 4,
325
+
326
+ /**
327
+ * A fault in the connector itself, not in the backend.
328
+ *
329
+ * @generated from enum value: BACKEND_FAILURE_REASON_INTERNAL = 5;
330
+ */
331
+ INTERNAL = 5,
332
+ }
333
+
334
+ /**
335
+ * Describes the enum kusinta.iot.common.v1.BackendFailureReason.
336
+ */
337
+ export declare const BackendFailureReasonSchema: GenEnum<BackendFailureReason>;
338
+
@@ -8,7 +8,7 @@ import { enumDesc, fileDesc, messageDesc, tsEnum } from "@bufbuild/protobuf/code
8
8
  * Describes the file kusinta/iot/common/v1/types.proto.
9
9
  */
10
10
  export const file_kusinta_iot_common_v1_types = /*@__PURE__*/
11
- fileDesc("CiFrdXNpbnRhL2lvdC9jb21tb24vdjEvdHlwZXMucHJvdG8SFWt1c2ludGEuaW90LmNvbW1vbi52MSKhAQoLRXJyb3JEZXRhaWwSDAoEY29kZRgBIAEoCRIPCgdtZXNzYWdlGAIgASgJEkIKCG1ldGFkYXRhGAMgAygLMjAua3VzaW50YS5pb3QuY29tbW9uLnYxLkVycm9yRGV0YWlsLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBKqEBCglTcGFjZVR5cGUSGgoWU1BBQ0VfVFlQRV9VTlNQRUNJRklFRBAAEhcKE1NQQUNFX1RZUEVfQlVJTERJTkcQARIUChBTUEFDRV9UWVBFX0ZMT09SEAISGAoUU1BBQ0VfVFlQRV9BUEFSVE1FTlQQAxITCg9TUEFDRV9UWVBFX1JPT00QBBIaChZTUEFDRV9UWVBFX0NPTU1PTl9BUkVBEAUqgwEKE0RldmljZU93bmVyc2hpcFR5cGUSJQohREVWSUNFX09XTkVSU0hJUF9UWVBFX1VOU1BFQ0lGSUVEEAASIQodREVWSUNFX09XTkVSU0hJUF9UWVBFX0NPTVBBTlkQARIiCh5ERVZJQ0VfT1dORVJTSElQX1RZUEVfUkVTSURFTlQQAirhAQoURGV2aWNlTGlmZWN5Y2xlU3RhdGUSJgoiREVWSUNFX0xJRkVDWUNMRV9TVEFURV9VTlNQRUNJRklFRBAAEigKJERFVklDRV9MSUZFQ1lDTEVfU1RBVEVfUEVORElOR19DTEFJTRABEiAKHERFVklDRV9MSUZFQ1lDTEVfU1RBVEVfT1dORUQQAhIrCidERVZJQ0VfTElGRUNZQ0xFX1NUQVRFX1BFTkRJTkdfVFJBTlNGRVIQAxIoCiRERVZJQ0VfTElGRUNZQ0xFX1NUQVRFX0JVSUxESU5H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5SRUFDSEFCTEUQARImCiJCQUNLRU5EX0ZBSUxVUkVfUkVBU09OX0FVVEhfRkFJTEVEEAISKAokQkFDS0VORF9GQUlMVVJFX1JFQVNPTl9CQUNLRU5EX0VSUk9SEAMSKAokQkFDS0VORF9GQUlMVVJFX1JFQVNPTl9NSVNDT05GSUdVUkVEEAQSIwofQkFDS0VORF9GQUlMVVJFX1JFQVNPTl9JTlRFUk5BTBAFQgJIAWIGcHJvdG8z");
12
12
 
13
13
  /**
14
14
  * Describes the message kusinta.iot.common.v1.ErrorDetail.
@@ -17,6 +17,13 @@ export const file_kusinta_iot_common_v1_types = /*@__PURE__*/
17
17
  export const ErrorDetailSchema = /*@__PURE__*/
18
18
  messageDesc(file_kusinta_iot_common_v1_types, 0);
19
19
 
20
+ /**
21
+ * Describes the message kusinta.iot.common.v1.BackendHealth.
22
+ * Use `create(BackendHealthSchema)` to create a new message.
23
+ */
24
+ export const BackendHealthSchema = /*@__PURE__*/
25
+ messageDesc(file_kusinta_iot_common_v1_types, 1);
26
+
20
27
  /**
21
28
  * Describes the enum kusinta.iot.common.v1.SpaceType.
22
29
  */
@@ -86,3 +93,44 @@ export const ConnectorKindSchema = /*@__PURE__*/
86
93
  export const ConnectorKind = /*@__PURE__*/
87
94
  tsEnum(ConnectorKindSchema);
88
95
 
96
+ /**
97
+ * Describes the enum kusinta.iot.common.v1.BackendHealthState.
98
+ */
99
+ export const BackendHealthStateSchema = /*@__PURE__*/
100
+ enumDesc(file_kusinta_iot_common_v1_types, 5);
101
+
102
+ /**
103
+ * Whether the backend a connector drives is working: the radio central, the network server,
104
+ * whatever the connector talks to on the far side from the gateway. Distinct from whether
105
+ * the connector itself is connected — that is the gateway↔connector stream, and a connector
106
+ * whose stream is down states nothing at all.
107
+ *
108
+ * Open, like every proto3 enum: a reader given a value its schema predates holds the number.
109
+ * Every reader treats anything but FAILING as healthy, so a state added later must be one an
110
+ * older reader may safely take for OK. A new way of failing is a new BackendFailureReason
111
+ * under FAILING, never a new state.
112
+ *
113
+ * @generated from enum kusinta.iot.common.v1.BackendHealthState
114
+ */
115
+ export const BackendHealthState = /*@__PURE__*/
116
+ tsEnum(BackendHealthStateSchema);
117
+
118
+ /**
119
+ * Describes the enum kusinta.iot.common.v1.BackendFailureReason.
120
+ */
121
+ export const BackendFailureReasonSchema = /*@__PURE__*/
122
+ enumDesc(file_kusinta_iot_common_v1_types, 6);
123
+
124
+ /**
125
+ * Why a backend is failing, or why a re-initialisation could not be attempted. Coarse on
126
+ * purpose: each value answers "what should someone do now?", and the specifics belong in a
127
+ * connector's log-only detail, never here.
128
+ *
129
+ * Shared rather than mirrored, for the reason PairingError gives: the connector produces it
130
+ * and the gateway passes it through unchanged.
131
+ *
132
+ * @generated from enum kusinta.iot.common.v1.BackendFailureReason
133
+ */
134
+ export const BackendFailureReason = /*@__PURE__*/
135
+ tsEnum(BackendFailureReasonSchema);
136
+
@@ -2,10 +2,10 @@
2
2
  // @generated from file kusinta/iot/connector/v1/connector.proto (package kusinta.iot.connector.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
5
- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
5
+ import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
6
6
  import type { Message } from "@bufbuild/protobuf";
7
7
  import type { ConnectorId, DeviceId, GatewayId } from "../../identity/v1/identity_pb.js";
8
- import type { ConnectorKind, ConnectorTransport } from "../../common/v1/types_pb.js";
8
+ import type { BackendFailureReason, BackendHealth, ConnectorKind, ConnectorTransport } from "../../common/v1/types_pb.js";
9
9
  import type { Device } from "../../device/v1/device_pb.js";
10
10
  import type { DeviceLink, LinkFunction, LinkState } from "../../link/v1/link_pb.js";
11
11
  import type { Timestamp } from "@bufbuild/protobuf/wkt";
@@ -106,6 +106,17 @@ export declare type ConnectorInfo = Message<"kusinta.iot.connector.v1.ConnectorI
106
106
  * @generated from field: string description = 11;
107
107
  */
108
108
  description: string;
109
+
110
+ /**
111
+ * The connector answers ReinitializeBackend: it can drop and re-establish its connection
112
+ * to its backend on request. The gateway sends ReinitializeBackend only to a connector
113
+ * that declares this, and refuses a reconnect for any other without asking it — a
114
+ * connector whose schema predates the message would ignore it, and the gateway would wait
115
+ * out its deadline for nothing.
116
+ *
117
+ * @generated from field: bool supports_backend_reinitialize = 12;
118
+ */
119
+ supportsBackendReinitialize: boolean;
109
120
  };
110
121
 
111
122
  /**
@@ -143,6 +154,34 @@ export declare type ConnectorHandshake = Message<"kusinta.iot.connector.v1.Conne
143
154
  * @generated from field: repeated kusinta.iot.link.v1.DeviceLink known_links = 3;
144
155
  */
145
156
  knownLinks: DeviceLink[];
157
+
158
+ /**
159
+ * The backend's health as the connector handshakes, so the gateway starts every session
160
+ * from the current state rather than from whatever it held before the stream dropped.
161
+ * From then on, changes arrive as BackendHealthReport on the session.
162
+ *
163
+ * Unset states nothing, and the gateway reads it as OK: a connector that predates backend
164
+ * health never sends it, and is never taken to be failing. A connector whose backend has
165
+ * not answered a call since it connected to the gateway — its backend is still in
166
+ * doubt — leaves it unset, or states FAILING only where BackendHealthReport's rules for
167
+ * FAILING already hold; never OK.
168
+ *
169
+ * After connecting to a gateway that sets HandshakeAck.supports_backend_health, a
170
+ * connector that reports backend health follows the rules on BackendHealthReport: its
171
+ * backend is in doubt from connecting to the gateway until it first answers, so the
172
+ * connector states OK (once it has answered) or FAILING within 60 seconds, here or in a
173
+ * BackendHealthReport, reports none of its devices as unreachable while its backend is in
174
+ * doubt, and re-reports them once it is not, as BackendHealthReport says. Toward a gateway
175
+ * that does not set it, none of those rules applies: the connector reports its devices as
176
+ * it did before backend health existed.
177
+ *
178
+ * Safe to set whatever the gateway: the handshake goes before the connector knows which
179
+ * gateway it reached, and a gateway that predates backend health skips the field as
180
+ * unknown. Everything after the handshake waits for HandshakeAck.supports_backend_health.
181
+ *
182
+ * @generated from field: kusinta.iot.connector.v1.BackendHealthReport backend_health = 4;
183
+ */
184
+ backendHealth?: BackendHealthReport | undefined;
146
185
  };
147
186
 
148
187
  /**
@@ -151,6 +190,162 @@ export declare type ConnectorHandshake = Message<"kusinta.iot.connector.v1.Conne
151
190
  */
152
191
  export declare const ConnectorHandshakeSchema: GenMessage<ConnectorHandshake>;
153
192
 
193
+ /**
194
+ * The health of the backend the connector drives, connector to gateway: whether the radio
195
+ * central or network server behind it is working. See common.v1.BackendHealth.
196
+ *
197
+ * Sent on the session only to a gateway that sets HandshakeAck.supports_backend_health; the
198
+ * handshake's ConnectorHandshake.backend_health is set whatever the gateway, since the ack is
199
+ * not yet known. To a gateway that does not set it — one that predates backend health — the
200
+ * connector sends neither this on the session nor
201
+ * ReinitializeBackendResult, and keeps working as it did before: its backend failing is
202
+ * then only in its own logs.
203
+ *
204
+ * Sent in the handshake (ConnectorHandshake.backend_health), then whenever state or reason
205
+ * changes, and once after every requested re-initialisation (ReinitializeBackend) it
206
+ * attempts, changed or not, before the
207
+ * result that answers it. Not sent for a change of detail alone. Each report replaces the
208
+ * last.
209
+ *
210
+ * The connector's backend is in doubt from when the connector connects to the gateway (each
211
+ * session, whether or not the backend kept answering meanwhile), from any failed call
212
+ * to the backend, and from a re-initialisation the connector attempts, until the backend
213
+ * answers a call again; OK
214
+ * is stated only once it has. While it is in doubt the
215
+ * connector reports none of its devices as unreachable, by whatever its technology uses to
216
+ * say so: a device it cannot reach then may be the backend's fault. The gateway applies no
217
+ * debounce of its own, so the connector never reports FAILING for a single failed call: it
218
+ * reports FAILING once its backend has been in doubt for 60 seconds in all within the last
219
+ * 120 — so a backend that hangs, or answers only now and then, reaches it, and brief failures
220
+ * between answers do not — or sooner when its own
221
+ * retries are used up, with the reason of its latest failed call, or UNREACHABLE when none
222
+ * has failed yet. After a ReinitializeBackend it reports the attempt's true outcome at once,
223
+ * FAILING included, or OK, before the result: the request is the retry a person asked for.
224
+ * A backend outage the connector rides out within 60 seconds opens no problem, and what the
225
+ * backend then says of its devices is reported as it is.
226
+ *
227
+ * When its backend stops being in doubt, whatever started it, the connector reports, within
228
+ * 30 seconds, the current reachability of every device it knows, reachable ones included. If
229
+ * doubt comes back before it is done, it still reports the devices it knows to be reachable,
230
+ * and the rest once the doubt ends. The gateway closes
231
+ * a device's offline problem as recovered only on a report that the device is reachable —
232
+ * this one or any later one — never on silence; it closes for other reasons as reporting.v1
233
+ * says.
234
+ *
235
+ * The gateway raises reporting.v1.PROBLEM_KIND_CONNECTOR_ERROR for this connector while its
236
+ * stream is up and the latest report is FAILING, and clears it when one is anything else; a
237
+ * stream that drops closes it too, and the next handshake decides afresh (see reporting.v1).
238
+ * A connector that never sends one is OK throughout. CONNECTOR_OFFLINE is the other problem
239
+ * and is not this one: that is the stream to the gateway down, this is the stream up and
240
+ * the backend failing.
241
+ *
242
+ * @generated from message kusinta.iot.connector.v1.BackendHealthReport
243
+ */
244
+ export declare type BackendHealthReport = Message<"kusinta.iot.connector.v1.BackendHealthReport"> & {
245
+ /**
246
+ * @generated from field: kusinta.iot.common.v1.BackendHealth health = 1;
247
+ */
248
+ health?: BackendHealth | undefined;
249
+
250
+ /**
251
+ * What went wrong, in the connector's words — an error message, the host it could not
252
+ * reach. For the gateway's logs only. The gateway never forwards it: not to the app, not
253
+ * to the cloud, not into a problem report. Empty when there is nothing to add.
254
+ *
255
+ * @generated from field: string detail = 2;
256
+ */
257
+ detail: string;
258
+ };
259
+
260
+ /**
261
+ * Describes the message kusinta.iot.connector.v1.BackendHealthReport.
262
+ * Use `create(BackendHealthReportSchema)` to create a new message.
263
+ */
264
+ export declare const BackendHealthReportSchema: GenMessage<BackendHealthReport>;
265
+
266
+ /**
267
+ * Asks the connector to re-initialise its backend connection, gateway to connector: drop
268
+ * the connection to its radio central or network server and establish it again, as it would
269
+ * at startup. Sent only to a connector that declares
270
+ * ConnectorInfo.supports_backend_reinitialize.
271
+ *
272
+ * Idempotent. Re-initialising a healthy backend is harmless, and asking twice is the same as
273
+ * asking once: a ReinitializeBackend that arrives while one is running starts nothing new,
274
+ * and is answered with the running one's outcome when it finishes. The gateway sends at most
275
+ * one at a time per connector and refuses a second request from above while one is
276
+ * outstanding; the connector's coalescing covers the case where the gateway gave up waiting
277
+ * and asked again.
278
+ *
279
+ * Sent only by a gateway that sets HandshakeAck.supports_backend_health, so a connector
280
+ * that receives it may answer. Answered once, by ReinitializeBackendResult with the same
281
+ * request_id. The connector bounds its attempt so that it answers within 30 seconds of
282
+ * receiving this; the gateway waits at least 45 and at most 60 seconds before it treats the
283
+ * request as timed out. A result arriving after the gateway has given up is ignored, but the
284
+ * health report sent before it still applies.
285
+ *
286
+ * @generated from message kusinta.iot.connector.v1.ReinitializeBackend
287
+ */
288
+ export declare type ReinitializeBackend = Message<"kusinta.iot.connector.v1.ReinitializeBackend"> & {
289
+ /**
290
+ * minted by the gateway, echoed in the result
291
+ *
292
+ * @generated from field: string request_id = 1;
293
+ */
294
+ requestId: string;
295
+ };
296
+
297
+ /**
298
+ * Describes the message kusinta.iot.connector.v1.ReinitializeBackend.
299
+ * Use `create(ReinitializeBackendSchema)` to create a new message.
300
+ */
301
+ export declare const ReinitializeBackendSchema: GenMessage<ReinitializeBackend>;
302
+
303
+ /**
304
+ * What became of a ReinitializeBackend, connector to gateway.
305
+ *
306
+ * DONE means the attempt was made and has finished — not that it succeeded. Whether the
307
+ * backend works now is stated by the BackendHealthReport the connector sends after every
308
+ * attempt, before this result, so a gateway reading DONE already holds the outcome. Keeping
309
+ * the two apart means there is one place that says whether a backend is healthy, and a
310
+ * result cannot contradict it.
311
+ *
312
+ * @generated from message kusinta.iot.connector.v1.ReinitializeBackendResult
313
+ */
314
+ export declare type ReinitializeBackendResult = Message<"kusinta.iot.connector.v1.ReinitializeBackendResult"> & {
315
+ /**
316
+ * @generated from field: string request_id = 1;
317
+ */
318
+ requestId: string;
319
+
320
+ /**
321
+ * @generated from field: kusinta.iot.connector.v1.ReinitializeOutcome outcome = 2;
322
+ */
323
+ outcome: ReinitializeOutcome;
324
+
325
+ /**
326
+ * Why it could not be attempted, when outcome is FAILED: MISCONFIGURED or INTERNAL.
327
+ * UNSPECIFIED otherwise. Never a failure found by attempting — rejected credentials, a
328
+ * backend that does not answer: the attempt was made, so the outcome is DONE and the
329
+ * health report before it says FAILING with AUTH_FAILED, UNREACHABLE or the like.
330
+ *
331
+ * @generated from field: kusinta.iot.common.v1.BackendFailureReason reason = 3;
332
+ */
333
+ reason: BackendFailureReason;
334
+
335
+ /**
336
+ * For the gateway's logs only, as BackendHealthReport.detail; never forwarded.
337
+ *
338
+ * @generated from field: string detail = 4;
339
+ */
340
+ detail: string;
341
+ };
342
+
343
+ /**
344
+ * Describes the message kusinta.iot.connector.v1.ReinitializeBackendResult.
345
+ * Use `create(ReinitializeBackendResultSchema)` to create a new message.
346
+ */
347
+ export declare const ReinitializeBackendResultSchema: GenMessage<ReinitializeBackendResult>;
348
+
154
349
  /**
155
350
  * Asks the connector to make a link, gateway to connector.
156
351
  *
@@ -326,6 +521,16 @@ export declare type HandshakeAck = Message<"kusinta.iot.connector.v1.HandshakeAc
326
521
  * @generated from field: kusinta.iot.identity.v1.GatewayId gateway_id = 3;
327
522
  */
328
523
  gatewayId?: GatewayId | undefined;
524
+
525
+ /**
526
+ * The gateway understands BackendHealthReport and ReinitializeBackendResult. A connector
527
+ * sends either on the session only when this is set. Unset — a gateway that predates
528
+ * backend health — the connector sends neither and works as before; such a gateway never
529
+ * sends ReinitializeBackend.
530
+ *
531
+ * @generated from field: bool supports_backend_health = 4;
532
+ */
533
+ supportsBackendHealth: boolean;
329
534
  };
330
535
 
331
536
  /**
@@ -759,6 +964,20 @@ export declare type SessionRequest = Message<"kusinta.iot.connector.v1.SessionRe
759
964
  */
760
965
  value: LinksReported;
761
966
  case: "linksReported";
967
+ } | {
968
+ /**
969
+ * The backend's health; see BackendHealthReport.
970
+ *
971
+ * @generated from field: kusinta.iot.connector.v1.BackendHealthReport backend_health = 14;
972
+ */
973
+ value: BackendHealthReport;
974
+ case: "backendHealth";
975
+ } | {
976
+ /**
977
+ * @generated from field: kusinta.iot.connector.v1.ReinitializeBackendResult reinitialize_backend_result = 15;
978
+ */
979
+ value: ReinitializeBackendResult;
980
+ case: "reinitializeBackendResult";
762
981
  } | { case: undefined; value?: undefined };
763
982
  };
764
983
 
@@ -854,6 +1073,14 @@ export declare type SessionResponse = Message<"kusinta.iot.connector.v1.SessionR
854
1073
  */
855
1074
  value: ListLinks;
856
1075
  case: "listLinks";
1076
+ } | {
1077
+ /**
1078
+ * See ReinitializeBackend.
1079
+ *
1080
+ * @generated from field: kusinta.iot.connector.v1.ReinitializeBackend reinitialize_backend = 14;
1081
+ */
1082
+ value: ReinitializeBackend;
1083
+ case: "reinitializeBackend";
857
1084
  } | { case: undefined; value?: undefined };
858
1085
  };
859
1086
 
@@ -863,3 +1090,44 @@ export declare type SessionResponse = Message<"kusinta.iot.connector.v1.SessionR
863
1090
  */
864
1091
  export declare const SessionResponseSchema: GenMessage<SessionResponse>;
865
1092
 
1093
+ /**
1094
+ * @generated from enum kusinta.iot.connector.v1.ReinitializeOutcome
1095
+ */
1096
+ export enum ReinitializeOutcome {
1097
+ /**
1098
+ * Not stated, or a value this gateway's schema does not know. Read as FAILED.
1099
+ *
1100
+ * @generated from enum value: REINITIALIZE_OUTCOME_UNSPECIFIED = 0;
1101
+ */
1102
+ UNSPECIFIED = 0,
1103
+
1104
+ /**
1105
+ * The connection was dropped and an attempt to establish it again has finished. Its
1106
+ * outcome is the BackendHealthReport sent just before.
1107
+ *
1108
+ * @generated from enum value: REINITIALIZE_OUTCOME_DONE = 1;
1109
+ */
1110
+ DONE = 1,
1111
+
1112
+ /**
1113
+ * The connector could not attempt it at all — no configuration to reconnect with, a fault
1114
+ * of its own. Health is unchanged and no report precedes this.
1115
+ *
1116
+ * @generated from enum value: REINITIALIZE_OUTCOME_FAILED = 2;
1117
+ */
1118
+ FAILED = 2,
1119
+
1120
+ /**
1121
+ * The connector has no backend connection it can re-initialise. A connector that answers
1122
+ * this should not declare supports_backend_reinitialize, but the gateway must handle it.
1123
+ *
1124
+ * @generated from enum value: REINITIALIZE_OUTCOME_NOT_SUPPORTED = 3;
1125
+ */
1126
+ NOT_SUPPORTED = 3,
1127
+ }
1128
+
1129
+ /**
1130
+ * Describes the enum kusinta.iot.connector.v1.ReinitializeOutcome.
1131
+ */
1132
+ export declare const ReinitializeOutcomeSchema: GenEnum<ReinitializeOutcome>;
1133
+