@@ -75,12 +75,12 @@ export class ValidatorPlugin implements Plugin {
7575
7676 // Register validation middleware for queries (if enabled)
7777 if ( this . config . enableQueryValidation !== false ) {
78- this . registerQueryValidation ( kernel ) ;
78+ this . registerQueryValidation ( ctx ) ;
7979 }
8080
8181 // Register validation middleware for mutations (if enabled)
8282 if ( this . config . enableMutationValidation !== false ) {
83- this . registerMutationValidation ( kernel ) ;
83+ this . registerMutationValidation ( ctx ) ;
8484 }
8585
8686 console . log ( `[${ this . name } ] Validator plugin installed` ) ;
@@ -90,10 +90,10 @@ export class ValidatorPlugin implements Plugin {
9090 * Register query validation middleware
9191 * @private
9292 */
93- private registerQueryValidation ( kernel : KernelWithValidator ) : void {
94- // Check if kernel supports middleware hooks
95- if ( typeof ( kernel as any ) . use === 'function' ) {
96- ( kernel as any ) . use ( 'beforeQuery' , async ( context : any ) => {
93+ private registerQueryValidation ( ctx : PluginContext ) : void {
94+ // Check if context supports hook registration
95+ if ( typeof ( ctx as any ) . hook === 'function' ) {
96+ ( ctx as any ) . hook ( 'beforeQuery' , async ( context : any ) => {
9797 // Query validation logic
9898 // In a real implementation, this would validate query parameters
9999 // For now, this is a placeholder that demonstrates the integration pattern
@@ -112,10 +112,10 @@ export class ValidatorPlugin implements Plugin {
112112 * Register mutation validation middleware
113113 * @private
114114 */
115- private registerMutationValidation ( kernel : KernelWithValidator ) : void {
116- // Check if kernel supports middleware hooks
117- if ( typeof ( kernel as any ) . use === 'function' ) {
118- ( kernel as any ) . use ( 'beforeMutation' , async ( context : any ) => {
115+ private registerMutationValidation ( ctx : PluginContext ) : void {
116+ // Check if context supports hook registration
117+ if ( typeof ( ctx as any ) . hook === 'function' ) {
118+ ( ctx as any ) . hook ( 'beforeMutation' , async ( context : any ) => {
119119 // Mutation validation logic
120120 // This would validate data before create/update operations
121121 if ( context . data && context . metadata ?. validation_rules ) {
0 commit comments