@kusinta/iot-schema 0.2.0-beta.5 → 0.2.0-beta.8

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.5",
3
+ "version": "0.2.0-beta.8",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": ["src"],
@@ -10,6 +10,7 @@
10
10
  },
11
11
  "exports": {
12
12
  "./common": "./src/kusinta/iot/common/v1/types_pb.js",
13
+ "./common/pairing": "./src/kusinta/iot/common/v1/pairing_pb.js",
13
14
  "./identity": "./src/kusinta/iot/identity/v1/identity_pb.js",
14
15
  "./device": "./src/kusinta/iot/device/v1/device_pb.js",
15
16
  "./device/descriptor": "./src/kusinta/iot/device/v1/descriptor_pb.js",
@@ -23,6 +24,7 @@
23
24
  "./space": "./src/kusinta/iot/space/v1/space_pb.js",
24
25
  "./access": "./src/kusinta/iot/access/v1/acl_pb.js",
25
26
  "./access/roles": "./src/kusinta/iot/access/v1/roles_pb.js",
27
+ "./link": "./src/kusinta/iot/link/v1/link_pb.js",
26
28
  "./connector": "./src/kusinta/iot/connector/v1/connector_pb.js",
27
29
  "./connector/service": "./src/kusinta/iot/connector/v1/connector_service_pb.js",
28
30
  "./webrtc": "./src/kusinta/iot/webrtc/v1/envelope_pb.js",
@@ -0,0 +1,201 @@
1
+ // @generated by protoc-gen-es v2.12.0 with parameter "target=js+dts,import_extension=js"
2
+ // @generated from file kusinta/iot/common/v1/pairing.proto (package kusinta.iot.common.v1, syntax proto3)
3
+ /* eslint-disable */
4
+
5
+ import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
6
+ import type { Message } from "@bufbuild/protobuf";
7
+
8
+ /**
9
+ * Describes the file kusinta/iot/common/v1/pairing.proto.
10
+ */
11
+ export declare const file_kusinta_iot_common_v1_pairing: GenFile;
12
+
13
+ /**
14
+ * A pairing failure and what can be said about it, the pairing counterpart of CommandError.
15
+ *
16
+ * The message matters more here than elsewhere: DEVICE_UNUSABLE is the code a user is most
17
+ * likely to see and least able to act on, and naming the device that joined is the whole
18
+ * difference between "something went wrong" and "this hub does not support that model yet".
19
+ *
20
+ * @generated from message kusinta.iot.common.v1.PairingErrorDetail
21
+ */
22
+ export declare type PairingErrorDetail = Message<"kusinta.iot.common.v1.PairingErrorDetail"> & {
23
+ /**
24
+ * @generated from field: kusinta.iot.common.v1.PairingError code = 1;
25
+ */
26
+ code: PairingError;
27
+
28
+ /**
29
+ * human-readable; may name the device, its model, or the fault
30
+ *
31
+ * @generated from field: string message = 2;
32
+ */
33
+ message: string;
34
+ };
35
+
36
+ /**
37
+ * Describes the message kusinta.iot.common.v1.PairingErrorDetail.
38
+ * Use `create(PairingErrorDetailSchema)` to create a new message.
39
+ */
40
+ export declare const PairingErrorDetailSchema: GenMessage<PairingErrorDetail>;
41
+
42
+ /**
43
+ * How long a hub accepts new devices, and which it will take.
44
+ *
45
+ * One message on both legs rather than the same three fields declared twice: the clamp rule
46
+ * and the meaning of a hint are the sort of thing that is written once and then diverges,
47
+ * and the two copies had already begun to.
48
+ *
49
+ * @generated from message kusinta.iot.common.v1.PairingWindow
50
+ */
51
+ export declare type PairingWindow = Message<"kusinta.iot.common.v1.PairingWindow"> & {
52
+ /**
53
+ * How long to accept arrivals. Whoever forwards this clamps it, and so does whoever acts
54
+ * on it: a window is an interval during which anything nearby can join, so its length is a
55
+ * security parameter rather than purely the caller's to choose.
56
+ *
57
+ * Absent means "no preference, use the default" — distinct from a caller asking for zero.
58
+ *
59
+ * @generated from field: optional uint32 duration_seconds = 1;
60
+ */
61
+ durationSeconds?: number | undefined;
62
+
63
+ /**
64
+ * The identifier printed on the device being paired, where the technology has one that is
65
+ * legible and the person is holding it. Free-form: what is printed differs per technology,
66
+ * and nothing between the app and the hub interprets it.
67
+ *
68
+ * Setting it changes the mechanism, not just the accuracy. The hub is restricted to that
69
+ * device and the arrival is verified against this value, so an arrival is attributed on
70
+ * identity. Leaving it empty opens the window to anything nearby, and attribution falls
71
+ * back to the arrival being the only one — which is why one window may be open at a time.
72
+ *
73
+ * Verification is not optional where this is set. A restriction can silently fail to take,
74
+ * and an arrival attributed on a restriction that did not hold is the wrong device in
75
+ * someone's home.
76
+ *
77
+ * @generated from field: string device_hint = 2;
78
+ */
79
+ deviceHint: string;
80
+
81
+ /**
82
+ * How many arrivals this one window may attribute. Absent means one.
83
+ *
84
+ * A batch suits commissioning, where devices are paired in a row and become a building's
85
+ * rather than any person's. It does not suit a caller whose pairing mints personal
86
+ * ownership.
87
+ *
88
+ * Ignored where device_hint is set, and narrowed to one rather than refused: a hint names
89
+ * one device, so a window restricted to it can never produce a second arrival to attribute.
90
+ * The combination is meaningless rather than dangerous, and there is no honest code in
91
+ * PairingError for "your request contradicted itself" — refusing it would mean answering a
92
+ * malformed request with an entitlement decision that was never made.
93
+ *
94
+ * @generated from field: optional uint32 max_devices = 3;
95
+ */
96
+ maxDevices?: number | undefined;
97
+ };
98
+
99
+ /**
100
+ * Describes the message kusinta.iot.common.v1.PairingWindow.
101
+ * Use `create(PairingWindowSchema)` to create a new message.
102
+ */
103
+ export declare const PairingWindowSchema: GenMessage<PairingWindow>;
104
+
105
+ /**
106
+ * Why a pairing attempt did not produce a device, in one vocabulary both the app and a
107
+ * connector speak.
108
+ *
109
+ * Shared rather than mirrored, for the reason CommandError's comment gives: mirrored enums
110
+ * leave every connector inventing its own spellings and something in the middle keeping a
111
+ * translation table that silently falls behind. A connector produces the subset it can
112
+ * observe; the gateway produces the rest and passes a connector's value through unchanged.
113
+ *
114
+ * Every value answers one question: *what should the client do now?* A code that does not
115
+ * change the answer does not need to exist, which is why "the device is on the hub and
116
+ * unusable" is one value and not two.
117
+ *
118
+ * @generated from enum kusinta.iot.common.v1.PairingError
119
+ */
120
+ export enum PairingError {
121
+ /**
122
+ * Sender set no code, or sent one this client's schema does not know.
123
+ *
124
+ * This must stay the safe reading. A client decodes every value added after its build as
125
+ * UNSPECIFIED, so the sensible handling is "it did not work, offering a retry is
126
+ * reasonable" — and no value below is so dangerous that reading it this way misleads.
127
+ *
128
+ * @generated from enum value: PAIRING_ERROR_UNSPECIFIED = 0;
129
+ */
130
+ UNSPECIFIED = 0,
131
+
132
+ /**
133
+ * The caller may not pair here. Permanent for this caller: stop, and say so.
134
+ *
135
+ * @generated from enum value: PAIRING_ERROR_NOT_ENTITLED = 1;
136
+ */
137
+ NOT_ENTITLED = 1,
138
+
139
+ /**
140
+ * A pairing window is already open, and only one may be. Retrying after it closes is the
141
+ * right response; retrying at once is not.
142
+ *
143
+ * The exclusivity is not incidental. Where a request names no device, the only thing
144
+ * attributing an arrival to a requester is that theirs was the one window open.
145
+ *
146
+ * @generated from enum value: PAIRING_ERROR_ALREADY_IN_PROGRESS = 2;
147
+ */
148
+ ALREADY_IN_PROGRESS = 2,
149
+
150
+ /**
151
+ * The connector could not be reached, or refused to open its window. Transient.
152
+ *
153
+ * @generated from enum value: PAIRING_ERROR_CONNECTOR_UNAVAILABLE = 3;
154
+ */
155
+ CONNECTOR_UNAVAILABLE = 3,
156
+
157
+ /**
158
+ * The window closed with nothing paired: no device was put into pairing mode, or it was
159
+ * out of range, or its batteries are flat. The ordinary outcome of a user who walked away,
160
+ * so the useful response is to say what to do and offer another go, not to report a fault.
161
+ *
162
+ * @generated from enum value: PAIRING_ERROR_NO_DEVICE_APPEARED = 4;
163
+ */
164
+ NO_DEVICE_APPEARED = 4,
165
+
166
+ /**
167
+ * A device joined the hub and cannot be presented — the connector has no model for it, or
168
+ * could not assemble a complete description of it.
169
+ *
170
+ * One value rather than two, because the client does the same thing either way: stop, do
171
+ * not retry, and tell the user there is now an unusable device on their hub. Which of the
172
+ * two it was belongs in PairingErrorDetail.message, where it can name the device.
173
+ *
174
+ * It stays joined deliberately. A later connector release that models it adopts it with
175
+ * nobody returning to the hardware, where removing it would need someone standing there.
176
+ *
177
+ * @generated from enum value: PAIRING_ERROR_DEVICE_UNUSABLE = 5;
178
+ */
179
+ DEVICE_UNUSABLE = 5,
180
+
181
+ /**
182
+ * A device joined that is not the one the request named. The connector checked the arrival
183
+ * against the identifier it was given and they did not match, so it was not attributed.
184
+ *
185
+ * @generated from enum value: PAIRING_ERROR_WRONG_DEVICE = 6;
186
+ */
187
+ WRONG_DEVICE = 6,
188
+
189
+ /**
190
+ * A fault on the gateway's or the connector's own side. Not the caller's doing.
191
+ *
192
+ * @generated from enum value: PAIRING_ERROR_INTERNAL = 7;
193
+ */
194
+ INTERNAL = 7,
195
+ }
196
+
197
+ /**
198
+ * Describes the enum kusinta.iot.common.v1.PairingError.
199
+ */
200
+ export declare const PairingErrorSchema: GenEnum<PairingError>;
201
+
@@ -0,0 +1,50 @@
1
+ // @generated by protoc-gen-es v2.12.0 with parameter "target=js+dts,import_extension=js"
2
+ // @generated from file kusinta/iot/common/v1/pairing.proto (package kusinta.iot.common.v1, syntax proto3)
3
+ /* eslint-disable */
4
+
5
+ import { enumDesc, fileDesc, messageDesc, tsEnum } from "@bufbuild/protobuf/codegenv2";
6
+
7
+ /**
8
+ * Describes the file kusinta/iot/common/v1/pairing.proto.
9
+ */
10
+ export const file_kusinta_iot_common_v1_pairing = /*@__PURE__*/
11
+ fileDesc("CiNrdXNpbnRhL2lvdC9jb21tb24vdjEvcGFpcmluZy5wcm90bxIVa3VzaW50YS5pb3QuY29tbW9uLnYxIlgKElBhaXJpbmdFcnJvckRldGFpbBIxCgRjb2RlGAEgASgOMiMua3VzaW50YS5pb3QuY29tbW9uLnYxLlBhaXJpbmdFcnJvchIPCgdtZXNzYWdlGAIgASgJIoIBCg1QYWlyaW5nV2luZG93Eh0KEGR1cmF0aW9uX3NlY29uZHMYASABKA1IAIgBARITCgtkZXZpY2VfaGludBgCIAEoCRIYCgttYXhfZGV2aWNlcxgDIAEoDUgBiAEBQhMKEV9kdXJhdGlvbl9zZWNvbmRzQg4KDF9tYXhfZGV2aWNlcyqiAgoMUGFpcmluZ0Vycm9yEh0KGVBBSVJJTkdfRVJST1JfVU5TUEVDSUZJRUQQABIeChpQQUlSSU5HX0VSUk9SX05PVF9FTlRJVExFRBABEiUKIVBBSVJJTkdfRVJST1JfQUxSRUFEWV9JTl9QUk9HUkVTUxACEicKI1BBSVJJTkdfRVJST1JfQ09OTkVDVE9SX1VOQVZBSUxBQkxFEAMSJAogUEFJUklOR19FUlJPUl9OT19ERVZJQ0VfQVBQRUFSRUQQBBIhCh1QQUlSSU5HX0VSUk9SX0RFVklDRV9VTlVTQUJMRRAFEh4KGlBBSVJJTkdfRVJST1JfV1JPTkdfREVWSUNFEAYSGgoWUEFJUklOR19FUlJPUl9JTlRFUk5BTBAHQgJIAWIGcHJvdG8z");
12
+
13
+ /**
14
+ * Describes the message kusinta.iot.common.v1.PairingErrorDetail.
15
+ * Use `create(PairingErrorDetailSchema)` to create a new message.
16
+ */
17
+ export const PairingErrorDetailSchema = /*@__PURE__*/
18
+ messageDesc(file_kusinta_iot_common_v1_pairing, 0);
19
+
20
+ /**
21
+ * Describes the message kusinta.iot.common.v1.PairingWindow.
22
+ * Use `create(PairingWindowSchema)` to create a new message.
23
+ */
24
+ export const PairingWindowSchema = /*@__PURE__*/
25
+ messageDesc(file_kusinta_iot_common_v1_pairing, 1);
26
+
27
+ /**
28
+ * Describes the enum kusinta.iot.common.v1.PairingError.
29
+ */
30
+ export const PairingErrorSchema = /*@__PURE__*/
31
+ enumDesc(file_kusinta_iot_common_v1_pairing, 0);
32
+
33
+ /**
34
+ * Why a pairing attempt did not produce a device, in one vocabulary both the app and a
35
+ * connector speak.
36
+ *
37
+ * Shared rather than mirrored, for the reason CommandError's comment gives: mirrored enums
38
+ * leave every connector inventing its own spellings and something in the middle keeping a
39
+ * translation table that silently falls behind. A connector produces the subset it can
40
+ * observe; the gateway produces the rest and passes a connector's value through unchanged.
41
+ *
42
+ * Every value answers one question: *what should the client do now?* A code that does not
43
+ * change the answer does not need to exist, which is why "the device is on the hub and
44
+ * unusable" is one value and not two.
45
+ *
46
+ * @generated from enum kusinta.iot.common.v1.PairingError
47
+ */
48
+ export const PairingError = /*@__PURE__*/
49
+ tsEnum(PairingErrorSchema);
50
+
@@ -7,8 +7,10 @@ import type { Message } from "@bufbuild/protobuf";
7
7
  import type { ConnectorId, DeviceId, GatewayId } from "../../identity/v1/identity_pb.js";
8
8
  import type { ConnectorTransport } from "../../common/v1/types_pb.js";
9
9
  import type { Device } from "../../device/v1/device_pb.js";
10
+ import type { DeviceLink, LinkFunction, LinkState } from "../../link/v1/link_pb.js";
10
11
  import type { Timestamp } from "@bufbuild/protobuf/wkt";
11
12
  import type { AttributeWriteRequest, CommandError, DeviceCommand } from "../../webrtc/v1/command_pb.js";
13
+ import type { PairingErrorDetail, PairingWindow } from "../../common/v1/pairing_pb.js";
12
14
  import type { PropertyUpdateBatch } from "../../device/v1/property_update_pb.js";
13
15
  import type { DeviceEventBatch } from "../../device/v1/device_event_pb.js";
14
16
 
@@ -73,6 +75,22 @@ export declare type ConnectorHandshake = Message<"kusinta.iot.connector.v1.Conne
73
75
  * @generated from field: repeated kusinta.iot.device.v1.Device known_devices = 2;
74
76
  */
75
77
  knownDevices: Device[];
78
+
79
+ /**
80
+ * Every link the hub currently holds, reported the way known_devices is.
81
+ *
82
+ * Links are hub state, not gateway state: they outlive a connector restart and
83
+ * can be changed by anyone with access to the hub. The gateway's records are a
84
+ * statement of intent that can drift, so the handshake is the moment to
85
+ * reconcile them against what is really there. A link in the gateway's records
86
+ * and not here has gone; one here and not in the records was made elsewhere.
87
+ *
88
+ * Empty means "states nothing" — a connector that does not model linking is not
89
+ * asserting that no links exist.
90
+ *
91
+ * @generated from field: repeated kusinta.iot.link.v1.DeviceLink known_links = 3;
92
+ */
93
+ knownLinks: DeviceLink[];
76
94
  };
