File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,9 +142,15 @@ export class ObjectQL implements IDataEngine {
142142 * Register contribution (Manifest)
143143 */
144144 registerApp ( manifest : any ) {
145- const id = manifest . id ;
145+ const id = manifest . id || manifest . name ;
146146 this . logger . debug ( 'Registering app manifest' , { id } ) ;
147147
148+ // Register the App Definition itself
149+ if ( manifest . name ) {
150+ SchemaRegistry . registerApp ( manifest ) ;
151+ this . logger . debug ( 'Registered App Definition' , { app : manifest . name } ) ;
152+ }
153+
148154 // Register objects
149155 if ( manifest . objects ) {
150156 if ( Array . isArray ( manifest . objects ) ) {
Original file line number Diff line number Diff line change @@ -110,6 +110,21 @@ export class SchemaRegistry {
110110 return this . listItems < ServiceObject > ( 'object' ) ;
111111 }
112112
113+ /**
114+ * App Helpers
115+ */
116+ static registerApp ( app : any ) {
117+ this . registerItem ( 'app' , app , 'name' ) ;
118+ }
119+
120+ static getApp ( name : string ) : any {
121+ return this . getItem ( 'app' , name ) ;
122+ }
123+
124+ static getAllApps ( ) : any [ ] {
125+ return this . listItems ( 'app' ) ;
126+ }
127+
113128 /**
114129 * Plugin Helpers
115130 */
Original file line number Diff line number Diff line change @@ -191,6 +191,16 @@ export class HttpDispatcher {
191191 if ( parts . length === 1 ) {
192192 const typeOrName = parts [ 0 ] ;
193193
194+ // Special handling for common pluralized types mapping to protocol
195+ if ( [ 'apps' , 'plugins' ] . includes ( typeOrName ) ) {
196+ const singularType = typeOrName . slice ( 0 , - 1 ) ;
197+ const protocol = this . kernel ?. context ?. getService ? this . kernel . context . getService ( 'protocol' ) : null ;
198+ if ( protocol && typeof protocol . getMetaItems === 'function' ) {
199+ const data = await protocol . getMetaItems ( { type : singularType } ) ;
200+ return { handled : true , response : this . success ( data ) } ;
201+ }
202+ }
203+
194204 // Heuristic: if it maps to a known type, list it. Else treat as object name.
195205 if ( [ 'objects' , 'apps' , 'plugins' ] . includes ( typeOrName ) ) {
196206 if ( typeOrName === 'objects' ) {
You can’t perform that action at this time.
0 commit comments