[INFRA-401] feat(node-sdk): add importToProject, ProjectMember, WorkspaceMember — v0.2.12#50
Conversation
…paceMember — v0.2.12 Mirrors the three additions shipped in Python SDK v0.2.14 (PR #43): - WorkItemTypes.importToProject(workspaceSlug, projectId, workItemTypeIds) POST /workspaces/{slug}/projects/{id}/work-item-types/import-work-item-types/ Imports workspace-level work item types into a project. - ProjectMember interface — extends User with role: number | null and role_slug: string | null. Projects.getMembers() now returns ProjectMember[] instead of User[]. - WorkspaceMember interface — same role fields as ProjectMember. Workspace.getMembers() now returns WorkspaceMember[] instead of User[]. Both new types are exported from src/models/index.ts. Version bumped 0.2.11 → 0.2.12. Co-authored-by: Plane AI <noreply@plane.so>
|
Warning Review limit reached
More reviews will be available in 53 minutes and 55 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. 📝 WalkthroughWalkthroughThis PR extends the Node SDK with member role information by introducing ChangesMember role types and API updates
Sequence DiagramsequenceDiagram
participant Client
participant ProjectsAPI
participant WorkspaceAPI
participant Backend
Client->>ProjectsAPI: getMembers(workspaceSlug, projectId)
ProjectsAPI->>Backend: GET /workspaces/{id}/projects/{id}/members/
Backend-->>ProjectsAPI: User[] with role, role_slug
ProjectsAPI-->>Client: ProjectMember[]
Client->>WorkspaceAPI: getMembers(workspaceSlug)
WorkspaceAPI->>Backend: GET /workspaces/{id}/members/
Backend-->>WorkspaceAPI: User[] with role, role_slug
WorkspaceAPI-->>Client: WorkspaceMember[]
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/models/Member.ts (1)
1-24:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUse kebab-case for the filename.
The file is named
Member.ts(PascalCase), but should bemember.ts(kebab-case). As per coding guidelines, files matchingsrc/**/*.tsmust use kebab-case for file names.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/models/Member.ts` around lines 1 - 24, The file is named using PascalCase (Member.ts) but project convention requires kebab-case; rename the file to member.ts and update all import paths that reference it to use "./member" (or the appropriate relative path) so symbols ProjectMember and WorkspaceMember continue to be exported from the renamed module; ensure any tooling/exports that reference Member.ts are adjusted accordingly and run a quick build/test to catch missed imports.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/api/WorkItemTypes.ts`:
- Around line 72-87: The file src/api/WorkItemTypes.ts has formatting issues
causing the oxfmt check to fail; run oxfmt (without --check) to auto-format the
file (or run it across the repo), then stage and commit the formatted changes.
Specifically ensure the method importToProject and surrounding JSDoc/comments
are reformatted to match oxfmt rules so the build passes, then push the commit.
---
Outside diff comments:
In `@src/models/Member.ts`:
- Around line 1-24: The file is named using PascalCase (Member.ts) but project
convention requires kebab-case; rename the file to member.ts and update all
import paths that reference it to use "./member" (or the appropriate relative
path) so symbols ProjectMember and WorkspaceMember continue to be exported from
the renamed module; ensure any tooling/exports that reference Member.ts are
adjusted accordingly and run a quick build/test to catch missed imports.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3716a46f-c75e-43ce-947c-2e0257efa0c6
📒 Files selected for processing (6)
package.jsonsrc/api/Projects.tssrc/api/WorkItemTypes.tssrc/api/Workspace.tssrc/models/Member.tssrc/models/index.ts
Co-authored-by: Plane AI <noreply@plane.so>
Summary
Mirrors the three additions from Python SDK v0.2.14 (PR #43) into the Node SDK.
WorkItemTypes.importToProject(workspaceSlug, projectId, workItemTypeIds)—POST import-work-item-types/— imports workspace-level work item types into a projectProjectMemberinterface — extendsUserwithrole: number | nullandrole_slug: string | null;Projects.getMembers()now returnsProjectMember[]instead ofUser[]WorkspaceMemberinterface — same role fields;Workspace.getMembers()now returnsWorkspaceMember[]instead ofUser[]src/models/index.ts0.2.11→0.2.12Files changed
src/models/Member.tsProjectMemberandWorkspaceMemberinterfacessrc/models/index.ts./Membersrc/api/WorkItemTypes.tsimportToProject()methodsrc/api/Projects.tsgetMembers()returnsProjectMember[]src/api/Workspace.tsgetMembers()returnsWorkspaceMember[]package.json0.2.11→0.2.12Test plan
pnpm buildpasses cleanly ✅importToProject()posts to correct endpoint with{ work_item_type_ids: [...] }Projects.getMembers()return type includesroleandrole_slugWorkspace.getMembers()return type includesroleandrole_slugProjectMemberandWorkspaceMemberexported from package rootCo-authored-by: Plane AI noreply@plane.so
Summary by CodeRabbit
Release Notes v0.2.12
New Features
Updates