Repository navigation
v0.3.0
Added
A client for the v2 API, under client.v2 — 407 operations across 90
resources. Everything you use today is untouched: v2 is a new namespace beside
the existing surface, not a replacement for it.
There are two ways in, and they compose:
// Flat path — each segment consumes exactly one URL path id
await client.v2.workspaces.projects.states.list("acme", "ENG");
// Loaded rows — a fetched row carries its ids, so nothing repeats
const project = await client.v2.workspaces.projects.retrieve("acme", "ENG");
await project.cycles.list();
await project.workItems.create({ name: "Ship it" });Path ids are named after the resource they identify, singular, with no Id
suffix: retrieve(slug, project, state).
- Navigable rows — 19
Loaded*types. A fetched workspace reaches 25
children, a project 19, a work item its comments, links, attachments and
worklogs. - Compile-time field projection —
fieldsnarrows the return type through
Pick<T, F | "id">, so reading a field you did not request is a type error
caught before you run, notundefinedat runtime.expandis exposed wherever
the API declares it. - Typed filters and ordering — every query filter the API declares is
reachable and typed;order_bylikewise, as generated unions. - Pagination — both envelopes: offset (
per_page,offset) and cursor
(cursor).iterate()follows pages on either, so the difference stays out of
your code. - Lookup by name —
findByName(...), andfindByDisplayName(...)on
property resources, so scripts can use the names people see in the UI instead
of ids. - Bridges —
add/removeon relationship collections, e.g.
cycle.workItems.add([...]), up to 100 ids per call. - Bulk writes —
bulkCreate/bulkUpdate/bulkDeletewhere the API
offers them, up to 50 items per call.
v2 types are exported from the package root, including the Loaded* row types.
Full Changelog: v0.2.14...v0.3.0