diff --git a/.changeset/davinci-metadata-collector.md b/.changeset/davinci-metadata-collector.md new file mode 100644 index 000000000..26dd20874 --- /dev/null +++ b/.changeset/davinci-metadata-collector.md @@ -0,0 +1,18 @@ +--- +'@ping-identity/rn-davinci': minor +--- + +feat(rn-davinci): add DaVinci METADATA collector pause/resume support (SDKS-5384) + +Exposes the SDK Integrator connector pause/resume flow: a `METADATA` field now +surfaces as a typed `MetadataCollector` with the opaque connector payload on +`metadata` and the new `metadata` execution mode/field kind. The flow pauses +until the app sets a result as the collector's form value and resumes via +`next()` — an object is POSTed as the success result (wrap it with the new +`buildMetadataResult` helper, which keeps the form value type from accepting +arbitrary objects for other collectors), and a `{ error: { code, message } }` +envelope (build one with the new `buildMetadataError` helper) routes the +connector's error branch. Submit +planning blocks with `METADATA_RESULT_REQUIRED` while no result is set and +with `METADATA_RESULT_MALFORMED` for non-object, array, or malformed-envelope +values; `computeFormMeta` gains `hasMetadata`. diff --git a/PingSampleApp/ui/davinci/components/molecules/DaVinciFieldRenderer.tsx b/PingSampleApp/ui/davinci/components/molecules/DaVinciFieldRenderer.tsx index fefd423ab..8cbe8c87b 100644 --- a/PingSampleApp/ui/davinci/components/molecules/DaVinciFieldRenderer.tsx +++ b/PingSampleApp/ui/davinci/components/molecules/DaVinciFieldRenderer.tsx @@ -13,6 +13,7 @@ import DaVinciFidoField from './DaVinciFidoField'; import DaVinciIdpField from './DaVinciIdpField'; import DaVinciImageField from './DaVinciImageField'; import DaVinciLabelField from './DaVinciLabelField'; +import DaVinciMetadataField from './DaVinciMetadataField'; import DaVinciMultiSelectField from './DaVinciMultiSelectField'; import DaVinciPasswordField from './DaVinciPasswordField'; import DaVinciPhoneNumberField from './DaVinciPhoneNumberField'; @@ -86,6 +87,8 @@ function DaVinciFieldRenderer( return ; case 'IMAGE': return ; + case 'METADATA': + return ; default: return ; } diff --git a/PingSampleApp/ui/davinci/components/molecules/DaVinciMetadataField.tsx b/PingSampleApp/ui/davinci/components/molecules/DaVinciMetadataField.tsx new file mode 100644 index 000000000..46554c6bd --- /dev/null +++ b/PingSampleApp/ui/davinci/components/molecules/DaVinciMetadataField.tsx @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2026 Ping Identity Corporation. All rights reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + +import React from 'react'; +import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'; +import { + buildMetadataError, + buildMetadataResult, + type MetadataCollector, +} from '@ping-identity/rn-davinci'; +import { colors } from '../../../../src/styles/colors'; +import { commonStyles } from '../../../../src/styles/common'; +import { davinciFieldStyles } from '../../../../src/styles/davinciStyles'; +import type { DaVinciCollectorRendererProps } from './types'; + +/** + * Demo success result stored by the "Set result" control. + * + * @remarks + * A real integration replaces this with the object the connector expects — + * any non-empty JSON object is a valid success result. + */ +const DEMO_SUCCESS_RESULT = buildMetadataResult({ + status: 'success', + source: 'sample-app', +}); + +/** + * Renders a {@link MetadataCollector} pause field: the connector payload as + * pretty JSON plus demo controls that store a success result, an error + * envelope, or clear the stored result. + * + * @remarks + * SDK Integrator connector pause/resume: the SDK surfaces the opaque + * `metadata` payload; the app performs the on-device work and stores a result + * as the collector's form value before the flow can resume via `next()`. + * This molecule is sample-app demo scaffolding — "Set result" stores + * {@link DEMO_SUCCESS_RESULT} and "Set error" stores a + * {@link buildMetadataError} envelope; a real integration would replace both + * with the actual SDK work. "Clear" stores `null`, which the submit helper + * treats as unset and blocks with `METADATA_RESULT_REQUIRED` until a result + * is present (gating is result-set-based, independent of the server + * `required` flag). + * + * @param props Renderer props. + * @returns Metadata field element. + */ +export default function DaVinciMetadataField( + props: DaVinciCollectorRendererProps, +): React.ReactElement { + const { collector, value, onChange } = props; + const metadataCollector = collector as MetadataCollector; + const isSet = value !== undefined && value !== null; + + return ( + + + {metadataCollector.label || 'SDK metadata'} + + Connector payload: + + {JSON.stringify(metadataCollector.metadata, null, 2)} + + Result: + + {isSet ? JSON.stringify(value, null, 2) : 'Not set'} + + {!isSet ? ( + + A result is required before the flow can resume. + + ) : null} + onChange(DEMO_SUCCESS_RESULT)} + > + Set result + + + onChange( + buildMetadataError( + 'USER_CANCELLED', + 'User cancelled the operation', + ), + ) + } + > + Set error + + onChange(null)} + > + Clear + + + ); +} + +const styles = StyleSheet.create({ + jsonText: { + fontFamily: 'Courier', + fontSize: 12, + color: colors.textDark, + backgroundColor: colors.background, + borderRadius: 8, + padding: 8, + marginTop: 4, + marginBottom: 4, + }, +}); diff --git a/PingSampleApp/ui/davinci/hooks/useDaVinciAutoForwarder.ts b/PingSampleApp/ui/davinci/hooks/useDaVinciAutoForwarder.ts index a80fcf89f..2abab2a83 100644 --- a/PingSampleApp/ui/davinci/hooks/useDaVinciAutoForwarder.ts +++ b/PingSampleApp/ui/davinci/hooks/useDaVinciAutoForwarder.ts @@ -81,6 +81,12 @@ export function useDaVinciAutoForwarder( if (lastNodeKeyRef.current === continueNodeKey) return; const { meta, canSubmit, input } = form; + if (meta.hasMetadata) { + // A METADATA node needs an app-supplied result and an explicit Continue. + // Consume the one-shot flag here so a later node is not auto-forwarded. + onForwarded(); + return; + } if (meta.hasManual) return; if (meta.hasIntegrationRequired) return; if (meta.hasUnsupported) return; diff --git a/PingTestRunner/__tests__/integration/davinci.test.ts b/PingTestRunner/__tests__/integration/davinci.test.ts index aca736b21..58051f72f 100644 --- a/PingTestRunner/__tests__/integration/davinci.test.ts +++ b/PingTestRunner/__tests__/integration/davinci.test.ts @@ -1473,6 +1473,133 @@ describe('@ping-identity/rn-davinci — integration', () => { }); }); + // ─── METADATA — SDK Integrator pause/resume ─────────────────── + // + // The native mapper (packages/davinci native tests) already proves a + // MetadataCollector serialises to { key, type: 'METADATA', label, required, + // metadata: }. These tests exercise the JS composition layer: + // classification, pause gating (unset/malformed block), and resume + // pass-through (success object / error envelope reach the next() payload + // intact). + + describe('METADATA — SDK Integrator pause/resume', () => { + const metadataCollector = { + key: 'sdkMetadata', + type: 'METADATA', + label: '', + required: false, + metadata: { sdk: 'PROTECT', action: 'INITIALIZE' }, + }; + + const metadataNode = { + type: 'ContinueNode', + collectors: [metadataCollector], + }; + + function loadWithMetadataNode(): Promise<{ + mod: typeof import('@ping-identity/rn-davinci'); + mock: NativeDaVinciMock; + }> { + const mock = makeMock({ + start: jest.fn(async () => metadataNode), + }); + return loadDaVinci(mock).then((mod) => ({ mod, mock })); + } + + it('classifies METADATA as executionMode metadata + kind metadata (payload intact)', async () => { + const { mod } = await loadWithMetadataNode(); + const client = mod.createDaVinciClient(VALID_CONFIG); + const node = asContinueNode(await client.start()); + const collectors = mod.normalizeCollectors(node.collectors); + expect(collectors).toHaveLength(1); + expect(collectors[0]).toMatchObject({ + key: 'sdkMetadata', + type: 'METADATA', + executionMode: 'metadata', + kind: 'metadata', + requiresUserInput: false, + metadata: { sdk: 'PROTECT', action: 'INITIALIZE' }, + }); + }); + + it('computeFormMeta reports hasMetadata for a metadata node', async () => { + const { mod } = await loadWithMetadataNode(); + const client = mod.createDaVinciClient(VALID_CONFIG); + const node = asContinueNode(await client.start()); + expect( + mod.computeFormMeta(mod.normalizeCollectors(node.collectors)), + ).toMatchObject({ hasMetadata: true }); + }); + + it('unset value blocks with METADATA_RESULT_REQUIRED and sends nothing', async () => { + const { mod, mock } = await loadWithMetadataNode(); + const client = mod.createDaVinciClient(VALID_CONFIG); + const node = asContinueNode(await client.start()); + const plan = mod.buildNextInput(node, {}); + expect(plan.canSubmit).toBe(false); + expect(plan.issues).toContainEqual( + expect.objectContaining({ + code: 'METADATA_RESULT_REQUIRED', + key: 'sdkMetadata', + }), + ); + await client.next(plan.input); + expect(mock.next).toHaveBeenCalledWith('davinci-id-mock', { + collectors: [], + }); + }); + + it('success result passes through to the next() payload intact', async () => { + const { mod, mock } = await loadWithMetadataNode(); + const client = mod.createDaVinciClient(VALID_CONFIG); + const node = asContinueNode(await client.start()); + const plan = mod.buildNextInput(node, { + sdkMetadata: mod.buildMetadataResult({ status: 'success' }), + }); + expect(plan.canSubmit).toBe(true); + expect(plan.issues).toEqual([]); + await client.next(plan.input); + expect(mock.next).toHaveBeenCalledTimes(1); + expect(mock.next).toHaveBeenCalledWith('davinci-id-mock', { + collectors: [{ key: 'sdkMetadata', value: { status: 'success' } }], + }); + }); + + it('error envelope passes through to the next() payload intact', async () => { + const errorEnvelope = { + error: { code: 'USER_CANCELLED', message: 'User cancelled' }, + }; + const { mod, mock } = await loadWithMetadataNode(); + const client = mod.createDaVinciClient(VALID_CONFIG); + const node = asContinueNode(await client.start()); + const plan = mod.buildNextInput(node, { sdkMetadata: errorEnvelope }); + expect(plan.canSubmit).toBe(true); + expect(plan.issues).toEqual([]); + await client.next(plan.input); + expect(mock.next).toHaveBeenCalledWith('davinci-id-mock', { + collectors: [{ key: 'sdkMetadata', value: errorEnvelope }], + }); + }); + + it('malformed value (string) blocks with METADATA_RESULT_MALFORMED', async () => { + const { mod, mock } = await loadWithMetadataNode(); + const client = mod.createDaVinciClient(VALID_CONFIG); + const node = asContinueNode(await client.start()); + const plan = mod.buildNextInput(node, { sdkMetadata: 'not-an-object' }); + expect(plan.canSubmit).toBe(false); + expect(plan.issues).toContainEqual( + expect.objectContaining({ + code: 'METADATA_RESULT_MALFORMED', + key: 'sdkMetadata', + }), + ); + await client.next(plan.input); + expect(mock.next).toHaveBeenCalledWith('davinci-id-mock', { + collectors: [], + }); + }); + }); + // ─── terminal node shapes ────────────────────────────────────────────────── // // SuccessNode/ErrorNode/FailureNode pass through the bridge as-is. These diff --git a/PingTestRunner/e2e/davinci-metadata.test.ts b/PingTestRunner/e2e/davinci-metadata.test.ts new file mode 100644 index 000000000..8131124ac --- /dev/null +++ b/PingTestRunner/e2e/davinci-metadata.test.ts @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2026 Ping Identity Corporation. All rights reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + +/** + * E2E — DaVinci METADATA collector pause/resume + * + * A DaVinci SDK Integrator connector pauses the flow with a `METADATA` + * collector carrying an opaque payload; the app performs the on-device work + * and supplies a result before the flow resumes via `next()`. + * + * The live test is env-gated: driving a METADATA field requires a tenant flow + * whose connector actually pauses with `METADATA`. Unless + * DAVINCI_METADATA_FLOW is `true`, the live test is registered as skipped, so + * reports show it as skipped rather than passed. The deterministic scenario UI + * (payload display, Set result / Set error / Clear controls, unset-state + * indicator) is covered by the integration suite in + * `__tests__/integration/davinci.test.ts` without a live flow. + * + * To run the live test against a metadata-enabled tenant flow: + * 1. Set DAVINCI_METADATA_FLOW=true plus the standard DaVinci env vars + * (PINGONE_DISCOVERY_ENDPOINT, PINGONE_CLIENT_ID, PINGONE_REDIRECT_URI, + * PINGONE_ACR_VALUES — the same set the launchArgs below forward; note + * these launch the app's DaVinci scenario unauthenticated, matching + * davinci.test.ts — drive any login step through the flow itself). + * 2. Update DAVINCI_METADATA_KEY below to the connector's collector key. + * + * testIDs consumed (see scenarios/DaVinciScenario.tsx manifest): + * davinci-field-{key}-metadata-payload / -metadata-value / -metadata-unset + * davinci-field-{key}-metadata-set-result / -metadata-set-error / -metadata-clear + */ + +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { device, element, by, expect as detoxExpect, waitFor } from 'detox'; +import { expect as jestExpect } from '@jest/globals'; +import { assertAppReady, DAVINCI_ENV } from './setup'; + +const NET_TIMEOUT = 30000; + +// Collector key the metadata-enabled connector uses on the pause node. +const DAVINCI_METADATA_KEY = + process.env['PING_DAVINCI_METADATA_KEY'] ?? 'sdkMetadata'; + +// Registered as skipped (not silently passed) unless a metadata-enabled tenant +// flow is configured; the file header lists the env vars required to enable it. +const itLive = process.env['DAVINCI_METADATA_FLOW'] === 'true' ? it : it.skip; + +const LAUNCH_ARGS = { + PING_TEST_SCENARIO: 'davinci', + ...(DAVINCI_ENV.discoveryEndpoint + ? { PINGONE_DISCOVERY_ENDPOINT: DAVINCI_ENV.discoveryEndpoint } + : {}), + ...(DAVINCI_ENV.clientId ? { PINGONE_CLIENT_ID: DAVINCI_ENV.clientId } : {}), + ...(DAVINCI_ENV.redirectUri + ? { PINGONE_REDIRECT_URI: DAVINCI_ENV.redirectUri } + : {}), + ...(DAVINCI_ENV.acrValues + ? { PINGONE_ACR_VALUES: DAVINCI_ENV.acrValues } + : {}), +}; + +describe('DaVinci — METADATA pause/resume', () => { + beforeAll(async () => { + await device.launchApp({ newInstance: true, launchArgs: LAUNCH_ARGS }); + await device.disableSynchronization(); + }); + + afterAll(async () => { + await device.terminateApp(); + }); + + it('app launches and root is visible', async () => { + await assertAppReady(); + }); + + itLive( + 'METADATA field surfaces payload, blocks while unset, then resumes with a result (live)', + async () => { + // The flow's first node is a form whose single SUBMIT_BUTTON ("Metadata") + // leads to the METADATA pause. The bridge surfaces exactly one submit + // button here, so it carries the generic davinci-submit-btn testID. + await element(by.id('davinci-start-btn')).tap(); + await waitFor(element(by.id('davinci-submit-btn'))) + .toBeVisible() + .withTimeout(NET_TIMEOUT); + await element(by.id('davinci-submit-btn')).tap(); + + await waitFor(element(by.id(`davinci-field-${DAVINCI_METADATA_KEY}`))) + .toBeVisible() + .withTimeout(NET_TIMEOUT); + // Re-asserted via detoxExpect: BrowserStack derives the test verdict from + // explicit expect calls, not waitFor polling. + await detoxExpect( + element( + by.id(`davinci-field-${DAVINCI_METADATA_KEY}-metadata-payload`), + ), + ).toBeVisible(); + + // Unset state: the blocking indicator is visible until a result is set. + await detoxExpect( + element(by.id(`davinci-field-${DAVINCI_METADATA_KEY}-metadata-unset`)), + ).toBeVisible(); + + // Store a demo success result and confirm the value indicator updated. + await element( + by.id(`davinci-field-${DAVINCI_METADATA_KEY}-metadata-set-result`), + ).tap(); + await waitFor( + element(by.id(`davinci-field-${DAVINCI_METADATA_KEY}-metadata-value`)), + ) + .toBeVisible() + .withTimeout(NET_TIMEOUT); + const attrs = await element( + by.id(`davinci-field-${DAVINCI_METADATA_KEY}-metadata-value`), + ).getAttributes(); + const text = (attrs as any).text ?? (attrs as any).label ?? ''; + jestExpect(text).toContain('status'); + + // Resume: with the result stored the flow must advance past the pause. + // The flow echoes the submitted result on a message node and then loops + // back to its start form, so the post-resume assertion is that a new + // form node arrived rather than a terminal success screen. + await element(by.id('davinci-submit-btn')).tap(); + await waitFor(element(by.id('davinci-start-btn'))) + .toBeVisible() + .withTimeout(NET_TIMEOUT); + // The next node renders a fresh form: the field container is gone + // (resumed past the pause) while the scenario stays interactive. + await detoxExpect( + element(by.id(`davinci-field-${DAVINCI_METADATA_KEY}-metadata-unset`)), + ).not.toExist(); + }, + ); +}); diff --git a/PingTestRunner/ios/Podfile.lock b/PingTestRunner/ios/Podfile.lock index de8771a54..6299ba217 100644 --- a/PingTestRunner/ios/Podfile.lock +++ b/PingTestRunner/ios/Podfile.lock @@ -3731,86 +3731,86 @@ SPEC CHECKSUMS: RCTTypeSafety: d877728097547d0a37786cc9130c43ad71739ac3 React: 4b0b9cb962e694611e5e8a697c1b0300a2510c21 React-callinvoker: 70f125c17c7132811a6b473946ac5e7ae93b5e57 - React-Core: 7cbc3118df2334b2ef597d9a515938b02c82109f - React-CoreModules: 7d8c14ecb889e7786a04637583b55b7d8f246baf - React-cxxreact: f32be07cba236c2f20f4e05ca200577ba5358e78 + React-Core: bab40f5b1f46fe0c5896895a6f333e861a821a81 + React-CoreModules: 05647d952e521113c128360633896ba7ba652e82 + React-cxxreact: 2b4bac1ec6eecc6288ac8a6caea6afb42585740e React-debug: deb3a146ef717fa3e8f4c23e0288369fe53199b7 - React-defaultsnativemodule: 2c13a4240c5f96c42d069d1ba2392de6b4145bbd - React-domnativemodule: 91349b0b1cb20310cec1341b87cdd461aaa85e57 - React-Fabric: bdfc7ec2481f26d7a9b8f59461f29ba4d903c549 - React-FabricComponents: 47898469543d1bfb4528a9846419ec5568be89b1 - React-FabricImage: ac8fc85ef452e5e9ae935c41118814651bd9e7f3 - React-featureflags: 793b911e4c53e680db4a7d9965d0d6dc87b2fa88 - React-featureflagsnativemodule: 25c9516d0dd004493c9bbafeb97da20bf9bde7dc - React-graphics: e07281690425dd9eeba3875d1faad28bc1f6da3b - React-hermes: bc1440d0e0662cc813bbf1c5ffbf9e0db2993a0f - React-idlecallbacksnativemodule: a2a3bb4a1793280b34d06d00169153b094be8c16 - React-ImageManager: c9fa7461f3cab08e7bc98cbf55455b499e71c8b3 - React-jserrorhandler: 15e591702040afed99cfcd088cf2337a8d09d807 - React-jsi: 512ab3a1a628bc8824c41de8bcbbb81b2ac6fa8d - React-jsiexecutor: 653ccd2dee1e5ea558eecaf2f27b8bba0f09add8 - React-jsinspector: 9121ccd2676a3f7c079ac01c9f90183422e3190e - React-jsinspectorcdp: 5c723ff2a09d73f2fdc496a545fb7003e7fdc079 - React-jsinspectornetwork: 9cb0173f69e8405cef33fc79030fad26bbc3c073 - React-jsinspectortracing: 65dc04125dc2392d85a82b6916f8cb088ea77566 - React-jsitooling: 21af93cc98f760dd88d65b06b9317e0d4849fbbc - React-jsitracing: 4cc1b7de8087ae41c61a0eeee2593bc3362908b6 - React-logger: 2f0d40bc8e648fbb1ff3b6580ad54189a8753290 - React-Mapbuffer: 9a7c65078c6851397c1999068989e4fc239d0c80 - React-microtasksnativemodule: 4f1ef719ba6c7ebbd2d75346ffa2916f9b4771c9 - react-native-launch-arguments: c02ee750ca094c92d2f9a5830c2c085efd10ec56 - React-NativeModulesApple: f6f696e510b9d89c3c06b7764f56947dc13ae922 + React-defaultsnativemodule: 11e2948787a15d3cf1b66d7f29f13770a177bff7 + React-domnativemodule: 2f4b279acdb2963736fb5de2f585811dd90070b5 + React-Fabric: 6f8d1a303c96f1d078c14d74c4005bf457e5b782 + React-FabricComponents: b106410970e9a0c4e592da656c7a7e0947306c23 + React-FabricImage: 1abaf230dfce9b58fdf53c4128f3f40c6e64af6a + React-featureflags: f7ef58d91079efde3ad223bcca6d197e845d5bcf + React-featureflagsnativemodule: ae5abc9849d1696f4f8f11ee3744bf5715e032cf + React-graphics: b306856c6ed9aac32f717a229550406a53b28a6d + React-hermes: b6edce8fa19388654b1aea30844497cbeade83bc + React-idlecallbacksnativemodule: cb386712842cb9e479c89311edb234d529b64db4 + React-ImageManager: 8ce94417853eaa22faaad1f4cc1952dd3f8e2275 + React-jserrorhandler: ab827d67dc270a9c8703eef524230baeafaf6876 + React-jsi: 545342ec5c78ab1277af5f0dbe8d489e7e73db14 + React-jsiexecutor: 20210891c7c77255c16dec6762faf68b373f9f74 + React-jsinspector: 4e73460e488132d70d2b4894e5578cc856f2cb74 + React-jsinspectorcdp: 8b2bcb5779289cb2b9ca517f2965ed23eb2fd3e0 + React-jsinspectornetwork: b5e0cb9e488d294eed2d8209dc3dc0f9587210c1 + React-jsinspectortracing: f3c4036e7b984405ac910f878576d325dd9f2834 + React-jsitooling: 75bbfd221b6173a5e848ca5a6680506bac064a56 + React-jsitracing: 11ed7d821864dd988c159d4943e0a1e0937c11b1 + React-logger: 984ebd897afad067555d081deaf03f57c4315723 + React-Mapbuffer: 0c045c844ce6d85cde53e85ab163294c6adad349 + React-microtasksnativemodule: d9499269ad1f484ae71319bac1d9231447f2094e + react-native-launch-arguments: eab68037b01ea7c78a0b3b55da3a5e967e9aaf92 + React-NativeModulesApple: 983f3483ef0a3446b56d490f09d579fba2442e17 React-oscompat: 114036cd8f064558c9c1a0c04fc9ae5e1453706a - React-perflogger: 4b2f88ae059b600daf268528a4a83366338eef05 - React-performancetimeline: e15fd9798123436f99e46898422fe921fecf506b + React-perflogger: e7287fee27c16e3c8bd4d470f2361572b63be16b + React-performancetimeline: 8ebbaa31d2d0cea680b0a2a567500d3cab8954fc React-RCTActionSheet: 68c68b0a7a5d2b0cfc255c64889b6e485974e988 - React-RCTAnimation: 6bf502c89c53076f92cd1a254f5ec8d63ee263de - React-RCTAppDelegate: c90f5732784684c3dd226d812eccb578cd954ad7 - React-RCTBlob: d2905f01749b80efd6d3b86fb15e30ed26d5450b - React-RCTFabric: 435b3ffaad113fb1f274c2f2a677c9fcc9b5cf55 - React-RCTFBReactNativeSpec: a3178b419f42af196e90ca4bf07710dce5d68301 - React-RCTImage: 8f5ffa03461339180a68820ea452af6e20ace2c7 - React-RCTLinking: 1151646834d31f97580d8a75d768a84b2533b7f9 - React-RCTNetwork: 52008724d0db90a540f4058ed0de0e41c4b7943c - React-RCTRuntime: 10ce9a7cb27ba307544d29a2a04e6202dc7b3e9a - React-RCTSettings: f724cacbd892ee18f985e1aebdd97386e49c76f5 - React-RCTText: 6e1b95d9126d808410dfa96e09bc4441ec6f36f7 - React-RCTVibration: 862a4e5b36d49e6299c8cbfb86486fc31f86f6fa + React-RCTAnimation: d6c5c728b888a967ce9aff1ff71a8ed71a68d069 + React-RCTAppDelegate: 0fc048666bda159cd469a6fb9befb04b3fa62be4 + React-RCTBlob: 12d8c699a1f906840113ee8d8bb575e69a05509f + React-RCTFabric: 01e815845ebc185f44205dcbf50eeb712fec23fe + React-RCTFBReactNativeSpec: f57927fb0af6ce2f25c19f8b894e2986138aa89f + React-RCTImage: a82518168f4ee407913b23ca749ca79ef51959f3 + React-RCTLinking: 7f343b584c36f024f390fea563483568fe763ef6 + React-RCTNetwork: 3165eb757ceb62a7cde4cdad043d63314122e8a3 + React-RCTRuntime: feee590c459c4cb6aaa7a00f3abc8c04709b536f + React-RCTSettings: 6bad0ae45d8d872c873059f332f586f99875621f + React-RCTText: 657d60f35983062de8f0cea67c279aa7a3ea9858 + React-RCTVibration: 78f4770515141efb7f55f9b27c49dda95319c3a8 React-rendererconsistency: f7baab26c6d0cd5b2eb7afcecfd2d8b957017b18 - React-renderercss: 62acb8f010a062309e3bd0e203aa14636162e3b3 - React-rendererdebug: 3a89ac44f15c7160735264d585a29525655238d2 + React-renderercss: bdd2f83a4a054c3e4321fd61305c202b848e471b + React-rendererdebug: 9f8865ee038127a9d99d4b034c9da4935d204993 React-rncore: f7438473c4c71ee1963fb06a8635bb96013c9e1c - React-RuntimeApple: 81f0a9ba81ce7eb203529b0471dc69bf18f5f637 - React-RuntimeCore: 6356e89b2518ba66a989c39a2adb18122a5e3b7b + React-RuntimeApple: 4d2ab9f72b9193da86eceded128a67254fc18aeb + React-RuntimeCore: 5fd73030438d094975ca0f549d162dd97746ae38 React-runtimeexecutor: 17c70842d5e611130cb66f91e247bc4a609c3508 - React-RuntimeHermes: 0a1d7ce2fe08cf182235de1a9330b51aa6b935cd - React-runtimescheduler: 10ae98e1417eff159be5df8fdc8fcdaac557aba6 + React-RuntimeHermes: 3c88e6e1ea7ea0899dcffc77c10d61ea46688cfd + React-runtimescheduler: 024500621c7c93d65371498abb4ee26d34f5d47d React-timing: c3c923df2b86194e1682e01167717481232f1dc7 - React-utils: 7791a96e194eec85cb41dc98a2045b5f07839598 - ReactAppDependencyProvider: ba631a31783569c13056dd57ff39e19764abdd6f - ReactCodegen: 1e9f3e8a3f56fa25fbf39ecd37b708a4838d9032 - ReactCommon: 96684b90b235d6ae340d126141edd4563b7a446a + React-utils: 9154a037543147e1c24098f1a48fc8472602c092 + ReactAppDependencyProvider: afd905e84ee36e1678016ae04d7370c75ed539be + ReactCodegen: 62690fdeb185860673cb78e3d9b049c7e1d40531 + ReactCommon: 17fd88849a174bf9ce45461912291aca711410fc RecaptchaEnterprise: a28429a5366cc0f687ac5e93a44c5caa2c685aa9 RecaptchaEnterpriseSDK: 72239ea30c486d9093918c7b31eb85629eff1a50 RecaptchaInterop: 11e0b637842dfb48308d242afc3f448062325aba - RNCAsyncStorage: 767abb068db6ad28b5f59a129fbc9fab18b377e2 - RNPingBinding: e4d2b04deac5fd415bc6c51183f8ab7f20a32cae - RNPingBrowser: c8c9c7d39ae023f2dd3c5d59c7b5577e2afb5093 - RNPingCore: f4a461e75fbe3fccf3263e2b91938d9887324b32 - RNPingDavinci: 9b356e3b5bf6f0c3f956a20df788d2046d126bec - RNPingDeviceClient: ffede82b969dd2119f02a79735a3e87bf2bd5290 - RNPingDeviceId: 24b703e3ae56c1e565fb3817916baa8874c51886 - RNPingDeviceProfile: 2ec43b7ac75897523af8222688b7e98a5a695eb9 - RNPingExternalIdp: 017fdda77ecf222960029213ad7a50bf54f9d067 - RNPingFido: faf7fbaeeef3c4e0513091eacfc46dd45579baa8 - RNPingJourney: 6cf81cf6036580d995ebf92e41843791251487bf - RNPingLogger: 0ce33153b0caf1790dc8156986557924767a1b69 - RNPingOath: 58432fb0f7f72eaea13dc8c761a2fe45974da716 - RNPingOidc: bd7d8b6f5dc7da893c1f0d713058500a16606a95 - RNPingProtect: f80df46fd64be64c343ca1507315ec9093c53863 - RNPingPush: 1043c9fcb01b0172b99690d2fe7f12d61948f49d - RNPingRecaptcha: 20ff6927ccac6cb4497e59c040eb9b778c323d48 - RNPingStorage: ce105d17812c024e043f8234ef62d1e5fdf80e25 + RNCAsyncStorage: 1f04c8d56558e533277beda29187f571cf7eecb2 + RNPingBinding: c2a36497bad23954aafa867594ff3da82ce4cd0a + RNPingBrowser: 798d176d117a73294d6b7863ecbc27fd54e6515d + RNPingCore: d97a80b517854e846c40b6f0155c4ffed6bd793a + RNPingDavinci: 5bd80921949104545f2744a7ec2d47da0a399554 + RNPingDeviceClient: be4ccdf53ee94adb65bb6ccea1395a485426612e + RNPingDeviceId: b047b8e355f31104673e9ff3a65998329bfc999a + RNPingDeviceProfile: aaa66f2e792bbee60f4d40686668e867d7b1c73f + RNPingExternalIdp: 16a3b51f49df157dc11fe1568b4f89f251a45229 + RNPingFido: b7025cc73c8bef937d43bcdcb693cb325ce86dbc + RNPingJourney: 8290ffc12aa49794e6b5aaac4d870f0488b12743 + RNPingLogger: 5bd4be81a79cf6a7e1788bbac08d3c33156c0359 + RNPingOath: aa9a3684200d9df715544106102857f314c09a32 + RNPingOidc: c6c84a86496759050cdcb774ae5b5ce63b56ed9c + RNPingProtect: 04bbf636ae2b67a501d783495b73d59481f07329 + RNPingPush: ef0ead1586fb6e98d0bfa0b44377f9c56d6f5e16 + RNPingRecaptcha: f47c662cefe81eb994db5896a395d599de352b90 + RNPingStorage: b25be825a2d9cfa85e1e640c1b3c52476e39f277 SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: daa1e4de4b971b977b23bc842aaa3e135324f1f3 diff --git a/PingTestRunner/scenarios/DaVinciScenario.tsx b/PingTestRunner/scenarios/DaVinciScenario.tsx index 8b48b8b26..39f017a94 100644 --- a/PingTestRunner/scenarios/DaVinciScenario.tsx +++ b/PingTestRunner/scenarios/DaVinciScenario.tsx @@ -18,6 +18,12 @@ * davinci-field-{key} → per-collector input * davinci-field-{key}-option-{value} → option button for single/multi-select * davinci-field-{key}-image-url / -image-description / -image-hyperlink → IMAGE display-only field (url, alt text, optional hyperlink) + * davinci-field-{key}-metadata-payload → METADATA connector payload (pretty JSON) + * davinci-field-{key}-metadata-value → current result value, or "Not set" + * davinci-field-{key}-metadata-unset → visible only while unset (blocking) + * davinci-field-{key}-metadata-set-result → stores a demo success result + * davinci-field-{key}-metadata-set-error → stores a demo error envelope + * davinci-field-{key}-metadata-clear → clears the stored result * davinci-flow-{key} → FLOW_BUTTON / FLOW_LINK / ACTION * davinci-submit-btn → first SUBMIT_BUTTON (or fallback submit) * davinci-submit-{label} → additional SUBMIT_BUTTON collectors, keyed by label @@ -39,6 +45,7 @@ import React, { useCallback, useState } from 'react'; import { Button, Switch, Text, TextInput, View } from 'react-native'; import { LaunchArguments } from 'react-native-launch-arguments'; import { + buildMetadataResult, createDaVinciClient, normalizeCollectors, } from '@ping-identity/rn-davinci'; @@ -584,6 +591,51 @@ function CollectorField({ return Polling…; } + if (collector.type === 'METADATA') { + const metadataCollector = collector as Extract< + DaVinciNormalizedCollector, + { type: 'METADATA' } + >; + const isSet = value !== undefined && value !== null; + return ( + + + {JSON.stringify(metadataCollector.metadata)} + + + {isSet ? JSON.stringify(value) : 'Not set'} + + {!isSet ? ( + + Result required before resume + + ) : null} +