77
95
 
78
96
  /**
@@ -81,6 +99,163 @@ export declare type ConnectorHandshake = Message<"kusinta.iot.connector.v1.Conne
81
99
  */
82
100
  export declare const ConnectorHandshakeSchema: GenMessage<ConnectorHandshake>;
83
101
 
102
+ /**
103
+ * Asks the connector to make a link, gateway to connector.
104
+ *
105
+ * Names two devices and a function; resolving that into whatever set of
106
+ * underlying connections the hub needs is the connector's work. It is expected to
107
+ * build the set atomically and roll back a partial one, because a half-built set
108
+ * is a link that lists as healthy and carries nothing.
109
+ *
110
+ * The connector is also expected to repair whatever the operation disturbs. On at
111
+ * least one vendor, both making and removing a link leaves the receiving device
112
+ * in a state it was not in before, with settings that must be captured
113
+ * beforehand and put back after.
114
+ *
115
+ * @generated from message kusinta.iot.connector.v1.CreateLink
116
+ */
117
+ export declare type CreateLink = Message<"kusinta.iot.connector.v1.CreateLink"> & {
118
+ /**
119
+ * assigned by the gateway, echoed in the result
120
+ *
121
+ * @generated from field: string link_id = 1;
122
+ */
123
+ linkId: string;
124
+
125
+ /**
126
+ * @generated from field: kusinta.iot.identity.v1.DeviceId sender = 2;
127
+ */
128
+ sender?: DeviceId | undefined;
129
+
130
+ /**
131
+ * @generated from field: kusinta.iot.identity.v1.DeviceId receiver = 3;
132
+ */
133
+ receiver?: DeviceId | undefined;
134
+
135
+ /**
136
+ * @generated from field: kusinta.iot.link.v1.LinkFunction function = 4;
137
+ */
138
+ function: LinkFunction;
139
+ };
140
+
141
+ /**
142
+ * Describes the message kusinta.iot.connector.v1.CreateLink.
143
+ * Use `create(CreateLinkSchema)` to create a new message.
144
+ */
145
+ export declare const CreateLinkSchema: GenMessage<CreateLink>;
146
+
147
+ /**
148
+ * Asks the connector to remove a link it previously made.
149
+ *
150
+ * @generated from message kusinta.iot.connector.v1.RemoveLink
151
+ */
152
+ export declare type RemoveLink = Message<"kusinta.iot.connector.v1.RemoveLink"> & {
153
+ /**
154
+ * @generated from field: string link_id = 1;
155
+ */
156
+ linkId: string;
157
+
158
+ /**
159
+ * @generated from field: kusinta.iot.identity.v1.DeviceId sender = 2;
160
+ */
161
+ sender?: DeviceId | undefined;
162
+
163
+ /**
164
+ * @generated from field: kusinta.iot.identity.v1.DeviceId receiver = 3;
165
+ */
166
+ receiver?: DeviceId | undefined;
167
+
168
+ /**
169
+ * @generated from field: kusinta.iot.link.v1.LinkFunction function = 4;
170
+ */
171
+ function: LinkFunction;
172
+ };
173
+
174
+ /**
175
+ * Describes the message kusinta.iot.connector.v1.RemoveLink.
176
+ * Use `create(RemoveLinkSchema)` to create a new message.
177
+ */
178
+ export declare const RemoveLinkSchema: GenMessage<RemoveLink>;
179
+
180
+ /**
181
+ * Asks the connector what links the hub holds, for reconciliation outside a
182
+ * handshake.
183
+ *
184
+ * @generated from message kusinta.iot.connector.v1.ListLinks
185
+ */
186
+ export declare type ListLinks = Message<"kusinta.iot.connector.v1.ListLinks"> & {
187
+ /**
188
+ * Unset asks for every link the hub holds.
189
+ *
190
+ * @generated from field: kusinta.iot.identity.v1.DeviceId device_id = 1;
191
+ */
192
+ deviceId?: DeviceId | undefined;
193
+ };
194
+
195
+ /**
196
+ * Describes the message kusinta.iot.connector.v1.ListLinks.
197
+ * Use `create(ListLinksSchema)` to create a new message.
198
+ */
199
+ export declare const ListLinksSchema: GenMessage<ListLinks>;
200
+
201
+ /**
202
+ * What became of a CreateLink or RemoveLink, connector to gateway.
203
+ *
204
+ * Reports the link's observed state rather than merely whether the call was
205
+ * accepted. A hub will report a link as present and healthy while the devices
206
+ * ignore it, so "the request did not fail" is not the same claim as "the link is
207
+ * carrying" and must not be encoded as though it were.
208
+ *
209
+ * @generated from message kusinta.iot.connector.v1.LinkResult
210
+ */
211
+ export declare type LinkResult = Message<"kusinta.iot.connector.v1.LinkResult"> & {
212
+ /**
213
+ * @generated from field: string link_id = 1;
214
+ */
215
+ linkId: string;
216
+
217
+ /**
218
+ * @generated from field: bool success = 2;
219
+ */
220
+ success: boolean;
221
+
222
+ /**
223
+ * @generated from field: kusinta.iot.link.v1.LinkState state = 3;
224
+ */
225
+ state: LinkState;
226
+
227
+ /**
228
+ * Why not, when success is false. For a person; never parsed.
229
+ *
230
+ * @generated from field: string detail = 4;
231
+ */
232
+ detail: string;
233
+ };
234
+
235
+ /**
236
+ * Describes the message kusinta.iot.connector.v1.LinkResult.
237
+ * Use `create(LinkResultSchema)` to create a new message.
238
+ */
239
+ export declare const LinkResultSchema: GenMessage<LinkResult>;
240
+
241
+ /**
242
+ * Every link the hub holds, connector to gateway, in reply to ListLinks.
243
+ *
244
+ * @generated from message kusinta.iot.connector.v1.LinksReported
245
+ */
246
+ export declare type LinksReported = Message<"kusinta.iot.connector.v1.LinksReported"> & {
247
+ /**
248
+ * @generated from field: repeated kusinta.iot.link.v1.DeviceLink links = 1;
249
+ */
250
+ links: DeviceLink[];
251
+ };
252
+
253
+ /**
254
+ * Describes the message kusinta.iot.connector.v1.LinksReported.
255
+ * Use `create(LinksReportedSchema)` to create a new message.
256
+ */
257
+ export declare const LinksReportedSchema: GenMessage<LinksReported>;
258
+
84
259
  /**
85
260
  * @generated from message kusinta.iot.connector.v1.HandshakeAck
86
261
  */
