Skip to content

Commit b7c098f

Browse files
Copilothotlong
andcommitted
Add optional metadata fields to 8 top-level entity schemas for extensibility
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent ece1688 commit b7c098f

4 files changed

Lines changed: 32 additions & 0 deletions

File tree

packages/spec/src/api/discovery.zod.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ export const DiscoverySchema = z.object({
6969
supported: z.array(z.string()),
7070
timezone: z.string(),
7171
}),
72+
73+
/**
74+
* Custom metadata key-value pairs for extensibility
75+
*/
76+
metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata key-value pairs for extensibility'),
7277
});
7378

7479
export type DiscoveryResponse = z.infer<typeof DiscoverySchema>;

packages/spec/src/hub/hub-federation.zod.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ export const RegionSchema = z.object({
8383
maxTenants: z.number().int().positive().optional(),
8484
maxStorage: z.number().int().positive().optional().describe('Bytes'),
8585
}).optional(),
86+
87+
/**
88+
* Custom metadata key-value pairs for extensibility
89+
*/
90+
metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata key-value pairs for extensibility'),
8691
});
8792

8893
export type Region = z.infer<typeof RegionSchema>;
@@ -159,6 +164,11 @@ export const HubInstanceSchema = z.object({
159164
*/
160165
createdAt: z.string().datetime(),
161166
updatedAt: z.string().datetime(),
167+
168+
/**
169+
* Custom metadata key-value pairs for extensibility
170+
*/
171+
metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata key-value pairs for extensibility'),
162172
});
163173

164174
export type HubInstance = z.infer<typeof HubInstanceSchema>;
@@ -255,6 +265,11 @@ export const FederationTopologySchema = z.object({
255265
*/
256266
conflictResolution: z.enum(['last-write-wins', 'primary-wins', 'manual']).default('last-write-wins'),
257267
}),
268+
269+
/**
270+
* Custom metadata key-value pairs for extensibility
271+
*/
272+
metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata key-value pairs for extensibility'),
258273
});
259274

260275
export type FederationTopology = z.infer<typeof FederationTopologySchema>;
@@ -503,6 +518,11 @@ export const EdgeLocationSchema = z.object({
503518
* Status
504519
*/
505520
status: z.enum(['active', 'inactive']).default('active'),
521+
522+
/**
523+
* Custom metadata key-value pairs for extensibility
524+
*/
525+
metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata key-value pairs for extensibility'),
506526
});
507527

508528
export type EdgeLocation = z.infer<typeof EdgeLocationSchema>;

packages/spec/src/kernel/plugin-structure.zod.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export const OpsFilePathSchema = z.string().describe('Validates a file path agai
7979
export const OpsDomainModuleSchema = z.object({
8080
name: z.string().regex(SNAKE_CASE_REGEX).describe('Module name (snake_case)'),
8181
files: z.array(z.string()).describe('List of files in this module'),
82+
metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata key-value pairs for extensibility'),
8283
}).describe('Scanned domain module representing a plugin folder').superRefine((module, ctx) => {
8384
// Rule: Must have an index.ts
8485
if (!module.files.includes('index.ts')) {
@@ -95,6 +96,7 @@ export const OpsDomainModuleSchema = z.object({
9596
export const OpsPluginStructureSchema = z.object({
9697
root: z.string().describe('Root directory path of the plugin project'),
9798
files: z.array(z.string()).describe('List of all file paths relative to root'),
99+
metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata key-value pairs for extensibility'),
98100
}).describe('Full plugin project layout validated against OPS conventions').superRefine((project, ctx) => {
99101
// Check for configuration file
100102
if (!project.files.includes('objectstack.config.ts')) {

packages/spec/src/system/change-management.zod.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ export const ChangeRequestSchema = z.object({
361361
*/
362362
url: z.string().url().describe('Attachment URL'),
363363
})).optional().describe('Attachments'),
364+
365+
/**
366+
* Custom metadata key-value pairs for extensibility
367+
*/
368+
metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata key-value pairs for extensibility'),
364369
});
365370

366371
// Type exports

0 commit comments

Comments
 (0)