@@ -92,8 +92,9 @@ export class ObjectQL implements IObjectQL {
9292
9393 // Stub legacy accessors
9494 ( this . kernel as any ) . metadata = {
95- register : ( type : string , item : any ) => SchemaRegistry . registerItem ( type , item ) ,
95+ register : ( type : string , item : any ) => SchemaRegistry . registerItem ( type , item , item . id ? 'id' : 'name' ) ,
9696 get : ( type : string , name : string ) => SchemaRegistry . getItem ( type , name ) ,
97+ getEntry : ( type : string , name : string ) => SchemaRegistry . getItem ( type , name ) ,
9798 list : ( type : string ) => SchemaRegistry . listItems ( type ) ,
9899 unregister : ( type : string , name : string ) => {
99100 // Access private static storage using any cast
@@ -318,14 +319,18 @@ export class ObjectQL implements IObjectQL {
318319 }
319320
320321 getObject ( name : string ) : ObjectConfig | undefined {
321- return ( this . kernel as any ) . metadata . get ( 'object' , name ) as ObjectConfig ;
322+ const item = ( this . kernel as any ) . metadata . get ( 'object' , name ) ;
323+ return item ?. content || item ;
322324 }
323325
324326 getConfigs ( ) : Record < string , ObjectConfig > {
325327 const result : Record < string , ObjectConfig > = { } ;
326- const items = ( this . kernel as any ) . metadata . list ( 'object' ) as ObjectConfig [ ] ;
328+ const items = ( this . kernel as any ) . metadata . list ( 'object' ) || [ ] ;
327329 for ( const item of items ) {
328- result [ item . name ] = item ;
330+ const config = item . content || item ;
331+ if ( config ?. name ) {
332+ result [ config . name ] = config ;
333+ }
329334 }
330335 return result ;
331336 }
@@ -428,7 +433,8 @@ export class ObjectQL implements IObjectQL {
428433 }
429434 }
430435
431- const objects = ( this . kernel as any ) . metadata . list ( 'object' ) as ObjectConfig [ ] ;
436+ const registryItems = ( this . kernel as any ) . metadata . list ( 'object' ) ;
437+ const objects = ( registryItems || [ ] ) . map ( ( item : any ) => item . content || item ) as ObjectConfig [ ] ;
432438
433439 // Init Datasources
434440 // Let's pass all objects to all configured drivers.
0 commit comments