Skip to content

feat(davinci-client): add metadata collector (SDKS-5100)#727

Open
ancheetah wants to merge 1 commit into
mainfrom
SDKS-5100-metadata-collector
Open

feat(davinci-client): add metadata collector (SDKS-5100)#727
ancheetah wants to merge 1 commit into
mainfrom
SDKS-5100-metadata-collector

Conversation

@ancheetah

@ancheetah ancheetah commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

JIRA Ticket

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

Description

TODO: I still need to create a flow in the new tenant and add e2e tests

What

Adds MetadataCollector support to davinci-client, enabling DaVinci flows to deliver server-side metadata payloads (e.g. session tokens, user context) to client applications. The collector carries its payload in output.value and reports success or structured errors back to the server via transformActionRequest.

Why

DaVinci flows need a mechanism to push arbitrary metadata to the client and receive a status (success or error) in return, without relying on a standard form submission. This fills that gap in the collector model.

Changes

  • New types: MetadataCollector, MetadataError, MetadataField, and DaVinciRequestValueTypes (extracted from inline union in davinci.utils.ts)
  • collector.types.ts / collector.utils.ts: Added MetadataCollector type alias and returnMetadataCollector factory; updated returnObjectCollector to handle the label-less METADATA field shape
  • node.reducer.ts: Added METADATA case to build a MetadataCollector from a field; added object-type guard for MetadataCollector update values
  • node.slice.ts: Falls back to metadataCollector.output.key for client.action when no SubmitCollector is present
  • davinci.api.ts: Auto-routes to transformActionRequest when a MetadataCollector is in the collector list
  • davinci.utils.ts: transformActionRequest now collects form data from all value-bearing collectors and includes it in the request body alongside actionKey
  • client.store.ts: Exposes getMetadataError helper on the client facade for constructing structured error objects
  • Tests: Unit tests for returnMetadataCollector and reducer MetadataField handling (create, update, invalid update)
  • E2e app: Added metadataComponent demonstrating success and error paths; wired into main.ts

Summary by CodeRabbit

Summary

  • New Features

    • Added support for METADATA fields, including a new MetadataCollector.
    • Metadata collection UI now offers dedicated success and error submission actions.
    • Added a client helper to create structured metadata errors.
    • Enhanced action submissions to include metadata when present.
  • Bug Fixes

    • Improved validation for metadata collector updates, with clearer handling of invalid values.
  • Tests

    • Expanded end-to-end and unit/type coverage for metadata collectors and error scenarios.

@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8693a1d

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

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

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

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds MetadataField, MetadataCollector, and MetadataError support across DaVinci types, reducers, request construction, client APIs, and the end-to-end example application. Metadata values can be updated, submitted, and represented as success or error results.

Changes

Metadata collector support

Layer / File(s) Summary
Metadata contracts and public types
packages/davinci-client/src/lib/{davinci.types.ts,client.types.ts,collector.types.ts,node.types.ts}, packages/davinci-client/api-report/*
Adds metadata field, collector, error, inference, request, cache, and public API typings, including updated client and server unions.
Metadata collector construction and updates
packages/davinci-client/src/lib/{collector.utils.ts,node.reducer.ts}, packages/davinci-client/src/lib/*test*
Constructs metadata collectors from METADATA fields, stores payload output, validates object updates, and adds reducer and factory coverage.
Metadata submission and client state
packages/davinci-client/src/lib/{davinci.api.ts,davinci.utils.ts,node.slice.ts,client.store.ts}
Builds action requests with collector form data, selects metadata action keys, and exposes structured metadata error creation.
Metadata form interaction
e2e/davinci-app/{main.ts,components/metadata.ts}, .changeset/real-swans-leave.md
Renders metadata success and error buttons that update the collector and submit the form, with a minor release changeset.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant metadataComponent
  participant davinciClient
  participant DaVinciAPI
  User->>metadataComponent: Click metadata success or error
  metadataComponent->>davinciClient: Update MetadataCollector
  metadataComponent->>metadataComponent: Submit form
  metadataComponent->>DaVinciAPI: Build metadata action request
  DaVinciAPI-->>davinciClient: Return next node
Loading

Possibly related PRs

Suggested reviewers: cerebrl

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 87.50% which is sufficient. The required threshold is 80.00%.
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.
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding MetadataCollector support to davinci-client.
Description check ✅ Passed The description includes the JIRA ticket, purpose, rationale, and change breakdown; it only omits an explicit changeset note.
✨ 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-5100-metadata-collector

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.

@nx-cloud

nx-cloud Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 8693a1d

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

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-21 21:07:35 UTC

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
packages/davinci-client/src/lib/client.store.ts (1)

459-471: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove commented-out code.

It looks like the isClientError property was considered but isn't part of the MetadataError type. Consider removing the dead code to keep the file clean.

♻️ Proposed refactor
     /**
      * `@method` getMetadataError - Constructs a structured error object from a code and message.
      * `@param` {{ code: string; message: string; }} errorDetails - An error code and description.
      * `@returns` {{ code: string; message: string }} The structured error object.
      */
