[SILO-1463] feat: api_v2 support via client.v2 (406 operations) - #56
[SILO-1463] feat: api_v2 support via client.v2 (406 operations)#56Prashant-Surya wants to merge 1 commit into
Conversation
…operations
`client.v2` exposes every api_v2 operation through a single chained form rooted at
the workspace, mirroring the API's own scope tree:
const ws = client.v2.workspace("acme"); // zero-I/O locator
const proj = ws.project("ENG"); // key or UUID
await proj.workItems.create({ name: "Fix login bug", state: "Todo" });
await ws.workItems.retrieveByIdentifier("ENG-12");
await ws.wiki.pages.create({ name: "Runbook" }); // public page -> default collection
await client.v2.users.me(); // the six non-workspace operations
- Kernel: own axios instance with RFC 9457 errors and PlaneNetworkError,
offset/cursor envelopes with a stall guard, ?fields/?expand/?order_by validated
per operation against the golden, typed `Pick<T, F>` field projection, upsert,
bulk create/update/delete with per-row results, findByName, custom verb
actions, scope-bound resources (`new Resource(transport, scope)`).
- Spec-generated constants (`pnpm codegen:v2`) for all 406 operations; every
implemented operation is declared in exactly one resource's `operations` map
and a two-way coverage test enforces 406/406.
- Method set is identical to plane-sdk (Python) (camelCase vs snake_case).
- Root exports keep every v1 name; v2 types that collide are aliased `V2*`, and
`scripts/check-types-bundle.mjs` guards the public export surface on build.
- Unit tests under tests/unit/v2 (nock); e2e under tests/e2e/v2 skip without env.
- CI: unit tests gated; a secret-gated `v2-golden-drift` job regenerates the
constants against plane-ee's golden.
- Version 0.3.0. v1 surface untouched.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XXZ9CT96T1dZoiSYmtiNe
|
Important Review skippedToo many files! This PR contains 289 files, which is 189 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (289)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Linked to Plane Work Item(s)
This comment was auto-generated by Plane |
Description
Adds the complete Plane api_v2 surface to the Node SDK — 406 operations across 120 resource groups — as a single chained form rooted at the workspace, mirroring the API's own scope tree. v1 is untouched: every existing root export resolves to the same v1 declaration (verified with a type-level probe), and v2 types that share a v1 name are aliased
V2*at the root and namespaced underv2models.src/api/v2/kernel/): own axios instance with RFC 9457PlaneApiErrorandPlaneNetworkError, offset/cursor pagination with a stall guard,?fields/?expand/?order_byvalidated per operation against the OpenAPI golden, typedPick<T, F>field projection, upsert, bulk create/update/delete,findByName, custom verb actions, scope-bound resources.pnpm codegen:v2) for all 406 operations; every implemented operation is declared in exactly one resource'soperationsmap and a two-way coverage test enforces 406/406.Create<Resource>/Update<Resource>.plane-sdk(Python) (camelCase vs snake_case).scripts/check-types-bundle.mjsguards the public export surface on every build.Type of Change
Test Scenarios
jest tests/unit/v2— 448 tests against nock asserting verb, exact URL, query, and body; error paths, stall guard, field/expand rejection, bulk cap, findByName ambiguity, typed field projection, two-way operation coverage.tests/e2e/v2skips withoutPLANE_BASE_URL/PLANE_API_KEY/TEST_WORKSPACE_SLUG; against a plane-dev instance all 50 suites pass — includes an end-to-end scenario (full-scenario.e2e.test.ts) and the two work-item-type flows ported from plane-ee.tsc0 errors,oxlintunchanged frommain(165 warnings / 0 errors),oxfmtclean,pnpm buildpasses with the export-surface snapshot.v2-golden-driftjob regenerates the constants against plane-ee's golden.Follow-ups (not in this PR)
./v2package subpath export yet (import { v2 } from "@makeplane/plane-node-sdk"is the entry point).PLANE_BASE_URL.References
[SILO-1466], plane-ee[SILO-1464](the live suite depends on that permission fix forusers/me,permissions/me,worklogs/summary).🤖 Generated with Claude Code
https://claude.ai/code/session_015XXZ9CT96T1dZoiSYmtiNe