api-client: typed helper to parse the audit JSON Lines export

Open Beginner friendly
#144 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
api

Research direction

Work in packages/api-client; first inspect its generated client and existing unit test patterns to find the right place for the parser. Add parseAuditExport(text: string): AuditEventDto[] so it preserves line order, ignores a trailing newline, and throws for invalid JSON lines. Add unit tests and run pnpm nx test api-client.

Written by the indexing model from the issue text.

Description

enhancement good first issue priority:P3 track:web

The audit export (/audit-events/export) returns application/x-ndjson, one AuditEventDto per line, which the generated client does not parse.

Task

In packages/api-client:

  • add parseAuditExport(text: string): AuditEventDto[];
  • ignore a trailing newline, throw on invalid JSON lines, and keep the original order;
  • add unit tests.

Acceptance

pnpm nx test api-client passes. No new dependency.

Dominant language
TypeScript
Stars
2
Forks
1
Avg merge
7h 17m
Merged PRs (30d)
197

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from shipkeepdev/shipkeep

All issues in shipkeepdev/shipkeep

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.