-    getMetadataError: (errorDetails: MetadataError): MetadataError => {
-      return {
-        code: errorDetails.code,
-        message: errorDetails.message,
-        // isClientError: true,
-      };
-    },
+    getMetadataError: (errorDetails: MetadataError): MetadataError => ({
+      code: errorDetails.code,
+      message: errorDetails.message,
+    }),
🤖 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 `@packages/davinci-client/src/lib/client.store.ts` around lines 459 - 471,
Remove the commented-out isClientError line from getMetadataError while
preserving the existing MetadataError fields and return behavior.
packages/davinci-client/src/lib/node.slice.ts (1)

195-198: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Prefer find over filter()[0].

Using find is slightly more efficient and idiomatic since it avoids allocating an intermediate array and stops iterating once a match is found.

♻️ Proposed refactor
-      const metadataCollector = collectors.filter(
+      const metadataCollector = collectors.find(
         (collector): collector is MetadataCollector => collector.type === 'MetadataCollector',
-      )[0];
+      );
🤖 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 `@packages/davinci-client/src/lib/node.slice.ts` around lines 195 - 198, Update
the metadata collector lookup in the surrounding node slice logic to use find
with the existing MetadataCollector type guard instead of filter()[0]. Preserve
the current result, including undefined when no matching collector exists.
🤖 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 `@packages/davinci-client/src/lib/client.types.ts`:
- Around line 47-48: Update the CollectorValueTypes union in client.types.ts to
include Record<string, unknown> alongside MetadataError and the existing value
types, allowing standard object payloads for MetadataCollector updates.

In `@packages/davinci-client/src/lib/node.reducer.ts`:
- Around line 341-347: Update the MetadataCollector validation in the reducer to
explicitly reject null values in addition to non-objects and arrays before
assigning collector.input.value. Also harden the PhoneNumberCollector and
FidoRegistrationCollector validation paths against null before using the in
operator, preserving their existing validation behavior for valid objects.

---

Nitpick comments:
In `@packages/davinci-client/src/lib/client.store.ts`:
- Around line 459-471: Remove the commented-out isClientError line from
getMetadataError while preserving the existing MetadataError fields and return
behavior.

In `@packages/davinci-client/src/lib/node.slice.ts`:
- Around line 195-198: Update the metadata collector lookup in the surrounding
node slice logic to use find with the existing MetadataCollector type guard
instead of filter()[0]. Preserve the current result, including undefined when no
matching collector exists.
🪄 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: e7a845e5-8d09-49fc-ae39-e9e2f576e8e7

📥 Commits

Reviewing files that changed from the base of the PR and between 9549894 and d076641.

📒 Files selected for processing (17)
  • e2e/davinci-app/components/metadata.ts
  • e2e/davinci-app/main.ts
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/src/lib/client.types.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.test.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/davinci.api.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/davinci.utils.ts
  • packages/davinci-client/src/lib/node.reducer.test.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/node.slice.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/src/lib/node.types.ts

Comment on lines +47 to +48
| FidoAuthenticationInputValue
| MetadataError;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Add Record<string, unknown> to CollectorValueTypes.

The CollectorValueTypes union defines the acceptable payloads for the updateCollectorValues action. Since the new MetadataCollector stores input values typed as Record<string, unknown>, this type must be explicitly included in the union alongside MetadataError. Without it, dispatching updates for a metadata collector using a standard object payload can result in TypeScript compilation errors.

💻 Proposed fix
-  | FidoAuthenticationInputValue
-  | MetadataError;
+  | FidoAuthenticationInputValue
+  | MetadataError
+  | Record<string, unknown>;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| FidoAuthenticationInputValue
| MetadataError;
| FidoAuthenticationInputValue
| MetadataError
| Record<string, unknown>;
🤖 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 `@packages/davinci-client/src/lib/client.types.ts` around lines 47 - 48, Update
the CollectorValueTypes union in client.types.ts to include Record<string,
unknown> alongside MetadataError and the existing value types, allowing standard
object payloads for MetadataCollector updates.

