4.4.69: Query parameter correctness, improved async upload error handling, and published integration guides
Highlights
- Fixes query parameter generation so
0is no longer dropped, preventing subtle bugs in pagination/limit/offset and other numeric params. - Improves
uploadAsyncMethoderror semantics by converting structured Fjell error responses intoFjellHttpError(with status and request context), aligning behavior with the rest of the HTTP API surface. - Adds and ships “agentic” usage/integration guides in the npm package, making integration patterns easier to follow without reading internal source.
Bug fixes
Query parameters: preserve numeric zero (and handle empty strings more predictably)
generateQueryParametersnow:- Includes numeric
0values in the query string (e.g.?limit=0&offset=0). - Filters out
undefinedvalues (as before). - Filters out empty-string values (e.g.
{ city: "" }will not be emitted). - Ensures boolean
falseis encoded as the literal stringfalse.
- Includes numeric
Impact
- This affects every call site that builds URLs via
generateQueryParameters, including core HTTP methods and file upload paths (e.g.src/api/http.ts,src/api/httpFile.ts, and async upload).
Async upload: structured Fjell errors now throw FjellHttpError
uploadAsyncMethodnow detects structured Fjell error payloads on HTTP status>= 400and throws aFjellHttpErrorwhen the server returns either:- Wrapped shape:
{ success: false, error: ErrorInfo } - Direct shape:
ErrorInfo
- Wrapped shape:
- When the body is not JSON / not structured, it falls back to a generic
Error("Upload failed with status X").
Impact
- Consumers can now reliably catch
FjellHttpErrorfor structured server errors and access status + error details, similar to other methods in this package.
Documentation (included in published package)
- Added new guides under
guide/:guide/index.mdguide/usage.mdguide/integration.md
- Updated
.npmignoreso thatguide/**is included in the npm tarball, even though*.mdis generally ignored.
Dependencies
- Updated dependencies and refreshed
package-lock.json. - Notably:
@fjell/coreis now^4.4.79@fjell/loggingis now^4.4.72
Tests
- Added coverage to verify:
- Query params preserve
0values. uploadAsyncMethodthrowsFjellHttpErrorfor structured Fjell error bodies and uses a generic error message for unstructured failures.
- Query params preserve
Breaking changes / upgrade notes
- No public API signature changes were detected.
- Behavior change to be aware of: if you previously relied on
uploadAsyncMethodthrowing only genericErrorinstances on HTTP>= 400, you may now receiveFjellHttpErrorwhen the server returns a structured Fjell error body. Adjust error handling to checkinstanceof FjellHttpError(or your existing Fjell error utilities) if needed.