Fix TypeScript compilation errors across P3-P6

- jwt.sign: explicit SignOptions cast for expiresIn (all 4 products)
- ioredis: use named import { Redis } instead of default (P4, P6)
- P4 catalog/service: fix import paths for aws-scanner and github-scanner
- P4 discovery: pass pool to ScheduledDiscovery constructor
- P6 agent-bridge: add explicit types for Redis message callback params
- All 4 Node products now compile cleanly with tsc --noEmit
This commit is contained in:
2026-03-01 06:06:31 +00:00
parent cf4d1de9e7
commit 4146f1c4d0
8 changed files with 12 additions and 12 deletions

View File

@@ -87,7 +87,7 @@ export function requireRole(req: FastifyRequest, reply: FastifyReply, minRole: A
}
export function signToken(payload: AuthPayload, secret: string, expiresIn = '24h'): string {
return jwt.sign(payload, secret, { expiresIn });
return jwt.sign(payload, secret, { expiresIn } as jwt.SignOptions);
}
// --- Password hashing (scrypt — no native bcrypt dep needed) ---

View File

@@ -1,5 +1,5 @@
import pino from 'pino';
import Redis from 'ioredis';
import { Redis } from 'ioredis';
const logger = pino({ name: 'agent-ws' });
@@ -41,7 +41,7 @@ export class AgentBridge {
const channel = `dd0c:run:${tenantId}:${executionId}:from_agent`;
await this.sub.subscribe(channel);
this.sub.on('message', (ch, message) => {
this.sub.on('message', (ch: string, message: string) => {
if (ch !== channel) return;
try {
const parsed = JSON.parse(message) as StepResultMessage;
@@ -71,7 +71,7 @@ export class AgentBridge {
const channel = `dd0c:run:${tenantId}:${executionId}:to_agent`;
await this.sub.subscribe(channel);
this.sub.on('message', (ch, message) => {
this.sub.on('message', (ch: string, message: string) => {
if (ch !== channel) return;
try {
const parsed = JSON.parse(message);