@@ -122,6 +297,25 @@ export declare type DeviceAnnouncement = Message<"kusinta.iot.connector.v1.Devic
122
297
  * @generated from field: kusinta.iot.device.v1.Device device = 2;
123
298
  */
124
299
  device?: Device | undefined;
300
+
301
+ /**
302
+ * The pairing request this device arrived for, empty for a device that arrived on its own.
303
+ *
304
+ * This field is the whole attribution mechanism. A connector is the only party that knows
305
+ * when its own hub was accepting devices, so it decides whether an arrival belongs to a
306
+ * request and says so here.
307
+ *
308
+ * Set it only when the arrival was actually checked. An arrival that fails the check is
309
+ * still announced — the device exists and has joined — but with this empty, which files it
310
+ * as belonging to nobody rather than to the wrong person.
311
+ *
312
+ * This is EnterPairingMode.request_id, minted per connector, and NOT an app message id:
313
+ * whoever forwards the outcome to the app has to map it back. The name avoids `in_reply_to`
314
+ * for that reason, which everywhere else in this schema means the app's own message id.
315
+ *
316
+ * @generated from field: string pairing_request_id = 3;
317
+ */
318
+ pairingRequestId: string;
125
319
  };
126
320
 
127
321
  /**
@@ -309,6 +503,127 @@ export declare type ConnectorCommandResult = Message<"kusinta.iot.connector.v1.C
309
503
  */
