taflor-protocol 0.1.0__py3-none-any.whl
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.
- taflor_protocol/__init__.py +91 -0
- taflor_protocol/conformance/FORMAT.md +117 -0
- taflor_protocol/conformance/v2/core/gm-only-key.yaml +52 -0
- taflor_protocol/conformance/v2/core/join.yaml +37 -0
- taflor_protocol/conformance/v2/core/object-create.yaml +24 -0
- taflor_protocol/conformance/v2/core/object-move.yaml +32 -0
- taflor_protocol/conformance/v2/core/protocol-mismatch.yaml +18 -0
- taflor_protocol/data/capabilities.json +80 -0
- taflor_protocol/schemas/common/v1.json +110 -0
- taflor_protocol/schemas/conformance/v2/scenario.json +320 -0
- taflor_protocol/schemas/extension/v1.json +31 -0
- taflor_protocol/schemas/manifest/v1.json +391 -0
- taflor_protocol/schemas/protocol/v2/capabilities.json +36 -0
- taflor_protocol/schemas/protocol/v2/client/battlemap.remove.json +19 -0
- taflor_protocol/schemas/protocol/v2/client/combat.activate.json +19 -0
- taflor_protocol/schemas/protocol/v2/client/combat.add.json +24 -0
- taflor_protocol/schemas/protocol/v2/client/combat.begin.json +15 -0
- taflor_protocol/schemas/protocol/v2/client/combat.end.json +15 -0
- taflor_protocol/schemas/protocol/v2/client/combat.next.json +15 -0
- taflor_protocol/schemas/protocol/v2/client/combat.prev.json +15 -0
- taflor_protocol/schemas/protocol/v2/client/combat.remove.json +24 -0
- taflor_protocol/schemas/protocol/v2/client/combat.roll.json +48 -0
- taflor_protocol/schemas/protocol/v2/client/combat.set_initiative.json +25 -0
- taflor_protocol/schemas/protocol/v2/client/cursor.json +23 -0
- taflor_protocol/schemas/protocol/v2/client/cursor.leave.json +15 -0
- taflor_protocol/schemas/protocol/v2/client/die.roll.json +19 -0
- taflor_protocol/schemas/protocol/v2/client/die.set.json +26 -0
- taflor_protocol/schemas/protocol/v2/client/doc.create.json +52 -0
- taflor_protocol/schemas/protocol/v2/client/doc.delete.json +23 -0
- taflor_protocol/schemas/protocol/v2/client/doc.subscribe.json +35 -0
- taflor_protocol/schemas/protocol/v2/client/doc.update.json +32 -0
- taflor_protocol/schemas/protocol/v2/client/fog.reset.json +19 -0
- taflor_protocol/schemas/protocol/v2/client/object.convert.json +29 -0
- taflor_protocol/schemas/protocol/v2/client/object.create.json +62 -0
- taflor_protocol/schemas/protocol/v2/client/object.delete.json +19 -0
- taflor_protocol/schemas/protocol/v2/client/object.duplicate.json +31 -0
- taflor_protocol/schemas/protocol/v2/client/object.preview.json +55 -0
- taflor_protocol/schemas/protocol/v2/client/object.update.json +41 -0
- taflor_protocol/schemas/protocol/v2/client/ping.json +23 -0
- taflor_protocol/schemas/protocol/v2/client/plugin.error.json +46 -0
- taflor_protocol/schemas/protocol/v2/client/presence.ping.json +29 -0
- taflor_protocol/schemas/protocol/v2/client/ruler.json +60 -0
- taflor_protocol/schemas/protocol/v2/client/saved_views.set.json +23 -0
- taflor_protocol/schemas/protocol/v2/client/showcase.hide.json +15 -0
- taflor_protocol/schemas/protocol/v2/client/showcase.show.json +19 -0
- taflor_protocol/schemas/protocol/v2/client/table.update.json +28 -0
- taflor_protocol/schemas/protocol/v2/client/tokens.gather.json +23 -0
- taflor_protocol/schemas/protocol/v2/client/view.pull.json +33 -0
- taflor_protocol/schemas/protocol/v2/client-message.json +585 -0
- taflor_protocol/schemas/protocol/v2/common.json +276 -0
- taflor_protocol/schemas/protocol/v2/envelope.json +18 -0
- taflor_protocol/schemas/protocol/v2/error.json +24 -0
- taflor_protocol/schemas/protocol/v2/object.json +76 -0
- taflor_protocol/schemas/protocol/v2/server/combat.json +26 -0
- taflor_protocol/schemas/protocol/v2/server/cursor.json +36 -0
- taflor_protocol/schemas/protocol/v2/server/cursor.leave.json +19 -0
- taflor_protocol/schemas/protocol/v2/server/dice.rolled.json +130 -0
- taflor_protocol/schemas/protocol/v2/server/doc.deleted.json +22 -0
- taflor_protocol/schemas/protocol/v2/server/doc.upserted.json +22 -0
- taflor_protocol/schemas/protocol/v2/server/looks.json +19 -0
- taflor_protocol/schemas/protocol/v2/server/object.converted.json +25 -0
- taflor_protocol/schemas/protocol/v2/server/object.created.json +23 -0
- taflor_protocol/schemas/protocol/v2/server/object.deleted.json +19 -0
- taflor_protocol/schemas/protocol/v2/server/object.duplicated.json +26 -0
- taflor_protocol/schemas/protocol/v2/server/object.preview.json +27 -0
- taflor_protocol/schemas/protocol/v2/server/object.upserted.json +54 -0
- taflor_protocol/schemas/protocol/v2/server/ping.json +36 -0
- taflor_protocol/schemas/protocol/v2/server/presence.json +22 -0
- taflor_protocol/schemas/protocol/v2/server/presence.pong.json +19 -0
- taflor_protocol/schemas/protocol/v2/server/protocol.json +20 -0
- taflor_protocol/schemas/protocol/v2/server/ruler.json +47 -0
- taflor_protocol/schemas/protocol/v2/server/saved_views.updated.json +22 -0
- taflor_protocol/schemas/protocol/v2/server/showcase.json +26 -0
- taflor_protocol/schemas/protocol/v2/server/table.updated.json +19 -0
- taflor_protocol/schemas/protocol/v2/server/tokens.gathered.json +25 -0
- taflor_protocol/schemas/protocol/v2/server/view.pull.json +22 -0
- taflor_protocol/schemas/protocol/v2/server-message.json +425 -0
- taflor_protocol/schemas/protocol/v2/state.json +75 -0
- taflor_protocol/schemas/sheet/v1/message.json +156 -0
- taflor_protocol-0.1.0.dist-info/METADATA +109 -0
- taflor_protocol-0.1.0.dist-info/RECORD +82 -0
- taflor_protocol-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://taflor.org/schemas/conformance/v2/scenario.json",
|
|
4
|
+
"title": "Conformance scenario (protocol v2)",
|
|
5
|
+
"description": "SPEC §13.2: a fixture with seats and objects, then steps send, expect, never and expectClose. The format and the matcher are described in conformance/FORMAT.md.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"scenario",
|
|
9
|
+
"title",
|
|
10
|
+
"capability",
|
|
11
|
+
"protocol",
|
|
12
|
+
"fixture",
|
|
13
|
+
"steps"
|
|
14
|
+
],
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"properties": {
|
|
17
|
+
"scenario": {
|
|
18
|
+
"description": "Unique id within the capability; equals the file name without .yaml.",
|
|
19
|
+
"type": "string",
|
|
20
|
+
"pattern": "^[a-z0-9][a-z0-9-]*$"
|
|
21
|
+
},
|
|
22
|
+
"title": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"minLength": 1
|
|
25
|
+
},
|
|
26
|
+
"description": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
"capability": {
|
|
30
|
+
"description": "The capability these scenarios prove; equals the folder name. A server claims a capability only if it passes all of its scenarios.",
|
|
31
|
+
"$ref": "https://taflor.org/schemas/common/v1.json#/$defs/capabilityName"
|
|
32
|
+
},
|
|
33
|
+
"protocol": {
|
|
34
|
+
"const": 2
|
|
35
|
+
},
|
|
36
|
+
"spec": {
|
|
37
|
+
"description": "SPEC sections the scenario checks, e.g. ['§6.7'].",
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"fixture": {
|
|
44
|
+
"$ref": "#/$defs/fixture"
|
|
45
|
+
},
|
|
46
|
+
"steps": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"minItems": 1,
|
|
49
|
+
"items": {
|
|
50
|
+
"$ref": "#/$defs/step"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"$defs": {
|
|
55
|
+
"ref": {
|
|
56
|
+
"description": "A name for a seat or an object, used as '@name' in steps.",
|
|
57
|
+
"type": "string",
|
|
58
|
+
"pattern": "^[a-z][a-z0-9_]*$"
|
|
59
|
+
},
|
|
60
|
+
"seatRefs": {
|
|
61
|
+
"description": "One seat, a list of seats, or 'all' (every seat that connected).",
|
|
62
|
+
"anyOf": [
|
|
63
|
+
{
|
|
64
|
+
"$ref": "#/$defs/ref"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"type": "array",
|
|
68
|
+
"minItems": 1,
|
|
69
|
+
"uniqueItems": true,
|
|
70
|
+
"items": {
|
|
71
|
+
"$ref": "#/$defs/ref"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"fixture": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"required": [
|
|
79
|
+
"seats"
|
|
80
|
+
],
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"properties": {
|
|
83
|
+
"table": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"properties": {
|
|
87
|
+
"name": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"minLength": 1
|
|
90
|
+
},
|
|
91
|
+
"capabilities": {
|
|
92
|
+
"description": "The table's capabilities. Default: every core capability of the catalogue.",
|
|
93
|
+
"type": "array",
|
|
94
|
+
"uniqueItems": true,
|
|
95
|
+
"items": {
|
|
96
|
+
"$ref": "https://taflor.org/schemas/common/v1.json#/$defs/capabilityName"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"settings": {
|
|
100
|
+
"type": "object"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"seats": {
|
|
105
|
+
"description": "The users at the table, by ref. Seats connect in the order given, before the first step, unless connect is false.",
|
|
106
|
+
"type": "object",
|
|
107
|
+
"minProperties": 1,
|
|
108
|
+
"propertyNames": {
|
|
109
|
+
"allOf": [
|
|
110
|
+
{
|
|
111
|
+
"$ref": "#/$defs/ref"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"not": {
|
|
115
|
+
"const": "all"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"description": "'all' is reserved for steps."
|
|
120
|
+
},
|
|
121
|
+
"additionalProperties": {
|
|
122
|
+
"$ref": "#/$defs/seat"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"objects": {
|
|
126
|
+
"type": "array",
|
|
127
|
+
"items": {
|
|
128
|
+
"$ref": "#/$defs/fixtureObject"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"policies": {
|
|
132
|
+
"description": "Data-key policies the table has for this scenario (SPEC §5.3), as a host or plugin would declare them. Keys without a policy are refused.",
|
|
133
|
+
"type": "array",
|
|
134
|
+
"items": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"required": [
|
|
137
|
+
"kind",
|
|
138
|
+
"key",
|
|
139
|
+
"writable_by",
|
|
140
|
+
"visible_to"
|
|
141
|
+
],
|
|
142
|
+
"additionalProperties": false,
|
|
143
|
+
"properties": {
|
|
144
|
+
"kind": {
|
|
145
|
+
"$ref": "https://taflor.org/schemas/common/v1.json#/$defs/pluginKindId"
|
|
146
|
+
},
|
|
147
|
+
"key": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"minLength": 1
|
|
150
|
+
},
|
|
151
|
+
"writable_by": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"pattern": "^(server|gm|controller|player-permission:[a-z0-9_-]+)$"
|
|
154
|
+
},
|
|
155
|
+
"visible_to": {
|
|
156
|
+
"enum": [
|
|
157
|
+
"all",
|
|
158
|
+
"gm"
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
"hidden_by": {
|
|
162
|
+
"type": "string"
|
|
163
|
+
},
|
|
164
|
+
"when": {
|
|
165
|
+
"type": "object"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"seat": {
|
|
173
|
+
"type": "object",
|
|
174
|
+
"required": [
|
|
175
|
+
"role"
|
|
176
|
+
],
|
|
177
|
+
"additionalProperties": false,
|
|
178
|
+
"properties": {
|
|
179
|
+
"role": {
|
|
180
|
+
"enum": [
|
|
181
|
+
"gm",
|
|
182
|
+
"player",
|
|
183
|
+
"viewer",
|
|
184
|
+
"denied"
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"anonymous": {
|
|
188
|
+
"type": "boolean",
|
|
189
|
+
"default": false,
|
|
190
|
+
"description": "Viewers only: no user id."
|
|
191
|
+
},
|
|
192
|
+
"protocol": {
|
|
193
|
+
"type": "integer",
|
|
194
|
+
"minimum": 0,
|
|
195
|
+
"description": "The ?v= the seat connects with. Default: the scenario's protocol."
|
|
196
|
+
},
|
|
197
|
+
"connect": {
|
|
198
|
+
"type": "boolean",
|
|
199
|
+
"default": true
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"if": {
|
|
203
|
+
"required": [
|
|
204
|
+
"anonymous"
|
|
205
|
+
],
|
|
206
|
+
"properties": {
|
|
207
|
+
"anonymous": {
|
|
208
|
+
"const": true
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"then": {
|
|
213
|
+
"properties": {
|
|
214
|
+
"role": {
|
|
215
|
+
"const": "viewer"
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"fixtureObject": {
|
|
221
|
+
"description": "An object on the table before the first step. Fields not given take the kind's defaults. Seat refs ('@alice') stand for user ids, e.g. in controlled_by.",
|
|
222
|
+
"type": "object",
|
|
223
|
+
"required": [
|
|
224
|
+
"ref",
|
|
225
|
+
"kind"
|
|
226
|
+
],
|
|
227
|
+
"properties": {
|
|
228
|
+
"ref": {
|
|
229
|
+
"$ref": "#/$defs/ref"
|
|
230
|
+
},
|
|
231
|
+
"kind": {
|
|
232
|
+
"$ref": "https://taflor.org/schemas/common/v1.json#/$defs/pluginKindId"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"step": {
|
|
237
|
+
"type": "object",
|
|
238
|
+
"minProperties": 1,
|
|
239
|
+
"maxProperties": 1,
|
|
240
|
+
"properties": {
|
|
241
|
+
"send": {
|
|
242
|
+
"type": "object",
|
|
243
|
+
"required": [
|
|
244
|
+
"from",
|
|
245
|
+
"message"
|
|
246
|
+
],
|
|
247
|
+
"additionalProperties": false,
|
|
248
|
+
"properties": {
|
|
249
|
+
"from": {
|
|
250
|
+
"$ref": "#/$defs/ref"
|
|
251
|
+
},
|
|
252
|
+
"message": {
|
|
253
|
+
"type": "object",
|
|
254
|
+
"required": [
|
|
255
|
+
"type"
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"expect": {
|
|
261
|
+
"type": "object",
|
|
262
|
+
"required": [
|
|
263
|
+
"to",
|
|
264
|
+
"message"
|
|
265
|
+
],
|
|
266
|
+
"additionalProperties": false,
|
|
267
|
+
"properties": {
|
|
268
|
+
"to": {
|
|
269
|
+
"$ref": "#/$defs/seatRefs"
|
|
270
|
+
},
|
|
271
|
+
"message": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"required": [
|
|
274
|
+
"type"
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"never": {
|
|
280
|
+
"type": "object",
|
|
281
|
+
"required": [
|
|
282
|
+
"to",
|
|
283
|
+
"message"
|
|
284
|
+
],
|
|
285
|
+
"additionalProperties": false,
|
|
286
|
+
"properties": {
|
|
287
|
+
"to": {
|
|
288
|
+
"$ref": "#/$defs/seatRefs"
|
|
289
|
+
},
|
|
290
|
+
"message": {
|
|
291
|
+
"type": "object",
|
|
292
|
+
"required": [
|
|
293
|
+
"type"
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"expectClose": {
|
|
299
|
+
"type": "object",
|
|
300
|
+
"required": [
|
|
301
|
+
"to",
|
|
302
|
+
"code"
|
|
303
|
+
],
|
|
304
|
+
"additionalProperties": false,
|
|
305
|
+
"properties": {
|
|
306
|
+
"to": {
|
|
307
|
+
"$ref": "#/$defs/seatRefs"
|
|
308
|
+
},
|
|
309
|
+
"code": {
|
|
310
|
+
"type": "integer",
|
|
311
|
+
"minimum": 1000,
|
|
312
|
+
"maximum": 4999
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"additionalProperties": false
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://taflor.org/schemas/extension/v1.json",
|
|
4
|
+
"title": "Server extension descriptor",
|
|
5
|
+
"description": "SPEC §9.2: the table_extension dict on a server extension's AppConfig, as JSON.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["id", "version", "api", "protocol"],
|
|
8
|
+
"x-taflor-open": "SPEC §9.2 shows an example only: which fields are required (assumed: id, version, api, protocol, since the core MUST check api and protocol), and are unknown fields allowed (assumed: no)? The descriptor has no version field of its own.",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"id": {"$ref": "https://taflor.org/schemas/common/v1.json#/$defs/pluginId"},
|
|
12
|
+
"version": {"$ref": "https://taflor.org/schemas/common/v1.json#/$defs/semver"},
|
|
13
|
+
"api": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 1,
|
|
16
|
+
"description": "A PEP 440 range of taflor_server.api versions, e.g. '>=1.0,<2' (SPEC §9.2)."
|
|
17
|
+
},
|
|
18
|
+
"protocol": {"$ref": "https://taflor.org/schemas/common/v1.json#/$defs/protocolVersions"},
|
|
19
|
+
"plugin": {"$ref": "https://taflor.org/schemas/common/v1.json#/$defs/pluginId"},
|
|
20
|
+
"urls": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$",
|
|
23
|
+
"description": "Dotted path of the URLconf mounted at /x/<id>/."
|
|
24
|
+
},
|
|
25
|
+
"capabilities": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": {"$ref": "https://taflor.org/schemas/common/v1.json#/$defs/capabilityName"},
|
|
28
|
+
"uniqueItems": true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|