Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ GEMINI.md

# Polaris
.polaris-setup-progress.json
.polaris
.playwright-mcp
46 changes: 32 additions & 14 deletions e2e/davinci-app/components/boolean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,38 @@
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import type { ValidatedBooleanCollector, Updater } from '@forgerock/davinci-client/types';
import type {
ValidatedBooleanCollector,
Updater,
Validator,
} from '@forgerock/davinci-client/types';

/**
* Creates a single checkbox and attaches it to the form
* @param {HTMLFormElement} formEl - The form element to attach the checkboxes to
* @param {HTMLFormElement} formEl - The form element to attach the checkbox to
* @param {ValidatedBooleanCollector} collector - Contains the configuration
* @param {Updater} updater - Function to call when selection changes
*/
export default function booleanComponent(
formEl: HTMLFormElement,
collector: ValidatedBooleanCollector,
updater: Updater<ValidatedBooleanCollector>,
validator: Validator<ValidatedBooleanCollector>,
) {
// Create a container for the checkboxes
const collectorKey = collector.output.key;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

❓ Verification inconclusive

Script executed:

find . -type f -name "boolean.ts" -path "*davinci-app*"

Repository: ForgeRock/ping-javascript-sdk


Repository: ForgeRock/ping-javascript-sdk
Exit code: 0

stdout:

./e2e/davinci-app/components/boolean.ts


Script executed:

cat -n ./e2e/davinci-app/components/boolean.ts

Repository: ForgeRock/ping-javascript-sdk


Repository: ForgeRock/ping-javascript-sdk
Exit code: 0

stdout:

     1	/*
     2	 * Copyright (c) 2026 Ping Identity Corporation. All rights reserved.
     3	 *
     4	 * This software may be modified and distributed under the terms
     5	 * of the MIT license. See the LICENSE file for details.
     6	 */
     7	import type {
     8	  ValidatedBooleanCollector,
     9	  Updater,
    10	  Validator,
    11	} from '`@forgerock/davinci-client/types`';
    12	
    13	/**
    14	 * Creates a single checkbox and attaches it to the form
    15	 * `@param` {HTMLFormElement} formEl - The form element to attach the checkbox to
    16	 * `@param` {ValidatedBooleanCollector} collector - Contains the configuration
    17	 * `@param` {Updater} updater - Function to call when selection changes
    18	 */
    19	export default function booleanComponent(
    20	  formEl: HTMLFormElement,
    21	  collector: ValidatedBooleanCollector,
    22	  updater: Updater<ValidatedBooleanCollector>,
    23	  validator: Validator<ValidatedBooleanCollector>,
    24	) {
    25	  const collectorKey = collector.output.key;
    26	
    27	  // Create a container for the checkbox
    28	  const containerDiv = document.createElement('div');
    29	  containerDiv.className = 'single-checkbox-container';
    30	
    31	  // Create a single checkbox
    32	  const wrapper = document.createElement('div');
    33	  wrapper.className = 'checkbox-wrapper';
    34	
    35	  const checkbox = document.createElement('input');
    36	  checkbox.type = 'checkbox';
    37	  checkbox.id = collectorKey;
    38	  checkbox.name = collectorKey || 'single-checkbox-field';
    39	  checkbox.checked = collector.output.value;
    40	  checkbox.value = 'checked';
    41	
    42	  const label = document.createElement('label');
    43	  label.htmlFor = checkbox.id;
    44	  label.textContent = collector.output.label;
    45	
    46	  // Add event listener to handle single-select behavior
    47	  checkbox.addEventListener('change', (event) => {
    48	    const checked = (event.target as HTMLInputElement).checked;
    49	    const result = validator(checked);
    50	    const errorEl = formEl?.querySelector(`.${collectorKey}-error`);
    51	
    52	    // Keep collector state aligned with the current UI value
    53	    const updateError = updater(checked);
    54	    if (updateError && 'error' in updateError) {
    55	      console.error(updateError.error.message);
    56	    }
    57	
    58	    // Validate the input
    59	    if (Array.isArray(result) && result.length && !errorEl) {
    60	      const errorEl = document.createElement('div');
    61	      errorEl.className = `${collectorKey}-error`;
    62	      errorEl.innerText = result.join(', ');
    63	      formEl?.querySelector(`#${collectorKey}`)?.after(errorEl);
    64	    } else {
    65	      formEl.querySelector(`.${collectorKey}-error`)?.remove();
    66	    }
    67	  });
    68	
    69	  wrapper.appendChild(checkbox);
    70	  wrapper.appendChild(label);
    71	  containerDiv.appendChild(wrapper);
    72	
    73	  // Append the container to the form
    74	  formEl.appendChild(containerDiv);
    75	}


Script executed:

# Search for how collector.output.key is generated or what format it follows
rg "collector\.output\.key" -B 3 -A 3 --type ts --type js

Repository: ForgeRock/ping-javascript-sdk


Repository: ForgeRock/ping-javascript-sdk
Exit code: 0

stdout:

e2e/davinci-app/main.ts-          collector, // This is the plain object of the collector
e2e/davinci-app/main.ts-          davinciClient.flow({
e2e/davinci-app/main.ts-            // Returns a function to call the flow from within component
e2e/davinci-app/main.ts:            action: collector.output.key,
e2e/davinci-app/main.ts-          }),
e2e/davinci-app/main.ts-          renderForm, // Ignore this; it's just for re-rendering the form
e2e/davinci-app/main.ts-        );
--
e2e/davinci-app/components/boolean.ts-  updater: Updater<ValidatedBooleanCollector>,
e2e/davinci-app/components/boolean.ts-  validator: Validator<ValidatedBooleanCollector>,
e2e/davinci-app/components/boolean.ts-) {
e2e/davinci-app/components/boolean.ts:  const collectorKey = collector.output.key;
e2e/davinci-app/components/boolean.ts-
e2e/davinci-app/components/boolean.ts-  // Create a container for the checkbox
e2e/davinci-app/components/boolean.ts-  const containerDiv = document.createElement('div');
--
e2e/davinci-app/components/fido.ts-  if (collector.type === 'FidoRegistrationCollector') {
e2e/davinci-app/components/fido.ts-    const button = document.createElement('button');
e2e/davinci-app/components/fido.ts-    button.type = 'button';
e2e/davinci-app/components/fido.ts:    button.value = collector.output.key;
e2e/davinci-app/components/fido.ts-    button.innerHTML = 'FIDO Register';
e2e/davinci-app/components/fido.ts-    formEl.appendChild(button);
e2e/davinci-app/components/fido.ts-
--
e2e/davinci-app/components/fido.ts-  } else if (collector.type === 'FidoAuthenticationCollector') {
e2e/davinci-app/components/fido.ts-    const button = document.createElement('button');
e2e/davinci-app/components/fido.ts-    button.type = 'button';
e2e/davinci-app/components/fido.ts:    button.value = collector.output.key;
e2e/davinci-app/components/fido.ts-    button.innerHTML = 'FIDO Authenticate';
e2e/davinci-app/components/fido.ts-    formEl.appendChild(button);
e2e/davinci-app/components/fido.ts-
--
e2e/davinci-app/components/password.ts-  updater: Updater<PasswordCollector | ValidatedPasswordCollector>,
e2e/davinci-app/components/password.ts-  validator?: Validator,
e2e/davinci-app/components/password.ts-) {
e2e/davinci-app/components/password.ts:  const collectorKey = dotToCamelCase(collector.output.key);
e2e/davinci-app/components/password.ts-  const label = document.createElement('label');
e2e/davinci-app/components/password.ts-  const input = document.createElement('input');
e2e/davinci-app/components/password.ts-
--
e2e/davinci-app/components/polling.ts-) {
e2e/davinci-app/components/polling.ts-  const button = document.createElement('button');
e2e/davinci-app/components/polling.ts-  button.type = 'button';
e2e/davinci-app/components/polling.ts:  button.value = collector.output.key;
e2e/davinci-app/components/polling.ts-  button.innerHTML = 'Start polling';
e2e/davinci-app/components/polling.ts-  formEl.appendChild(button);
e2e/davinci-app/components/polling.ts-
--
e2e/davinci-app/components/multi-value.ts-
e2e/davinci-app/components/multi-value.ts-    const checkbox = document.createElement('input');
e2e/davinci-app/components/multi-value.ts-    checkbox.type = 'checkbox';
e2e/davinci-app/components/multi-value.ts:    checkbox.id = `${collector.output.key}-${index}`;
e2e/davinci-app/components/multi-value.ts:    checkbox.name = collector.output.key || 'checkbox-field';
e2e/davinci-app/components/multi-value.ts-    checkbox.value = option.value;
e2e/davinci-app/components/multi-value.ts-
e2e/davinci-app/components/multi-value.ts-    const label = document.createElement('label');
--
e2e/davinci-app/components/text.ts-  updater: Updater<TextCollector | ValidatedTextCollector>,
e2e/davinci-app/components/text.ts-  validator: Validator<ValidatedTextCollector>,
e2e/davinci-app/components/text.ts-) {
e2e/davinci-app/components/text.ts:  const collectorKey = dotToCamelCase(collector.output.key);
e2e/davinci-app/components/text.ts-  const label = document.createElement('label');
e2e/davinci-app/components/text.ts-  const input = document.createElement('input');
e2e/davinci-app/components/text.ts-
--
e2e/davinci-app/components/single-value.ts-  // Create the label element
e2e/davinci-app/components/single-value.ts-  const labelEl = document.createElement('label');
e2e/davinci-app/components/single-value.ts-  labelEl.textContent = collector.output.label || 'Select an option';
e2e/davinci-app/components/single-value.ts:  labelEl.setAttribute('for', collector.output.key || 'dropdown-field');
e2e/davinci-app/components/single-value.ts-  labelEl.className = 'dropdown-label';
e2e/davinci-app/components/single-value.ts:  labelEl.setAttribute('for', collector.output.key || 'dropdown-field');
e2e/davinci-app/components/single-value.ts-
e2e/davinci-app/components/single-value.ts-  // Create the select element
e2e/davinci-app/components/single-value.ts-  const selectEl = document.createElement('select');
e2e/davinci-app/components/single-value.ts:  selectEl.name = collector.output.key || 'dropdown-field';
e2e/davinci-app/components/single-value.ts:  selectEl.id = collector.output.key || 'dropdown-field';
e2e/davinci-app/components/single-value.ts-
e2e/davinci-app/components/single-value.ts-  // Add all options from the data
e2e/davinci-app/components/single-value.ts-  for (const option of collector.output.options) {


Script executed:

# Search for dotToCamelCase definition and usage
rg "dotToCamelCase" -B 2 -A 5 --type ts --type js

Repository: ForgeRock/ping-javascript-sdk


Repository: ForgeRock/ping-javascript-sdk
Exit code: 0

stdout:

e2e/journey-app/helper.ts- * of the MIT license. See the LICENSE file for details.
e2e/journey-app/helper.ts- */
e2e/journey-app/helper.ts:export function dotToCamelCase(str: string) {
e2e/journey-app/helper.ts-  return str
e2e/journey-app/helper.ts-    .split('.')
e2e/journey-app/helper.ts-    .map((part: string, index: number) =>
e2e/journey-app/helper.ts-      index === 0 ? part.toLowerCase() : part.charAt(0).toUpperCase() + part.slice(1).toLowerCase(),
e2e/journey-app/helper.ts-    )
--
e2e/davinci-app/helper.ts- * of the MIT license. See the LICENSE file for details.
e2e/davinci-app/helper.ts- */
e2e/davinci-app/helper.ts:export function dotToCamelCase(str: string) {
e2e/davinci-app/helper.ts-  return str
e2e/davinci-app/helper.ts-    .split('.')
e2e/davinci-app/helper.ts-    .map((part: string, index: number) =>
e2e/davinci-app/helper.ts-      index === 0 ? part.toLowerCase() : part.charAt(0).toUpperCase() + part.slice(1).toLowerCase(),
e2e/davinci-app/helper.ts-    )
--
e2e/davinci-app/components/text.ts-  Validator,
e2e/davinci-app/components/text.ts-} from '`@forgerock/davinci-client/types`';
e2e/davinci-app/components/text.ts:import { dotToCamelCase } from '../helper.js';
e2e/davinci-app/components/text.ts-
e2e/davinci-app/components/text.ts-export default function textComponent(
e2e/davinci-app/components/text.ts-  formEl: HTMLFormElement,
e2e/davinci-app/components/text.ts-  collector: TextCollector | ValidatedTextCollector,
e2e/davinci-app/components/text.ts-  updater: Updater<TextCollector | ValidatedTextCollector>,
e2e/davinci-app/components/text.ts-  validator: Validator<ValidatedTextCollector>,
e2e/davinci-app/components/text.ts-) {
e2e/davinci-app/components/text.ts:  const collectorKey = dotToCamelCase(collector.output.key);
e2e/davinci-app/components/text.ts-  const label = document.createElement('label');
e2e/davinci-app/components/text.ts-  const input = document.createElement('input');
e2e/davinci-app/components/text.ts-
e2e/davinci-app/components/text.ts-  label.htmlFor = collectorKey;
e2e/davinci-app/components/text.ts-  label.innerText = collector.output.label;
--
e2e/davinci-app/components/password.ts-  Validator,
e2e/davinci-app/components/password.ts-} from '`@forgerock/davinci-client/types`';
e2e/davinci-app/components/password.ts:import { dotToCamelCase } from '../helper.js';
e2e/davinci-app/components/password.ts-
e2e/davinci-app/components/password.ts-const UPPERCASE_RE = /^[A-Z]+$/;
e2e/davinci-app/components/password.ts-const LOWERCASE_RE = /^[a-z]+$/;
e2e/davinci-app/components/password.ts-const DIGIT_RE = /^[0-9]+$/;
e2e/davinci-app/components/password.ts-
--
e2e/davinci-app/components/password.ts-  validator?: Validator,
e2e/davinci-app/components/password.ts-) {
e2e/davinci-app/components/password.ts:  const collectorKey = dotToCamelCase(collector.output.key);
e2e/davinci-app/components/password.ts-  const label = document.createElement('label');
e2e/davinci-app/components/password.ts-  const input = document.createElement('input');
e2e/davinci-app/components/password.ts-
e2e/davinci-app/components/password.ts-  label.htmlFor = collectorKey;
e2e/davinci-app/components/password.ts-  label.innerText = collector.output.label;


Script executed:

# Verify CSS.escape is available and check for any other selector uses
rg "querySelector" e2e/davinci-app/components/boolean.ts -n

Repository: ForgeRock/ping-javascript-sdk


Repository: ForgeRock/ping-javascript-sdk
Exit code: 0

stdout:

50:    const errorEl = formEl?.querySelector(`.${collectorKey}-error`);
63:      formEl?.querySelector(`#${collectorKey}`)?.after(errorEl);
65:      formEl.querySelector(`.${collectorKey}-error`)?.remove();


Escape collectorKey in querySelector selectors to handle keys with CSS-special characters.

Keys containing dots (e.g., from dotToCamelCase in other components) will break unescaped selectors. Use CSS.escape() for all querySelector id and class selectors at lines 50, 63, and 65.

🔧 Proposed fix
  const collectorKey = collector.output.key;
+  const selectorKey = CSS.escape(collectorKey);
@@
-    const errorEl = formEl?.querySelector(`.${collectorKey}-error`);
+    const errorEl = formEl?.querySelector(`.${selectorKey}-error`);
@@
-      formEl?.querySelector(`#${collectorKey}`)?.after(errorEl);
+      formEl?.querySelector(`#${selectorKey}`)?.after(errorEl);
@@
-      formEl.querySelector(`.${collectorKey}-error`)?.remove();
+      formEl.querySelector(`.${selectorKey}-error`)?.remove();
🤖 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 `@e2e/davinci-app/components/boolean.ts` at line 25, The code constructs DOM
selectors using the raw collectorKey (const collectorKey = collector.output.key)
and then passes it to document.querySelector for id/class selectors, which
breaks when keys contain CSS-special characters (e.g., dots); update each
querySelector call that uses collectorKey (the selectors around where
collectorKey is interpolated) to wrap the key with CSS.escape(collectorKey) when
building id or class selectors so the selectors are valid for any key value.


// Create a container for the checkbox
const containerDiv = document.createElement('div');
containerDiv.className = 'single-checkbox-container';

// Create a heading/label for the checkbox group
const groupLabel = document.createElement('div');
groupLabel.textContent = collector.output.label || 'Single Checkbox';
groupLabel.className = 'single-checkbox-label';
containerDiv.appendChild(groupLabel);

// Create checkboxes for each option
// Create a single checkbox
const wrapper = document.createElement('div');
wrapper.className = 'checkbox-wrapper';

const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.id = collector.output.key;
checkbox.name = collector.output.key || 'single-checkbox-field';
checkbox.id = collectorKey;
checkbox.name = collectorKey || 'single-checkbox-field';
checkbox.checked = collector.output.value;
checkbox.value = 'checked';

Expand All @@ -44,8 +45,25 @@ export default function booleanComponent(

// Add event listener to handle single-select behavior
checkbox.addEventListener('change', (event) => {
const target = event.target as HTMLInputElement;
updater(target.checked);
const checked = (event.target as HTMLInputElement).checked;
const result = validator(checked);
const errorEl = formEl?.querySelector(`.${collectorKey}-error`);

// Keep collector state aligned with the current UI value
const updateError = updater(checked);
if (updateError && 'error' in updateError) {
console.error(updateError.error.message);
}

// Validate the input
if (Array.isArray(result) && result.length && !errorEl) {
const errorEl = document.createElement('div');
errorEl.className = `${collectorKey}-error`;
errorEl.innerText = result.join(', ');
formEl?.querySelector(`#${collectorKey}`)?.after(errorEl);
} else {
formEl.querySelector(`.${collectorKey}-error`)?.remove();
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
});

wrapper.appendChild(checkbox);
Expand Down
2 changes: 1 addition & 1 deletion e2e/davinci-app/components/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function textComponent(
formEl: HTMLFormElement,
collector: TextCollector | ValidatedTextCollector,
updater: Updater<TextCollector | ValidatedTextCollector>,
validator: Validator,
validator: Validator<ValidatedTextCollector>,
) {
const collectorKey = dotToCamelCase(collector.output.key);
const label = document.createElement('label');
Expand Down
7 changes: 6 additions & 1 deletion e2e/davinci-app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,12 @@ const urlParams = new URLSearchParams(window.location.search);
} else if (collector.type === 'MultiSelectCollector') {
multiValueComponent(formEl, collector, davinciClient.update(collector));
} else if (collector.type === 'ValidatedBooleanCollector') {
booleanComponent(formEl, collector, davinciClient.update(collector));
booleanComponent(
formEl,
collector,
davinciClient.update(collector),
davinciClient.validate(collector),
);
}
});

Expand Down
9 changes: 6 additions & 3 deletions e2e/davinci-app/server-configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ export const serverConfigs: Record<string, DaVinciConfig> = {
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/.well-known/openid-configuration',
},
},
'60de77d5-dd2c-41ef-8c40-f8bb2381a359': {
clientId: '60de77d5-dd2c-41ef-8c40-f8bb2381a359',
/**
* Form Fields
*/
'e4ef2896-8d90-4abd-bf0f-7b8034995927': {
clientId: 'e4ef2896-8d90-4abd-bf0f-7b8034995927',
redirectUri: window.location.origin + '/',
scope: 'openid profile email name revoke',
serverConfig: {
wellknown:
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/.well-known/openid-configuration',
'https://auth.pingone.ca/356a254c-cba3-4ade-be1a-860136e8df01/as/.well-known/openid-configuration',
},
},
/**
Expand Down
41 changes: 36 additions & 5 deletions e2e/davinci-suites/src/form-fields.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { asyncEvents } from './utils/async-events.js';

test('Should render form fields', async ({ page }) => {
const { navigate } = asyncEvents(page);
await navigate('/?clientId=60de77d5-dd2c-41ef-8c40-f8bb2381a359');
await navigate('/?clientId=e4ef2896-8d90-4abd-bf0f-7b8034995927');

await expect(page.getByText('Select Test Form')).toBeVisible();
await expect(page.getByText('Select Form Fields Test Form')).toBeVisible();
await page.getByRole('button', { name: 'Form Fields' }).click();

await expect(page.getByText('Form Fields Test')).toBeVisible();
Expand All @@ -34,6 +34,32 @@ test('Should render form fields', async ({ page }) => {
await page.locator('#phone-number-input-1').fill('1234567890');
await page.locator('#extension-input-1').fill('7890');

// Rich text should render a link
await expect(page.getByRole('link', { name: 'Ping Identity' })).toBeVisible();
await expect(page.getByRole('link', { name: 'Ping Identity' })).toHaveAttribute(
'href',
'https://www.pingidentity.com',
);

// Agreement title and content should be visible
await expect(page.getByRole('heading', { name: 'Terms of Service Agreement' })).toBeVisible();
await expect(
page.getByText(
'This is example agreement text, you can edit this text in the agreements section.',
),
).toBeVisible();

// Single checkbox default value
await expect(page.locator('#single-checkbox-field')).not.toBeChecked();
await expect(page.getByText('I agree to the Terms and Conditions')).toBeVisible();

// Toggle the single checkbox and assert that it is optional by the abscence of an error message
await page.locator('#single-checkbox-field').check();
await expect(page.locator('#single-checkbox-field')).toBeChecked();
await page.locator('#single-checkbox-field').uncheck();
await expect(page.locator('#single-checkbox-field')).not.toBeChecked();
await expect(page.locator('.single-checkbox-field-error')).not.toBeAttached();

await expect(page.getByRole('button', { name: 'Flow Button' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Flow Link' })).toBeVisible();

Expand All @@ -53,20 +79,20 @@ test('Should render form fields', async ({ page }) => {
'checkbox-field-key': ['option1 value', 'option2 value'],
'dropdown-field-key': 'dropdown-option2-value',
'radio-group-key': 'option2 value',
'single-checkbox-field': false,
'combobox-field-key': ['option1 value', 'option3 value'],
'phone-field': {
phoneNumber: '1234567890',
countryCode: 'GB',
extension: '7890', // Tests PhoneNumberExtensionCollector
},
'single-checkbox-field': false,
});
});

test('should render form validation fields', async ({ page }) => {
await page.goto('http://localhost:5829/?clientId=60de77d5-dd2c-41ef-8c40-f8bb2381a359');
await page.goto('http://localhost:5829/?clientId=e4ef2896-8d90-4abd-bf0f-7b8034995927');

await expect(page.getByText('Select Test Form')).toBeVisible();
await expect(page.getByText('Select Form Fields Test Form')).toBeVisible();

await page.getByRole('button', { name: 'Form Validation' }).click();

Expand All @@ -80,4 +106,9 @@ test('should render form validation fields', async ({ page }) => {

await page.getByRole('textbox', { name: 'Email Address' }).fill('abc@email.com');
await expect(page.getByText('Not a valid email')).not.toBeVisible();

// Toggle the single checkbox to assert error message
await page.locator('#single-checkbox-field').check();
await page.locator('#single-checkbox-field').uncheck();
await expect(page.getByText('Select the checkbox to continue.')).toBeVisible();
});
54 changes: 26 additions & 28 deletions packages/davinci-client/api-report/davinci-client.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,11 @@ export function davinci<ActionType extends ActionTypes = ActionTypes>(input: {
resume: (input: {
continueToken: string;
}) => Promise<InternalErrorResponse | NodeStates>;
start: <QueryParams extends OutgoingQueryParams = OutgoingQueryParams>(options?: StartOptions<QueryParams> | undefined) => Promise<ContinueNode | ErrorNode | StartNode | SuccessNode | FailureNode>;
start: <QueryParams extends OutgoingQueryParams = OutgoingQueryParams>(options?: StartOptions<QueryParams> | undefined) => Promise<ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode>;
update: <T extends SingleValueCollectors | MultiSelectCollector | ObjectValueCollectors | AutoCollectors>(collector: T) => Updater<T>;
validate: (collector: SingleValueCollectors | ObjectValueCollectors | MultiValueCollectors | AutoCollectors) => Validator;
pollStatus: (collector: PollingCollector) => Poller;
getClient: () => {
status: "start";
} | {
action: string;
collectors: Collectors[];
description?: string;
Expand All @@ -302,22 +300,22 @@ export function davinci<ActionType extends ActionTypes = ActionTypes>(input: {
description?: string;
name?: string;
status: "error";
} | {
status: "failure";
} | {
status: "start";
} | {
authorization?: {
code?: string;
state?: string;
};
status: "success";
} | {
status: "failure";
} | null;
getCollectors: () => Collectors[];
getError: () => DaVinciError | null;
getErrorCollectors: () => CollectorErrors[];
getNode: () => ContinueNode | ErrorNode | StartNode | SuccessNode | FailureNode;
getNode: () => ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode;
getServer: () => {
status: "start";
} | {
_links?: Links;
id?: string;
interactionId?: string;
Expand All @@ -335,20 +333,22 @@ export function davinci<ActionType extends ActionTypes = ActionTypes>(input: {
} | {
_links?: Links;
eventName?: string;
href?: string;
id?: string;
interactionId?: string;
interactionToken?: string;
href?: string;
session?: string;
status: "success";
status: "failure";
} | {
status: "start";
} | {
_links?: Links;
eventName?: string;
href?: string;
id?: string;
interactionId?: string;
interactionToken?: string;
status: "failure";
href?: string;
session?: string;
status: "success";
} | null;
cache: {
getLatestResponse: () => ((state: RootState< {
Expand Down Expand Up @@ -382,14 +382,14 @@ export function davinci<ActionType extends ActionTypes = ActionTypes>(input: {
} & Omit<{
requestId: string;
data?: unknown;
error?: SerializedError | FetchBaseQueryError | undefined;
error?: FetchBaseQueryError | SerializedError | undefined;
endpointName: string;
startedTimeStamp: number;
fulfilledTimeStamp?: number;
}, "data" | "fulfilledTimeStamp"> & Required<Pick<{
requestId: string;
data?: unknown;
error?: SerializedError | FetchBaseQueryError | undefined;
error?: FetchBaseQueryError | SerializedError | undefined;
endpointName: string;
startedTimeStamp: number;
fulfilledTimeStamp?: number;
Expand All @@ -406,7 +406,7 @@ export function davinci<ActionType extends ActionTypes = ActionTypes>(input: {
} & {
requestId: string;
data?: unknown;
error?: SerializedError | FetchBaseQueryError | undefined;
error?: FetchBaseQueryError | SerializedError | undefined;
endpointName: string;
startedTimeStamp: number;
fulfilledTimeStamp?: number;
Expand All @@ -423,14 +423,14 @@ export function davinci<ActionType extends ActionTypes = ActionTypes>(input: {
} & Omit<{
requestId: string;
data?: unknown;
error?: SerializedError | FetchBaseQueryError | undefined;
error?: FetchBaseQueryError | SerializedError | undefined;
endpointName: string;
startedTimeStamp: number;
fulfilledTimeStamp?: number;
}, "error"> & Required<Pick<{
requestId: string;
data?: unknown;
error?: SerializedError | FetchBaseQueryError | undefined;
error?: FetchBaseQueryError | SerializedError | undefined;
endpointName: string;
startedTimeStamp: number;
fulfilledTimeStamp?: number;
Expand Down Expand Up @@ -477,14 +477,14 @@ export function davinci<ActionType extends ActionTypes = ActionTypes>(input: {
} & Omit<{
requestId: string;
data?: unknown;
error?: SerializedError | FetchBaseQueryError | undefined;
error?: FetchBaseQueryError | SerializedError | undefined;
endpointName: string;
startedTimeStamp: number;
fulfilledTimeStamp?: number;
}, "data" | "fulfilledTimeStamp"> & Required<Pick<{
requestId: string;
data?: unknown;
error?: SerializedError | FetchBaseQueryError | undefined;
error?: FetchBaseQueryError | SerializedError | undefined;
endpointName: string;
startedTimeStamp: number;
fulfilledTimeStamp?: number;
Expand All @@ -501,7 +501,7 @@ export function davinci<ActionType extends ActionTypes = ActionTypes>(input: {
} & {
requestId: string;
data?: unknown;
error?: SerializedError | FetchBaseQueryError | undefined;
error?: FetchBaseQueryError | SerializedError | undefined;
endpointName: string;
startedTimeStamp: number;
fulfilledTimeStamp?: number;
Expand All @@ -518,14 +518,14 @@ export function davinci<ActionType extends ActionTypes = ActionTypes>(input: {
} & Omit<{
requestId: string;
data?: unknown;
error?: SerializedError | FetchBaseQueryError | undefined;
error?: FetchBaseQueryError | SerializedError | undefined;
endpointName: string;
startedTimeStamp: number;
fulfilledTimeStamp?: number;
}, "error"> & Required<Pick<{
requestId: string;
data?: unknown;
error?: SerializedError | FetchBaseQueryError | undefined;
error?: FetchBaseQueryError | SerializedError | undefined;
endpointName: string;
startedTimeStamp: number;
fulfilledTimeStamp?: number;
Expand Down Expand Up @@ -1187,8 +1187,8 @@ value: Record<string, unknown>;
}, string>;

// @public
export const nodeCollectorReducer: Reducer<(ValidatedTextCollector | ValidatedBooleanCollector | ValidatedPasswordCollector | DeviceAuthenticationCollector | DeviceRegistrationCollector | PhoneNumberCollector | PhoneNumberExtensionCollector | ProtectCollector | FidoRegistrationCollector | FidoAuthenticationCollector | PollingCollector | TextCollector | PasswordCollector | SingleSelectCollector | UnknownCollector | IdpCollector | FlowCollector | SubmitCollector | ReadOnlyCollector | RichTextCollector | QrCodeCollector | AgreementCollector | ActionCollector<"ActionCollector"> | SingleValueCollector<"SingleValueCollector"> | MultiSelectCollector)[]> & {
getInitialState: () => (ValidatedTextCollector | ValidatedBooleanCollector | ValidatedPasswordCollector | DeviceAuthenticationCollector | DeviceRegistrationCollector | PhoneNumberCollector | PhoneNumberExtensionCollector | ProtectCollector | FidoRegistrationCollector | FidoAuthenticationCollector | PollingCollector | TextCollector | PasswordCollector | SingleSelectCollector | UnknownCollector | IdpCollector | FlowCollector | SubmitCollector | ReadOnlyCollector | RichTextCollector | QrCodeCollector | AgreementCollector | ActionCollector<"ActionCollector"> | SingleValueCollector<"SingleValueCollector"> | MultiSelectCollector)[];
export const nodeCollectorReducer: Reducer<(TextCollector | SingleSelectCollector | PasswordCollector | ValidatedPasswordCollector | ValidatedBooleanCollector | ValidatedTextCollector | ProtectCollector | PollingCollector | FidoRegistrationCollector | FidoAuthenticationCollector | DeviceAuthenticationCollector | DeviceRegistrationCollector | PhoneNumberCollector | PhoneNumberExtensionCollector | UnknownCollector | IdpCollector | FlowCollector | SubmitCollector | ReadOnlyCollector | RichTextCollector | QrCodeCollector | AgreementCollector | MultiSelectCollector | ActionCollector<"ActionCollector"> | SingleValueCollector<"SingleValueCollector">)[]> & {
getInitialState: () => (TextCollector | SingleSelectCollector | PasswordCollector | ValidatedPasswordCollector | ValidatedBooleanCollector | ValidatedTextCollector | ProtectCollector | PollingCollector | FidoRegistrationCollector | FidoAuthenticationCollector | DeviceAuthenticationCollector | DeviceRegistrationCollector | PhoneNumberCollector | PhoneNumberExtensionCollector | UnknownCollector | IdpCollector | FlowCollector | SubmitCollector | ReadOnlyCollector | RichTextCollector | QrCodeCollector | AgreementCollector | MultiSelectCollector | ActionCollector<"ActionCollector"> | SingleValueCollector<"SingleValueCollector">)[];
};

// @public (undocumented)
Expand Down Expand Up @@ -1670,9 +1670,7 @@ export type SingleCheckboxField = {
key: string;
label: string;
required: boolean;
validation?: {
errorMessage: string;
};
errorMessage?: string;
};

// @public (undocumented)
Expand Down
Loading
Loading