Skip to content

docs(journey-client): fix FRDevice mapping, export PolicyParams, improve migration guide#630

Open
vatsalparikh wants to merge 1 commit into
mainfrom
sdks-4796-journey-client-docs
Open

docs(journey-client): fix FRDevice mapping, export PolicyParams, improve migration guide#630
vatsalparikh wants to merge 1 commit into
mainfrom
sdks-4796-journey-client-docs

Conversation

@vatsalparikh
Copy link
Copy Markdown
Contributor

@vatsalparikh vatsalparikh commented May 11, 2026

JIRA Ticket

https://pingidentity.atlassian.net/browse/SDKS-4796

Description

  • Exports PolicyParams from @forgerock/journey-client/types (was only accessible via @forgerock/sdk-types)
  • Moves callbackType re-export from index.ts into types.ts alongside other value exports — no consumer impact
  • Fixes FRDevice mapping in interface_mapping.md: was incorrectly pointing to deviceClient from @forgerock/device-client; it maps to Device from @forgerock/journey-client/device
  • Adds migration guide sections to MIGRATION.md:
    • StepOptions to StartParam / NextOptions / ResumeOptions — covers the three implementation pain points not obvious from the type table
    • How to replace new FRStep()/new FRLoginSuccess()/new FRLoginFailure() with typed object literals for mocks and stories

Did you add a changeset?

Yes — patch for @forgerock/journey-client (new PolicyParams export).

Summary by CodeRabbit

  • New Features

    • PolicyParams type is now exported from journey-client/types for enhanced type support.
  • Documentation

    • Added migration guide documenting updated SDK types and test-story creation patterns.
    • Updated legacy SDK interface mappings for device functionality.

Review Change Stack

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 11, 2026

🦋 Changeset detected

Latest commit: 698f24e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@forgerock/journey-client Patch
@forgerock/davinci-client Patch
@forgerock/device-client Patch
@forgerock/oidc-client Patch
@forgerock/protect Patch
@forgerock/sdk-types Patch
@forgerock/sdk-utilities Patch
@forgerock/iframe-manager Patch
@forgerock/sdk-logger Patch
@forgerock/sdk-oidc Patch
@forgerock/sdk-request-middleware Patch
@forgerock/storage Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

This PR adds PolicyParams to the exported types from @forgerock/journey-client by reorganizing type re-exports in the source, validating the changes in generated API reports, and documenting the release and related SDK migration patterns for users.

Changes

Export Consolidation

Layer / File(s) Summary
Type Re-export Consolidation
packages/journey-client/src/types.ts
PolicyParams is added to the type re-export list from @forgerock/sdk-types, and value re-exports (callbackType, PolicyKey, StepType) are consolidated into a single statement.
Index Entrypoint Re-export
packages/journey-client/src/index.ts
Index module updates its public surface to re-export from ./lib/client.store.js and ./types.js, removing direct re-export of callbackType from @forgerock/sdk-types.
API Report Validation
packages/journey-client/api-report/journey-client.api.md, packages/journey-client/api-report/journey-client.types.api.md
PolicyParams and callbackType are added to imports and exports in the public API surface documentation.
Release & User Documentation
.changeset/cool-kings-learn.md, MIGRATION.md, interface_mapping.md
Patch release is documented, SDK type migration patterns are added (legacy StepOptionsStartParam, test object literals), and device mapping documentation is updated to reflect Device from @forgerock/journey-client/device.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • ancheetah
  • ryanbas21
  • cerebrl

Poem

🐰 A rabbit hops through exports bright,
PolicyParams now in sight!
Types consolidated, clean and neat,
API reports complete the feat. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: exporting PolicyParams, fixing the FRDevice mapping, and improving the migration guide documentation.
Description check ✅ Passed The description provides a clear JIRA reference, explains all major changes, and confirms that a changeset was added, meeting the template requirements.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sdks-4796-journey-client-docs

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 11, 2026

View your CI Pipeline Execution ↗ for commit 698f24e

Command Status Duration Result
nx run-many -t build --no-agents ✅ Succeeded <1s View ↗
nx affected -t build lint test typecheck e2e-ci ✅ Succeeded 6m 49s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-11 16:07:07 UTC

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.

🧹 Nitpick comments (1)
MIGRATION.md (1)

194-244: 💤 Low value

Comprehensive guide for creating test mocks.

The examples clearly demonstrate the shift from class instantiation to typed object literals. The code is syntactically correct and the imports align with the updated module structure.

One consideration: The getCallbackOfType implementation at line 218 throws an error with "not implemented". While this is appropriate for a minimal mock example in tests/stories, consider adding a brief note that production code or more complete test fixtures would need full implementations of all methods.

📝 Suggested clarification

Add a note after line 225 or in the introduction paragraph at line 196:

 const mockStep: JourneyStep = {
   type: StepType.Step,
   payload: rawPayload,
   callbacks: rawPayload.callbacks?.map(createCallback) ?? [],
   getCallbackOfType: (type) => {
     throw new Error('not implemented');
   },
   getCallbacksOfType: (type) => [],
   setCallbackValue: () => {},
   getDescription: () => undefined,
   getHeader: () => undefined,
   getStage: () => undefined,
 };
