@mhome/app-facade-protocol 1.42.2 → 1.44.0

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.
@@ -4,10 +4,22 @@
4
4
  "title": "Native-client pod commissioning session snapshot",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
- "required": ["sessionId", "revision", "state", "candidate", "expiresAtMs"],
7
+ "required": [
8
+ "sessionId",
9
+ "revision",
10
+ "state",
11
+ "candidate",
12
+ "expiresAtMs"
13
+ ],
8
14
  "properties": {
9
- "sessionId": { "type": "string", "minLength": 1 },
10
- "revision": { "type": "integer", "minimum": 0 },
15
+ "sessionId": {
16
+ "type": "string",
17
+ "minLength": 1
18
+ },
19
+ "revision": {
20
+ "type": "integer",
21
+ "minimum": 0
22
+ },
11
23
  "state": {
12
24
  "enum": [
13
25
  "connecting",
@@ -27,17 +39,42 @@
27
39
  "timed_out"
28
40
  ]
29
41
  },
30
- "candidate": { "$ref": "pod-discovery.v1.schema.json#/$defs/candidate" },
31
- "expiresAtMs": { "type": "integer", "minimum": 0 },
42
+ "candidate": {
43
+ "$ref": "pod-discovery.v1.schema.json#/$defs/candidate"
44
+ },
45
+ "expiresAtMs": {
46
+ "type": "integer",
47
+ "minimum": 0
48
+ },
32
49
  "device": {
33
50
  "type": "object",
34
51
  "additionalProperties": false,
35
- "required": ["deviceId", "model", "firmwareVersion", "wifiConfigured"],
52
+ "required": [
53
+ "deviceId",
54
+ "model",
55
+ "firmwareVersion",
56
+ "wifiConfigured",
57
+ "dependentHost"
58
+ ],
36
59
  "properties": {
37
- "deviceId": { "type": "string", "minLength": 1 },
38
- "model": { "type": "string", "minLength": 1 },
39
- "firmwareVersion": { "type": "string", "minLength": 1 },
40
- "wifiConfigured": { "type": "boolean" }
60
+ "deviceId": {
61
+ "type": "string",
62
+ "minLength": 1
63
+ },
64
+ "model": {
65
+ "type": "string",
66
+ "minLength": 1
67
+ },
68
+ "firmwareVersion": {
69
+ "type": "string",
70
+ "minLength": 1
71
+ },
72
+ "wifiConfigured": {
73
+ "type": "boolean"
74
+ },
75
+ "dependentHost": {
76
+ "type": "boolean"
77
+ }
41
78
  }
42
79
  },
43
80
  "networks": {
@@ -45,44 +82,93 @@
45
82
  "items": {
46
83
  "type": "object",
47
84
  "additionalProperties": false,
48
- "required": ["ssid", "rssi", "secured"],
85
+ "required": [
86
+ "ssid",
87
+ "rssi",
88
+ "secured"
89
+ ],
49
90
  "properties": {
50
- "ssid": { "type": "string", "minLength": 1 },
51
- "rssi": { "type": "integer" },
52
- "secured": { "type": "boolean" }
91
+ "ssid": {
92
+ "type": "string",
93
+ "minLength": 1
94
+ },
95
+ "rssi": {
96
+ "type": "integer"
97
+ },
98
+ "secured": {
99
+ "type": "boolean"
100
+ }
53
101
  }
54
102
  }
55
103
  },
56
104
  "authorization": {
57
105
  "type": "object",
58
106
  "additionalProperties": false,
59
- "required": ["userId", "userName", "scopes", "defaultScopeId"],
107
+ "required": [
108
+ "userId",
109
+ "userName",
110
+ "scopes",
111
+ "defaultScopeId"
112
+ ],
60
113
  "properties": {
61
- "userId": { "type": "string", "minLength": 1 },
62
- "userName": { "type": "string" },
114
+ "userId": {
115
+ "type": "string",
116
+ "minLength": 1
117
+ },
118
+ "userName": {
119
+ "type": "string"
120
+ },
63
121
  "scopes": {
64
122
  "type": "array",
65
123
  "minItems": 1,
66
124
  "items": {
67
125
  "type": "object",
68
126
  "additionalProperties": false,
69
- "required": ["scopeId", "name", "local"],
127
+ "required": [
128
+ "scopeId",
129
+ "name",
130
+ "local",
131
+ "owner"
132
+ ],
70
133
  "properties": {
71
- "scopeId": { "type": "string", "minLength": 1 },
72
- "name": { "type": "string" },
73
- "local": { "type": "boolean" }
134
+ "scopeId": {
135
+ "type": "string",
136
+ "minLength": 1
137
+ },
138
+ "name": {
139
+ "type": "string"
140
+ },
141
+ "local": {
142
+ "type": "boolean"
143
+ },
144
+ "owner": {
145
+ "type": "boolean"
146
+ }
74
147
  }
75
148
  }
76
149
  },
77
- "defaultScopeId": { "type": "string", "minLength": 1 }
150
+ "defaultScopeId": {
151
+ "type": "string",
152
+ "minLength": 1
153
+ }
78
154
  }
79
155
  },
80
- "podId": { "type": "string", "minLength": 1 },
81
- "mode": { "enum": ["reprovision"] },
156
+ "podId": {
157
+ "type": "string",
158
+ "minLength": 1
159
+ },
160
+ "mode": {
161
+ "enum": [
162
+ "reprovision"
163
+ ]
164
+ },
82
165
  "error": {
83
166
  "type": "object",
84
167
  "additionalProperties": false,
85
- "required": ["code", "message"],
168
+ "required": [
169
+ "code",
170
+ "message"
171
+ ],
86
172
  "properties": {
87
173
  "code": {
88
174
  "enum": [
@@ -102,47 +188,187 @@
102
188
  "session_timeout"
103
189
  ]
104
190
  },
105
- "message": { "type": "string" },
106
- "detail": { "type": "string" }
191
+ "message": {
192
+ "type": "string"
193
+ },
194
+ "detail": {
195
+ "type": "string"
196
+ }
107
197
  }
108
198
  }
109
199
  },
