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

未關閉 適合新手
#144 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
85/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
typescript
領域
api

研究方向

在 packages/api-client 中工作;先檢查產生的用戶端和現有的單元測試模式,找出適合放置解析器的位置。新增 parseAuditExport(text: string): AuditEventDto[],使其保留行順序、忽略結尾的換行字元,並在 JSON 行無效時擲出錯誤。新增單元測試並執行 pnpm nx test api-client。

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
TypeScript
星號
2
分支
1
平均合併
7 小時 17 分鐘
30 天內合併 PR
197

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

shipkeepdev/shipkeep 的其他 Issue

查看 shipkeepdev/shipkeep 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。