+
+// Note: This is a minimal mock suitable for stories and basic tests.
+// Production code or comprehensive test fixtures should implement all methods fully.
🤖 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 `@MIGRATION.md` around lines 194 - 244, Add a short clarifying note near the
mock examples (around the mockStep/mockSuccess/mockFailure block) explaining
that the provided JourneyStep/JourneyLoginSuccess/JourneyLoginFailure object
literals are minimal test stubs and that getCallbackOfType currently throws
("not implemented") as a placeholder; recommend implementing full method
behavior (e.g., getCallbackOfType, getCallbacksOfType, setCallbackValue, etc.)
for production code or more comprehensive test fixtures so readers know when to
replace the placeholder with real logic.
🤖 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.

Nitpick comments:
In `@MIGRATION.md`:
- Around line 194-244: Add a short clarifying note near the mock examples
(around the mockStep/mockSuccess/mockFailure block) explaining that the provided
JourneyStep/JourneyLoginSuccess/JourneyLoginFailure object literals are minimal
test stubs and that getCallbackOfType currently throws ("not implemented") as a
placeholder; recommend implementing full method behavior (e.g.,
getCallbackOfType, getCallbacksOfType, setCallbackValue, etc.) for production
code or more comprehensive test fixtures so readers know when to replace the
placeholder with real logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a7f1b1fb-0a8d-4757-9c8a-27f0793e0d1e

📥 Commits

Reviewing files that changed from the base of the PR and between 44f9be3 and 698f24e.

📒 Files selected for processing (7)
  • .changeset/cool-kings-learn.md
  • MIGRATION.md
  • interface_mapping.md
  • packages/journey-client/api-report/journey-client.api.md
  • packages/journey-client/api-report/journey-client.types.api.md
  • packages/journey-client/src/index.ts
  • packages/journey-client/src/types.ts
💤 Files with no reviewable changes (1)
  • packages/journey-client/src/index.ts

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 11, 2026

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/@forgerock/davinci-client@630

@forgerock/device-client

pnpm add https://pkg.pr.new/@forgerock/device-client@630

@forgerock/journey-client

pnpm add https://pkg.pr.new/@forgerock/journey-client@630

@forgerock/oidc-client

pnpm add https://pkg.pr.new/@forgerock/oidc-client@630

@forgerock/protect

pnpm add https://pkg.pr.new/@forgerock/protect@630

@forgerock/sdk-types

pnpm add https://pkg.pr.new/@forgerock/sdk-types@630

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/@forgerock/sdk-utilities@630

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/@forgerock/iframe-manager@630

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/@forgerock/sdk-logger@630

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/@forgerock/sdk-oidc@630

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/@forgerock/sdk-request-middleware@630

@forgerock/storage

pnpm add https://pkg.pr.new/@forgerock/storage@630

commit: 698f24e

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 17.61%. Comparing base (5d6747a) to head (698f24e).
⚠️ Report is 94 commits behind head on main.

Files with missing lines Patch % Lines
packages/journey-client/src/types.ts 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (40.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (17.61%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #630       +/-   ##
===========================================
- Coverage   70.90%   17.61%   -53.29%     
===========================================
  Files          53      154      +101     
  Lines        2021    24242    +22221     
  Branches      377     1160      +783     
===========================================
+ Hits         1433     4271     +2838     
- Misses        588    19971    +19383     
Files with missing lines Coverage Δ
packages/journey-client/src/index.ts 33.33% <ø> (ø)
packages/journey-client/src/types.ts 3.22% <0.00%> (-0.11%) ⬇️

... and 101 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

Deployed 36ff687 to https://ForgeRock.github.io/ping-javascript-sdk/pr-630/36ff68711289ad3906aa362fc0fc8eff74183ce1 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Copy Markdown
Contributor

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔻 @forgerock/device-client - 0.0 KB (-10.0 KB, -100.0%)
🔻 @forgerock/journey-client - 0.0 KB (-91.9 KB, -100.0%)

📊 Minor Changes

📉 @forgerock/journey-client - 91.8 KB (-0.1 KB)

➖ No Changes

@forgerock/device-client - 10.0 KB
@forgerock/davinci-client - 48.9 KB
@forgerock/oidc-client - 25.2 KB
@forgerock/sdk-utilities - 11.2 KB
@forgerock/sdk-types - 7.9 KB
@forgerock/protect - 144.6 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-oidc - 4.8 KB
@forgerock/sdk-request-middleware - 4.5 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/iframe-manager - 2.4 KB


14 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

export * from './types.js';

// Re-export types from internal packages that consumers need
export { callbackType } from '@forgerock/sdk-types';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is tricky since its both a type and a value. we may want to keep this here, doing otherwise breaks the api.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh okay. Moving it to types looked cleaner. Why does it break the API? Can we

export type { callbackType } from '@forgerock/sdk-types';

along with

export { callbackType, PolicyKey, StepType } from '@forgerock/sdk-types';

in types.ts file? Just a thought to keep index.ts cleaner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants