Skip to content

Conversation

@tolgaozen
Copy link
Member

@tolgaozen tolgaozen commented Nov 14, 2025

Summary by CodeRabbit

  • Chores

    • Version updated to 1.1.3.
  • Improvements

    • Enhanced client library type definitions with explicit service endpoint specifications, delivering improved IDE support, better type safety, and clearer development interfaces.

@coderabbitai
Copy link

coderabbitai bot commented Nov 14, 2025

Walkthrough

Version field updated from 1.1.2 to 1.1.3. Type system improvements to gRPC client module with new PermifyClient type and explicit return type annotations for newClient function. Helper types added for client definition mapping.

Changes

Cohort / File(s) Summary
Version Bump
package.json
Version incremented from 1.1.2 to 1.1.3
gRPC Client Typing
src/grpc/clients.ts
Added imports for RawClient and TsProtoServiceDefinition from nice-grpc. Introduced helper type ClientFromDefinition for mapping service definitions to client types. New exported PermifyClient type provides explicit per-endpoint client typings (permission, schema, data, bundle, tenancy, watch). Updated newClient function signature to return PermifyClient instead of inferred type.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • src/grpc/clients.ts: Review the new PermifyClient type structure to ensure all endpoint definitions are correctly mapped and the helper type ClientFromDefinition properly wraps each service definition.
  • package.json: Verify version bump aligns with semantic versioning conventions for the changes introduced.

Poem

🐰 A version hops along,
From 1.1.2, strong and true,
While types align in perfect song,
PermifyClient arrives on cue,
Explicit paths make structures clear,
Welcome, changes, far and near! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an explicit PermifyClient type for the gRPC client factory, which aligns with the primary modification in src/grpc/clients.ts.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-permify-client-types

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 576b9a4 and 1c50648.

📒 Files selected for processing (2)
  • package.json (1 hunks)
  • src/grpc/clients.ts (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/grpc/clients.ts (2)
src/grpc/generated/base/v1/service.ts (12)
  • PermissionDefinition (6527-6527)
  • PermissionDefinition (6528-15766)
  • SchemaDefinition (16868-16868)
  • SchemaDefinition (16869-20627)
  • DataDefinition (20658-20658)
  • DataDefinition (20659-28969)
  • BundleDefinition (29029-29029)
  • BundleDefinition (29030-33138)
  • TenancyDefinition (33164-33164)
  • TenancyDefinition (33165-34955)
  • WatchDefinition (15877-15877)
  • WatchDefinition (15878-16854)
src/grpc/config.ts (1)
  • Config (2-8)
🔇 Additional comments (5)
package.json (1)

3-3: LGTM! Version bump is appropriate.

The patch version increment from 1.1.2 to 1.1.3 correctly reflects the type system improvements without introducing breaking changes.

src/grpc/clients.ts (4)

13-14: LGTM! Well-structured helper type.

The ClientFromDefinition helper type provides a clean abstraction for mapping service definitions to client types, reducing repetition in the PermifyClient type definition.


16-27: LGTM! Excellent type definition with clear documentation.

The PermifyClient type provides an explicit, well-documented contract for the client factory return type, ensuring proper type preservation through export layers and improving developer experience with better IDE support.


39-39: LGTM! Explicit return type enhances type safety.

Adding the explicit PermifyClient return type ensures proper type preservation and improves the developer experience by making the return type clear and preventing type widening issues.


1-2: Imports verified but note non-primary export path for FromTsProtoServiceDefinition.

The types TsProtoServiceDefinition and FromTsProtoServiceDefinition do exist in nice-grpc@2.1.9 at the specified path. However, only TsProtoServiceDefinition is re-exported from the main package index. Since FromTsProtoServiceDefinition is not included in the primary public API exports, importing from the lib path is necessary but reflects a non-primary export. While both types are properly defined in the published TypeScript definitions, be aware that relying on types outside the main export may have fewer stability guarantees across major versions.


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.

@tolgaozen tolgaozen merged commit 5002df7 into main Nov 14, 2025
4 checks passed
@tolgaozen tolgaozen deleted the update-permify-client-types branch November 14, 2025 10:25
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