@fedify/vocab-tools 2.5.0-dev.2664 → 2.5.0-dev.2710

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/src/schema.yaml DELETED
@@ -1,336 +0,0 @@
1
- $schema: "https://json-schema.org/draft/2020-12/schema"
2
- title: Fedify model schema
3
-
4
- $defs:
5
- property:
6
- description: >-
7
- The schema of a property. It is used to generate property accessors of
8
- a class.
9
- anyOf:
10
- - allOf:
11
- - $ref: "#/$defs/property-base"
12
- - $ref: "#/$defs/property-typing"
13
- - type: object
14
- properties:
15
- functional:
16
- description: &functional-description >-
17
- Marks the property that it can have only one value. Turning on
18
- this flag will generate only singular property accessors,
19
- so pluralName and singularAccessor should not be specified.
20
- const: false
21
- pluralName:
22
- description: >-
23
- The plural form of the property name. It is used as the name of
24
- the generated property accessors.
25
- type: string
26
- singularAccessor:
27
- description: >-
28
- Whether to generate singular property accessors. Regardless of
29
- this flag, plural property accessors are generated
30
- (unless functional is turned on).
31
- type: boolean
32
- container:
33
- description: >-
34
- The container type of the property values. It can be unspecified.
35
- enum:
36
- - graph
37
- - list
38
- required:
39
- - pluralName
40
- - allOf:
41
- - $ref: "#/$defs/property-base"
42
- - $ref: "#/$defs/property-typing"
43
- - type: object
44
- properties:
45
- functional:
46
- description: *functional-description
47
- const: true
48
- required:
49
- - functional
50
-
51
- property-base:
52
- type: object
53
- properties:
54
- redundantProperties:
55
- description: >-
56
- Synonyms read after the canonical property in declaration order.
57
- The first non-empty raw value set is selected before decoding values
58
- and containers. Synonyms are never merged or retried on invalid values.
59
- Serialization writes all synonyms by default.
60
- type: array
61
- items:
62
- type: object
63
- properties:
64
- uri:
65
- description: The qualified URI of the property.
66
- type: string
67
- format: uri
68
- compactName:
69
- description: >-
70
- The property name used in the compacted JSON-LD document.
71
- It is used as the key of the property.
72
- type: string
73
- required:
74
- - uri
75
- redundantPropertiesWrite:
76
- description: >-
77
- Whether serialization writes all synonyms or only the canonical
78
- property. Does not change deserialization precedence.
79
- enum:
80
- - all
81
- - canonical
82
- default: all
83
- extraContext:
84
- description: >-
85
- A context URL added to default serialization when this property's
86
- expanded IRI appears in the compacted document. Explicit caller
87
- contexts are unchanged. Populated properties use the JSON-LD
88
- processor instead of compact serialization heuristics.
89
- type: string
90
- format: uri
91
- singularName:
92
- description: >-
93
- The singular form of the property name. It is used as the name of the
94
- generated property accessors.
95
- type: string
96
- uri:
97
- description: The qualified URI of the property.
98
- type: string
99
- format: uri
100
- compactName:
101
- description: >-
102
- The property name used in the compacted JSON-LD document. It is used
103
- as the key of the property.
104
- type: string
105
- subpropertyOf:
106
- description: >-
107
- The qualified URI of the superproperty of the property (if any).
108
- It means that the property is a specialization of the referenced
109
- property.
110
- type: string
111
- format: uri
112
- description:
113
- description: >-
114
- The description of the property. It is used as the doc comment of
115
- the generated property accessors.
116
- type: string
117
- embedContext:
118
- description: >-
119
- Whether the enclosed object should have its own context when
120
- the document is compacted.
121
- type: object
122
- properties:
123
- compactName:
124
- description: >-
125
- The compact name of the property that contains the context.
126
- type: string
127
- inherit:
128
- description: >-
129
- Whether the embedded context should be the same as the context of
130
- the enclosing document.
131
- const: true
132
- preprocessors:
133
- description: >-
134
- Preprocessors for this property. Each preprocessor receives an
135
- expanded JSON-LD property value and may return a vocabulary object
136
- matching the property's declared range, `undefined` when it did not
137
- handle the value, or an `Error` when it recognized the value but
138
- failed while converting it.
139
-
140
- `module` is resolved from the generated vocabulary source file
141
- and imported statically at the top of the generated file.
142
- type: array
143
- items:
144
- type: object
145
- properties:
146
- module:
147
- description: >-
148
- Module specifier resolved from the generated vocabulary
149
- source file.
150
- type: string
151
- minLength: 1
152
- function:
153
- description: The name of the exported function in the module.
154
- type: string
155
- pattern: "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
156
- required:
157
- - module
158
- - function
159
- required:
160
- - singularName
161
- - uri
162
- - description
163
-
164
- property-typing:
165
- anyOf:
166
- - type: object
167
- properties:
168
- untyped:
169
- description: >-
170
- Whether the property value has @type field. If true, the range must
171
- have only one element.
172
- const: false
173
- range:
174
- description: >-
175
- The qualified URIs of all possible types of the property values.
176
- type: array
177
- items:
178
- $ref: "#/$defs/typeUri"
179
- minItems: 1
180
- uniqueItems: true
181
- required:
182
- - range
183
- - type: object
184
- properties:
185
- untyped:
186
- description: >-
187
- Whether the property value has @type field. If true, the range must
188
- have only one element.
189
- const: true
190
- range:
191
- description: >-
192
- The qualified URIs of all possible types of the property values.
193
- type: array
194
- items:
195
- $ref: "#/$defs/typeUri"
196
- minItems: 1
197
- maxItems: 1
198
- required:
199
- - untyped
200
- - range
201
-
202
- typeUri:
203
- description: >-
204
- The qualified URI of a type. It is used as the range of a property.
205
- anyOf:
206
- - type: string
207
- format: uri
208
- - enum:
209
- - fedify:langTag
210
-
211
- ldContext:
212
- anyOf:
213
- - type: string
214
- format: uri
215
- - $ref: "#/$defs/ldEmbeddedContext"
216
- - type: array
217
- items:
218
- anyOf:
219
- - type: string
220
- format: uri
221
- - $ref: "#/$defs/ldEmbeddedContext"
222
- uniqueItems: true
223
-
224
- ldEmbeddedContext:
225
- type: object
226
- patternProperties:
227
- "^.+$":
228
- $ref: "#/$defs/ldTermDefinition"
229
-
230
- ldTermDefinition:
231
- allOf:
232
- - anyOf:
233
- - type: string
234
- format: uri
235
- - type: object
236
- patternProperties:
237
- "^.+$":
238
- anyOf:
239
- - type: string
240
- format: uri
241
- - const: "@id"
242
- - $ref: "#/$defs/ldContainerTermDefinition"
243
- - if:
244
- type: object
245
- required:
246
- - "@container"
247
- then:
248
- $ref: "#/$defs/ldContainerTermDefinition"
249
-
250
- ldContainerTermDefinition:
251
- type: object
252
- properties:
253
- "@id":
254
- type: string
255
- format: uri
256
- "@type":
257
- anyOf:
258
- - type: string
259
- format: uri
260
- - const: "@id"
261
- "@container":
262
- enum:
263
- - "@set"
264
- - "@list"
265
- required:
266
- - "@id"
267
- - "@container"
268
- additionalProperties: false
269
-
270
- description: The schema of a type. It is used to generate a class.
271
- type: object
272
- properties:
273
- name:
274
- description: The type name. It is used as the name of the generated class.
275
- type: string
276
- uri:
277
- description: The qualified URI of the type.
278
- type: string
279
- format: uri
280
- compactName:
281
- description: >-
282
- The type name used in the compacted JSON-LD document. It is used as the
283
- value of the `type` field.
284
- type: string
285
- extends:
286
- description: The qualified URIs of the base type of the type (if any).
287
- type: string
288
- format: uri
289
- entity:
290
- description: >-
291
- Marks the type an entity type rather than a value type. Turning on this
292
- flag will make property accessors for the type asynchronous, so that they
293
- can load the values of the properties from the remote server.
294
-
295
- The extended subtypes must have the consistent value of this flag.
296
- type: boolean
297
- trustEmbeddedObjects:
298
- description: >-
299
- Whether this type's id establishes same-origin trust for its own
300
- embedded entity-valued properties. Defaults to true. Set to false
301
- for metadata ids that do not identify independently fetched resources.
302
- Locally constructed and explicitly trusted values remain trusted.
303
- type: boolean
304
- typeless:
305
- description: >-
306
- Whether the type omits @type in JSON-LD serialization. When true,
307
- the generated toJsonLd() method will not emit @type (or type in
308
- compact form) in the serialized JSON-LD. The generated fromJsonLd()
309
- method will still accept @type if present for backward compatibility.
310
-
311
- This is useful for types that are not real vocabulary types but rather
312
- anonymous object structures (e.g., Endpoints, Source in
313
- ActivityStreams).
314
- type: boolean
315
- description:
316
- description: >-
317
- The description of the type. It is used as the doc comment of
318
- the generated class.
319
- type: string
320
- properties:
321
- description: The possible properties of the type.
322
- type: array
323
- items:
324
- $ref: "#/$defs/property"
325
- uniqueItems: true
326
- defaultContext:
327
- description: >-
328
- The default JSON-LD context of the type. It is used as the default
329
- context of the generated toJsonLd() method.
330
- $ref: "#/$defs/ldContext"
331
- required:
332
- - name
333
- - uri
334
- - entity
335
- - description
336
- - properties