Comment thread packages/davinci-client/src/lib/node.reducer.ts

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We updated the transformActionRequest test to include formData: {} in the expected request payload, matching the new behavior introduced by this PR. The PR modified transformActionRequest in davinci.utils.ts to reduce non-action collectors into a formData object and include it in the request, but the test's expected value was not updated accordingly. This fix aligns the test with the current implementation so the assertion passes correctly.

Tip

We verified this fix by re-running @forgerock/davinci-client:test.

diff --git a/packages/davinci-client/src/lib/davinci.utils.test.ts b/packages/davinci-client/src/lib/davinci.utils.test.ts
index 094d4d9..f2f36eb 100644
--- a/packages/davinci-client/src/lib/davinci.utils.test.ts
+++ b/packages/davinci-client/src/lib/davinci.utils.test.ts
@@ -243,6 +243,7 @@ describe('transformActionRequest', () => {
         eventType: 'action',
         data: {
           actionKey: 'TEST_ACTION',
+          formData: {},
         },
       },
     };

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally nPN3-s8Wg

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

@ancheetah
ancheetah force-pushed the SDKS-5100-metadata-collector branch from d076641 to b8c285f Compare July 20, 2026 20:06
@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

@forgerock/davinci-client

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

@forgerock/device-client

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

@forgerock/journey-client

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

@forgerock/oidc-client

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

@forgerock/protect

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

@forgerock/sdk-types

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

@forgerock/sdk-utilities

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

@forgerock/iframe-manager

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

@forgerock/sdk-logger

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

@forgerock/sdk-oidc

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

@forgerock/sdk-request-middleware

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

@forgerock/storage

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

commit: 8693a1d

@codecov-commenter

codecov-commenter commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.85714% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.26%. Comparing base (eafe277) to head (8693a1d).
⚠️ Report is 48 commits behind head on main.

Files with missing lines Patch % Lines
packages/davinci-client/src/lib/davinci.utils.ts 50.00% 8 Missing ⚠️
packages/davinci-client/src/lib/davinci.api.ts 0.00% 6 Missing ⚠️
packages/davinci-client/src/lib/client.store.ts 16.66% 5 Missing ⚠️

❌ Your project status has failed because the head coverage (23.26%) 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     #727      +/-   ##
==========================================
+ Coverage   18.07%   23.26%   +5.18%     
==========================================
  Files         155      161       +6     
  Lines       24398    25667    +1269     
  Branches     1203     1626     +423     
==========================================
+ Hits         4410     5971    +1561     
+ Misses      19988    19696     -292     
Files with missing lines Coverage Δ
packages/davinci-client/src/lib/client.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/collector.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/collector.utils.ts 87.13% <100.00%> (+1.98%) ⬆️
packages/davinci-client/src/lib/davinci.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/node.reducer.ts 74.20% <100.00%> (+3.72%) ⬆️
packages/davinci-client/src/lib/node.slice.ts 76.95% <100.00%> (+0.25%) ⬆️
packages/davinci-client/src/lib/node.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/client.store.ts 25.60% <16.66%> (+25.32%) ⬆️
packages/davinci-client/src/lib/davinci.api.ts 29.54% <0.00%> (+17.57%) ⬆️
packages/davinci-client/src/lib/davinci.utils.ts 86.41% <50.00%> (-3.53%) ⬇️

... and 13 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

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Deployed 28ccd76 to https://ForgeRock.github.io/ping-javascript-sdk/pr-727/28ccd76e834a0a2d79b20b9ffb47ec97f251a207 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions

Copy link
Copy Markdown
Contributor

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🆕 New Packages

🆕 @forgerock/device-client - 10.0 KB (new)
🆕 @forgerock/device-client - 0.0 KB (new)
🆕 @forgerock/journey-client - 92.6 KB (new)
🆕 @forgerock/journey-client - 0.0 KB (new)

📊 Minor Changes

📈 @forgerock/davinci-client - 55.2 KB (+0.8 KB)

➖ No Changes

@forgerock/sdk-types - 9.1 KB
@forgerock/protect - 144.6 KB
@forgerock/sdk-request-middleware - 4.6 KB
@forgerock/iframe-manager - 3.2 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/sdk-oidc - 5.7 KB
@forgerock/storage - 1.5 KB
@forgerock/oidc-client - 35.3 KB
@forgerock/sdk-utilities - 18.6 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

