Skip to content

Commit f99abfd

Browse files
Copilothotlong
andcommitted
Fix remaining TypeScript errors: use issues instead of errors, change silent to error log level
- Fix ZodError.errors to ZodError.issues for Zod 4.x compatibility - Change test log level from 'silent' to 'error' (silent not supported) - Fix getService mock type signature with generic parameter Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 81f8404 commit f99abfd

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

packages/core/src/security/plugin-config-validator.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('PluginConfigValidator', () => {
99
let logger: ReturnType<typeof createLogger>;
1010

1111
beforeEach(() => {
12-
logger = createLogger({ level: 'silent' });
12+
logger = createLogger({ level: 'error' });
1313
validator = new PluginConfigValidator(logger);
1414
});
1515

packages/core/src/security/plugin-config-validator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ export class PluginConfigValidator {
172172

173173
// Private methods
174174

175-
private formatZodErrors(error: z.ZodError): Array<{path: string; message: string}> {
176-
return error.errors.map((e: z.ZodIssue) => ({
175+
private formatZodErrors(error: z.ZodError<any>): Array<{path: string; message: string}> {
176+
return error.issues.map((e: z.ZodIssue) => ({
177177
path: e.path.join('.') || 'root',
178178
message: e.message,
179179
}));

packages/core/src/security/plugin-permission-enforcer.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('PluginPermissionEnforcer', () => {
99
let logger: ReturnType<typeof createLogger>;
1010

1111
beforeEach(() => {
12-
logger = createLogger({ level: 'silent' });
12+
logger = createLogger({ level: 'error' });
1313
enforcer = new PluginPermissionEnforcer(logger);
1414
});
1515

@@ -172,12 +172,12 @@ describe('SecurePluginContext', () => {
172172
let mockBaseContext: PluginContext;
173173

174174
beforeEach(() => {
175-
logger = createLogger({ level: 'silent' });
175+
logger = createLogger({ level: 'error' });
176176
enforcer = new PluginPermissionEnforcer(logger);
177177

178178
mockBaseContext = {
179179
registerService: () => {},
180-
getService: (name: string) => ({ name }),
180+
getService: <T>(name: string): T => ({ name } as any),
181181
getServices: () => new Map(),
182182
hook: () => {},
183183
trigger: async () => {},

0 commit comments

Comments
 (0)