fix(ping-protect): fixes type for PIProtect.start() options object #573
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JIRA Ticket
N/A
Description
While working on a component to handle Ping One Protect using
@forgerock/javascript-sdk, I found that after updating to the latest version of@forgerock/ping-protect(eg.4.6.2) I starting to see unexpected TypeScript errors when I attempted to pull Ping One config from aPingOneProtectInitializeCallbackcallback viaPingOneProtectInitializeCallback.getConfig(). This is expected to return an object with the following type:This works fine in version
4.6.1of@forgerock/ping-protect, however in4.6.2when I attempt to pass the result ofPingOneProtectInitializeCallback.getConfig()toPIProtect.start(config)I get a TypeScript error becausePIProtect.start()is expecting the_typeand_actionfields. These fields are explicitly omitted in theInitConfiginterface inpackages/ping-protect/src/lib/ping-protect.ts.Here's a screenshot of the TypeScript error from VS Code.
Full error in plain text:
Did you add a changeset?
Yes a changeset has been included. I'm not sure if this is appropriate for a change like this (developer facing).