ping-identity
    Preparing search index...

    Function buildMetadataResult

    Headless collector normalisation and submit-planning helpers.

    • Wraps a success result for a MetadataCollector so it can be set as the collector's form value.

      Parameters

      • result: Record<string, unknown>

        The JSON object to POST as formData.sdkMetadata.

      Returns DaVinciMetadataResult

      The same object, typed as a DaVinciMetadataResult.

      DaVinciFormValue accepts only this branded type (and the error envelope from buildMetadataError) for METADATA, so a plain object literal does not compile. That keeps mis-shaped values for other collector kinds a compile-time error. The brand is type-only: the returned value is the same object that was passed in, and the runtime checks (plain non-array object, well-formed error envelope when an error key is present) are unchanged.

      form.setValue('sdkMetadata', buildMetadataResult({ status: 'success' }));
      await next(form.input);