310
504
  export declare const ConnectorCommandResultSchema: GenMessage<ConnectorCommandResult>;
311
505
 
506
+ /**
507
+ * Tells a connector to accept new devices for a while, gateway → connector.
508
+ *
509
+ * Named for what the connector does rather than for what the app asked. The two legs are
510
+ * named differently on purpose: the app starts one pairing, and the gateway may put several
511
+ * connectors into pairing mode to serve it.
512
+ *
513
+ * @generated from message kusinta.iot.connector.v1.EnterPairingMode
514
+ */
515
+ export declare type EnterPairingMode = Message<"kusinta.iot.connector.v1.EnterPairingMode"> & {
516
+ /**
517
+ * echoed on PairingModeResult, PairingModeEnded and the announcement
518
+ *
519
+ * @generated from field: string request_id = 1;
520
+ */
521
+ requestId: string;
522
+
523
+ /**
524
+ * How long, which device, how many. See PairingWindow — and clamp the duration again here.
525
+ * A connector is the last thing standing between a number on the wire and a radio that
526
+ * accepts anything nearby for that long.
527
+ *
528
+ * @generated from field: kusinta.iot.common.v1.PairingWindow window = 2;
529
+ */
530
+ window?: PairingWindow | undefined;
531
+ };
532
+
533
+ /**
534
+ * Describes the message kusinta.iot.connector.v1.EnterPairingMode.
535
+ * Use `create(EnterPairingModeSchema)` to create a new message.
536
+ */
537
+ export declare const EnterPairingModeSchema: GenMessage<EnterPairingMode>;
538
+
539
+ /**
540
+ * A connector's answer to EnterPairingMode: whether the window opened, and nothing more.
541
+ *
542
+ * The same accept-now-report-later split as ConnectorCommandResult, for the same reason — a
543
+ * connector that waited for a device to wake before answering would blow every deadline
544
+ * above it. What the window produced arrives later, as PairingModeEnded.
545
+ *
546
+ * @generated from message kusinta.iot.connector.v1.PairingModeResult
547
+ */
548
+ export declare type PairingModeResult = Message<"kusinta.iot.connector.v1.PairingModeResult"> & {
549
+ /**
550
+ * @generated from field: string request_id = 1;
551
+ */
552
+ requestId: string;
553
+
554
+ /**
555
+ * @generated from field: bool accepted = 2;
556
+ */
557
+ accepted: boolean;
558
+
559
+ /**
560
+ * Why the window did not open. Only what a connector can observe at this point:
561
+ * CONNECTOR_UNAVAILABLE, INTERNAL. NOT_ENTITLED and ALREADY_IN_PROGRESS are the gateway's,
562
+ * decided before this message is sent, and a connector must not claim them.
563
+ *
564
+ * @generated from field: kusinta.iot.common.v1.PairingErrorDetail error = 3;
565
+ */
566
+ error?: PairingErrorDetail | undefined;
567
+
568
+ /**
569
+ * When the window closes, if it opened. Lets the gateway expire its own record against the
570
+ * connector's clock rather than a guess — the connector is the party that clamped it.
571
+ *
572
+ * @generated from field: google.protobuf.Timestamp expires_at = 4;
573
+ */
574
+ expiresAt?: Timestamp | undefined;
575
+ };
576
+
577
+ /**
578
+ * Describes the message kusinta.iot.connector.v1.PairingModeResult.
579
+ * Use `create(PairingModeResultSchema)` to create a new message.
580
+ */
581
+ export declare const PairingModeResultSchema: GenMessage<PairingModeResult>;
582
+
583
+ /**
584
+ * What the window produced, connector → gateway, sent once when it closes.
585
+ *
586
+ * Without this the connector has no way to report anything it learned after the window
587
+ * opened: a device that joined and cannot be modelled, or one that joined and was not the
588
+ * device the hint named. Neither can travel on a DeviceAnnouncement — the first has nothing
589
+ * announceable, and the second is announced but unattributed, which says a device arrived
590
+ * and not why it was refused.
591
+ *
592
+ * It also gives a batch window a definite end. Counting announcements cannot distinguish
593
+ * "three of five so far" from "three of five, and that is all".
594
+ *
595
+ * @generated from message kusinta.iot.connector.v1.PairingModeEnded
596
+ */
597
+ export declare type PairingModeEnded = Message<"kusinta.iot.connector.v1.PairingModeEnded"> & {
598
+ /**
599
+ * @generated from field: string request_id = 1;
600
+ */
601
+ requestId: string;
602
+
603
+ /**
604
+ * How many arrivals this connector attributed to the request. The gateway can count the
605
+ * announcements it received, but only the connector knows it has stopped.
606
+ *
607
+ * @generated from field: uint32 devices_attributed = 2;
608
+ */
609
+ devicesAttributed: number;
610
+
611
+ /**
612
+ * Why it produced fewer than asked for, absent when it produced them all. DEVICE_UNUSABLE
613
+ * and WRONG_DEVICE are reported here and should name the device in the message, since that
614
+ * is the only place a user learns which device is now sitting on their hub.
615
+ *
616
+ * @generated from field: kusinta.iot.common.v1.PairingErrorDetail error = 3;
617
+ */
618
+ error?: PairingErrorDetail | undefined;
619
+ };
620
+
621
+ /**
622
+ * Describes the message kusinta.iot.connector.v1.PairingModeEnded.
623
+ * Use `create(PairingModeEndedSchema)` to create a new message.
624
+ */
625
+ export declare const PairingModeEndedSchema: GenMessage<PairingModeEnded>;
626
+
312
627
  /**
313
628
  * @generated from message kusinta.iot.connector.v1.SessionRequest
314
629
  */
