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
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"type": "commonjs",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be module

"name": "ping-javascript-sdk",
"version": "0.0.0",
"private": true,
Expand All @@ -22,9 +23,9 @@
"circular-dep-check": "madge --circular .",
"clean": "shx rm -rf ./{coverage,dist,docs,node_modules,tmp}/ ./{packages,e2e}/*/{dist,node_modules}/ ./e2e/node_modules/ && git clean -fX -e \"!.env*,nx-cloud.env\"",
"commit": "git cz",
"commitlint": "commitlint --edit",
"copyright:check": "node tools/copyright/sync-header-years.mjs --check",
"copyright:sync": "node tools/copyright/sync-header-years.mjs --fix",
"commitlint": "commitlint --edit",
"create-package": "nx g @nx/js:library",
"format": "pnpm nx format:write",
"generate-docs": "typedoc",
Expand All @@ -37,8 +38,8 @@
"nx": "nx",
"prepare": "lefthook install",
"serve": "nx serve",
"syncpack:lint": "syncpack lint --source 'package.json' --source 'packages/*/package.json' --source 'packages/sdk-effects/*/package.json' --source 'packages/utils/*/package.json' --source 'e2e/*/package.json' --source 'tools/*/package.json' --source 'scratchpad/package.json'",
"syncpack:fix": "syncpack fix --source 'package.json' --source 'packages/*/package.json' --source 'packages/sdk-effects/*/package.json' --source 'packages/utils/*/package.json' --source 'e2e/*/package.json' --source 'tools/*/package.json' --source 'scratchpad/package.json'",
"syncpack:lint": "syncpack lint --source 'package.json' --source 'packages/*/package.json' --source 'packages/sdk-effects/*/package.json' --source 'packages/utils/*/package.json' --source 'e2e/*/package.json' --source 'tools/*/package.json' --source 'scratchpad/package.json'",
"test": "CI=true nx affected:test",
"test:e2e": "CI=true nx affected:e2e",
"verdaccio": "nx local-registry",
Expand Down
94 changes: 94 additions & 0 deletions packages/davinci-client/api-report/davinci-client.fido.api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
## API Report File for "@forgerock/davinci-client"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import type { GenericError } from '@forgerock/sdk-types';

// @public (undocumented)
export interface AssertionValue extends Omit<PublicKeyCredential, 'rawId' | 'response' | 'getClientExtensionResults' | 'toJSON'> {
// (undocumented)
rawId: string;
// (undocumented)
response: {
clientDataJSON: string;
authenticatorData: string;
signature: string;
userHandle: string | null;
};
}

// @public (undocumented)
export interface AttestationValue extends Omit<PublicKeyCredential, 'rawId' | 'response' | 'getClientExtensionResults' | 'toJSON'> {
// (undocumented)
rawId: string;
// (undocumented)
response: {
clientDataJSON: string;
attestationObject: string;
};
}

// @public
export function fido(): FidoClient;

// @public (undocumented)
export interface FidoAuthenticationInputValue {
// (undocumented)
assertionValue?: AssertionValue;
}

// @public (undocumented)
export interface FidoAuthenticationOptions extends Omit<PublicKeyCredentialRequestOptions, 'challenge' | 'allowCredentials'> {
// (undocumented)
allowCredentials?: {
id: number[];
transports?: AuthenticatorTransport[];
type: PublicKeyCredentialType;
}[];
// (undocumented)
challenge: number[];
}

// @public (undocumented)
export interface FidoClient {
authenticate: (options: FidoAuthenticationOptions) => Promise<FidoAuthenticationInputValue | GenericError>;
register: (options: FidoRegistrationOptions) => Promise<FidoRegistrationInputValue | GenericError>;
}

// @public
export type FidoErrorCode = 'NotAllowedError' | 'AbortError' | 'InvalidStateError' | 'NotSupportedError' | 'SecurityError' | 'TimeoutError' | 'UnknownError';

// @public (undocumented)
export interface FidoRegistrationInputValue {
// (undocumented)
attestationValue?: AttestationValue;
}