@ancheetah
ancheetah force-pushed the SDKS-5100-metadata-collector branch 2 times, most recently from fdb36d4 to 82986b0 Compare July 21, 2026 15:13
Comment thread packages/davinci-client/src/lib/davinci.api.ts Outdated
Comment thread packages/davinci-client/src/lib/davinci.utils.ts Outdated
Comment thread packages/davinci-client/src/lib/davinci.api.ts Outdated

if (!body) {
if (
state.node.client.collectors.some((collector) => collector.type === 'MetadataCollector')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this mean that when a collector of type 'MetadataCollector' is present, the body is always silently discarded and replaced with transformActionsRequest's output? I guess we might need to add && !body to this statement to be consistent with how the 'submit' branches are gated.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That's a good question. I'm not really sure in what situations we send body and when we send an action/submit request. Perhaps someone else can shed some light on this. If body is used as an override then I'll probably want to move transformActionRequest to the if (!body) branch.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I've gone ahead an updated this. From what I'm can tell body is an override that can be passed as an argument to next. This isn't commonly done but we should continue supporting this.

@ancheetah
ancheetah force-pushed the SDKS-5100-metadata-collector branch from 82986b0 to c3b91d2 Compare July 21, 2026 20:20

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@packages/davinci-client/src/lib/client.types.ts`:
- Around line 54-63: Add Record<string, unknown> to the DaVinciRequestValueTypes
union in packages/davinci-client/src/lib/client.types.ts (lines 54-63) so
metadata object values are supported. Regenerate the API report at
packages/davinci-client/api-report/davinci-client.types.api.md (lines 642-643)
to reflect the updated public type.
🪄 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: 1b3d99c0-9fb5-4548-b70b-079d37d802fd

📥 Commits

Reviewing files that changed from the base of the PR and between fdb36d4 and c3b91d2.

📒 Files selected for processing (18)
  • .changeset/real-swans-leave.md
  • e2e/davinci-app/components/metadata.ts
  • e2e/davinci-app/main.ts
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/src/lib/client.types.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.test.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/davinci.api.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/davinci.utils.ts
  • packages/davinci-client/src/lib/node.reducer.test.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/node.slice.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/src/lib/node.types.ts
🚧 Files skipped from review as they are similar to previous changes (12)
  • .changeset/real-swans-leave.md
  • packages/davinci-client/src/lib/node.reducer.test.ts
  • e2e/davinci-app/main.ts
  • packages/davinci-client/src/lib/node.types.ts
  • packages/davinci-client/src/lib/davinci.api.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/src/lib/node.slice.ts
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/davinci.utils.ts
  • packages/davinci-client/api-report/davinci-client.api.md

Comment on lines +54 to +63
export type DaVinciRequestValueTypes =
| string
| number
| boolean
| (string | number | boolean)[]
| DeviceValue
| PhoneNumberInputValue
| FidoRegistrationInputValue
| FidoAuthenticationInputValue
| MetadataError;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Allow metadata object values in action requests.

CollectorValueType<MetadataCollector> accepts Record<string, unknown>, but DaVinciRequestValueTypes excludes it. Successful metadata payloads therefore cannot be represented by the typed request transformation.

  • packages/davinci-client/src/lib/client.types.ts#L54-L63: add Record<string, unknown> to DaVinciRequestValueTypes.
  • packages/davinci-client/api-report/davinci-client.types.api.md#L642-L643: regenerate the API report after updating the source type.
📍 Affects 2 files
  • packages/davinci-client/src/lib/client.types.ts#L54-L63 (this comment)
  • packages/davinci-client/api-report/davinci-client.types.api.md#L642-L643
🤖 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 `@packages/davinci-client/src/lib/client.types.ts` around lines 54 - 63, Add
Record<string, unknown> to the DaVinciRequestValueTypes union in
packages/davinci-client/src/lib/client.types.ts (lines 54-63) so metadata object
values are supported. Regenerate the API report at
packages/davinci-client/api-report/davinci-client.types.api.md (lines 642-643)
to reflect the updated public type.

@ancheetah

Copy link
Copy Markdown
Collaborator Author

Moved MetadataCollector interface from ObjectValueCollector to ObjectValueAutoCollector category

@ancheetah
ancheetah force-pushed the SDKS-5100-metadata-collector branch from c3b91d2 to 8693a1d Compare July 21, 2026 21:03
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.

4 participants