|
|
e9d5e0ea16
|
clients/typescript: apply audit findings — uploadFile streaming + metadata + validation (15de6e7 → cc54cfb)
HIGH:
- H1: uploadFile streams via createReadStream, validates is_file, caps size (configurable, default 100MB)
MEDIUM:
- M1: LICENSE file added
- M2: package.json repository/bugs/homepage/author fields
- M3: ESM-only doc + engines.node>=18
- M4: defaultTimeoutMs negative validation
- M5: baseUrl validated as URL in constructor
LOW:
- L1: empty 200 body throws ForgeAPIError instead of {} as T
- L2: DOMException("timeout", "TimeoutError") for symmetry with AbortSignal.timeout()
- L4: package-lock.json committed
- L5: 6 new tests (500-not-502, Blob upload, invalid source, empty revokeToken, JSON error body, double-signal race)
- L7: defensive raw.ok === true check in run()
Audit: memory/clawdforge-audits/typescript-15de6e7.md
|
2026-04-28 23:12:27 -07:00 |
|
|
|
15de6e765f
|
clients/typescript: initial TypeScript SDK for clawdforge
Drop-in Node 18+ client with strict types, native fetch, AbortSignal
support, and a typed error hierarchy (ForgeAuthError / ForgeAPIError /
ForgeTransportError). Mirrors the existing Python client surface but
stays generic — no Sulkta-specific assumptions, suitable for anyone
running their own clawdforge instance.
- camelCase TS, snake_case wire — converted at the boundary
- node:test suite (17 tests) covering healthz, run success/error paths,
502 envelopes, abort/timeout, file upload, and admin token CRUD
- tsc --noEmit clean with strict mode + Node16 module resolution
|
2026-04-28 22:42:46 -07:00 |
|