File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,42 @@ console.log('--- Plugins Loaded ---');
2020
2121// 3. Define Unified Routes
2222
23+ /**
24+ * System Discovery API
25+ * GET /api/v1
26+ */
27+ app . get ( '/api/v1' , ( c ) => {
28+ return c . json ( {
29+ name : 'ObjectOS Local Server' ,
30+ version : '1.0.0' ,
31+ environment : 'development' ,
32+ routes : {
33+ discovery : '/api/v1' ,
34+ metadata : '/api/v1/meta' ,
35+ data : '/api/v1/data' ,
36+ auth : '/api/v1/auth'
37+ } ,
38+ capabilities : {
39+ search : true ,
40+ files : true
41+ }
42+ } ) ;
43+ } ) ;
44+
45+ /**
46+ * Metadata Discovery API: List all available metadata types
47+ * GET /api/v1/meta
48+ */
49+ app . get ( '/api/v1/meta' , ( c ) => {
50+ const types = SchemaRegistry . getRegisteredTypes ( ) ;
51+ const summary = types . map ( type => ( {
52+ type : type ,
53+ href : `/api/v1/meta/${ type } ` ,
54+ count : SchemaRegistry . listItems ( type ) . length
55+ } ) ) ;
56+ return c . json ( { data : summary } ) ;
57+ } ) ;
58+
2359/**
2460 * Unified Metadata API: List Items by Type
2561 * GET /api/v1/meta/objects
Original file line number Diff line number Diff line change @@ -42,6 +42,13 @@ export class SchemaRegistry {
4242 return Array . from ( this . metadata . get ( type ) ?. values ( ) || [ ] ) as T [ ] ;
4343 }
4444
45+ /**
46+ * Get all registered metadata types (Kinds)
47+ */
48+ static getRegisteredTypes ( ) : string [ ] {
49+ return Array . from ( this . metadata . keys ( ) ) ;
50+ }
51+
4552 // ==========================================
4653 // Typed Helper Methods (Shortcuts)
4754 // ==========================================
You can’t perform that action at this time.
0 commit comments