// @public (undocumented)
export interface FidoRegistrationOptions extends Omit<PublicKeyCredentialCreationOptions, 'challenge' | 'user' | 'pubKeyCredParams' | 'excludeCredentials'> {
// (undocumented)
challenge: number[];
// (undocumented)
excludeCredentials?: {
id: number[];
transports?: AuthenticatorTransport[];
type: PublicKeyCredentialType;
}[];
// (undocumented)
pubKeyCredParams: {
alg: string | number;
type: PublicKeyCredentialType;
}[];
// (undocumented)
user: {
id: number[];
name: string;
displayName: string;
};
}

// (No @packageDocumentation comment for this package)

```
1 change: 1 addition & 0 deletions packages/davinci-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"type": "module",
"exports": {
".": "./dist/src/index.js",
"./fido": "./dist/src/lib/fido/index.js",
"./types": "./dist/src/types.d.ts"
},
"main": "./dist/src/index.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/davinci-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
* Copyright (c) 2025 - 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 { fido } from './lib/fido/fido.js';

// davinci is re-exported via types.ts
export { fido };
export { davinci } from './lib/client.store.js';

@vatsalparikh vatsalparikh Aug 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similarly, we can remove davinci export from https://github.com/ForgeRock/ping-javascript-sdk/blob/aj-fix-types/packages/davinci-client/src/types.ts#L37

There is no public API impact either because we exported everything from types.ts file anyway in index file, so removing it now from types.ts is just an internal change.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How did this even work to begin with? We were not exporting the client.store.js from the index file!?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this was because of the api-extractor code i added.

export { fido } from './lib/fido/fido.js';

export * from './types.js';
5 changes: 5 additions & 0 deletions packages/davinci-client/src/lib/fido/fido.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,8 @@ export type FidoErrorCode =
| 'SecurityError'
| 'TimeoutError'
| 'UnknownError';

// Re-export necessary FIDO types for package.json `./fido` entry point
export type { FidoRegistrationInputValue, FidoAuthenticationInputValue };
export type { FidoRegistrationOptions, FidoAuthenticationOptions };
export type { AttestationValue, AssertionValue } from '../collector.types.js';
10 changes: 10 additions & 0 deletions packages/davinci-client/src/lib/fido/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* 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.
*/

// Re-export FIDO module and types for package.json `./fido` entry point
export { fido } from './fido.js';
Comment thread
vatsalparikh marked this conversation as resolved.
export * from './fido.types.js';
Comment on lines +8 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Cover the new FIDO barrel before merging.

Codecov reports this changed file as uncovered, leaving patch coverage at 14.28571% against the 40% gate. Add a focused test that imports @forgerock/davinci-client/fido and exercises the exported fido path, with a compile-time import for the type re-exports.

🤖 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 `@packages/davinci-client/src/lib/fido/index.ts` around lines 8 - 10, Add
focused coverage for the FIDO barrel in index.ts by importing
`@forgerock/davinci-client/fido`, exercising the exported fido path, and adding a
compile-time import that validates the re-exported types from fido.types.js.

4 changes: 2 additions & 2 deletions packages/device-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
* Copyright (c) 2025 - 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.
*/
// deviceClient is re-exported via types.js
export { deviceClient } from './lib/device.store.js';

@vatsalparikh vatsalparikh Aug 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similarly, we can now remove the export of deviceClient from types.ts file. There is no public API impact either because we exported everything from types.ts file anyway in index file, so removing it now from types.ts is just an internal change.

https://github.com/ForgeRock/ping-javascript-sdk/blob/aj-fix-types/packages/device-client/src/types.ts#L10

export * from './types.js';
4 changes: 2 additions & 2 deletions packages/oidc-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
* Copyright (c) 2025 - 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.
*/
// oidc and createClientStore are re-exported via types.js
export { oidc } from './lib/client.store.js';

@vatsalparikh vatsalparikh Aug 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now that we're exporting oidc from index.ts file I think we can remove the oidc export from types.ts file. There is no public API impact either because we exported everything from types.ts file anyway in index file, so removing it now from types.ts is just an internal change.

https://github.com/ForgeRock/ping-javascript-sdk/blob/aj-fix-types/packages/oidc-client/src/types.ts#L24

export * from './types.js';
Loading