fix: TypeScript and config fixes for dev server + testing/docs#162
Closed
Agbasimere wants to merge 2 commits intonathydre21:mainfrom
Closed
fix: TypeScript and config fixes for dev server + testing/docs#162Agbasimere wants to merge 2 commits intonathydre21:mainfrom
Agbasimere wants to merge 2 commits intonathydre21:mainfrom
Conversation
…pes, rate limiters, audit, swagger, Prisma)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves TypeScript compilation and config issues so the app can run with
npm run dev. Also adds testing setup and docs from earlier work.Closes #156
Changes
TypeScript / runtime fixes
esModuleInterop,allowSyntheticDefaultImports; includetypes/**/*.d.ts.sendCommandfor rate-limit-redis (RedisReply, rest params); guard for optionalclientIP; Express Request augmentation forsuspicious(and triple-slash reference).sendCommand+ RedisReply pattern for RedisStore.clientIPis missing socheckSuspiciousPatternsreceives a string.{ error: toError(error) }instead of rawunknown.rTracer.id()cast tostring | undefinedfor LogContext.app: undefined;captureMessage2-arg form with options object.durationas number in logger context; optional chaining formetric.memoryUsage;avgResponseTimevariable name;durationMsfor display where needed.updateSessionActivityonly whenevent.sessionIdis defined.toError()helper for catch blocks; non-null assertions for audit client getters afterensureInitialized.previewfrom Document create (not in Prisma schema).$on; logger error context with normalized Error.apislist limited to file paths to avoid EISDIR.../services/AnalyticsService.getNotificationBreachHistory.(req: Request, res: Response)for route handlers.userRolecast toUserRolefor ROLE_BASED_MULTIPLIERS index.../src/config/prismaClient(replacing non-existent user-service).suspicious?: booleanto Express Request.Dependencies
swagger-jsdoc,@types/swagger-jsdoc,@types/swagger-ui-express.Note
npm run devmay still require environment setup (e.g. Redis, DB URLs). The “Failed to load retention policies” log is a known runtime message when the audit DB is not configured. Any remaining TS or runtime issues can be fixed in follow-up.