Skip to content

Commit e975c20

Browse files
committed
feat(metadata): update metadata schemas and add new options for import/export
1 parent 13167f5 commit e975c20

17 files changed

Lines changed: 554 additions & 1 deletion

content/docs/references/kernel/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"events",
66
"feature",
77
"manifest",
8-
"metadata-loader",
8+
"metadata-persistence",
99
"permission",
1010
"plugin",
1111
"plugin-capability",

examples/plugin-bi/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"zod": "^4.3.6"
2222
},
2323
"devDependencies": {
24+
"@objectstack/cli": "workspace:*",
2425
"typescript": "^5.0.0"
2526
}
2627
}

examples/plugin-crm/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@objectstack/spec": "workspace:*"
1515
},
1616
"devDependencies": {
17+
"@objectstack/cli": "workspace:*",
1718
"typescript": "^5.0.0"
1819
}
1920
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$ref": "#/definitions/MetadataCollectionInfo",
3+
"definitions": {
4+
"MetadataCollectionInfo": {
5+
"type": "object",
6+
"properties": {
7+
"type": {
8+
"type": "string"
9+
},
10+
"count": {
11+
"type": "number"
12+
},
13+
"namespaces": {
14+
"type": "array",
15+
"items": {
16+
"type": "string"
17+
}
18+
}
19+
},
20+
"required": [
21+
"type",
22+
"count",
23+
"namespaces"
24+
],
25+
"additionalProperties": false
26+
}
27+
},
28+
"$schema": "http://json-schema.org/draft-07/schema#"
29+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"$ref": "#/definitions/MetadataExportOptions",
3+
"definitions": {
4+
"MetadataExportOptions": {
5+
"type": "object",
6+
"properties": {
7+
"types": {
8+
"type": "array",
9+
"items": {
10+
"type": "string"
11+
}
12+
},
13+
"namespaces": {
14+
"type": "array",
15+
"items": {
16+
"type": "string"
17+
}
18+
},
19+
"output": {
20+
"type": "string",
21+
"description": "Output directory or file"
22+
},
23+
"format": {
24+
"type": "string",
25+
"enum": [
26+
"json",
27+
"yaml",
28+
"yml",
29+
"ts",
30+
"js"
31+
],
32+
"default": "json"
33+
}
34+
},
35+
"required": [
36+
"output"
37+
],
38+
"additionalProperties": false
39+
}
40+
},
41+
"$schema": "http://json-schema.org/draft-07/schema#"
42+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$ref": "#/definitions/MetadataFormat",
3+
"definitions": {
4+
"MetadataFormat": {
5+
"type": "string",
6+
"enum": [
7+
"json",
8+
"yaml",
9+
"yml",
10+
"ts",
11+
"js"
12+
]
13+
}
14+
},
15+
"$schema": "http://json-schema.org/draft-07/schema#"
16+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$ref": "#/definitions/MetadataImportOptions",
3+
"definitions": {
4+
"MetadataImportOptions": {
5+
"type": "object",
6+
"properties": {
7+
"source": {
8+
"type": "string",
9+
"description": "Input directory or file"
10+
},
11+
"strategy": {
12+
"type": "string",
13+
"enum": [
14+
"merge",
15+
"replace",
16+
"skip"
17+
],
18+
"default": "merge"
19+
},
20+
"validate": {
21+
"type": "boolean",
22+
"default": true
23+
}
24+
},
25+
"required": [
26+
"source"
27+
],
28+
"additionalProperties": false
29+
}
30+
},
31+
"$schema": "http://json-schema.org/draft-07/schema#"
32+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$ref": "#/definitions/MetadataLoadOptions",
3+
"definitions": {
4+
"MetadataLoadOptions": {
5+
"type": "object",
6+
"properties": {
7+
"scope": {
8+
"type": "string",
9+
"enum": [
10+
"system",
11+
"platform",
12+
"user"
13+
]
14+
},
15+
"namespace": {
16+
"type": "string"
17+
},
18+
"raw": {
19+
"type": "boolean",
20+
"description": "Return raw file content instead of parsed JSON"
21+
},
22+
"cache": {
23+
"type": "boolean",
24+
"default": true
25+
}
26+
},
27+
"additionalProperties": false
28+
}
29+
},
30+
"$schema": "http://json-schema.org/draft-07/schema#"
31+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"$ref": "#/definitions/MetadataLoadResult",
3+
"definitions": {
4+
"MetadataLoadResult": {
5+
"type": "object",
6+
"properties": {
7+
"data": {},
8+
"stats": {
9+
"type": "object",
10+
"properties": {
11+
"path": {
12+
"type": "string"
13+
},
14+
"size": {
15+
"type": "number"
16+
},
17+
"mtime": {
18+
"type": "string",
19+
"format": "date-time"
20+
},
21+
"hash": {
22+
"type": "string"
23+
}
24+
},
25+
"additionalProperties": false
26+
},
27+
"format": {
28+
"type": "string",
29+
"enum": [
30+
"json",
31+
"yaml",
32+
"yml",
33+
"ts",
34+
"js"
35+
]
36+
},
37+
"source": {
38+
"type": "string"
39+
}
40+
},
41+
"additionalProperties": false
42+
}
43+
},
44+
"$schema": "http://json-schema.org/draft-07/schema#"
45+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"$ref": "#/definitions/MetadataLoaderContract",
3+
"definitions": {
4+
"MetadataLoaderContract": {
5+
"type": "object",
6+
"properties": {
7+
"name": {
8+
"type": "string"
9+
},
10+
"protocol": {
11+
"type": "string"
12+
},
13+
"description": {
14+
"type": "string"
15+
},
16+
"capabilities": {
17+
"type": "object",
18+
"properties": {
19+
"read": {
20+
"type": "boolean",
21+
"default": true
22+
},
23+
"write": {
24+
"type": "boolean",
25+
"default": false
26+
},
27+
"watch": {
28+
"type": "boolean",
29+
"default": false
30+
},
31+
"list": {
32+
"type": "boolean",
33+
"default": true
34+
}
35+
},
36+
"additionalProperties": false
37+
}
38+
},
39+
"required": [
40+
"name",
41+
"protocol",
42+
"capabilities"
43+
],
44+
"additionalProperties": false
45+
}
46+
},
47+
"$schema": "http://json-schema.org/draft-07/schema#"
48+
}

0 commit comments

Comments
 (0)