feat(sdk): namespace EntityIdentifier helpers under EntityIdentifiers#916
Conversation
Update JS examples to use `EntityIdentifiers.forEmail(...)` instead of bare `forEmail(...)` to match opentdf/web-sdk#916. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…iers Export helpers as `EntityIdentifiers.forEmail(...)` instead of bare `forEmail(...)` to avoid top-level name collisions (e.g. with future TDF recipient helpers) and align with the Java SDK pattern. Closes #915 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request refactors the export of entity identifiers by grouping them under a namespaced EntityIdentifiers object instead of individual exports. The changes are reflected in the library's main entry point and the unit tests. Feedback indicates that JSDoc examples in the source file still demonstrate the old non-namespaced usage and should be updated to reflect this breaking change.
2269d1b to
3f83aec
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
X-Test Failure Report |
X-Test Failure Report |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Keep the bare named exports (forEmail, forClientId, etc.) with @deprecated JSDoc tags so existing consumers don't break. The namespaced EntityIdentifiers export is the recommended path forward. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
X-Test Failure Report✅ java-main |
Update JS examples to use `EntityIdentifiers.forEmail(...)` instead of bare `forEmail(...)` to match opentdf/web-sdk#916. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
eugenioenko
left a comment
There was a problem hiding this comment.
Code changes look great!
…291) ## Summary - Add `EntityIdentifiers` helper tables and examples for Java and JavaScript to the EntityIdentifier reference section (now in language tabs) - Update all Java examples to use `EntityIdentifiers.forEmail(...)` instead of verbose `EntityIdentifier.newBuilder().setEntityChain(...)` construction - Update all JavaScript examples to use `EntityIdentifiers.forEmail(...)` instead of verbose nested object literals - Update discovery page JS example to use helpers - Move verbose construction patterns to collapsible `<details>` blocks for reference ## Related - opentdf/web-sdk#916 — namespaces JS helpers under `EntityIdentifiers` (deprecates opentdf/web-sdk#911) - opentdf/java-sdk#346 — Java `EntityIdentifiers` convenience constructors - opentdf/platform#3232 — Go `EntityIdentifier` helpers ## Test plan - [x] Verify docs build (`npm run build`) passes - [ ] Check surge preview for correct rendering of helper tables, code examples, and details blocks 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Unified entity identification docs into language-specific tabs with examples for Go/Java/JavaScript * Replaced manual nested identifier examples with SDK helper-based examples across Java and JavaScript; simplified sample payloads for entitlements and decision requests * Added JavaScript support for request-token identifiers; clarified when manual construction (e.g., UUIDs) is still required * Linked discovery guide examples to the new helper-based guidance <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
EntityIdentifierconvenience constructors under a namespacedEntityIdentifiersobject, using the existingexport * aspattern (same asAuthProviders)forEmail,forClientId, etc.) are preserved with@deprecatedJSDoc tags for backwards compatibilityEntityIdentifiers.forEmail(...)patternMigration
Closes #915
Test plan
🤖 Generated with Claude Code