110
200
  "allOf": [
111
201
  {
112
- "if": { "properties": { "state": { "enum": ["failed", "timed_out"] } } },
113
- "then": { "properties": { "error": {} }, "required": ["error"] }
202
+ "if": {
203
+ "properties": {
204
+ "state": {
205
+ "enum": [
206
+ "failed",
207
+ "timed_out"
208
+ ]
209
+ }
210
+ }
211
+ },
212
+ "then": {
213
+ "properties": {
214
+ "error": {}
215
+ },
216
+ "required": [
217
+ "error"
218
+ ]
219
+ }
114
220
  },
115
221
  {
116
222
  "if": {
117
223
  "properties": {
118
- "state": { "not": { "enum": ["failed", "timed_out", "awaiting_code", "awaiting_wifi"] } }
224
+ "state": {
225
+ "not": {
226
+ "enum": [
227
+ "failed",
228
+ "timed_out",
229
+ "awaiting_code",
230
+ "awaiting_wifi"
231
+ ]
232
+ }
233
+ }
119
234
  }
120
235
  },
121
- "then": { "not": { "properties": { "error": {} }, "required": ["error"] } }
236
+ "then": {
237
+ "not": {
238
+ "properties": {
239
+ "error": {}
240
+ },
241
+ "required": [
242
+ "error"
243
+ ]
244
+ }
245
+ }
122
246
  },
123
247
  {
124
- "if": { "properties": { "state": { "const": "awaiting_code" } }, "required": ["error"] },
125
- "then": { "properties": { "error": { "type": "object", "properties": { "code": { "const": "code_rejected" } } } } }
248
+ "if": {
249
+ "properties": {
250
+ "state": {
251
+ "const": "awaiting_code"
252
+ }
253
+ },
254
+ "required": [
255
+ "error"
256
+ ]
257
+ },
258
+ "then": {
259
+ "properties": {
260
+ "error": {
261
+ "type": "object",
262
+ "properties": {
263
+ "code": {
264
+ "const": "code_rejected"
265
+ }
266
+ }
267
+ }
268
+ }
269
+ }
126
270
  },
127
271
  {
128
- "if": { "properties": { "state": { "const": "awaiting_wifi" } }, "required": ["error"] },
272
+ "if": {
273
+ "properties": {
274
+ "state": {
275
+ "const": "awaiting_wifi"
276
+ }
277
+ },
278
+ "required": [
279
+ "error"
280
+ ]
281
+ },
129
282
  "then": {
130
283
  "properties": {
131
- "error": { "type": "object", "properties": { "code": { "enum": ["wifi_auth_failed", "wifi_not_found", "wifi_failed"] } } }
284
+ "error": {
285
+ "type": "object",
286
+ "properties": {
287
+ "code": {
288
+ "enum": [
289
+ "wifi_auth_failed",
290
+ "wifi_not_found",
291
+ "wifi_failed"
292
+ ]
293
+ }
294
+ }
295
+ }
132
296
  }
133
297
  }
134
298
  },
135
299
  {
136
- "if": { "properties": { "state": { "const": "awaiting_authorization" } } },
137
- "then": { "properties": { "authorization": {} }, "required": ["authorization"] }
300
+ "if": {
301
+ "properties": {
302
+ "state": {
303
+ "const": "awaiting_authorization"
304
+ }
305
+ }
306
+ },
307
+ "then": {
308
+ "properties": {
309
+ "authorization": {}
310
+ },
311
+ "required": [
312
+ "authorization"
313
+ ]
314
+ }
138
315
  },
139
316
  {
140
- "if": { "properties": { "state": { "const": "completed" } }, "not": { "properties": { "mode": {} }, "required": ["mode"] } },
141
- "then": { "properties": { "podId": {} }, "required": ["podId"] }
317
+ "if": {
318
+ "properties": {
319
+ "state": {
320
+ "const": "completed"
321
+ }
322
+ },
323
+ "not": {
324
+ "properties": {
325
+ "mode": {}
326
+ },
327
+ "required": [
328
+ "mode"
329
+ ]
330
+ }
331
+ },
332
+ "then": {
333
+ "properties": {
334
+ "podId": {}
335
+ },
336
+ "required": [
337
+ "podId"
338
+ ]
339
+ }
142
340
  },
143
341
  {
144
- "if": { "properties": { "mode": {} }, "required": ["mode"] },
145
- "then": { "not": { "anyOf": [{ "properties": { "podId": {} }, "required": ["podId"] }, { "properties": { "authorization": {} }, "required": ["authorization"] }] } }
342
+ "if": {
343
+ "properties": {
344
+ "mode": {}
345
+ },
346
+ "required": [
347
+ "mode"
348
+ ]
349
+ },
350
+ "then": {
351
+ "not": {
352
+ "anyOf": [
353
+ {
354
+ "properties": {
355
+ "podId": {}
356
+ },
357
+ "required": [
358
+ "podId"
359
+ ]
360
+ },
361
+ {
362
+ "properties": {
363
+ "authorization": {}
364
+ },
365
+ "required": [
366
+ "authorization"
367
+ ]
368
+ }
369
+ ]
370
+ }
371
+ }
146
372
  }
147
373
  ]
