Skip to content

[INFRA-401] feat(node-sdk): add importToProject, ProjectMember, WorkspaceMember — v0.2.12#50

Merged
Prashant-Surya merged 2 commits into
mainfrom
infra-node-sdk/v0.2.12-member-models-import-to-project
Jun 1, 2026
Merged

[INFRA-401] feat(node-sdk): add importToProject, ProjectMember, WorkspaceMember — v0.2.12#50
Prashant-Surya merged 2 commits into
mainfrom
infra-node-sdk/v0.2.12-member-models-import-to-project

Conversation

@mguptahub
Copy link
Copy Markdown
Contributor

@mguptahub mguptahub commented Jun 1, 2026

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 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; Workspace.getMembers() now returns WorkspaceMember[] instead of User[]
  • Both new types exported from src/models/index.ts
  • Version bumped 0.2.110.2.12

Files changed

File Change
src/models/Member.ts New — ProjectMember and WorkspaceMember interfaces
src/models/index.ts Export ./Member
src/api/WorkItemTypes.ts Add importToProject() method
src/api/Projects.ts getMembers() returns ProjectMember[]
src/api/Workspace.ts getMembers() returns WorkspaceMember[]
package.json Version 0.2.110.2.12

Test plan

  • pnpm build passes cleanly ✅
  • importToProject() posts to correct endpoint with { work_item_type_ids: [...] }
  • Projects.getMembers() return type includes role and role_slug
  • Workspace.getMembers() return type includes role and role_slug
  • ProjectMember and WorkspaceMember exported from package root

Co-authored-by: Plane AI noreply@plane.so

Summary by CodeRabbit

Release Notes v0.2.12

  • New Features

    • Added ability to import work item types from workspace level to projects.
  • Updates

    • Member retrieval methods now return role information for workspace and project members.

…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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Warning

Review limit reached

@mguptahub, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d56cdc4c-564d-4de9-b654-a67ad69d2b89

📥 Commits

Reviewing files that changed from the base of the PR and between c39fc62 and 89db811.

📒 Files selected for processing (1)
  • src/api/WorkItemTypes.ts
📝 Walkthrough

Walkthrough

This PR extends the Node SDK with member role information by introducing ProjectMember and WorkspaceMember types, updating Projects and Workspace API responses, adding a WorkItemTypes import method, and incrementing the package version to 0.2.12.

Changes

Member role types and API updates

Layer / File(s) Summary
Member data models with role information
src/models/Member.ts, src/models/index.ts
ProjectMember and WorkspaceMember interfaces extend User and add nullable role and role_slug fields; the module is exported via the models barrel index.
Projects and Workspace API member response type updates
src/api/Projects.ts, src/api/Workspace.ts
Projects.getMembers and Workspace.getMembers now return the new typed members with role information, with imports swapped and JSDoc updated to reflect the enriched response contract.
WorkItemTypes import method
src/api/WorkItemTypes.ts
importToProject method is added to import workspace-level work item types into a project via POST to import-work-item-types/ endpoint, returning project-level WorkItemType[].
Package version release
package.json
Version bumped from 0.2.11 to 0.2.12.

Sequence Diagram

sequenceDiagram
  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[]
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit hops through member trees 🐰,
With roles now clear for all to see,
New types imported, APIs aligned,
And WorkItemTypes left behind—
Version bumped, the SDK's refined!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding importToProject method, ProjectMember and WorkspaceMember types, and version bump to v0.2.12.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch infra-node-sdk/v0.2.12-member-models-import-to-project

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@makeplane
Copy link
Copy Markdown

makeplane Bot commented Jun 1, 2026

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Use kebab-case for the filename.

The file is named Member.ts (PascalCase), but should be member.ts (kebab-case). As per coding guidelines, files matching src/**/*.ts must 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

📥 Commits

Reviewing files that changed from the base of the PR and between 18cbaae and c39fc62.

📒 Files selected for processing (6)
  • package.json
  • src/api/Projects.ts
  • src/api/WorkItemTypes.ts
  • src/api/Workspace.ts
  • src/models/Member.ts
  • src/models/index.ts

Comment thread src/api/WorkItemTypes.ts
Co-authored-by: Plane AI <noreply@plane.so>
@Prashant-Surya Prashant-Surya merged commit 41eb144 into main Jun 1, 2026
2 checks passed
@Prashant-Surya Prashant-Surya deleted the infra-node-sdk/v0.2.12-member-models-import-to-project branch June 1, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants