Skip to content

Commit 427bc7f

Browse files
committed
feat(metadata): update schemas to include new properties and optional fields
1 parent b319c36 commit 427bc7f

7 files changed

Lines changed: 67 additions & 3 deletions

File tree

packages/spec/json-schema/system/MetadataLoadOptions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
"description": "Return raw file content instead of parsed JSON"
2121
},
2222
"cache": {
23-
"type": "boolean",
24-
"default": true
23+
"type": "boolean"
2524
},
2625
"useCache": {
2726
"type": "boolean"

packages/spec/json-schema/system/MetadataLoadResult.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@
2727
"modifiedAt": {
2828
"type": "string",
2929
"format": "date-time"
30+
},
31+
"format": {
32+
"type": "string",
33+
"enum": [
34+
"json",
35+
"yaml",
36+
"yml",
37+
"ts",
38+
"js",
39+
"typescript",
40+
"javascript"
41+
]
3042
}
3143
},
3244
"additionalProperties": false
@@ -51,6 +63,9 @@
5163
},
5264
"etag": {
5365
"type": "string"
66+
},
67+
"notModified": {
68+
"type": "boolean"
5469
}
5570
},
5671
"additionalProperties": false

packages/spec/json-schema/system/MetadataLoaderContract.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"type": "string"
2020
}
2121
},
22+
"supportsWatch": {
23+
"type": "boolean"
24+
},
2225
"capabilities": {
2326
"type": "object",
2427
"properties": {

packages/spec/json-schema/system/MetadataSaveResult.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,27 @@
3232
"modifiedAt": {
3333
"type": "string",
3434
"format": "date-time"
35+
},
36+
"format": {
37+
"type": "string",
38+
"enum": [
39+
"json",
40+
"yaml",
41+
"yml",
42+
"ts",
43+
"js",
44+
"typescript",
45+
"javascript"
46+
]
3547
}
3648
},
3749
"additionalProperties": false
3850
},
3951
"etag": {
4052
"type": "string"
53+
},
54+
"size": {
55+
"type": "number"
4156
}
4257
},
4358
"required": [

packages/spec/json-schema/system/MetadataStats.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@
2323
"modifiedAt": {
2424
"type": "string",
2525
"format": "date-time"
26+
},
27+
"format": {
28+
"type": "string",
29+
"enum": [
30+
"json",
31+
"yaml",
32+
"yml",
33+
"ts",
34+
"js",
35+
"typescript",
36+
"javascript"
37+
]
2638
}
2739
},
2840
"additionalProperties": false

packages/spec/json-schema/system/MetadataWatchEvent.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,24 @@
4040
"modifiedAt": {
4141
"type": "string",
4242
"format": "date-time"
43+
},
44+
"format": {
45+
"type": "string",
46+
"enum": [
47+
"json",
48+
"yaml",
49+
"yml",
50+
"ts",
51+
"js",
52+
"typescript",
53+
"javascript"
54+
]
4355
}
4456
},
4557
"additionalProperties": false
58+
},
59+
"metadataType": {
60+
"type": "string"
4661
}
4762
},
4863
"required": [

packages/spec/src/system/metadata-persistence.zod.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export const MetadataStatsSchema = z.object({
105105
hash: z.string().optional(),
106106
etag: z.string().optional(),
107107
modifiedAt: z.date().optional(), // Alias for mtime
108+
format: MetadataFormatSchema.optional(),
108109
});
109110

110111
/**
@@ -116,6 +117,7 @@ export const MetadataLoaderContractSchema = z.object({
116117
protocol: z.string(), // e.g. 'file:', 'http:', 's3:'
117118
description: z.string().optional(),
118119
supportedFormats: z.array(z.string()).optional(),
120+
supportsWatch: z.boolean().optional(),
119121
capabilities: z.object({
120122
read: z.boolean().default(true),
121123
write: z.boolean().default(false),
@@ -131,7 +133,7 @@ export const MetadataLoadOptionsSchema = z.object({
131133
scope: MetadataScopeSchema.optional(),
132134
namespace: z.string().optional(),
133135
raw: z.boolean().optional().describe('Return raw file content instead of parsed JSON'),
134-
cache: z.boolean().default(true),
136+
cache: z.boolean().optional(),
135137
useCache: z.boolean().optional(), // Alias for cache
136138
validate: z.boolean().optional(),
137139
ifNoneMatch: z.string().optional(), // For caching
@@ -150,6 +152,7 @@ export const MetadataLoadResultSchema = z.object({
150152
source: z.string().optional(), // File path or URL
151153
fromCache: z.boolean().optional(),
152154
etag: z.string().optional(),
155+
notModified: z.boolean().optional(),
153156
});
154157

155158
/**
@@ -175,6 +178,7 @@ export const MetadataSaveResultSchema = z.object({
175178
path: z.string().optional(),
176179
stats: MetadataStatsSchema.optional(),
177180
etag: z.string().optional(),
181+
size: z.number().optional(),
178182
});
179183

180184
/**
@@ -184,6 +188,7 @@ export const MetadataWatchEventSchema = z.object({
184188
type: z.enum(['add', 'change', 'unlink', 'added', 'changed', 'deleted']),
185189
path: z.string(),
186190
stats: MetadataStatsSchema.optional(),
191+
metadataType: z.string().optional(),
187192
});
188193

189194
/**

0 commit comments

Comments
 (0)