148
374
  }
@@ -30,7 +30,9 @@
30
30
  "source",
31
31
  "reachable",
32
32
  "claimable",
33
- "info"
33
+ "info",
34
+ "authorization",
35
+ "challenge"
34
36
  ],
35
37
  "properties": {
36
38
  "hostId": {
@@ -241,6 +243,125 @@
241
243
  ]
242
244
  }
243
245
  }
246
+ },
247
+ "authorization": {
248
+ "anyOf": [
249
+ {
250
+ "type": "null"
251
+ },
252
+ {
253
+ "type": "object",
254
+ "additionalProperties": false,
255
+ "required": [
256
+ "hostId",
257
+ "hostKeyId",
258
+ "env",
259
+ "mode",
260
+ "generation",
261
+ "claim"
262
+ ],
263
+ "properties": {
264
+ "hostId": {
265
+ "type": "string",
266
+ "minLength": 1,
267
+ "maxLength": 256
268
+ },
269
+ "hostKeyId": {
270
+ "type": "string",
271
+ "minLength": 1,
272
+ "maxLength": 256
273
+ },
274
+ "env": {
275
+ "enum": [
276
+ "prod",
277
+ "dev",
278
+ "e2e"
279
+ ]
280
+ },
281
+ "mode": {
282
+ "enum": [
283
+ "admin",
284
+ "spaceSelf",
285
+ "spaceDep"
286
+ ]
287
+ },
288
+ "generation": {
289
+ "type": "string",
290
+ "minLength": 1,
291
+ "maxLength": 256
292
+ },
293
+ "claim": {
294
+ "anyOf": [
295
+ {
296
+ "type": "null"
297
+ },
298
+ {
299
+ "type": "object",
300
+ "additionalProperties": false,
301
+ "required": [
302
+ "kind",
303
+ "userIds"
304
+ ],
305
+ "properties": {
306
+ "kind": {
307
+ "const": "admin"
308
+ },
309
+ "userIds": {
310
+ "type": "array",
311
+ "minItems": 1,
312
+ "uniqueItems": true,
313
+ "items": {
314
+ "type": "string",
315
+ "minLength": 1,
316
+ "maxLength": 256
317
+ }
318
+ }
319
+ }
320
+ },
321
+ {
322
+ "type": "object",
323
+ "additionalProperties": false,
324
+ "required": [
325
+ "kind",
326
+ "space"
327
+ ],
328
+ "properties": {
329
+ "kind": {
330
+ "const": "space"
331
+ },
332
+ "space": {
333
+ "type": "object",
334
+ "additionalProperties": false,
335
+ "required": [
336
+ "tenantId",
337
+ "scopeId"
338
+ ],
339
+ "properties": {
340
+ "tenantId": {
341
+ "type": "string",
342
+ "minLength": 1,
343
+ "maxLength": 256
344
+ },
345
+ "scopeId": {
346
+ "type": "string",
347
+ "minLength": 1,
348
+ "maxLength": 256
349
+ }
350
+ }
351
+ }
352
+ }
353
+ }
354
+ ]
355
+ }
356
+ }
357
+ }
358
+ ]
359
+ },
360
+ "challenge": {
361
+ "type": [
362
+ "string",
363
+ "null"
364
+ ]
244
365
  }
245
366
  }
246
367
  }
@@ -1,18 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.mhome.ai/app-facade/pod-credential-status.v1.schema.json",
4
- "title": "Lion pod credential status, as seen by the owning user",
5
- "type": "object",
6
- "required": ["podId", "status"],
7
- "properties": {
8
- "podId": { "type": "string", "minLength": 1 },
9
- "status": { "enum": ["pending", "active", "absent"] },
10
- "activatedAt": { "type": "integer", "minimum": 0 }
11
- },
12
- "allOf": [
13
- {
14
- "if": { "properties": { "status": { "const": "active" } } },
15
- "then": { "properties": { "activatedAt": {} }, "required": ["activatedAt"] }
16
- }
17
- ]
18
- }