@fedify/vocab-tools 2.0.0-pr.458.1791 → 2.0.0-pr.467.1876
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/deno.json +1 -1
- package/dist/mod.cjs +1 -1
- package/dist/mod.js +1 -1
- package/dist/schema.yaml +247 -0
- package/package.json +20 -2
- package/tsdown.config.ts +11 -0
package/deno.json
CHANGED
package/dist/mod.cjs
CHANGED
|
@@ -31,7 +31,7 @@ const es_toolkit = __toESM(require("es-toolkit"));
|
|
|
31
31
|
|
|
32
32
|
//#region deno.json
|
|
33
33
|
var name = "@fedify/vocab-tools";
|
|
34
|
-
var version = "2.0.0-pr.
|
|
34
|
+
var version = "2.0.0-pr.467.1876+1fd56163";
|
|
35
35
|
var license = "MIT";
|
|
36
36
|
var exports$1 = { ".": "./src/mod.ts" };
|
|
37
37
|
var author = {
|
package/dist/mod.js
CHANGED
|
@@ -8,7 +8,7 @@ import { pascalCase } from "es-toolkit";
|
|
|
8
8
|
|
|
9
9
|
//#region deno.json
|
|
10
10
|
var name = "@fedify/vocab-tools";
|
|
11
|
-
var version = "2.0.0-pr.
|
|
11
|
+
var version = "2.0.0-pr.467.1876+1fd56163";
|
|
12
12
|
var license = "MIT";
|
|
13
13
|
var exports = { ".": "./src/mod.ts" };
|
|
14
14
|
var author = {
|
package/dist/schema.yaml
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
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
|
+
redundantProperties::
|
|
49
|
+
description: >-
|
|
50
|
+
If it's present, those redundant properties are also filled with
|
|
51
|
+
the same value altogether when the object is serialized into
|
|
52
|
+
JSON-LD. When it's deserialized from JSON-LD, it tries to
|
|
53
|
+
parse the values of the specified properties in order.
|
|
54
|
+
type: array
|
|
55
|
+
items:
|
|
56
|
+
type: object
|
|
57
|
+
properties:
|
|
58
|
+
uri:
|
|
59
|
+
description: The qualified URI of the property.
|
|
60
|
+
type: string
|
|
61
|
+
format: uri
|
|
62
|
+
compactName:
|
|
63
|
+
description: >-
|
|
64
|
+
The property name used in the compacted JSON-LD document.
|
|
65
|
+
It is used as the key of the property.
|
|
66
|
+
type: string
|
|
67
|
+
required:
|
|
68
|
+
- uri
|
|
69
|
+
required:
|
|
70
|
+
- functional
|
|
71
|
+
|
|
72
|
+
property-base:
|
|
73
|
+
type: object
|
|
74
|
+
properties:
|
|
75
|
+
singularName:
|
|
76
|
+
description: >-
|
|
77
|
+
The singular form of the property name. It is used as the name of the
|
|
78
|
+
generated property accessors.
|
|
79
|
+
type: string
|
|
80
|
+
uri:
|
|
81
|
+
description: The qualified URI of the property.
|
|
82
|
+
type: string
|
|
83
|
+
format: uri
|
|
84
|
+
compactName:
|
|
85
|
+
description: >-
|
|
86
|
+
The property name used in the compacted JSON-LD document. It is used
|
|
87
|
+
as the key of the property.
|
|
88
|
+
type: string
|
|
89
|
+
subpropertyOf:
|
|
90
|
+
description: >-
|
|
91
|
+
The qualified URI of the superproperty of the property (if any).
|
|
92
|
+
It means that the property is a specialization of the referenced
|
|
93
|
+
property.
|
|
94
|
+
type: string
|
|
95
|
+
format: uri
|
|
96
|
+
description:
|
|
97
|
+
description: >-
|
|
98
|
+
The description of the property. It is used as the doc comment of
|
|
99
|
+
the generated property accessors.
|
|
100
|
+
type: string
|
|
101
|
+
embedContext:
|
|
102
|
+
description: >-
|
|
103
|
+
Whether the enclosed object should have its own context when
|
|
104
|
+
the document is compacted.
|
|
105
|
+
type: object
|
|
106
|
+
properties:
|
|
107
|
+
compactName:
|
|
108
|
+
description: >-
|
|
109
|
+
The compact name of the property that contains the context.
|
|
110
|
+
type: string
|
|
111
|
+
inherit:
|
|
112
|
+
description: >-
|
|
113
|
+
Whether the embedded context should be the same as the context of
|
|
114
|
+
the enclosing document.
|
|
115
|
+
const: true
|
|
116
|
+
required:
|
|
117
|
+
- singularName
|
|
118
|
+
- uri
|
|
119
|
+
- description
|
|
120
|
+
|
|
121
|
+
property-typing:
|
|
122
|
+
anyOf:
|
|
123
|
+
- type: object
|
|
124
|
+
properties:
|
|
125
|
+
untyped:
|
|
126
|
+
description: >-
|
|
127
|
+
Whether the property value has @type field. If true, the range must
|
|
128
|
+
have only one element.
|
|
129
|
+
const: false
|
|
130
|
+
range:
|
|
131
|
+
description: >-
|
|
132
|
+
The qualified URIs of all possible types of the property values.
|
|
133
|
+
type: array
|
|
134
|
+
items:
|
|
135
|
+
$ref: "#/$defs/typeUri"
|
|
136
|
+
minItems: 1
|
|
137
|
+
uniqueItems: true
|
|
138
|
+
required:
|
|
139
|
+
- range
|
|
140
|
+
- type: object
|
|
141
|
+
properties:
|
|
142
|
+
untyped:
|
|
143
|
+
description: >-
|
|
144
|
+
Whether the property value has @type field. If true, the range must
|
|
145
|
+
have only one element.
|
|
146
|
+
const: true
|
|
147
|
+
range:
|
|
148
|
+
description: >-
|
|
149
|
+
The qualified URIs of all possible types of the property values.
|
|
150
|
+
type: array
|
|
151
|
+
items:
|
|
152
|
+
$ref: "#/$defs/typeUri"
|
|
153
|
+
minItems: 1
|
|
154
|
+
maxItems: 1
|
|
155
|
+
required:
|
|
156
|
+
- untyped
|
|
157
|
+
- range
|
|
158
|
+
|
|
159
|
+
typeUri:
|
|
160
|
+
description: >-
|
|
161
|
+
The qualified URI of a type. It is used as the range of a property.
|
|
162
|
+
anyOf:
|
|
163
|
+
- type: string
|
|
164
|
+
format: uri
|
|
165
|
+
- enum:
|
|
166
|
+
- fedify:langTag
|
|
167
|
+
|
|
168
|
+
ldContext:
|
|
169
|
+
anyOf:
|
|
170
|
+
- type: string
|
|
171
|
+
format: uri
|
|
172
|
+
- $ref: "#/$defs/ldEmbeddedContext"
|
|
173
|
+
- type: array
|
|
174
|
+
items:
|
|
175
|
+
anyOf:
|
|
176
|
+
- type: string
|
|
177
|
+
format: uri
|
|
178
|
+
- $ref: "#/$defs/ldEmbeddedContext"
|
|
179
|
+
uniqueItems: true
|
|
180
|
+
|
|
181
|
+
ldEmbeddedContext:
|
|
182
|
+
type: object
|
|
183
|
+
patternProperties:
|
|
184
|
+
"^.+$":
|
|
185
|
+
$ref: "#/$defs/ldTermDefinition"
|
|
186
|
+
|
|
187
|
+
ldTermDefinition:
|
|
188
|
+
anyOf:
|
|
189
|
+
- type: string
|
|
190
|
+
format: uri
|
|
191
|
+
- type: object
|
|
192
|
+
patternProperties:
|
|
193
|
+
"^.+$":
|
|
194
|
+
anyOf:
|
|
195
|
+
- type: string
|
|
196
|
+
format: uri
|
|
197
|
+
- const: "@id"
|
|
198
|
+
|
|
199
|
+
description: The schema of a type. It is used to generate a class.
|
|
200
|
+
type: object
|
|
201
|
+
properties:
|
|
202
|
+
name:
|
|
203
|
+
description: The type name. It is used as the name of the generated class.
|
|
204
|
+
type: string
|
|
205
|
+
uri:
|
|
206
|
+
description: The qualified URI of the type.
|
|
207
|
+
type: string
|
|
208
|
+
format: uri
|
|
209
|
+
compactName:
|
|
210
|
+
description: >-
|
|
211
|
+
The type name used in the compacted JSON-LD document. It is used as the
|
|
212
|
+
value of the `type` field.
|
|
213
|
+
type: string
|
|
214
|
+
extends:
|
|
215
|
+
description: The qualified URIs of the base type of the type (if any).
|
|
216
|
+
type: string
|
|
217
|
+
format: uri
|
|
218
|
+
entity:
|
|
219
|
+
description: >-
|
|
220
|
+
Marks the type an entity type rather than a value type. Turning on this
|
|
221
|
+
flag will make property accessors for the type asynchronous, so that they
|
|
222
|
+
can load the values of the properties from the remote server.
|
|
223
|
+
|
|
224
|
+
The extended subtypes must have the consistent value of this flag.
|
|
225
|
+
type: boolean
|
|
226
|
+
description:
|
|
227
|
+
description: >-
|
|
228
|
+
The description of the type. It is used as the doc comment of
|
|
229
|
+
the generated class.
|
|
230
|
+
type: string
|
|
231
|
+
properties:
|
|
232
|
+
description: The possible properties of the type.
|
|
233
|
+
type: array
|
|
234
|
+
items:
|
|
235
|
+
$ref: "#/$defs/property"
|
|
236
|
+
uniqueItems: true
|
|
237
|
+
defaultContext:
|
|
238
|
+
description: >-
|
|
239
|
+
The default JSON-LD context of the type. It is used as the default
|
|
240
|
+
context of the generated toJsonLd() method.
|
|
241
|
+
$ref: "#/$defs/ldContext"
|
|
242
|
+
required:
|
|
243
|
+
- name
|
|
244
|
+
- uri
|
|
245
|
+
- entity
|
|
246
|
+
- description
|
|
247
|
+
- properties
|
package/package.json
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/vocab-tools",
|
|
3
|
-
"version": "2.0.0-pr.
|
|
3
|
+
"version": "2.0.0-pr.467.1876+1fd56163",
|
|
4
4
|
"description": "Code generator for Activity Vocabulary APIs",
|
|
5
|
+
"homepage": "https://fedify.dev/",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/fedify-dev/fedify.git",
|
|
9
|
+
"directory": "packages/vocab-tools"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/fedify-dev/fedify/issues"
|
|
13
|
+
},
|
|
14
|
+
"funding": [
|
|
15
|
+
"https://opencollective.com/fedify",
|
|
16
|
+
"https://github.com/sponsors/dahlia"
|
|
17
|
+
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"deno": ">=2.0.0",
|
|
20
|
+
"node": ">=22.0.0",
|
|
21
|
+
"bun": ">=1.1.0"
|
|
22
|
+
},
|
|
5
23
|
"type": "module",
|
|
6
24
|
"main": "./dist/mod.cjs",
|
|
7
25
|
"module": "./dist/mod.js",
|
|
@@ -33,7 +51,7 @@
|
|
|
33
51
|
"devDependencies": {
|
|
34
52
|
"@types/node": "^22.17.0",
|
|
35
53
|
"tsdown": "^0.12.9",
|
|
36
|
-
"typescript": "^5.9.
|
|
54
|
+
"typescript": "^5.9.3"
|
|
37
55
|
},
|
|
38
56
|
"dependencies": {
|
|
39
57
|
"@cfworker/json-schema": "^4.1.1",
|
package/tsdown.config.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { cp } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
1
3
|
import { defineConfig } from "tsdown";
|
|
2
4
|
|
|
3
5
|
export default defineConfig({
|
|
@@ -6,4 +8,13 @@ export default defineConfig({
|
|
|
6
8
|
format: ["esm", "cjs"],
|
|
7
9
|
platform: "node",
|
|
8
10
|
external: [/^node:/],
|
|
11
|
+
hooks: {
|
|
12
|
+
"build:done": async (ctx) => {
|
|
13
|
+
await cp(
|
|
14
|
+
join("src", "schema.yaml"),
|
|
15
|
+
join(ctx.options.outDir, "schema.yaml"),
|
|
16
|
+
{ force: true },
|
|
17
|
+
);
|
|
18
|
+
},
|
|
19
|
+
},
|
|
9
20
|
});
|