@mhome/app-facade-protocol 1.32.0 → 1.34.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.
- package/README.md +16 -0
- package/contract/host-provisioning-v1.md +173 -0
- package/contract/pod-commissioning-v1.md +435 -0
- package/fixtures/host-provision.completed.json +26 -0
- package/fixtures/pod-commission.awaiting-authorization.json +29 -0
- package/fixtures/pod-commission.failed.json +22 -0
- package/fixtures/pod-commission.reprovision-completed.json +24 -0
- package/fixtures/pod-discovery.snapshot.json +18 -0
- package/manifest/app-facade.v1.json +9 -1
- package/manifest/host-provision-targets.v1.json +39 -0
- package/manifest/hub-targets.v1.json +1 -1
- package/manifest/pod-targets.v1.json +102 -0
- package/manifest/routing.v1.json +1 -2
- package/manifest/targets.v1.json +1 -1
- package/package.json +1 -1
- package/protocol.json +5 -1
- package/schema/host-provision.v1.schema.json +121 -0
- package/schema/pod-commission.v1.schema.json +144 -0
- package/schema/pod-credential-status.v1.schema.json +18 -0
- package/schema/pod-discovery.v1.schema.json +50 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sessionId": "pcs-7f3a",
|
|
3
|
+
"revision": 9,
|
|
4
|
+
"state": "awaiting_authorization",
|
|
5
|
+
"candidate": {
|
|
6
|
+
"candidateId": "ble:1A2B3C4D",
|
|
7
|
+
"kind": "pod",
|
|
8
|
+
"name": "MeowPod S1",
|
|
9
|
+
"model": "S1",
|
|
10
|
+
"shortId": "1A2B3C4D",
|
|
11
|
+
"rssi": -55,
|
|
12
|
+
"commissionable": true,
|
|
13
|
+
"wifiConfigured": false,
|
|
14
|
+
"lastSeenMs": 1791300000000
|
|
15
|
+
},
|
|
16
|
+
"expiresAtMs": 1791300600000,
|
|
17
|
+
"device": {
|
|
18
|
+
"deviceId": "a0b1c2d3e4f5",
|
|
19
|
+
"model": "S1",
|
|
20
|
+
"firmwareVersion": "0.3.0",
|
|
21
|
+
"wifiConfigured": false
|
|
22
|
+
},
|
|
23
|
+
"authorization": {
|
|
24
|
+
"userId": "user-1",
|
|
25
|
+
"userName": "Ada",
|
|
26
|
+
"scopes": [{ "scopeId": "scope-1", "name": "Home" }],
|
|
27
|
+
"defaultScopeId": "scope-1"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sessionId": "pcs-7f3a",
|
|
3
|
+
"revision": 12,
|
|
4
|
+
"state": "failed",
|
|
5
|
+
"candidate": {
|
|
6
|
+
"candidateId": "ble:1A2B3C4D",
|
|
7
|
+
"kind": "pod",
|
|
8
|
+
"name": "MeowPod S1",
|
|
9
|
+
"model": "S1",
|
|
10
|
+
"shortId": "1A2B3C4D",
|
|
11
|
+
"rssi": -55,
|
|
12
|
+
"commissionable": true,
|
|
13
|
+
"wifiConfigured": false,
|
|
14
|
+
"lastSeenMs": 1791300000000
|
|
15
|
+
},
|
|
16
|
+
"expiresAtMs": 1791300600000,
|
|
17
|
+
"error": {
|
|
18
|
+
"code": "activation_failed",
|
|
19
|
+
"message": "The device could not reach the cloud",
|
|
20
|
+
"detail": "cloud_unreachable"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sessionId": "pcs-81d0",
|
|
3
|
+
"revision": 10,
|
|
4
|
+
"state": "completed",
|
|
5
|
+
"candidate": {
|
|
6
|
+
"candidateId": "ble:1A2B3C4D",
|
|
7
|
+
"kind": "pod",
|
|
8
|
+
"name": "MeowPod S1",
|
|
9
|
+
"model": "S1",
|
|
10
|
+
"shortId": "1A2B3C4D",
|
|
11
|
+
"rssi": -55,
|
|
12
|
+
"commissionable": true,
|
|
13
|
+
"wifiConfigured": false,
|
|
14
|
+
"lastSeenMs": 1791300000000
|
|
15
|
+
},
|
|
16
|
+
"expiresAtMs": 1791300600000,
|
|
17
|
+
"device": {
|
|
18
|
+
"deviceId": "a0b1c2d3e4f5",
|
|
19
|
+
"model": "S1",
|
|
20
|
+
"firmwareVersion": "0.3.0",
|
|
21
|
+
"wifiConfigured": false
|
|
22
|
+
},
|
|
23
|
+
"mode": "reprovision"
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"revision": 4,
|
|
3
|
+
"scanning": true,
|
|
4
|
+
"adapter": { "state": "ready" },
|
|
5
|
+
"candidates": [
|
|
6
|
+
{
|
|
7
|
+
"candidateId": "ble:1A2B3C4D",
|
|
8
|
+
"kind": "pod",
|
|
9
|
+
"name": "MeowPod S1",
|
|
10
|
+
"model": "S1",
|
|
11
|
+
"shortId": "1A2B3C4D",
|
|
12
|
+
"rssi": -58,
|
|
13
|
+
"commissionable": true,
|
|
14
|
+
"wifiConfigured": false,
|
|
15
|
+
"lastSeenMs": 1791300000000
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": "mhome.app-facade.v1",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.34.0",
|
|
4
4
|
"callSchema": "schema/facade-call.v1.schema.json",
|
|
5
5
|
"routing": "manifest/routing.v1.json",
|
|
6
6
|
"routingSchema": "schema/routing.v1.schema.json",
|
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
"messaging": {
|
|
22
22
|
"targets": "manifest/targets.v1.json"
|
|
23
23
|
},
|
|
24
|
+
"pod": {
|
|
25
|
+
"targets": "manifest/pod-targets.v1.json",
|
|
26
|
+
"contract": "contract/pod-commissioning-v1.md"
|
|
27
|
+
},
|
|
28
|
+
"hostProvision": {
|
|
29
|
+
"targets": "manifest/host-provision-targets.v1.json",
|
|
30
|
+
"contract": "contract/host-provisioning-v1.md"
|
|
31
|
+
},
|
|
24
32
|
"plugin": {
|
|
25
33
|
"extensionVersion": "v1",
|
|
26
34
|
"targetPrefix": "/app/plugin",
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest": "mhome.host-provision.targets.v1",
|
|
3
|
+
"contractVersion": "1.34.0",
|
|
4
|
+
"contract": "contract/host-provisioning-v1.md",
|
|
5
|
+
"localTargets": [
|
|
6
|
+
"/local/host/provision/start",
|
|
7
|
+
"/local/host/provision/code",
|
|
8
|
+
"/local/host/provision/wifi",
|
|
9
|
+
"/local/host/provision/wifi/scan",
|
|
10
|
+
"/local/host/provision/cancel",
|
|
11
|
+
"/local/host/provision/renew",
|
|
12
|
+
"/local/host/provision/status"
|
|
13
|
+
],
|
|
14
|
+
"eventTargets": [
|
|
15
|
+
"/local/host/provision/changed"
|
|
16
|
+
],
|
|
17
|
+
"localPayload": "domainInput",
|
|
18
|
+
"localForwardable": false,
|
|
19
|
+
"ble": {
|
|
20
|
+
"kind": 2,
|
|
21
|
+
"appInfoLabel": "meow",
|
|
22
|
+
"appCapability": "host",
|
|
23
|
+
"appInfoLocked": "locked",
|
|
24
|
+
"appInfoLockedForMs": "lockedForMs",
|
|
25
|
+
"maxAttributeBytes": 512,
|
|
26
|
+
"scanTimeoutMs": 12000,
|
|
27
|
+
"customEndpoints": [
|
|
28
|
+
"host-info"
|
|
29
|
+
],
|
|
30
|
+
"customEndpointUuids": {
|
|
31
|
+
"host-info": 65364
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"codeLockout": {
|
|
35
|
+
"initialMs": 30000,
|
|
36
|
+
"maxMs": 600000
|
|
37
|
+
},
|
|
38
|
+
"claimTokenLength": 43
|
|
39
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest": "mhome.pod.targets.v1",
|
|
3
|
+
"contractVersion": "1.34.0",
|
|
4
|
+
"contract": "contract/pod-commissioning-v1.md",
|
|
5
|
+
"localTargets": [
|
|
6
|
+
"/local/pod/discovery/start",
|
|
7
|
+
"/local/pod/discovery/renew",
|
|
8
|
+
"/local/pod/discovery/stop",
|
|
9
|
+
"/local/pod/discovery/list",
|
|
10
|
+
"/local/pod/commission/start",
|
|
11
|
+
"/local/pod/commission/code",
|
|
12
|
+
"/local/pod/commission/wifi",
|
|
13
|
+
"/local/pod/commission/wifi/scan",
|
|
14
|
+
"/local/pod/commission/authorize",
|
|
15
|
+
"/local/pod/commission/cancel",
|
|
16
|
+
"/local/pod/commission/renew",
|
|
17
|
+
"/local/pod/commission/status",
|
|
18
|
+
"/local/pod/bluetooth/settings"
|
|
19
|
+
],
|
|
20
|
+
"eventTargets": [
|
|
21
|
+
"/local/pod/discovery/changed",
|
|
22
|
+
"/local/pod/commission/changed"
|
|
23
|
+
],
|
|
24
|
+
"localPayload": "domainInput",
|
|
25
|
+
"localForwardable": false,
|
|
26
|
+
"ble": {
|
|
27
|
+
"serviceUuid": "a17a7ad5-9b2f-4010-9cf0-aa15ac54c40e",
|
|
28
|
+
"companyId": 65535,
|
|
29
|
+
"manufacturerMagic": "MW",
|
|
30
|
+
"advertisingVersion": 1,
|
|
31
|
+
"kinds": {
|
|
32
|
+
"pod": 1,
|
|
33
|
+
"host": 2
|
|
34
|
+
},
|
|
35
|
+
"srpUsername": "meow",
|
|
36
|
+
"securityVersion": 2,
|
|
37
|
+
"appInfoLabel": "meow",
|
|
38
|
+
"appCapability": "pod",
|
|
39
|
+
"appInfoLocked": "locked",
|
|
40
|
+
"appInfoLockedForMs": "lockedForMs",
|
|
41
|
+
"codeAttempts": 5,
|
|
42
|
+
"customEndpoints": [
|
|
43
|
+
"pod-info",
|
|
44
|
+
"pod-credential"
|
|
45
|
+
],
|
|
46
|
+
"standardEndpointUuids": {
|
|
47
|
+
"prov-ctrl": 65359,
|
|
48
|
+
"prov-scan": 65360,
|
|
49
|
+
"prov-session": 65361,
|
|
50
|
+
"prov-config": 65362,
|
|
51
|
+
"proto-ver": 65363
|
|
52
|
+
},
|
|
53
|
+
"customEndpointUuids": {
|
|
54
|
+
"pod-info": 65364,
|
|
55
|
+
"pod-credential": 65365
|
|
56
|
+
},
|
|
57
|
+
"customEndpointMaxBytes": 480
|
|
58
|
+
},
|
|
59
|
+
"discovery": {
|
|
60
|
+
"leaseMs": 30000,
|
|
61
|
+
"candidateTtlMs": 10000,
|
|
62
|
+
"eventIntervalMs": 1000
|
|
63
|
+
},
|
|
64
|
+
"session": {
|
|
65
|
+
"lifetimeMs": 600000,
|
|
66
|
+
"leaseMs": 30000,
|
|
67
|
+
"renewIntervalMs": 10000,
|
|
68
|
+
"activationGraceMs": 30000,
|
|
69
|
+
"credentialStatusPollMs": 5000
|
|
70
|
+
},
|
|
71
|
+
"cloud": {
|
|
72
|
+
"issue": "pod/credential/issue",
|
|
73
|
+
"status": "pod/credential/status",
|
|
74
|
+
"revoke": "pod/credential/revoke",
|
|
75
|
+
"statusSchema": "schema/pod-credential-status.v1.schema.json"
|
|
76
|
+
},
|
|
77
|
+
"activationErrorCodes": [
|
|
78
|
+
"time_sync_failed",
|
|
79
|
+
"cloud_unreachable",
|
|
80
|
+
"refresh_rejected",
|
|
81
|
+
"auth_rejected",
|
|
82
|
+
"storage_failed"
|
|
83
|
+
],
|
|
84
|
+
"notActivatedDetail": "not_activated",
|
|
85
|
+
"credentialRefusalReasons": ["invalid_payload", "wrong_state"],
|
|
86
|
+
"reprovisionMode": "reprovision",
|
|
87
|
+
"requestErrorReasons": [
|
|
88
|
+
"session_active",
|
|
89
|
+
"device_gone",
|
|
90
|
+
"not_commissionable",
|
|
91
|
+
"wrong_kind",
|
|
92
|
+
"unknown_session",
|
|
93
|
+
"wrong_state",
|
|
94
|
+
"invalid_code",
|
|
95
|
+
"invalid_wifi",
|
|
96
|
+
"bluetooth_unavailable",
|
|
97
|
+
"not_signed_in",
|
|
98
|
+
"scope_not_offered",
|
|
99
|
+
"cloud_unreachable_for_device",
|
|
100
|
+
"busy"
|
|
101
|
+
]
|
|
102
|
+
}
|
package/manifest/routing.v1.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": "mhome.app-facade.routing.v1",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.34.0",
|
|
4
4
|
"targetPrefix": "/app/",
|
|
5
5
|
"default": {
|
|
6
6
|
"execution": "scopeMode",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
],
|
|
17
17
|
"cloudTargets": [
|
|
18
18
|
"/app/agent/context/get",
|
|
19
|
-
"/app/credit/record",
|
|
20
19
|
"/app/hub/cache/clear",
|
|
21
20
|
"/app/hub/get",
|
|
22
21
|
"/app/hub/remove",
|
package/manifest/targets.v1.json
CHANGED
package/package.json
CHANGED
package/protocol.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"protocol": "mhome.app-facade",
|
|
3
|
-
"contractVersion": "1.
|
|
3
|
+
"contractVersion": "1.34.0",
|
|
4
4
|
"manifest": "manifest/app-facade.v1.json",
|
|
5
5
|
"schemas": {
|
|
6
6
|
"capabilityDescriptor": "schema/capability-descriptor.v1.schema.json",
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
"routing": "schema/routing.v1.schema.json",
|
|
11
11
|
"hubState": "schema/hub-state.v1.schema.json",
|
|
12
12
|
"localHubState": "schema/local-hub-state.v1.schema.json",
|
|
13
|
+
"podDiscovery": "schema/pod-discovery.v1.schema.json",
|
|
14
|
+
"podCommission": "schema/pod-commission.v1.schema.json",
|
|
15
|
+
"podCredentialStatus": "schema/pod-credential-status.v1.schema.json",
|
|
16
|
+
"hostProvision": "schema/host-provision.v1.schema.json",
|
|
13
17
|
"systemClients": "schema/system-clients.v1.schema.json",
|
|
14
18
|
"systemHosts": "schema/system-hosts.v1.schema.json",
|
|
15
19
|
"systemHostsRuntime": "schema/system-hosts-runtime.v1.schema.json",
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.mhome.ai/app-facade/host-provision.v1.schema.json",
|
|
4
|
+
"title": "Native-client Host provisioning session snapshot",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["sessionId", "revision", "state", "candidate", "expiresAtMs"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"sessionId": { "type": "string", "minLength": 1 },
|
|
10
|
+
"revision": { "type": "integer", "minimum": 0 },
|
|
11
|
+
"state": {
|
|
12
|
+
"enum": [
|
|
13
|
+
"connecting",
|
|
14
|
+
"awaiting_code",
|
|
15
|
+
"securing",
|
|
16
|
+
"reading_info",
|
|
17
|
+
"awaiting_wifi",
|
|
18
|
+
"joining_wifi",
|
|
19
|
+
"completed",
|
|
20
|
+
"failed",
|
|
21
|
+
"cancelled",
|
|
22
|
+
"timed_out"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"candidate": { "$ref": "pod-discovery.v1.schema.json#/$defs/candidate" },
|
|
26
|
+
"expiresAtMs": { "type": "integer", "minimum": 0 },
|
|
27
|
+
"host": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"additionalProperties": false,
|
|
30
|
+
"required": ["hostId", "name", "firmwareVersion", "fingerprint", "wifiConfigured"],
|
|
31
|
+
"properties": {
|
|
32
|
+
"hostId": { "type": "string", "minLength": 1 },
|
|
33
|
+
"name": { "type": "string", "minLength": 1 },
|
|
34
|
+
"productId": { "type": "string" },
|
|
35
|
+
"firmwareVersion": { "type": "string", "minLength": 1 },
|
|
36
|
+
"fingerprint": { "type": "string", "minLength": 1 },
|
|
37
|
+
"wifiConfigured": { "type": "boolean" }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"networks": {
|
|
41
|
+
"type": "array",
|
|
42
|
+
"items": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"additionalProperties": false,
|
|
45
|
+
"required": ["ssid", "rssi", "secured"],
|
|
46
|
+
"properties": {
|
|
47
|
+
"ssid": { "type": "string", "minLength": 1 },
|
|
48
|
+
"rssi": { "type": "integer" },
|
|
49
|
+
"secured": { "type": "boolean" }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"addresses": {
|
|
54
|
+
"description": "IPv4 LAN addresses reported by the Host; may be empty",
|
|
55
|
+
"type": "array",
|
|
56
|
+
"items": { "type": "string", "format": "ipv4" }
|
|
57
|
+
},
|
|
58
|
+
"claimToken": {
|
|
59
|
+
"description": "One-time token for the first claim of this Host",
|
|
60
|
+
"type": "string",
|
|
61
|
+
"pattern": "^[A-Za-z0-9_-]{43}$"
|
|
62
|
+
},
|
|
63
|
+
"error": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"required": ["code", "message"],
|
|
67
|
+
"properties": {
|
|
68
|
+
"code": {
|
|
69
|
+
"enum": [
|
|
70
|
+
"bluetooth_unavailable",
|
|
71
|
+
"device_busy",
|
|
72
|
+
"disconnected",
|
|
73
|
+
"code_rejected",
|
|
74
|
+
"code_locked",
|
|
75
|
+
"wifi_auth_failed",
|
|
76
|
+
"wifi_not_found",
|
|
77
|
+
"wifi_failed",
|
|
78
|
+
"session_timeout"
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"message": { "type": "string" },
|
|
82
|
+
"detail": { "type": "string" }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"allOf": [
|
|
87
|
+
{
|
|
88
|
+
"if": { "properties": { "state": { "enum": ["failed", "timed_out"] } } },
|
|
89
|
+
"then": { "required": ["error"] }
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"if": {
|
|
93
|
+
"properties": {
|
|
94
|
+
"state": { "not": { "enum": ["failed", "timed_out", "awaiting_code", "awaiting_wifi"] } }
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"then": { "not": { "required": ["error"] } }
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"if": { "properties": { "state": { "const": "awaiting_code" } }, "required": ["error"] },
|
|
101
|
+
"then": { "properties": { "error": { "properties": { "code": { "const": "code_rejected" } } } } }
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"if": { "properties": { "state": { "const": "awaiting_wifi" } }, "required": ["error"] },
|
|
105
|
+
"then": {
|
|
106
|
+
"properties": {
|
|
107
|
+
"error": {
|
|
108
|
+
"properties": {
|
|
109
|
+
"code": { "enum": ["wifi_auth_failed", "wifi_not_found", "wifi_failed"] }
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"if": { "properties": { "state": { "const": "completed" } } },
|
|
117
|
+
"then": { "required": ["host"] },
|
|
118
|
+
"else": { "not": { "required": ["claimToken"] } }
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.mhome.ai/app-facade/pod-commission.v1.schema.json",
|
|
4
|
+
"title": "Native-client pod commissioning session snapshot",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["sessionId", "revision", "state", "candidate", "expiresAtMs"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"sessionId": { "type": "string", "minLength": 1 },
|
|
10
|
+
"revision": { "type": "integer", "minimum": 0 },
|
|
11
|
+
"state": {
|
|
12
|
+
"enum": [
|
|
13
|
+
"connecting",
|
|
14
|
+
"awaiting_code",
|
|
15
|
+
"securing",
|
|
16
|
+
"reading_info",
|
|
17
|
+
"awaiting_wifi",
|
|
18
|
+
"joining_wifi",
|
|
19
|
+
"awaiting_authorization",
|
|
20
|
+
"issuing",
|
|
21
|
+
"delivering",
|
|
22
|
+
"activating",
|
|
23
|
+
"completed",
|
|
24
|
+
"failed",
|
|
25
|
+
"cancelled",
|
|
26
|
+
"timed_out"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"candidate": { "$ref": "pod-discovery.v1.schema.json#/$defs/candidate" },
|
|
30
|
+
"expiresAtMs": { "type": "integer", "minimum": 0 },
|
|
31
|
+
"device": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"required": ["deviceId", "model", "firmwareVersion", "wifiConfigured"],
|
|
35
|
+
"properties": {
|
|
36
|
+
"deviceId": { "type": "string", "minLength": 1 },
|
|
37
|
+
"model": { "type": "string", "minLength": 1 },
|
|
38
|
+
"firmwareVersion": { "type": "string", "minLength": 1 },
|
|
39
|
+
"wifiConfigured": { "type": "boolean" }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"networks": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["ssid", "rssi", "secured"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"ssid": { "type": "string", "minLength": 1 },
|
|
50
|
+
"rssi": { "type": "integer" },
|
|
51
|
+
"secured": { "type": "boolean" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"authorization": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"additionalProperties": false,
|
|
58
|
+
"required": ["userId", "userName", "scopes", "defaultScopeId"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"userId": { "type": "string", "minLength": 1 },
|
|
61
|
+
"userName": { "type": "string" },
|
|
62
|
+
"scopes": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"minItems": 1,
|
|
65
|
+
"items": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"additionalProperties": false,
|
|
68
|
+
"required": ["scopeId", "name"],
|
|
69
|
+
"properties": {
|
|
70
|
+
"scopeId": { "type": "string", "minLength": 1 },
|
|
71
|
+
"name": { "type": "string" }
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"defaultScopeId": { "type": "string", "minLength": 1 }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"podId": { "type": "string", "minLength": 1 },
|
|
79
|
+
"mode": { "enum": ["reprovision"] },
|
|
80
|
+
"error": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"additionalProperties": false,
|
|
83
|
+
"required": ["code", "message"],
|
|
84
|
+
"properties": {
|
|
85
|
+
"code": {
|
|
86
|
+
"enum": [
|
|
87
|
+
"bluetooth_unavailable",
|
|
88
|
+
"device_busy",
|
|
89
|
+
"disconnected",
|
|
90
|
+
"code_rejected",
|
|
91
|
+
"code_locked",
|
|
92
|
+
"wifi_auth_failed",
|
|
93
|
+
"wifi_not_found",
|
|
94
|
+
"wifi_failed",
|
|
95
|
+
"issue_failed",
|
|
96
|
+
"delivery_failed",
|
|
97
|
+
"activation_failed",
|
|
98
|
+
"session_timeout"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"message": { "type": "string" },
|
|
102
|
+
"detail": { "type": "string" }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"allOf": [
|
|
107
|
+
{
|
|
108
|
+
"if": { "properties": { "state": { "enum": ["failed", "timed_out"] } } },
|
|
109
|
+
"then": { "required": ["error"] }
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"if": {
|
|
113
|
+
"properties": {
|
|
114
|
+
"state": { "not": { "enum": ["failed", "timed_out", "awaiting_code", "awaiting_wifi"] } }
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"then": { "not": { "required": ["error"] } }
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"if": { "properties": { "state": { "const": "awaiting_code" } }, "required": ["error"] },
|
|
121
|
+
"then": { "properties": { "error": { "properties": { "code": { "const": "code_rejected" } } } } }
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"if": { "properties": { "state": { "const": "awaiting_wifi" } }, "required": ["error"] },
|
|
125
|
+
"then": {
|
|
126
|
+
"properties": {
|
|
127
|
+
"error": { "properties": { "code": { "enum": ["wifi_auth_failed", "wifi_not_found", "wifi_failed"] } } }
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"if": { "properties": { "state": { "const": "awaiting_authorization" } } },
|
|
133
|
+
"then": { "required": ["authorization"] }
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"if": { "properties": { "state": { "const": "completed" } }, "not": { "required": ["mode"] } },
|
|
137
|
+
"then": { "required": ["podId"] }
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"if": { "required": ["mode"] },
|
|
141
|
+
"then": { "not": { "anyOf": [{ "required": ["podId"] }, { "required": ["authorization"] }] } }
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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": { "required": ["activatedAt"] }
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.mhome.ai/app-facade/pod-discovery.v1.schema.json",
|
|
4
|
+
"title": "Native-client BLE discovery snapshot (pods and Hosts)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["revision", "scanning", "adapter", "candidates"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"revision": { "type": "integer", "minimum": 0 },
|
|
10
|
+
"scanning": { "type": "boolean" },
|
|
11
|
+
"adapter": { "$ref": "#/$defs/adapter" },
|
|
12
|
+
"candidates": { "type": "array", "items": { "$ref": "#/$defs/candidate" } }
|
|
13
|
+
},
|
|
14
|
+
"$defs": {
|
|
15
|
+
"adapter": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"required": ["state"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"state": { "enum": ["ready", "poweredOff", "denied", "unavailable"] },
|
|
21
|
+
"message": { "type": "string" }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"candidate": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": [
|
|
28
|
+
"candidateId",
|
|
29
|
+
"kind",
|
|
30
|
+
"name",
|
|
31
|
+
"shortId",
|
|
32
|
+
"rssi",
|
|
33
|
+
"commissionable",
|
|
34
|
+
"wifiConfigured",
|
|
35
|
+
"lastSeenMs"
|
|
36
|
+
],
|
|
37
|
+
"properties": {
|
|
38
|
+
"candidateId": { "type": "string", "minLength": 1 },
|
|
39
|
+
"kind": { "enum": ["pod", "host"] },
|
|
40
|
+
"name": { "type": "string", "minLength": 1 },
|
|
41
|
+
"model": { "type": "string" },
|
|
42
|
+
"shortId": { "type": "string", "pattern": "^[0-9A-F]{8}$" },
|
|
43
|
+
"rssi": { "type": "integer" },
|
|
44
|
+
"commissionable": { "type": "boolean" },
|
|
45
|
+
"wifiConfigured": { "type": "boolean" },
|
|
46
|
+
"lastSeenMs": { "type": "integer", "minimum": 0 }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|