@@ -368,6 +683,30 @@ export declare type SessionRequest = Message<"kusinta.iot.connector.v1.SessionRe
368
683
  */
369
684
  value: DeviceEventBatch;
370
685
  case: "deviceEvents";
686
+ } | {
687
+ /**
688
+ * @generated from field: kusinta.iot.connector.v1.PairingModeResult pairing_mode_result = 10;
689
+ */
690
+ value: PairingModeResult;
691
+ case: "pairingModeResult";
692
+ } | {
693
+ /**
694
+ * @generated from field: kusinta.iot.connector.v1.PairingModeEnded pairing_mode_ended = 11;
695
+ */
696
+ value: PairingModeEnded;
697
+ case: "pairingModeEnded";
698
+ } | {
699
+ /**
700
+ * @generated from field: kusinta.iot.connector.v1.LinkResult link_result = 12;
701
+ */
702
+ value: LinkResult;
703
+ case: "linkResult";
704
+ } | {
705
+ /**
706
+ * @generated from field: kusinta.iot.connector.v1.LinksReported links_reported = 13;
707
+ */
708
+ value: LinksReported;
709
+ case: "linksReported";
371
710
  } | { case: undefined; value?: undefined };
372
711
  };
373
712
 
@@ -433,6 +772,36 @@ export declare type SessionResponse = Message<"kusinta.iot.connector.v1.SessionR
433
772
  */
