@mhome/messaging-protocol 0.14.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/LICENSE +9 -0
- package/README.md +71 -0
- package/fixtures/actor-link-claim-confirm.request.json +1 -0
- package/fixtures/actor-link-claim-confirm.response.json +1 -0
- package/fixtures/actor-link-claim-event.response.json +1 -0
- package/fixtures/actor-link-claim-status.request.json +1 -0
- package/fixtures/actor-link-claim-status.response.json +1 -0
- package/fixtures/actor-link-code-create.request.json +1 -0
- package/fixtures/actor-link-code-create.response.json +1 -0
- package/fixtures/actor-link-delete.request.json +1 -0
- package/fixtures/actor-link-delete.response.json +1 -0
- package/fixtures/actor-link-list.request.json +1 -0
- package/fixtures/actor-link-list.response.json +1 -0
- package/fixtures/invalid/mismatched-direction.json +5 -0
- package/fixtures/invalid/missing-required-extension.json +5 -0
- package/fixtures/invalid/unknown-request-field.json +5 -0
- package/fixtures/messaging-commands.conformance.json +20 -0
- package/fixtures/normalized-inbound.conformance.json +148 -0
- package/fixtures/normalized-inbound.shared-text.json +25 -0
- package/fixtures/provider-account-delete.request.json +9 -0
- package/fixtures/provider-account-delete.response.json +5 -0
- package/fixtures/provider-account-list.request.json +5 -0
- package/fixtures/provider-account-list.response.json +21 -0
- package/fixtures/provider-account-status.request.json +5 -0
- package/fixtures/provider-account-status.response.json +12 -0
- package/fixtures/provider-account-test.request.json +5 -0
- package/fixtures/provider-account-test.response.json +5 -0
- package/fixtures/provider-account-update.request.json +10 -0
- package/fixtures/provider-account-update.response.json +15 -0
- package/fixtures/provider-list.request.json +14 -0
- package/fixtures/provider-list.response.json +31 -0
- package/fixtures/route-delete.request.json +5 -0
- package/fixtures/route-delete.response.json +5 -0
- package/fixtures/route-list.request.json +5 -0
- package/fixtures/route-list.response.json +37 -0
- package/fixtures/route-update.request.json +12 -0
- package/fixtures/route-update.response.json +20 -0
- package/fixtures/setup-options.request.json +5 -0
- package/fixtures/setup-options.response.json +5 -0
- package/fixtures/setup-start.request.json +9 -0
- package/fixtures/setup-start.response.json +12 -0
- package/fixtures/setup-status.request.json +5 -0
- package/fixtures/setup-status.response.json +14 -0
- package/fixtures/shared-account-grant-create.request.json +5 -0
- package/fixtures/shared-account-grant-create.response.json +5 -0
- package/fixtures/shared-account-grant-delete.request.json +5 -0
- package/fixtures/shared-account-grant-delete.response.json +5 -0
- package/fixtures/shared-account-grant-list.request.json +5 -0
- package/fixtures/shared-account-grant-list.response.json +9 -0
- package/fixtures/surface-bind-code-create.request.json +1 -0
- package/fixtures/surface-bind-code-create.response.json +1 -0
- package/fixtures/surface-dismiss.request.json +1 -0
- package/fixtures/surface-dismiss.response.json +1 -0
- package/fixtures/surface-list.request.json +1 -0
- package/fixtures/surface-list.response.json +1 -0
- package/manifest/targets.v1.json +57 -0
- package/package.json +43 -0
- package/protocol.json +16 -0
- package/schema/messaging-commands.v1.schema.json +67 -0
- package/schema/messaging-frame.v3.schema.json +2534 -0
- package/schema/normalized-inbound.v4.schema.json +117 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "urn:mhome:messaging-api:normalized-inbound:v4",
|
|
4
|
+
"title": "mHome normalized messaging inbound v4",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "eventId", "address", "actor", "content"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": 4 },
|
|
10
|
+
"eventId": { "$ref": "#/$defs/id" },
|
|
11
|
+
"address": { "$ref": "#/$defs/address" },
|
|
12
|
+
"actor": { "$ref": "#/$defs/actor" },
|
|
13
|
+
"content": { "$ref": "#/$defs/content" },
|
|
14
|
+
"conversationDisplayName": { "$ref": "#/$defs/id" },
|
|
15
|
+
"occurredAtMs": { "type": "integer", "minimum": 0 }
|
|
16
|
+
},
|
|
17
|
+
"$defs": {
|
|
18
|
+
"id": { "type": "string", "minLength": 1, "pattern": "^\\S(?:.*\\S)?$" },
|
|
19
|
+
"text": { "type": "string", "minLength": 1 },
|
|
20
|
+
"providerId": { "type": "string", "pattern": "^[a-z][a-z0-9_]*$" },
|
|
21
|
+
"address": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": false,
|
|
24
|
+
"required": ["provider", "accountId", "conversationId", "audience"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"provider": { "$ref": "#/$defs/providerId" },
|
|
27
|
+
"accountId": { "$ref": "#/$defs/id" },
|
|
28
|
+
"conversationId": { "$ref": "#/$defs/id" },
|
|
29
|
+
"laneId": { "$ref": "#/$defs/id" },
|
|
30
|
+
"audience": { "enum": ["personal", "shared"] }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"actor": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["provider", "accountId", "externalUserId"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"provider": { "$ref": "#/$defs/providerId" },
|
|
39
|
+
"accountId": { "$ref": "#/$defs/id" },
|
|
40
|
+
"externalUserId": { "$ref": "#/$defs/id" },
|
|
41
|
+
"displayName": { "$ref": "#/$defs/id" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"media": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["handle", "kind"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"handle": { "$ref": "#/$defs/id" },
|
|
50
|
+
"kind": { "enum": ["image", "audio", "video", "file"] },
|
|
51
|
+
"mimeType": { "$ref": "#/$defs/id" },
|
|
52
|
+
"sizeBytes": { "type": "integer", "minimum": 1 },
|
|
53
|
+
"fileName": { "$ref": "#/$defs/id" },
|
|
54
|
+
"durationMs": { "type": "integer", "minimum": 1 },
|
|
55
|
+
"widthPx": { "type": "integer", "minimum": 1 },
|
|
56
|
+
"heightPx": { "type": "integer", "minimum": 1 },
|
|
57
|
+
"caption": { "$ref": "#/$defs/id" },
|
|
58
|
+
"transcript": { "$ref": "#/$defs/id" }
|
|
59
|
+
},
|
|
60
|
+
"dependentRequired": {
|
|
61
|
+
"widthPx": ["heightPx"],
|
|
62
|
+
"heightPx": ["widthPx"]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"part": {
|
|
66
|
+
"oneOf": [
|
|
67
|
+
{
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": ["type", "text"],
|
|
71
|
+
"properties": {
|
|
72
|
+
"type": { "const": "text" },
|
|
73
|
+
"text": { "$ref": "#/$defs/text" }
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"type": "object",
|
|
78
|
+
"additionalProperties": false,
|
|
79
|
+
"required": ["type", "reference"],
|
|
80
|
+
"properties": {
|
|
81
|
+
"type": { "const": "media" },
|
|
82
|
+
"reference": { "$ref": "#/$defs/media" }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"content": {
|
|
88
|
+
"oneOf": [
|
|
89
|
+
{
|
|
90
|
+
"type": "object",
|
|
91
|
+
"additionalProperties": false,
|
|
92
|
+
"required": ["type", "attention", "parts"],
|
|
93
|
+
"properties": {
|
|
94
|
+
"type": { "const": "message" },
|
|
95
|
+
"providerMessageId": { "$ref": "#/$defs/id" },
|
|
96
|
+
"attention": { "enum": ["addressed", "unaddressed", "unknown"] },
|
|
97
|
+
"parts": {
|
|
98
|
+
"type": "array",
|
|
99
|
+
"minItems": 1,
|
|
100
|
+
"maxItems": 16,
|
|
101
|
+
"items": { "$ref": "#/$defs/part" }
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "object",
|
|
107
|
+
"additionalProperties": false,
|
|
108
|
+
"required": ["type", "token"],
|
|
109
|
+
"properties": {
|
|
110
|
+
"type": { "const": "action_selected" },
|
|
111
|
+
"token": { "$ref": "#/$defs/id" }
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|