ping-identity
    Preparing search index...

    Function buildNextInput

    Headless collector normalisation and submit-planning helpers.

    • Builds a next() payload from a DaVinci node and form values.

      Parameters

      • node: DaVinciNode

        Current DaVinci node. Returns a NO_ACTIVE_CONTINUE_NODE issue when absent.

      • values: DaVinciFormValues

        Form values keyed by collector key.

      • OptionalhandledCollectorTypes: ReadonlySet<string>

        Collector types the app has already processed via native integration (e.g. IdP, FIDO, Protect). Matching integration_required collectors are excluded from submit issues so canSubmit reflects true readiness.

      • OptionalflowKey: string

        Optional FlowCollector key to submit immediately.

      Returns DaVinciBuildNextInputResult

      Submit plan with payload, submit eligibility, and issues.

      Basic submit:

      const { canSubmit, input, issues } = buildNextInput(node, values);
      if (canSubmit) {
      await client.next(input);
      }

      Flow button (bypasses all other field values):

      const { input } = buildNextInput(node, values, undefined, 'forgot-password');
      await client.next(input);

      When flowKey is provided, the payload contains only that single collector key — all other field values are ignored and no REQUIRED_VALUE_MISSING issues are produced. This mirrors how FlowCollector advances the flow with eventType = "action" on the native side.

      Integration-required collectors whose type appears in handledCollectorTypes are silently skipped; those not in the set emit a non-blocking INTEGRATION_REQUIRED issue and force canSubmit: false.