434
773
  value: AttributeWriteRequest;
435
774
  case: "executeAttributeWrite";
775
+ } | {
776
+ /**
777
+ * The connector-leg half of the pairing flow. See EnterPairingMode.
778
+ *
779
+ * @generated from field: kusinta.iot.connector.v1.EnterPairingMode enter_pairing_mode = 10;
780
+ */
781
+ value: EnterPairingMode;
782
+ case: "enterPairingMode";
783
+ } | {
784
+ /**
785
+ * The link operations. Separate cases rather than one with a verb, so a
786
+ * connector that models none of them fails to match rather than having to
787
+ * decode a request it cannot serve.
788
+ *
789
+ * @generated from field: kusinta.iot.connector.v1.CreateLink create_link = 11;
790
+ */
791
+ value: CreateLink;
792
+ case: "createLink";
793
+ } | {
794
+ /**
795
+ * @generated from field: kusinta.iot.connector.v1.RemoveLink remove_link = 12;
796
+ */
797
+ value: RemoveLink;
798
+ case: "removeLink";
799
+ } | {
800
+ /**
801
+ * @generated from field: kusinta.iot.connector.v1.ListLinks list_links = 13;
802
+ */
803
+ value: ListLinks;
804
+ case: "listLinks";
436
805
  } | { case: undefined; value?: undefined };
437
806
  };
438
807